Re: [PATCH v3 5/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-01-27 Thread . Christoph Hellwig
On Wed, Jan 27, 2021 at 10:35:02PM +0100, Ricardo Ribalda wrote: > I have used the current API here: > > https://git.kernel.org/pub/scm/linux/kernel/git/ribalda/linux.git/log/?h=uvc-noncontiguous > > And I think the result is very clean. Great work! > > I have tested it in X86 and in arm64,

Re: [PATCH RFC 7/9] iommu: Introduce map_sg() as an IOMMU op for IOMMU drivers

2021-01-27 Thread Lu Baolu
Hi, On 1/28/21 4:01 AM, Chuck Lever wrote: From: Isaac J. Manjarres Add support for IOMMU drivers to have their own map_sg() callbacks. This completes the path for having iommu_map_sg() invoke an IOMMU driver's map_sg() callback, which can then invoke the io-pgtable map_sg() callback with the

Re: [PATCH RFC 2/9] iommu: Add iova and size as parameters in iotlb_sync_map

2021-01-27 Thread Lu Baolu
On 1/28/21 4:00 AM, Chuck Lever wrote: From: Yong Wu iotlb_sync_map allow IOMMU drivers tlb sync after completing the whole mapping. This patch adds iova and size as the parameters in it. then the IOMMU driver could flush tlb with the whole range once after iova mapping to improve performance.

Re: [PATCH RFC 1/9] iommu: Move iotlb_sync_map out from __iommu_map

2021-01-27 Thread Lu Baolu
Hi, On 1/28/21 4:00 AM, Chuck Lever wrote: From: Yong Wu In the end of __iommu_map, It alway call iotlb_sync_map. This patch moves iotlb_sync_map out from __iommu_map since it is unnecessary to call this for each sg segment especially iotlb_sync_map is flush tlb all currently. Add a little

Re: [PATCH RFC 0/9] Possible set of VT-d optimizations

2021-01-27 Thread Lu Baolu
Hi Chuck, On 1/28/21 4:00 AM, Chuck Lever wrote: Hi- This collection of patches seems to get the best throughtput results so far. The NFS WRITE result is fully restored, and the NFS READ result is very close to fully restored. Very glad to see this. Thanks! Can you please add below link if

[PATCH 0/3] Adding offset keeping option when mapping data via SWIOTLB.*

2021-01-27 Thread Jianxiong Gao via iommu
NVMe driver and other applications may depend on the data offset to operate correctly. Currently when unaligned data is mapped via SWIOTLB, the data is mapped as slab aligned with the SWIOTLB. This patch adds an option to make sure the mapped data preserves its offset of the orginal addrss.

Re: [PATCH v3] iommu/vt-d: do not use flush-queue when caching-mode is on

2021-01-27 Thread Lu Baolu
On 1/28/21 1:53 AM, Nadav Amit wrote: From: Nadav Amit When an Intel IOMMU is virtualized, and a physical device is passed-through to the VM, changes of the virtual IOMMU need to be propagated to the physical IOMMU. The hypervisor therefore needs to monitor PTE mappings in the IOMMU

RE: [RFC PATCH v2] uacce: Add uacce_ctrl misc device

2021-01-27 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Jason Gunthorpe [mailto:j...@ziepe.ca] > Sent: Wednesday, January 27, 2021 7:20 AM > To: Song Bao Hua (Barry Song) > Cc: Wangzhou (B) ; Greg Kroah-Hartman > ; Arnd Bergmann ; Zhangfei Gao > ; linux-accelerat...@lists.ozlabs.org; >

[PATCH 1/3] Adding page_offset_mask to device_dma_parameters

2021-01-27 Thread Jianxiong Gao via iommu
Some devices rely on the address offset in a page to function correctly (NVMe driver as an example). These devices may use a different page size than the Linux kernel. The address offset has to be preserved upon mapping, and in order to do so, we need to record the page_offset_mask first.

[PATCH 2/3] Add swiotlb offset preserving mapping when dma_dma_parameters->page_offset_mask is non zero.

2021-01-27 Thread Jianxiong Gao via iommu
For devices that need to preserve address offset on mapping through swiotlb, this patch adds offset preserving based on page_offset_mask and keeps the offset if the mask is non zero. This is needed for device drivers like NVMe. Signed-off-by: Jianxiong Gao --- kernel/dma/swiotlb.c | 25

[PATCH 3/3] Adding device_dma_parameters->offset_preserve_mask to NVMe driver.

2021-01-27 Thread Jianxiong Gao via iommu
NVMe driver relies on the address offset to function properly. This patch adds the offset preserve mask to NVMe driver when mapping via dma_map_sg_attrs and unmapping via nvme_unmap_sg. The mask depends on the page size defined by CC.MPS register of NVMe controller. Signed-off-by: Jianxiong Gao

Re: [PATCH v3 2/2] vfio/iommu_type1: Fix some sanity checks in detach group

2021-01-27 Thread Alex Williamson
On Fri, 22 Jan 2021 17:26:35 +0800 Keqian Zhu wrote: > vfio_sanity_check_pfn_list() is used to check whether pfn_list and > notifier are empty when remove the external domain, so it makes a > wrong assumption that only external domain will use the pinning > interface. > > Now we apply the

Re: [PATCH 2/5] kernel/dma: remove unnecessary unmap_kernel_range

2021-01-27 Thread Nicholas Piggin
Excerpts from Christoph Hellwig's message of January 27, 2021 5:10 pm: > On Tue, Jan 26, 2021 at 05:08:46PM -0500, Konrad Rzeszutek Wilk wrote: >> On Tue, Jan 26, 2021 at 02:54:01PM +1000, Nicholas Piggin wrote: >> > vunmap will remove ptes. >> >> Should there be some ASSERT after the vunmap to

Re: [PATCH v3 5/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-01-27 Thread Ricardo Ribalda
Hi Christoph On Wed, Jan 27, 2021 at 4:56 PM . Christoph Hellwig wrote: > > On Wed, Jan 27, 2021 at 12:29:08AM +0100, Ricardo Ribalda wrote: > > - Is there any platform where dma_alloc_noncontiguos can fail? > > This is, !ops->alloc_noncontiguous and !dev->coherent_dma_mask > > If yes then we

[PATCH RFC 9/9] iommu/vt-d: Introduce map_sg() for Intel IOMMUs

2021-01-27 Thread Chuck Lever
Attempt to reduce indirect call overhead when mapping a substantial scatter-gather list. Signed-off-by: Chuck Lever --- drivers/iommu/intel/iommu.c | 37 + 1 file changed, 37 insertions(+) diff --git a/drivers/iommu/intel/iommu.c

[PATCH RFC 4/9] iommu/io-pgtable: Introduce map_sg() as a page table op

2021-01-27 Thread Chuck Lever
From: Isaac J. Manjarres While mapping a scatter-gather list, iommu_map_sg() calls into the IOMMU driver through an indirect call, which can call into the io-pgtable code through another indirect call. This sequence of going through the IOMMU core code, the IOMMU driver, and finally the

[PATCH RFC 8/9] iommu/arm-smmu: Hook up map_sg()

2021-01-27 Thread Chuck Lever
From: Isaac J. Manjarres Now that everything is in place for iommu_map_sg() to defer mapping a scatter-gather list to the io-pgtable layer, implement the map_sg() callback in the SMMU driver, so that iommu_map_sg() can invoke it with the entire scatter-gather list that will be mapped.

Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges

2021-01-27 Thread Rob Herring
On Tue, 19 Jan 2021 18:52:03 +0800, Yong Wu wrote: > The commit e0d072782c73 ("dma-mapping: introduce DMA range map, > supplanting dma_pfn_offset") always update dma_range_map even though it was > already set, like in the sunxi_mbus driver. the issue is reported at [1]. > This patch avoid

[PATCH RFC 3/9] iommu/vt-d: Add iotlb_sync_map callback

2021-01-27 Thread Chuck Lever
From: Lu Baolu Some Intel VT-d hardware implementations don't support memory coherency for page table walk (presented by the Page-Walk-coherency bit in the ecap register), so that software must flush the corresponding CPU cache lines explicitly after each page table entry update. The

[PATCH RFC 7/9] iommu: Introduce map_sg() as an IOMMU op for IOMMU drivers

2021-01-27 Thread Chuck Lever
From: Isaac J. Manjarres Add support for IOMMU drivers to have their own map_sg() callbacks. This completes the path for having iommu_map_sg() invoke an IOMMU driver's map_sg() callback, which can then invoke the io-pgtable map_sg() callback with the entire scatter-gather list, so that it can be

[PATCH RFC 5/9] iommu/io-pgtable-arm: Hook up map_sg()

2021-01-27 Thread Chuck Lever
From: Isaac J. Manjarres Implement the map_sg io-pgtable op for the ARM LPAE io-pgtable code, so that IOMMU drivers can call it when they need to map a scatter-gather list. Signed-off-by: Isaac J. Manjarres Tested-by: Sai Prakash Ranjan Signed-off-by: Chuck Lever ---

[PATCH RFC 6/9] iommu/io-pgtable-arm-v7s: Hook up map_sg()

2021-01-27 Thread Chuck Lever
From: Isaac J. Manjarres Implement the map_sg io-pgtable op for the ARMv7s io-pgtable code, so that IOMMU drivers can call it when they need to map a scatter-gather list. Signed-off-by: Isaac J. Manjarres Tested-by: Sai Prakash Ranjan Signed-off-by: Chuck Lever ---

[PATCH RFC 2/9] iommu: Add iova and size as parameters in iotlb_sync_map

2021-01-27 Thread Chuck Lever
From: Yong Wu iotlb_sync_map allow IOMMU drivers tlb sync after completing the whole mapping. This patch adds iova and size as the parameters in it. then the IOMMU driver could flush tlb with the whole range once after iova mapping to improve performance. Signed-off-by: Yong Wu Reviewed-by:

[PATCH RFC 1/9] iommu: Move iotlb_sync_map out from __iommu_map

2021-01-27 Thread Chuck Lever
From: Yong Wu In the end of __iommu_map, It alway call iotlb_sync_map. This patch moves iotlb_sync_map out from __iommu_map since it is unnecessary to call this for each sg segment especially iotlb_sync_map is flush tlb all currently. Add a little helper _iommu_map for this. Signed-off-by:

[PATCH RFC 0/9] Possible set of VT-d optimizations

2021-01-27 Thread Chuck Lever
Hi- This collection of patches seems to get the best throughtput results so far. The NFS WRITE result is fully restored, and the NFS READ result is very close to fully restored. Children see throughput for 12 initial writers = 5008474.03 kB/sec Parent sees throughput for 12

Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges

2021-01-27 Thread Robin Murphy
On 2021-01-27 19:09, Rob Herring wrote: On Wed, Jan 27, 2021 at 7:13 AM Robin Murphy wrote: [ + Christoph, Marek ] On 2021-01-27 13:00, Paul Kocialkowski wrote: Hi, On Tue 19 Jan 21, 18:52, Yong Wu wrote: The commit e0d072782c73 ("dma-mapping: introduce DMA range map, supplanting

Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges

2021-01-27 Thread Robin Murphy
On 2021-01-27 19:07, Rob Herring wrote: On Tue, Jan 19, 2021 at 4:52 AM Yong Wu wrote: The commit e0d072782c73 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset") always update dma_range_map even though it was already set, like in the sunxi_mbus driver. the issue is reported

Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges

2021-01-27 Thread Rob Herring
On Wed, Jan 27, 2021 at 7:13 AM Robin Murphy wrote: > > [ + Christoph, Marek ] > > On 2021-01-27 13:00, Paul Kocialkowski wrote: > > Hi, > > > > On Tue 19 Jan 21, 18:52, Yong Wu wrote: > >> The commit e0d072782c73 ("dma-mapping: introduce DMA range map, > >> supplanting dma_pfn_offset") always

Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges

2021-01-27 Thread Rob Herring
On Tue, Jan 19, 2021 at 4:52 AM Yong Wu wrote: > > The commit e0d072782c73 ("dma-mapping: introduce DMA range map, > supplanting dma_pfn_offset") always update dma_range_map even though it was > already set, like in the sunxi_mbus driver. the issue is reported at [1]. > This patch avoid

Re: [PATCH v2] iommu/vt-d: do not use flush-queue when caching-mode is on

2021-01-27 Thread Nadav Amit
> On Jan 27, 2021, at 3:25 AM, Lu Baolu wrote: > > On 2021/1/27 14:17, Nadav Amit wrote: >> From: Nadav Amit >> When an Intel IOMMU is virtualized, and a physical device is >> passed-through to the VM, changes of the virtual IOMMU need to be >> propagated to the physical IOMMU. The hypervisor

[PATCH v3] iommu/vt-d: do not use flush-queue when caching-mode is on

2021-01-27 Thread Nadav Amit
From: Nadav Amit When an Intel IOMMU is virtualized, and a physical device is passed-through to the VM, changes of the virtual IOMMU need to be propagated to the physical IOMMU. The hypervisor therefore needs to monitor PTE mappings in the IOMMU page-tables. Intel specifications provide

[PATCH 2/2] iommu/io-pgtable: Remove TLBI_ON_MAP quirk

2021-01-27 Thread Robin Murphy
IO_PGTABLE_QUIRK_TLBI_ON_MAP is now fully superseded by the core API's iotlb_sync_map callback. Signed-off-by: Robin Murphy --- drivers/iommu/io-pgtable-arm-v7s.c | 8 +--- include/linux/io-pgtable.h | 5 - 2 files changed, 1 insertion(+), 12 deletions(-) diff --git

[PATCH 1/2] iommu/msm: Hook up iotlb_sync_map

2021-01-27 Thread Robin Murphy
The core API can now accommodate invalidate-on-map style behaviour in a single efficient call, so hook that up instead of having io-pgatble do it piecemeal. Signed-off-by: Robin Murphy --- Just a little quick cleanup on top of the Mediatek TLB patches now queued - CC'ing a bunch of folks from

Re: [PATCH RESEND] dma-mapping: benchmark: fix kernel crash when dma_map_single fails

2021-01-27 Thread Christoph Hellwig
Thanks, applied. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v3 5/6] media: uvcvideo: Use dma_alloc_noncontiguos API

2021-01-27 Thread . Christoph Hellwig
On Wed, Jan 27, 2021 at 12:29:08AM +0100, Ricardo Ribalda wrote: > - Is there any platform where dma_alloc_noncontiguos can fail? > This is, !ops->alloc_noncontiguous and !dev->coherent_dma_mask > If yes then we need to add a function to let the driver know in > advance that it has to use the

[PATCH v12 10/10] iommu/arm-smmu-v3: Add stall support for platform devices

2021-01-27 Thread Jean-Philippe Brucker
The SMMU provides a Stall model for handling page faults in platform devices. It is similar to PCIe PRI, but doesn't require devices to have their own translation cache. Instead, faulting transactions are parked and the OS is given a chance to fix the page tables and retry the transaction. Enable

[PATCH v12 09/10] ACPI/IORT: Enable stall support for platform devices

2021-01-27 Thread Jean-Philippe Brucker
Copy the "Stall supported" bit, that tells whether a named component supports stall, into the dma-can-stall device property. Acked-by: Jonathan Cameron Signed-off-by: Jean-Philippe Brucker --- drivers/acpi/arm64/iort.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v12 07/10] iommu/arm-smmu-v3: Maintain a SID->device structure

2021-01-27 Thread Jean-Philippe Brucker
When handling faults from the event or PRI queue, we need to find the struct device associated with a SID. Add a rb_tree to keep track of SIDs. Acked-by: Jonathan Cameron Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 13 +-

[PATCH v12 08/10] dt-bindings: document stall property for IOMMU masters

2021-01-27 Thread Jean-Philippe Brucker
On ARM systems, some platform devices behind an IOMMU may support stall, which is the ability to recover from page faults. Let the firmware tell us when a device supports stall. Reviewed-by: Rob Herring Signed-off-by: Jean-Philippe Brucker --- .../devicetree/bindings/iommu/iommu.txt|

[PATCH v12 06/10] iommu: Add a page fault handler

2021-01-27 Thread Jean-Philippe Brucker
Some systems allow devices to handle I/O Page Faults in the core mm. For example systems implementing the PCIe PRI extension or Arm SMMU stall model. Infrastructure for reporting these recoverable page faults was added to the IOMMU core by commit 0c830e6b3282 ("iommu: Introduce device fault report

[PATCH v12 05/10] uacce: Enable IOMMU_DEV_FEAT_IOPF

2021-01-27 Thread Jean-Philippe Brucker
The IOPF (I/O Page Fault) feature is now enabled independently from the SVA feature, because some IOPF implementations are device-specific and do not require IOMMU support for PCIe PRI or Arm SMMU stall. Enable IOPF unconditionally when enabling SVA for now. In the future, if a device driver

[PATCH v12 04/10] iommu/vt-d: Support IOMMU_DEV_FEAT_IOPF

2021-01-27 Thread Jean-Philippe Brucker
Allow drivers to query and enable IOMMU_DEV_FEAT_IOPF, which amounts to checking whether PRI is enabled. Reviewed-by: Lu Baolu Signed-off-by: Jean-Philippe Brucker --- Cc: David Woodhouse Cc: Lu Baolu --- drivers/iommu/intel/iommu.c | 11 --- 1 file changed, 8 insertions(+), 3

[PATCH v12 03/10] iommu: Separate IOMMU_DEV_FEAT_IOPF from IOMMU_DEV_FEAT_SVA

2021-01-27 Thread Jean-Philippe Brucker
Some devices manage I/O Page Faults (IOPF) themselves instead of relying on PCIe PRI or Arm SMMU stall. Allow their drivers to enable SVA without mandating IOMMU-managed IOPF. The other device drivers now need to first enable IOMMU_DEV_FEAT_IOPF before enabling IOMMU_DEV_FEAT_SVA. Enabling

[PATCH v12 01/10] iommu: Fix comment for struct iommu_fwspec

2021-01-27 Thread Jean-Philippe Brucker
Commit 986d5ecc5699 ("iommu: Move fwspec->iommu_priv to struct dev_iommu") removed iommu_priv from fwspec and commit 5702ee24182f ("ACPI/IORT: Check ATS capability in root complex nodes") added @flags. Update the struct doc. Acked-by: Jonathan Cameron Signed-off-by: Jean-Philippe Brucker ---

[PATCH v12 02/10] iommu/arm-smmu-v3: Use device properties for pasid-num-bits

2021-01-27 Thread Jean-Philippe Brucker
The pasid-num-bits property shouldn't need a dedicated fwspec field, it's a job for device properties. Add properties for IORT, and access the number of PASID bits using device_property_read_u32(). Suggested-by: Robin Murphy Acked-by: Jonathan Cameron Signed-off-by: Jean-Philippe Brucker ---

[PATCH v12 00/10] iommu: I/O page faults for SMMUv3

2021-01-27 Thread Jean-Philippe Brucker
Add stall support to the SMMUv3, along with a common I/O Page Fault handler. Since v11 I added a sanity check in arm_smmu_dev_disable_feature(), patch 10: return -EBUSY if device drivers attempt to disable the IOPF feature before SVA. That would leak the IOPF param and fault handler. v11:

Re: [PATCH v4 00/13] iommu/amd: Add Generic IO Page Table Framework Support

2021-01-27 Thread Suravee Suthikulpanit
On 1/27/21 7:06 PM, Joerg Roedel wrote: Hi Suravee, On Tue, Dec 15, 2020 at 01:36:52AM -0600, Suravee Suthikulpanit wrote: Suravee Suthikulpanit (13): iommu/amd: Re-define amd_iommu_domain_encode_pgtable as inline iommu/amd: Prepare for generic IO page table framework iommu/amd:

Re: [PATCH v4 0/7] MediaTek IOMMU improve tlb flush performance in map/unmap

2021-01-27 Thread Will Deacon
On Thu, 7 Jan 2021 20:29:02 +0800, Yong Wu wrote: > This patchset is to improve tlb flushing performance in iommu_map/unmap > for MediaTek IOMMU. > > For iommu_map, currently MediaTek IOMMU use IO_PGTABLE_QUIRK_TLBI_ON_MAP > to do tlb_flush for each a memory chunk. this is so unnecessary. we

Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges

2021-01-27 Thread Robin Murphy
[ + Christoph, Marek ] On 2021-01-27 13:00, Paul Kocialkowski wrote: Hi, On Tue 19 Jan 21, 18:52, Yong Wu wrote: The commit e0d072782c73 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset") always update dma_range_map even though it was already set, like in the sunxi_mbus

Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges

2021-01-27 Thread Paul Kocialkowski
Hi, On Tue 19 Jan 21, 18:52, Yong Wu wrote: > The commit e0d072782c73 ("dma-mapping: introduce DMA range map, > supplanting dma_pfn_offset") always update dma_range_map even though it was > already set, like in the sunxi_mbus driver. the issue is reported at [1]. > This patch avoid this(Updating

Re: [PATCH v1 2/2] iommu: add Unisoc iommu basic driver

2021-01-27 Thread Chunyan Zhang
On Fri, 22 Jan 2021 at 05:46, Robin Murphy wrote: > > On 2021-01-21 11:23, Chunyan Zhang wrote: > > From: Chunyan Zhang > > > > This patch only adds display iommu support, the driver was tested with sprd > > dpu and image codec processor. > > > > The iommu support for others would be added once

Re: [PATCH v4 00/13] iommu/amd: Add Generic IO Page Table Framework Support

2021-01-27 Thread Joerg Roedel
Hi Suravee, On Tue, Dec 15, 2020 at 01:36:52AM -0600, Suravee Suthikulpanit wrote: > Suravee Suthikulpanit (13): > iommu/amd: Re-define amd_iommu_domain_encode_pgtable as inline > iommu/amd: Prepare for generic IO page table framework > iommu/amd: Move pt_root to struct amd_io_pgtable >

Re: [PATCH] iommu/amd: remove h from printk format specifier

2021-01-27 Thread Joerg Roedel
On Tue, Dec 15, 2020 at 01:30:21PM -0800, t...@redhat.com wrote: > drivers/iommu/amd/init.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH -next] iommu: amd: Use DEFINE_SPINLOCK() for spinlock

2021-01-27 Thread Joerg Roedel
On Mon, Dec 28, 2020 at 09:51:12PM +0800, Zheng Yongjun wrote: > spinlock can be initialized automatically with DEFINE_SPINLOCK() > rather than explicitly calling spin_lock_init(). > > Signed-off-by: Zheng Yongjun > --- > drivers/iommu/amd/iommu_v2.c | 4 +--- > 1 file changed, 1 insertion(+),

Re: [PATCH -next] iommu/amd/init: convert comma to semicolon

2021-01-27 Thread Joerg Roedel
On Mon, Dec 14, 2020 at 09:44:38PM +0800, Zheng Yongjun wrote: > Replace a comma between expression statements by a semicolon. > > Signed-off-by: Zheng Yongjun > --- > drivers/iommu/amd/init.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) What tree is this against? This code does

[PATCH v3 3/3] iommu/arm-smmu-v3: Reserving the entire SMMU register space

2021-01-27 Thread Zhen Lei
commit 52f3fab0067d ("iommu/arm-smmu-v3: Don't reserve implementation defined register space") only reserves the basic SMMU register space. So the ECMDQ register space is not covered, it should be mapped again. Due to the size of this ECMDQ resource is not fixed, depending on

[PATCH v3 1/3] perf/smmuv3: Don't reserve the PMCG register spaces

2021-01-27 Thread Zhen Lei
According to the SMMUv3 specification: Each PMCG counter group is represented by one 4KB page (Page 0) with one optional additional 4KB page (Page 1), both of which are at IMPLEMENTATION DEFINED base addresses. This means that the PMCG register spaces may be within the 64KB pages of the SMMUv3

[PATCH v3 0/3] perf/smmuv3: Don't reserve the PMCG register spaces

2021-01-27 Thread Zhen Lei
v2 --> v3: Patch 3 is updated because https://lkml.org/lkml/2021/1/22/532 has been queued in advance. v1 --> v2: According to Robin Murphy's suggestion: https://lkml.org/lkml/2021/1/20/470 Don't reserve the PMCG register spaces, and reserve the entire SMMU register space. v1: Since the PMCG

[PATCH v3 2/3] perf/smmuv3: Add a MODULE_SOFTDEP() to indicate dependency on SMMU

2021-01-27 Thread Zhen Lei
The MODULE_SOFTDEP() gives user space a hint of the loading sequence. And when command "modprobe arm_smmuv3_pmu" is executed, the arm_smmu_v3.ko is automatically loaded in advance. Signed-off-by: Zhen Lei --- drivers/perf/arm_smmuv3_pmu.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [RESEND PATCH 1/1] iommu/amd: Remove unnecessary assignment

2021-01-27 Thread Joerg Roedel
On Thu, Dec 10, 2020 at 10:13:30AM +0800, Adrian Huang wrote: > drivers/iommu/amd/init.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) Applied, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH v2 0/6] IOMMU: Some more IOVA and core code tidy-up

