[PATCH] dma-iommu: Add a check to avoid dereference null pointer in function iommu_dma_map_sg()

2021-05-20 Thread chenxiang
From: Xiang Chen The issue is reported by tool TscanCode, and it is possible to deference null pointer when prev is NULL which is the initial value. Signed-off-by: Xiang Chen --- drivers/iommu/dma-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v4] iommu/of: Fix pci_request_acs() before enumerating PCI devices

2021-05-20 Thread Wang Xingang
From: Xingang Wang When booting with devicetree, the pci_request_acs() is called after the enumeration and initialization of PCI devices, thus the ACS is not enabled. And ACS should be enabled when IOMMU is detected for the PCI host bridge, so add check for IOMMU before probe of PCI host and

Re: [PATCH v2 1/5] dt-bindings: reserved-memory: Document memory region specifier

2021-05-20 Thread Rob Herring
On Fri, Apr 23, 2021 at 06:32:30PM +0200, Thierry Reding wrote: > From: Thierry Reding > > Reserved memory region phandle references can be accompanied by a > specifier that provides additional information about how that specific > reference should be treated. > > One use-case is to mark a

Re: i915 and swiotlb_max_segment

2021-05-20 Thread Konrad Rzeszutek Wilk
On Mon, May 10, 2021 at 05:25:25PM +0200, Christoph Hellwig wrote: > Hi all, > > swiotlb_max_segment is a rather strange "API" export by swiotlb.c, > and i915 is the only (remaining) user. > > swiotlb_max_segment returns 0 if swiotlb is not in use, 1 if > SWIOTLB_FORCE is set or swiotlb-zen is

Re: [PATCH 3/6] vfio: remove the unused mdev iommu hook

2021-05-20 Thread Jason Gunthorpe
On Thu, May 20, 2021 at 03:13:55PM +0100, Robin Murphy wrote: > By "mdev-like" I mean it's very similar in shape to the general SIOV-style > mediated device concept - i.e. a physical device with an awareness of > operating on multiple contexts at once, using a Substream ID/PASID for each > one -

Re: [PATCH 3/6] vfio: remove the unused mdev iommu hook

2021-05-20 Thread Robin Murphy
On 2021-05-20 00:24, Jason Gunthorpe wrote: On Wed, May 19, 2021 at 11:12:46PM +, Tian, Kevin wrote: From: Jason Gunthorpe Sent: Thursday, May 20, 2021 2:07 AM On Wed, May 19, 2021 at 04:23:21PM +0100, Robin Murphy wrote: On 2021-05-17 16:35, Joerg Roedel wrote: On Mon, May 17, 2021 at

Re: [PATCH v3] iommu/of: Fix pci_request_acs() before enumerating PCI devices

2021-05-20 Thread Rob Herring
On Thu, May 20, 2021 at 2:28 AM Wang Xingang wrote: > > From: Xingang Wang > > When booting with devicetree, the pci_request_acs() is called after the > enumeration and initialization of PCI devices, thus the ACS is not > enabled. And ACS should be enabled when IOMMU is detected for the > PCI

Re: [PATCH 3/3] lib/vsprintf: Use pr_crit() instead of long fancy messages

2021-05-20 Thread Petr Mladek via iommu
On Mon 2021-05-17 08:21:12, Geert Uytterhoeven wrote: > On Wed, Mar 31, 2021 at 11:59 AM Geert Uytterhoeven > wrote: > > While long fancy messages have a higher probability of being seen than > > small messages, they may scroll of the screen fast, if visible at all, > > and may still be missed.

Re: Re: [PATCH v7 00/12] Introduce VDUSE - vDPA Device in Userspace

2021-05-20 Thread Yongji Xie
On Thu, May 20, 2021 at 2:06 PM Michael S. Tsirkin wrote: > > On Mon, May 17, 2021 at 05:55:01PM +0800, Xie Yongji wrote: > > This series introduces a framework, which can be used to implement > > vDPA Devices in a userspace program. The work consist of two parts: > > control path forwarding and

Re: [PATCH v2 00/15] dma mapping/iommu: Allow IOMMU IOVA rcache range to be configured

2021-05-20 Thread John Garry
On 10/05/2021 15:17, John Garry wrote: Hi Robin, guys, A friendly reminder on this one... Thanks For streaming DMA mappings involving an IOMMU and whose IOVA len regularly exceeds the IOVA rcache upper limit (meaning that they are not cached), performance can be reduced. This is much more

[PATCH v3] iommu/of: Fix pci_request_acs() before enumerating PCI devices

2021-05-20 Thread Wang Xingang
From: Xingang Wang When booting with devicetree, the pci_request_acs() is called after the enumeration and initialization of PCI devices, thus the ACS is not enabled. And ACS should be enabled when IOMMU is detected for the PCI host bridge, so add check for IOMMU before probe of PCI host and

[PATCH -next 1/3] iommu/arm-smmu-v3: fix missing a blank line after declarations

