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.
-- v6: 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 706dbdc94d1..c288e32420a 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -2465,7 +2465,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 @@ -2493,6 +2493,9 @@ static void *get_host_addr_space_limit(void) return (void *)((addr << 1) - (granularity_mask + 1)); }
+#endif /* _WIN64 */ + +#ifdef __aarch64__
/*********************************************************************** * alloc_arm64ec_map @@ -3325,7 +3328,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=148057
Your paranoid android.
=== debian11b (64 bit WoW report) ===
kernel32: comm.c:1586: Test failed: Unexpected time 1002, expected around 500
Much better, thanks. Could you please fix the authorship information in the commit to use your full name?