dolphin/Source/Core
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
..
AudioCommon AudioCommon: Convert alerts over to fmt-based variants 2020-11-27 10:10:11 -05:00
Common Merge pull request #9283 from JosJuice/config-get-speedup 2020-11-27 02:36:33 +01:00
Core JitArm64: Do downcount immediately before jumping to dispatcher 2020-11-29 14:01:14 +01:00
DiscIO Use positional arguments in all translatable fmt strings 2020-11-16 13:28:11 +01:00
DolphinNoGUI Clean up screen saver inhibition and apply setting change immediately. 2020-10-18 16:31:48 -05:00
DolphinQt Add Fallback Region to configuration menu 2020-11-28 15:40:21 -05:00
InputCommon Merge pull request #9232 from AdmiralCurtiss/show-result-value-in-expression-editor 2020-11-26 01:30:12 +01:00
MacUpdater Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
UICommon Frontends: Migrate logs over to fmt 2020-11-25 21:19:08 -05:00
UpdaterCommon Fix updater not always cleaning up temp directory 2020-11-13 12:25:53 -08:00
VideoBackends Fix bounding box incorrectly disabled on OpenGL ES 3.1, 3.2 2020-11-24 21:22:39 +01:00
VideoCommon Core: Remove commented out logs 2020-11-26 07:49:37 -05:00
WinUpdater DolphinQt: Handle non-ASCII characters in Windows cmd arguments 2020-09-21 17:26:29 +02:00
CMakeLists.txt WinUpdater: Add CMakeLists.txt 2019-05-08 23:59:04 +02:00