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

From: Ingo Molnar
Date: Thu Feb 18 2016 - 15:14:51 EST



* Luck, Tony <tony.luck@xxxxxxxxx> wrote:

> On Thu, Feb 18, 2016 at 10:12:42AM -0800, Linus Torvalds wrote:
> > On Wed, Feb 17, 2016 at 10:20 AM, Tony Luck <tony.luck@xxxxxxxxx> 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.
>
> First user is libnvdimm. Dan Williams already has code to use this so that
> kernel code accessing persistent memory can return -EIO to a user instead of
> crashing the system if the cpu runs into an uncorrected error during the copy.

Are these the memcpy_*_pmem() calls in drivers/nvdimm/pmem.c? Is there any actual
patch to look at?

Thanks,

Ingo