08 Jul, 2010

1 commit

  • We already have cpufeature indicies above 255, so use a 16-bit number
    for the alternatives index. This consumes a padding field and so
    doesn't add any size, but it means that abusing the padding field to
    create assembly errors on overflow no longer works. We can retain the
    test simply by redirecting it to the .discard section, however.

    [ v3: updated to include open-coded locations ]

    Signed-off-by: H. Peter Anvin
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    H. Peter Anvin
     

30 Dec, 2009

1 commit

  • In order to avoid unnecessary chains of branches, rather than
    implementing memcpy()/memset()'s access to their alternative
    implementations via a jump, patch the (larger) original function
    directly.

    The memcpy() part of this is slightly subtle: while alternative
    instruction patching does itself use memcpy(), with the
    replacement block being less than 64-bytes in size the main loop
    of the original function doesn't get used for copying memcpy_c()
    over memcpy(), and hence we can safely write over its beginning.

    Also note that the CFI annotations are fine for both variants of
    each of the functions.

    Signed-off-by: Jan Beulich
    Cc: Nick Piggin
    Cc: Linus Torvalds
    Cc: Andrew Morton
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Jan Beulich
     

11 Oct, 2007

1 commit