Resolves issue https://gitlab.winehq.org/wine/wine/-/merge_requests/3598#note_75871
The host address space limit may not be `0x7fffffff0000` on any architecture (eg: ARM64). Such architectures can fully emulate x86_64 Wine (eg: QEMU, FEX, BOX64) and need to have their host address space detected. Implementing the detection regardless of the Wine build architecture should not regress anything.
-- v5: ntdll: Determine the available address space dynamically for 64bit architectures.
From: gmesmer 3676-gmesmer@users.noreply.gitlab.winehq.org
--- dlls/ntdll/unix/virtual.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 0fedfe0fb1d..ca241bbffd7 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -2436,7 +2436,7 @@ static NTSTATUS map_pe_header( void *ptr, size_t size, int fd, BOOL *removable ) return STATUS_SUCCESS; /* page protections will be updated later */ }
-#ifdef __aarch64__ +#ifdef _WIN64
/*********************************************************************** * get_host_addr_space_limit @@ -2464,6 +2464,9 @@ static void *get_host_addr_space_limit(void) return (void *)((addr << 1) - (granularity_mask + 1)); }
+#endif /* _WIN64 */ + +#ifdef __aarch64__
/*********************************************************************** * alloc_arm64ec_map @@ -3296,7 +3299,7 @@ void virtual_init(void) pthread_mutex_init( &virtual_mutex, &attr ); pthread_mutexattr_destroy( &attr );
-#ifdef __aarch64__ +#ifdef _WIN64 host_addr_space_limit = get_host_addr_space_limit(); TRACE( "host addr space limit: %p\n", host_addr_space_limit ); #else
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=148056
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000027F00F4, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
On Wed Aug 28 16:34:58 2024 +0000, Alexandre Julliard wrote:
It doesn't make sense to do this for 32-bit architectures.
Ok. Changed.