KVM: arm64: Fix stage-2 THP mapping on hosts with 2-level page tables
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | KVM: arm64: Fix THP block mapping when the PMD level is foldedarch/ | +2 | 0 replies | |
| 2/2 | KVM: arm64: selftests: Test a THP whose first fault is on a tail pagetools/ | +53 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] KVM: arm64: Fix stage-2 THP mapping on hosts with 2-level page tables
Hi folks,
A fix for how KVM maps a THP at stage-2 on a host with 2-level page tables (64K pages with a 42-bit VA, or 16K pages with a 36-bit VA). There, KVM also maps the host memory that follows a THP into the guest if the guest's first access to the THP isn't to its first page.
transparent_hugepage_adjust() is meant to round the faulting pfn down to the start of the THP, but its mask is a no-op when the PMD level is folded, and has been since THP support was added. Before 6f745f1bb5bf2 ("KVM: arm64: Convert user_mem_abort() to generic page-table API"), KVM mapped only the THP anyway, which is why the Fixes: tag is on that commit. Kernels before f583a53c2b8a ("KVM: arm64: Make fault_ipa immutable") round the IPA with PMD_MASK, so only the pfn line of the fix applies there.
Tested on QEMU with a 64K, 42-bit VA host kernel, where the new selftest scenario fails without the fix and passes with it.
Based on Linux 7.4-rc3 (aebb727447640).
Cheers,
/fuad
Fuad Tabba (2):
KVM: arm64: Fix THP block mapping when the PMD level is folded
KVM: arm64: selftests: Test a THP whose first fault is on a tail page
arch/arm64/kvm/mmu.c | 4 +- .../kvm/arm64/stage2_block_transitions.c | 56 ++++++++++++++++++- 2 files changed, 55 insertions(+), 5 deletions(-)
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
Signature · 1 line
2.47.3