提交 09df29b6 编写于 作者: R Roman Kagan 提交者: Paolo Bonzini

hyperv: make SynIC version msr constant

The value of HV_X64_MSR_SVERSION is initialized once at vcpu init, and
is reset to zero on vcpu reset, which is wrong.

It is supposed to be a constant, so drop the field from X86CPU, set the
msr with the constant value, and don't bother getting it.
Signed-off-by: NRoman Kagan <rkagan@virtuozzo.com>
Message-Id: <20171122181418.14180-4-rkagan@virtuozzo.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 689141dd
...@@ -1107,7 +1107,6 @@ typedef struct CPUX86State { ...@@ -1107,7 +1107,6 @@ typedef struct CPUX86State {
uint64_t msr_hv_crash_params[HV_CRASH_PARAMS]; uint64_t msr_hv_crash_params[HV_CRASH_PARAMS];
uint64_t msr_hv_runtime; uint64_t msr_hv_runtime;
uint64_t msr_hv_synic_control; uint64_t msr_hv_synic_control;
uint64_t msr_hv_synic_version;
uint64_t msr_hv_synic_evt_page; uint64_t msr_hv_synic_evt_page;
uint64_t msr_hv_synic_msg_page; uint64_t msr_hv_synic_msg_page;
uint64_t msr_hv_synic_sint[HV_SINT_COUNT]; uint64_t msr_hv_synic_sint[HV_SINT_COUNT];
......
...@@ -669,7 +669,6 @@ static int hyperv_handle_properties(CPUState *cs) ...@@ -669,7 +669,6 @@ static int hyperv_handle_properties(CPUState *cs)
} }
env->features[FEAT_HYPERV_EAX] |= HV_SYNIC_AVAILABLE; env->features[FEAT_HYPERV_EAX] |= HV_SYNIC_AVAILABLE;
env->msr_hv_synic_version = HV_SYNIC_VERSION;
} }
if (cpu->hyperv_stimer) { if (cpu->hyperv_stimer) {
if (!has_msr_hv_stimer) { if (!has_msr_hv_stimer) {
...@@ -1715,10 +1714,10 @@ static int kvm_put_msrs(X86CPU *cpu, int level) ...@@ -1715,10 +1714,10 @@ static int kvm_put_msrs(X86CPU *cpu, int level)
if (cpu->hyperv_synic) { if (cpu->hyperv_synic) {
int j; int j;
kvm_msr_entry_add(cpu, HV_X64_MSR_SVERSION, HV_SYNIC_VERSION);
kvm_msr_entry_add(cpu, HV_X64_MSR_SCONTROL, kvm_msr_entry_add(cpu, HV_X64_MSR_SCONTROL,
env->msr_hv_synic_control); env->msr_hv_synic_control);
kvm_msr_entry_add(cpu, HV_X64_MSR_SVERSION,
env->msr_hv_synic_version);
kvm_msr_entry_add(cpu, HV_X64_MSR_SIEFP, kvm_msr_entry_add(cpu, HV_X64_MSR_SIEFP,
env->msr_hv_synic_evt_page); env->msr_hv_synic_evt_page);
kvm_msr_entry_add(cpu, HV_X64_MSR_SIMP, kvm_msr_entry_add(cpu, HV_X64_MSR_SIMP,
...@@ -2082,7 +2081,6 @@ static int kvm_get_msrs(X86CPU *cpu) ...@@ -2082,7 +2081,6 @@ static int kvm_get_msrs(X86CPU *cpu)
uint32_t msr; uint32_t msr;
kvm_msr_entry_add(cpu, HV_X64_MSR_SCONTROL, 0); kvm_msr_entry_add(cpu, HV_X64_MSR_SCONTROL, 0);
kvm_msr_entry_add(cpu, HV_X64_MSR_SVERSION, 0);
kvm_msr_entry_add(cpu, HV_X64_MSR_SIEFP, 0); kvm_msr_entry_add(cpu, HV_X64_MSR_SIEFP, 0);
kvm_msr_entry_add(cpu, HV_X64_MSR_SIMP, 0); kvm_msr_entry_add(cpu, HV_X64_MSR_SIMP, 0);
for (msr = HV_X64_MSR_SINT0; msr <= HV_X64_MSR_SINT15; msr++) { for (msr = HV_X64_MSR_SINT0; msr <= HV_X64_MSR_SINT15; msr++) {
...@@ -2286,9 +2284,6 @@ static int kvm_get_msrs(X86CPU *cpu) ...@@ -2286,9 +2284,6 @@ static int kvm_get_msrs(X86CPU *cpu)
case HV_X64_MSR_SCONTROL: case HV_X64_MSR_SCONTROL:
env->msr_hv_synic_control = msrs[i].data; env->msr_hv_synic_control = msrs[i].data;
break; break;
case HV_X64_MSR_SVERSION:
env->msr_hv_synic_version = msrs[i].data;
break;
case HV_X64_MSR_SIEFP: case HV_X64_MSR_SIEFP:
env->msr_hv_synic_evt_page = msrs[i].data; env->msr_hv_synic_evt_page = msrs[i].data;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册