diff options
author | Liu, Jinsong <jinsong.liu@intel.com> | 2011-10-05 16:52:32 -0300 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2011-10-24 21:29:07 -0200 |
commit | aa82ba549a3a88f7215e65956f3cb4bfd34835cc (patch) | |
tree | 17a5b466b28f22e949482600d1a0c66ae73cea32 /target-i386/machine.c | |
parent | 38d2c27ea68468bd2fdaa19c74d9e6d290f94777 (diff) |
kvm: support TSC deadline MSR with subsection
KVM add emulation of lapic tsc deadline timer for guest.
This patch is co-operation work at qemu side.
Use subsections to save/restore the field (mtosatti).
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386/machine.c')
-rw-r--r-- | target-i386/machine.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/target-i386/machine.c b/target-i386/machine.c index 9aca8e0523..176d372d1d 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -310,6 +310,24 @@ static const VMStateDescription vmstate_fpop_ip_dp = { } }; +static bool tscdeadline_needed(void *opaque) +{ + CPUState *env = opaque; + + return env->tsc_deadline != 0; +} + +static const VMStateDescription vmstate_msr_tscdeadline = { + .name = "cpu/msr_tscdeadline", + .version_id = 1, + .minimum_version_id = 1, + .minimum_version_id_old = 1, + .fields = (VMStateField []) { + VMSTATE_UINT64(tsc_deadline, CPUState), + VMSTATE_END_OF_LIST() + } +}; + static const VMStateDescription vmstate_cpu = { .name = "cpu", .version_id = CPU_SAVE_VERSION, @@ -420,6 +438,9 @@ static const VMStateDescription vmstate_cpu = { } , { .vmsd = &vmstate_fpop_ip_dp, .needed = fpop_ip_dp_needed, + }, { + .vmsd = &vmstate_msr_tscdeadline, + .needed = tscdeadline_needed, } , { /* empty */ } |