aboutsummaryrefslogtreecommitdiff
path: root/kqemu.c
diff options
context:
space:
mode:
Diffstat (limited to 'kqemu.c')
-rw-r--r--kqemu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kqemu.c b/kqemu.c
index b7a93b0be6..5ba314f42b 100644
--- a/kqemu.c
+++ b/kqemu.c
@@ -470,9 +470,13 @@ static int do_syscall(CPUState *env,
selector = (env->star >> 32) & 0xffff;
#ifdef __x86_64__
if (env->hflags & HF_LMA_MASK) {
+ int code64;
+
env->regs[R_ECX] = kenv->next_eip;
env->regs[11] = env->eflags;
+ code64 = env->hflags & HF_CS64_MASK;
+
cpu_x86_set_cpl(env, 0);
cpu_x86_load_seg_cache(env, R_CS, selector & 0xfffc,
0, 0xffffffff,
@@ -485,7 +489,7 @@ static int do_syscall(CPUState *env,
DESC_S_MASK |
DESC_W_MASK | DESC_A_MASK);
env->eflags &= ~env->fmask;
- if (env->hflags & HF_CS64_MASK)
+ if (code64)
env->eip = env->lstar;
else
env->eip = env->cstar;