amd_iommu: Fix page size reporting on hugepage mappings
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | amd_iommu: Follow root pointer before page walk and use 1-based levelshw/ hw/ | +97 | 4 replies | |
| 2/2 | amd_iommu: Reject non-decreasing NextLevel in fetch_pte()hw/ | +4 | 0 replies |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | David Hoppenbrouwers | Sairaj Kodilkar |
|---|---|---|
| 1/2 | R-b | R-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] amd_iommu: Fix page size reporting on hugepage mappings
An issue in the page walking code where hugepage mappings were reported as 4K pages in certain configurations was reported by David Hoppenbrouwers in:
https://lore.kernel.org/qemu-devel/[email protected]/
While the change proposed in that thread fixes that specific bug, there are opportunities to simplify the algorithm by using a 1-based level accounting (matching DTE[Mode] and PTE NextLevel semantics).
The second change enforces a rule from the AMD-Vi specification which requires that NextLevel must be strictly lower than the current level to guarantee that the page walk eventually completes.
These changes make the page walk logic easier to follow, keep page size tracking aligned with the current page table level, and prevent invalid guest tables from causing page walk loops.
For stable: Please pick both patches together, PATCH 2 can be squashed into PATCH 1 for ease of backporting.
Thank you David and Sairaj for the detailed reporting/analysis of the original issue and the proposed fixes.
Alejandro
Alejandro Jimenez (2):
amd_iommu: Follow root pointer before page walk and use 1-based levels
amd_iommu: Reject non-decreasing NextLevel in fetch_pte()
hw/i386/amd_iommu.c | 136 +++++++++++++++++++++++++++++++------------- hw/i386/amd_iommu.h | 11 ++-- 2 files changed, 101 insertions(+), 46 deletions(-)
base-commit: 1fd5ff9d76d23ab23a68419cbc76d5ee33e8b455
Signature · 1 line
2.47.3