Always invalidate code as temp fix
Until I find out what else triggers SPU invalidation
This commit is contained in:
@@ -25,7 +25,9 @@ void spu_recompiler_base::enter(SPUThread& spu)
|
|||||||
|
|
||||||
// Search if cached data matches
|
// Search if cached data matches
|
||||||
auto & func = spu.compiled_cache[spu.pc / 4];
|
auto & func = spu.compiled_cache[spu.pc / 4];
|
||||||
if (func.dirty_bit)
|
|
||||||
|
// func.contents is there only as a temporary test, to see if SPU codfe not getting invalidated is the reason for the crashes
|
||||||
|
if (func.contents || func.dirty_bit)
|
||||||
{
|
{
|
||||||
func.dirty_bit = false;
|
func.dirty_bit = false;
|
||||||
|
|
||||||
|
|||||||
@@ -470,6 +470,7 @@ void SPUThread::do_dma_transfer(const spu_mfc_cmd& args, bool from_mfc)
|
|||||||
|
|
||||||
u32 eal = args.eal;
|
u32 eal = args.eal;
|
||||||
u32 lsa = args.lsa & 0x3ffff;
|
u32 lsa = args.lsa & 0x3ffff;
|
||||||
|
SPUThread * spu = nullptr;
|
||||||
|
|
||||||
if (eal >= SYS_SPU_THREAD_BASE_LOW && offset < RAW_SPU_BASE_ADDR) // SPU Thread Group MMIO (LS and SNR)
|
if (eal >= SYS_SPU_THREAD_BASE_LOW && offset < RAW_SPU_BASE_ADDR) // SPU Thread Group MMIO (LS and SNR)
|
||||||
{
|
{
|
||||||
@@ -478,15 +479,15 @@ void SPUThread::do_dma_transfer(const spu_mfc_cmd& args, bool from_mfc)
|
|||||||
|
|
||||||
if (group && index < group->num && group->threads[index])
|
if (group && index < group->num && group->threads[index])
|
||||||
{
|
{
|
||||||
auto& spu = static_cast<SPUThread&>(*group->threads[index]);
|
spu = group->threads[index].get();
|
||||||
|
|
||||||
if (offset + args.size - 1 < 0x40000) // LS access
|
if (offset + args.size - 1 < 0x40000) // LS access
|
||||||
{
|
{
|
||||||
eal = spu.offset + offset; // redirect access
|
eal = spu->offset + offset; // redirect access
|
||||||
}
|
}
|
||||||
else if (!is_get && args.size == 4 && (offset == SYS_SPU_THREAD_SNR1 || offset == SYS_SPU_THREAD_SNR2))
|
else if (!is_get && args.size == 4 && (offset == SYS_SPU_THREAD_SNR1 || offset == SYS_SPU_THREAD_SNR2))
|
||||||
{
|
{
|
||||||
spu.push_snr(SYS_SPU_THREAD_SNR2 == offset, _ref<u32>(lsa));
|
spu->push_snr(SYS_SPU_THREAD_SNR2 == offset, _ref<u32>(lsa));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -554,6 +555,20 @@ void SPUThread::do_dma_transfer(const spu_mfc_cmd& args, bool from_mfc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (spu)
|
||||||
|
{
|
||||||
|
for (auto& func : spu->compiled_functions)
|
||||||
|
{
|
||||||
|
auto faddr = func->contents->addr;
|
||||||
|
auto fsize = func->contents->size;
|
||||||
|
|
||||||
|
if (faddr >= eal && faddr + fsize < eal + args.size)
|
||||||
|
{
|
||||||
|
func->dirty_bit = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (is_get && from_mfc)
|
if (is_get && from_mfc)
|
||||||
{
|
{
|
||||||
//_mm_sfence();
|
//_mm_sfence();
|
||||||
|
|||||||
Reference in New Issue
Block a user