diff --git a/Source/Windows/ARM64EC/Module.cpp b/Source/Windows/ARM64EC/Module.cpp index b931f100f..6f27dc0e3 100644 --- a/Source/Windows/ARM64EC/Module.cpp +++ b/Source/Windows/ARM64EC/Module.cpp @@ -629,11 +629,6 @@ NTSTATUS ProcessInit() { const uintptr_t KiUserExceptionDispatcherFFS = reinterpret_cast(GetProcAddress(NtDll, "KiUserExceptionDispatcher")); Exception::KiUserExceptionDispatcher = NtDllRedirectionLUT[KiUserExceptionDispatcherFFS - NtDllBase] + NtDllBase; - FEX_CONFIG_OPT(TSOEnabled, TSOENABLED); - if (TSOEnabled() && FEX::Windows::UnixLib::TryEnableHardwareTSO()) { - CTX->SetHardwareTSOSupport(true); - } - FEX_CONFIG_OPT(ProfileStats, PROFILESTATS); FEX_CONFIG_OPT(StartupSleep, STARTUPSLEEP); FEX_CONFIG_OPT(StartupSleepProcName, STARTUPSLEEPPROCNAME); diff --git a/Source/Windows/Common/TSOHandlerConfig.h b/Source/Windows/Common/TSOHandlerConfig.h index 1a0a888ab..cbde622da 100644 --- a/Source/Windows/Common/TSOHandlerConfig.h +++ b/Source/Windows/Common/TSOHandlerConfig.h @@ -5,6 +5,8 @@ #include #include +#include "Windows/Common/FEXUnixLib.h" + namespace FEX::Windows { class TSOHandlerConfig final { public: @@ -15,12 +17,8 @@ public: UnalignedHandlerType = FEXCore::ArchHelpers::Arm64::UnalignedHandlerType::NonAtomic; } - if (TSOEnabled()) { - BOOL Enable = TRUE; - NTSTATUS Status = NtSetInformationProcess(NtCurrentProcess(), ProcessFexHardwareTso, &Enable, sizeof(Enable)); - if (Status == STATUS_SUCCESS) { - CTX.SetHardwareTSOSupport(true); - } + if (TSOEnabled() && FEX::Windows::UnixLib::TryEnableHardwareTSO()) { + CTX.SetHardwareTSOSupport(true); } uint64_t Flags = (StrictInProcessSplitLocks() ? FEX_UNALIGN_ATOMIC_STRICT_SPLIT_LOCKS : 0) | diff --git a/Source/Windows/WOW64/Module.cpp b/Source/Windows/WOW64/Module.cpp index aa2fe70d3..085dc2523 100644 --- a/Source/Windows/WOW64/Module.cpp +++ b/Source/Windows/WOW64/Module.cpp @@ -571,11 +571,6 @@ void BTCpuProcessInit() { // wow64.dll will only initialise the cross-process queue if this is set GetTLS().Wow64Info().CpuFlags = WOW64_CPUFLAGS_SOFTWARE; - FEX_CONFIG_OPT(TSOEnabled, TSOENABLED); - if (TSOEnabled() && FEX::Windows::UnixLib::TryEnableHardwareTSO()) { - CTX->SetHardwareTSOSupport(true); - } - FEX_CONFIG_OPT(ProfileStats, PROFILESTATS); FEX_CONFIG_OPT(StartupSleep, STARTUPSLEEP); FEX_CONFIG_OPT(StartupSleepProcName, STARTUPSLEEPPROCNAME);