diff options
author | Vadim Rozenfeld | 2014-01-23 14:40:47 +0100 |
---|---|---|
committer | Paolo Bonzini | 2014-02-03 17:33:55 +0100 |
commit | 1c90ef2619dd6e5c4fec7e9e18c04c0a08e93aac (patch) | |
tree | f79d7a86c624020e8fb6cf0624618e50948a9bed /target-i386/kvm.c | |
parent | kvm: make availability of Hyper-V enlightenments dependent on KVM_CAP_HYPERV (diff) | |
download | qemu-1c90ef2619dd6e5c4fec7e9e18c04c0a08e93aac.tar.gz qemu-1c90ef2619dd6e5c4fec7e9e18c04c0a08e93aac.tar.xz qemu-1c90ef2619dd6e5c4fec7e9e18c04c0a08e93aac.zip |
kvm: make hyperv hypercall and guest os id MSRs migratable.
Signed-off-by: Vadim Rozenfeld <vrozenfe@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target-i386/kvm.c')
-rw-r--r-- | target-i386/kvm.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c index e6831b27fe..fade2c99a7 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -1230,8 +1230,10 @@ static int kvm_put_msrs(X86CPU *cpu, int level) env->msr_global_ctrl); } if (has_msr_hv_hypercall) { - kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_GUEST_OS_ID, 0); - kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_HYPERCALL, 0); + kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_GUEST_OS_ID, + env->msr_hv_guest_os_id); + kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_HYPERCALL, + env->msr_hv_hypercall); } if (has_msr_hv_vapic) { kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_APIC_ASSIST_PAGE, 0); @@ -1520,6 +1522,10 @@ static int kvm_get_msrs(X86CPU *cpu) } } + if (has_msr_hv_hypercall) { + msrs[n++].index = HV_X64_MSR_HYPERCALL; + msrs[n++].index = HV_X64_MSR_GUEST_OS_ID; + } msr_data.info.nmsrs = n; ret = kvm_vcpu_ioctl(CPU(cpu), KVM_GET_MSRS, &msr_data); if (ret < 0) { @@ -1627,6 +1633,12 @@ static int kvm_get_msrs(X86CPU *cpu) case MSR_P6_EVNTSEL0 ... MSR_P6_EVNTSEL0 + MAX_GP_COUNTERS - 1: env->msr_gp_evtsel[index - MSR_P6_EVNTSEL0] = msrs[i].data; break; + case HV_X64_MSR_HYPERCALL: + env->msr_hv_hypercall = msrs[i].data; + break; + case HV_X64_MSR_GUEST_OS_ID: + env->msr_hv_guest_os_id = msrs[i].data; + break; } } |