[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH rfcv2 19/20] intel_iommu: Bypass replay in stage-1 page table mod
From: |
Zhenzhong Duan |
Subject: |
[PATCH rfcv2 19/20] intel_iommu: Bypass replay in stage-1 page table mode |
Date: |
Wed, 19 Feb 2025 16:22:27 +0800 |
VFIO utilizes replay to setup initial shadow iommu mappings.
But when stage-1 page table is configured, it is passed to
host to construct nested page table, there is no replay needed.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
hw/i386/intel_iommu.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 225e332132..e4b83cbe50 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -5743,6 +5743,14 @@ static void vtd_iommu_replay(IOMMUMemoryRegion
*iommu_mr, IOMMUNotifier *n)
VTDContextEntry ce;
DMAMap map = { .iova = 0, .size = HWADDR_MAX };
+ /*
+ * Replay on stage-1 page table is meaningless as stage-1 page table
+ * is passthroughed to host to construct nested page table
+ */
+ if (s->flts && s->root_scalable) {
+ return;
+ }
+
/* replay is protected by BQL, page walk will re-setup it safely */
iova_tree_remove(vtd_as->iova_tree, map);
--
2.34.1
- Re: [PATCH rfcv2 10/20] intel_iommu: Optimize context entry cache utilization, (continued)
- [PATCH rfcv2 11/20] intel_iommu: Check for compatibility with IOMMUFD backed device when x-flts=on, Zhenzhong Duan, 2025/02/19
- [PATCH rfcv2 12/20] intel_iommu: Introduce a new structure VTDHostIOMMUDevice, Zhenzhong Duan, 2025/02/19
- [PATCH rfcv2 15/20] intel_iommu: ERRATA_772415 workaround, Zhenzhong Duan, 2025/02/19
- [PATCH rfcv2 19/20] intel_iommu: Bypass replay in stage-1 page table mode,
Zhenzhong Duan <=
- [PATCH rfcv2 13/20] intel_iommu: Add PASID cache management infrastructure, Zhenzhong Duan, 2025/02/19
- [PATCH rfcv2 16/20] intel_iommu: Replay pasid binds after context cache invalidation, Zhenzhong Duan, 2025/02/19
- [PATCH rfcv2 18/20] intel_iommu: Refresh pasid bind when either SRTP or TE bit is changed, Zhenzhong Duan, 2025/02/19
- [PATCH rfcv2 14/20] intel_iommu: Bind/unbind guest page table to host, Zhenzhong Duan, 2025/02/19
- [PATCH rfcv2 17/20] intel_iommu: Propagate PASID-based iotlb invalidation to host, Zhenzhong Duan, 2025/02/19
- [PATCH rfcv2 20/20] intel_iommu: Enable host device when x-flts=on in scalable mode, Zhenzhong Duan, 2025/02/19
- Re: [PATCH rfcv2 00/20] intel_iommu: Enable stage-1 translation for passthrough device, Eric Auger, 2025/02/20