kmemcheck: add opcode self-testing at boot
authorVegard Nossum <vegard.nossum@gmail.com>
Fri, 27 Feb 2009 10:35:55 +0000 (11:35 +0100)
committerVegard Nossum <vegard.nossum@gmail.com>
Mon, 15 Jun 2009 13:49:22 +0000 (15:49 +0200)
commitac61a7579625ddfca3b2e0aa298879a94d15884d
treeadb11c2513bfdb4825e1ac213f8116d7280ac4a9
parenteb63657e1314ae4af5e19a61db8dc1b6e935775a
kmemcheck: add opcode self-testing at boot

We've had some troubles in the past with weird instructions. This
patch adds a self-test framework which can be used to verify that
a certain set of opcodes are decoded correctly. Of course, the
opcodes which are not tested can still give the wrong results.

In short, this is just a safeguard to catch unintentional changes
in the opcode decoder. It does not mean that errors can't still
occur!

[rebased for mainline inclusion]
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
arch/x86/mm/kmemcheck/Makefile
arch/x86/mm/kmemcheck/kmemcheck.c
arch/x86/mm/kmemcheck/selftest.c [new file with mode: 0644]
arch/x86/mm/kmemcheck/selftest.h [new file with mode: 0644]