Skip to contentSkip to conversation

Intel IOMMU updates for v6.19

GIT PULL New Lu Baolu 2 participants 4 messages Nov 19, 2025 – Nov 20, 2025

Subsystems (2)
lore
Share & tools
lore

Lu Baolu

author maintainer
#0 lore raw

Hi Joerg,

The following changes have been queued for v6.19-rc1. They are about two small and non-critical fixes, including:

- Use right invalidation hint in qi_desc_iotlb()
- Reduce the scope of INTEL_IOMMU_FLOPPY_WA

These patches are based on v6.18-rc6. Please consider them for the iommu/vt-d branch.

Best regards,
baolu

Aashish Sharma (1):
iommu/vt-d: Fix unused invalidation hint in qi_desc_iotlb

Vineeth Pillai (Google) (1):
iommu/vt-d: Set INTEL_IOMMU_FLOPPY_WA depend on BLK_DEV_FD

 drivers/iommu/intel/Kconfig | 2 +-
 drivers/iommu/intel/iommu.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH 1/2 iommu/vt-d: Set INTEL_IOMMU_FLOPPY_WA depend on BLK_DEV_FD

From: "Vineeth Pillai (Google)" <[email protected]>

INTEL_IOMMU_FLOPPY_WA workaround was introduced to create direct mappings for first 16MB for floppy devices as the floppy drivers were not using dma apis. We need not do this direct map if floppy driver is not enabled.

INTEL_IOMMU_FLOPPY_WA is generally not a good idea. Iommu will be mapping pages in this address range while kernel would also be allocating from this range(mostly on memory stress). A misbehaving device using this domain will have access to the pages that the kernel might be actively using. We noticed this while running a test that was trying to figure out if any pages used by kernel is in iommu page tables.

This patch reduces the scope of the above issue by disabling the workaround when floppy driver is not enabled. But we would still need to fix the floppy driver to use dma apis so that we need not do direct map without reserving the pages. Or the other option is to reserve this memory range in firmware so that kernel will not use the pages.

Fixes d850c2ee5fe2 ("iommu/vt-d: Expose ISA direct mapping region via iommu_get_resv_regions")
Fixes 49a0429e53f2 ("Intel IOMMU: Iommu floppy workaround")
---
 drivers/iommu/intel/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/intel/Kconfig +1 -1
index f2f538c70650..17a91f881b2e 100644
@@ -66,7 +66,7 @@ config INTEL_IOMMU_DEFAULT_ON
 
 config INTEL_IOMMU_FLOPPY_WA
 	def_bool y
-	depends on X86
+	depends on X86 && BLK_DEV_FD
 	help
 	  Floppy disk drivers are known to bypass DMA API calls
 	  thereby failing to work when IOMMU is enabled. This
Signature · 1 line
2.43.0
author maintainer
#2 lore raw

PATCH 2/2 iommu/vt-d: Fix unused invalidation hint in qi_desc_iotlb

In reply to Lu Baolu

From: Aashish Sharma <[email protected]>

Invalidation hint (ih) in the function 'qi_desc_iotlb' is initialized to zero and never used. It is embedded in the 0th bit of the 'addr' parameter. Get the correct 'ih' value from there.

Fixes f701c9f36bcb ("iommu/vt-d: Factor out invalidation descriptor composition")
---
 drivers/iommu/intel/iommu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/intel/iommu.h +1 -1
index 3056583d7f56..dcc5466d35f9 100644
@@ -1097,7 +1097,7 @@ static inline void qi_desc_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
 				 struct qi_desc *desc)
 {
 	u8 dw = 0, dr = 0;
-	int ih = 0;
+	int ih = addr & 1;
 
 	if (cap_write_drain(iommu->cap))
 		dw = 1;
Signature · 1 line
2.43.0
maintainer Applied
#3 lore raw
In reply to Lu Baolu
Quoted 17 lines · Lu Baolu

Hi Joerg,

The following changes have been queued for v6.19-rc1. They are about two small and non-critical fixes, including:

- Use right invalidation hint in qi_desc_iotlb()
- Reduce the scope of INTEL_IOMMU_FLOPPY_WA

These patches are based on v6.18-rc6. Please consider them for the iommu/vt-d branch.

Best regards,
baolu

Aashish Sharma (1):
iommu/vt-d: Fix unused invalidation hint in qi_desc_iotlb

Quoted 6 lines

Vineeth Pillai (Google) (1):
iommu/vt-d: Set INTEL_IOMMU_FLOPPY_WA depend on BLK_DEV_FD

 drivers/iommu/intel/Kconfig | 2 +-
 drivers/iommu/intel/iommu.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks Baolu.