]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/i386/sev: Use legacy SEV VM types for older machine types
authorMichael Roth <michael.roth@amd.com>
Tue, 9 Apr 2024 23:07:43 +0000 (18:07 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 23 Apr 2024 15:35:25 +0000 (17:35 +0200)
Newer 9.1 machine types will default to using the KVM_SEV_INIT2 API for
creating SEV/SEV-ES going forward. However, this API results in guest
measurement changes which are generally not expected for users of these
older guest types and can cause disruption if they switch to a newer
QEMU/kernel version. Avoid this by continuing to use the older
KVM_SEV_INIT/KVM_SEV_ES_INIT APIs for older machine types.

Signed-off-by: Michael Roth <michael.roth@amd.com>
Message-ID: <20240409230743.962513-4-michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/pc.c
target/i386/sev.c

index 41909f7bd7a75b69617b8eee7dd75368dc079d26..08c7de416fda76b72491aea4c5b9b70a16639e26 100644 (file)
@@ -80,6 +80,7 @@
 
 GlobalProperty pc_compat_9_0[] = {
     { TYPE_X86_CPU, "guest-phys-bits", "0" },
+    { "sev-guest", "legacy-vm-type", "true" },
 };
 const size_t pc_compat_9_0_len = G_N_ELEMENTS(pc_compat_9_0);
 
index f4ee317cb03aaaad0bceef75d0ec17e5e7fcef28..d30b68c11e47b26f6ac7ab4df7848e5cbe351682 100644 (file)
@@ -1417,6 +1417,7 @@ sev_guest_instance_init(Object *obj)
     object_property_add_uint32_ptr(obj, "reduced-phys-bits",
                                    &sev->reduced_phys_bits,
                                    OBJ_PROP_FLAG_READWRITE);
+    object_apply_compat_props(obj);
 }
 
 /* sev guest info */