aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/arm
diff options
context:
space:
mode:
authorLiam <[email protected]>2023-11-21 23:23:48 -0500
committert895 <[email protected]>2023-11-25 00:47:36 -0500
commitcf534f514989e0d2e52df208818a39aa5eead7c0 (patch)
tree3677e07133815a84c8b894f7e3047e58dd7461fd /src/core/arm
parent20de0ddf1f3afce420beebdf69ec675f0dee2b9f (diff)
downloadyuzu-mainline-cf534f514989e0d2e52df208818a39aa5eead7c0.tar.gz
yuzu-mainline-cf534f514989e0d2e52df208818a39aa5eead7c0.zip
arm_nce: skip data aborts for crash handling parity
Diffstat (limited to 'src/core/arm')
-rw-r--r--src/core/arm/nce/arm_nce.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/core/arm/nce/arm_nce.cpp b/src/core/arm/nce/arm_nce.cpp
index bb1f6d2e6..6eb6299cc 100644
--- a/src/core/arm/nce/arm_nce.cpp
+++ b/src/core/arm/nce/arm_nce.cpp
@@ -116,10 +116,18 @@ bool ARM_NCE::HandleGuestFault(GuestContext* guest_ctx, void* raw_info, void* ra
return true;
}
- // We can't handle the access, so trigger an exception.
+ // We can't handle the access, so determine why we crashed.
const bool is_prefetch_abort = host_ctx.pc == reinterpret_cast<u64>(info->si_addr);
- guest_ctx->esr_el1.fetch_or(
- static_cast<u64>(is_prefetch_abort ? HaltReason::PrefetchAbort : HaltReason::DataAbort));
+
+ // For data aborts, skip the instruction and return to guest code.
+ // This will allow games to continue in many scenarios where they would otherwise crash.
+ if (!is_prefetch_abort) {
+ host_ctx.pc += 4;
+ return true;
+ }
+
+ // This is a prefetch abort.
+ guest_ctx->esr_el1.fetch_or(static_cast<u64>(HaltReason::PrefetchAbort));
// Forcibly mark the context as locked. We are still running.
// We may race with SignalInterrupt here: