Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-15 Thread Borislav Petkov
On Tue, Dec 15, 2015 at 10:46:53AM +0100, Borislav Petkov wrote: > I think what is more important is that this should be in the > x86-specific linker script, not in the generic one. And related to that, I think all those additions to kernel/extable.c should be somewhere in arch/x86/ and not in

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-15 Thread Borislav Petkov
On Mon, Dec 14, 2015 at 05:00:59PM -0800, Luck, Tony wrote: > Not sure what the "whatnot" would be though. Making it depend on > X86_MCE should keep it out of the tiny configurations. By the time > you have MCE support, this seems like a pretty small incremental > change. Ok, so it is called

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-15 Thread Borislav Petkov
On Mon, Dec 14, 2015 at 05:00:59PM -0800, Luck, Tony wrote: > Not sure what the "whatnot" would be though. Making it depend on > X86_MCE should keep it out of the tiny configurations. By the time > you have MCE support, this seems like a pretty small incremental > change. Ok, so it is called

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-15 Thread Borislav Petkov
On Tue, Dec 15, 2015 at 10:46:53AM +0100, Borislav Petkov wrote: > I think what is more important is that this should be in the > x86-specific linker script, not in the generic one. And related to that, I think all those additions to kernel/extable.c should be somewhere in arch/x86/ and not in

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-14 Thread Luck, Tony
On Sat, Dec 12, 2015 at 11:11:42AM +0100, Borislav Petkov wrote: > > +config MCE_KERNEL_RECOVERY > > + depends on X86_MCE && X86_64 > > + def_bool y > > Shouldn't that depend on NVDIMM or whatnot? Looks too generic now. Not sure what the "whatnot" would be though. Making it depend on

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-14 Thread Borislav Petkov
On Mon, Dec 14, 2015 at 10:58:45AM -0700, Ross Zwisler wrote: > With this code if CONFIG_MCE_KERNEL_RECOVERY isn't defined you'll get > a compiler error that the function doesn't have a return statement, > right? I think we need an #else to return NULL, or to have the #ifdef > encompass the whole

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-14 Thread Ross Zwisler
On Sat, Dec 12, 2015 at 3:11 AM, Borislav Petkov wrote: > On Thu, Dec 10, 2015 at 01:58:04PM -0800, Tony Luck wrote: <> >> +#ifdef CONFIG_MCE_KERNEL_RECOVERY >> +/* Given an address, look for it in the machine check exception tables. */ >> +const struct exception_table_entry

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-14 Thread Luck, Tony
On Sat, Dec 12, 2015 at 11:11:42AM +0100, Borislav Petkov wrote: > > +config MCE_KERNEL_RECOVERY > > + depends on X86_MCE && X86_64 > > + def_bool y > > Shouldn't that depend on NVDIMM or whatnot? Looks too generic now. Not sure what the "whatnot" would be though. Making it depend on

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-14 Thread Ross Zwisler
On Sat, Dec 12, 2015 at 3:11 AM, Borislav Petkov wrote: > On Thu, Dec 10, 2015 at 01:58:04PM -0800, Tony Luck wrote: <> >> +#ifdef CONFIG_MCE_KERNEL_RECOVERY >> +/* Given an address, look for it in the machine check exception tables. */ >> +const struct exception_table_entry

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-14 Thread Borislav Petkov
On Mon, Dec 14, 2015 at 10:58:45AM -0700, Ross Zwisler wrote: > With this code if CONFIG_MCE_KERNEL_RECOVERY isn't defined you'll get > a compiler error that the function doesn't have a return statement, > right? I think we need an #else to return NULL, or to have the #ifdef > encompass the whole

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-12 Thread Borislav Petkov
On Thu, Dec 10, 2015 at 01:58:04PM -0800, Tony Luck wrote: > Copy the existing page fault fixup mechanisms to create a new table > to be used when fixing machine checks. Note: > 1) At this time we only provide a macro to annotate assembly code > 2) We assume all fixups will in code builtin to the

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-12 Thread Borislav Petkov
On Thu, Dec 10, 2015 at 01:58:04PM -0800, Tony Luck wrote: > Copy the existing page fault fixup mechanisms to create a new table > to be used when fixing machine checks. Note: > 1) At this time we only provide a macro to annotate assembly code > 2) We assume all fixups will in code builtin to the

RE: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-11 Thread Luck, Tony
>> + regs->ip = new_ip; >> + regs->ax = BIT(63) | addr; > > Can this be an actual #define? Doh! Yes, of course. That would be much better. Now I need to think of a good name for it. -Tony

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-11 Thread Andy Lutomirski
On Thu, Dec 10, 2015 at 1:58 PM, Tony Luck wrote: > Copy the existing page fault fixup mechanisms to create a new table > to be used when fixing machine checks. Note: > 1) At this time we only provide a macro to annotate assembly code > 2) We assume all fixups will in code builtin to the kernel.

[PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-11 Thread Tony Luck
Copy the existing page fault fixup mechanisms to create a new table to be used when fixing machine checks. Note: 1) At this time we only provide a macro to annotate assembly code 2) We assume all fixups will in code builtin to the kernel. 3) Only for x86_64 4) New code under

Re: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-11 Thread Andy Lutomirski
On Thu, Dec 10, 2015 at 1:58 PM, Tony Luck wrote: > Copy the existing page fault fixup mechanisms to create a new table > to be used when fixing machine checks. Note: > 1) At this time we only provide a macro to annotate assembly code > 2) We assume all fixups will in code

[PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-11 Thread Tony Luck
Copy the existing page fault fixup mechanisms to create a new table to be used when fixing machine checks. Note: 1) At this time we only provide a macro to annotate assembly code 2) We assume all fixups will in code builtin to the kernel. 3) Only for x86_64 4) New code under

RE: [PATCHV2 1/3] x86, ras: Add new infrastructure for machine check fixup tables

2015-12-11 Thread Luck, Tony
>> + regs->ip = new_ip; >> + regs->ax = BIT(63) | addr; > > Can this be an actual #define? Doh! Yes, of course. That would be much better. Now I need to think of a good name for it. -Tony