All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/extable: Add a comment about early exception handlers
@ 2016-04-04 15:46 Andy Lutomirski
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Lutomirski @ 2016-04-04 15:46 UTC (permalink / raw)
  To: X86 ML
  Cc: KVM list, Peter Zijlstra, Linus Torvalds, linux-kernel,
	xen-devel, Borislav Petkov, Andy Lutomirski, Paolo Bonzini,
	Andrew Morton, Arjan van de Ven

Borislav asked for a comment explaining why all exception handlers are
allowed early.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/mm/extable.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
index 98b5f45d9d79..36fe03bc81ee 100644
--- a/arch/x86/mm/extable.c
+++ b/arch/x86/mm/extable.c
@@ -132,6 +132,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;
 
-- 
2.5.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] x86/extable: Add a comment about early exception handlers
@ 2016-04-04 15:46 Andy Lutomirski
  2016-04-04 16:16 ` Borislav Petkov
  2016-04-04 16:16 ` Borislav Petkov
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Lutomirski @ 2016-04-04 15:46 UTC (permalink / raw)
  To: X86 ML
  Cc: Paolo Bonzini, Peter Zijlstra, KVM list, Arjan van de Ven,
	xen-devel, linux-kernel, Linus Torvalds, Andrew Morton,
	Borislav Petkov, Andy Lutomirski

Borislav asked for a comment explaining why all exception handlers are
allowed early.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/mm/extable.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
index 98b5f45d9d79..36fe03bc81ee 100644
--- a/arch/x86/mm/extable.c
+++ b/arch/x86/mm/extable.c
@@ -132,6 +132,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;
 
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-04 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-04 15:46 [PATCH] x86/extable: Add a comment about early exception handlers Andy Lutomirski
  -- strict thread matches above, loose matches on Subject: below --
2016-04-04 15:46 Andy Lutomirski
2016-04-04 16:16 ` Borislav Petkov
2016-04-04 16:16 ` Borislav Petkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.