diff --git a/src/arch/x86/isa/microops/ldstop.isa b/src/arch/x86/isa/microops/ldstop.isa index 4fb953acca..3c3b7e4847 100644 --- a/src/arch/x86/isa/microops/ldstop.isa +++ b/src/arch/x86/isa/microops/ldstop.isa @@ -518,10 +518,10 @@ let {{ implicitStack=True) defineMicroLoadOp('Ldst', 'Data = merge(Data, data, Mem, dataSize);', 'Data = Mem & mask(dataSize * 8);', - '(StoreCheck << FlagShift)') + 'Request::READ_MODIFY_WRITE') defineMicroLoadOp('Ldstl', 'Data = merge(Data, data, Mem, dataSize);', 'Data = Mem & mask(dataSize * 8);', - '(StoreCheck << FlagShift) | Request::LOCKED_RMW', + 'Request::READ_MODIFY_WRITE | Request::LOCKED_RMW', nonSpec=True) defineMicroLoadOp('Ldfp', code='FpData_uqw = Mem', big=False, @@ -599,10 +599,10 @@ let {{ ''' defineMicroLoadSplitOp('LdSplit', code, - '(StoreCheck << FlagShift)') + 'Request::READ_MODIFY_WRITE') defineMicroLoadSplitOp('LdSplitl', code, - '(StoreCheck << FlagShift) | Request::LOCKED_RMW', + 'Request::READ_MODIFY_WRITE | Request::LOCKED_RMW', nonSpec=True) def defineMicroStoreOp(mnemonic, code, completeCode="", mem_flags="0", diff --git a/src/arch/x86/ldstflags.hh b/src/arch/x86/ldstflags.hh index ab6fa2c763..7465d570ea 100644 --- a/src/arch/x86/ldstflags.hh +++ b/src/arch/x86/ldstflags.hh @@ -56,7 +56,6 @@ namespace X86ISA { CPL0FlagBit = 1, AddrSizeFlagBit = 2, - StoreCheck = 4 }; } // namespace X86ISA } // namespace gem5 diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc index 00e1120f4e..9c1a9dae5f 100644 --- a/src/arch/x86/tlb.cc +++ b/src/arch/x86/tlb.cc @@ -313,7 +313,7 @@ TLB::translate(const RequestPtr &req, { Request::Flags flags = req->getFlags(); int seg = flags & SegmentFlagMask; - bool storeCheck = flags & (StoreCheck << FlagShift); + bool storeCheck = flags & Request::READ_MODIFY_WRITE; delayedResponse = false; diff --git a/src/gpu-compute/gpu_tlb.cc b/src/gpu-compute/gpu_tlb.cc index 9560b4de10..e2225a0ffd 100644 --- a/src/gpu-compute/gpu_tlb.cc +++ b/src/gpu-compute/gpu_tlb.cc @@ -424,7 +424,7 @@ namespace X86ISA { uint32_t flags = req->getFlags(); int seg = flags & SegmentFlagMask; - bool storeCheck = flags & (StoreCheck << FlagShift); + bool storeCheck = flags & Request::READ_MODIFY_WRITE; // If this is true, we're dealing with a request // to a non-memory address space. @@ -764,7 +764,7 @@ namespace X86ISA { HandyM5Reg m5Reg = tc->readMiscRegNoEffect(MISCREG_M5_REG); uint32_t flags = pkt->req->getFlags(); - bool storeCheck = flags & (StoreCheck << FlagShift); + bool storeCheck = flags & Request::READ_MODIFY_WRITE; // Do paging protection checks. bool inUser diff --git a/src/mem/request.hh b/src/mem/request.hh index f6c975ac1b..3b884a9e29 100644 --- a/src/mem/request.hh +++ b/src/mem/request.hh @@ -157,6 +157,8 @@ class Request /** This request is for a memory swap. */ MEM_SWAP = 0x00400000, MEM_SWAP_COND = 0x00800000, + /** This request is a read which will be followed by a write. */ + READ_MODIFY_WRITE = 0x00020000, /** The request is a prefetch. */ PREFETCH = 0x01000000, @@ -939,14 +941,22 @@ class Request bool isUncacheable() const { return _flags.isSet(UNCACHEABLE); } bool isStrictlyOrdered() const { return _flags.isSet(STRICT_ORDER); } bool isInstFetch() const { return _flags.isSet(INST_FETCH); } - bool isPrefetch() const { return (_flags.isSet(PREFETCH) || - _flags.isSet(PF_EXCLUSIVE)); } + bool + isPrefetch() const + { + return (_flags.isSet(PREFETCH | PF_EXCLUSIVE)); + } bool isPrefetchEx() const { return _flags.isSet(PF_EXCLUSIVE); } bool isLLSC() const { return _flags.isSet(LLSC); } bool isPriv() const { return _flags.isSet(PRIVILEGED); } bool isLockedRMW() const { return _flags.isSet(LOCKED_RMW); } - bool isSwap() const { return _flags.isSet(MEM_SWAP|MEM_SWAP_COND); } + bool isSwap() const { return _flags.isSet(MEM_SWAP | MEM_SWAP_COND); } bool isCondSwap() const { return _flags.isSet(MEM_SWAP_COND); } + bool + isReadModifyWrite() const + { + return _flags.isSet(LOCKED_RMW | READ_MODIFY_WRITE); + } bool isSecure() const { return _flags.isSet(SECURE); } bool isPTWalk() const { return _flags.isSet(PT_WALK); } bool isRelease() const { return _flags.isSet(RELEASE); } diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc index ca82052a73..77ab1700ed 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -725,14 +725,7 @@ Sequencer::makeRequest(PacketPtr pkt) } else if (pkt->req->isInstFetch()) { primary_type = secondary_type = RubyRequestType_IFETCH; } else { - bool storeCheck = false; - // only X86 need the store check - if (system->getArch() == Arch::X86ISA) { - uint32_t flags = pkt->req->getFlags(); - storeCheck = flags & - (X86ISA::StoreCheck << X86ISA::FlagShift); - } - if (storeCheck) { + if (pkt->req->isReadModifyWrite()) { primary_type = RubyRequestType_RMW_Read; secondary_type = RubyRequestType_ST; } else {