]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Resume guest immediately when injecting #GP on ECREATE
authorSean Christopherson <seanjc@google.com>
Fri, 30 Sep 2022 23:31:32 +0000 (23:31 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 10:11:47 +0000 (11:11 +0100)
commit57b6d285f03ed62366ac5d7df1d6f8ae771890e6
treece9f8df741051d1555b2120a61df0ed48c2f0472
parent1fc2abae35d95641b3ea40acf78b0edf78352513
KVM: VMX: Resume guest immediately when injecting #GP on ECREATE

commit 36d3e211d2303c0aae44305878b009bc73a44219 upstream.

Resume the guest immediately when injecting a #GP on ECREATE due to an
invalid enclave size, i.e. don't attempt ECREATE in the host.  The #GP is
a terminal fault, e.g. skipping the instruction if ECREATE is successful
would result in KVM injecting #GP on the instruction following ECREATE.

Fixes: f4aee565929a ("KVM: VMX: Add SGX ENCLS[ECREATE] handler to enforce CPUID restrictions")
Cc: stable@vger.kernel.org
Cc: Kai Huang <kai.huang@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/r/20220930233132.1723330-1-seanjc@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/vmx/sgx.c