aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Lutomirski <[email protected]>2016-04-04 08:46:22 -0700
committerIngo Molnar <[email protected]>2016-04-13 11:37:47 +0200
commit60a0e2039e3df6c0a2b896bd78af36ff36fb629c (patch)
treea057af18b433a4217a0e1d43917cde8b701eecc8
parentb828b79fcced0e66492590707649dbfaea6435e6 (diff)
x86/extable: Add a comment about early exception handlers
Borislav asked for a comment explaining why all exception handlers are allowed early. Signed-off-by: Andy Lutomirski <[email protected]> Reviewed-by: Borislav Petkov <[email protected]> Acked-by: Linus Torvalds <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Arjan van de Ven <[email protected]> Cc: Boris Ostrovsky <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: KVM list <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: xen-devel <[email protected]> Link: http://lkml.kernel.org/r/5f1dcd6919f4a5923959a8065cb2c04d9dac1412.1459784772.git.luto@kernel.org Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r--arch/x86/mm/extable.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
index fd9eb98c4f58..aaeda3ffaafe 100644
--- a/arch/x86/mm/extable.c
+++ b/arch/x86/mm/extable.c
@@ -125,6 +125,20 @@ void __init early_fixup_exception(struct pt_regs *regs, int trapnr)
if (regs->cs != __KERNEL_CS)
goto fail;
+ /*
+ * The full exception fixup machinery is available as soon as
+ * the early IDT is loaded. This means that it is the
+ * responsibility of extable users to either function correctly
+ * when handlers are invoked early or to simply avoid causing
+ * exceptions before they're ready to handle them.
+ *
+ * This is better than filtering which handlers can be used,
+ * because refusing to call a handler here is guaranteed to
+ * result in a hard-to-debug panic.
+ *
+ * Keep in mind that not all vectors actually get here. Early
+ * fage faults, for example, are special.
+ */
if (fixup_exception(regs, trapnr))
return;