Skip to content

Commit

Permalink
KVM: SVM: Do not allow instruction emulation under SEV-ES
Browse files Browse the repository at this point in the history
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: Tom Lendacky <[email protected]>
Message-Id: <f6355ea3024fda0a3eb5eb99c6b62dca10d792bd.1607620209.git.thomas.lendacky@amd.com>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
tlendacky authored and bonzini committed Dec 15, 2020
1 parent 8d4846b commit bc624d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/x86/kvm/svm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -4157,6 +4157,12 @@ static bool svm_can_emulate_instruction(struct kvm_vcpu *vcpu, void *insn, int i
bool smep, smap, is_user;
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.
*
Expand Down

0 comments on commit bc624d9

Please sign in to comment.