From 1d96135087be27b43ddfb5f2f508fbed8e0b7ebb Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 27 May 2012 19:01:04 -0700 Subject: [PATCH] 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. --- src/arch/x86/tlb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc index 8dad84dc4..eb6e9c530 100644 --- a/src/arch/x86/tlb.cc +++ b/src/arch/x86/tlb.cc @@ -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. -- 2.30.2