aboutsummaryrefslogtreecommitdiff
path: root/target/i386
diff options
context:
space:
mode:
authorPavel Dovgalyuk <pavel.dovgaluk@gmail.com>2019-05-29 15:41:56 +0300
committerEduardo Habkost <ehabkost@redhat.com>2019-06-11 10:17:47 -0300
commit89a44a103315267122119b4311218d00d2561ebe (patch)
tree0aafdb86732e2d04771a8b7205478a6e2b5fcce6 /target/i386
parent506174bf8219dc6d56d2b1f7e66e8cf39157466f (diff)
i386: Save EFER for 32-bit targets
i386 (32 bit) emulation uses EFER in wrmsr and in MMU fault processing. But it does not included in VMState, because "efer" field is disabled with This patch adds a section for 32-bit targets which saves EFER when it's value is non-zero. Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <155913371654.8429.1659082639780315242.stgit@pasha-Precision-3630-Tower> Reviewed-by: Peter Xu <peterx@redhat.com> [ehabkost: indentation fix] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'target/i386')
-rw-r--r--target/i386/machine.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/target/i386/machine.c b/target/i386/machine.c
index 225b5d433b..2c96cfc9a2 100644
--- a/target/i386/machine.c
+++ b/target/i386/machine.c
@@ -964,6 +964,27 @@ static const VMStateDescription vmstate_svm_npt = {
}
};
+#ifndef TARGET_X86_64
+static bool intel_efer32_needed(void *opaque)
+{
+ X86CPU *cpu = opaque;
+ CPUX86State *env = &cpu->env;
+
+ return env->efer != 0;
+}
+
+static const VMStateDescription vmstate_efer32 = {
+ .name = "cpu/efer32",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = intel_efer32_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT64(env.efer, X86CPU),
+ VMSTATE_END_OF_LIST()
+ }
+};
+#endif
+
VMStateDescription vmstate_x86_cpu = {
.name = "cpu",
.version_id = 12,
@@ -1089,6 +1110,9 @@ VMStateDescription vmstate_x86_cpu = {
&vmstate_msr_intel_pt,
&vmstate_msr_virt_ssbd,
&vmstate_svm_npt,
+#ifndef TARGET_X86_64
+ &vmstate_efer32,
+#endif
NULL
}
};