mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
KVM: SVM: add migration support for nested TSC scaling
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20211101132300.192584-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6aedeb650e
commit
cabf9862e4
4 changed files with 46 additions and 0 deletions
|
@ -1280,6 +1280,27 @@ static const VMStateDescription vmstate_spec_ctrl = {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
static bool amd_tsc_scale_msr_needed(void *opaque)
|
||||
{
|
||||
X86CPU *cpu = opaque;
|
||||
CPUX86State *env = &cpu->env;
|
||||
|
||||
return (env->features[FEAT_SVM] & CPUID_SVM_TSCSCALE);
|
||||
}
|
||||
|
||||
static const VMStateDescription amd_tsc_scale_msr_ctrl = {
|
||||
.name = "cpu/amd_tsc_scale_msr",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.needed = amd_tsc_scale_msr_needed,
|
||||
.fields = (VMStateField[]){
|
||||
VMSTATE_UINT64(env.amd_tsc_scale_msr, X86CPU),
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static bool intel_pt_enable_needed(void *opaque)
|
||||
{
|
||||
X86CPU *cpu = opaque;
|
||||
|
@ -1558,6 +1579,7 @@ const VMStateDescription vmstate_x86_cpu = {
|
|||
&vmstate_pkru,
|
||||
&vmstate_pkrs,
|
||||
&vmstate_spec_ctrl,
|
||||
&amd_tsc_scale_msr_ctrl,
|
||||
&vmstate_mcg_ext_ctl,
|
||||
&vmstate_msr_intel_pt,
|
||||
&vmstate_msr_virt_ssbd,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue