summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-12-14 17:30:35 +0200
committerAvi Kivity <avi@redhat.com>2009-12-14 17:30:35 +0200
commit0f52a3682bd2cb4bb67ed9848448d16a0cf8ee5f (patch)
tree80a8485b4d836160939f5cf574ca38166e42310b /target-i386
parentMerge commit '1c1d7bda2cd507aec72057a1c16094541add9dd6' into stable-0.12-merge (diff)
parentv2: properly save kvm system time msr registers (diff)
downloadqemu-kvm-0f52a3682bd2cb4bb67ed9848448d16a0cf8ee5f.tar.gz
qemu-kvm-0f52a3682bd2cb4bb67ed9848448d16a0cf8ee5f.tar.bz2
qemu-kvm-0f52a3682bd2cb4bb67ed9848448d16a0cf8ee5f.zip
Merge commit '0014803d23acaccc15b31180f06784f5d6edfd3a' into stable-0.12-merge
* commit '0014803d23acaccc15b31180f06784f5d6edfd3a': v2: properly save kvm system time msr registers VNC: Convert do_info_vnc() to QObject Conflicts: target-i386/kvm.c target-i386/machine.c Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/kvm.c15
-rw-r--r--target-i386/machine.c4
2 files changed, 17 insertions, 2 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 6926cc959..bb9012a3e 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -36,6 +36,9 @@
do { } while (0)
#endif
+#define MSR_KVM_WALL_CLOCK 0x11
+#define MSR_KVM_SYSTEM_TIME 0x12
+
#ifdef KVM_CAP_EXT_CPUID
static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max)
@@ -496,6 +499,9 @@ static int kvm_put_msrs(CPUState *env)
kvm_msr_entry_set(&msrs[n++], MSR_FMASK, env->fmask);
kvm_msr_entry_set(&msrs[n++], MSR_LSTAR, env->lstar);
#endif
+ kvm_msr_entry_set(&msrs[n++], MSR_KVM_SYSTEM_TIME, env->system_time_msr);
+ kvm_msr_entry_set(&msrs[n++], MSR_KVM_WALL_CLOCK, env->wall_clock_msr);
+
msr_data.info.nmsrs = n;
return kvm_vcpu_ioctl(env, KVM_SET_MSRS, &msr_data);
@@ -637,6 +643,9 @@ static int kvm_get_msrs(CPUState *env)
msrs[n++].index = MSR_FMASK;
msrs[n++].index = MSR_LSTAR;
#endif
+ msrs[n++].index = MSR_KVM_SYSTEM_TIME;
+ msrs[n++].index = MSR_KVM_WALL_CLOCK;
+
msr_data.info.nmsrs = n;
ret = kvm_vcpu_ioctl(env, KVM_GET_MSRS, &msr_data);
if (ret < 0)
@@ -673,6 +682,12 @@ static int kvm_get_msrs(CPUState *env)
case MSR_IA32_TSC:
env->tsc = msrs[i].data;
break;
+ case MSR_KVM_SYSTEM_TIME:
+ env->system_time_msr = msrs[i].data;
+ break;
+ case MSR_KVM_WALL_CLOCK:
+ env->wall_clock_msr = msrs[i].data;
+ break;
case MSR_VM_HSAVE_PA:
env->vm_hsave = msrs[i].data;
break;
diff --git a/target-i386/machine.c b/target-i386/machine.c
index 6b10c8702..804002e66 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -474,8 +474,8 @@ static const VMStateDescription vmstate_cpu = {
/* rdtscp */
VMSTATE_UINT64_V(tsc_aux, CPUState, 11),
/* KVM pvclock msr */
- VMSTATE_UINT64_V(system_time_msr, CPUState, 12),
- VMSTATE_UINT64_V(wall_clock_msr, CPUState, 12),
+ VMSTATE_UINT64_V(system_time_msr, CPUState, 11),
+ VMSTATE_UINT64_V(wall_clock_msr, CPUState, 11),
VMSTATE_END_OF_LIST()
/* The above list is not sorted /wrt version numbers, watch out! */
}