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:54:21 +0000 (12:54 +0100)
commitbd39fe29bbbba8ad84605f6ded5c570b24f6cf8b
tree94333aa3b4b8f47efcaea5b529d5fe31fee84394
parent9efad4cb03658b62514d8f8992525b2912272b7b
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