From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752388AbbLaUaq (ORCPT ); Thu, 31 Dec 2015 15:30:46 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34453 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751207AbbLaUan (ORCPT ); Thu, 31 Dec 2015 15:30:43 -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> Date: Thu, 31 Dec 2015 12:30:42 -0800 Message-ID: Subject: Re: [PATCHV5 3/3] x86, ras: Add __mcsafe_copy() function to recover from machine checks From: Tony Luck To: Andy Lutomirski 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 On Wed, Dec 30, 2015 at 3:32 PM, Tony Luck wrote: > Fifth is just a hack because I clearly didn't understand what I was > doing in parts 2&3 because my new class shows up as '3' not '1'! > > Andy: Can you explain the assembler/linker arithmetic for the class? Never mind ... figured it out. The fixup entry in the extable is: label - . + 0x2000000 - BIAS The "label - ." part evaluates to a smallish negative value (because the .fixup section is bundled in towards the end of .text, and the ex_table section comes right after. Then you add 0x20000000 to get a positive number, then *subtract* the BIAS. I'd picked BIAS = 0x40000000 thinking that would show up directly in class bits. But 0x1ffff000 - 0x40000000 is 0xdffff000 so bits 31 & 31 are both set, and this is class3 I switched to BIAS 0xC0000000 ... and now I get class 1 entries (bit31=0, bit30=1). New patch series coming soon. -Tony