Skip to content

KVM: x86/mmu: Obsolete root shadow page fix

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Queued this one for 5.16, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 10 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/7KVM: x86: Retry page fault if MMU reload is pending and root has no sparch/x86/kvm/mmu/mmu.c+15 -17 replies
2/7KVM: x86: Invoke kvm_mmu_unload() directly on CR4.PCIDE changearch/x86/kvm/x86.c+5 -60 replies
3/7KVM: Drop kvm_reload_remote_mmus(), open code request in x86 usersarch/x86/kvm/mmu/mmu.c include/linux/kvm_host.h virt/kvm/kvm_main.c+7 -130 replies
4/7KVM: x86/mmu: Zap only obsolete roots if a root shadow page is zappedarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.h arch/x86/kvm/mmu/mmu.c +1 more+64 -90 replies
5/7KVM: s390: Replace KVM_REQ_MMU_RELOAD usage with arch specific requestarch/s390/include/asm/kvm_host.h arch/s390/kvm/kvm-s390.c arch/s390/kvm/kvm-s390.h+7 -52 replies
6/7KVM: Drop KVM_REQ_MMU_RELOAD and update vcpu-requests.rst documentationDocumentation/virt/kvm/vcpu-requests.rst include/linux/kvm_host.h+4 -61 reply
7/7KVM: WARN if is_unsync_root() is called on a root without a shadow pagearch/x86/kvm/mmu/mmu.c+8 -00 replies

Reviews trailers per patch

2 of 7 patches have a Reviewed-by or Acked-by.

PatchClaudio ImbrendaJanosch FrankSean Christopherson
1/7Analyzed-by
2/7
3/7
4/7
5/7R-b R-b
6/7R-b
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/7] KVM: x86/mmu: Obsolete root shadow page fix

Patch 01 fixes a complete braino and lack of testing :-(

The rest of the series is an enhancement to address a performance issue I encountered when implementing the aforementioned fix. I wanted to WARN if KVM_REQ_MMU_LOAD was pending with a valid root shadow page, but it fired like crazy because the roots in prev_roots have an elevated root_count and thus can trigger KVM_REQ_MMU_LOAD when the guest zaps a cached root's corresponding PGD (in the guest).

Patches 2+ haven't been super well tested, I'll beat on 'em more and holler if anything pops up.

Sean Christopherson (7):
KVM: x86: Retry page fault if MMU reload is pending and root has no sp
KVM: x86: Invoke kvm_mmu_unload() directly on CR4.PCIDE change
KVM: Drop kvm_reload_remote_mmus(), open code request in x86 users
KVM: x86/mmu: Zap only obsolete roots if a root shadow page is zapped
KVM: s390: Replace KVM_REQ_MMU_RELOAD usage with arch specific request
KVM: Drop KVM_REQ_MMU_RELOAD and update vcpu-requests.rst
documentation
KVM: WARN if is_unsync_root() is called on a root without a shadow
page

 Documentation/virt/kvm/vcpu-requests.rst |  7 +-
 arch/s390/include/asm/kvm_host.h         |  2 +
 arch/s390/kvm/kvm-s390.c                 |  8 +-
 arch/s390/kvm/kvm-s390.h                 |  2 +-
 arch/x86/include/asm/kvm_host.h          |  2 +
 arch/x86/kvm/mmu.h                       |  1 +
 arch/x86/kvm/mmu/mmu.c                   | 98 +++++++++++++++++++++---
 arch/x86/kvm/x86.c                       | 15 ++--
 include/linux/kvm_host.h                 |  4 +-
 virt/kvm/kvm_main.c                      |  5 --
 10 files changed, 107 insertions(+), 37 deletions(-)
Signature · 1 line
2.34.1.400.ga245620fadb-goog