x86: add hooks for kmemcheck
authorVegard Nossum <vegard.nossum@gmail.com>
Thu, 3 Apr 2008 22:53:23 +0000 (00:53 +0200)
committerVegard Nossum <vegard.nossum@gmail.com>
Mon, 15 Jun 2009 10:40:02 +0000 (12:40 +0200)
commitf85612967c93b67b10dd240e3e8bf8a0eee9def7
tree184a70bc888b35235ee0b1805a06f90fd45295d8
parentf8b4ece2a94693b7d2dd32ea716cb92545b5dce6
x86: add hooks for kmemcheck

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 <vegardno@ifi.uio.no>
[whitespace fixlet]
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
[rebased for mainline inclusion]
Signed-off-by: Vegard Nossum <vegardno@ifi.uio.no>
arch/x86/include/asm/string_32.h
arch/x86/include/asm/string_64.h
arch/x86/include/asm/xor.h
arch/x86/kernel/cpu/intel.c
arch/x86/kernel/traps.c
arch/x86/mm/fault.c
arch/x86/mm/init.c
arch/x86/mm/init_32.c