Re: Question about the "EXPERIMENTAL" tag for dax in XFS

2021-02-26 Thread Dan Williams
On Fri, Feb 26, 2021 at 12:51 PM Dave Chinner wrote: > > On Fri, Feb 26, 2021 at 11:24:53AM -0800, Dan Williams wrote: > > On Fri, Feb 26, 2021 at 11:05 AM Darrick J. Wong wrote: > > > > > > On Fri, Feb 26, 2021 at 09:45:45AM +, ruansy.f...@fujit

Re: [PATCH] cxl: Make loop variable be 'i' instead of 'j'

2021-02-26 Thread Dan Williams
On Fri, Feb 26, 2021 at 12:46 PM Konrad Rzeszutek Wilk wrote: > Hey, Konrad, thanks for fixing this up. Some more cosmetic changes to fold in below... > .. otherwise people spend extra cycles looking for the > inner loop and wondering 'why j'? > > This was an over-sight when initial work was

Re: Question about the "EXPERIMENTAL" tag for dax in XFS

2021-02-26 Thread Dan Williams
On Fri, Feb 26, 2021 at 11:05 AM Darrick J. Wong wrote: > > On Fri, Feb 26, 2021 at 09:45:45AM +, ruansy.f...@fujitsu.com wrote: > > Hi, guys > > > > Beside this patchset, I'd like to confirm something about the > > "EXPERIMENTAL" tag for dax in XFS. > > > > In XFS, the "EXPERIMENTAL" tag,

Re: [GIT PULL] Compute Express Linux (CXL) for v5.12-rc1

2021-02-23 Thread Dan Williams
As much as I'd love to be working on "Compute Express Linux" the subject should have read "Compute Express Link". On Tue, Feb 23, 2021 at 8:05 PM Dan Williams wrote: > > Hi Linus, please pull from: > > git://git.kernel.org/pub/scm/linux/kernel/git/nv

[GIT PULL] Compute Express Linux (CXL) for v5.12-rc1

2021-02-23 Thread Dan Williams
ers of the CXL driver cxl/mem: Fix potential memory leak Dan Carpenter (1): cxl/mem: Return -EFAULT if copy_to_user() fails Dan Williams (2): cxl/mem: Introduce a driver for CXL-2.0-Type-3 endpoints cxl/mem: Register CXL memX devices .clang-format

[GIT PULL] libnvdimm + device-dax for v5.12-rc1

2021-02-23 Thread Dan Williams
. - Miscellaneous cleanups Dan Williams (1): Merge branch 'for-5.12/dax' into for-5.12/libnvdimm Shiyang Ruan (1): device-dax: Fix default return code of range_parse() Uwe Kleine-König (7): libnvdimm/dimm: Simplify

Re: [PATCH v17 08/10] PM: hibernate: disable when there are active secretmem users

2021-02-22 Thread Dan Williams
On Mon, Feb 22, 2021 at 2:24 AM Mike Rapoport wrote: > > On Mon, Feb 22, 2021 at 07:34:52AM +, Matthew Garrett wrote: > > On Mon, Feb 08, 2021 at 10:49:18AM +0200, Mike Rapoport wrote: > > > > > It is unsafe to allow saving of secretmem areas to the hibernation > > > snapshot as they would be

Re: [PATCH v5 4/9] cxl/mem: Add basic IOCTL interface

