From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752626AbcAFMgK (ORCPT ); Wed, 6 Jan 2016 07:36:10 -0500 Received: from mail.skyhub.de ([78.46.96.112]:34320 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751777AbcAFMgJ (ORCPT ); Wed, 6 Jan 2016 07:36:09 -0500 Date: Wed, 6 Jan 2016 13:36:04 +0100 From: Borislav Petkov To: Tony Luck Cc: Ingo Molnar , Andrew Morton , Andy Lutomirski , Dan Williams , elliott@hpe.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@ml01.01.org, x86@kernel.org Subject: Re: [PATCH v7 1/3] x86: Add classes to exception tables Message-ID: <20160106123604.GD19507@pd.tnic> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 30, 2015 at 09:59:29AM -0800, Tony Luck wrote: > Starting with a patch from Andy Lutomirski > that used linker relocation trickery to free up a couple of bits > in the "fixup" field of the exception table (and generalized the > uaccess_err hack to use one of the classes). > > This patch allocates another one of the classes to provide > a mechanism to provide the fault number to the fixup code > in %rax. > > Still one free class for the next brilliant idea. If more are > needed it should be possible to squeeze another bit or three > extending the same technique. > > Originally-from: Andy Lutomirski > Signed-off-by: Tony Luck > --- > arch/x86/include/asm/asm.h | 102 +++++++++++++++++++++++++++++++---------- > arch/x86/include/asm/uaccess.h | 17 +++++-- > arch/x86/kernel/kprobes/core.c | 2 +- > arch/x86/kernel/traps.c | 6 +-- > arch/x86/mm/extable.c | 66 ++++++++++++++++++-------- > arch/x86/mm/fault.c | 2 +- > 6 files changed, 142 insertions(+), 53 deletions(-) ... > @@ -699,7 +699,7 @@ static void math_error(struct pt_regs *regs, int error_code, int trapnr) > conditional_sti(regs); > > if (!user_mode(regs)) { > - if (!fixup_exception(regs)) { > + if (!fixup_exception(regs, X86_TRAP_DE)) { Whatever we end up doing, this needs to be trapnr above and not X86_TRAP_DE. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.