qemu-cr16/qapi
Michael Roth 9d38d9dca2 i386/sev: Don't allow automatic fallback to legacy KVM_SEV*_INIT
Currently if the 'legacy-vm-type' property of the sev-guest object is
'on', QEMU will attempt to use the newer KVM_SEV_INIT2 kernel
interface in conjunction with the newer KVM_X86_SEV_VM and
KVM_X86_SEV_ES_VM KVM VM types.

This can lead to measurement changes if, for instance, an SEV guest was
created on a host that originally had an older kernel that didn't
support KVM_SEV_INIT2, but is booted on the same host later on after the
host kernel was upgraded.

Instead, if legacy-vm-type is 'off', QEMU should fail if the
KVM_SEV_INIT2 interface is not provided by the current host kernel.
Modify the fallback handling accordingly.

In the future, VMSA features and other flags might be added to QEMU
which will require legacy-vm-type to be 'off' because they will rely
on the newer KVM_SEV_INIT2 interface. It may be difficult to convey to
users what values of legacy-vm-type are compatible with which
features/options, so as part of this rework, switch legacy-vm-type to a
tri-state OnOffAuto option. 'auto' in this case will automatically
switch to using the newer KVM_SEV_INIT2, but only if it is required to
make use of new VMSA features or other options only available via
KVM_SEV_INIT2.

Defining 'auto' in this way would avoid inadvertantly breaking
compatibility with older kernels since it would only be used in cases
where users opt into newer features that are only available via
KVM_SEV_INIT2 and newer kernels, and provide better default behavior
than the legacy-vm-type=off behavior that was previously in place, so
make it the default for 9.1+ machine types.

Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
cc: kvm@vger.kernel.org
Signed-off-by: Michael Roth <michael.roth@amd.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Link: https://lore.kernel.org/r/20240710041005.83720-1-michael.roth@amd.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-07-16 10:45:06 +02:00
..
acpi.json
audio.json
authz.json
block-core.json sphinx/qapidoc: Fix to generate doc for explicit, unboxed arguments 2024-07-06 08:58:24 +02:00
block-export.json
block.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
char.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
common.json
compat.json
control.json qapi: add markup to note blocks 2024-07-06 08:58:24 +02:00
crypto.json
cryptodev.json
cxl.json hw/cxl/events: Mark cxl-add-dynamic-capacity and cxl-release-dynamic-capcity unstable 2024-07-03 18:14:07 -04:00
dump.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
ebpf.json
error.json
introspect.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
job.json
machine-common.json
machine-target.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
machine.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
meson.build
migration.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
misc-target.json i386/sev: Update query-sev QAPI format to handle SEV-SNP 2024-06-05 11:01:06 +02:00
misc.json qapi: add markup to note blocks 2024-07-06 08:58:24 +02:00
net.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
opts-visitor.c
pci.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
pragma.json
qapi-clone-visitor.c qapi: Do not cast function pointers 2024-05-29 12:41:56 +02:00
qapi-dealloc-visitor.c
qapi-forward-visitor.c
qapi-schema.json
qapi-type-helpers.c
qapi-util.c
qapi-visit-core.c
qdev.json qapi: add markup to note blocks 2024-07-06 08:58:24 +02:00
qmp-dispatch.c Revert "monitor: use aio_co_reschedule_self()" 2024-06-10 11:05:43 +02:00
qmp-event.c
qmp-registry.c
qobject-input-visitor.c
qobject-output-visitor.c
qom.json i386/sev: Don't allow automatic fallback to legacy KVM_SEV*_INIT 2024-07-16 10:45:06 +02:00
replay.json
rocker.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
run-state.json qapi: add markup to note blocks 2024-07-06 08:58:24 +02:00
sockets.json qapi: add markup to note blocks 2024-07-06 08:58:24 +02:00
stats.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
string-input-visitor.c
string-output-visitor.c
tpm.json
trace-events
trace.h
trace.json trace: Remove deprecated 'vcpu' field from QMP trace events 2024-06-04 11:53:43 +02:00
transaction.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
ui.json qapi: add markup to note blocks 2024-07-06 08:58:24 +02:00
vfio.json
virtio.json qapi: convert "Note" sections to plain rST 2024-07-06 08:58:24 +02:00
yank.json