aboutsummaryrefslogtreecommitdiff
path: root/target-i386/machine.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-25 18:16:18 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-25 18:16:18 +0000
commit2436b61a6b386d712a1813b036921443bd1c5c39 (patch)
tree9a4250e083f45b100f741e007f8f02301cbdbcdc /target-i386/machine.c
parente737b32a3688d415c3b1f9d0a3fb2b941b1e758c (diff)
SYSENTER/SYSEXIT IA-32e implementation (Alexander Graf).
On Intel CPUs, sysenter and sysexit are valid in 64-bit mode. This patch makes both 64-bit aware and enables them for Intel CPUs. Add cpu save/load for 64-bit wide sysenter variables. Signed-off-by: Alexander Graf <agraf@suse.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5318 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/machine.c')
-rw-r--r--target-i386/machine.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/target-i386/machine.c b/target-i386/machine.c
index 34a0d76541..71311117d0 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -88,9 +88,9 @@ void cpu_save(QEMUFile *f, void *opaque)
cpu_put_seg(f, &env->gdt);
cpu_put_seg(f, &env->idt);
- qemu_put_be32s(f, &env->sysenter_cs);
- qemu_put_be32s(f, &env->sysenter_esp);
- qemu_put_be32s(f, &env->sysenter_eip);
+ qemu_put_betls(f, &env->sysenter_cs);
+ qemu_put_betls(f, &env->sysenter_esp);
+ qemu_put_betls(f, &env->sysenter_eip);
qemu_put_betls(f, &env->cr[0]);
qemu_put_betls(f, &env->cr[2]);
@@ -169,7 +169,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
int32_t a20_mask;
if (version_id != 3 && version_id != 4 && version_id != 5
- && version_id != 6)
+ && version_id != 6 && version_id != 7)
return -EINVAL;
for(i = 0; i < CPU_NB_REGS; i++)
qemu_get_betls(f, &env->regs[i]);
@@ -244,8 +244,13 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
cpu_get_seg(f, &env->idt);
qemu_get_be32s(f, &env->sysenter_cs);
- qemu_get_be32s(f, &env->sysenter_esp);
- qemu_get_be32s(f, &env->sysenter_eip);
+ if (version_id >= 7) {
+ qemu_get_betls(f, &env->sysenter_esp);
+ qemu_get_betls(f, &env->sysenter_eip);
+ } else {
+ qemu_get_be32s(f, &env->sysenter_esp);
+ qemu_get_be32s(f, &env->sysenter_eip);
+ }
qemu_get_betls(f, &env->cr[0]);
qemu_get_betls(f, &env->cr[2]);