Re: [PATCH] iommu: explicitly check for NULL in iommu_dma_get_resv_regions()

2022-02-10 Thread Robin Murphy
On 2022-02-09 14:09, Aleksandr Fedorov wrote: iommu_dma_get_resv_regions() assumes that iommu_fwspec field for corresponding device is set which is not always true. Since iommu_dma_get_resv_regions() seems to be a future-proof generic API that can be used by any iommu driver, add an explicit che

[PATCH] iommu: Remove trivial ops->capable implementations

2022-02-10 Thread Robin Murphy
Implementing ops->capable to always return false is pointless since it's the default behaviour anyway. Clean up the unnecessary implementations. Signed-off-by: Robin Murphy --- Spinning this out of my bus ops stuff (currently 30 patches and counting...) since it would be better off alongside Bao

[PATCH] iommu/vt-d: Add missing "__init" for rmrr_sanity_check()

2022-02-10 Thread Marco Bonelli
rmrr_sanity_check() calls arch_rmrr_sanity_check(), which is marked as "__init". Add the annotation for rmrr_sanity_check() too. This function is currently only called from dmar_parse_one_rmrr() which is also "__init". Signed-off-by: Marco Bonelli --- drivers/iommu/intel/iommu.c | 2 +- 1 file c

[PATCH] iommu/amd: Fix I/O page table memory leak

2022-02-10 Thread Suravee Suthikulpanit via iommu
The current logic updates the I/O page table mode for the domain before calling the logic to free memory used for the page table. This results in IOMMU page table memory leak, and can be observed when launching VM w/ pass-through devices. Fix by freeing the memory used for page table before updati

Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit

