diff --git a/hw/i386/pc.c b/hw/i386/pc.c index addf602da0..4b53b5be4a 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -78,6 +78,7 @@ const size_t pc_compat_10_2_len = G_N_ELEMENTS(pc_compat_10_2); GlobalProperty pc_compat_10_1[] = { { "mch", "extended-tseg-mbytes", "16" }, + { TYPE_X86_CPU, "x-migrate-error-code", "false" }, }; const size_t pc_compat_10_1_len = G_N_ELEMENTS(pc_compat_10_1); diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 1debc0c61f..5b9ae79f16 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10651,6 +10651,7 @@ static const Property x86_cpu_properties[] = { DEFINE_PROP_BOOL("tcg-cpuid", X86CPU, expose_tcg, true), DEFINE_PROP_BOOL("x-migrate-smi-count", X86CPU, migrate_smi_count, true), + DEFINE_PROP_BOOL("x-migrate-error-code", X86CPU, migrate_error_code, true), /* * lecacy_cache defaults to true unless the CPU model provides its * own cache information (see x86_cpu_load_def()). diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 7bd38f0c03..0b539155c4 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2361,6 +2361,7 @@ struct ArchCPU { bool expose_tcg; bool migratable; bool migrate_smi_count; + bool migrate_error_code; uint32_t apic_id; /* Enables publishing of TSC increment and Local APIC bus frequencies to diff --git a/target/i386/machine.c b/target/i386/machine.c index c913961281..48a2a4b319 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -466,7 +466,7 @@ static bool cpu_errcode_needed(void *opaque) { X86CPU *cpu = opaque; - return cpu->env.has_error_code != 0; + return cpu->env.has_error_code != 0 && cpu->migrate_error_code; } static const VMStateDescription vmstate_error_code = {