• Linus Torvalds's avatar
    x86: simplify load_unaligned_zeropad() implementation · c4e34dd9
    Linus Torvalds authored
    The exception for the "unaligned access at the end of the page, next
    page not mapped" never happens, but the fixup code ends up causing
    trouble for compilers to optimize well.
    
    clang in particular ends up seeing it being in the middle of a loop, and
    tries desperately to optimize the exception fixup code that is never
    really reached.
    
    The simple solution is to just move all the fixups into the exception
    handler itself, which moves it all out of the hot case code, and means
    that the compiler never sees it or needs to worry about it.
    Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    c4e34dd9
word-at-a-time.h 2.3 KB