[ndctl PATCH v2 2/2] ndctl/test: Relax dax_pmem_compat requirement

2020-03-03 Thread Dan Williams
While there are some tests that require the new "dax-bus" device model, none of the tests require compatibility mode. Drop the requirement so the tests work with DEV_DAX_PMEM_COMPAT=n kernels. Link: http://lore.kernel.org/r/20200123154720.12097-1-j...@suse.cz Cc: Jan Kara Signed-o

[ndctl PATCH v2 1/2] ndctl/test: Cleanup test-vs-production nvdimm module detection

2020-03-03 Thread Dan Williams
Update nfit_test_init() to use strcmp() instead of strstr() to filter which modules are probed to come from the out-of-tree unit-test set. Reported-by: Jan Kara Link: http://lore.kernel.org/r/20200303132850.ga21...@quack2.suse.cz Signed-off-by: Dan Williams --- test/core.c |6 +++--- 1

[PATCH v4 1/5] mm/memremap_pages: Introduce memremap_compat_align()

2020-03-03 Thread Dan Williams
ern for arch overrides. Based on an initial patch by Aneesh. Link: http://lore.kernel.org/r/capcyv4gbgnp95apyabcsocea50tqj9b5h__83vgngjq3oug...@mail.gmail.com Reported-by: Aneesh Kumar K.V Reported-by: Jeff Moyer Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Reviewed-by: Aneesh Kumar K.

[PATCH v4 0/5] libnvdimm: Cross-arch compatible namespace alignment

2020-03-03 Thread Dan Williams
nment override where necessary. Thanks to Aneesh for early feedback and testing on this change to alignment handling. --- Dan Williams (5): mm/memremap_pages: Introduce memremap_compat_align() libnvdimm/pfn: Prevent raw mode fallback if pfn-infoblock valid libnvdimm/namespace:

[PATCH v4 2/5] libnvdimm/pfn: Prevent raw mode fallback if pfn-infoblock valid

2020-03-03 Thread Dan Williams
exposing the namespace to I/O when the infoblock needs to be corrected, or the system needs to be put into a different configuration (like changing the page size on PowerPC). Cc: Aneesh Kumar K.V Cc: Jeff Moyer Reviewed-by: Aneesh Kumar K.V Signed-off-by: Dan Williams --- drivers/nvdimm/pfn_devs.c

[PATCH v4 5/5] libnvdimm/region: Introduce an 'align' attribute

2020-03-03 Thread Dan Williams
setting. Reported-by: Aneesh Kumar K.V Reported-by: Jeff Moyer Reviewed-by: Aneesh Kumar K.V Reviewed-by: Jeff Moyer Link: https://lore.kernel.org/r/158041478371.3889308.14542630147672668068.st...@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams --- drivers/nvdimm/dimm_devs.c |

[PATCH v4 3/5] libnvdimm/namespace: Enforce memremap_compat_align()

2020-03-03 Thread Dan Williams
: Aneesh Kumar K.V Cc: Jeff Moyer Fixes: a3619190d62e ("libnvdimm/pfn: stop padding pmem namespaces to section alignment") Reviewed-by: Aneesh Kumar K.V Signed-off-by: Dan Williams --- drivers/nvdimm/namespace_devs.c | 17 + drivers/nvdimm/pfn.h

[PATCH v4 4/5] libnvdimm/region: Introduce NDD_LABELING

2020-03-03 Thread Dan Williams
Jeff Moyer Reviewed-by: Aneesh Kumar K.V Link: https://lore.kernel.org/r/158041477856.3889308.4212605617834097674.st...@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams --- arch/powerpc/platforms/pseries/papr_scm.c |2 +- drivers/acpi/nfit/core.c |4 +++- dr

Re: [PATCH] block: refactor duplicated macros

2020-03-04 Thread Dan Williams
-- > block/blk-lib.c | 2 +- > drivers/block/brd.c | 3 --- > drivers/block/null_blk_main.c| 4 > drivers/block/zram/zram_drv.c| 8 > drivers/block/zram/zram_drv.h| 2 -- > drivers/dax/super.c | 2 +- For

Re: [PATCH 0/5] Manual definition of Soft Reserved memory devices

2020-03-06 Thread Dan Williams
On Fri, Mar 6, 2020 at 12:07 PM Jeff Moyer wrote: > > Dan Williams writes: > > > Given the current dearth of systems that supply an ACPI HMAT table, and > > the utility of being able to manually define device-dax "hmem" instances > > via the efi_fake_me

Re: nfit_test: issue #2: modprobe: ERROR: could not insert 'nfit_test': Unknown symbol in module, or unknown parameter

2020-03-12 Thread Dan Williams
On Thu, Mar 12, 2020 at 7:38 AM Dorau, Lukasz wrote: > > Hi, > > Inserting the 'nfit_test' module in a natural way fails with the following > error: > > $ sudo modprobe -v nfit_test > insmod > /lib/modules/5.6.0-rc1-bb-13504-g7b27a8622f80/kernel/drivers/char/hw_random/rng-core.ko.xz > insmod >

Re: nfit_test: issue #3: BUG: kernel NULL pointer dereference, address: 0000000000000018

