From 74bbe20141aec3bd7639000fb6ad8ff5fe1a7237 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Tue, 2 Dec 2014 06:08:00 -0500 Subject: [PATCH] cpu: Always mask the snoop address when performing lock check Ensure the snoop address check is always using a cache-block aligned address. This patch updates Alpha and Mips to match the other ISAs. --- src/arch/alpha/locked_mem.hh | 4 +--- src/arch/mips/locked_mem.hh | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/arch/alpha/locked_mem.hh b/src/arch/alpha/locked_mem.hh index 253b94be4..7998cbdf1 100644 --- a/src/arch/alpha/locked_mem.hh +++ b/src/arch/alpha/locked_mem.hh @@ -76,9 +76,7 @@ handleLockedSnoop(XC *xc, PacketPtr pkt, Addr cacheBlockMask) return; Addr locked_addr = xc->readMiscReg(MISCREG_LOCKADDR) & cacheBlockMask; - Addr snoop_addr = pkt->getAddr(); - - assert((cacheBlockMask & snoop_addr) == snoop_addr); + Addr snoop_addr = pkt->getAddr() & cacheBlockMask; if (locked_addr == snoop_addr) xc->setMiscReg(MISCREG_LOCKFLAG, false); diff --git a/src/arch/mips/locked_mem.hh b/src/arch/mips/locked_mem.hh index 5b0f8a1b8..a5ff467b3 100644 --- a/src/arch/mips/locked_mem.hh +++ b/src/arch/mips/locked_mem.hh @@ -66,9 +66,7 @@ handleLockedSnoop(XC *xc, PacketPtr pkt, Addr cacheBlockMask) return; Addr locked_addr = xc->readMiscReg(MISCREG_LLADDR) & cacheBlockMask; - Addr snoop_addr = pkt->getAddr(); - - assert((cacheBlockMask & snoop_addr) == snoop_addr); + Addr snoop_addr = pkt->getAddr() & cacheBlockMask; if (locked_addr == snoop_addr) xc->setMiscReg(MISCREG_LLFLAG, false); -- 2.30.2