@@ -4125,7 +4125,7 @@ bool spu_thread::process_mfc_cmd()
41254125 if (raddr != addr)
41264126 {
41274127 // Last check for event before we replace the reservation with a new one
4128- if (reservation_check (raddr, rdata))
4128+ if (~ch_events. load (). events & SPU_EVENT_LR && reservation_check (raddr, rdata, addr ))
41294129 {
41304130 set_events (SPU_EVENT_LR);
41314131 }
@@ -4821,7 +4821,7 @@ bool spu_thread::process_mfc_cmd()
48214821 ch_mfc_cmd.cmd , ch_mfc_cmd.lsa , ch_mfc_cmd.eal , ch_mfc_cmd.tag , ch_mfc_cmd.size );
48224822}
48234823
4824- bool spu_thread::reservation_check (u32 addr, const decltype (rdata)& data) const
4824+ bool spu_thread::reservation_check (u32 addr, const decltype (rdata)& data, u32 current_eal ) const
48254825{
48264826 if (!addr)
48274827 {
@@ -4840,6 +4840,21 @@ bool spu_thread::reservation_check(u32 addr, const decltype(rdata)& data) const
48404840 return !cmp_rdata (data, *vm::get_super_ptr<decltype (rdata)>(addr));
48414841 }
48424842
4843+ if ((addr >> 20 ) == (current_eal >> 20 ))
4844+ {
4845+ if (vm::check_addr (addr, vm::page_1m_size))
4846+ {
4847+ // Same random-access-memory page as the current MFC command, assume allocated
4848+ return !cmp_rdata (data, vm::_ref<decltype (rdata)>(addr));
4849+ }
4850+
4851+ if ((addr >> 16 ) == (current_eal >> 16 ) && vm::check_addr (addr, vm::page_64k_size))
4852+ {
4853+ // Same random-access-memory page as the current MFC command, assume allocated
4854+ return !cmp_rdata (data, vm::_ref<decltype (rdata)>(addr));
4855+ }
4856+ }
4857+
48434858 // Ensure data is allocated (HACK: would raise LR event if not)
48444859 // Set range_lock first optimistically
48454860 range_lock->store (u64 {128 } << 32 | addr | vm::range_readable);
0 commit comments