]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
i386: do not migrate MSR_SMI_COUNT on machine types <2.12
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 24 Jul 2018 11:59:21 +0000 (13:59 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 30 Jul 2018 12:00:11 +0000 (14:00 +0200)
MSR_SMI_COUNT started being migrated in QEMU 2.12.  Do not migrate it
on older machine types, or the subsection causes a load failure for
guests that use SMM.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/hw/i386/pc.h
target/i386/cpu.c
target/i386/cpu.h
target/i386/machine.c

index 654003f44c665b0db557d5f585110f4a49c33a77..6894f37df1d29e7b947fc5a4c0dd391512d76a8b 100644 (file)
@@ -317,6 +317,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
 #define PC_COMPAT_2_11 \
     HW_COMPAT_2_11 \
     {\
+        .driver   = TYPE_X86_CPU,\
+        .property = "x-migrate-smi-count",\
+        .value    = "off",\
+    },{\
         .driver   = "Skylake-Server" "-" TYPE_X86_CPU,\
         .property = "clflushopt",\
         .value    = "off",\
index f454d4beb379eff07447dcc8b8ef86e810758b47..723e02221e5e8d9e23fed67481c6de87ba0d2f0e 100644 (file)
@@ -5435,6 +5435,8 @@ static Property x86_cpu_properties[] = {
                      false),
     DEFINE_PROP_BOOL("vmware-cpuid-freq", X86CPU, vmware_cpuid_freq, true),
     DEFINE_PROP_BOOL("tcg-cpuid", X86CPU, expose_tcg, true),
+    DEFINE_PROP_BOOL("x-migrate-smi-count", X86CPU, migrate_smi_count,
+                     true),
     /*
      * lecacy_cache defaults to true unless the CPU model provides its
      * own cache information (see x86_cpu_load_def()).
index 194e2e6b92ced7c3830974c2a6967ee2de307cbd..c18863ec7a9477b3945c5fe4fb81945841d7cc02 100644 (file)
@@ -1379,6 +1379,7 @@ struct X86CPU {
     bool expose_kvm;
     bool expose_tcg;
     bool migratable;
+    bool migrate_smi_count;
     bool max_features; /* Enable all supported features automatically */
     uint32_t apic_id;
 
index 8b64dff4875299544fad144a4002a3a648ae6fe5..084c2c73a8f7cec93d421a484aa7625439de8e47 100644 (file)
@@ -400,7 +400,7 @@ static bool msr_smi_count_needed(void *opaque)
     X86CPU *cpu = opaque;
     CPUX86State *env = &cpu->env;
 
-    return env->msr_smi_count != 0;
+    return cpu->migrate_smi_count && env->msr_smi_count != 0;
 }
 
 static const VMStateDescription vmstate_msr_smi_count = {