summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlauber Costa <glommer@redhat.com>2009-10-16 15:27:38 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2009-10-19 17:49:04 -0200
commit11ed4b344c0eb6f1c5d11a07c307e94174a13900 (patch)
tree546d56749cda473f81c5c0a39e2bd39ed602508a /target-i386
parentintroduce VMSTATE_U64 (diff)
downloadqemu-kvm-11ed4b344c0eb6f1c5d11a07c307e94174a13900.tar.gz
qemu-kvm-11ed4b344c0eb6f1c5d11a07c307e94174a13900.tar.bz2
qemu-kvm-11ed4b344c0eb6f1c5d11a07c307e94174a13900.zip
properly save kvm system time msr registers
Currently, the msrs involved in setting up pvclock are not saved over migration and/or save/restore. This patch puts their value in special fields in our CPUState, and deal with them using vmstate. kvm also has to account for it, by including them in the msr list for the ioctls. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/cpu.h4
-rw-r--r--target-i386/machine.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 278d3e3bf..4605fd280 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -667,6 +667,8 @@ typedef struct CPUX86State {
target_ulong fmask;
target_ulong kernelgsbase;
#endif
+ uint64_t system_time_msr;
+ uint64_t wall_clock_msr;
uint64_t tsc;
@@ -886,7 +888,7 @@ uint64_t cpu_get_tsc(CPUX86State *env);
#define cpu_signal_handler cpu_x86_signal_handler
#define cpu_list x86_cpu_list
-#define CPU_SAVE_VERSION 11
+#define CPU_SAVE_VERSION 12
/* MMU modes definitions */
#define MMU_MODE0_SUFFIX _kernel
diff --git a/target-i386/machine.c b/target-i386/machine.c
index 16d9c57ba..b364936eb 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -479,6 +479,9 @@ const VMStateDescription vmstate_cpu = {
VMSTATE_UINT64_ARRAY_V(mce_banks, CPUState, MCE_BANKS_DEF *4, 10),
/* 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_END_OF_LIST()
}
};