aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-01-16 23:35:43 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-01-16 23:35:43 +0000
commitca954f6d90208fa691c04b26ba6227bf717df57f (patch)
treec51d50970422251d969fe430ca6e4e2379e3ebc8
parent97ed14aead862362210c0367782274afa0f593b9 (diff)
downloadqemu-ca954f6d90208fa691c04b26ba6227bf717df57f.zip
qemu-ca954f6d90208fa691c04b26ba6227bf717df57f.tar.gz
qemu-ca954f6d90208fa691c04b26ba6227bf717df57f.tar.bz2
x86_64 fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1226 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--target-i386/helper.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 58530dc..d9c446f 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1550,7 +1550,8 @@ void helper_ljmp_protected_T0_T1(int next_eip)
if (!(e2 & DESC_P_MASK))
raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc);
limit = get_seg_limit(e1, e2);
- if (new_eip > limit)
+ if (new_eip > limit &&
+ !(env->hflags & HF_LMA_MASK) && !(e2 & DESC_L_MASK))
raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
cpu_x86_load_seg_cache(env, R_CS, (new_cs & 0xfffc) | cpl,
get_seg_base(e1, e2), limit, e2);
@@ -1949,7 +1950,8 @@ static inline void helper_ret_protected(int shift, int is_iret, int addend)
raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc);
sp += addend;
- if (rpl == cpl && !(env->hflags & HF_CS64_MASK)) {
+ if (rpl == cpl && (!(env->hflags & HF_CS64_MASK) ||
+ ((env->hflags & HF_CS64_MASK) && !is_iret))) {
/* return to same priledge level */
cpu_x86_load_seg_cache(env, R_CS, new_cs,
get_seg_base(e1, e2),