acrn-kernel/arch/x86/kvm/svm
Sean Christopherson 0c29397ac1 KVM: SVM: Disable SEV-ES support if MMIO caching is disable
Disable SEV-ES if MMIO caching is disabled as SEV-ES relies on MMIO SPTEs
generating #NPF(RSVD), which are reflected by the CPU into the guest as
a #VC.  With SEV-ES, the untrusted host, a.k.a. KVM, doesn't have access
to the guest instruction stream or register state and so can't directly
emulate in response to a #NPF on an emulated MMIO GPA.  Disabling MMIO
caching means guest accesses to emulated MMIO ranges cause #NPF(!PRESENT),
and those flavors of #NPF cause automatic VM-Exits, not #VC.

Adjust KVM's MMIO masks to account for the C-bit location prior to doing
SEV(-ES) setup, and document that dependency between adjusting the MMIO
SPTE mask and SEV(-ES) setup.

Fixes: b09763da4d ("KVM: x86/mmu: Add module param to disable MMIO caching (for testing)")
Reported-by: Michael Roth <michael.roth@amd.com>
Tested-by: Michael Roth <michael.roth@amd.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220803224957.1285926-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-08-10 15:08:25 -04:00
..
avic.c KVM: x86: nSVM: optimize svm_set_x2apic_msr_interception 2022-06-24 12:52:59 -04:00
hyperv.h
nested.c KVM: x86: Split kvm_is_valid_cr4() and export only the non-vendor bits 2022-07-28 13:22:25 -04:00
pmu.c Revert "KVM: x86: always allow host-initiated writes to PMU MSRs" 2022-06-20 11:49:46 -04:00
sev.c KVM: SVM: Disable SEV-ES support if MMIO caching is disable 2022-08-10 15:08:25 -04:00
svm.c KVM: SVM: Disable SEV-ES support if MMIO caching is disable 2022-08-10 15:08:25 -04:00
svm.h Merge remote-tracking branch 'kvm/next' into kvm-next-5.20 2022-08-01 03:21:00 -04:00
svm_onhyperv.c
svm_onhyperv.h
svm_ops.h
vmenter.S x86: Add magic AMD return-thunk 2022-06-27 10:33:59 +02:00