2021-02-20 Thread Dan Williams
On Sat, Feb 20, 2021 at 8:33 AM Ben Widawsky wrote: > > On 21-02-19 20:22:00, Konrad Rzeszutek Wilk wrote: > > ..snip.. > > > +static int handle_mailbox_cmd_from_user(struct cxl_mem *cxlm, > > > + const struct cxl_mem_command *cmd, > > > +

Re: [PATCH] cxl/mem: return -EFAULT if copy_to_user() fails

2021-02-19 Thread Dan Williams
On Fri, Feb 19, 2021 at 1:55 AM Dan Carpenter wrote: > > The copy_to_user() function returns the number of bytes remaining to be > copied, but we want to return -EFAULT if the copy doesn't complete. > > Fixes: b754ffbbc0ee ("cxl/mem: Add basic IOCTL interface") > Signed-off-by: Dan Carpenter >

Re: [PATCH v2 0/5] dax-device: Some cleanups

2021-02-16 Thread Dan Williams
On Tue, Feb 16, 2021 at 7:48 PM Dan Williams wrote: > > On Fri, Feb 5, 2021 at 2:29 PM Uwe Kleine-König > wrote: > > > > Hello, > > > > I didn't get any feedback for the (implicit) v1 of this series that > > started with Message-Id: 20210127230124.10

Re: [PATCH v2 0/5] dax-device: Some cleanups

2021-02-16 Thread Dan Williams
On Fri, Feb 5, 2021 at 2:29 PM Uwe Kleine-König wrote: > > Hello, > > I didn't get any feedback for the (implicit) v1 of this series that > started with Message-Id: 20210127230124.109522-1-...@kleine-koenig.org, > but I identified a few improvements myself: > > - Use "dax-device" consistently as

Re: [PATCH 2/2] libnvdimm: Make remove callback return void

2021-02-16 Thread Dan Williams
On Fri, Feb 12, 2021 at 9:21 AM Uwe Kleine-König wrote: > > All drivers return 0 in their remove callback and the driver core ignores > the return value of nvdimm_bus_remove() anyhow. So simplify by changing > the driver remove callback to return void and return 0 unconditionally > to the upper

Re: [PATCH 1/2] libnvdimm: simplify nvdimm_remove()

2021-02-16 Thread Dan Williams
On Fri, Feb 12, 2021 at 9:11 AM Uwe Kleine-König wrote: > > nvdimm_remove is only ever called after nvdimm_probe() returned > successfully. In this case driver data is always set to a non-NULL value > so the check for driver data being NULL can go away as it's always false. Looks good, thanks.

Re: [PATCH] dax: fix default return code of range_parse()

2021-02-16 Thread Dan Williams
On Wed, Feb 10, 2021 at 10:19 AM Joao Martins wrote: > > On 1/26/21 2:13 AM, Shiyang Ruan wrote: > > The return value of range_parse() indicates the size when it is > > positive. The error code should be negative. > > > > Signed-off-by: Shiyang Ruan > > Reviewed-by: Joao Martins > > Although,

Re: [PATCH] cxl/mem: Fix an error code in cxl_mem_mbox_get()

2021-02-16 Thread Dan Williams
On Tue, Feb 16, 2021 at 11:17 AM Dan Carpenter wrote: > > Smatch complains that sometimes when we return success we are holding > the mutex and sometimes we have released the mutex. It turns out that > the bug is a missing error code if the mbox is not ready. It should > return -EBUSY instead

Re: [PATCH v5 05/14] vfio/mdev: idxd: add basic mdev registration and helper functions

2021-02-16 Thread Dan Williams
On Tue, Feb 16, 2021 at 11:05 AM Dave Jiang wrote: > > > On 2/10/2021 4:59 PM, Jason Gunthorpe wrote: > > On Fri, Feb 05, 2021 at 01:53:24PM -0700, Dave Jiang wrote: > > > >> +static int check_vma(struct idxd_wq *wq, struct vm_area_struct *vma) > >> { > >> -/* FIXME: Fill in later */ > >> +

Re: [PATCH v4 9/9] cxl/mem: Add payload dumping for debug

2021-02-16 Thread Dan Williams
On Tue, Feb 16, 2021 at 7:50 AM Jonathan Cameron wrote: > > On Mon, 15 Feb 2021 17:45:38 -0800 > Ben Widawsky wrote: > > > It's often useful in debug scenarios to see what the hardware has dumped > > out. As it stands today, any device error will result in the payload not > > being copied out,

Re: [PATCH v2 3/8] cxl/mem: Register CXL memX devices

2021-02-11 Thread Dan Williams
On Thu, Feb 11, 2021 at 2:19 AM Jonathan Cameron wrote: > > On Wed, 10 Feb 2021 18:17:25 + > Jonathan Cameron wrote: > > > On Tue, 9 Feb 2021 16:02:54 -0800 > > Ben Widawsky wrote: > > > > > From: Dan Williams > > > > > > Create the

Re: [PATCH v2 6/8] cxl/mem: Enable commands via CEL

2021-02-11 Thread Dan Williams
On Thu, Feb 11, 2021 at 9:45 AM Ben Widawsky wrote: [..] > > > + if (mbox_cmd.size_out > sizeof(gsl)) { > > > + dev_warn(dev, "%zu excess logs\n", > > > +(mbox_cmd.size_out - sizeof(gsl)) / > > > +sizeof(struct gsl_entry)); > > > > This

Re: [PATCH v2 5/8] cxl/mem: Add a "RAW" send command

2021-02-11 Thread Dan Williams
On Wed, Feb 10, 2021 at 7:27 AM wrote: > > > diff --git a/drivers/cxl/Kconfig b/drivers/cxl/Kconfig > > index c4ba3aa0a05d..08eaa8e52083 100644 > > --- a/drivers/cxl/Kconfig > > +++ b/drivers/cxl/Kconfig > > @@ -33,6 +33,24 @@ config CXL_MEM > > > > If unsure say 'm'. > > > > +config

Re: [PATCH v2 4/8] cxl/mem: Add basic IOCTL interface

2021-02-10 Thread Dan Williams
On Wed, Feb 10, 2021 at 10:47 AM Jonathan Cameron wrote: [..] > > +#define CXL_CMDS \ > > + ___C(INVALID, "Invalid Command"), \ > > + ___C(IDENTIFY, "Identify Command"),

Re: [PATCH v2 2/8] cxl/mem: Find device capabilities

2021-02-10 Thread Dan Williams
On Wed, Feb 10, 2021 at 10:53 AM Ben Widawsky wrote: [..] > > Christoph raised this in v1, and I agree with him that his would me more > > compact > > and readable as > > > > struct range pmem_range; > > struct range ram_range; > > > > The discussion seemed to get lost without

Re: [PATCH] driver core: auxiliary bus: Fix calling stage for auxiliary bus init

2021-02-09 Thread Dan Williams
On Tue, Feb 9, 2021 at 11:16 AM Greg KH wrote: [..] > > diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c > > index 8336535f1e11..53f93a506626 100644 > > --- a/drivers/base/auxiliary.c > > +++ b/drivers/base/auxiliary.c > > @@ -270,7 +270,7 @@ static void __exit

Re: [PATCH v10 01/20] dlb: add skeleton for DLB driver

2021-02-09 Thread Dan Williams
Eads > > Signed-off-by: Mike Ximing Chen > > Reviewed-by: Magnus Karlsson > > Reviewed-by: Dan Williams > > --- > > Documentation/misc-devices/dlb.rst | 259 +++ > > Documentation/misc-devices/index.rst | 1 + > > MAINTAINERS

Re: [PATCH 08/14] taint: add taint for direct hardware access

2021-02-08 Thread Dan Williams
On Mon, Feb 8, 2021 at 3:36 PM Dan Williams wrote: > > On Mon, Feb 8, 2021 at 2:09 PM Kees Cook wrote: > > > > On Mon, Feb 08, 2021 at 02:00:33PM -0800, Dan Williams wrote: > > > [ add Jon Corbet as I'd expect him to be Cc'd on anything that > > > gen

Re: [PATCH 08/14] taint: add taint for direct hardware access

2021-02-08 Thread Dan Williams
On Mon, Feb 8, 2021 at 2:09 PM Kees Cook wrote: > > On Mon, Feb 08, 2021 at 02:00:33PM -0800, Dan Williams wrote: > > [ add Jon Corbet as I'd expect him to be Cc'd on anything that > > generically touches Documentation/ like this, and add Kees as the last > > person who a

Re: [PATCH 08/14] taint: add taint for direct hardware access

2021-02-08 Thread Dan Williams
[ add Jon Corbet as I'd expect him to be Cc'd on anything that generically touches Documentation/ like this, and add Kees as the last person who added a taint (tag you're it) ] Jon, Kees, are either of you willing to ack this concept? Top-posting to add more context for the below: This taint is

[GIT PULL] libnvdimm fixes for v5.11-rc7

2021-02-07 Thread Dan Williams
infrastructure for non-ACPI platforms Dan Williams (3): ACPI: NFIT: Fix flexible_array.cocci warnings libnvdimm/namespace: Fix visibility of namespace resource attribute libnvdimm/dimm: Avoid race between probe

Re: [PATCH 13/14] cxl/mem: Add limited Get Log command (0401h)

2021-02-04 Thread Dan Williams
On Thu, Feb 4, 2021 at 10:56 AM Ben Widawsky wrote: [..] > It actually got pushed into cxl_mem_raw_command_allowed() > > static bool cxl_mem_raw_command_allowed(u16 opcode) > { > int i; > > if (!IS_ENABLED(CONFIG_CXL_MEM_RAW_COMMANDS)) > return false; > >

Re: [PATCH 03/14] cxl/mem: Find device capabilities

2021-02-03 Thread Dan Williams
On Wed, Feb 3, 2021 at 9:23 AM Ben Widawsky wrote: > > On 21-02-03 17:15:34, Christoph Hellwig wrote: > > On Tue, Feb 02, 2021 at 10:24:18AM -0800, Ben Widawsky wrote: > > > > > + /* Cap 4000h - CXL_CAP_CAP_ID_MEMDEV */ > > > > > + struct { > > > > > + void __iomem

Re: [PATCH 13/14] cxl/mem: Add limited Get Log command (0401h)

2021-02-03 Thread Dan Williams
On Wed, Feb 3, 2021 at 10:16 AM Konrad Rzeszutek Wilk wrote: > > On Wed, Feb 03, 2021 at 09:16:10AM -0800, Ben Widawsky wrote: > > On 21-02-02 15:57:03, Dan Williams wrote: > > > On Tue, Feb 2, 2021 at 3:51 PM Ben Widawsky > > > wrote: > > > > > >

Re: [PATCH 13/14] cxl/mem: Add limited Get Log command (0401h)

2021-02-02 Thread Dan Williams
On Tue, Feb 2, 2021 at 3:51 PM Ben Widawsky wrote: > > On 21-02-01 13:28:48, Konrad Rzeszutek Wilk wrote: > > On Fri, Jan 29, 2021 at 04:24:37PM -0800, Ben Widawsky wrote: > > > The Get Log command returns the actual log entries that are advertised > > > via the Get Supported Logs command

Re: [PATCH 04/14] cxl/mem: Implement polled mode mailbox

2021-02-02 Thread Dan Williams
On Tue, Feb 2, 2021 at 2:57 PM Ben Widawsky wrote: > > On 21-02-01 12:00:18, Dan Williams wrote: > > On Sat, Jan 30, 2021 at 3:52 PM David Rientjes wrote: > > > > > > On Fri, 29 Jan 2021, Ben Widawsky wrote: > > > > > > > Provide enough func

Re: [PATCH 08/14] taint: add taint for direct hardware access

2021-02-02 Thread Dan Williams
On Mon, Feb 1, 2021 at 6:50 PM Konrad Rzeszutek Wilk wrote: > > On Mon, Feb 01, 2021 at 11:01:11AM -0800, Dan Williams wrote: > > On Mon, Feb 1, 2021 at 10:35 AM Ben Widawsky wrote: > > > > > > On 21-02-01 13:18:45, Konrad Rzeszutek Wilk wrote: > > > >

[PATCH] libnvdimm/dimm: Avoid race between probe and available_slots_show()

2021-02-01 Thread Dan Williams
a97aa9e8 ("libnvdimm, nvdimm: dimm driver and base libnvdimm device-driver infrastructure") Cc: Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Cc: Coly Li Reported-by: Richard Palethorpe Signed-off-by: Dan Williams --- drivers/nvdimm/dimm_devs.c | 18 +++--- 1 fil

Re: [PATCH 03/14] cxl/mem: Find device capabilities

2021-02-01 Thread Dan Williams
On Mon, Feb 1, 2021 at 4:11 PM Ben Widawsky wrote: > > On 21-02-01 15:58:09, David Rientjes wrote: > > On Mon, 1 Feb 2021, Ben Widawsky wrote: > > > > > > I haven't seen the update to 8.2.8.4.5 to know yet :) > > > > > > > > You make a good point of at least being able to interact with the > > >

Re: [PATCH 04/15] PCI: Add pci_find_vsec_capability() to find a specific VSEC

2021-02-01 Thread Dan Williams
[ add Ben ] On Mon, Feb 1, 2021 at 2:39 PM Bjorn Helgaas wrote: > > [+cc Vinod, Dan, dmaengine] > > On Tue, Dec 15, 2020 at 06:30:13PM +0100, Gustavo Pimentel wrote: > > Add pci_find_vsec_capability() that crawls through the device config > > space searching in all Vendor-Specific Extended

Re: [PATCH v2] nvdimm: Avoid race between probe and reading device attributes

2021-02-01 Thread Dan Williams
12.728923] seq_read+0x389/0xe10 > [ 12.729415] vfs_read+0x101/0x2d0 > [ 12.729891] ksys_read+0xf9/0x1d0 > [ 12.730361] ? kernel_write+0x120/0x120 > [ 12.730915] do_syscall_64+0x95/0x4a0 > [ 12.731435] entry_SYSCALL_64_after_hwframe+0x49/0xb3 [..] > Fixes: 4d88a97aa9e8 (&

Re: [PATCH 03/14] cxl/mem: Find device capabilities

2021-02-01 Thread Dan Williams
On Mon, Feb 1, 2021 at 1:51 PM David Rientjes wrote: > > On Mon, 1 Feb 2021, Ben Widawsky wrote: > > > On 21-01-30 15:51:49, David Rientjes wrote: > > > On Fri, 29 Jan 2021, Ben Widawsky wrote: > > > > > > > +static int cxl_mem_setup_mailbox(struct cxl_mem *cxlm) > > > > +{ > > > > + const int

Re: [PATCH 05/14] cxl/mem: Register CXL memX devices

2021-02-01 Thread Dan Williams
On Mon, Feb 1, 2021 at 1:53 PM David Rientjes wrote: > > On Mon, 1 Feb 2021, Ben Widawsky wrote: > > > > > diff --git a/Documentation/ABI/testing/sysfs-bus-cxl > > > > b/Documentation/ABI/testing/sysfs-bus-cxl > > > > new file mode 100644 > > > > index ..fe7b87eba988 > > > > ---

Re: [PATCH 09/14] cxl/mem: Add a "RAW" send command

2021-02-01 Thread Dan Williams
On Mon, Feb 1, 2021 at 11:36 AM Konrad Rzeszutek Wilk wrote: > > On Mon, Feb 01, 2021 at 11:27:08AM -0800, Ben Widawsky wrote: > > On 21-02-01 13:24:00, Konrad Rzeszutek Wilk wrote: > > > On Fri, Jan 29, 2021 at 04:24:33PM -0800, Ben Widawsky wrote: > > > > The CXL memory device send interface

Re: [PATCH 04/14] cxl/mem: Implement polled mode mailbox

2021-02-01 Thread Dan Williams
On Sat, Jan 30, 2021 at 3:52 PM David Rientjes wrote: > > On Fri, 29 Jan 2021, Ben Widawsky wrote: > > > Provide enough functionality to utilize the mailbox of a memory device. > > The mailbox is used to interact with the firmware running on the memory > > device. > > > > The CXL specification

Re: [PATCH 04/14] cxl/mem: Implement polled mode mailbox

2021-02-01 Thread Dan Williams
On Mon, Feb 1, 2021 at 11:13 AM Ben Widawsky wrote: > > On 21-02-01 12:54:00, Konrad Rzeszutek Wilk wrote: > > > +#define cxl_doorbell_busy(cxlm) > > > \ > > > + (cxl_read_mbox_reg32(cxlm, CXLDEV_MB_CTRL_OFFSET) & > > > \ > > >

Re: [PATCH 08/14] taint: add taint for direct hardware access

2021-02-01 Thread Dan Williams
On Mon, Feb 1, 2021 at 10:35 AM Ben Widawsky wrote: > > On 21-02-01 13:18:45, Konrad Rzeszutek Wilk wrote: > > On Fri, Jan 29, 2021 at 04:24:32PM -0800, Ben Widawsky wrote: > > > For drivers that moderate access to the underlying hardware it is > > > sometimes desirable to allow userspace to

Re: [PATCH 0/3] cdev: Generic shutdown handling

2021-01-30 Thread Dan Williams
On Wed, Jan 20, 2021 at 11:38 AM Dan Williams wrote: > > After reviewing driver submissions with new cdev + ioctl usages one > common stumbling block is coordinating the shutdown of the ioctl path, > or other file operations, at driver ->remove() time. While cdev_del() > guar

Re: [PATCH 05/14] cxl/mem: Register CXL memX devices

2021-01-29 Thread Dan Williams
On Fri, Jan 29, 2021 at 4:25 PM Ben Widawsky wrote: > > From: Dan Williams > > Create the /sys/bus/cxl hierarchy to enumerate: > > * Memory Devices (per-endpoint control devices) > > * Memory Address Space Devices (platform address ranges with > interleaving, p

Re: dax alignment problem on arm64 (and other achitectures)

2021-01-29 Thread Dan Williams
On Fri, Jan 29, 2021 at 5:51 AM Pavel Tatashin wrote: > > > Since we last talked about this the enabling for EFI "Special Purpose" > > / Soft Reserved Memory has gone upstream and instantiates device-dax > > instances for address ranges marked with EFI_MEMORY_SP attribute. > > Critically this way

Re: dax alignment problem on arm64 (and other achitectures)

2021-01-28 Thread Dan Williams
On Wed, Jan 27, 2021 at 1:50 PM Pavel Tatashin wrote: > > On Wed, Jan 27, 2021 at 4:09 PM David Hildenbrand wrote: > > > > On 27.01.21 21:43, Pavel Tatashin wrote: > > > This is something that Dan Williams and I discussed off the mailing > > > list someti

Re: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-21 Thread Dan Williams
On Wed, Jan 13, 2021 at 1:56 AM Greg KH wrote: [..] > > That's not my concern though. The open race that cdev_del() does not > > address is ioctl() called after device-unbind. The open fd is never > > revoked and can live past device_unregister() in which case the ioctl > > needs to revalidate

Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-21 Thread Dan Williams
On Thu, Jan 21, 2021 at 12:13 AM Greg KH wrote: > > On Wed, Jan 20, 2021 at 11:38:57AM -0800, Dan Williams wrote: > > -void cdev_del(struct cdev *p) > > +void cdev_del(struct cdev *cdev) > > { > > - cdev_unmap(p->dev, p->count); > > - kobject_

Re: [PATCH 3/3] libnvdimm/ioctl: Switch to cdev_register_queued()

2021-01-21 Thread Dan Williams
On Thu, Jan 21, 2021 at 12:16 AM Greg KH wrote: > > On Wed, Jan 20, 2021 at 11:39:08AM -0800, Dan Williams wrote: > > The ioctl implementation in libnvdimm is a case study in what can be > > cleaned up when the cdev core handles synchronizing in-flight ioctls > > wit

Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-20 Thread Dan Williams
On Wed, Jan 20, 2021 at 12:20 PM Dan Williams wrote: > > On Wed, Jan 20, 2021 at 11:46 AM Christoph Hellwig wrote: > > > > The subject doesn't make any sense to me. > > > > But thn again queued sound really weird. You just have a managed > > API with a

Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-20 Thread Dan Williams
On Wed, Jan 20, 2021 at 11:51 AM Logan Gunthorpe wrote: > > > > > On 2021-01-20 12:38 p.m., Dan Williams wrote: > > ...common reference count handling scenarios were addressed, but the > > shutdown-synchronization problem was only mentioned as something driver >

Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-20 Thread Dan Williams
On Wed, Jan 20, 2021 at 11:46 AM Christoph Hellwig wrote: > > The subject doesn't make any sense to me. > > But thn again queued sound really weird. You just have a managed > API with a refcount and synchronization, right? Correct. "queue" was in reference to the way q_usage_count behaves, but

[PATCH 3/3] libnvdimm/ioctl: Switch to cdev_register_queued()

2021-01-20 Thread Dan Williams
cleanups. Cc: Vishal Verma Reviewed-by: Dave Jiang Cc: Ira Weiny Signed-off-by: Dan Williams --- drivers/nvdimm/bus.c | 175 +++- drivers/nvdimm/core.c | 14 ++-- drivers/nvdimm/dimm_devs.c | 51 +++-- drivers/nvdimm/nd-core.h

[PATCH 2/3] libnvdimm/ida: Switch to non-deprecated ida helpers

2021-01-20 Thread Dan Williams
In preparation for a rework of character device initialization, take the opportunity to cleanup ida usage. Cc: Vishal Verma Reviewed-by: Dave Jiang Cc: Ira Weiny Signed-off-by: Dan Williams --- drivers/nvdimm/btt_devs.c |6 +++--- drivers/nvdimm/bus.c|4

[PATCH 0/3] cdev: Generic shutdown handling

2021-01-20 Thread Dan Williams
ked with a result of: 4 files changed, 101 insertions(+), 153 deletions(-) --- Dan Williams (3): cdev: Finish the cdev api with queued mode support libnvdimm/ida: Switch to non-deprecated ida helpers libnvdimm/ioctl: Switch to cdev_register_queued() drivers/nvdimm/btt_dev

[PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-20 Thread Dan Williams
andre Belloni Cc: Alexander Viro Reviewed-by: Dave Jiang Signed-off-by: Dan Williams --- fs/char_dev.c| 108 +++--- include/linux/cdev.h | 21 +- 2 files changed, 122 insertions(+), 7 deletions(-) diff --git a/fs/char_dev.c b/

Re: [RFC PATCH v3 02/16] cxl/acpi: Add an acpi_cxl module for the CXL interconnect

2021-01-20 Thread Dan Williams
On Wed, Jan 13, 2021 at 9:55 AM Kaneda, Erik wrote: [..] > > The supplemental tables described here: > > > > https://www.uefi.org/acpi > > > > ...do eventually make there way into ACPICA. Added Bob and Erik in > > case they can comment on when CEDT and CDAT support will be picked up. > > We would

Re: linux-next: build failure after merge of the akpm-current tree

2021-01-19 Thread Dan Williams
On Tue, Jan 19, 2021 at 9:25 PM Stephen Rothwell wrote: > > Hi all, > > After merging the akpm-current tree, today's linux-next build (powerpc > ppc64_defconfig) failed like this: > > mm/memory_hotplug.c: In function 'move_pfn_range_to_zone': > mm/memory_hotplug.c:772:24: error: 'ZONE_DEVICE'

[PATCH] mm: Fix ZONE_DEVICE usage in move_pfn_range_to_zone()

2021-01-19 Thread Dan Williams
Randy reports the build breaks with recent additions of section_taint_zone_device() in move_pfn_range_to_zone(). Fix that by including a conditionally stubbed out zone_is_zone_device() helper. Reported-by: Randy Dunlap Signed-off-by: Dan Williams --- Andrew, apologies for the thrash. Please

Re: [PATCH -mmotm] mm/memory_hotplug: fix for CONFIG_ZONE_DEVICE not enabled

2021-01-19 Thread Dan Williams
On Tue, Jan 19, 2021 at 7:05 PM Randy Dunlap wrote: > > From: Randy Dunlap > > Fix memory_hotplug.c when CONFIG_ZONE_DEVICE is not enabled. > > Fixes this build error: > > ../mm/memory_hotplug.c: In function ‘move_pfn_range_to_zone’: > ../mm/memory_hotplug.c:772:24: error: ‘ZONE_DEVICE’

Re: [PATCH v4 4/5] mm: Fix page reference leak in soft_offline_page()

2021-01-17 Thread Dan Williams
On Sun, Jan 17, 2021 at 2:01 PM Andrew Morton wrote: > > On Wed, 13 Jan 2021 16:43:32 -0800 Dan Williams > wrote: > > > The conversion to move pfn_to_online_page() internal to > > soft_offline_page() missed that the get_user_pages() reference taken by > > the madv

Re: [PATCH v2 0/2] Make it possible to reserve memory on 64bit platform

2021-01-17 Thread Dan Williams
On Sat, Jan 16, 2021 at 2:43 AM Wesley Zhao wrote: > > I was trying to reserve some memory to save logs incase that Android panic or > hang and then > I can read the logs from QNX side from the memory reserved before on the > Qualcomm 8155 hypervisor platform, > and I find the "reserve="

Re: [PATCH 04/10] mm, fsdax: Refactor memory-failure handler for dax mapping

2021-01-14 Thread Dan Williams
On Wed, Dec 30, 2020 at 8:59 AM Shiyang Ruan wrote: > > The current memory_failure_dev_pagemap() can only handle single-mapped > dax page for fsdax mode. The dax page could be mapped by multiple files > and offsets if we let reflink feature & fsdax mode work together. So, > we refactor current

Re: [PATCH v4 4/5] mm: Fix page reference leak in soft_offline_page()

2021-01-13 Thread Dan Williams
On Wed, Jan 13, 2021 at 5:50 PM HORIGUCHI NAOYA(堀口 直也) wrote: > > On Wed, Jan 13, 2021 at 04:43:32PM -0800, Dan Williams wrote: > > The conversion to move pfn_to_online_page() internal to > > soft_offline_page() missed that the get_user_pages() reference taken by > >

[PATCH v4 5/5] mm: Fix memory_failure() handling of dax-namespace metadata

2021-01-13 Thread Dan Williams
rew Morton Reported-by: David Hildenbrand Reviewed-by: David Hildenbrand Signed-off-by: Dan Williams --- include/linux/memremap.h |6 ++ mm/memory-failure.c |6 ++ mm/memremap.c| 15 +++ 3 files changed, 27 insertions(+) diff --git a/include/linux/me

[PATCH v4 3/5] mm: Teach pfn_to_online_page() about ZONE_DEVICE section collisions

2021-01-13 Thread Dan Williams
and Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Signed-off-by: Dan Williams --- include/linux/mmzone.h | 22 +++--- mm/memory_hotplug.c| 38 ++ 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/include/lin

[PATCH v4 2/5] mm: Teach pfn_to_online_page() to consider subsection validity

2021-01-13 Thread Dan Williams
Cc: Michal Hocko Cc: Oscar Salvador Reported-by: David Hildenbrand Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Signed-off-by: Dan Williams --- mm/memory_hotplug.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/mm/memory_hotp

[PATCH v4 4/5] mm: Fix page reference leak in soft_offline_page()

2021-01-13 Thread Dan Williams
David Hildenbrand Reviewed-by: Oscar Salvador Cc: Signed-off-by: Dan Williams --- mm/memory-failure.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 5a38e9eade94..78b173c7190c 100644 --- a/mm/memory-

[PATCH v4 1/5] mm: Move pfn_to_online_page() out of line

2021-01-13 Thread Dan Williams
-by: Dan Williams --- include/linux/memory_hotplug.h | 17 + mm/memory_hotplug.c| 16 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 15acce5ab106..3d99de0db2dd 100644

[PATCH v4 0/5] mm: Fix pfn_to_online_page() with respect to ZONE_DEVICE

2021-01-13 Thread Dan Williams
to lookup ZONE_DEVICE pages, however that mapping may contain data pages and metadata raw pfns. Introduce pgmap_pfn_valid() to delineate the 2 types and fail the handling of raw metadata pfns. --- Dan Williams (5): mm: Move pfn_to_online_page() out of line mm: Teach pfn_to_online_p

Re: [PATCH v3 2/6] mm: Teach pfn_to_online_page() to consider subsection validity

2021-01-13 Thread Dan Williams
On Wed, Jan 13, 2021 at 12:29 AM David Hildenbrand wrote: > > On 13.01.21 08:35, Dan Williams wrote: > > pfn_section_valid() determines pfn validity on subsection granularity > > where pfn_valid() may be limited to coarse section granularity. > > Explicitly validate sub

[PATCH v3 1/6] mm: Move pfn_to_online_page() out of line

2021-01-12 Thread Dan Williams
-by: Dan Williams --- include/linux/memory_hotplug.h | 17 + mm/memory_hotplug.c| 16 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 15acce5ab106..3d99de0db2dd 100644

[PATCH v3 5/6] mm: Fix memory_failure() handling of dax-namespace metadata

2021-01-12 Thread Dan Williams
of get_dev_pagemap() are not a concern because those are operating on known data pfns having been looking up by get_user_pages(). I.e. metadata pfns are never user mapped. Cc: Naoya Horiguchi Cc: Andrew Morton Reported-by: David Hildenbrand Signed-off-by: Dan Williams --- include/linux/memremap.h

[PATCH v3 6/6] libnvdimm/namespace: Fix visibility of namespace resource attribute

2021-01-12 Thread Dan Williams
n this fix. Fixes: bfd2e9140656 ("libnvdimm: Simplify root read-only definition for the 'resource' attribute") Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Cc: Signed-off-by: Dan Williams --- drivers/nvdimm/namespace_devs.c | 10 +- 1 file changed, 5 insertions(+), 5 dele

[PATCH v3 3/6] mm: Teach pfn_to_online_page() about ZONE_DEVICE section collisions

2021-01-12 Thread Dan Williams
and Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Signed-off-by: Dan Williams --- include/linux/mmzone.h | 22 +++--- mm/memory_hotplug.c| 38 ++ 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/include/lin

[PATCH v3 4/6] mm: Fix page reference leak in soft_offline_page()

2021-01-12 Thread Dan Williams
David Hildenbrand Reviewed-by: Oscar Salvador Cc: Signed-off-by: Dan Williams --- mm/memory-failure.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 5a38e9eade94..78b173c7190c 100644 --- a/mm/memory-

[PATCH v3 2/6] mm: Teach pfn_to_online_page() to consider subsection validity

2021-01-12 Thread Dan Williams
Cc: Michal Hocko Cc: Oscar Salvador Reported-by: David Hildenbrand Signed-off-by: Dan Williams --- mm/memory_hotplug.c | 24 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 55a69d4396e7..9f37f8a68da4 10064

[PATCH v3 0/6] mm: Fix pfn_to_online_page() with respect to ZONE_DEVICE

2021-01-12 Thread Dan Williams
w pfns. Introduce pgmap_pfn_valid() to delineate the 2 types and fail the handling of raw metadata pfns. --- Dan Williams (6): mm: Move pfn_to_online_page() out of line mm: Teach pfn_to_online_page() to consider subsection validity mm: Teach pfn_to_online_page() about

Re: [PATCH v2 2/5] mm: Teach pfn_to_online_page() to consider subsection validity

2021-01-12 Thread Dan Williams
On Tue, Jan 12, 2021 at 1:53 AM David Hildenbrand wrote: > > On 12.01.21 10:34, Dan Williams wrote: > > pfn_section_valid() determines pfn validity on subsection granularity. > > > > pfn_valid_within() internally uses pfn_section_valid(), but gates it > > wi

Re: [PATCH v2 4/5] mm: Fix page reference leak in soft_offline_page()

2021-01-12 Thread Dan Williams
On Tue, Jan 12, 2021 at 1:54 AM Oscar Salvador wrote: > > On Tue, Jan 12, 2021 at 01:34:58AM -0800, Dan Williams wrote: > > The conversion to move pfn_to_online_page() internal to > > soft_offline_page() missed that the get_user_pages() reference needs to > > be dropped

Re: [RFC PATCH v3 04/16] cxl/mem: Introduce a driver for CXL-2.0-Type-3 endpoints

2021-01-12 Thread Dan Williams
On Tue, Jan 12, 2021 at 11:03 AM Jonathan Cameron wrote: > > On Mon, 11 Jan 2021 14:51:08 -0800 > Ben Widawsky wrote: > > > From: Dan Williams > > > > The CXL.mem protocol allows a device to act as a provider of "System > > RAM" and/or "Persist

Re: [PATCH] mm: Teach pfn_to_online_page() about ZONE_DEVICE section collisions

2021-01-12 Thread Dan Williams
On Tue, Jan 12, 2021 at 1:44 AM David Hildenbrand wrote: > > On 12.01.21 10:18, Dan Williams wrote: > > On Thu, Jan 7, 2021 at 1:16 AM David Hildenbrand wrote: > >> > >> [...] > >> > >>>>> Well, I would love to have no surprises either.

Re: [RFC PATCH v3 05/16] cxl/mem: Map memory device registers

2021-01-12 Thread Dan Williams
On Tue, Jan 12, 2021 at 11:21 AM Ben Widawsky wrote: > > On 21-01-12 19:13:42, Jonathan Cameron wrote: > > On Mon, 11 Jan 2021 14:51:09 -0800 > > Ben Widawsky wrote: > > > > > All the necessary bits are initialized in order to find and map the > > > register space for CXL Memory Devices. This is

Re: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-12 Thread Dan Williams
On Sun, Jan 10, 2021 at 7:06 AM Greg KH wrote: > > On Sat, Jan 09, 2021 at 01:49:42PM -0800, Dan Williams wrote: > > On Sat, Jan 9, 2021 at 12:34 AM Greg KH wrote: > > > > > > On Sat, Jan 09, 2021 at 07:49:24AM +, Chen, Mike Ximing wrote: > > &g

Re: [RFC PATCH v3 02/16] cxl/acpi: Add an acpi_cxl module for the CXL interconnect

2021-01-12 Thread Dan Williams
he OS has native support for the CXL > > capabilities of endpoints. > > > > Note: the actbl1.h changes are speculative. The expectation is that they > > will arrive through the ACPICA tree in due time. > > I would pull the ACPICA changes out into a precursor patch. &

[PATCH v2 4/5] mm: Fix page reference leak in soft_offline_page()

2021-01-12 Thread Dan Williams
down due to a leaked reference. Fixes: feec24a6139d ("mm, soft-offline: convert parameter to pfn") Cc: Andrew Morton Cc: Naoya Horiguchi Cc: David Hildenbrand Cc: Michal Hocko Cc: Oscar Salvador Cc: Signed-off-by: Dan Williams --- mm/memory-failure.c | 20

[PATCH v2 5/5] libnvdimm/namespace: Fix visibility of namespace resource attribute

2021-01-12 Thread Dan Williams
n this fix. Fixes: bfd2e9140656 ("libnvdimm: Simplify root read-only definition for the 'resource' attribute") Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Cc: Signed-off-by: Dan Williams --- drivers/nvdimm/namespace_devs.c | 10 +- 1 file changed, 5 insertions(+), 5 dele

[PATCH v2 3/5] mm: Teach pfn_to_online_page() about ZONE_DEVICE section collisions

2021-01-12 Thread Dan Williams
brand Signed-off-by: Dan Williams --- include/linux/mmzone.h | 22 +++--- mm/memory_hotplug.c| 38 ++ 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index b593316bff3d.

[PATCH v2 2/5] mm: Teach pfn_to_online_page() to consider subsection validity

2021-01-12 Thread Dan Williams
pfn_section_valid() determines pfn validity on subsection granularity. pfn_valid_within() internally uses pfn_section_valid(), but gates it with early_section() to preserve the traditional behavior of pfn_valid() before subsection support was added. pfn_to_online_page() wants the explicit

[PATCH v2 1/5] mm: Move pfn_to_online_page() out of line

2021-01-12 Thread Dan Williams
pfn_to_online_page() is already too large to be a macro or an inline function. In anticipation of further logic changes / growth, move it out of line. No functional change, just code movement. Cc: David Hildenbrand Reported-by: Michal Hocko Signed-off-by: Dan Williams --- include/linux

[PATCH v2 0/5] mm: Fix pfn_to_online_page() with respect to ZONE_DEVICE

2021-01-12 Thread Dan Williams
e resource base for memmap=ss!nn defined namespaces. This is needed for the regression test for soft_offline_page(). --- Dan Williams (5): mm: Move pfn_to_online_page() out of line mm: Teach pfn_to_online_page() to consider subsection validity mm: Teach pfn_to_online_pa

Re: [PATCH] mm: Teach pfn_to_online_page() about ZONE_DEVICE section collisions

2021-01-12 Thread Dan Williams
On Thu, Jan 7, 2021 at 1:16 AM David Hildenbrand wrote: > > [...] > > >>> Well, I would love to have no surprises either. So far there was not > >>> actual argument why the pmem reserved space cannot be fully initialized. > >> > >> Yes, I'm still hoping Dan can clarify that. > > > > Complexity

Re: [PATCH] mm: Teach pfn_to_online_page() about ZONE_DEVICE section collisions

2021-01-12 Thread Dan Williams
On Wed, Jan 6, 2021 at 1:55 AM Michal Hocko wrote: > > On Tue 05-01-21 20:07:18, Dan Williams wrote: > > While pfn_to_online_page() is able to determine pfn_valid() at > > subsection granularity it is not able to reliably determine if a given > > pfn is also online

Re: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-09 Thread Dan Williams
On Sat, Jan 9, 2021 at 12:34 AM Greg KH wrote: > > On Sat, Jan 09, 2021 at 07:49:24AM +, Chen, Mike Ximing wrote: > > > > +static int dlb_ioctl_arg_size[NUM_DLB_CMD] = { > > > > + sizeof(struct dlb_get_device_version_args), > > > > + sizeof(struct dlb_create_sched_domain_args), > > > > +

Re: [PATCH] x86: fix movdir64b() sparse warning

2021-01-06 Thread Dan Williams
rom the comment in movdir64b @__dst must be supplied as an lvalue because this tells the compiler what the object is (its size) the instruction accesses. I.e., not the pointers but what they point to, thus the deref'ing '*'." With clarified changelog for both you can add: Reviewed-by: Dan Williams

Re: [PATCH] mm: Teach pfn_to_online_page() about ZONE_DEVICE section collisions

2021-01-06 Thread Dan Williams
On Wed, Jan 6, 2021 at 3:23 AM David Hildenbrand wrote: > > On 06.01.21 11:42, Michal Hocko wrote: > > On Wed 06-01-21 10:56:19, David Hildenbrand wrote: > > [...] > >> Note that this is not sufficient in the general case. I already > >> mentioned that we effectively override an already

[PATCH] mm: Teach pfn_to_online_page() about ZONE_DEVICE section collisions

2021-01-05 Thread Dan Williams
Signed-off-by: Dan Williams --- This compiles and passes the nvdimm unit tests, but I have not tested with pfn walkers in the presence of ZONE_DEVICE collisions. include/linux/memory_hotplug.h | 17 +- include/linux/mmzone.h | 22 mm/memory_hotplug.c

Re: [PATCH] ACPI: NFIT: Fix flexible_array.cocci warnings

2021-01-05 Thread Dan Williams
On Tue, Jan 5, 2021 at 1:28 PM Verma, Vishal L wrote: > > On Tue, 2021-01-05 at 13:03 -0800, Dan Williams wrote: > > Julia and 0day report: > > > > Zero-length and one-element arrays are deprecated, see > > Documentation/process/deprecated.rst > > F

<    1   2   3   4   5   6   7   8   9   10   >