Browse Source

i386/cpu: Add APX migration support

Add a VMStateDescription to migrate APX EGPRs.

Tested-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Co-developed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20251211070942.3612547-8-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pull/316/head
Zide Chen 8 months ago
committed by Paolo Bonzini
parent
commit
e105745d20
  1. 25
      target/i386/machine.c

25
target/i386/machine.c

@ -1741,6 +1741,28 @@ static const VMStateDescription vmstate_cet = {
}, },
}; };
#ifdef TARGET_X86_64
static bool apx_needed(void *opaque)
{
X86CPU *cpu = opaque;
CPUX86State *env = &cpu->env;
return !!(env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_APXF);
}
static const VMStateDescription vmstate_apx = {
.name = "cpu/apx",
.version_id = 1,
.minimum_version_id = 1,
.needed = apx_needed,
.fields = (VMStateField[]) {
VMSTATE_UINTTL_SUB_ARRAY(env.regs, X86CPU, CPU_NB_REGS,
CPU_NB_EREGS - CPU_NB_REGS),
VMSTATE_END_OF_LIST()
}
};
#endif
const VMStateDescription vmstate_x86_cpu = { const VMStateDescription vmstate_x86_cpu = {
.name = "cpu", .name = "cpu",
.version_id = 12, .version_id = 12,
@ -1892,6 +1914,9 @@ const VMStateDescription vmstate_x86_cpu = {
&vmstate_triple_fault, &vmstate_triple_fault,
&vmstate_pl0_ssp, &vmstate_pl0_ssp,
&vmstate_cet, &vmstate_cet,
#ifdef TARGET_X86_64
&vmstate_apx,
#endif
NULL NULL
} }
}; };

Loading…
Cancel
Save