mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13: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
|
@ -105,6 +105,7 @@ static bool has_msr_hv_reenlightenment;
|
|||
static bool has_msr_xss;
|
||||
static bool has_msr_umwait;
|
||||
static bool has_msr_spec_ctrl;
|
||||
static bool has_tsc_scale_msr;
|
||||
static bool has_msr_tsx_ctrl;
|
||||
static bool has_msr_virt_ssbd;
|
||||
static bool has_msr_smi_count;
|
||||
|
@ -2216,6 +2217,9 @@ static int kvm_get_supported_msrs(KVMState *s)
|
|||
case MSR_IA32_SPEC_CTRL:
|
||||
has_msr_spec_ctrl = true;
|
||||
break;
|
||||
case MSR_AMD64_TSC_RATIO:
|
||||
has_tsc_scale_msr = true;
|
||||
break;
|
||||
case MSR_IA32_TSX_CTRL:
|
||||
has_msr_tsx_ctrl = true;
|
||||
break;
|
||||
|
@ -2972,6 +2976,10 @@ static int kvm_put_msrs(X86CPU *cpu, int level)
|
|||
if (has_msr_spec_ctrl) {
|
||||
kvm_msr_entry_add(cpu, MSR_IA32_SPEC_CTRL, env->spec_ctrl);
|
||||
}
|
||||
if (has_tsc_scale_msr) {
|
||||
kvm_msr_entry_add(cpu, MSR_AMD64_TSC_RATIO, env->amd_tsc_scale_msr);
|
||||
}
|
||||
|
||||
if (has_msr_tsx_ctrl) {
|
||||
kvm_msr_entry_add(cpu, MSR_IA32_TSX_CTRL, env->tsx_ctrl);
|
||||
}
|
||||
|
@ -3377,6 +3385,10 @@ static int kvm_get_msrs(X86CPU *cpu)
|
|||
if (has_msr_spec_ctrl) {
|
||||
kvm_msr_entry_add(cpu, MSR_IA32_SPEC_CTRL, 0);
|
||||
}
|
||||
if (has_tsc_scale_msr) {
|
||||
kvm_msr_entry_add(cpu, MSR_AMD64_TSC_RATIO, 0);
|
||||
}
|
||||
|
||||
if (has_msr_tsx_ctrl) {
|
||||
kvm_msr_entry_add(cpu, MSR_IA32_TSX_CTRL, 0);
|
||||
}
|
||||
|
@ -3788,6 +3800,9 @@ static int kvm_get_msrs(X86CPU *cpu)
|
|||
case MSR_IA32_SPEC_CTRL:
|
||||
env->spec_ctrl = msrs[i].data;
|
||||
break;
|
||||
case MSR_AMD64_TSC_RATIO:
|
||||
env->amd_tsc_scale_msr = msrs[i].data;
|
||||
break;
|
||||
case MSR_IA32_TSX_CTRL:
|
||||
env->tsx_ctrl = msrs[i].data;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue