mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
KVM: SVM: WARN if KVM attempts emulation on #UD or #GP for SEV guests
WARN if KVM attempts to emulate in response to #UD or #GP for SEV guests, i.e. if KVM intercepts #UD or #GP, as emulation on any fault except #NPF is impossible since KVM cannot read guest private memory to get the code stream, and the CPU's DecodeAssists feature only provides the instruction bytes on #NPF. Signed-off-by: Sean Christopherson <seanjc@google.com> Reviewed-by: Liam Merwick <liam.merwick@oracle.com> Message-Id: <20220120010719.711476-7-seanjc@google.com> [Warn on EMULTYPE_TRAP_UD_FORCED according to Liam Merwick's review. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
4d31d9eff2
commit
132627c64d
1 changed files with 5 additions and 0 deletions
|
@ -4268,6 +4268,11 @@ static bool svm_can_emulate_instruction(struct kvm_vcpu *vcpu, int emul_type,
|
||||||
if (!sev_guest(vcpu->kvm))
|
if (!sev_guest(vcpu->kvm))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
/* #UD and #GP should never be intercepted for SEV guests. */
|
||||||
|
WARN_ON_ONCE(emul_type & (EMULTYPE_TRAP_UD |
|
||||||
|
EMULTYPE_TRAP_UD_FORCED |
|
||||||
|
EMULTYPE_VMWARE_GP));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Emulation is impossible for SEV-ES guests as KVM doesn't have access
|
* Emulation is impossible for SEV-ES guests as KVM doesn't have access
|
||||||
* to guest register state.
|
* to guest register state.
|
||||||
|
|
Loading…
Reference in a new issue