KVM: SVM: Add host SEV-ES save area structure into VMCB via a union
authorSean Christopherson <seanjc@google.com>
Fri, 2 Aug 2024 20:45:10 +0000 (13:45 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 30 Aug 2024 02:06:12 +0000 (19:06 -0700)
commit1b5ef14dc656a25280d56795b73cf90dad64ad44
treed65af443f870265f4afb5d27c602271f494c31aa
parent48547fe75ea7d5bf1ff9425a0a5d4d32b3a77777
KVM: SVM: Add host SEV-ES save area structure into VMCB via a union

Incorporate the _host_ SEV-ES save area into the VMCB as a union with the
legacy save area.  The SEV-ES variant used to save/load host state is
larger than the legacy save area, but resides at the same offset.  Prefix
the field with "host" to make it as obvious as possible that the SEV-ES
variant in the VMCB is only ever used for host state.  Guest state for
SEV-ES VMs is stored in a completely separate page (VMSA), albeit with
the same layout as the host state.

Add a compile-time assert to ensure the VMCB layout is correct, i.e. that
KVM's layout matches the architectural definitions.

No functional change intended.

Link: https://lore.kernel.org/r/20240802204511.352017-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/svm.h