KVM: SVM: Don't kill SEV guest if SMAP erratum triggers in usermode
authorSean Christopherson <seanjc@google.com>
Thu, 20 Jan 2022 01:07:19 +0000 (01:07 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Feb 2022 11:56:17 +0000 (12:56 +0100)
commitf7da3276e087461effafb6d701a1583dfae9a83e
treef4f8f284b1088abd028d795b8084fad30052e884
parent11f9427d01a3b0f2e03c28f1413374eab7dd5a7b
KVM: SVM: Don't kill SEV guest if SMAP erratum triggers in usermode

[ Upstream commit cdf85e0c5dc766fc7fc779466280e454a6d04f87 ]

Inject a #GP instead of synthesizing triple fault to try to avoid killing
the guest if emulation of an SEV guest fails due to encountering the SMAP
erratum.  The injected #GP may still be fatal to the guest, e.g. if the
userspace process is providing critical functionality, but KVM should
make every attempt to keep the guest alive.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Message-Id: <20220120010719.711476-10-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/svm/svm.c