Re: [PATCH v14] x86, mce: Add memcpy_mcsafe()

2016-03-13 Thread Ingo Molnar
* Linus Torvalds wrote: > On Sat, Mar 12, 2016 at 9:16 AM, Ingo Molnar wrote: > > > > Please use the copy_*_user() memory copying API semantics, which are: return > > negative code (-EFAULT) on error, 0 on success. > > Those are the get_user/put_user() semantics. > > copy_*_user() has those a

Re: [PATCH v14] x86, mce: Add memcpy_mcsafe()

2016-03-12 Thread Linus Torvalds
On Sat, Mar 12, 2016 at 9:16 AM, Ingo Molnar wrote: > > Please use the copy_*_user() memory copying API semantics, which are: return > negative code (-EFAULT) on error, 0 on success. Those are the get_user/put_user() semantics. copy_*_user() has those annoying "bytes left uncopied" return values

Re: [PATCH v14] x86, mce: Add memcpy_mcsafe()

2016-03-12 Thread Ingo Molnar
* Tony Luck wrote: > On Thu, Mar 10, 2016 at 11:37 AM, Luck, Tony wrote: > >> But you return 0 == false for success and 1 == true for failure. > > > > Aaargh! -ETOOMUCHSHELLSCRIPTPROGRAMMING > > > > -Tony > > Options to fix this: > 1) Just change the comments in the code. > This seems li

Re: [PATCH v14] x86, mce: Add memcpy_mcsafe()

2016-03-11 Thread Dan Williams
On Fri, Mar 11, 2016 at 2:10 PM, Tony Luck wrote: > On Thu, Mar 10, 2016 at 11:37 AM, Luck, Tony wrote: >>> But you return 0 == false for success and 1 == true for failure. >> >> Aaargh! -ETOOMUCHSHELLSCRIPTPROGRAMMING >> >> -Tony > > Options to fix this: > 1) Just change the comments in the cod

Re: [PATCH v14] x86, mce: Add memcpy_mcsafe()

2016-03-11 Thread Tony Luck
On Thu, Mar 10, 2016 at 11:37 AM, Luck, Tony wrote: >> But you return 0 == false for success and 1 == true for failure. > > Aaargh! -ETOOMUCHSHELLSCRIPTPROGRAMMING > > -Tony Options to fix this: 1) Just change the comments in the code. This seems like it would confuse people as I thing most

RE: [PATCH v14] x86, mce: Add memcpy_mcsafe()

2016-03-10 Thread Luck, Tony
> But you return 0 == false for success and 1 == true for failure. Aaargh! -ETOOMUCHSHELLSCRIPTPROGRAMMING -Tony

Re: [PATCH v14] x86, mce: Add memcpy_mcsafe()

2016-03-10 Thread Mika Penttilä
On 18.02.2016 21:47, Tony Luck wrote: > Make use of the EXTABLE_FAULT exception table entries to write > a kernel copy routine that doesn't crash the system if it > encounters a machine check. Prime use case for this is to copy > from large arrays of non-volatile memory used as storage. > > We ha

Re: [PATCH v14] x86, mce: Add memcpy_mcsafe()

2016-03-02 Thread Luck, Tony
On Thu, Feb 18, 2016 at 11:47:26AM -0800, Tony Luck wrote: > Make use of the EXTABLE_FAULT exception table entries to write > a kernel copy routine that doesn't crash the system if it > encounters a machine check. Prime use case for this is to copy > from large arrays of non-volatile memory used as