Signed-off-by: Fan WenJie fanwj@mail.ustc.edu.cn
-- v3: tools/makedep: add *.lib to .gitignore ntdll:setting limit with checking server:setting range64 with checking
From: Fan WenJie fanwj@mail.ustc.edu.cn
Signed-off-by: Fan WenJie fanwj@mail.ustc.edu.cn --- server/mapping.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/server/mapping.c b/server/mapping.c index a795dc4b38b..9d402ade5b0 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -229,9 +229,24 @@ static struct addr_range ranges64;
void init_memory(void) { - page_mask = sysconf( _SC_PAGESIZE ) - 1; + size_t page_size = sysconf( _SC_PAGESIZE ); +#ifdef __LP64__ + size_t limit = 1LLU << 48U; + while(limit > 0x100000000LLU) + { + void* addr = (void*)(limit - page_size); + void* ret = mmap(addr, page_size, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0); + size_t next = limit >> 1U; + if (ret == (void*)-1) ret = NULL; + if (ret) munmap(ret, page_size); + if (ret >= (void*)next) break; + limit = next; + } + free_map_addr( limit - (limit >> 4U), limit >> 4U ); +#endif + page_mask = page_size - 1; free_map_addr( 0x60000000, 0x1c000000 ); - free_map_addr( 0x600000000000, 0x100000000000 ); + }
static void ranges_dump( struct object *obj, int verbose )
From: Fan WenJie fanwj@mail.ustc.edu.cn
Signed-off-by: Fan WenJie fanwj@mail.ustc.edu.cn --- dlls/ntdll/unix/virtual.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 75e6319c007..1defce8e312 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -557,7 +557,7 @@ static void mmap_init( const struct preload_info *preload_info ) /* if we don't have a preloader, try to reserve the space now */ reserve_area( (void *)0x000000010000, (void *)0x000068000000 ); reserve_area( (void *)0x00007f000000, (void *)0x00007fff0000 ); - reserve_area( (void *)0x7ffffe000000, (void *)0x7fffffff0000 ); + reserve_area( ((char *)user_space_limit) - 0x1ff0000, user_space_limit );
#endif } @@ -3245,6 +3245,24 @@ static void *alloc_virtual_heap( SIZE_T size ) return anon_mmap_alloc( size, PROT_READ | PROT_WRITE ); }
+#ifdef _WIN64 +static void set_space_limit(void) +{ + size_t limit = 1LLU << 48U; + while(limit > 0x100000000LLU) + { + void* addr = (void*)(limit - page_size); + void* ret = mmap(addr, page_size, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0); + size_t next = limit >> 1U; + if (ret == (void*)-1) ret = NULL; + if (ret) munmap(ret, page_size); + if (ret >= (void*)next) break; + limit = next; + } + address_space_limit = user_space_limit = working_set_limit = (void*)(limit - 0x10000LLU); +} +#endif + /*********************************************************************** * virtual_init */ @@ -3261,6 +3279,10 @@ void virtual_init(void) pthread_mutex_init( &virtual_mutex, &attr ); pthread_mutexattr_destroy( &attr );
+#ifdef _WIN64 + set_space_limit(); +#endif + if (preload_info && *preload_info) for (i = 0; (*preload_info)[i].size; i++) mmap_add_reserved_area( (*preload_info)[i].addr, (*preload_info)[i].size );
From: Fan WenJie fanwj@mail.ustc.edu.cn
Signed-off-by: Fan WenJie fanwj@mail.ustc.edu.cn --- tools/makedep.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/tools/makedep.c b/tools/makedep.c index 8ce575b15ca..299bda7c502 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -4034,6 +4034,7 @@ static void output_gitignore( const char *dest, struct strarray files ) output_file = create_temp_file( dest );
output( "# Automatically generated by make depend; DO NOT EDIT!!\n" ); + output( "*.lib\n" ); for (i = 0; i < files.count; i++) { if (!strchr( files.str[i], '/' )) output( "/" );
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=140032
Your paranoid android.
=== debian11b (64 bit WoW report) ===
kernel32: loader.c:2383: Test failed: 4: NtMapViewOfSection failed 40000003 loader.c:2397: Test failed: 4: not at base 00007FFFFF460000 / 00007FFFFF210000 loader.c:2399: Test failed: 4: tls not relocated 00007FFFFF4610B8 / 00007FFFFF2110B8