KVM: SEV: Add support to handle GHCB GPA register VMGEXIT
authorBrijesh Singh <brijesh.singh@amd.com>
Wed, 1 May 2024 08:51:58 +0000 (03:51 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 12 May 2024 08:09:30 +0000 (04:09 -0400)
commit0c76b1d08280649f789e1b537b397cefc43da7a0
treec99759015811ecb3a6b18cd894a68411dbc55d16
parentad27ce155566f2b4400fa865859834592bd18777
KVM: SEV: Add support to handle GHCB GPA register VMGEXIT

SEV-SNP guests are required to perform a GHCB GPA registration. Before
using a GHCB GPA for a vCPU the first time, a guest must register the
vCPU GHCB GPA. If hypervisor can work with the guest requested GPA then
it must respond back with the same GPA otherwise return -1.

On VMEXIT, verify that the GHCB GPA matches with the registered value.
If a mismatch is detected, then abort the guest.

Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
Message-ID: <20240501085210.2213060-9-michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/sev-common.h
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.h