| 131 +++-
> drivers/cxl/pci.c | 123 +++-
> drivers/dax/bus.c | 352 +++++--
> drivers/dax/bus.h | 4 +-
> drivers/dax/cxl.c | 72 ++-
> drivers/dax/dax-private.h | 47 +-
> drivers/dax/hmem/hmem.c | 2 +-
> drivers/dax/pmem.c| 2 +-
> fs/btrfs/ordered-data.c | 10 +-
> include/acpi/actbl1.h | 2 +
> include/cxl/event.h | 32 +
> include/linux/range.h | 7 +
> lib/test_printf.c | 70 +++
> lib/vsprintf.c| 55 +-
> tools/testing/cxl/Kbuild | 3 +-
> tools/testing/cxl/test/mem.c | 960
> ++
> 29 files changed, 3576 insertions(+), 320 deletions(-)
> ---
> base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
> change-id: 20230604-dcd-type2-upstream-0cd15f6216fd
>
> Best regards,
> --
> Ira Weiny
>
--
Fan Ni
f %pa misaligned\n", &to_alloc))
> + return -ENXIO;
> +
> +retry:
> + alloc = dev_dax_resize_static(&dax_region->res, dev_dax, to_alloc);
> + if (alloc <= 0)
> + return alloc;
> to_alloc -= alloc;
> if (to_alloc)
> goto retry;
> @@ -1198,7 +1225,8 @@ static ssize_t mapping_store(struct device *dev, struct
> device_attribute *attr,
>
> to_alloc = range_len(&r);
> if (alloc_is_aligned(dev_dax, to_alloc))
> - rc = alloc_dev_dax_range(dev_dax, r.start, to_alloc);
> + rc = alloc_dev_dax_range(&dax_region->res, dev_dax, r.start,
> + to_alloc);
> up_write(&dax_dev_rwsem);
> up_write(&dax_region_rwsem);
>
> @@ -1466,7 +1494,8 @@ static struct dev_dax *__devm_create_dev_dax(struct
> dev_dax_data *data)
> device_initialize(dev);
> dev_set_name(dev, "dax%d.%d", dax_region->id, dev_dax->id);
>
> - rc = alloc_dev_dax_range(dev_dax, dax_region->res.start, data->size);
> + rc = alloc_dev_dax_range(&dax_region->res, dev_dax,
> dax_region->res.start,
> + data->size);
> if (rc)
> goto err_range;
>
>
> --
> 2.46.0
>
--
Fan Ni
avneet Singh
> Co-developed-by: Ira Weiny
> Signed-off-by: Ira Weiny
>
Reviewed-by: Fan Ni
Tested-by: Fan Ni
> ---
> Changes:
> [djiang: Split sysfs docs up]
> [iweiny: Adjust sysfs docs dates]
> ---
> Documentation/ABI/testing/sysfs-bus-cxl |
' is N times bigger than 'max_extents'(e,g.
> > > cnt=20, max_extents=10). all responses will be sent in this
> > > xa_for_each(), and CXL_DCD_EVENT_MORE will be set in the last response
> > > but it should not be set in these cases.
> > >
> >
> > Ah yes. cnt must be decremented. As I looked at the patch just now the
> >
> > if (cnt == 0 || pl_index)
> >
> > ... seemed very wrong to me. That change masked this bug.
> >
> > This should fix it:
> >
> > diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> > index d66beec687a0..99200274dea8 100644
> > --- a/drivers/cxl/core/mbox.c
> > +++ b/drivers/cxl/core/mbox.c
> > @@ -1119,10 +1119,11 @@ static int cxl_send_dc_response(struct
> > cxl_memdev_state *mds, int opcode,
> > if (rc)
> > return rc;
> > pl_index = 0;
> > + cnt -= pl_index;
> > }
> > }
> >
> > - if (cnt == 0 || pl_index) {
>
> I thought this cnt == 0 check was to deal with the no valid
> extents case where an empty reply is needed.
Agreed. Based on current code logic, there are two cases that cnt == 0:
1. no extent is accepted so cnt is passed as 0;
2. cnt was decreased to 0 and response has already been sent.
For case 1, we still need to send a response with zero extents;
For case 2, we do not need to handle.
Fan
>
>
> > + if (pl_index) {
> > mbox_cmd = (struct cxl_mbox_cmd) {
> > .opcode = opcode,
> > .size_in = struct_size(response, extent_list,
> >
> >
> > Thank you, and sorry again for missing your feedback.
> >
> > Ira
> >
> > [snip]
> >
>
--
Fan Ni
HPA offset. In addition, well behaved
> extents should be contained within an endpoint decoder.
>
> Return the endpoint decoder found to be used in subsequent DCD code.
>
> Signed-off-by: Ira Weiny
Reviewed-by: Fan Ni
> ---
> drivers/cxl/core/core.h | 6 --
> driv
ms(mds, &policy, native_cxl);
> if (rc)
> return rc;
>
> @@ -790,12 +834,16 @@ static int cxl_event_config(struct pci_host_bridge
> *host_bridge,
> if (rc)
> return rc;
>
> - rc = cxl_event_irqsetup(mds, &policy);
> + rc = cxl_irqsetup(mds, &policy, native_cxl);
> if (rc)
> return rc;
>
> cxl_mem_get_event_records(mds, CXLDEV_EVENT_STATUS_ALL);
>
> + dev_dbg(mds->cxlds.dev, "Event config : %s DCD %s\n",
> + native_cxl ? "OS" : "BIOS",
> + cxl_dcd_supported(mds) ? "supported" : "not supported");
> +
> return 0;
> }
>
>
> --
> 2.46.0
>
--
Fan Ni
nt interrupt configuration.
>
> Factor out event interrupt setting validation.
>
> Reviewed-by: Dave Jiang
> Reviewed-by: Jonathan Cameron
> Signed-off-by: Ira Weiny
>
Reviewed-by: Fan Ni
> ---
> Changes:
> [iweiny: reword commit message]
> [iweiny: keep revi
nt interrupt configuration.
>
> Split cxl_event_config_msgnums() from irq setup in preparation for
> separate DCD interrupts configuration.
>
> Signed-off-by: Ira Weiny
> ---
One minor comment inline; otherwise
Reviewed-by: Fan Ni
> drivers/cxl/pci.c | 24 -
ruct device *dev)
> struct cxl_region *cxlr = cxlr_dax->cxlr;
> struct dax_region *dax_region;
> struct dev_dax_data data;
> + resource_size_t dev_size;
> + unsigned long flags;
>
> if (nid == NUMA_NO_NODE)
> nid = memory_add_physaddr_to_nid(cxlr_dax->hpa_range.start);
>
> + flags = IORESOURCE_DAX_KMEM;
> + if (cxlr->mode == CXL_REGION_DC)
> + flags |= IORESOURCE_DAX_SPARSE_CAP;
> +
> dax_region = alloc_dax_region(dev, cxlr->id, &cxlr_dax->hpa_range, nid,
> - PMD_SIZE, IORESOURCE_DAX_KMEM);
> + PMD_SIZE, flags);
> if (!dax_region)
> return -ENOMEM;
>
> + if (cxlr->mode == CXL_REGION_DC)
> + /* Add empty seed dax device */
> + dev_size = 0;
> + else
> + dev_size = range_len(&cxlr_dax->hpa_range);
> +
> data = (struct dev_dax_data) {
> .dax_region = dax_region,
> .id = -1,
> - .size = range_len(&cxlr_dax->hpa_range),
> + .size = dev_size,
> .memmap_on_memory = true,
> };
>
>
> --
> 2.46.0
>
--
Fan Ni
> Refactor create_pmem_region_store() and create_ram_region_store() to use
> a single common function to be used in subsequent DC code.
>
> Suggested-by: Fan Ni
> Signed-off-by: Ira Weiny
> ---
Reviewed-by: Fan Ni
> drivers/cxl/core/region.c | 28 +++-
> 1 file cha
> \
> + .attrs = cxl_memdev_dc##n##_attributes,
> \
> + .is_visible = SYSFS_GROUP_VISIBLE(cxl_memdev_dc##n),
> \
> +}
> +CXL_MEMDEV_DC_ATTR_GROUP(0);
> +CXL_MEMDEV_DC_ATTR_GROUP(1);
> +CXL_MEMDEV_DC_ATTR_GROUP(2);
> +CXL_MEMDEV_DC_ATTR_GROUP(3);
> +CXL_MEMDEV_DC_ATTR_GROUP(4);
> +CXL_MEMDEV_DC_ATTR_GROUP(5);
> +CXL_MEMDEV_DC_ATTR_GROUP(6);
> +CXL_MEMDEV_DC_ATTR_GROUP(7);
> +
> static umode_t cxl_memdev_visible(struct kobject *kobj, struct attribute *a,
> int n)
> {
> @@ -525,6 +643,14 @@ static struct attribute_group
> cxl_memdev_security_attribute_group = {
> };
>
> static const struct attribute_group *cxl_memdev_attribute_groups[] = {
> + &cxl_memdev_dc0_group,
> + &cxl_memdev_dc1_group,
> + &cxl_memdev_dc2_group,
> + &cxl_memdev_dc3_group,
> + &cxl_memdev_dc4_group,
> + &cxl_memdev_dc5_group,
> + &cxl_memdev_dc6_group,
> + &cxl_memdev_dc7_group,
> &cxl_memdev_attribute_group,
> &cxl_memdev_ram_attribute_group,
> &cxl_memdev_pmem_attribute_group,
>
> --
> 2.46.0
>
--
Fan Ni
XL_MAX_DC_REGION];
>
> struct cxl_event_state event;
> struct cxl_poison_state poison;
> diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
> index 199afc2cd122..387fc821703a 100644
> --- a/include/acpi/actbl1.h
> +++ b/include/acpi/actbl1.h
> @@ -403,6 +403,8 @@ struct acpi_cdat_dsmas {
> /* Flags for subtable above */
>
> #define ACPI_CDAT_DSMAS_NON_VOLATILE(1 << 2)
> +#define ACPI_CDAT_DSMAS_SHAREABLE (1 << 3)
> +#define ACPI_CDAT_DSMAS_READ_ONLY (1 << 6)
>
> /* Subtable 1: Device scoped Latency and Bandwidth Information Structure
> (DSLBIS) */
>
>
> --
> 2.46.0
>
--
Fan Ni
oped-by: Ira Weiny
> Signed-off-by: Ira Weiny
>
Reviewed-by: Fan Ni
> ---
> Changes:
> [iweiny: rebase]
> [Jonathan: remove dead code]
> [Jonathan: clarify commit message]
> ---
> drivers/cxl/core/cdat.c | 6 ++--
> drivers/cxl/core/region.c
event configuration.
>
> Reviewed-by: Davidlohr Bueso
> Reviewed-by: Dave Jiang
> Reviewed-by: Jonathan Cameron
> Signed-off-by: Ira Weiny
>
Reviewed-by: Fan Ni
> ---
> Changes:
> [iweiny: keep tags for early simple patch]
> [Davidlohr, Jonathan, djiang: move to be
y
> To: Jonathan Corbet (maintainer:DOCUMENTATION)
> Cc: linux-...@vger.kernel.org
> Cc: linux-ker...@vger.kernel.org (open list)
> Signed-off-by: Ira Weiny
> ---
Reviewed-by: Fan Ni
> drivers/cxl/core/cdat.c | 8
> 1 file changed, 4 insertions(+), 4 deletions(-
p, the number of bits is determined by the field
> * width which must be explicitly specified either as part of the
> * format string '%32b[l]' or through '%*b[l]', [l] selects
> @@ -2399,8 +2437,13 @@ char *pointer(const char *fmt, char *buf, char *end,
> void *ptr,
> fallthrough;
> case 'B':
> return symbol_string(buf, end, ptr, spec, fmt);
> - case 'R':
> case 'r':
> + switch (fmt[1]) {
> + case 'a':
> + return range_string(buf, end, ptr, spec, fmt);
> + }
> + fallthrough;
> + case 'R':
> return resource_string(buf, end, ptr, spec, fmt);
> case 'h':
> return hex_string(buf, end, ptr, spec, fmt);
>
> --
> 2.46.0
>
--
Fan Ni
Petr Mladek
> To: Steven Rostedt
> To: Andy Shevchenko
> To: Rasmus Villemoes
> To: Sergey Senozhatsky
> Cc: linux-...@vger.kernel.org
> Signed-off-by: Ira Weiny
Reviewed-by: Fan Ni
Tested-by: Fan Ni
>
> ---
> [lkp: ensure phys_addr_t is within limits fo
On Tue, Oct 08, 2024 at 03:57:13PM -0700, Fan Ni wrote:
> On Mon, Oct 07, 2024 at 06:16:06PM -0500, Ira Weiny wrote:
> > A git tree of this series can be found here:
> >
> > https://github.com/weiny2/linux-kernel/tree/dcd-v4-2024-10-04
> >
> > Series info
--
> drivers/dax/bus.h | 4 +-
> drivers/dax/cxl.c | 72 ++-
> drivers/dax/dax-private.h | 47 +-
> drivers/dax/hmem/hmem.c | 2 +-
> drivers/dax/pmem.c| 2 +-
> fs/btrfs/ordered-data.c | 10 +-
> include/acpi/actbl1.h | 2 +
> include/cxl/event.h | 32 +
> include/linux/range.h | 7 +
> lib/test_printf.c | 70 +++
> lib/vsprintf.c| 55 +-
> tools/testing/cxl/Kbuild | 3 +-
> tools/testing/cxl/test/mem.c | 960
> ++
> 29 files changed, 3576 insertions(+), 320 deletions(-)
> ---
> base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
> change-id: 20230604-dcd-type2-upstream-0cd15f6216fd
>
> Best regards,
> --
> Ira Weiny
>
--
Fan Ni
event configuration.
>
> Reviewed-by: Davidlohr Bueso
> Reviewed-by: Dave Jiang
> Reviewed-by: Jonathan Cameron
> Signed-off-by: Ira Weiny
>
> ---
Reviewed-by: Fan Ni
> Changes:
> [iweiny: keep tags for early simple patch]
> [Davidlohr, Jonathan, djiang: move to be
g.
>
> Signed-off-by: Navneet Singh
> Signed-off-by: Ira Weiny
>
With the following cxl spec version fixed,
Reviewed-by: Fan Ni
> ---
> Changes:
> [Alison: Update commit message]
> ---
> drivers/cxl/core/mbox
y
> Signed-off-by: Ira Weiny
With the minor things fixed mentioned by Jonathan and Dave,
Reviewed-by: Fan Ni
>
> ---
> Changes:
> [iweiny: Leverage the new add path from the event processing code such
>that the adding and surfacing of extents flows through the same
&
On Fri, Aug 16, 2024 at 09:44:26AM -0500, ira.we...@intel.com wrote:
> From: Navneet Singh
>
> A dynamic capacity device (DCD) sends events to signal the host for
> changes in the availability of Dynamic Capacity (DC) memory. These
> events contain extents describing a DPA range and meta data fo
avneet Singh
> Co-developed-by: Ira Weiny
> Signed-off-by: Ira Weiny
Reviewed-by: Fan Ni
>
> ---
> Changes:
> [iweiny: split this out]
> [Jonathan: add documentation for extent sysfs]
> [Jonathan/djbw: s/label/tag]
> [Jonathan/djbw: treat tag as uuid]
> [djbw: use
On Tue, Aug 27, 2024 at 01:08:29PM +0100, Jonathan Cameron wrote:
> On Fri, 23 Aug 2024 14:32:32 -0700
> Fan Ni wrote:
>
> > On Fri, Aug 16, 2024 at 09:44:26AM -0500, ira.we...@intel.com wrote:
> > > From: Navneet Singh
> > >
> > > A dynamic capaci
On Fri, Aug 16, 2024 at 09:44:26AM -0500, ira.we...@intel.com wrote:
> From: Navneet Singh
>
> A dynamic capacity device (DCD) sends events to signal the host for
> changes in the availability of Dynamic Capacity (DC) memory. These
> events contain extents describing a DPA range and meta data fo
nt interrupt configuration.
>
> Factor out event interrupt setting validation.
>
> Reviewed-by: Dave Jiang
> Reviewed-by: Jonathan Cameron
> Signed-off-by: Ira Weiny
>
Reviewed-by: Fan Ni
> ---
> Changes:
> [iweiny: reword commit message]
> [iweiny: keep revi
nt interrupt configuration.
>
> Split cxl_event_config_msgnums() from irq setup in preparation for
> separate DCD interrupts configuration.
>
> Signed-off-by: Ira Weiny
> ---
Reviewed-by: Fan Ni
> drivers/cxl/pci.c | 24
> 1 file changed, 12 inse
> Refactor create_pmem_region_store() and create_ram_region_store() to use
> a single common function to be used in subsequent DC code.
>
> Suggested-by: Fan Ni
> Signed-off-by: Ira Weiny
> ---
Reviewed-by: Fan Ni
> drivers/cxl/core/region.c | 28 +++-
> 1 file cha
On Fri, Aug 16, 2024 at 09:44:21AM -0500, ira.we...@intel.com wrote:
> From: Navneet Singh
>
> Dynamic Capacity CXL regions must allow memory to be added or removed
> dynamically. In addition to the quantity of memory available the
> location of the memory within a DC partition is dynamic based
On Fri, Aug 16, 2024 at 02:45:47PM -0700, Dave Jiang wrote:
>
>
> On 8/16/24 7:44 AM, ira.we...@intel.com wrote:
> > From: Navneet Singh
> >
> > Devices which optionally support Dynamic Capacity (DC) are configured
> > via mailbox commands. CXL 3.1 requires the host to issue the Get DC
> > Con
31 matches
Mail list logo