cpu-o3: Fix handling of some mem. order violations
authorGiacomo Gabrielli <giacomo.gabrielli@arm.com>
Wed, 2 Oct 2019 14:43:47 +0000 (15:43 +0100)
committerGiacomo Gabrielli <giacomo.gabrielli@arm.com>
Wed, 30 Oct 2019 09:05:34 +0000 (09:05 +0000)
This patch fixes the handling of memory order violations due to snoops
targeting out-of-order loads: the re-execution triggered in these cases
is achieved by raising a ReExec fault, but such a fault was not handled
correctly after the code changes introduced in changeset 46da8fb.

Change-Id: I2abe161a90468412f56cb28dcc92729326cba1cd
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21819
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Timothy Hayes <timothy.hayes@arm.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

src/cpu/o3/lsq.hh
src/cpu/o3/lsq_unit_impl.hh

index 6225c507d31d047ca9b25af21ffa3f04ab8b58a6..ca92790b8d9ee5460ef4ef3ec41f571e2983da73 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2012, 2014, 2018 ARM Limited
+ * Copyright (c) 2011-2012, 2014, 2018-2019 ARM Limited
  * Copyright (c) 2013 Advanced Micro Devices, Inc.
  * All rights reserved
  *
@@ -623,6 +623,12 @@ class LSQ
                     (isPartialFault() && isLoad()));
         }
 
+        void
+        setStateToFault()
+        {
+            setState(State::Fault);
+        }
+
         /**
          * The LSQ entry is cleared
          */
index c2483d56742892b1c5f6909520c9508ad337a3c3..553c903e79e148e1636d1b866b663718efaae289 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2010-2014, 2017-2018 ARM Limited
+ * Copyright (c) 2010-2014, 2017-2019 ARM Limited
  * Copyright (c) 2013 Advanced Micro Devices, Inc.
  * All rights reserved
  *
@@ -426,6 +426,7 @@ LSQUnit<Impl>::checkSnoop(PacketPtr pkt)
 
                 // Mark the load for re-execution
                 ld_inst->fault = std::make_shared<ReExec>();
+                req->setStateToFault();
             } else {
                 DPRINTF(LSQUnit, "HitExternal Snoop for addr %#x [sn:%lli]\n",
                         pkt->getAddr(), ld_inst->seqNum);