fix canonical address calculation broken with LASS merge

This commit is contained in:
Stanislav Shwartsman 2023-10-30 07:08:44 +02:00
parent 18deee022f
commit 975c11fe09
2 changed files with 15 additions and 15 deletions

View File

@ -315,12 +315,12 @@ BX_CPU_C::tickle_read_linear(unsigned s, bx_address laddr)
}
#if BX_SUPPORT_X86_64
if (long64_mode()) {
if (! IsCanonical(laddr)) {
BX_ERROR(("tickle_read_linear(): canonical failure"));
exception(int_number(s), 0);
}
if (! IsCanonical(laddr)) {
BX_ERROR(("tickle_read_linear(): canonical failure"));
exception(int_number(s), 0);
}
if (long64_mode()) {
if (BX_CPU_THIS_PTR cr4.get_LASS()) {
// laddr[63] == 0 user, laddr[63] == 1 supervisor
if ((laddr >> 63) == USER_PL) {

View File

@ -2490,12 +2490,12 @@ int BX_CPU_C::access_write_linear(bx_address laddr, unsigned len, unsigned curr_
bx_TLB_entry *tlbEntry = BX_DTLB_ENTRY_OF(laddr, 0);
#if BX_SUPPORT_X86_64
if (long64_mode()) {
if (! IsCanonical(laddr)) {
BX_ERROR(("access_write_linear(): canonical failure"));
return -1;
}
if (! IsCanonical(laddr)) {
BX_ERROR(("access_write_linear(): canonical failure"));
return -1;
}
if (long64_mode()) {
if (BX_CPU_THIS_PTR cr4.get_LASS()) {
// laddr[63] == 0 user, laddr[63] == 1 supervisor
if ((laddr >> 63) == user) {
@ -2613,12 +2613,12 @@ int BX_CPU_C::access_read_linear(bx_address laddr, unsigned len, unsigned curr_p
bool user = (curr_pl == 3);
#if BX_SUPPORT_X86_64
if (long64_mode()) {
if (! IsCanonical(laddr)) {
BX_ERROR(("access_read_linear(): canonical failure"));
return -1;
}
if (! IsCanonical(laddr)) {
BX_ERROR(("access_read_linear(): canonical failure"));
return -1;
}
if (long64_mode()) {
if (BX_CPU_THIS_PTR cr4.get_LASS()) {
// laddr[63] == 0 user, laddr[63] == 1 supervisor
if ((laddr >> 63) == user) {