From mboxrd@z Thu Jan 1 00:00:00 1970 From: tip-bot for Andy Lutomirski Subject: [tip:x86/asm] x86/extable: Add a comment about early exception handlers Date: Wed, 13 Apr 2016 04:46:52 -0700 Message-ID: References: <5f1dcd6919f4a5923959a8065cb2c04d9dac1412.1459784772.git.luto@kernel.org> Reply-To: hpa@zytor.com, pbonzini@redhat.com, bp@suse.de, mingo@kernel.org, kvm@vger.kernel.org, Xen-devel@lists.xen.org, arjan@linux.intel.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, peterz@infradead.org, tglx@linutronix.de, boris.ostrovsky@oracle.com, torvalds@linux-foundation.org, luto@kernel.org, bp@alien8.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: hpa@zytor.com, pbonzini@redhat.com, bp@suse.de, mingo@kernel.org, Xen-devel@lists.xen.org, kvm@vger.kernel.org, arjan@linux.intel.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, tglx@linutronix.de, peterz@infradead.org, boris.ostrovsky@oracle.com, torvalds@linux-foundation.org, luto@kernel.org, bp@alien8.de To: linux-tip-commits@vger.kernel.org Return-path: In-Reply-To: <5f1dcd6919f4a5923959a8065cb2c04d9dac1412.1459784772.git.luto@kernel.org> Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Commit-ID: 60a0e2039e3df6c0a2b896bd78af36ff36fb629c Gitweb: http://git.kernel.org/tip/60a0e2039e3df6c0a2b896bd78af36ff36fb629c Author: Andy Lutomirski AuthorDate: Mon, 4 Apr 2016 08:46:22 -0700 Committer: Ingo Molnar CommitDate: Wed, 13 Apr 2016 11:37:47 +0200 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 Reviewed-by: Borislav Petkov Acked-by: Linus Torvalds Cc: Andrew Morton Cc: Arjan van de Ven Cc: Boris Ostrovsky Cc: Borislav Petkov Cc: KVM list Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: xen-devel Link: http://lkml.kernel.org/r/5f1dcd6919f4a5923959a8065cb2c04d9dac1412.1459784772.git.luto@kernel.org Signed-off-by: Ingo Molnar --- 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 fd9eb98..aaeda3f 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;