VirtualBox

Changeset 47328 in vbox for trunk/src/recompiler


Ignore:
Timestamp:
Jul 22, 2013 10:50:49 PM (11 years ago)
Author:
vboxsync
Message:

CPUM,++: Fix DR6 and DR7 read-as-1 (RA1) and read-as-zero (RAZ) values on load since REM didn't set them right for years. Introduced constants for these values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/target-i386/op_helper.c

    r47324 r47328  
    36603660    } else if (reg == 7) {
    36613661# else
    3662     } else if (reg == 7 || reg == 5) {
     3662    } else if (reg == 7 || reg == 5) {  /* (DR5 is an alias for DR7.) */
     3663        if (t0 & X86_DR7_MBZ_MASK)
     3664            raise_exception_err(EXCP0D_GPF, 0);
     3665        t0 |= X86_DR7_RA1_MASK;
     3666        t0 &= ~X86_DR7_RAZ_MASK;
    36633667# endif
    36643668        for (i = 0; i < 4; i++)
     
    36673671        for (i = 0; i < 4; i++)
    36683672            hw_breakpoint_insert(env, i);
    3669     } else
     3673    } else {
    36703674# ifndef VBOX
    36713675        env->dr[reg] = t0;
    36723676# else
    3673         env->dr[6] = (t0 & ~RT_BIT_32(12)) | UINT32_C(0xffff0ff0); /* 4 is an alias for 6. */
     3677        if (t0 & X86_DR6_MBZ_MASK)
     3678            raise_exception_err(EXCP0D_GPF, 0);
     3679        t0 |= X86_DR6_RA1_MASK;
     3680        t0 &= ~X86_DR6_RAZ_MASK;
     3681        env->dr[6] = t0;                /* (DR4 is an alias for DR6.) */
    36743682# endif
     3683    }
    36753684}
    36763685#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette