Commit ca954f6d90208fa691c04b26ba6227bf717df57f
1 parent
97ed14ae
x86_64 fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1226 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
4 additions
and
2 deletions
target-i386/helper.c
@@ -1550,7 +1550,8 @@ void helper_ljmp_protected_T0_T1(int next_eip) | @@ -1550,7 +1550,8 @@ void helper_ljmp_protected_T0_T1(int next_eip) | ||
1550 | if (!(e2 & DESC_P_MASK)) | 1550 | if (!(e2 & DESC_P_MASK)) |
1551 | raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc); | 1551 | raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc); |
1552 | limit = get_seg_limit(e1, e2); | 1552 | limit = get_seg_limit(e1, e2); |
1553 | - if (new_eip > limit) | 1553 | + if (new_eip > limit && |
1554 | + !(env->hflags & HF_LMA_MASK) && !(e2 & DESC_L_MASK)) | ||
1554 | raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc); | 1555 | raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc); |
1555 | cpu_x86_load_seg_cache(env, R_CS, (new_cs & 0xfffc) | cpl, | 1556 | cpu_x86_load_seg_cache(env, R_CS, (new_cs & 0xfffc) | cpl, |
1556 | get_seg_base(e1, e2), limit, e2); | 1557 | get_seg_base(e1, e2), limit, e2); |
@@ -1949,7 +1950,8 @@ static inline void helper_ret_protected(int shift, int is_iret, int addend) | @@ -1949,7 +1950,8 @@ static inline void helper_ret_protected(int shift, int is_iret, int addend) | ||
1949 | raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc); | 1950 | raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc); |
1950 | 1951 | ||
1951 | sp += addend; | 1952 | sp += addend; |
1952 | - if (rpl == cpl && !(env->hflags & HF_CS64_MASK)) { | 1953 | + if (rpl == cpl && (!(env->hflags & HF_CS64_MASK) || |
1954 | + ((env->hflags & HF_CS64_MASK) && !is_iret))) { | ||
1953 | /* return to same priledge level */ | 1955 | /* return to same priledge level */ |
1954 | cpu_x86_load_seg_cache(env, R_CS, new_cs, | 1956 | cpu_x86_load_seg_cache(env, R_CS, new_cs, |
1955 | get_seg_base(e1, e2), | 1957 | get_seg_base(e1, e2), |