diff options
| author | crueter <crueter@eden-emu.dev> | 2025-09-08 02:37:55 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2025-09-08 02:37:55 +0200 |
| commit | ecc99ce9ab54e4a14dc5f67aac932316a332b6a1 (patch) | |
| tree | 913a025dca56d41944af916cb2e7f32bc79163dc | |
| parent | 2f82b63e6ad4f26544e74f86224f4e240933d602 (diff) | |
[dynarmic] spinlock: (re-)allow RWE on execute-supported targets (#393)
regr. #273
Signed-off-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/393
| -rw-r--r-- | src/dynarmic/src/dynarmic/common/spin_lock_x64.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dynarmic/src/dynarmic/common/spin_lock_x64.cpp b/src/dynarmic/src/dynarmic/common/spin_lock_x64.cpp index 7c0ba8a890..c949ed7de8 100644 --- a/src/dynarmic/src/dynarmic/common/spin_lock_x64.cpp +++ b/src/dynarmic/src/dynarmic/common/spin_lock_x64.cpp @@ -11,6 +11,12 @@ #include "dynarmic/backend/x64/hostloc.h" #include "dynarmic/common/spin_lock.h" +#ifdef DYNARMIC_ENABLE_NO_EXECUTE_SUPPORT +static const auto default_cg_mode = Xbyak::DontSetProtectRWE; +#else +static const auto default_cg_mode = nullptr; //Allow RWE +#endif + namespace Dynarmic { void EmitSpinLockLock(Xbyak::CodeGenerator& code, Xbyak::Reg64 ptr, Xbyak::Reg32 tmp) { @@ -37,7 +43,7 @@ namespace { struct SpinLockImpl { void Initialize(); - Xbyak::CodeGenerator code = Xbyak::CodeGenerator(4096, Xbyak::DontSetProtectRWE); + Xbyak::CodeGenerator code = Xbyak::CodeGenerator(4096, default_cg_mode); void (*lock)(volatile int*); void (*unlock)(volatile int*); |