2020-03-12 Thread Dan Williams
On Thu, Mar 12, 2020 at 8:06 AM Dorau, Lukasz wrote: > > Hi, > > [Resending the same, because the first e-mail got corrupted] > > I have inserted the 'nfit_test' module, removed it and reinserted it again > (like in the previous e-mail " nfit_test: issue #2: modprobe: ERROR: could > not insert '

Re: nfit_test: issue #2: modprobe: ERROR: could not insert 'nfit_test': Unknown symbol in module, or unknown parameter

2020-03-13 Thread Dan Williams
On Fri, Mar 13, 2020 at 2:49 AM Dorau, Lukasz wrote: > > On Thursday, March 12, 2020 6:06 PM Dan Williams > wrote: > > > > Yes, you're environment is not being careful to exclude the production > > version of the modules from being loaded. The ndctl unit

Re: nfit_test: issue #3: BUG: kernel NULL pointer dereference, address: 0000000000000018

2020-03-13 Thread Dan Williams
On Fri, Mar 13, 2020 at 3:06 AM Dorau, Lukasz wrote: > > On Thursday, March 12, 2020 6:09 PM Dan Williams > wrote: > > > > If you force loaded a module with unresolved symbols all bets are off, > > lets get "make TESTS=libndctl check" running cleanly b

Re: nfit_test: issue #3: BUG: kernel NULL pointer dereference, address: 0000000000000018

2020-03-17 Thread Dan Williams
On Mon, Mar 16, 2020 at 1:58 AM Dorau, Lukasz wrote: > > On Friday, March 13, 2020 4:50 PM Dan Williams > wrote: > > On Fri, Mar 13, 2020 at 3:06 AM Dorau, Lukasz > > wrote: > > > > > > The steps to reproduce: > > > > > > $ sudo modpro

Re: nfit_test: issue #3: BUG: kernel NULL pointer dereference, address: 0000000000000018

2020-03-17 Thread Dan Williams
On Tue, Mar 17, 2020 at 2:09 AM Dorau, Lukasz wrote: > > On Tuesday, March 17, 2020 9:26 AM Dan Williams > wrote: > > On Mon, Mar 16, 2020 at 1:58 AM Dorau, Lukasz > > wrote: > > > The above error: > > >"nfit_test: Unknown symbol acpi_nfit_

Re: [PATCH 4/5] resource: Report parent to walk_iomem_res_desc() callback

2020-03-17 Thread Dan Williams
On Thu, Mar 5, 2020 at 6:42 AM Tom Lendacky wrote: > > On 3/2/20 4:20 PM, Dan Williams wrote: > > In support of detecting whether a resource might have been been claimed, > > report the parent to the walk_iomem_res_desc() callback. For example, > > the ACPI HMAT parser p

Re: [PATCH 1/5] ACPI: NUMA: Add 'nohmat' option

2020-03-17 Thread Dan Williams
On Mon, Mar 2, 2020 at 2:36 PM Dan Williams wrote: > > Disable parsing of the HMAT for debug, to workaround broken platform > instances, or cases where it is otherwise not wanted. Rafael, any heartburn with this change to the numa= option? ...as I look at this I realize I failed to al

Re: [PATCH 1/5] ACPI: NUMA: Add 'nohmat' option

2020-03-18 Thread Dan Williams
On Wed, Mar 18, 2020 at 1:24 AM Rafael J. Wysocki wrote: > > On Wed, Mar 18, 2020 at 1:09 AM Dan Williams wrote: > > > > On Mon, Mar 2, 2020 at 2:36 PM Dan Williams > > wrote: > > > > > > Disable parsing of the HMAT for debug, to workaround broken plat

Re: [PATCH v1] test/dax.sh: correct the pmd pagefault counts generated by dax-pmd

2020-03-19 Thread Dan Williams
On Thu, Mar 19, 2020 at 7:13 PM XiaoLi Feng wrote: > > From: Xiaoli Feng > > For directIO, cannot generate pmd pagefault by pread|pwrite|read|write > if do not map fd to memory. In dax-pmd.c, case 1 and case 4 each only > generate once pmd pagefault. So change the all counts from 10 to 8. What k

Re: [PATCH v1] test/dax.sh: correct the pmd pagefault counts generated by dax-pmd

2020-03-19 Thread Dan Williams
On Thu, Mar 19, 2020 at 8:19 PM Xiaoli Feng wrote: > > Hi, > > - Original Message - > > From: "Dan Williams" > > To: "XiaoLi Feng" > > Cc: "linux-nvdimm" > > Sent: Friday, March 20, 2020 10:36:05 AM > &g

[PATCH v2 0/6] Manual definition of Soft Reserved memory devices

2020-03-22 Thread Dan Williams
"size":"4.00 GiB (4.29 GB)", "align":2097152, "devices":[ { "chardev":"dax0.0", "size":"4.00 GiB (4.29 GB)", "target_node":2, "mode":"devdax&quo

[PATCH v2 4/6] ACPI: HMAT: Refactor hmat_register_target_device to hmem_register_device

2020-03-22 Thread Dan Williams
values and instead relies on numa_map_to_online_node() to determine the numa node for the device. Cc: "Rafael J. Wysocki" Link: https://lore.kernel.org/r/158318761484.2216124.2049322072599482736.st...@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams --- drivers/acpi

[PATCH v2 1/6] x86/numa: Cleanup configuration dependent command-line options

2020-03-22 Thread Dan Williams
compile-time. Suggested-by: Rafael J. Wysocki Signed-off-by: Dan Williams --- arch/x86/include/asm/numa.h |8 +++- arch/x86/mm/numa.c |8 ++-- arch/x86/mm/numa_emulation.c |3 ++- arch/x86/xen/enlighten_pv.c |2 +- drivers/acpi/numa/srat.c |9

[PATCH v2 5/6] resource: Report parent to walk_iomem_res_desc() callback

2020-03-22 Thread Dan Williams
Cc: Wei Yang Cc: Tom Lendacky Signed-off-by: Dan Williams --- kernel/resource.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c index 76036a41143b..f54ccf7a1009 100644 --- a/kernel/resource.c +++ b/kernel/resource.c

[PATCH v2 3/6] efi/fake_mem: Arrange for a resource entry per efi_fake_mem instance

2020-03-22 Thread Dan Williams
Anvin" Cc: x...@kernel.org Acked-by: Ard Biesheuvel Signed-off-by: Dan Williams --- arch/x86/kernel/e820.c | 16 +++- drivers/firmware/efi/x86_fake_mem.c | 12 +--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/e820.c

[PATCH v2 6/6] ACPI: HMAT: Attach a device for each soft-reserved range

2020-03-22 Thread Dan Williams
s the hmem device enabling to have unique name in the module namespace: "device_hmem". Rather than mark this x86-only, include an interim phys_to_target_node() implementation for arm64. Cc: Jonathan Cameron Cc: Brice Goglin Cc: Ard Biesheuvel Cc: "Rafael J. Wysocki" Cc: Jeff

[PATCH v2 2/6] x86/numa: Add 'nohmat' option

2020-03-22 Thread Dan Williams
ov Cc: "H. Peter Anvin" Signed-off-by: Dan Williams --- arch/x86/mm/numa.c |2 ++ drivers/acpi/numa/hmat.c |8 +++- include/acpi/acpi_numa.h |8 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 9c1266

Re: [ndctl PATCH] ndctl/namespace: Fix a resource leak in file_write_infoblock

2020-03-23 Thread Dan Williams
On Mon, Mar 23, 2020 at 11:33 AM Vishal Verma wrote: > > Static analysis reported that we were leaking 'fd' in one case in the > above function, fix the error handling to go through the 'out' label. > > Cc: Dan Williams > Signed-off-by: Vishal Verma >

[PATCH 00/12] device-dax: Support sub-dividing soft-reserved ranges

2020-03-23 Thread Dan Williams
0313.17144-1-joao.m.mart...@oracle.com/ [4]: http://lore.kernel.org/r/158489354353.1457606.8327903161927980740.st...@dwillia2-desk3.amr.corp.intel.com/ --- Dan Williams (12): device-dax: Drop the dax_region.pfn_flags attribute device-dax: Move instance creation parameters to 'struct

[PATCH 01/12] device-dax: Drop the dax_region.pfn_flags attribute

2020-03-23 Thread Dan Williams
All callers specify the same flags to alloc_dax_region(), so there is no need to allow for anything other than PFN_DEV|PFN_MAP, or carry a ->pfn_flags around on the region. Device-dax instances are always page backed. Signed-off-by: Dan Williams --- drivers/dax/bus.c |

[PATCH 04/12] device-dax: Kill dax_kmem_res

2020-03-23 Thread Dan Williams
e not yet implemented." comment is stale as of commit 9f960da72b25 ("device-dax: "Hotremove" persistent memory that is used like normal RAM") Cc: David Hildenbrand Cc: Vishal Verma Cc: Dave Hansen Cc: Pavel Tatashin Signed-off-by: Dan Williams --- drivers/dax/dax-p

[PATCH 03/12] device-dax: Make pgmap optional for instance creation

2020-03-23 Thread Dan Williams
resource range via a new @range property of 'struct dev_dax_data'. Signed-off-by: Dan Williams --- drivers/dax/bus.c | 29 +++-- drivers/dax/bus.h |2 ++ drivers/dax/dax-private.h |9 - drivers/dax/device.c

[PATCH 05/12] device-dax: Add an allocation interface for device-dax instances

2020-03-23 Thread Dan Williams
is per Jeff's feedback the last time dynamic device-dax capacity allocation support was discussed. Link: https://lore.kernel.org/linux-nvdimm/x49shpp3zn8@segfault.boston.devel.redhat.com Signed-off-by: Dan Williams --- drivers/dax/bus.c |

[PATCH 10/12] mm/memremap_pages: Support multiple ranges per invocation

2020-03-23 Thread Dan Williams
Cc: Bjorn Helgaas Cc: Logan Gunthorpe Cc: Michael Ellerman Cc: Vishal Verma Signed-off-by: Dan Williams --- arch/powerpc/kvm/book3s_hv_uvmem.c |1 drivers/dax/device.c |1 drivers/gpu/drm/nouveau/nouveau_dmem.c |1 drivers/nvdimm/pfn_devs.c

[PATCH 02/12] device-dax: Move instance creation parameters to 'struct dev_dax_data'

2020-03-23 Thread Dan Williams
In preparation for adding more parameters to instance creation, move existing parameters to a new struct. Signed-off-by: Dan Williams --- drivers/dax/bus.c | 14 +++--- drivers/dax/bus.h | 16 drivers/dax/hmem/hmem.c |8 +++- drivers/dax/pmem

[PATCH 11/12] device-dax: Add dis-contiguous resource support

2020-03-23 Thread Dan Williams
https://lore.kernel.org/lkml/20200110190313.17144-1-joao.m.mart...@oracle.com/ Reported-by: Joao Martins Signed-off-by: Dan Williams --- drivers/dax/bus.c | 230 +--- drivers/dax/dax-private.h |9 +- drivers/dax/device.c |

[PATCH 12/12] device-dax: Introduce 'mapping' devices

2020-03-23 Thread Dan Williams
ent layout until the device is enabled. Signed-off-by: Dan Williams --- drivers/dax/bus.c | 190 + drivers/dax/dax-private.h | 14 +++ 2 files changed, 202 insertions(+), 2 deletions(-) diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c index 07a

[PATCH 09/12] mm/memremap_pages: Convert to 'struct range'

2020-03-23 Thread Dan Williams
a minor usage of the flags field, but only to report failures with "%pR". That is replaced with an open coded print of the range. Cc: Jason Gunthorpe Cc: Christoph Hellwig Cc: Ben Skeggs Cc: Ira Weiny Cc: Paul Mackerras Cc: Bjorn Helgaas Cc: Logan Gunthorpe Cc: Michael Ellerma

[PATCH 08/12] device-dax: Add resize support

2020-03-23 Thread Dan Williams
; ../drivers/{device_dax,kmem}/bind echo dax0.1 > ../drivers/{device_dax,kmem}/bind Instances can be destroyed by: echo $device > $(readlink -f $device)../dax_region/delete Signed-off-by: Dan Williams --- drivers/dax/bus.c | 186 ++-

[PATCH 06/12] device-dax: Introduce seed devices

2020-03-23 Thread Dan Williams
capacity from the region. Signed-off-by: Dan Williams --- drivers/dax/bus.c | 296 +++-- drivers/dax/bus.h |4 - drivers/dax/dax-private.h |7 + drivers/dax/device.c | 12 +- drivers/dax/hmem/hmem.c |2 drivers/dax/kme

[PATCH 07/12] drivers/base: Make device_find_child_by_name() compatible with sysfs inputs

2020-03-23 Thread Dan Williams
Use sysfs_streq() in device_find_child_by_name() to allow it to use a sysfs input string that might contain a trailing newline. The other "device by name" interfaces, {bus,driver,class}_find_device_by_name(), already account for sysfs strings. Signed-off-by: Dan Williams --- dr

Re: [PATCH v2] libnvdimm: Update persistence domain value for of_pmem and papr_scm device

2020-03-23 Thread Dan Williams
On Fri, Mar 20, 2020 at 2:25 AM Aneesh Kumar K.V wrote: > > > Hi Dan, > > > Dan Williams writes: > > ... > > > > > >> > >> Or are you suggesting that application should not infer any of those > >> details looking at persistence

Re: [PATCH v2 4/6] ACPI: HMAT: Refactor hmat_register_target_device to hmem_register_device

2020-03-24 Thread Dan Williams
On Tue, Mar 24, 2020 at 12:41 PM Joao Martins wrote: > > > On 3/22/20 4:12 PM, Dan Williams wrote: > > In preparation for exposing "Soft Reserved" memory ranges without an > > HMAT, move the hmem device registration to its own compilation unit and > > make th

Re: [PATCH v2 6/6] ACPI: HMAT: Attach a device for each soft-reserved range

2020-03-24 Thread Dan Williams
On Tue, Mar 24, 2020 at 12:41 PM Joao Martins wrote: > > On 3/22/20 4:12 PM, Dan Williams wrote: > > The hmem enabling in commit 'cf8741ac57ed ("ACPI: NUMA: HMAT: Register > > "soft reserved" memory as an "hmem" device")' only register

Re: [PATCH 12/12] device-dax: Introduce 'mapping' devices

2020-03-24 Thread Dan Williams
On Tue, Mar 24, 2020 at 9:28 AM Joao Martins wrote: > > On 3/23/20 11:55 PM, Dan Williams wrote: > > In support of interrogating the physical address layout of a device with > > dis-contiguous ranges, introduce a sysfs directory with 'start', 'end',

Re: [PATCH v2 6/6] ACPI: HMAT: Attach a device for each soft-reserved range

2020-03-25 Thread Dan Williams
On Wed, Mar 25, 2020 at 4:10 AM Will Deacon wrote: > > On Sun, Mar 22, 2020 at 09:12:58AM -0700, Dan Williams wrote: > > The hmem enabling in commit 'cf8741ac57ed ("ACPI: NUMA: HMAT: Register > > "soft reserved" memory as an "hmem" device")&#x

Re: [PATCH 11/12] device-dax: Add dis-contiguous resource support

2020-03-25 Thread Dan Williams
On Wed, Mar 25, 2020 at 3:35 AM Joao Martins wrote: > > On 3/24/20 4:12 PM, Joao Martins wrote: > > On 3/23/20 11:55 PM, Dan Williams wrote: > >> static ssize_t dev_dax_resize(struct dax_region *dax_region, > >> struct dev_dax

Re: [PATCH v2 4/6] ACPI: HMAT: Refactor hmat_register_target_device to hmem_register_device

2020-03-25 Thread Dan Williams
On Tue, Mar 24, 2020 at 2:04 PM Dan Williams wrote: > > On Tue, Mar 24, 2020 at 12:41 PM Joao Martins > wrote: > > > > > > On 3/22/20 4:12 PM, Dan Williams wrote: > > > In preparation for exposing "Soft Reserved" memory ranges without an > >

Re: [ndctl PATCH] ndctl/README: Add a missing config setting

2020-03-26 Thread Dan Williams
On Thu, Mar 26, 2020 at 2:25 AM Dorau, Lukasz wrote: > > Add a missing config setting to README.md: > CONFIG_DEV_DAX_PMEM_COMPAT=m It's not required anymore as of: https://github.com/pmem/ndctl/commit/b7991dbc22f31d03a38f3ee2dca4446fb55279e3 ___ Linux-

Re: [ndctl PATCH] ndctl/README: Add a missing config setting

2020-03-26 Thread Dan Williams
On Thu, Mar 26, 2020 at 11:45 AM Dan Williams wrote: > > On Thu, Mar 26, 2020 at 2:25 AM Dorau, Lukasz wrote: > > > > Add a missing config setting to README.md: > > CONFIG_DEV_DAX_PMEM_COMPAT=m > > It's not required anymore as of: >

Re: [PATCH][next] acpi: nfit.h: Replace zero-length array with flexible-array member

2020-03-30 Thread Dan Williams
On Wed, Mar 25, 2020 at 3:06 AM Rafael J. Wysocki wrote: > > On Thu, Mar 19, 2020 at 9:15 PM Gustavo A. R. Silva > wrote: > > > > The current codebase makes use of the zero-length array language > > extension to the C90 standard, but the preferred mechanism to declare > > variable-length types su

Re: [PATCH -next] libnvdimm/region: Fix build error

2020-03-31 Thread Dan Williams
On Mon, Mar 30, 2020 at 7:23 AM YueHaibing wrote: > > On CONFIG_PPC32=y build fails: > > drivers/nvdimm/region_devs.c:1034:14: note: in expansion of macro ‘do_div’ > remainder = do_div(per_mapping, mappings); > ^~ > In file included from ./arch/powerpc/include/generated/asm/div

Re: [PATCH v6 4/6] dm,dax: Add dax zero_page_range operation

2020-03-31 Thread Dan Williams
[ Add Mike ] On Fri, Feb 28, 2020 at 8:35 AM Vivek Goyal wrote: > > This patch adds support for dax zero_page_range operation to dm targets. Mike, Sorry, I should have pinged you earlier, but could you take a look at this patch and ack it if it looks ok to go through the nvdimm tree with the re

Re: [PATCH v5 4/8] dax, pmem: Add a dax operation zero_page_range

2020-03-31 Thread Dan Williams
On Tue, Feb 18, 2020 at 1:49 PM Vivek Goyal wrote: > > Add a dax operation zero_page_range, to zero a range of memory. This will > also clear any poison in the range being zeroed. > > As of now, zeroing of up to one page is allowed in a single call. There > are no callers which are trying to zero

Re: [PATCH v2 -next] libnvdimm/region: Fix build error

2020-03-31 Thread Dan Williams
On Tue, Mar 31, 2020 at 4:52 AM YueHaibing wrote: > > On CONFIG_PPC32=y build fails: > > drivers/nvdimm/region_devs.c:1034:14: note: in expansion of macro ‘do_div’ > remainder = do_div(per_mapping, mappings); > ^~ > In file included from ./arch/powerpc/include/generated/asm/div

Re: [PATCH v2] memcpy_flushcache: use cache flusing for larger lengths

2020-03-31 Thread Dan Williams
[ add x86 and LKML ] On Tue, Mar 31, 2020 at 5:27 AM Mikulas Patocka wrote: > > > > On Tue, 31 Mar 2020, Elliott, Robert (Servers) wrote: > > > > > > > > -Original Message- > > > From: Mikulas Patocka > > > Sent: Monday, March

Re: [PATCH] tools/test/nvdimm: Fix out of tree build

2020-03-31 Thread Dan Williams
On Mon, Jan 13, 2020 at 9:41 PM Santosh Sivaraj wrote: > > Out of tree build using > >make M=tools/test/nvdimm O=/tmp/build -C /tmp/build > > fails with the following error > > make: Entering directory '/tmp/build' > CC [M] tools/testing/nvdimm/test/nfit.o > linux/tools/testing/nvdimm/test/

Re: [PATCH v3] libnvdimm: Update persistence domain value for of_pmem and papr_scm device

2020-03-31 Thread Dan Williams
On Mon, Mar 23, 2020 at 8:48 PM Aneesh Kumar K.V wrote: > > Currently, kernel shows the below values > "persistence_domain":"cpu_cache" > "persistence_domain":"memory_controller" > "persistence_domain":"unknown" > > "cpu_cache" indicates no extra instructions is needed to e

Re: [ndctl PATCH] monitor: Add epoll timeout for forcing a full dimm health check

2020-03-31 Thread Dan Williams
On Fri, Feb 21, 2020 at 9:55 AM Vaibhav Jain wrote: > > This patch adds a new command argument to the 'monitor' command namely > '--check-interval' that triggers a call to notify_dimm_event() at > regular intervals forcing a periodic check of dimm smart events. > > This behavior is useful for dimm

Re: [PATCH v4 00/25] Add support for OpenCAPI Persistent Memory devices

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > This series adds support for OpenCAPI Persistent Memory devices on bare metal > (arch/powernv), exposing them as nvdimms so that we can make use of the > existing infrastructure. There already exists a driver for the same devices > ab

Re: [PATCH v4 01/25] powerpc/powernv: Add OPAL calls for LPC memory alloc/release

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > Add OPAL calls for LPC memory alloc/release > This seems to be referencing an existing api definition, can you include a pointer to the spec in case someone wanted to understand what these routines do? I suspect this is not allocating m

Re: [PATCH v4 02/25] mm/memory_hotplug: Allow check_hotplug_memory_addressable to be called from drivers

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > When setting up OpenCAPI connected persistent memory, the range check may > not be performed until quite late (or perhaps not at all, if the user does > not establish a DAX device). > > This patch makes the range check callable so we can

Re: [PATCH v4 05/25] ocxl: Address kernel doc errors & warnings

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > This patch addresses warnings and errors from the kernel doc scripts for > the OpenCAPI driver. > > It also makes minor tweaks to make the docs more consistent. > > Signed-off-by: Alastair D'Silva > Acked-by: Andrew Donnellan > --- >

Re: [PATCH v4 06/25] ocxl: Tally up the LPC memory on a link & allow it to be mapped

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:53 PM Alastair D'Silva wrote: > > OpenCAPI LPC memory is allocated per link, but each link supports > multiple AFUs, and each AFU can have LPC memory assigned to it. Is there an OpenCAPI primer to decode these objects and their associations that I can reference? > > T

Re: [PATCH v4 04/25] ocxl: Remove unnecessary externs

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > Function declarations don't need externs, remove the existing ones > so they are consistent with newer code > > Signed-off-by: Alastair D'Silva > Acked-by: Andrew Donnellan > Acked-by: Frederic Barrat Looks good. > --- > arch/powe

Re: [PATCH v4 03/25] powerpc/powernv: Map & release OpenCAPI LPC memory

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > This patch adds OPAL calls to powernv so that the OpenCAPI > driver can map & release LPC (Lowest Point of Coherency) memory. > > Signed-off-by: Alastair D'Silva > Reviewed-by: Andrew Donnellan > --- > arch/powerpc/include/asm/pnv-oc

Re: [PATCH v4 07/25] ocxl: Add functions to map/unmap LPC memory

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > Add functions to map/unmap LPC memory > "map memory" is an overloaded term. I'm guessing this patch has nothing to do with mapping memory in the MMU. Is it updating hardware resource decoders to start claiming address space that was all

Re: [PATCH v4 10/25] nvdimm: Add driver for OpenCAPI Persistent Memory

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > This driver exposes LPC memory on OpenCAPI pmem cards > as an NVDIMM, allowing the existing nvram infrastructure > to be used. > > Namespace metadata is stored on the media itself, so > scm_reserve_metadata() maps 1 section's worth of PM

Re: [PATCH v4 08/25] ocxl: Emit a log message showing how much LPC memory was detected

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > This patch emits a message showing how much LPC memory & special purpose > memory was detected on an OCXL device. > > Signed-off-by: Alastair D'Silva > Acked-by: Frederic Barrat > Acked-by: Andrew Donnellan > --- > drivers/misc/ocxl/

Re: [PATCH v4 10/25] nvdimm: Add driver for OpenCAPI Persistent Memory

2020-04-01 Thread Dan Williams
On Wed, Apr 1, 2020 at 1:49 AM Dan Williams wrote: > > On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva > wrote: > > > > This driver exposes LPC memory on OpenCAPI pmem cards > > as an NVDIMM, allowing the existing nvram infrastructure > > to be used. &

Re: [PATCH v4 12/25] nvdimm/ocxl: Add register addresses & status values to the header

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:53 PM Alastair D'Silva wrote: > > These values have been taken from the device specifications. Link to specification? ___ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-le..

Re: [PATCH v4 11/25] powerpc: Enable the OpenCAPI Persistent Memory driver for powernv_defconfig

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > This patch enables the OpenCAPI Persistent Memory driver, as well > as DAX support, for the 'powernv' defconfig. > > DAX is not a strict requirement for the functioning of the driver, but it > is likely that a user will want to create a

Re: [PATCH v4 13/25] nvdimm/ocxl: Read the capability registers & wait for device ready

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > This patch reads timeouts & firmware version from the controller, and > uses those timeouts to wait for the controller to report that it is ready > before handing the memory over to libnvdimm. > > Signed-off-by: Alastair D'Silva > --- >

Re: [PATCH v4 15/25] nvdimm/ocxl: Register a character device for userspace to interact with

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:53 PM Alastair D'Silva wrote: > > This patch introduces a character device (/dev/ocxlpmemX) which further > patches will use to interact with userspace, such as error logs, > controller stats and card debug functionality. This was asked earlier, but I'll reiterate, I do

Re: [PATCH v4 19/25] nvdimm/ocxl: Forward events to userspace

2020-04-01 Thread Dan Williams
On Tue, Mar 31, 2020 at 1:59 AM Alastair D'Silva wrote: > > Some of the interrupts that the card generates are better handled > by the userspace daemon, in particular: > Controller Hardware/Firmware Fatal > Controller Dump Available > Error Log available > > This patch allows a userspace applicati

Re: [PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-04-01 Thread Dan Williams
On Tue, Mar 31, 2020 at 7:33 AM Vaibhav Jain wrote: > > Implement support for fetching nvdimm health information via > H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair > of 64-bit big-endian integers which are then stored in 'struct > papr_scm_priv' and subsequently partially e

Re: [PATCH v4 14/25] nvdimm/ocxl: Add support for Admin commands

2020-04-01 Thread Dan Williams
On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > Admin commands for these devices are the primary means of interacting > with the device controller to provide functionality beyond the load/store > capabilities offered via the NPU. > > For example, SMART data, firmware update, and devic

Re: [PATCH v6 4/6] dm,dax: Add dax zero_page_range operation

2020-04-02 Thread Dan Williams
On Tue, Mar 31, 2020 at 12:34 PM Dan Williams wrote: > > [ Add Mike ] > > On Fri, Feb 28, 2020 at 8:35 AM Vivek Goyal wrote: > > > > This patch adds support for dax zero_page_range operation to dm targets. > > Mike, > > Sorry, I should have pinged you earlier,

Re: [PATCH v4 16/25] nvdimm/ocxl: Implement the Read Error Log command

2020-04-02 Thread Dan Williams
On Tue, Mar 31, 2020 at 1:59 AM Alastair D'Silva wrote: > > The read error log command extracts information from the controller's > internal error log. > > This patch exposes this information in 2 ways: > - During probe, if an error occurs & a log is available, print it to the > console > - Afte

Re: [PATCH v5 1/4] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-04-02 Thread Dan Williams
On Wed, Apr 1, 2020 at 8:08 PM Dan Williams wrote: [..] > > * "locked" : Indicating that nvdimm contents cant be modified > >until next power cycle. > > There is the generic NDD_LOCKED flag, can you use that? ...and in > general I wonder if

Re: [PATCH v5 2/4] ndctl/uapi: Introduce NVDIMM_FAMILY_PAPR_SCM as a new NVDIMM DSM family

2020-04-03 Thread Dan Williams
On Tue, Mar 31, 2020 at 7:33 AM Vaibhav Jain wrote: > > Add PAPR-scm family of DSM command-set to the white list of NVDIMM > command sets. > > Signed-off-by: Vaibhav Jain > --- > Changelog: > > v4..v5 : None > > v3..v4 : None > > v2..v3 : Updated the patch prefix to 'ndctl/uapi' [Aneesh] > > v1..

[PATCH] libnvdimm: Validate command family indices

2020-04-03 Thread Dan Williams
whitelist the valid set of command family indices. - Update the generic __nd_ioctl() path to validate that field on behalf of all implementations. Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism") Cc: Signed-off-by: Dan Williams --- dr

Re: [PATCH v5 3/4] powerpc/papr_scm,uapi: Add support for handling PAPR DSM commands

2020-04-03 Thread Dan Williams
On Tue, Mar 31, 2020 at 7:33 AM Vaibhav Jain wrote: > > Implement support for handling PAPR DSM commands in papr_scm > module. We advertise support for ND_CMD_CALL for the dimm command mask > and implement necessary scaffolding in the module to handle ND_CMD_CALL > ioctl and DSM commands that we r

Re: [PATCH v5 4/4] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

2020-04-03 Thread Dan Williams
On Tue, Mar 31, 2020 at 7:33 AM Vaibhav Jain wrote: > > This patch implements support for papr_scm command > 'DSM_PAPR_SCM_HEALTH' that returns a newly introduced 'struct > nd_papr_scm_dimm_health_stat' instance containing dimm health > information back to user space in response to ND_CMD_CALL. Th

Re: [PATCH 11/12] device-dax: Add dis-contiguous resource support

2020-04-06 Thread Dan Williams
On Mon, Apr 6, 2020 at 3:46 AM Joao Martins wrote: > > On 3/23/20 11:55 PM, Dan Williams wrote: > > [...] > > > static ssize_t dev_dax_resize(struct dax_region *dax_region, > > struct dev_dax *dev_dax, resource_size_t size) > >

[GIT PULL] libnvdimm for v5.7

2020-04-07 Thread Dan Williams
for of_pmem and papr_scm device Dan Carpenter (2): acpi/nfit: improve bounds checking for 'func' libnvdimm: Out of bounds read in __nd_ioctl() Dan Williams (15): ACPI: NUMA: Up-level "map to online node" functionality mm/numa: Skip NUMA_NO_NOD

Re: [GIT PULL] libnvdimm for v5.7

2020-04-08 Thread Dan Williams
On Wed, Apr 8, 2020 at 9:11 PM Linus Torvalds wrote: > > On Tue, Apr 7, 2020 at 1:12 PM Dan Williams wrote: > > > > mm/memremap_pages: Introduce memremap_compat_align() > > Why is this an exported function that just returns a constant? > > Why isn't

Re: [PATCH] nvdimm: cleanup resources when the initialization fails

2020-04-09 Thread Dan Williams
On Thu, Apr 9, 2020 at 8:16 PM Wu Bo wrote: > > From: Wu Bo > > When the initialization fails, add the cleanup resources > in pmem_attach_disk() function Are you familiar with devm? devm routines take care of this automatically on driver probe error conditions. _

[PATCH] x86/memcpy: Introduce memcpy_mcsafe_fast

2020-04-10 Thread Dan Williams
uot;H. Peter Anvin" Cc: Thomas Gleixner Cc: Peter Zijlstra Acked-by: Tony Luck Reported-by: Erwin Tsaur Tested-by: Erwin Tsaur Fixes: 92b0729c34ca ("x86/mm, x86/mce: Add memcpy_mcsafe()") Signed-off-by: Dan Williams --- Note that I marked this for stable and included a Fix

Re: [PATCH] dax/kmem: refrain from adding memory into an impossible node

2020-04-10 Thread Dan Williams
] kthread+0x120/0x140 > [ +0.000508] ? kthread_create_on_node+0x60/0x60 > [ +0.000706] ret_from_fork+0x3a/0x50 > > Add a check in the kmem driver to ensure that the target_node for the > device in question is in the nodes_possible mask. > > Cc: Dan Williams > Acke

[RFC PATCH] /dev/mem: Revoke mappings when a driver claims the region

2020-04-11 Thread Dan Williams
a545e98126 ("restrict /dev/mem to idle io memory ranges") Signed-off-by: Dan Williams --- I marked this RFC because after writing it I realized we potentially have the same problem with /dev/port, and many mmap drivers in general. Is there a wider solution I'm missing? drivers/

Re: [ndctl PATCH] Skip region filtering if numa_node attribute is not present

2020-04-14 Thread Dan Williams
On Tue, Apr 14, 2020 at 4:39 AM Santosh Sivaraj wrote: > > For kernel versions older than 5.4, the numa_node attribute is not > present for regions; due to which `ndctl list -U 1` fails to list > namespaces. > > Signed-off-by: Santosh Sivaraj > --- > ndctl/lib/libndctl.c | 11 +++ > nd

Re: [PATCH] dax/kmem: refrain from adding memory into an impossible node

2020-04-14 Thread Dan Williams
88 CR3: 000120b50002 CR4: > > 001606e0 > > [ +0.001095] Call Trace: > > [ +0.000388] kswapd+0x103/0x520 > > [ +0.000494] ? finish_wait+0x80/0x80 > > [ +0.000547] ? balance_pgdat+0x5a0/0x5a0 > > [ +0.000607] kthread+0x120/0x140 > >

Re: [PATCH v2] mm/memory_hotplug: refrain from adding memory into an impossible node

2020-04-14 Thread Dan Williams
] kthread+0x120/0x140 > [ +0.000508] ? kthread_create_on_node+0x60/0x60 > [ +0.000706] ret_from_fork+0x3a/0x50 > > Add a check in the add_memory path to ensure that the node to which we > are adding memory is in the node_possible_map > > Cc: David Hildenbrand >

Re: [ndctl PATCH v2] Skip region filtering if numa_node attribute is not present

2020-04-17 Thread Dan Williams
On Thu, Apr 16, 2020 at 1:14 AM Santosh Sivaraj wrote: > > For kernel versions older than 5.4, the numa_node attribute is not > present for regions; due to which `ndctl list -U 1` fails to list > namespaces. > > Signed-off-by: Santosh Sivaraj Looks good to me. Reviewe

Re: [PATCH] x86/memcpy: Introduce memcpy_mcsafe_fast

2020-04-17 Thread Dan Williams
[ add Linus because he had comments the last time memcpy_mcsafe() was reworked [1] ] On Fri, Apr 10, 2020 at 11:06 AM Dan Williams wrote: > > The original memcpy_mcsafe() implementation satisfied two primary > concerns. It provided a copy routine that avoided known unrecoverable &g

Re: [PATCH] x86/memcpy: Introduce memcpy_mcsafe_fast

2020-04-19 Thread Dan Williams
On Sat, Apr 18, 2020 at 1:52 PM Linus Torvalds wrote: > > On Sat, Apr 18, 2020 at 1:30 PM Andy Lutomirski wrote: > > > > Maybe I’m missing something obvious, but what’s the alternative? The > > _mcsafe variants don’t just avoid the REP mess — they also tell the kernel > > that this particular

Re: [PATCH] x86/memcpy: Introduce memcpy_mcsafe_fast

2020-04-20 Thread Dan Williams
On Mon, Apr 20, 2020 at 10:29 AM Linus Torvalds wrote: > > On Sun, Apr 19, 2020 at 10:08 PM Dan Williams > wrote: > > > > Do we have examples of doing exception handling from C? I thought all > > the exception handling copy routines were assembly routines? > >

Re: [PATCH] x86/memcpy: Introduce memcpy_mcsafe_fast

2020-04-20 Thread Dan Williams
On Mon, Apr 20, 2020 at 12:13 PM Linus Torvalds wrote: > On Mon, Apr 20, 2020 at 11:20 AM Dan Williams > wrote: [..] > I really really detest the whole mcsafe garbage. And I absolutely > *ABHOR* how nobody inside of Intel has apparently ever questioned the > brokenness at a rea

<    5   6   7   8   9   10   11   12   13   14   >