memory: handle GPU faults at the mapped boundary

Co-authored-by: CheesyPoofs346 <jjs777406@gmail.com>
This commit is contained in:
nmzik
2026-09-06 11:08:05 +04:00
parent 50e78d717d
commit d83f1f8235
2 changed files with 49 additions and 1 deletions
@@ -12,7 +12,9 @@ GpuResourceManager::GpuResourceManager(GraphicContext& graphics, CommandSchedule
GpuResourceManager::~GpuResourceManager() = default;
bool GpuResourceManager::HandleFault(PageFaultAccess access, uint64_t fault_vaddr) noexcept {
constexpr uint64_t fault_size = 8;
// The host reports the faulting byte, not the instruction's access width. Both caches
// resolve its page; guessing a width can cross the end of a valid guest mapping.
constexpr uint64_t fault_size = 1;
if (!IsMapped(fault_vaddr, fault_size)) {
return false;
}