x86: Set a physical address for local accesses.

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>
diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc
index ceccba8..71ab563 100644
--- a/src/arch/x86/tlb.cc
+++ b/src/arch/x86/tlb.cc
@@ -206,6 +206,7 @@
         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 @@
         // 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 @@
         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
             {