Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752120AbbL0MTT (ORCPT ); Sun, 27 Dec 2015 07:19:19 -0500 Received: from mail-ob0-f179.google.com ([209.85.214.179]:33538 "EHLO mail-ob0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751621AbbL0MTD (ORCPT ); Sun, 27 Dec 2015 07:19:03 -0500 MIME-Version: 1.0 In-Reply-To: References: <20151224214632.GF4128@pd.tnic> <20151225114937.GA862@pd.tnic> <5FBC1CF1-095B-466D-85D6-832FBFA98364@intel.com> <20151226103252.GA21988@pd.tnic> From: Andy Lutomirski Date: Sun, 27 Dec 2015 04:18:42 -0800 Message-ID: Subject: Re: [PATCHV5 3/3] x86, ras: Add __mcsafe_copy() function to recover from machine checks To: Tony Luck Cc: Borislav Petkov , linux-nvdimm , X86 ML , "elliott@hpe.com" , "linux-mm@kvack.org" , Andrew Morton , "Williams, Dan J" , Ingo Molnar , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1534 Lines: 34 On Sat, Dec 26, 2015 at 10:57 PM, Tony Luck wrote: > On Sat, Dec 26, 2015 at 6:16 PM, Andy Lutomirski wrote: >>>> We could make one of them 31-bits (since even an "allyesconfig" kernel >>>> is still much smaller than a gigabyte) to free a bit for a flag. But there >>>> are those external tools to pre-sort exception tables that would all >>>> need to be fixed too. >> >> Wait, why? The external tools sort by source address, and we'd >> squeeze the flag into the target address, no? > > I was thinking that we'd need to recompute the fixup when we move > the entry to its new sorted location. So that: > > ex_fixup_addr(const struct exception_table_entry *x) > { > return (unsigned long)&x->fixup + x->fixup; > } > > will get the right value. Maybe this would still work out > if the fixup is a 31-bit value plus a flag, but the external > tool thinks it is a 32-bit value? I'd have to ponder that. I think I can save you some pondering. This old patch gives two flag bits. Feel free to borrow the patch, but you'll probably want to change the _EXTABLE_CLASS_XYZ macros: https://git.kernel.org/cgit/linux/kernel/git/luto/linux.git/commit/?h=strict_uaccess_fixups/patch_v1&id=16644d9460fc6531456cf510d5efc57f89e5cd34 --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/