x86: Set a physical address for local accesses.
authorGabe Black <gabeblack@google.com>
Tue, 12 May 2020 22:02:00 +0000 (15:02 -0700)
committerGabe Black <gabeblack@google.com>
Thu, 14 May 2020 05:41:30 +0000 (05:41 +0000)
This avoids problems when other parts of the simulator blindly try to
retrieve the physical address.

Change-Id: Ia13a2b85b9f919e1e81a6a0f67d10858e98244e5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28987
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/x86/tlb.cc

index ceccba892f4beb663942996752d82c6ae7a2e0a8..71ab56344513a56b073918577be690549419fa44 100644 (file)
@@ -206,6 +206,7 @@ TLB::translateInt(bool read, RequestPtr req, ThreadContext *tc)
         if (!msrAddrToIndex(regNum, vaddr))
             return std::make_shared<GeneralProtection>(0);
 
+        req->setPaddr(req->getVaddr());
         req->setLocalAccessor(
             [read,regNum](ThreadContext *tc, PacketPtr pkt)
             {
@@ -223,6 +224,7 @@ TLB::translateInt(bool read, RequestPtr req, ThreadContext *tc)
         // space.
         assert(!(IOPort & ~0xFFFF));
         if (IOPort == 0xCF8 && req->getSize() == 4) {
+            req->setPaddr(req->getVaddr());
             req->setLocalAccessor(
                 [read](ThreadContext *tc, PacketPtr pkt)
                 {
@@ -262,6 +264,7 @@ TLB::finalizePhysical(const RequestPtr &req,
         req->setFlags(Request::STRICT_ORDER);
         uint8_t func;
         PseudoInst::decodeAddrOffset(paddr - m5opRange.start(), func);
+        req->setPaddr(req->getVaddr());
         req->setLocalAccessor(
             [func, mode](ThreadContext *tc, PacketPtr pkt) -> Cycles
             {