Skip to content

KVM: x86/mmu: Page fault and MMIO cleanups

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Applied to kvm-coco-queue, thanks, and these to kvm/queue as well:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest16 patches 66 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/16KVM: x86/mmu: Exit to userspace with -EFAULT if private fault hits emulationarch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/mmu_internal.h+13 -86 replies
2/16KVM: x86: Remove separate "bit" defines for page fault error code masksarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.h+12 -245 replies
3/16KVM: x86: Define more SEV+ page fault error bits/flags for #NPFarch/x86/include/asm/kvm_host.h+4 -02 replies
4/16KVM: x86/mmu: Pass full 64-bit error code when handling page faultsarch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/mmu_internal.h arch/x86/kvm/mmu/mmutrace.h+4 -54 replies
5/16KVM: x86/mmu: Use synthetic page fault error code to indicate private faultsarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/mmu_internal.h+31 -87 replies
6/16KVM: x86/mmu: WARN if upper 32 bits of legacy #PF error code are non-zeroarch/x86/kvm/mmu/mmu.c+7 -03 replies
7/16KVM: x86: Move synthetic PFERR_* sanity checks to SVM's #NPF handlerarch/x86/kvm/mmu/mmu.c arch/x86/kvm/svm/svm.c+12 -94 replies
8/16KVM: x86/mmu: WARN and skip MMIO cache on private, reserved page faultsarch/x86/kvm/mmu/mmu.c+2 -16 replies
9/16KVM: x86/mmu: Move private vs. shared check above slot validity checksarch/x86/kvm/mmu/mmu.c+10 -511 replies
10/16KVM: x86/mmu: Don't force emulation of L2 accesses to non-APIC internal slotsarch/x86/kvm/mmu/mmu.c+13 -41 reply
11/16KVM: x86/mmu: Explicitly disallow private accesses to emulated MMIOarch/x86/kvm/mmu/mmu.c+5 -07 replies
12/16KVM: x86/mmu: Move slot checks from __kvm_faultin_pfn() to kvm_faultin_pfn()arch/x86/kvm/mmu/mmu.c+53 -521 reply
13/16KVM: x86/mmu: Handle no-slot faults at the beginning of kvm_faultin_pfn()arch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/mmu_internal.h+18 -132 replies
14/16KVM: x86/mmu: Set kvm_page_fault.hva to KVM_HVA_ERR_BAD for "no slot" faultsarch/x86/kvm/mmu/mmu.c+1 -02 replies
15/16KVM: x86/mmu: Initialize kvm_page_fault's pfn and hva to error valuesarch/x86/kvm/mmu/mmu_internal.h+3 -01 reply
16/16KVM: x86/mmu: Sanity check that __kvm_faultin_pfn() doesn't create noslot pfnsarch/x86/kvm/mmu/mmu.c+1 -11 reply

Reviews trailers per patch

12 of 16 patches have a Reviewed-by or Acked-by.

PatchPaolo BonziniKai HuangXiaoyao LiBinbin Wu
1/16
2/16R-b
3/16
4/16R-b
5/16R-b
6/16R-b
7/16R-b R-b R-b
8/16
9/16R-b R-b
10/16R-b
11/16
12/16R-b
13/16R-b
14/16R-b
15/16R-b
16/16R-b

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

Read the v1 thread

Cover letter [PATCH 00/16] KVM: x86/mmu: Page fault and MMIO cleanups

This is a combination of prep work for TDX and SNP, and a clean up of the page fault path to (hopefully) make it easier to follow the rules for private memory, noslot faults, writes to read-only slots, etc.

Paolo, this is the series I mentioned in your TDX/SNP prep work series. Stating the obvious, these

KVM: x86/mmu: Pass full 64-bit error code when handling page faults
KVM: x86: Move synthetic PFERR_* sanity checks to SVM's #NPF handler

are the drop-in replacements.

Isaku Yamahata (1):
KVM: x86/mmu: Pass full 64-bit error code when handling page faults

Sean Christopherson (15):
KVM: x86/mmu: Exit to userspace with -EFAULT if private fault hits
emulation
KVM: x86: Remove separate "bit" defines for page fault error code
masks
KVM: x86: Define more SEV+ page fault error bits/flags for #NPF
KVM: x86/mmu: Use synthetic page fault error code to indicate private
faults
KVM: x86/mmu: WARN if upper 32 bits of legacy #PF error code are
non-zero
KVM: x86: Move synthetic PFERR_* sanity checks to SVM's #NPF handler
KVM: x86/mmu: WARN and skip MMIO cache on private, reserved page
faults
KVM: x86/mmu: Move private vs. shared check above slot validity checks
KVM: x86/mmu: Don't force emulation of L2 accesses to non-APIC
internal slots
KVM: x86/mmu: Explicitly disallow private accesses to emulated MMIO
KVM: x86/mmu: Move slot checks from __kvm_faultin_pfn() to
kvm_faultin_pfn()
KVM: x86/mmu: Handle no-slot faults at the beginning of
kvm_faultin_pfn()
KVM: x86/mmu: Set kvm_page_fault.hva to KVM_HVA_ERR_BAD for "no slot"
faults
KVM: x86/mmu: Initialize kvm_page_fault's pfn and hva to error values
KVM: x86/mmu: Sanity check that __kvm_faultin_pfn() doesn't create
noslot pfns

 arch/x86/include/asm/kvm_host.h |  45 ++++-----
 arch/x86/kvm/mmu.h              |   4 +-
 arch/x86/kvm/mmu/mmu.c          | 159 +++++++++++++++++++-------------
 arch/x86/kvm/mmu/mmu_internal.h |  24 ++++-
 arch/x86/kvm/mmu/mmutrace.h     |   2 +-
 arch/x86/kvm/svm/svm.c          |   9 ++
 6 files changed, 151 insertions(+), 92 deletions(-)

base-commit: ec1e3d33557babed2c2c2c7da6e84293c2f56f58

Signature · 1 line
2.44.0.278.ge034bb2e1d-goog