dolphin/Source/Core
JosJuice 86c1f6e1e7 Jit: Don't use a second stack
This second stack leads to JNI problems on Android, because ART fetches
the address and size of the original stack using pthread functions
(see GetThreadStack in art/runtime/thread.cc), and (presumably) treats
stack addresses outside of the original stack as invalid. (What I don't
understand is why some JNI operations on the CPU thread work fine
despite this but others don't.)

Instead of creating a second stack, let's borrow the approach ART uses:
Use pthread functions to find out the stack's address and size, then
install guard pages at an appropriate location. This lets us get rid
of a workaround we had in the MsgAlert function.

Because we're no longer choosing the stack size ourselves, I've made some
tweaks to where the put the guard pages. Previously we had a stack of
2 MiB and a safe zone of 512 KiB. We now accept stacks as small as 512 KiB
(used on macOS) and use a safe zone of 256 KiB. I feel like this should
be fine, but haven't done much testing beyond "it seems to work".

By the way, on Windows it was already the case that we didn't create
a second stack... But there was a bug in the implementation!
The code for protecting the stack has to run on the CPU thread, since
it's the CPU thread's stack we want to protect, but it was actually
running on EmuThread. This commit fixes that, since now this bug
matters on other operating systems too.
2023-02-28 20:29:46 +01:00
..
AudioCommon WorkQueueThread: provide name and function at same time 2023-02-04 15:56:27 +13:00
Common Jit: Don't use a second stack 2023-02-28 20:29:46 +01:00
Core Jit: Don't use a second stack 2023-02-28 20:29:46 +01:00
DiscIO RiivolutionPatcher: Use capitalization of file that exists in the host file system if possible. 2023-02-28 00:56:34 +01:00
DolphinNoGUI Merge pull request #11522 from phire/KillRendererWithFire 2023-02-09 19:59:16 +13:00
DolphinQt Qt/GameList: Also filter by filename when searching. 2023-02-26 19:13:45 +01:00
DolphinTool Merge pull request #11522 from phire/KillRendererWithFire 2023-02-09 19:59:16 +13:00
InputCommon InputCommon: Fix ControlGroup::SaveConfig with DefaultValue::Disabled 2023-02-26 17:45:09 +01:00
MacUpdater MacUpdater: check os version 2022-10-30 12:04:57 -07:00
UICommon Merge pull request #11608 from Dentomologist/fix_dynamicinputtextures_directory_error_logs 2023-02-27 18:07:57 +01:00
UpdaterCommon Common/FileUtil: Rename Copy() to CopyRegularFile(). 2023-02-22 11:43:58 +01:00
VideoBackends VideoBackends: rework d3d11 to specify samplers/bound textures using a bitset with a constant size, instead of hardcoding each individual enumeration value 2023-02-24 11:32:48 -06:00
VideoCommon D3D: Restore workaround for erroneous NaN optimization 2023-02-25 16:27:30 -08:00
WinUpdater windows: prefer os version from registry 2023-01-17 01:38:00 -08:00
CMakeLists.txt CMakeLists: Add option to disable automatic update support 2022-03-18 03:04:51 -04:00
DolphinLib.ARM64.props msbuild: use default Project attrs 2022-04-27 15:26:43 -07:00
DolphinLib.props VideoCommon: add constant value to set the allowed maximum number of pixel samplers 2023-02-10 00:46:11 -06:00
DolphinLib.vcxproj Add Dear ImPlot Library 2022-12-22 14:32:42 -05:00
DolphinLib.vcxproj.user msbuild: use default Project attrs 2022-04-27 15:26:43 -07:00
DolphinLib.x64.props Move x64 DSP JIT into DolphinLib.x64.props 2023-01-06 22:42:21 -08:00