Re: [PATCH 3/3] iommu/vt-d: A fix to iommu_flush_dev_iotlb() for aux-domain

2020-12-18 Thread Lu Baolu
Hi, On 2020/12/20 8:03, Liu Yi L wrote: iommu_flush_dev_iotlb() is called to invalidate caches on device. It only loops the devices which are full-attached to the domain. For sub-devices, this is ineffective. This results in invalid caching entries left on the device. Fix it by adding loop for

Re: [PATCH 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info.

2020-12-18 Thread Lu Baolu
Hi, On 2020/12/20 8:03, Liu Yi L wrote: In existing code, if wanting to loop all devices attached to a domain, current code can only loop the devices which are attached to the domain via normal manner. While for devices attached via auxiliary manner, this is subdevice, they are not tracked in

Re: [PATCH 1/3] iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev

2020-12-18 Thread Lu Baolu
Hi, On 2020/12/20 8:03, Liu Yi L wrote: Current struct intel_svm has a field to record the struct intel_iommu pointer for a PASID bind. And struct intel_svm will be shared by all the devices bind to the same process. The devices may be behind different DMAR units. As the iommu driver code uses

RE: [PATCH] dma-mapping: benchmark: check the validity of dma mask bits

2020-12-18 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Saturday, December 19, 2020 7:10 AM > To: Song Bao Hua (Barry Song) ; h...@lst.de; > m.szyprow...@samsung.com > Cc: iommu@lists.linux-foundation.org; Linuxarm ; Dan > Carpenter > Subject: Re: [PATCH]

Re: [PATCH v2 1/4] dt-bindings: reserved-memory: Document "active" property

2020-12-18 Thread Thierry Reding
On Fri, Dec 18, 2020 at 04:15:45PM -0600, Rob Herring wrote: > On Thu, Dec 17, 2020 at 9:00 AM Thierry Reding > wrote: > > > > On Tue, Nov 10, 2020 at 08:33:09PM +0100, Thierry Reding wrote: > > > On Fri, Nov 06, 2020 at 04:25:48PM +0100, Thierry Reding wrote: > > > > On Thu, Nov 05, 2020 at

[PATCH 1/3] iommu/vt-d: Move intel_iommu info from struct intel_svm to struct intel_svm_dev

2020-12-18 Thread Liu Yi L
Current struct intel_svm has a field to record the struct intel_iommu pointer for a PASID bind. And struct intel_svm will be shared by all the devices bind to the same process. The devices may be behind different DMAR units. As the iommu driver code uses the intel_iommu pointer stored in intel_svm

[PATCH 2/3] iommu/vt-d: Track device aux-attach with subdevice_domain_info.

2020-12-18 Thread Liu Yi L
In existing code, if wanting to loop all devices attached to a domain, current code can only loop the devices which are attached to the domain via normal manner. While for devices attached via auxiliary manner, this is subdevice, they are not tracked in the domain. This patch adds struct

[PATCH 0/4] iommu/vtd-: Misc fixes on scalable mode

2020-12-18 Thread Liu Yi L
Hi, This patchset aims to fix a bug regards to SVM usage on native, and also several bugs around subdevice (attached to device via auxiliary manner) tracking and ineffective device_tlb flush. Regards, Yi Liu Liu Yi L (3): iommu/vt-d: Move intel_iommu info from struct intel_svm to struct

[PATCH 3/3] iommu/vt-d: A fix to iommu_flush_dev_iotlb() for aux-domain

2020-12-18 Thread Liu Yi L
iommu_flush_dev_iotlb() is called to invalidate caches on device. It only loops the devices which are full-attached to the domain. For sub-devices, this is ineffective. This results in invalid caching entries left on the device. Fix it by adding loop for subdevices as well. Also, update the

Re: [PATCH v2 1/4] dt-bindings: reserved-memory: Document "active" property

2020-12-18 Thread Rob Herring
On Thu, Dec 17, 2020 at 9:00 AM Thierry Reding wrote: > > On Tue, Nov 10, 2020 at 08:33:09PM +0100, Thierry Reding wrote: > > On Fri, Nov 06, 2020 at 04:25:48PM +0100, Thierry Reding wrote: > > > On Thu, Nov 05, 2020 at 05:47:21PM +, Robin Murphy wrote: > > > > On 2020-11-05 16:43, Thierry

Re: [PATCH 1/3] iommu/io-pgtable-arm: Prepare for modularization

2020-12-18 Thread isaacm
On 2020-12-18 04:38, Robin Murphy wrote: On 2020-12-18 08:38, Isaac J. Manjarres wrote: The io-pgtable-arm and io-pgtable-arm-v7s source files will be compiled as separate modules, along with the io-pgtable source. Export the symbols for the io-pgtable init function structures for the

Re: [PATCH] dma-mapping: benchmark: check the validity of dma mask bits

2020-12-18 Thread Robin Murphy
On 2020-12-12 10:18, Barry Song wrote: While dma_mask_bits is larger than 64, the bahvaiour is undefined. On the other hand, dma_mask_bits which is smaller than 20 (1MB) makes no sense in real hardware. Reported-by: Dan Carpenter Signed-off-by: Barry Song --- kernel/dma/map_benchmark.c | 6

Re: [PATCH 1/3] iommu/io-pgtable-arm: Prepare for modularization

2020-12-18 Thread Robin Murphy
On 2020-12-18 08:38, Isaac J. Manjarres wrote: The io-pgtable-arm and io-pgtable-arm-v7s source files will be compiled as separate modules, along with the io-pgtable source. Export the symbols for the io-pgtable init function structures for the io-pgtable module to use. In my current build

Re: [RFC PATCH v2 0/8] ACPI/IORT: Support for IORT RMR node

2020-12-18 Thread Jon Nettleton
On Thu, Dec 17, 2020 at 4:53 PM Jon Nettleton wrote: > > On Thu, Dec 17, 2020 at 4:42 PM Shameerali Kolothum Thodi > wrote: > > > > > > > > > -Original Message- > > > From: Jon Nettleton [mailto:j...@solid-run.com] > > > Sent: 17 December 2020 14:48 > > > To: Shameerali Kolothum Thodi >

Re: swiotlb/virtio: unchecked device dma address and length

2020-12-18 Thread Radev, Martin
> I believe the above example is without a SEV guest enabled/active, > as SEVguest debugging can only be done with SEV Debug patches applied. SEV is active. Adding `console=ttyS0` to the kernel parameters and `GRUB_TERMINAL="console serial"` seems to do the job without any AMD-internal patches.

[PATCH 3/3] iommu/io-pgtable: Allow building as a module

2020-12-18 Thread Isaac J. Manjarres
Now that all of the required symbols have been exported, and the io-pgtable code can correctly refer to the io-pgtable init functions when their source files are built as modules, allow the io-pgtable code to be built as a module. The expectation is that the io-pgtable core code, along with the

[PATCH 2/3] iommu/io-pgtable: Prepare for modularization

2020-12-18 Thread Isaac J. Manjarres
The io-pgtable source file uses the #ifdef preprocessor macro to construct the io_pgtable_init_table structure. However, the #ifdef macro evaluates to true if the config it is testing is set to y. This is not ideal when the configs that the io-pgtable code checks for can be m, so use IS_ENABLED()

[PATCH 1/3] iommu/io-pgtable-arm: Prepare for modularization

2020-12-18 Thread Isaac J. Manjarres
The io-pgtable-arm and io-pgtable-arm-v7s source files will be compiled as separate modules, along with the io-pgtable source. Export the symbols for the io-pgtable init function structures for the io-pgtable module to use. Signed-off-by: Isaac J. Manjarres ---

[RFC PATCH 0/3] iommu: Permit modular builds of io-pgtable drivers

2020-12-18 Thread Isaac J. Manjarres
The goal of the Generic Kernel Image (GKI) effort is to have a common image that works across multiple Android devices. This involves generating a kernel image that has core features integrated into it, while SoC specific functionality can be added to the kernel for the device as a module. Along

Re: [PATCH 4/7] vfio: iommu_type1: Fix missing dirty page when promote pinned_scope

2020-12-18 Thread Keqian Zhu
On 2020/12/15 23:53, Alex Williamson wrote: > On Tue, 15 Dec 2020 17:37:11 +0800 > zhukeqian wrote: > >> Hi Alex, >> >> On 2020/12/15 8:04, Alex Williamson wrote: [...] +static void vfio_populate_bitmap_all(struct vfio_iommu *iommu) +{ + struct rb_node *n; +