Revision ca954f6d target-i386/helper.c

b/target-i386/helper.c
1550 1550
        if (!(e2 & DESC_P_MASK))
1551 1551
            raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc);
1552 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 1555
            raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
1555 1556
        cpu_x86_load_seg_cache(env, R_CS, (new_cs & 0xfffc) | cpl,
1556 1557
                       get_seg_base(e1, e2), limit, e2);
......
1949 1950
        raise_exception_err(EXCP0B_NOSEG, new_cs & 0xfffc);
1950 1951
    
1951 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 1955
        /* return to same priledge level */
1954 1956
        cpu_x86_load_seg_cache(env, R_CS, new_cs, 
1955 1957
                       get_seg_base(e1, e2),

Also available in: Unified diff