[PATCH v1 3/6] iommu/vt-d: Refactor iommu information of each domain

2022-06-25 Thread Lu Baolu
When a DMA domain is attached to a device, it needs to allocate a domain ID from its IOMMU. Currently, the domain ID information is stored in two static arrays embedded in the domain structure. This can lead to memory waste when the driver is running on a small platform. This optimizes these

[PATCH v1 4/6] iommu/vt-d: Add VTD_FLAG_IOMMU_PROBED flag

2022-06-25 Thread Lu Baolu
In the IOMMU hot-add path, there's a need to check whether an IOMMU has been probed. Instead of checking the IOMMU pointer in the global list, it's better to allocate a flag bit in iommu->flags for this purpose. Signed-off-by: Lu Baolu --- drivers/iommu/intel/iommu.h | 1 +

[PATCH v1 6/6] iommu/vt-d: Make DMAR_UNITS_SUPPORTED default 1024

2022-06-25 Thread Lu Baolu
If the available hardware exceeds DMAR_UNITS_SUPPORTED (previously set to MAX_IO_APICS, or 128), it causes these messages: "DMAR: Failed to allocate seq_id", "DMAR: Parse DMAR table failure.", and "x2apic: IRQ remapping doesn't support X2APIC mode x2apic disabled"; and the system fails to boot

[PATCH v1 1/6] iommu/vt-d: Remove unused domain_get_iommu()

2022-06-25 Thread Lu Baolu
It is not used anywhere. Remove it to avoid dead code. Signed-off-by: Lu Baolu --- drivers/iommu/intel/iommu.h | 1 - drivers/iommu/intel/iommu.c | 18 -- 2 files changed, 19 deletions(-) diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h index

[PATCH v1 2/6] iommu/vt-d: Use IDA interface to manage iommu sequence id

2022-06-25 Thread Lu Baolu
Switch dmar unit sequence id allocation and release from bitmap to IDA interface. Signed-off-by: Lu Baolu --- drivers/iommu/intel/dmar.c | 33 +++-- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c

[PATCH v1 0/6] iommu/vt-d: Reset DMAR_UNITS_SUPPORTED

2022-06-25 Thread Lu Baolu
Hi folks, This is a follow-up series of changes proposed by this patch: https://lore.kernel.org/linux-iommu/20220615183650.32075-1-steve.w...@hpe.com/ It removes several static arrays of size DMAR_UNITS_SUPPORTED and sets the DMAR_UNITS_SUPPORTED to 1024. Please help review and suggest. Best

[PATCH v1 5/6] iommu/vt-d: Remove global g_iommus array

2022-06-25 Thread Lu Baolu
The g_iommus is not used anywhere. Remove it to avoid dead code. Signed-off-by: Lu Baolu --- drivers/iommu/intel/iommu.c | 42 - 1 file changed, 42 deletions(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index

[PATCH 0/1] iommu/vt-d: Fixes for v5.19-rc4

2022-06-25 Thread Lu Baolu
Hi Joerg, One fix is queued for v5.19. It aims to fix: - RID2PASID setup/teardown failures for pci alias devices Please consider it for the iommu/fix branch. Best regards, Lu Baolu Lu Baolu (1): iommu/vt-d: Fix RID2PASID setup/teardown failure include/linux/intel-iommu.h | 3 --

[PATCH 1/1] iommu/vt-d: Fix RID2PASID setup/teardown failure

2022-06-25 Thread Lu Baolu
The IOMMU driver shares the pasid table for PCI alias devices. When the RID2PASID entry of the shared pasid table has been filled by the first device, the subsequent device will encounter the "DMAR: Setup RID2PASID failed" failure as the pasid entry has already been marked as present. As the

Re: iommu_sva_bind_device question

2022-06-25 Thread Fenghua Yu
Hi, Jerry and Baolu, On Fri, Jun 24, 2022 at 07:47:30AM -0700, Jerry Snitselaar wrote: > > > > > > Hi Baolu & Dave, > > > > fails. > > > > > > > > You also will get the following warning if you don't have scalable > > > > mode enabled (either not enabled by default, or if enabled by default > >

Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-25 Thread Michael Schmitz
Arnd, Am 24.06.2022 um 21:10 schrieb Arnd Bergmann: On Sat, Jun 18, 2022 at 3:06 AM Michael Schmitz wrote: Am 18.06.2022 um 00:57 schrieb Arnd Bergmann: All architecture-independent users of virt_to_bus() and bus_to_virt() have been fixed to use the dma mapping interfaces or have been

Re: iommu_sva_bind_device question

2022-06-25 Thread Jerry Snitselaar
On Sat, Jun 25, 2022 at 12:52:27PM -0700, Fenghua Yu wrote: > Hi, Jerry and Baolu, > > On Fri, Jun 24, 2022 at 07:47:30AM -0700, Jerry Snitselaar wrote: > > > > > > > Hi Baolu & Dave, > > > > > fails. > > > > > > > > > > You also will get the following warning if you don't have scalable > > > >

Re: [PATCH v9 00/11] iommu: SVA and IOPF refactoring

2022-06-25 Thread Baolu Lu
Hi folks, On 2022/6/21 22:43, Lu Baolu wrote: Hi folks, The former part of this series refactors the IOMMU SVA code by assigning an SVA type of iommu_domain to a shared virtual address and replacing sva_bind/unbind iommu ops with set/block_dev_pasid domain ops. The latter part changes the

[GIT PULL] dma-mapping fix for Linux 5.19

2022-06-25 Thread Christoph Hellwig
The following changes since commit a111daf0c53ae91e71fd2bfe7497862d14132e3e: Linux 5.19-rc3 (2022-06-19 15:06:47 -0500) are available in the Git repository at: git://git.infradead.org/users/hch/dma-mapping.git tags/dma-mapping-5.19-2022-06-26 for you to fetch changes up to