i386/sev: Add 'legacy-vm-type' parameter for SEV guest objects
authorMichael Roth <michael.roth@amd.com>
Tue, 9 Apr 2024 23:07:41 +0000 (18:07 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 23 Apr 2024 15:35:25 +0000 (17:35 +0200)
commit023267334da375226720e62963df9545aa8fc2fd
tree4df5704ddbb9198ad87b7dbe9c98783b9a83d649
parent663e2f443e5722370708ce2f4c27d94a2087d2d3
i386/sev: Add 'legacy-vm-type' parameter for SEV guest objects

QEMU will currently automatically make use of the KVM_SEV_INIT2 API for
initializing SEV and SEV-ES guests verses the older
KVM_SEV_INIT/KVM_SEV_ES_INIT interfaces.

However, the older interfaces will silently avoid sync'ing FPU/XSAVE
state to the VMSA prior to encryption, thus relying on behavior and
measurements that assume the related fields to be allow zero.

With KVM_SEV_INIT2, this state is now synced into the VMSA, resulting in
measurements changes and, theoretically, behaviorial changes, though the
latter are unlikely to be seen in practice.

To allow a smooth transition to the newer interface, while still
providing a mechanism to maintain backward compatibility with VMs
created using the older interfaces, provide a new command-line
parameter:

  -object sev-guest,legacy-vm-type=true,...

and have it default to false.

Signed-off-by: Michael Roth <michael.roth@amd.com>
Message-ID: <20240409230743.962513-2-michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qapi/qom.json
target/i386/sev.c