X86: Truncate addresses to 32 bits except in 64 bit mode, not long mode.
A small change was added a while ago to keep addresses from overflowing 32 bits when larger addresses shouldn't be accessible to software. That change truncated when not in long mode, but really it should have truncated when not in 64 bit mode. The difference is whether compatibility mode is included, a mode that's supposed to act like a legacy 32 bit mode.
This commit is contained in:
@@ -289,7 +289,7 @@ TLB::translate(RequestPtr req, ThreadContext *tc, Translation *translation,
|
||||
return new GeneralProtection(0);
|
||||
}
|
||||
}
|
||||
if (m5Reg.mode != LongMode ||
|
||||
if (m5Reg.submode != SixtyFourBitMode ||
|
||||
(flags & (AddrSizeFlagBit << FlagShift)))
|
||||
vaddr &= mask(32);
|
||||
// If paging is enabled, do the translation.
|
||||
|
||||
Reference in New Issue
Block a user