2021-05-20 Thread Bixuan Cui
Fixes checkpatch warnings in arm-smmu-v3.c: WARNING: Missing a blank line after declarations Signed-off-by: Bixuan Cui --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

[PATCH -next 0/3] iommu/arm-smmu-v3: clean up some code style issues

2021-05-20 Thread Bixuan Cui
Clean up some code style issues. Bixuan Cui (3): iommu/arm-smmu-v3: fix missing a blank line after declarations iommu/arm-smmu-v3: Change *array into *const array iommu/arm-smmu-v3: Prefer unsigned int to bare use of unsigned drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 9 +++-- 1

[PATCH -next 3/3] iommu/arm-smmu-v3: Prefer unsigned int to bare use of unsigned

2021-05-20 Thread Bixuan Cui
Fix checkpatch warning in arm-smmu-v3.c: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Bixuan Cui --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

[PATCH -next 2/3] iommu/arm-smmu-v3: Change *array into *const array

2021-05-20 Thread Bixuan Cui
Fix checkpatch warning in arm-smmu-v3.c: static const char * array should probably be static const char * const Signed-off-by: Bixuan Cui --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: Re: Re: [PATCH v7 04/12] virtio-blk: Add validation for block size in config space

2021-05-20 Thread Yongji Xie
On Thu, May 20, 2021 at 1:43 PM Michael S. Tsirkin wrote: > > On Thu, May 20, 2021 at 01:25:16PM +0800, Yongji Xie wrote: > > On Wed, May 19, 2021 at 10:42 PM Dan Carpenter > > wrote: > > > > > > On Wed, May 19, 2021 at 09:39:20PM +0800, Yongji Xie wrote: > > > > On Mon, May 17, 2021 at 5:56 PM

Re: Re: [PATCH v7 11/12] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-05-20 Thread Yongji Xie
On Thu, May 20, 2021 at 2:28 PM Al Viro wrote: > > On Mon, May 17, 2021 at 05:55:12PM +0800, Xie Yongji wrote: > > > + case VDUSE_IOTLB_GET_FD: { > > + struct vduse_iotlb_entry entry; > > + struct vhost_iotlb_map *map; > > + struct vdpa_map_file *map_file;

Re: [PATCH v7 01/15] swiotlb: Refactor swiotlb init functions

2021-05-20 Thread Claire Chang
On Thu, May 20, 2021 at 2:50 AM Florian Fainelli wrote: > > > > On 5/17/2021 11:42 PM, Claire Chang wrote: > > Add a new function, swiotlb_init_io_tlb_mem, for the io_tlb_mem struct > > initialization to make the code reusable. > > > > Note that we now also call set_memory_decrypted in

Re: [PATCH v7 04/15] swiotlb: Add restricted DMA pool initialization

2021-05-20 Thread Claire Chang
On Thu, May 20, 2021 at 2:54 AM Florian Fainelli wrote: > > > > On 5/17/2021 11:42 PM, Claire Chang wrote: > > Add the initialization function to create restricted DMA pools from > > matching reserved-memory nodes. > > > > Signed-off-by: Claire Chang > > --- > > include/linux/device.h | 4 +++

Re: Re: [PATCH v7 02/12] file: Export receive_fd() to modules

2021-05-20 Thread Yongji Xie
On Thu, May 20, 2021 at 2:18 PM Al Viro wrote: > > On Mon, May 17, 2021 at 05:55:03PM +0800, Xie Yongji wrote: > > Export receive_fd() so that some modules can use > > it to pass file descriptor between processes without > > missing any security stuffs. > > Which tree is that against? Because in

Re: [PATCH v7 11/12] vduse: Introduce VDUSE - vDPA Device in Userspace

2021-05-20 Thread Al Viro
On Mon, May 17, 2021 at 05:55:12PM +0800, Xie Yongji wrote: > + case VDUSE_IOTLB_GET_FD: { > + struct vduse_iotlb_entry entry; > + struct vhost_iotlb_map *map; > + struct vdpa_map_file *map_file; > + struct vduse_iova_domain *domain =

Re: [PATCH v7 02/12] file: Export receive_fd() to modules

2021-05-20 Thread Al Viro
On Mon, May 17, 2021 at 05:55:03PM +0800, Xie Yongji wrote: > Export receive_fd() so that some modules can use > it to pass file descriptor between processes without > missing any security stuffs. Which tree is that against? Because in mainline this won't even build, let alone work. > ---

Re: [PATCH v7 00/12] Introduce VDUSE - vDPA Device in Userspace

2021-05-20 Thread Michael S. Tsirkin
On Mon, May 17, 2021 at 05:55:01PM +0800, Xie Yongji wrote: > This series introduces a framework, which can be used to implement > vDPA Devices in a userspace program. The work consist of two parts: > control path forwarding and data path offloading. > > In the control path, the VDUSE driver will