Re: [PATCH][next] dax: remove redundant assignment to variable rc

2024-04-15 Thread Dave Jiang
ning: Value stored to 'rc' is never > read [deadcode.DeadStores] > > Signed-off-by: Colin Ian King Reviewed-by: Dave Jiang > --- > drivers/dax/bus.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c > index 797e1ebff299..

[GIT PULL] NVDIMM//DAX changes for 6.9

2024-03-14 Thread Dave Jiang
Hi Linus, please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git tags/libnvdimm-for-6.9 ... to get updates to the nvdimm tree. They are a number of updates to interfaces used by nvdimm/dax and a documentation fix. Doc fixes: ACPI_NFIT Kconfig documetation

Re: [PATCH] dax: remove SLAB_MEM_SPREAD flag usage

2024-02-27 Thread Dave Jiang
On 2/24/24 6:47 AM, chengming.z...@linux.dev wrote: > From: Chengming Zhou > > The SLAB_MEM_SPREAD flag is already a no-op as of 6.8-rc1, remove > its usage so we can delete it from slab. No functional change. Can you please provide a Link tag to the lore post that indicates SLAB_MEM_SPREAD

Re: [PATCH] dax: constify the struct device_type usage

2024-02-23 Thread Dave Jiang
read-only memory which can not be modified at runtime. > > Cc: Greg Kroah-Hartman > Signed-off-by: Ricardo B. Marliere Reviewed-by: Dave Jiang > --- > drivers/dax/bus.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/dax/bus.c b/driver

Re: [PATCH] device-dax: make dax_bus_type const

2024-02-05 Thread Dave Jiang
g Kroah-Hartman > Suggested-by: Greg Kroah-Hartman > Signed-off-by: Ricardo B. Marliere Reviewed-by: Dave Jiang > --- > drivers/dax/bus.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c > index 1659b787b65f..

Re: [PATCH] nvdimm: make nvdimm_bus_type const

2024-02-05 Thread Dave Jiang
g Kroah-Hartman > Suggested-by: Greg Kroah-Hartman > Signed-off-by: Ricardo B. Marliere Reviewed-by: Dave Jiang > --- > drivers/nvdimm/bus.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c >

Re: [PATCH] driver core: Add a guard() definition for the device_lock()

2023-12-14 Thread Dave Jiang
Cc: Ira Weiny > Cc: Peter Zijlstra > Cc: Greg Kroah-Hartman > Cc: Andrew Morton > Signed-off-by: Dan Williams Reviewed-by: Dave Jiang > --- > Hi Greg, > > I wonder if you might include this change in v6.7-rc to ease some patch > sets alternately going through my tree and

Re: [PATCH] [v2] nvdimm-btt: simplify code with the scope based resource management

2023-12-14 Thread Dave Jiang
On 12/14/23 01:39, Dinghao Liu wrote: > Use the scope based resource management (defined in > linux/cleanup.h) to automate resource lifetime > control on struct btt_sb *super in discover_arenas(). > > Signed-off-by: Dinghao Liu Reviewed-by: Dave Jiang > --- > >

Re: [PATCH] nvdimm-btt: simplify code with the scope based resource management

2023-12-13 Thread Dave Jiang
On 12/12/23 20:12, dinghao@zju.edu.cn wrote: >> >> On 12/10/23 03:27, Dinghao Liu wrote: >>> Use the scope based resource management (defined in >>> linux/cleanup.h) to automate resource lifetime >>> control on struct btt_sb *super in discover_arenas(). >>> >>> Signed-off-by: Dinghao Liu

Re: [PATCH] nvdimm: Remove usage of the deprecated ida_simple_xx() API

2023-12-11 Thread Dave Jiang
On 12/10/23 10:13, Christophe JAILLET wrote: > ida_alloc() and ida_free() should be preferred to the deprecated > ida_simple_get() and ida_simple_remove(). > > This is less verbose. > > Signed-off-by: Christophe JAILLET Reviewed-by: Dave Jiang > --- > drivers/nvd

Re: [PATCH] nvdimm-btt: simplify code with the scope based resource management

2023-12-11 Thread Dave Jiang
On 12/10/23 03:27, Dinghao Liu wrote: > Use the scope based resource management (defined in > linux/cleanup.h) to automate resource lifetime > control on struct btt_sb *super in discover_arenas(). > > Signed-off-by: Dinghao Liu > --- > drivers/nvdimm/btt.c | 12 > 1 file

