]> Git Repo - linux.git/commitdiff
KVM: SVM: Do not allow instruction emulation under SEV-ES
authorTom Lendacky <[email protected]>
Thu, 10 Dec 2020 17:09:44 +0000 (11:09 -0600)
committerPaolo Bonzini <[email protected]>
Tue, 15 Dec 2020 10:20:46 +0000 (05:20 -0500)
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[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
arch/x86/kvm/svm/svm.c

index bec427acab208bce68402eb10669c926e9668cff..cade703d6edbe6158ed7293f31d839031aa896d9 100644 (file)
@@ -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.
         *
This page took 0.06201 seconds and 4 git commands to generate.