summaryrefslogtreecommitdiff
path: root/target-i386/machine.c
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2010-06-17 17:53:07 +0800
committerMarcelo Tosatti <mtosatti@redhat.com>2010-06-28 13:06:03 -0300
commitf1665b21f16c5dc0ac37de60233a4975aff31193 (patch)
tree0e19f8cd7e54a5aa7dced550c52a296fddb42292 /target-i386/machine.c
parent51e49430c0472c9f609341e3058d47ed93dabe6e (diff)
downloadqemu-f1665b21f16c5dc0ac37de60233a4975aff31193.tar.gz
qemu-f1665b21f16c5dc0ac37de60233a4975aff31193.tar.bz2
qemu-f1665b21f16c5dc0ac37de60233a4975aff31193.zip
kvm: Enable XSAVE live migration support
Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386/machine.c')
-rw-r--r--target-i386/machine.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/target-i386/machine.c b/target-i386/machine.c
index b547e2ac7a..5f8376c37b 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -47,6 +47,22 @@ static const VMStateDescription vmstate_xmm_reg = {
#define VMSTATE_XMM_REGS(_field, _state, _n) \
VMSTATE_STRUCT_ARRAY(_field, _state, _n, 0, vmstate_xmm_reg, XMMReg)
+/* YMMH format is the same as XMM */
+static const VMStateDescription vmstate_ymmh_reg = {
+ .name = "ymmh_reg",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .fields = (VMStateField []) {
+ VMSTATE_UINT64(XMM_Q(0), XMMReg),
+ VMSTATE_UINT64(XMM_Q(1), XMMReg),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
+#define VMSTATE_YMMH_REGS_VARS(_field, _state, _n, _v) \
+ VMSTATE_STRUCT_ARRAY(_field, _state, _n, _v, vmstate_ymmh_reg, XMMReg)
+
static const VMStateDescription vmstate_mtrr_var = {
.name = "mtrr_var",
.version_id = 1,
@@ -453,6 +469,10 @@ static const VMStateDescription vmstate_cpu = {
/* KVM pvclock msr */
VMSTATE_UINT64_V(system_time_msr, CPUState, 11),
VMSTATE_UINT64_V(wall_clock_msr, CPUState, 11),
+ /* XSAVE related fields */
+ VMSTATE_UINT64_V(xcr0, CPUState, 12),
+ VMSTATE_UINT64_V(xstate_bv, CPUState, 12),
+ VMSTATE_YMMH_REGS_VARS(ymmh_regs, CPUState, CPU_NB_REGS, 12),
VMSTATE_END_OF_LIST()
/* The above list is not sorted /wrt version numbers, watch out! */
}