Re: [PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-07 Thread Dave Jiang
On 12/6/23 20:43, Dinghao Liu wrote: > When an error happens in btt_freelist_init(), its caller > discover_arenas() will directly free arena, which makes > arena->freelist allocated in btt_freelist_init() a leaked > memory. Fix this by freeing arena->freelist in all error > handling paths of

[GIT PULL] NVDIMM Fixes for 6.6-rc5

2023-10-02 Thread Dave Jiang
Hi Linus, please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git tags/libnvdimm-fixes-6.6-rc5 ...to receive a small fix for libnvdimm correcting the calculation of idt size in the NFIT code. It has appeared in -next for a few days with no reported issues. --- The

Re: [PATCH v1 1/1] ACPI: NFIT: Switch to use acpi_evaluate_dsm_typed()

2023-10-02 Thread Dave Jiang
On 10/2/23 06:54, Andy Shevchenko wrote: > The acpi_evaluate_dsm_typed() provides a way to check the type of the > object evaluated by _DSM call. Use it instead of open coded variant. > > Signed-off-by: Andy Shevchenko Reviewed-by: Dave Jiang > --- > drivers/acpi/nfit/cor

Re: [PATCH v1 1/2] ACPI: NFIT: Fix memory leak, and local use of devm_*()

2023-09-26 Thread Dave Jiang
Fix this by switching from devm_kcalloc() to kcalloc(), and adding > proper rollback. > > Fixes: eaf961536e16 ("libnvdimm, nfit: add interleave-set state-tracking > infrastructure") > Reported-by: Andy Shevchenko > Signed-off-by: Michal Wilczynski Reviewed

Re: [PATCH v1 2/2] ACPI: NFIT: Use modern scope based rollback

2023-09-26 Thread Dave Jiang
On 9/26/23 11:45, Michal Wilczynski wrote: > Change rollback in acpi_nfit_init_interleave_set() to use modern scope > based attribute __free(). This is similar to C++ RAII and is a preferred > way for handling local memory allocations. > > Suggested-by: Dave Jiang >

Re: [PATCH v3] libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return value

2023-09-14 Thread Dave Jiang
On 9/14/23 00:03, Chen Ni wrote: > Use devm_kstrdup() instead of kstrdup() and check its return value to > avoid memory leak. > > Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name for bus > provider") > Signed-off-by: Chen Ni Reviewed-by: Dave J

Re: [PATCH] dax: refactor deprecated strncpy

2023-09-13 Thread Dave Jiang
Cc: linux-harden...@vger.kernel.org > Signed-off-by: Justin Stitt Reviewed-by: Dave Jiang > --- > Note: build-tested only. > --- > drivers/dax/bus.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c > index 0ee9

Re: [PATCH] drivers: nvdimm: fix possible memory leak

2023-09-08 Thread Dave Jiang
On 9/5/23 02:15, Konstantin Meskhidze wrote: Memory pointed by 'nd_pmu->pmu.attr_groups[NVDIMM_PMU_CPUMASK_ATTR]->attrs[0]' is allocated in function 'nvdimm_pmu_cpu_hotplug_init' via 'create_cpumask_attr_group' call. But not released in function 'nvdimm_pmu_free_hotplug_memory' or anywhere

[GIT PULL] NVDIMM and DAX for 6.6

2023-08-30 Thread Dave Jiang
Hi Linus, please pull from git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git tags/libnvdimm-for-6.6 ... to receive the libnvdimm and DAX updates for v6.6 This is mostly small cleanups, fixes, and with a change to prevent zero-sized namespace exposed to user for nvdimm. It

Re: [PATCH] nvdimm: of_pmem: Add kfree for kstrdup

2023-08-28 Thread Dave Jiang
On 8/27/23 23:23, Chen Ni wrote: Add kfree() for kstrdup() in order to avoid memory leak. Signed-off-by: Chen Ni Can you please add a fixes tag? Thanks! --- drivers/nvdimm/of_pmem.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/nvdimm/of_pmem.c

Re: [PATCH] drivers: nvdimm: fix dereference after free

2023-08-17 Thread Dave Jiang
On 8/17/23 08:45, Dave Jiang wrote: On 8/17/23 04:41, Konstantin Meskhidze wrote: 'nd_pmu->pmu.attr_groups' is dereferenced in function 'nvdimm_pmu_free_hotplug_memory' call after it has been freed. Because in function 'nvdimm_pmu_free_hotplug_memory' memory pointed by the fie

Re: [PATCH] drivers: nvdimm: fix memleak

2023-08-17 Thread Dave Jiang
On 8/17/23 04:59, Konstantin Meskhidze wrote: Memory pointed by 'nd_pmu->pmu.attr_groups' is allocated in function 'register_nvdimm_pmu' and is lost after 'kfree(nd_pmu)' call in function 'unregister_nvdimm_pmu'. Co-developed-by: Ivanov Mikhail Signed-off-by: Konstantin Meskhidze Applied

Re: [PATCH] drivers: nvdimm: fix dereference after free

2023-08-17 Thread Dave Jiang
On 8/17/23 04:41, Konstantin Meskhidze wrote: 'nd_pmu->pmu.attr_groups' is dereferenced in function 'nvdimm_pmu_free_hotplug_memory' call after it has been freed. Because in function 'nvdimm_pmu_free_hotplug_memory' memory pointed by the fields of 'nd_pmu->pmu.attr_groups' is deallocated it

Re: [PATCH v2] ACPI: NFIT: limit string attribute write

2023-07-11 Thread Dave Jiang
On 7/11/23 02:37, Ben Dooks wrote: If we're writing what could be an arbitrary sized string into an attribute we should probably use sysfs_emit() just to be safe. Most of the other attriubtes are some sort of integer so unlikely to be an issue so not altered at this time. Signed-off-by: Ben

Re: [PATCH] ACPI: NFIT: add helper to_nfit_mem() to take device to nfit_mem

2023-07-05 Thread Dave Jiang
Dooks Reviewed-by: Dave Jiang --- drivers/acpi/nfit/core.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 0fcc247fdfac..9213b426b125 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers

Re: [PATCH] ACPI: NFIT: limit string attribute write

2023-07-05 Thread Dave Jiang
On 7/4/23 01:17, Ben Dooks wrote: If we're writing what could be an arbitrary sized string into an attribute we should probably use snprintf() just to be safe. Most of the other attriubtes are some sort of integer so unlikely to be an issue so not altered at this time. Signed-off-by: Ben

Re: [PATCH] nvdimm: make security_show static

2023-06-16 Thread Dave Jiang
/dimm_devs.c:352:9: warning: symbol 'security_show' was not declared. Should it be static? Signed-off-by: Ben Dooks Reviewed-by: Dave Jiang --- drivers/nvdimm/dimm_devs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c

Re: [PATCH 3/3] libnvdimm: mark 'security_show' static again

2023-05-22 Thread Dave Jiang
:352:9: error: no previous prototype for 'security_show' This is also not an appropriate name for a global symbol in the kernel, so just make it static again. Fixes: 15a8348707ff ("libnvdimm: Introduce CONFIG_NVDIMM_SECURITY_TEST flag") Signed-off-by: Arnd Bergmann Reviewed-by:

Re: [PATCH 2/3] testing: nvdimm: add missing prototypes for wrapped functions

2023-05-22 Thread Dave Jiang
' [-Werror=missing-prototypes] 86 | void *__wrap_devm_memremap(struct device *dev, resource_size_t offset, | ^~~~ ... Add prototypes to avoid the warning. Signed-off-by: Arnd Bergmann Reviewed-by: Dave Jiang --- tools/testing/nvdimm/test/nfit_test.h | 29

Re: [PATCH 1/3] acpi: nfit: add declaration in a local header

2023-05-22 Thread Dave Jiang
/core.c:1717:13: error: no previous prototype for 'nfit_intel_shutdown_status' [-Werror=missing-prototypes] Add a declaration in a header that gets included from both sides to shut up the warning and ensure that the prototypes actually match. Signed-off-by: Arnd Bergmann Reviewed-by: Dave Jiang

Re: [PATCH 5.11 007/122] dmaengine: idxd: Fix clobbering of SWERR overflow bit on writeback

2021-04-20 Thread Dave Jiang
On 4/20/2021 1:13 PM, Pavel Machek wrote: Hi! Current code blindly writes over the SWERR and the OVERFLOW bits. Write back the bits actually read instead so the driver avoids clobbering the OVERFLOW bit that comes after the register is read. I believe this is incorrect. Changelog explains

Re: [PATCH] dmaengine: idxd: Fix potential null dereference on pointer status

2021-04-15 Thread Dave Jiang
ed-off-by: Colin Ian King Acked-by: Dave Jiang Thanks! --- drivers/dma/idxd/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c index 31c819544a22..78d2dc5e9bd8 100644 --- a/drivers/dma/idxd/device.c ++

Re: [PATCH v2] dma: Fix a double free in dma_async_device_register

2021-03-30 Thread Dave Jiang
hen chan->local was freed in __dma_async_device_channel_register(). My patch sets chan->local to NULL when the callee failed to avoid double free. Fixes: d2fb0a0438384 ("dmaengine: break out channel registration") Signed-off-by: Lv Yunlong Reviewed-by: Dave Jiang --- drivers

Re: [PATCH] dma: Fix a double free in dma_async_device_register

2021-03-30 Thread Dave Jiang
On 3/30/2021 2:01 AM, Lv Yunlong wrote: In the first list_for_each_entry() macro of dma_async_device_register, it gets the chan from list and calls __dma_async_device_channel_register (..,chan). We can see that chan->local is allocated by alloc_percpu() and it is freed chan->local by

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

2021-03-01 Thread Dave Jiang
On 3/1/2021 5:29 PM, Jason Gunthorpe wrote: On Mon, Mar 01, 2021 at 05:23:47PM -0700, Dave Jiang wrote: So after looking at the code in vfio_pci_intrs.c, I agree that the set_irqs code between VFIO_PCI and this driver can be made in common. Given that Alex doesn't want a vfio_pci device

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

2021-03-01 Thread Dave Jiang
On 2/10/2021 4:59 PM, Jason Gunthorpe wrote: On Fri, Feb 05, 2021 at 01:53:24PM -0700, Dave Jiang wrote: <-- cut for brevity --> +static int vdcm_idxd_set_msix_trigger(struct vdcm_idxd *vidxd, + unsigned int index, unsigned int

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

2021-02-16 Thread Dave Jiang
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 */ + if (vma->vm_end < vma->vm_start) + retur

Re: [PATCH v5 04/14] vfio/mdev: idxd: Add auxialary device plumbing for idxd mdev support

2021-02-12 Thread Dave Jiang
On 2/10/2021 4:46 PM, Jason Gunthorpe wrote: On Fri, Feb 05, 2021 at 01:53:18PM -0700, Dave Jiang wrote: diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h index a2438b3166db..f02c96164515 100644 +++ b/drivers/dma/idxd/idxd.h @@ -8,6 +8,7 @@ #include #include #include

[PATCH] driver core: auxiliary bus: Remove unneeded module bits

2021-02-11 Thread Dave Jiang
Remove module bits in the auxiliary bus code since the auxiliary bus cannot be built as a module and the relevant code is not needed. Cc: Dave Ertman Suggested-by: Greg Kroah-Hartman Signed-off-by: Dave Jiang --- drivers/base/auxiliary.c |5 - 1 file changed, 5 deletions(-) diff

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

2021-02-11 Thread Dave Jiang
On 2/11/2021 10:59 AM, Greg KH wrote: On Thu, Feb 11, 2021 at 10:42:49AM -0700, Dave Jiang wrote: When the auxiliary device code is built into the kernel, it can be executed before the auxiliary bus is registered. This causes bus->p to be not allocated and triggers a NULL pointer derefere

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

2021-02-11 Thread Dave Jiang
0x1f/0x30 [ 1.950670] Modules linked in: [ 1.950670] CR2: 0060 [ 1.950670] --[ end trace cd7d1b226d3ca901 ]-- Fixes: 7de3697e9cbd ("Add auxiliary bus support") Reported-by: Jacob Pan Acked-by: Dave Ertman Reviewed-by: Dan Williams Signed-off-by: Dave Jiang --- v4: - Remove re

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

2021-02-11 Thread Dave Jiang
On 2/10/2021 11:54 PM, Greg KH wrote: On Wed, Feb 10, 2021 at 01:16:11PM -0700, Dave Jiang wrote: When the auxiliary device code is built into the kernel, it can be executed before the auxiliary bus is registered. This causes bus->p to be not allocated and triggers a NULL pointer derefere

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

2021-02-11 Thread Dave Jiang
On 2/11/2021 12:44 AM, Greg KH wrote: On Wed, Feb 10, 2021 at 01:16:11PM -0700, Dave Jiang wrote: MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("Auxiliary Bus"); MODULE_AUTHOR("David Ertman "); As this code can not be built as a module, can you remove these

Re: [PATCH v5 02/14] dmaengine: idxd: add IMS detection in base driver

2021-02-10 Thread Dave Jiang
On 2/10/2021 4:30 PM, Jason Gunthorpe wrote: On Fri, Feb 05, 2021 at 01:53:05PM -0700, Dave Jiang wrote: diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c index 21c1e23cdf23..ab5c76e1226b 100644 +++ b/drivers/dma/idxd/sysfs.c @@ -1444,6 +1444,14 @@ static ssize_t

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

2021-02-10 Thread Dave Jiang
0x1f/0x30 [ 1.950670] Modules linked in: [ 1.950670] CR2: 0060 [ 1.950670] --[ end trace cd7d1b226d3ca901 ]-- Fixes: 7de3697e9cbd ("Add auxiliary bus support") Reported-by: Jacob Pan Acked-by: Dave Ertman Reviewed-by: Dan Williams Signed-off-by: Dave Jiang --- v3: - C

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

2021-02-09 Thread Dave Jiang
0x1f/0x30 [ 1.950670] Modules linked in: [ 1.950670] CR2: 0060 [ 1.950670] --[ end trace cd7d1b226d3ca901 ]-- Fixes: 7de3697e9cbd ("Add auxiliary bus support") Reported-by: Jacob Pan Acked-by: Dave Ertman Reviewed-by: Dan Williams Signed-off-by: Dave Jiang --- v2: -

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

2021-02-09 Thread Dave Jiang
On 2/9/2021 12:14 PM, Greg KH wrote: On Tue, Feb 09, 2021 at 12:05:05PM -0700, Dave Jiang wrote: When the auxiliary device code is built into the kernel, it can be executed before the auxiliary bus is registered. This causes bus->p to be not allocated and triggers a NULL pointer derefere

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

2021-02-09 Thread Dave Jiang
1.950670] ret_from_fork+0x1f/0x30 [ 1.950670] Modules linked in: [ 1.950670] CR2: 0060 [ 1.950670] --[ end trace cd7d1b226d3ca901 ]-- Fixes: 7de3697e9cbd ("Add auxiliary bus support") Reported-by: Jacob Pan Acked-by: Dave Ertman Reviewed-by: Dan Williams Signed

[PATCH v5 02/14] dmaengine: idxd: add IMS detection in base driver

2021-02-05 Thread Dave Jiang
MOVDIR64B or ENQCMD(S). The offset for the portal address determines whether the submitted descriptor is for MSI-X or IMS notification. See Intel SIOV spec for more details: https://software.intel.com/en-us/download/intel-scalable-io-virtualization-technical-specification Signed-off-by:

[PATCH v5 01/14] vfio/mdev: idxd: add theory of operation documentation for idxd mdev

2021-02-05 Thread Dave Jiang
Add idxd vfio mediated device theory of operation documentation. Provide description on mdev design, usage, and why vfio mdev was chosen. Reviewed-by: Ashok Raj Reviewed-by: Kevin Tian Signed-off-by: Dave Jiang --- Documentation/driver-api/vfio/mdev-idxd.rst | 397

[PATCH v5 06/14] vfio/mdev: idxd: add mdev type as a new wq type

2021-02-05 Thread Dave Jiang
Add "mdev" wq type and support helpers. The mdev wq type marks the wq to be utilized as a VFIO mediated device. Signed-off-by: Dave Jiang --- drivers/dma/idxd/idxd.h |2 ++ drivers/dma/idxd/sysfs.c | 13 +++-- 2 files changed, 13 insertions(+), 2 deletions(-)

[PATCH v5 07/14] vfio/mdev: idxd: add 1dwq-v1 mdev type

2021-02-05 Thread Dave Jiang
Add mdev device type "1dwq-v1" support code. 1dwq-v1 is defined as a single DSA gen1 dedicated WQ. This WQ cannot be shared between guests. The guest also cannot change any WQ configuration. Signed-off-by: Dave Jiang --- drivers/dma/idxd/sysfs.c |1 drivers/vfio/mdev/i

[PATCH v5 08/14] vfio/mdev: idxd: add emulation rw routines

2021-02-05 Thread Dave Jiang
type once the commit goes upstream. Signed-off-by: Dave Jiang --- drivers/dma/idxd/registers.h | 10 + drivers/vfio/mdev/idxd/vdev.c | 456 - drivers/vfio/mdev/idxd/vdev.h |8 + include/uapi/linux/idxd.h |2 4 files changed, 468 insert

[PATCH v5 12/14] vfio/mdev: idxd: add irq bypass for IMS vectors

2021-02-05 Thread Dave Jiang
Add support to bypass host for IMS interrupts configured for the guest. Signed-off-by: Dave Jiang --- drivers/vfio/mdev/Kconfig |1 + drivers/vfio/mdev/idxd/mdev.c | 17 +++-- drivers/vfio/mdev/idxd/mdev.h |1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff

[PATCH v5 09/14] vfio/mdev: idxd: prep for virtual device commands

2021-02-05 Thread Dave Jiang
Update some of the device commands in order to support usage by the virtual device commands emulated by the vdcm. Expose some of the commands' raw status so the virtual commands can utilize them accordingly. Signed-off-by: Dave Jiang --- drivers/dma/idxd/cdev.c |2 + drivers/dma/idxd

[PATCH v5 11/14] vfio/mdev: idxd: ims setup for the vdcm

2021-02-05 Thread Dave Jiang
like MSIX interrupts once the relevant IRQ domain is set. The msi_domain_alloc_irqs()/msi_domain_free_irqs() APIs can then be used to allocate interrupts from the above set domain. Signed-off-by: Dave Jiang --- drivers/dma/idxd/idxd.h |1 + drivers/vfio/mdev/idxd/mdev.c | 12

[PATCH v5 14/14] vfio/mdev: idxd: add error notification from host driver to mediated device

2021-02-05 Thread Dave Jiang
When a device error occurs, the mediated device need to be notified in order to notify the guest of device error. Add support to notify the specific mdev when an error is wq specific and broadcast errors to all mdev when it's a generic device error. Signed-off-by: Dave Jiang --- drivers/dma

[PATCH v5 10/14] vfio/mdev: idxd: virtual device commands emulation

2021-02-05 Thread Dave Jiang
Add all the helper functions that supports the emulation of the commands that are submitted to the device command register. Signed-off-by: Dave Jiang --- drivers/dma/idxd/device.c |5 drivers/dma/idxd/registers.h | 16 + drivers/vfio/mdev/idxd/mdev.c |2 drivers/vfio/mdev/idxd

[PATCH v5 13/14] vfio/mdev: idxd: add new wq state for mdev

2021-02-05 Thread Dave Jiang
led on the mdev and a pasid is programmed to the WQCFG, the dwq is enabled again and goes to the ENABLED state. Signed-off-by: Dave Jiang --- drivers/dma/idxd/device.c |9 + drivers/dma/idxd/idxd.h |1 + drivers/dma/idxd/sysfs.c |2 ++ drivers/vfio/mdev/idxd/mdev.c |

[PATCH v5 04/14] vfio/mdev: idxd: Add auxialary device plumbing for idxd mdev support

2021-02-05 Thread Dave Jiang
Add the VFIO mediated device driver as an auxiliary device to the main idxd driver. This allows the mdev code to be under VFIO mdev subsystem. Signed-off-by: Dave Jiang --- MAINTAINERS |8 drivers/dma/idxd/Makefile |2 + drivers/dma/idxd/idxd.h

[PATCH v5 03/14] dmaengine: idxd: add device support functions in prep for mdev

2021-02-05 Thread Dave Jiang
Add device support helper functions in preparation of adding VFIO mdev support. Signed-off-by: Dave Jiang --- drivers/dma/idxd/device.c| 61 ++ drivers/dma/idxd/idxd.h |4 +++ drivers/dma/idxd/registers.h |3 +- 3 files changed, 67

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

2021-02-05 Thread Dave Jiang
that VFIO mdev requires to support a mediated device. Signed-off-by: Dave Jiang --- drivers/dma/idxd/device.c |1 drivers/dma/idxd/idxd.h |7 drivers/dma/idxd/init.c |2 drivers/vfio/mdev/idxd/Makefile |2 drivers/vfio/mdev/idxd/mdev.c | 1006

[PATCH v5 00/14] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2021-02-05 Thread Dave Jiang
ata-streaming-accelerator [6]: https://intel.github.io/idxd/ [7]: https://github.com/intel/idxd-driver idxd-stage2.5 --- Dave Jiang (14): vfio/mdev: idxd: add theory of operation documentation for idxd mdev dmaengine: idxd: add IMS detection in base driver dmaengine: idxd: add

Re: [PATCH v9 15/17] NTB: Add support for EPF PCI-Express Non-Transparent Bridge

2021-01-18 Thread Dave Jiang
connnects to the standard NTB sub-system interface. The EPF NTB device has configurable number of memory windows (Max 4), configurable number of doorbell (Max 32), and configurable number of scratch-pad registers. Signed-off-by: Kishon Vijay Abraham I Reviewed-by: Dave Jiang --- drivers/ntb/hw

[tip: x86/asm] x86/asm: Add a missing __iomem annotation in enqcmds()

2021-01-08 Thread tip-bot2 for Dave Jiang
The following commit has been merged into the x86/asm branch of tip: Commit-ID: 5c99720b28381bb400d4f546734c34ddaf608761 Gitweb: https://git.kernel.org/tip/5c99720b28381bb400d4f546734c34ddaf608761 Author:Dave Jiang AuthorDate:Thu, 07 Jan 2021 09:45:21 -07:00 Committer

[tip: x86/asm] x86/asm: Annotate movdir64b()'s dst argument with __iomem

2021-01-08 Thread tip-bot2 for Dave Jiang
The following commit has been merged into the x86/asm branch of tip: Commit-ID: 6ae58d871319dc22ef780baaacd393f8543a1e74 Gitweb: https://git.kernel.org/tip/6ae58d871319dc22ef780baaacd393f8543a1e74 Author:Dave Jiang AuthorDate:Thu, 07 Jan 2021 09:44:51 -07:00 Committer

[PATCH v3] x86: fix enqcmds() with missing __iomem annotation

2021-01-07 Thread Dave Jiang
lude/asm/special_insns.h:289:41: sparse: got void [noderef] __iomem *dst Fixes: 7f5933f81bd8 ("x86/asm: Add an enqcmds() wrapper for the ENQCMDS instruction") Reported-by: kernel test robot Reviewed-by: Ben Widawsky Reviewed-by: Dan Williams Signed-off-by: Dave Jiang --- v3: - Upda

[PATCH v3] x86: fix movdir64b() with missing __iomem annotation

2021-01-07 Thread Dave Jiang
ir64b() helper for general usage") Reported-by: kernel test robot Reviewed-by: Ben Widawsky Reviewed-by: Dan Williams Signed-off-by: Dave Jiang --- v3: - Update subject and commit log with comments from Boris. v2: - Update commit log with comments from Dan. arch/x86/include/asm/special_

[PATCH v2] x86: fix enqcmds() sparse warning

2021-01-06 Thread Dave Jiang
lude/asm/special_insns.h:289:41: sparse: got void [noderef] __iomem *dst Fixes: 7f5933f81bd8 ("x86/asm: Add an enqcmds() wrapper for the ENQCMDS instruction") Reported-by: kernel test robot Reviewed-by: Ben Widawsky Reviewed-by: Dan Williams Signed-off-by: Dave Jiang --- v2: - Upd

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

2021-01-06 Thread Dave Jiang
per for general usage") Reported-by: kernel test robot Reviewed-by: Ben Widawsky Reviewed-by: Dan Williams Signed-off-by: Dave Jiang --- v2: - Update commit log with comments from Dan. arch/x86/include/asm/special_insns.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) dif

[PATCH] x86: fix enqcmds() sparse warning

2021-01-06 Thread Dave Jiang
uction") Reported-by: kernel test robot Reviewed-by: Ben Widawsky Signed-off-by: Dave Jiang --- arch/x86/include/asm/special_insns.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h index 4e23

[PATCH] x86: fix movdir64b() sparse warning

2021-01-06 Thread Dave Jiang
d3e ("x86/asm: Carve out a generic movdir64b() helper for general usage") Reported-by: kernel test robot Reviewed-by: Ben Widawsky Signed-off-by: Dave Jiang --- arch/x86/include/asm/special_insns.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include

Re: [PATCH v2 -next] dma: idxd: use DEFINE_MUTEX() for mutex lock

2020-12-24 Thread Dave Jiang
On Thu, 24 Dec 2020 21:22:54 +0800 Zheng Yongjun wrote: > mutex lock can be initialized automatically with DEFINE_MUTEX() > rather than explicitly calling mutex_init(). > > Signed-off-by: Zheng Yongjun Acked-by: Dave Jiang > --- > drivers/dma/idxd/init.c | 3 +-- &g

[PATCH] driver core: auxiliary bus: Fix auxiliary bus shutdown null auxdrv ptr

2020-12-04 Thread Dave Jiang
s support") Cc: Dave Ertman Signed-off-by: Dave Jiang Reviewed-by: Dan Williams --- drivers/base/auxiliary.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c index f303daadf843..8336535f1e11 100644

Re: [PATCH v4 00/17] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-11-02 Thread Dave Jiang
On 11/2/2020 10:19 AM, Jason Gunthorpe wrote: On Mon, Nov 02, 2020 at 08:20:43AM -0800, Raj, Ashok wrote: Creating these private interfaces for intra-module are just 1-1 and not general purpose and every accelerator needs to create these instances. This is where we are going, auxillary bus

Re: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-10-30 Thread Dave Jiang
On 10/30/2020 3:45 PM, Jason Gunthorpe wrote: On Fri, Oct 30, 2020 at 02:20:03PM -0700, Dave Jiang wrote: So the intel-iommu driver checks for the SIOV cap. And the idxd driver checks for SIOV and IMS cap. There will be other upcoming drivers that will check for such cap too. It is Intel

Re: [PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-10-30 Thread Dave Jiang
On 10/30/2020 12:51 PM, Bjorn Helgaas wrote: On Fri, Oct 30, 2020 at 11:51:32AM -0700, Dave Jiang wrote: Intel Scalable I/O Virtualization (SIOV) enables sharing of I/O devices across isolated domains through PASID based sub-device partitioning. Interrupt Message Storage (IMS) enables

Re: [PATCH v4 00/17] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-10-30 Thread Dave Jiang
On 10/30/2020 1:48 PM, Thomas Gleixner wrote: On Fri, Oct 30 2020 at 11:50, Dave Jiang wrote: The code has dependency on Thomas’s MSI restructuring patch series: https://lore.kernel.org/lkml/20200826111628.794979...@linutronix.de/ which is outdated and not longer applicable. Yes I

Re: [PATCH v4 02/17] iommu/vt-d: Add DEV-MSI support

2020-10-30 Thread Dave Jiang
On 10/30/2020 1:31 PM, Thomas Gleixner wrote: On Fri, Oct 30 2020 at 11:51, Dave Jiang wrote: From: Megha Dey This conflicts with git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/apic I'll get that fixed up. Thanks! Thanks, tglx

Re: [PATCH v4 00/17] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-10-30 Thread Dave Jiang
On 10/30/2020 11:58 AM, Jason Gunthorpe wrote: On Fri, Oct 30, 2020 at 11:50:47AM -0700, Dave Jiang wrote: .../ABI/stable/sysfs-driver-dma-idxd |6 + Documentation/driver-api/vfio/mdev-idxd.rst | 404 ++ MAINTAINERS |1 + drivers

[PATCH v4 09/17] dmaengine: idxd: add basic mdev registration and helper functions

2020-10-30 Thread Dave Jiang
that VFIO mdev requires to support a mediated device. Signed-off-by: Dave Jiang --- drivers/dma/Kconfig |7 drivers/dma/idxd/Makefile |2 drivers/dma/idxd/idxd.h | 14 + drivers/dma/idxd/init.c | 11 + drivers/dma/idxd/mdev.c | 968

[PATCH v4 05/17] dmaengine: idxd: add interrupt handle request support

2020-10-30 Thread Dave Jiang
. On the guest kernel, the MSIX interrupts are backed by the mediated device through emulation or IMS vectors. Vector 0 is handled through emulation by the host vdcm. It only requires the host driver to send the signal to qemu. The vector 1 (and more may be supported later) is backed by IMS. Signed-off-by: Dave

[PATCH v4 08/17] dmaengine: idxd: add device support functions in prep for mdev

2020-10-30 Thread Dave Jiang
Add device support helper functions in preparation of adding VFIO mdev support. Signed-off-by: Dave Jiang --- drivers/dma/idxd/device.c| 61 ++ drivers/dma/idxd/idxd.h |4 +++ drivers/dma/idxd/registers.h |3 +- 3 files changed, 67

[PATCH v4 12/17] dmaengine: idxd: virtual device commands emulation

2020-10-30 Thread Dave Jiang
Add all the helper functions that supports the emulation of the commands that are submitted to the device command register. Signed-off-by: Dave Jiang --- drivers/dma/idxd/registers.h | 16 +- drivers/dma/idxd/vdev.c | 427 ++ 2 files changed, 438

[PATCH v4 15/17] dmaengine: idxd: add dedicated wq mdev type

2020-10-30 Thread Dave Jiang
d SVA and will match the stage 1 driver in functional support. For backward compatibility, the mdev will maintain the DSA spec definition of this mdev type once the commit goes upstream. Signed-off-by: Dave Jiang --- drivers/dma/idxd/mdev.c | 141 ---

[PATCH v4 02/17] iommu/vt-d: Add DEV-MSI support

2020-10-30 Thread Dave Jiang
From: Megha Dey Add required support in the interrupt remapping driver for devices which generate dev-msi interrupts and use the intel remapping domain as the parent domain. Reviewed-by: Ashok Raj Suggested-by: Thomas Gleixner Signed-off-by: Megha Dey Signed-off-by: Dave Jiang --- drivers

[PATCH v4 04/17] dmaengine: idxd: add support for readonly config devices

2020-10-30 Thread Dave Jiang
marked as read-only. Signed-off-by: Dave Jiang --- drivers/dma/idxd/device.c | 116 + drivers/dma/idxd/idxd.h |1 drivers/dma/idxd/init.c |8 +++ drivers/dma/idxd/sysfs.c | 20 +--- 4 files changed, 137 insertions(+), 8 deletions

[PATCH v4 01/17] irqchip: Add IMS (Interrupt Message Store) driver

2020-10-30 Thread Dave Jiang
Tested the IMS infrastructure with the IDXD driver] Signed-off-by: Thomas Gleixner Signed-off-by: Megha Dey Signed-off-by: Dave Jiang --- drivers/irqchip/Kconfig | 14 ++ drivers/irqchip/Makefile|1 drivers/irqchip/irq-ims-msi.c | 204

[PATCH v4 07/17] dmaengine: idxd: add IMS support in base driver

2020-10-30 Thread Dave Jiang
or ENQCMD(S). The offset for the portal address determines whether the submitted descriptor is for MSI-X or IMS notification. See Intel SIOV spec for more details: https://software.intel.com/en-us/download/intel-scalable-io-virtualization-technical-specification Signed-off-by:

[PATCH v4 06/17] PCI: add SIOV and IMS capability detection

2020-10-30 Thread Dave Jiang
will add the ability to query the PCI DVSEC capabilities for the SIOV cap. Suggested-by: Thomas Gleixner Cc: Baolu Lu Signed-off-by: Dave Jiang Reviewed-by: Ashok Raj --- drivers/iommu/intel/iommu.c | 31 ++--- drivers/pci/Kconfig | 15 drivers/pci

[PATCH v4 11/17] dmaengine: idxd: prep for virtual device commands

2020-10-30 Thread Dave Jiang
Update some of the device commands in order to support usage by the virtual device commands emulated by the vdcm. Expose some of the commands' raw status so the virtual commands can utilize them accordingly. Signed-off-by: Dave Jiang --- drivers/dma/idxd/cdev.c |2 + drivers/dma/idxd

[PATCH v4 13/17] dmaengine: idxd: ims setup for the vdcm

2020-10-30 Thread Dave Jiang
. Signed-off-by: Megha Dey Signed-off-by: Dave Jiang --- drivers/dma/Kconfig |2 ++ drivers/dma/idxd/idxd.h |1 + drivers/dma/idxd/mdev.c | 26 + drivers/dma/idxd/mdev.h |1 + drivers/dma/idxd/vdev.c | 57

[PATCH v4 17/17] dmaengine: idxd: add error notification from host driver to mediated device

2020-10-30 Thread Dave Jiang
When a device error occurs, the mediated device need to be notified in order to notify the guest of device error. Add support to notify the specific mdev when an error is wq specific and broadcast errors to all mdev when it's a generic device error. Signed-off-by: Dave Jiang --- drivers/dma

[PATCH v4 03/17] dmaengine: idxd: add theory of operation documentation for idxd mdev

2020-10-30 Thread Dave Jiang
Add idxd vfio mediated device theory of operation documentation. Provide description on mdev design, usage, and why vfio mdev was chosen. Reviewed-by: Ashok Raj Reviewed-by: Kevin Tian Signed-off-by: Dave Jiang --- Documentation/driver-api/vfio/mdev-idxd.rst | 404

[PATCH v4 16/17] dmaengine: idxd: add new wq state for mdev

2020-10-30 Thread Dave Jiang
, the wq is not in DISABLED state and will prevent any modifications to the configuration. It is also not in the ENABLED state and therefore prevents any actions allowed in the ENABLED state. Signed-off-by: Dave Jiang --- drivers/dma/idxd/idxd.h |1 + drivers/dma/idxd/mdev.c |4

[PATCH v4 00/17] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-10-30 Thread Dave Jiang
19/introducing-intel-data-streaming-accelerator [6]: https://intel.github.io/idxd/ [7]: https://github.com/intel/idxd-driver idxd-stage2.5 --- Dave Jiang (15): dmaengine: idxd: add theory of operation documentation for idxd mdev dmaengine: idxd: add support for readonly config devices

[PATCH v4 10/17] dmaengine: idxd: add emulation rw routines

2020-10-30 Thread Dave Jiang
configuration, most of the MMIO emulations are simple memory copy except for cases such as handling device commands and interrupts. Signed-off-by: Dave Jiang --- drivers/dma/idxd/registers.h | 10 + drivers/dma/idxd/vdev.c | 427 +- drivers/dma/idxd

[PATCH v4 14/17] dmaengine: idxd: add mdev type as a new wq type

2020-10-30 Thread Dave Jiang
Add "mdev" wq type and support helpers. The mdev wq type marks the wq to be utilized as a VFIO mediated device. Signed-off-by: Dave Jiang --- drivers/dma/idxd/idxd.h |2 ++ drivers/dma/idxd/sysfs.c | 13 +++-- 2 files changed, 13 insertions(+), 2 deletions(-)

Re: [PATCH v3 11/18] dmaengine: idxd: ims setup for the vdcm

2020-10-08 Thread Dave Jiang
On 10/8/2020 4:32 PM, Jason Gunthorpe wrote: On Fri, Oct 09, 2020 at 01:17:38AM +0200, Thomas Gleixner wrote: Dave, On Thu, Oct 08 2020 at 09:51, Dave Jiang wrote: On 10/8/2020 12:39 AM, Thomas Gleixner wrote: On Wed, Oct 07 2020 at 14:54, Dave Jiang wrote: On 9/30/2020 12:57 PM, Thomas

  1   2   3   4   5   >