Intel IOMMU updates for v6.19
Subsystems (2)
Lu Baolu
maintainerHi 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
Lu Baolu
maintainerPATCH 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.
--- drivers/iommu/intel/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/intel/Kconfig +1 -1
@@ -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
Lu Baolu
maintainerPATCH 2/2 iommu/vt-d: Fix unused invalidation hint in qi_desc_iotlb
In reply to Lu BaoluFrom: 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.
--- drivers/iommu/intel/iommu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/intel/iommu.h +1 -1
@@ -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
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 ofINTEL_IOMMU_FLOPPY_WAThese patches are based on v6.18-rc6. Please consider them for the iommu/vt-d branch.
Best regards,
baoluAashish Sharma (1):
iommu/vt-d: Fix unused invalidation hint inqi_desc_iotlb
Quoted 6 lines
Vineeth Pillai (Google) (1):
iommu/vt-d: SetINTEL_IOMMU_FLOPPY_WAdepend onBLK_DEV_FDdrivers/iommu/intel/Kconfig | 2 +- drivers/iommu/intel/iommu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks Baolu.