dolphin/Source
JosJuice 2863b3ff5b JitArm64: Do downcount immediately before jumping to dispatcher
Fixes https://bugs.dolphin-emu.org/issues/12327.

When we started using fmt in CheckExternalExceptions, JitArm64
mysteriously stopped working even though the code path where
fmt was used never was reached. This is because the compiler
added a function prologue and epilogue to set up the stack,
since the code path that used fmt required the use of the stack.

However, the breakage didn't actually have anything to do
with the usage of the stack in itself, but rather with the
compiler's insertion of a stack canary. In the function
epilogue, a cmp instruction was inserted to check that the
stack canary had not been overwritten during the execution
of the function. This cmp instruction overwriting the status
flags ended up having a disastrous side effect once execution
returned to code emitted by JitArm64::WriteExceptionExit.

JitArm64's dispatcher contains a branch to the "do_timing"
code which is intended to be taken if the PPC downcount is
negative. However, the dispatcher doesn't update the status
flags on its own before this conditional branch, but rather
expects the calling code to have set them as a side effect
of DoDownCount. The root cause of our bug was that
JitArm64::WriteExceptionExit was calling DoDownCount before
Check(External)Exceptions instead of after.
2020-11-29 14:01:14 +01:00
..
Android IP/Top: Add Android network interface 2020-11-27 19:10:28 +04:00
Core JitArm64: Do downcount immediately before jumping to dispatcher 2020-11-29 14:01:14 +01:00
DSPSpy DSPSpy: sync Makefile with current devkitPro template 2020-06-08 04:21:41 +01:00
DSPTool msbuild: re-enable standalone vcxproj processing 2020-08-22 16:17:50 -07:00
PCH Merge pull request #9091 from shuffle2/pch 2020-10-29 21:29:28 +01:00
UnitTests x64Emitter: Check end of allocated space when emitting code. 2020-08-24 19:31:32 +02:00
VSProps DolphinQt: Stop using qtmain 2020-09-21 17:27:10 +02:00
.clang-format Require clang-format 9 and reformat source code 2020-01-08 22:18:15 +01:00
CMakeLists.txt Disable -Wstringop-truncation warnings 2020-11-21 02:08:08 +01:00
dolphin-emu.sln Externals: Add zstd 2020-05-13 20:53:10 +02:00