Re: [PATCH v10 3/4] x86, mce: Add __mcsafe_copy()

2016-02-10 Thread Borislav Petkov
On Wed, Feb 10, 2016 at 11:39:05AM -0800, Luck, Tony wrote: > On Wed, Feb 10, 2016 at 11:58:43AM +0100, Borislav Petkov wrote: > > But one could take out that function do some microbenchmarking with > > different sizes and once with the current version and once with the > > pushes and pops of r1[2-

Re: [PATCH v10 3/4] x86, mce: Add __mcsafe_copy()

2016-02-10 Thread Luck, Tony
On Wed, Feb 10, 2016 at 11:58:43AM +0100, Borislav Petkov wrote: > But one could take out that function do some microbenchmarking with > different sizes and once with the current version and once with the > pushes and pops of r1[2-5] to see where the breakeven is. On a 4K page copy from a source a

Re: [PATCH v10 3/4] x86, mce: Add __mcsafe_copy()

2016-02-10 Thread Borislav Petkov
On Tue, Feb 09, 2016 at 03:15:57PM -0800, Luck, Tony wrote: > > You can save yourself this MOV here in what is, I'm assuming, the > > general likely case where @src is aligned and do: > > > > /* check for bad alignment of source */ > > testl $7, %esi > > /* already aligned?

Re: [PATCH v10 3/4] x86, mce: Add __mcsafe_copy()

2016-02-09 Thread Luck, Tony
> You can save yourself this MOV here in what is, I'm assuming, the > general likely case where @src is aligned and do: > > /* check for bad alignment of source */ > testl $7, %esi > /* already aligned? */ > jz 102f > > movl %esi,%ecx > subl $8,%ecx

Re: [PATCH v10 3/4] x86, mce: Add __mcsafe_copy()

2016-02-07 Thread Richard Weinberger
Am 07.02.2016 um 17:55 schrieb Borislav Petkov: > due to those > >> + _ASM_EXTABLE_FAULT(0b,30b) >> + _ASM_EXTABLE_FAULT(1b,31b) >> + _ASM_EXTABLE_FAULT(2b,32b) >> + _ASM_EXTABLE_FAULT(3b,33b) >> + _ASM_EXTABLE_FAULT(4b,34b) > > things below and that's because ex_handler_fault

Re: [PATCH v10 3/4] x86, mce: Add __mcsafe_copy()

2016-02-07 Thread Borislav Petkov
On Fri, Jan 08, 2016 at 01:18:03PM -0800, Tony Luck wrote: > Make use of the EXTABLE_FAULT exception table entries. This routine > returns a structure to indicate the result of the copy: > > struct mcsafe_ret { > u64 trapnr; > u64 remain; > }; > > If the copy is successful, then b

Re: [PATCH v10 3/4] x86, mce: Add __mcsafe_copy()

2016-02-07 Thread Borislav Petkov
On Fri, Jan 08, 2016 at 01:18:03PM -0800, Tony Luck wrote: > Make use of the EXTABLE_FAULT exception table entries. This routine > returns a structure to indicate the result of the copy: > > struct mcsafe_ret { > u64 trapnr; > u64 remain; > }; > > If the copy is successful, then b

[PATCH v10 3/4] x86, mce: Add __mcsafe_copy()

2016-02-04 Thread Tony Luck
Make use of the EXTABLE_FAULT exception table entries. This routine returns a structure to indicate the result of the copy: struct mcsafe_ret { u64 trapnr; u64 remain; }; If the copy is successful, then both 'trapnr' and 'remain' are zero. If we faulted during the copy, then 'tra