OSDN Git Service

x86/mm: Expand the exception table logic to allow new handling options
authorTony Luck <tony.luck@intel.com>
Wed, 17 Feb 2016 18:20:12 +0000 (10:20 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2016 10:14:00 +0000 (04:14 -0600)
commitfcf5e5198b447969ed2a56ec335dae3c695a6b46
tree7dc34bac6282e79106ced2743d37fbc543ccd82e
parent90bc49cd66f5cf28f3b1d5bf4621e5569c1b4901
x86/mm: Expand the exception table logic to allow new handling options

commit 548acf19234dbda5a52d5a8e7e205af46e9da840 upstream.

Huge amounts of help from  Andy Lutomirski and Borislav Petkov to
produce this. Andy provided the inspiration to add classes to the
exception table with a clever bit-squeezing trick, Boris pointed
out how much cleaner it would all be if we just had a new field.

Linus Torvalds blessed the expansion with:

  ' I'd rather not be clever in order to save just a tiny amount of space
    in the exception table, which isn't really criticial for anybody. '

The third field is another relative function pointer, this one to a
handler that executes the actions.

We start out with three handlers:

 1: Legacy - just jumps the to fixup IP
 2: Fault - provide the trap number in %ax to the fixup code
 3: Cleaned up legacy for the uaccess error hack

Signed-off-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/f6af78fcbd348cf4939875cfda9c19689b5e50b8.1455732970.git.tony.luck@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/x86/exception-tables.txt
arch/x86/include/asm/asm.h
arch/x86/include/asm/uaccess.h
arch/x86/kernel/kprobes/core.c
arch/x86/kernel/traps.c
arch/x86/mm/extable.c
arch/x86/mm/fault.c
scripts/sortextable.c