29 Sep, 2009

1 commit

  • GCC provides reasonable memset/memcpy functions itself, with __builtin_memset
    and __builtin_memcpy. For the "unknown" cases, it'll fall back to our
    current existing functions, but for fixed size versions it'll inline
    something smart. Quite often that will be the same as we have now,
    but sometimes it can do something smarter (for example, if the code
    then sets the first member of a struct, it can do a shorter memset).

    In addition, and this is more important, gcc knows which registers and
    such are not clobbered (while for our asm version it pretty much
    acts like a compiler barrier), so for various cases it can avoid reloading
    values.

    The effect on codesize is shown below on my typical laptop .config:

    text data bss dec hex filename
    5605675 2041100 6525148 14171923 d83f13 vmlinux.before
    5595849 2041668 6525148 14162665 d81ae9 vmlinux.after

    Due to some not-so-good behavior in the gcc 3.x series, this change
    is only done for GCC 4.x and above.

    Signed-off-by: Arjan van de Ven
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Arjan van de Ven
     

21 Sep, 2009

1 commit


15 Jun, 2009

1 commit

  • The hooks that we modify are:
    - Page fault handler (to handle kmemcheck faults)
    - Debug exception handler (to hide pages after single-stepping
    the instruction that caused the page fault)

    Also redefine memset() to use the optimized version if kmemcheck is
    enabled.

    (Thanks to Pekka Enberg for minimizing the impact on the page fault
    handler.)

    As kmemcheck doesn't handle MMX/SSE instructions (yet), we also disable
    the optimized xor code, and rely instead on the generic C implementation
    in order to avoid false-positive warnings.

    Signed-off-by: Vegard Nossum

    [whitespace fixlet]
    Signed-off-by: Pekka Enberg
    Signed-off-by: Ingo Molnar

    [rebased for mainline inclusion]
    Signed-off-by: Vegard Nossum

    Vegard Nossum
     

23 Oct, 2008

2 commits