From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH] x86/extable: Add a comment about early exception handlers Date: Mon, 4 Apr 2016 18:16:34 +0200 Message-ID: <20160404161634.GH351@pd.tnic> References: <5f1dcd6919f4a5923959a8065cb2c04d9dac1412.1459784772.git.luto@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: X86 ML , Paolo Bonzini , Peter Zijlstra , KVM list , Arjan van de Ven , xen-devel , linux-kernel@vger.kernel.org, Linus Torvalds , Andrew Morton To: Andy Lutomirski Return-path: Received: from mail.skyhub.de ([78.46.96.112]:35420 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495AbcDDQQo (ORCPT ); Mon, 4 Apr 2016 12:16:44 -0400 Content-Disposition: inline In-Reply-To: <5f1dcd6919f4a5923959a8065cb2c04d9dac1412.1459784772.git.luto@kernel.org> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Apr 04, 2016 at 08:46:22AM -0700, Andy Lutomirski wrote: > Borislav asked for a comment explaining why all exception handlers are > allowed early. > > Signed-off-by: Andy Lutomirski > --- > 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; > > -- Thanks! Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.