* [PATCH 0/2] [PULL REQUEST] Intel IOMMU updates for v6.19
@ 2025-11-19 5:16 Lu Baolu
2025-11-19 5:16 ` [PATCH 1/2] iommu/vt-d: Set INTEL_IOMMU_FLOPPY_WA depend on BLK_DEV_FD Lu Baolu
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Lu Baolu @ 2025-11-19 5:16 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
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(-)
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] iommu/vt-d: Set INTEL_IOMMU_FLOPPY_WA depend on BLK_DEV_FD
2025-11-19 5:16 [PATCH 0/2] [PULL REQUEST] Intel IOMMU updates for v6.19 Lu Baolu
@ 2025-11-19 5:16 ` Lu Baolu
2025-11-19 5:16 ` [PATCH 2/2] iommu/vt-d: Fix unused invalidation hint in qi_desc_iotlb Lu Baolu
2025-11-20 10:33 ` [PATCH 0/2] [PULL REQUEST] Intel IOMMU updates for v6.19 Joerg Roedel
2 siblings, 0 replies; 4+ messages in thread
From: Lu Baolu @ 2025-11-19 5:16 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
From: "Vineeth Pillai (Google)" <vineeth@bitbyteword.org>
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")
Signed-off-by: Vineeth Pillai (Google) <vineeth@bitbyteword.org>
Link: https://lore.kernel.org/r/20251002161625.1155133-1-vineeth@bitbyteword.org
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
drivers/iommu/intel/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/intel/Kconfig b/drivers/iommu/intel/Kconfig
index f2f538c70650..17a91f881b2e 100644
--- a/drivers/iommu/intel/Kconfig
+++ b/drivers/iommu/intel/Kconfig
@@ -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
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] iommu/vt-d: Fix unused invalidation hint in qi_desc_iotlb
2025-11-19 5:16 [PATCH 0/2] [PULL REQUEST] Intel IOMMU updates for v6.19 Lu Baolu
2025-11-19 5:16 ` [PATCH 1/2] iommu/vt-d: Set INTEL_IOMMU_FLOPPY_WA depend on BLK_DEV_FD Lu Baolu
@ 2025-11-19 5:16 ` Lu Baolu
2025-11-20 10:33 ` [PATCH 0/2] [PULL REQUEST] Intel IOMMU updates for v6.19 Joerg Roedel
2 siblings, 0 replies; 4+ messages in thread
From: Lu Baolu @ 2025-11-19 5:16 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
From: Aashish Sharma <aashish@aashishsharma.net>
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")
Signed-off-by: Aashish Sharma <aashish@aashishsharma.net>
Link: https://lore.kernel.org/r/20251009010903.1323979-1-aashish@aashishsharma.net
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
drivers/iommu/intel/iommu.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h
index 3056583d7f56..dcc5466d35f9 100644
--- a/drivers/iommu/intel/iommu.h
+++ b/drivers/iommu/intel/iommu.h
@@ -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;
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] [PULL REQUEST] Intel IOMMU updates for v6.19
2025-11-19 5:16 [PATCH 0/2] [PULL REQUEST] Intel IOMMU updates for v6.19 Lu Baolu
2025-11-19 5:16 ` [PATCH 1/2] iommu/vt-d: Set INTEL_IOMMU_FLOPPY_WA depend on BLK_DEV_FD Lu Baolu
2025-11-19 5:16 ` [PATCH 2/2] iommu/vt-d: Fix unused invalidation hint in qi_desc_iotlb Lu Baolu
@ 2025-11-20 10:33 ` Joerg Roedel
2 siblings, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2025-11-20 10:33 UTC (permalink / raw)
To: Lu Baolu; +Cc: iommu, linux-kernel
On Wed, Nov 19, 2025 at 01:16:11PM +0800, Lu Baolu wrote:
> 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(-)
Applied, thanks Baolu.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-20 10:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19 5:16 [PATCH 0/2] [PULL REQUEST] Intel IOMMU updates for v6.19 Lu Baolu
2025-11-19 5:16 ` [PATCH 1/2] iommu/vt-d: Set INTEL_IOMMU_FLOPPY_WA depend on BLK_DEV_FD Lu Baolu
2025-11-19 5:16 ` [PATCH 2/2] iommu/vt-d: Fix unused invalidation hint in qi_desc_iotlb Lu Baolu
2025-11-20 10:33 ` [PATCH 0/2] [PULL REQUEST] Intel IOMMU updates for v6.19 Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox