Skip to content

KVM: x86/mmu: Zap only obsolete roots on "reload"

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest7 patches 13 repliesApplied

Changes in v2 from the cover letter

- Collect reviews. [Claudio, Janosch]
- Rebase to latest kvm/queue.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/7KVM: x86: Remove spurious whitespaces from kvm_post_set_cr4()arch/x86/kvm/x86.c+2 -20 replies
2/7KVM: x86: Invoke kvm_mmu_unload() directly on CR4.PCIDE changearch/x86/kvm/x86.c+1 -10 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 -131 reply
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+63 -98 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 -50 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 -02 replies

Reviews trailers per patch

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

PatchClaudio ImbrendaJanosch FrankBen Gardon
1/7
2/7
3/7R-b
4/7R-b
5/7R-b R-b
6/7R-b R-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 v2 thread

Cover letter [PATCH v2 0/7] KVM: x86/mmu: Zap only obsolete roots on "reload"

For all intents and purposes, this is an x86/mmu series, but it touches s390 and common KVM code because KVM_REQ_MMU_RELOAD is currently a generic request despite its use being encapsulated entirely within arch code.

The meat of the series is to zap only obsolete (a.k.a. invalid) roots in response to KVM marking a root obsolete/invalid due to it being zapped. KVM currently drops/zaps all roots, which, aside from being a performance hit if the guest is using multiple roots, complicates x86 KVM paths that load a new root because it raises the question of what should be done if there's a pending KVM_REQ_MMU_RELOAD, i.e. if the path _knows_ that any root it loads will be obliterated.

Paolo, I'm hoping you can squash patch 01 with your patch it "fixes".

I'm also speculating that this will be applied after my patch to remove KVM_REQ_GPC_INVALIDATE, otherwise the changelog in patch 06 will be wrong.

v2:
- Collect reviews. [Claudio, Janosch]
- Rebase to latest kvm/queue.

v1: https://lore.kernel.org/all/[email protected]

Sean Christopherson (7):
KVM: x86: Remove spurious whitespaces from kvm_post_set_cr4()
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                   | 83 ++++++++++++++++++++----
 arch/x86/kvm/x86.c                       | 10 +--
 include/linux/kvm_host.h                 |  4 +-
 virt/kvm/kvm_main.c                      |  5 --
 10 files changed, 90 insertions(+), 34 deletions(-)

base-commit: f4bc051fc91ab9f1d5225d94e52d369ef58bec58

Signature · 1 line
2.35.1.574.g5d30c73bfb-goog