2021-01-27 Thread Joerg Roedel
On Wed, Jan 06, 2021 at 09:35:05PM +0800, John Garry wrote: > Just some tidy-up to IOVA and core code. > > Based on v5.11-rc2 > > Differences to v1: > - Add core IOMMU patches > > John Garry (6): > iova: Make has_iova_flush_queue() private > iova: Delete copy_reserved_iova() > iova: Stop

Re: [PATCH v2] iommu/vt-d: do not use flush-queue when caching-mode is on

2021-01-27 Thread Lu Baolu
On 2021/1/27 14:17, Nadav Amit wrote: From: Nadav Amit When an Intel IOMMU is virtualized, and a physical device is passed-through to the VM, changes of the virtual IOMMU need to be propagated to the physical IOMMU. The hypervisor therefore needs to monitor PTE mappings in the IOMMU

Re: [PATCH v6 07/33] iommu: Avoid reallocate default domain for a group

2021-01-27 Thread Yong Wu
On Tue, 2021-01-26 at 22:23 +, Will Deacon wrote: > On Mon, Jan 11, 2021 at 07:18:48PM +0800, Yong Wu wrote: > > If group->default_domain exists, avoid reallocate it. > > > > In some iommu drivers, there may be several devices share a group. Avoid > > realloc the default domain for this case.

