sys_rsx: Outlaw mapping sys_vm memory to RSX IO address-space

This commit is contained in:
Eladash 2021-12-24 20:19:24 +02:00 committed by Ivan
parent a0040e6fb1
commit 6ee9d0f35f
2 changed files with 9 additions and 1 deletions

View File

@ -231,7 +231,7 @@ CellError process_is_spu_lock_line_reservation_address(u32 addr, u64 flags)
return CELL_EPERM;
default:
{
if (auto vm0 = idm::get<sys_vm_t>(sys_vm_t::find_id(addr & -0x1000'0000)))
if (auto vm0 = idm::get<sys_vm_t>(sys_vm_t::find_id(addr)))
{
// sys_vm area was not covering the address specified but made a reservation on the entire 256mb region
if (vm0->addr + vm0->size - 1 < addr)

View File

@ -6,7 +6,9 @@
#include "Emu/Cell/timers.hpp"
#include "Emu/Memory/vm_locking.h"
#include "Emu/RSX/RSXThread.h"
#include "util/asm.hpp"
#include "sys_event.h"
#include "sys_vm.h"
LOG_CHANNEL(sys_rsx);
@ -324,6 +326,12 @@ error_code sys_rsx_context_iomap(cpu_thread& cpu, u32 context_id, u32 io, u32 ea
{
return CELL_EINVAL;
}
if ((addr == ea || !(addr % 0x1000'0000)) && idm::check<sys_vm_t>(sys_vm_t::find_id(addr)))
{
// Virtual memory is disallowed
return CELL_EINVAL;
}
}
io >>= 20, ea >>= 20, size >>= 20;