KVM: x86/mmu: Drop dedicated self-changing mapping code
Status from this message: Queued, thanks.
Get series with b4
b4 am [email protected]Versions newest first
Changes in v2 from the cover letter
- Track the "write #PF to shadow page" using an EMULTYPE flag.
- Split the main patch in two.
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | KVM: x86/mmu: Use EMULTYPE flag to track write #PFs to shadow pagesarch/ arch/ arch/ +2 more | +37 | 0 replies | |
| 2/3 | KVM: x86/mmu: Detect write #PF to shadow pages during FNAME(fetch) walkarch/ | +5 | 0 replies | |
| 3/3 | KVM: x86/mmu: Remove FNAME(is_self_change_mapping)arch/ | +7 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/3] KVM: x86/mmu: Drop dedicated self-changing mapping code
Excise the MMU's one-off self-changing mapping logic and instead detect self-changing mappings in the primary "walk" flow, and rely on kvm_mmu_hugepage_adjust() to naturally handle "disallowed hugepage due to shadow page" conditions.
When is_self_change_mapping() was first added, KVM did hugepage adjustments before the primary walk, and so didn't account for shadow pages that were allocated for the current page fault, i.e. effectively consumed a stale disallow_lpage. Now that KVM adjust after allocating new shadow pages, the one-off code is superfluous.
Dropping the one-off code fixes an issue where KVM will force 4KiB pages for a 1GiB guest page even when using a 2MiB would be safe (1GiB overlaps a shadow page but 2MiB does not).
v2:
- Track the "write #PF to shadow page" using an EMULTYPE flag.
- Split the main patch in two.
v1: https://lore.kernel.org/all/[email protected]
Lai Jiangshan (2):
KVM: x86/mmu: Detect write #PF to shadow pages during FNAME(fetch)
walk
KVM: x86/mmu: Remove FNAME(is_self_change_mapping)
Sean Christopherson (1):
KVM: x86/mmu: Use EMULTYPE flag to track write #PFs to shadow pages
arch/x86/include/asm/kvm_host.h | 37 +++++++++++--------- arch/x86/kvm/mmu/mmu.c | 5 +-- arch/x86/kvm/mmu/mmu_internal.h | 12 ++++++- arch/x86/kvm/mmu/paging_tmpl.h | 61 ++++++--------------------------- arch/x86/kvm/x86.c | 15 ++------ 5 files changed, 46 insertions(+), 84 deletions(-)
base-commit: 11b36fe7d4500c8ef73677c087f302fd713101c2
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog