Re: [PATCH v2 4/9] x86, memcpy_mcsafe: add write-protection-fault handling

2018-05-02 Thread Mika Penttilä
On 05/03/2018 07:59 AM, Dan Williams wrote: > In preparation for using memcpy_mcsafe() to handle user copies it needs > to be to handle write-protection faults while writing user pages. Add > MMU-fault handlers alongside the machine-check exception handlers. > > Note that the machine check fault

[PATCH v2 4/9] x86, memcpy_mcsafe: add write-protection-fault handling

2018-05-02 Thread Dan Williams
In preparation for using memcpy_mcsafe() to handle user copies it needs to be to handle write-protection faults while writing user pages. Add MMU-fault handlers alongside the machine-check exception handlers. Note that the machine check fault exception handling makes assumptions about source

[PATCH v2 6/9] dax: introduce a ->copy_to_iter dax operation

2018-05-02 Thread Dan Williams
Similar to the ->copy_from_iter() operation, a platform may want to deploy an architecture or device specific routine for handling reads from a dax_device like /dev/pmemX. On x86 this routine will point to a machine check safe version of copy_to_iter(). For now, add the plumbing to device-mapper

[PATCH v2 8/9] pmem: switch to copy_to_iter_mcsafe()

2018-05-02 Thread Dan Williams
Use the machine check safe version of copy_to_iter() for the ->copy_to_iter() operation published by the pmem driver. Signed-off-by: Dan Williams --- drivers/nvdimm/pmem.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvdimm/pmem.c

[PATCH v2 5/9] x86, memcpy_mcsafe: define copy_to_iter_mcsafe()

2018-05-02 Thread Dan Williams
Use the updated memcpy_mcsafe() implementation to define copy_user_mcsafe() and copy_to_iter_mcsafe(). The most significant difference from typical copy_to_iter() is that the ITER_KVEC and ITER_BVEC iterator types can fail to complete a full transfer. Cc: Cc: Ingo Molnar

[PATCH v2 9/9] x86, nfit_test: unit test for memcpy_mcsafe()

2018-05-02 Thread Dan Williams
Given the fact that the ACPI "EINJ" (error injection) facility is not universally available, implement software infrastructure to validate the memcpy_mcsafe() exception handling implementation. For each potential read exception point in memcpy_mcsafe(), inject a emulated exception point at the

[PATCH v2 7/9] dax: report bytes remaining in dax_iomap_actor()

2018-05-02 Thread Dan Williams
In preparation for protecting the dax read(2) path from media errors with copy_to_iter_mcsafe() (via dax_copy_to_iter()), convert the implementation to report the bytes successfully transferred. Cc: Cc: Ingo Molnar Cc: Borislav Petkov Cc: Tony

[PATCH v2 3/9] x86, memcpy_mcsafe: return bytes remaining

2018-05-02 Thread Dan Williams
Machine check safe memory copies are currently deployed in the pmem driver whenever reading from persistent memory media, so that -EIO is returned rather than triggering a kernel panic. While this protects most pmem accesses, it is not complete in the filesystem-dax case. When filesystem-dax is

[PATCH v2 2/9] x86, memcpy_mcsafe: add labels for write fault handling

2018-05-02 Thread Dan Williams
The memcpy_mcsafe() implementation handles CPU exceptions when reading from the source address. Before it can be used for user copies it needs to grow support for handling write faults. In preparation for adding that exception handling update the labels for the read cache word X case (.L_cache_rX)

[PATCH v2 0/9] use memcpy_mcsafe() for copy_to_iter()

2018-05-02 Thread Dan Williams
Changes since v1 [1]: * Remove the loop unrolling in the assembly implementation since it significantly complicates the exception handling (Linus) * Introduce a ->copy_to_iter() dax operation for symmetry with the existing ->copy_from_iter() operation to allow platform / device-specific

Re: [PATCH v2] ndctl, filter: fix "keyword 'all' is ignored" in util__filter()

2018-05-02 Thread Verma, Vishal L
On Thu, 2018-04-26 at 09:56 +0900, QI Fuli wrote: > This is a follow up patch for commit c70adc3cf6bf ("ndctl, filter: > refactor > util__filter() to support multiple space-seperated arguments") > refactored util__filter() to support multiple space-seperated > arguments. > But, when the keyword

Re: [PATCH] pmem: fix badblocks population for raw mode

2018-05-02 Thread Jeff Moyer
Toshi Kani writes: > pmem_attach_disk() calls nvdimm_badblocks_populate() with resource > range uninitialized in the case of raw mode. This leads the pmem > driver to hit MCE despite of ARS reporting the range bad. > > Initialize 'bb_res' for raw mode. > > Fixes:

转发linux-nvdimm:如何让客户及满意,不抱怨,不投诉

2018-05-02 Thread 致企业的一封信
7:29:20 *详 - 情 - 见 - 附 - 件* ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 0/6] use memcpy_mcsafe() for copy_to_iter()

2018-05-02 Thread Dan Williams
On Wed, May 2, 2018 at 9:19 AM, Andy Lutomirski wrote: > On Tue, May 1, 2018 at 8:34 PM Linus Torvalds > > wrote: > >> On Tue, May 1, 2018 at 8:22 PM Dan Williams >> wrote: > >> > All that to say that having a typical RAM

Re: [PATCH 0/6] use memcpy_mcsafe() for copy_to_iter()

2018-05-02 Thread Andy Lutomirski
On Tue, May 1, 2018 at 8:34 PM Linus Torvalds wrote: > On Tue, May 1, 2018 at 8:22 PM Dan Williams > wrote: > > All that to say that having a typical RAM page covering poisoned pmem > > would complicate the 'clear badblocks'

Re: [PATCH v4 00/14] Copy Offload in NVMe Fabrics with P2P PCI Memory

2018-05-02 Thread Logan Gunthorpe
Hi Christian, On 5/2/2018 5:51 AM, Christian König wrote: it would be rather nice to have if you could separate out the functions to detect if peer2peer is possible between two devices. This would essentially be pci_p2pdma_distance() in the existing patchset. It returns the sum of the

Re: [RESEND 2/3] powerpc/memcpy: Add memcpy_mcsafe for pmem

2018-05-02 Thread Balbir Singh
On Wed, May 2, 2018 at 6:57 AM, Dan Williams wrote: > On Thu, Apr 5, 2018 at 8:00 AM, Dan Williams wrote: >> On Wed, Apr 4, 2018 at 11:45 PM, Nicholas Piggin wrote: > [,,] >>> What's the problem with just counting bytes

Re: [PATCH v4 00/14] Copy Offload in NVMe Fabrics with P2P PCI Memory

2018-05-02 Thread Christian König
Hi Logan, it would be rather nice to have if you could separate out the functions to detect if peer2peer is possible between two devices. That would allow me to reuse the same logic for GPU peer2peer where I don't really have ZONE_DEVICE. Regards, Christian. Am 24.04.2018 um 01:30 schrieb

Re: [PATCH 0/6] use memcpy_mcsafe() for copy_to_iter()

2018-05-02 Thread Borislav Petkov
On Tue, May 01, 2018 at 07:25:57PM -0700, Dan Williams wrote: > Right, but the only way to make MCE non-fatal is to teach the machine > check handler about recoverable conditions. This patch teaches the > machine check handler how to recover copy_to_iter() errors. Yeah, about that: maybe we