2022-02-10 Thread Fenghua Yu
Hi, Jacob, On Wed, Feb 09, 2022 at 07:16:14PM -0800, Jacob Pan wrote: > Hi Fenghua, > > On Mon, 7 Feb 2022 15:02:48 -0800, Fenghua Yu wrote: > > > @@ -1047,8 +1040,6 @@ struct iommu_sva *intel_svm_bind(struct device > > *dev, struct mm_struct *mm, void } > > > > sva = intel_svm_bind_mm(i

Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit

2022-02-10 Thread Luck, Tony
On Thu, Feb 10, 2022 at 08:27:50AM -0800, Fenghua Yu wrote: > Hi, Jacob, > > On Wed, Feb 09, 2022 at 07:16:14PM -0800, Jacob Pan wrote: > > Hi Fenghua, > > > > On Mon, 7 Feb 2022 15:02:48 -0800, Fenghua Yu wrote: > > > > > @@ -1047,8 +1040,6 @@ struct iommu_sva *intel_svm_bind(struct device >

Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit

2022-02-10 Thread Fenghua Yu
Hi, Tony, On Thu, Feb 10, 2022 at 09:24:50AM -0800, Luck, Tony wrote: > On Thu, Feb 10, 2022 at 08:27:50AM -0800, Fenghua Yu wrote: > > Hi, Jacob, > > > > On Wed, Feb 09, 2022 at 07:16:14PM -0800, Jacob Pan wrote: > > > Hi Fenghua, > > > > > > On Mon, 7 Feb 2022 15:02:48 -0800, Fenghua Yu > >

Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit

2022-02-10 Thread Jacob Pan
On Wed, 9 Feb 2022 19:16:14 -0800, Jacob Pan wrote: > Hi Fenghua, > > On Mon, 7 Feb 2022 15:02:48 -0800, Fenghua Yu > wrote: > > > @@ -1047,8 +1040,6 @@ struct iommu_sva *intel_svm_bind(struct device > > *dev, struct mm_struct *mm, void } > > > > sva = intel_svm_bind_mm(iommu, dev, mm

Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit

2022-02-10 Thread Fenghua Yu
On Thu, Feb 10, 2022 at 10:49:04AM -0800, Jacob Pan wrote: > > On Wed, 9 Feb 2022 19:16:14 -0800, Jacob Pan > wrote: > > > Hi Fenghua, > > > > On Mon, 7 Feb 2022 15:02:48 -0800, Fenghua Yu > > wrote: > > > > > @@ -1047,8 +1040,6 @@ struct iommu_sva *intel_svm_bind(struct device > > > *dev, s

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

2022-02-10 Thread Janne Grunau
On 2022-02-09 17:31:16 +0100, Thierry Reding wrote: > On Sun, Feb 06, 2022 at 11:27:00PM +0100, Janne Grunau wrote: > > On 2021-09-15 17:19:39 +0200, Thierry Reding wrote: > > > On Tue, Sep 07, 2021 at 07:44:44PM +0200, Thierry Reding wrote: > > > > On Tue, Sep 07, 2021 at 10:33:24AM -0500, Rob Her

Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit

2022-02-10 Thread Fenghua Yu
Hi, Tony, On Thu, Feb 10, 2022 at 10:31:42AM -0800, Fenghua Yu wrote: > > On Thu, Feb 10, 2022 at 09:24:50AM -0800, Luck, Tony wrote: > > On Thu, Feb 10, 2022 at 08:27:50AM -0800, Fenghua Yu wrote: > > > Hi, Jacob, > > > > > > On Wed, Feb 09, 2022 at 07:16:14PM -0800, Jacob Pan wrote: > > > > Hi

Re: Error when running fio against nvme-of rdma target (mlx5 driver)

2022-02-10 Thread Martin Oliveira
On 2/9/22 1:41 AM, Chaitanya Kulkarni wrote: > On 2/8/22 6:50 PM, Martin Oliveira wrote: > > Hello, > > > > We have been hitting an error when running IO over our nvme-of setup, using > > the mlx5 driver and we are wondering if anyone has seen anything > > similar/has any suggestions. > > > > Bot

Re: [PATCH] iommu: Remove trivial ops->capable implementations

2022-02-10 Thread Lu Baolu
On 2/10/22 8:29 PM, Robin Murphy wrote: Implementing ops->capable to always return false is pointless since it's the default behaviour anyway. Clean up the unnecessary implementations. Signed-off-by: Robin Murphy --- Spinning this out of my bus ops stuff (currently 30 patches and counting...)

[PATCH] iommu/vt-d: Fix list_add double add when enabling VMD and scalable mode

2022-02-10 Thread Adrian Huang
From: Adrian Huang When enabling VMD and IOMMU scalable mode, the following kernel panic call trace/kernel log is shown in Eagle Stream platform (Sapphire Rapids CPU) during booting: pci :59:00.5: Adding to iommu group 42 ... vmd :59:00.5: PCI host bridge to bus 1:80 pci 1:80:01.

[PATCH 0/2] Replace intel_iommu_gfx_mapped with device_iommu_mapped()

2022-02-10 Thread Lu Baolu
Hi, This follows commit cca084692394a ("drm/i915: Use per device iommu check") to convert intel_iommu_gfx_mapped use in agp/intel to device_iommu_mapped(). With this changed, the export intel_iommu_gfx_mapped could be removed. Best regards, baolu Lu Baolu (2): agp/intel: Use per device iommu c

[PATCH 2/2] iommu/vt-d: Remove unnecessary exported symbol

2022-02-10 Thread Lu Baolu
The exported symbol intel_iommu_gfx_mapped is not used anywhere in the tree. Remove it to avoid dead code. Signed-off-by: Lu Baolu --- include/linux/intel-iommu.h | 1 - drivers/iommu/intel/iommu.c | 6 -- 2 files changed, 7 deletions(-) diff --git a/include/linux/intel-iommu.h b/include/li

[PATCH 1/2] agp/intel: Use per device iommu check

2022-02-10 Thread Lu Baolu
The IOMMU subsystem has already provided an interface to query whether the IOMMU hardware is enabled for a specific device. This changes the check from Intel specific intel_iommu_gfx_mapped (globally exported by the Intel IOMMU driver) to probing the presence of IOMMU on a specific device using the

[PATCH] dma-mapping: benchmark: Extract a common header file for map_benchmark definition

2022-02-10 Thread Tian Tao via iommu
kernel/dma/map_benchmark.c and selftests/dma/dma_map_benchmark.c have duplicate map_benchmark definitions, which tends to lead to inconsistent changes to map_benchmark on both sides, extract a common header file to avoid this problem. Signed-off-by: Tian Tao --- kernel/dma/map_benchmark.c

RE: [PATCH] dma-mapping: benchmark: Extract a common header file for map_benchmark definition

2022-02-10 Thread Song Bao Hua (Barry Song) via iommu
> -Original Message- > From: tiantao (H) > Sent: Friday, February 11, 2022 4:15 PM > To: Song Bao Hua (Barry Song) ; sh...@kernel.org; > chenxiang (M) > Cc: iommu@lists.linux-foundation.org; linux-kselft...@vger.kernel.org; > linux...@openeuler.org > Subject: [PATCH] dma-mapping: benchm