Re: [PATCH 1/1] iommu/arm-smmu-v3: add support for BBML

2021-01-27 Thread Robin Murphy
On 2021-01-27 07:36, Keqian Zhu wrote: On 2021/1/27 10:01, Leizhen (ThunderTown) wrote: On 2021/1/26 18:12, Will Deacon wrote: On Mon, Jan 25, 2021 at 08:23:40PM +, Robin Murphy wrote: Now we probably will need some degreee of BBML feature awareness for the sake of SVA if and when we

Re: [PATCH 1/1] iommu/arm-smmu-v3: Use DEFINE_RES_MEM() to simplify code

2021-01-27 Thread Leizhen (ThunderTown)
On 2021/1/27 17:23, Will Deacon wrote: > On Wed, Jan 27, 2021 at 10:05:50AM +0800, Leizhen (ThunderTown) wrote: >> I've sent another set of patches. https://lkml.org/lkml/2021/1/26/1065 >> If those patches are acceptable, then this one should be ignored. > > I've already queued this one, so if

Re: [PATCH 1/1] iommu/arm-smmu-v3: Use DEFINE_RES_MEM() to simplify code

2021-01-27 Thread Will Deacon
On Wed, Jan 27, 2021 at 10:05:50AM +0800, Leizhen (ThunderTown) wrote: > I've sent another set of patches. https://lkml.org/lkml/2021/1/26/1065 > If those patches are acceptable, then this one should be ignored. I've already queued this one, so if you want me to drop it then you need to send me a