]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: SEV: Don't terminate SNP VMs on #VMGEXIT without a registered GHCB
authorSean Christopherson <seanjc@google.com>
Fri, 29 May 2026 18:35:43 +0000 (20:35 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 3 Jun 2026 14:59:19 +0000 (16:59 +0200)
commit1797e00bf802d64b859ea18505087daad92019c8
treef37906880f532e91134335743f0d0e167e0412b0
parentdb38bcb3311053954f62b865cd2d86e164b04351
KVM: SEV: Don't terminate SNP VMs on #VMGEXIT without a registered GHCB

If the guest attempts a non-MSR #VMGEXIT without the registered GHCB,
return a GHCB_HV_RESP_MALFORMED_INPUT+GHCB_ERR_NOT_REGISTERED error to the
guest instead of exiting KVM_RUN with -EINVAL (and in likelihood killing
the VM).  KVM has already mapped the requested GHCB, i.e. can cleanly
report an error, and so exiting with -EINVAL is completely unjustified.

Fixes: 0c76b1d08280 ("KVM: SEV: Add support to handle GHCB GPA register VMGEXIT")
Cc: stable@vger.kernel.org
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20260501202250.2115252-19-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20260529183549.1104619-19-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c