lkml.org 
[lkml]   [2016]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v11 3/4] x86, mce: Add __mcsafe_copy()
From
On Wed, Feb 17, 2016 at 10:20 AM, Tony Luck <tony.luck@intel.com> wrote:
>
> If we faulted during the copy, then 'trapnr' will say which type
> of trap (X86_TRAP_PF or X86_TRAP_MC) and 'remain' says how many
> bytes were not copied.

So apart from the naming, a couple of questions:

- I'd like to see the actual *use* case explained, not just what it does.

- why does this use the complex - and slower, on modern machines -
unrolled manual memory copy, when you might as well just use a single

rep ; movsb

which not only makes it smaller, but makes the exception fixup trivial.

- why not make the "bytes remaining" the same as for a user-space
copy (ie return it as the return value)?

- at that point, it ends up looking a *lot* like uaccess_try/catch,
which gets the error code from current_thread_info()->uaccess_err

Hmm?

Linus

\
 
 \ /
  Last update: 2016-02-18 19:41    [W:1.746 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site