Commit bc624d9f authored by Tom Lendacky's avatar Tom Lendacky Committed by Paolo Bonzini

KVM: SVM: Do not allow instruction emulation under SEV-ES

When a guest is running as an SEV-ES guest, it is not possible to emulate
instructions. Add support to prevent instruction emulation.
Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Message-Id: <f6355ea3024fda0a3eb5eb99c6b62dca10d792bd.1607620209.git.thomas.lendacky@amd.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 8d4846b9
...@@ -4157,6 +4157,12 @@ static bool svm_can_emulate_instruction(struct kvm_vcpu *vcpu, void *insn, int i ...@@ -4157,6 +4157,12 @@ static bool svm_can_emulate_instruction(struct kvm_vcpu *vcpu, void *insn, int i
bool smep, smap, is_user; bool smep, smap, is_user;
unsigned long cr4; unsigned long cr4;
/*
* When the guest is an SEV-ES guest, emulation is not possible.
*/
if (sev_es_guest(vcpu->kvm))
return false;
/* /*
* Detect and workaround Errata 1096 Fam_17h_00_0Fh. * Detect and workaround Errata 1096 Fam_17h_00_0Fh.
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment