diff --git a/patches/ntdll-Builtin_Prot/0001-ntdll-Fix-holes-in-ELF-mappings.patch b/patches/ntdll-Builtin_Prot/0001-ntdll-Fix-holes-in-ELF-mappings.patch index 315bd86b..b907b22c 100644 --- a/patches/ntdll-Builtin_Prot/0001-ntdll-Fix-holes-in-ELF-mappings.patch +++ b/patches/ntdll-Builtin_Prot/0001-ntdll-Fix-holes-in-ELF-mappings.patch @@ -1,4 +1,4 @@ -From aa9b48c7e76994f4b93fbc516eee5d39a597f63f Mon Sep 17 00:00:00 2001 +From 83309ce4174bf56eef86e516221290b8d88bdc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 1 Jun 2017 06:04:53 +0200 Subject: [PATCH] ntdll: Fix holes in ELF mappings. (v2) @@ -10,10 +10,10 @@ Based on a patch by Andrew Wesie. 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index 66bcde8aff1..734dd130817 100644 +index cdc8e1189b3..1f73e72a952 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -959,6 +959,16 @@ static inline BOOL is_write_watch_range( const void *addr, size_t size ) +@@ -968,6 +968,16 @@ static inline BOOL is_write_watch_range( const void *addr, size_t size ) } @@ -30,7 +30,7 @@ index 66bcde8aff1..734dd130817 100644 /*********************************************************************** * find_view_range * -@@ -2920,6 +2930,19 @@ NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err, BOOL on_signal_stack ) +@@ -2966,6 +2976,19 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack ) /* ignore fault if page is writable now */ if (get_unix_prot( get_page_vprot( page ) ) & PROT_WRITE) ret = STATUS_SUCCESS; } @@ -47,7 +47,7 @@ index 66bcde8aff1..734dd130817 100644 + else + set_page_vprot_bits( page, page_size, 0, VPROT_READ | VPROT_EXEC ); + } - server_leave_uninterrupted_section( &virtual_mutex, &sigset ); + pthread_mutex_unlock( &virtual_mutex ); return ret; } diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c diff --git a/patches/ntdll-ForceBottomUpAlloc/0005-ntdll-Use-free-area-list-for-virtual-memory-allocati.patch b/patches/ntdll-ForceBottomUpAlloc/0005-ntdll-Use-free-area-list-for-virtual-memory-allocati.patch index 9eb2f3f1..ce826382 100644 --- a/patches/ntdll-ForceBottomUpAlloc/0005-ntdll-Use-free-area-list-for-virtual-memory-allocati.patch +++ b/patches/ntdll-ForceBottomUpAlloc/0005-ntdll-Use-free-area-list-for-virtual-memory-allocati.patch @@ -1,4 +1,4 @@ -From 04a45064d81f63de64effc2748b70cf15bba5f5d Mon Sep 17 00:00:00 2001 +From 7264548fa5272de83119327be9f7b1f2815dbc79 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 14 Jan 2020 21:42:21 +0300 Subject: [PATCH] ntdll: Use free area list for virtual memory allocation. @@ -8,10 +8,10 @@ Subject: [PATCH] ntdll: Use free area list for virtual memory allocation. 1 file changed, 230 insertions(+), 112 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index 00b29bc5d1d..667401aaa93 100644 +index cc7ca87241b..ec404479329 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -186,7 +186,11 @@ static BYTE *pages_vprot; +@@ -189,7 +189,11 @@ static BYTE *pages_vprot; #endif static struct file_view *view_block_start, *view_block_end, *next_free_view; @@ -23,7 +23,7 @@ index 00b29bc5d1d..667401aaa93 100644 static void *preload_reserve_start; static void *preload_reserve_end; static BOOL force_exec_prot; /* whether to force PROT_EXEC on all PROT_READ mmaps */ -@@ -521,13 +525,13 @@ static struct range_entry *free_ranges_lower_bound( void *addr ) +@@ -546,13 +550,13 @@ static struct range_entry *free_ranges_lower_bound( void *addr ) * * Updates the free_ranges after a new view has been created. */ @@ -40,7 +40,7 @@ index 00b29bc5d1d..667401aaa93 100644 /* free_ranges initial value is such that the view is either inside range or before another one. */ assert( range != free_ranges_end ); assert( range->end > view_base || next != free_ranges_end ); -@@ -538,7 +542,7 @@ static void free_ranges_insert_view( struct file_view *view ) +@@ -563,7 +567,7 @@ static void free_ranges_insert_view( struct file_view *view ) (range->end == view_base && next->base >= view_end)) { /* on Win64, assert that it's correctly aligned so we're not going to be in trouble later */ @@ -49,7 +49,7 @@ index 00b29bc5d1d..667401aaa93 100644 WARN( "range %p - %p is already mapped\n", view_base, view_end ); return; } -@@ -578,6 +582,12 @@ static void free_ranges_insert_view( struct file_view *view ) +@@ -603,6 +607,12 @@ static void free_ranges_insert_view( struct file_view *view ) } } @@ -62,7 +62,7 @@ index 00b29bc5d1d..667401aaa93 100644 /*********************************************************************** * free_ranges_remove_view -@@ -608,6 +618,7 @@ static void free_ranges_remove_view( struct file_view *view ) +@@ -633,6 +643,7 @@ static void free_ranges_remove_view( struct file_view *view ) return; } #endif @@ -70,7 +70,7 @@ index 00b29bc5d1d..667401aaa93 100644 /* free_ranges initial value is such that the view is either inside range or before another one. */ assert( range != free_ranges_end ); -@@ -954,44 +965,6 @@ static struct file_view *find_view_range( const void *addr, size_t size ) +@@ -1008,44 +1019,6 @@ static struct file_view *find_view_range( const void *addr, size_t size ) } @@ -115,7 +115,7 @@ index 00b29bc5d1d..667401aaa93 100644 /*********************************************************************** * try_map_free_area * -@@ -1035,65 +1008,11 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step, +@@ -1084,65 +1057,11 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step, return NULL; } @@ -181,7 +181,7 @@ index 00b29bc5d1d..667401aaa93 100644 */ static void *find_reserved_free_area( void *base, void *end, size_t size, int top_down ) { -@@ -1307,8 +1226,7 @@ static void delete_view( struct file_view *view ) /* [in] View */ +@@ -1356,8 +1275,7 @@ static void delete_view( struct file_view *view ) /* [in] View */ { if (!(view->protect & VPROT_SYSTEM)) unmap_area( view->base, view->size ); set_page_vprot( view->base, view->size, 0 ); @@ -191,7 +191,7 @@ index 00b29bc5d1d..667401aaa93 100644 wine_rb_remove( &views_tree, &view->entry ); *(struct file_view **)view = next_free_view; next_free_view = view; -@@ -1356,8 +1274,7 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz +@@ -1405,8 +1323,7 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz set_page_vprot( base, size, vprot ); wine_rb_put( &views_tree, view->base, &view->entry ); @@ -201,7 +201,7 @@ index 00b29bc5d1d..667401aaa93 100644 *view_ret = view; -@@ -1589,6 +1506,7 @@ struct alloc_area +@@ -1651,6 +1568,7 @@ struct alloc_area int top_down; void *limit; void *result; @@ -209,7 +209,7 @@ index 00b29bc5d1d..667401aaa93 100644 }; /*********************************************************************** -@@ -1630,6 +1548,210 @@ static int CDECL alloc_reserved_area_callback( void *start, SIZE_T size, void *a +@@ -1692,6 +1610,210 @@ static int CDECL alloc_reserved_area_callback( void *start, SIZE_T size, void *a return 0; } @@ -420,7 +420,7 @@ index 00b29bc5d1d..667401aaa93 100644 /*********************************************************************** * map_fixed_area * -@@ -1715,11 +1837,15 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, +@@ -1777,11 +1899,15 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, alloc.size = size; alloc.top_down = top_down; alloc.limit = (void*)(get_zero_bits_64_mask( zero_bits_64 ) & (UINT_PTR)user_space_limit); @@ -439,7 +439,7 @@ index 00b29bc5d1d..667401aaa93 100644 } if (mmap_enum_reserved_areas( alloc_reserved_area_callback, &alloc, top_down )) -@@ -1731,15 +1857,6 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, +@@ -1793,15 +1919,6 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size, goto done; } @@ -455,14 +455,14 @@ index 00b29bc5d1d..667401aaa93 100644 view_size = size + granularity_mask + 1; for (;;) -@@ -2392,6 +2509,7 @@ void virtual_init(void) +@@ -2456,6 +2573,7 @@ void virtual_init(void) if (preload_reserve_start) address_space_start = min( address_space_start, preload_reserve_start ); } + TRACE("preload reserve %p-%p.\n", preload_reserve_start, preload_reserve_end); } - size = ROUND_SIZE( 0, sizeof(TEB) ) + max( MINSIGSTKSZ, 8192 ); + size = teb_size + max( MINSIGSTKSZ, 8192 ); -- 2.27.0 diff --git a/patches/ntdll-Heap_Improvements/0002-ntdll-Improve-heap-allocation-performance.patch b/patches/ntdll-Heap_Improvements/0002-ntdll-Improve-heap-allocation-performance.patch index cf68be1a..27e53ada 100644 --- a/patches/ntdll-Heap_Improvements/0002-ntdll-Improve-heap-allocation-performance.patch +++ b/patches/ntdll-Heap_Improvements/0002-ntdll-Improve-heap-allocation-performance.patch @@ -1,4 +1,4 @@ -From a64bc7c1b8d5625fcb7b1b666d95aced4009341b Mon Sep 17 00:00:00 2001 +From 1b79a7d8eb8c813cca81916eda14090a15b93290 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 22 Jul 2017 07:21:45 +0200 Subject: [PATCH] ntdll: Improve heap allocation performance. (v2) @@ -8,7 +8,7 @@ Subject: [PATCH] ntdll: Improve heap allocation performance. (v2) 1 file changed, 210 insertions(+), 96 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c -index 3cbbff2de35..fc669d9dc4d 100644 +index 4fe11fe2b48..de33fcce4bb 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -3,6 +3,7 @@ @@ -87,7 +87,7 @@ index 3cbbff2de35..fc669d9dc4d 100644 -/* Max size of the blocks on the free lists above HEAP_MAX_SMALL_FREE_LIST */ -static const SIZE_T HEAP_freeListSizes[] = -{ -- 0x200, 0x400, 0x1000, ~0UL +- 0x200, 0x400, 0x1000, ~(SIZE_T)0 -}; -#define HEAP_NB_FREE_LISTS (ARRAY_SIZE( HEAP_freeListSizes ) + HEAP_NB_SMALL_FREE_LISTS) - diff --git a/patches/ntdll-Interrupt-0x2e/0001-ntdll-Catch-windows-int-0x2e-syscall-on-i386.patch b/patches/ntdll-Interrupt-0x2e/0001-ntdll-Catch-windows-int-0x2e-syscall-on-i386.patch index 8432d08a..38657927 100644 --- a/patches/ntdll-Interrupt-0x2e/0001-ntdll-Catch-windows-int-0x2e-syscall-on-i386.patch +++ b/patches/ntdll-Interrupt-0x2e/0001-ntdll-Catch-windows-int-0x2e-syscall-on-i386.patch @@ -1,4 +1,4 @@ -From 17b12b07aae111f5dde4f4dca3520ab93487b2aa Mon Sep 17 00:00:00 2001 +From 4b73ac9cedc1531c6ae441c38d0bad37ed29c13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sun, 19 Mar 2017 19:08:34 +0100 Subject: [PATCH] ntdll: Catch windows int 0x2e syscall on i386. @@ -8,15 +8,15 @@ Subject: [PATCH] ntdll: Catch windows int 0x2e syscall on i386. 1 file changed, 5 insertions(+) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c -index 7ae4cda33a6..80fef44d055 100644 +index 19ba551773a..e30dbf9398e 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c -@@ -1638,6 +1638,11 @@ static BOOL handle_interrupt( unsigned int interrupt, ucontext_t *sigcontext, st - stack->rec.ExceptionInformation[2] = stack->context.Edx; - setup_raise_exception( sigcontext, stack ); +@@ -1584,6 +1584,11 @@ static BOOL handle_interrupt( unsigned int interrupt, ucontext_t *sigcontext, vo + rec->ExceptionInformation[2] = context->Edx; + setup_raise_exception( sigcontext, stack, rec, context ); return TRUE; + case 0x2e: -+ FIXME("unimplemented syscall handler for %#x\n", stack->context.Eax); ++ FIXME("unimplemented syscall handler for %#x\n", context->Eax); + EAX_sig(sigcontext) = STATUS_INVALID_SYSTEM_SERVICE; + EIP_sig(sigcontext) += 2; + return TRUE; @@ -24,5 +24,5 @@ index 7ae4cda33a6..80fef44d055 100644 return FALSE; } -- -2.26.2 +2.27.0 diff --git a/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch b/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch index 1b1f2bb5..348a9540 100644 --- a/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch +++ b/patches/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch @@ -1,4 +1,4 @@ -From 2efee8f30caa027977f7cfb91a84b748a5fd17cd Mon Sep 17 00:00:00 2001 +From 25022d43f705d40658bb1aaf3ad8e86edf8b3325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 4 Oct 2014 02:53:22 +0200 Subject: [PATCH] ntdll: Setup a temporary signal handler during process @@ -8,16 +8,16 @@ Subject: [PATCH] ntdll: Setup a temporary signal handler during process dlls/ntdll/unix/loader.c | 1 + dlls/ntdll/unix/signal_arm.c | 6 ++++ dlls/ntdll/unix/signal_arm64.c | 7 +++++ - dlls/ntdll/unix/signal_i386.c | 52 +++++++++++++++++++++++++++++++++ + dlls/ntdll/unix/signal_i386.c | 56 +++++++++++++++++++++++++++++++++ dlls/ntdll/unix/signal_x86_64.c | 6 ++++ dlls/ntdll/unix/unix_private.h | 1 + - 6 files changed, 73 insertions(+) + 6 files changed, 77 insertions(+) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c -index 73c24eff549..8881d073684 100644 +index d03f5861d0..d7aa088e1d 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c -@@ -1761,6 +1761,7 @@ void __wine_main( int argc, char *argv[], char *envp[] ) +@@ -1812,6 +1812,7 @@ void __wine_main( int argc, char *argv[], char *envp[] ) #endif virtual_init(); @@ -26,10 +26,10 @@ index 73c24eff549..8881d073684 100644 ntdll_module = load_ntdll(); fixup_ntdll_imports( &__wine_spec_nt_header ); diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c -index e65b8a93d18..d7a9323a195 100644 +index 34463309de..0810024a34 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c -@@ -869,6 +869,12 @@ void signal_init_process(void) +@@ -830,6 +830,12 @@ void signal_init_process(void) exit(1); } @@ -43,10 +43,10 @@ index e65b8a93d18..d7a9323a195 100644 /*********************************************************************** * init_thread_context diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c -index 7f8fb708ccd..574633dbd5d 100644 +index e66952a29b..4b63de0ea4 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c -@@ -791,6 +791,13 @@ void signal_init_process(void) +@@ -882,6 +882,13 @@ void signal_init_process(void) exit(1); } @@ -61,10 +61,10 @@ index 7f8fb708ccd..574633dbd5d 100644 * init_thread_context */ diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c -index 2f5d397ed55..c29a006736a 100644 +index 162a0b6a70..dc66ed0f38 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c -@@ -1644,6 +1644,30 @@ static BOOL handle_interrupt( unsigned int interrupt, ucontext_t *sigcontext, st +@@ -1590,6 +1590,34 @@ static BOOL handle_interrupt( unsigned int interrupt, ucontext_t *sigcontext, vo } @@ -76,17 +76,21 @@ index 2f5d397ed55..c29a006736a 100644 + */ +static void segv_handler_early( int signal, siginfo_t *siginfo, void *sigcontext ) +{ -+ ucontext_t *context = sigcontext; ++ EXCEPTION_RECORD rec = { 0 }; ++ CONTEXT context; ++ ucontext_t *ucontext = sigcontext; ++ void *stack = setup_exception_record( sigcontext, &rec, &context ); ++ + init_handler( sigcontext ); + -+ switch (TRAP_sig(context)) ++ switch (TRAP_sig(ucontext)) + { + case TRAP_x86_PAGEFLT: /* Page fault */ -+ if (!virtual_handle_fault( siginfo->si_addr, (ERROR_sig(context) >> 1) & 0x09, TRUE )) ++ if (!virtual_handle_fault( siginfo->si_addr, (ERROR_sig(ucontext) >> 1) & 0x09, stack )) + return; + /* fall-through */ + default: -+ WINE_ERR( "Got unexpected trap %d during process initialization\n", TRAP_sig(context) ); ++ WINE_ERR( "Got unexpected trap %d during process initialization\n", TRAP_sig(ucontext) ); + abort_thread(1); + break; + } @@ -95,7 +99,7 @@ index 2f5d397ed55..c29a006736a 100644 /********************************************************************** * segv_handler * -@@ -2243,6 +2267,34 @@ void signal_init_process(void) +@@ -2148,6 +2176,34 @@ void signal_init_process(void) exit(1); } @@ -131,10 +135,10 @@ index 2f5d397ed55..c29a006736a 100644 /*********************************************************************** * init_thread_context diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c -index 88ee18461a2..dedc17bf60e 100644 +index 01be0eab81..4342ab0237 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c -@@ -1415,6 +1415,12 @@ void signal_init_process(void) +@@ -2409,6 +2409,12 @@ void signal_init_process(void) exit(1); } @@ -148,10 +152,10 @@ index 88ee18461a2..dedc17bf60e 100644 /*********************************************************************** * init_thread_context diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h -index 7dbfde43b34..fbcd200c420 100644 +index 3cf9ca6673..76c483cc3f 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h -@@ -207,6 +207,7 @@ extern NTSTATUS signal_alloc_thread( TEB *teb ) DECLSPEC_HIDDEN; +@@ -218,6 +218,7 @@ extern NTSTATUS signal_alloc_thread( TEB *teb ) DECLSPEC_HIDDEN; extern void signal_free_thread( TEB *teb ) DECLSPEC_HIDDEN; extern void signal_init_thread( TEB *teb ) DECLSPEC_HIDDEN; extern void signal_init_process(void) DECLSPEC_HIDDEN; diff --git a/patches/ntdll-WRITECOPY/0004-ntdll-Properly-handle-PAGE_WRITECOPY-protection.-try.patch b/patches/ntdll-WRITECOPY/0004-ntdll-Properly-handle-PAGE_WRITECOPY-protection.-try.patch index 19150af8..d58e5911 100644 --- a/patches/ntdll-WRITECOPY/0004-ntdll-Properly-handle-PAGE_WRITECOPY-protection.-try.patch +++ b/patches/ntdll-WRITECOPY/0004-ntdll-Properly-handle-PAGE_WRITECOPY-protection.-try.patch @@ -1,4 +1,4 @@ -From d85f01d0f447026a9cb266cd85934f6f0874ef75 Mon Sep 17 00:00:00 2001 +From 7cdceba44d1eb2af5a724f55964802cd8bc05454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 4 Oct 2014 03:22:09 +0200 Subject: [PATCH] ntdll: Properly handle PAGE_WRITECOPY protection. (try 5) @@ -9,10 +9,10 @@ For now, only enable it when a special environment variable is set. 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index 90dfb62eed1..b059261b3c0 100644 +index b17d8d6b61e..d3ed89de62e 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -491,6 +491,21 @@ int CDECL mmap_enum_reserved_areas( int (CDECL *enum_func)(void *base, SIZE_T si +@@ -500,6 +500,21 @@ int CDECL mmap_enum_reserved_areas( int (CDECL *enum_func)(void *base, SIZE_T si return ret; } @@ -34,7 +34,7 @@ index 90dfb62eed1..b059261b3c0 100644 /*********************************************************************** * free_ranges_lower_bound -@@ -792,8 +807,19 @@ static int get_unix_prot( BYTE vprot ) +@@ -801,8 +816,19 @@ static int get_unix_prot( BYTE vprot ) { if (vprot & VPROT_READ) prot |= PROT_READ; if (vprot & VPROT_WRITE) prot |= PROT_WRITE | PROT_READ; @@ -55,7 +55,7 @@ index 90dfb62eed1..b059261b3c0 100644 if (vprot & VPROT_WRITEWATCH) prot &= ~PROT_WRITE; } if (!prot) prot = PROT_NONE; -@@ -1532,7 +1558,7 @@ static void update_write_watches( void *base, size_t size, size_t accessed_size +@@ -1548,7 +1574,7 @@ static void update_write_watches( void *base, size_t size, size_t accessed_size { TRACE( "updating watch %p-%p-%p\n", base, (char *)base + accessed_size, (char *)base + size ); /* clear write watch flag on accessed pages */ @@ -64,7 +64,7 @@ index 90dfb62eed1..b059261b3c0 100644 /* restore page protections on the entire range */ mprotect_range( base, size, 0, 0 ); } -@@ -2854,12 +2880,13 @@ NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err, BOOL on_signal_stack ) +@@ -2900,12 +2926,13 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack ) set_page_vprot_bits( page, page_size, 0, VPROT_WRITEWATCH ); mprotect_range( page, page_size, 0, 0 ); } @@ -80,9 +80,9 @@ index 90dfb62eed1..b059261b3c0 100644 + /* ignore fault if page is writable now */ + if (get_unix_prot( get_page_vprot( page ) ) & PROT_WRITE) ret = STATUS_SUCCESS; } - server_leave_uninterrupted_section( &virtual_mutex, &sigset ); + pthread_mutex_unlock( &virtual_mutex ); return ret; -@@ -2881,11 +2908,16 @@ static NTSTATUS check_write_access( void *base, size_t size, BOOL *has_write_wat +@@ -2982,11 +3009,16 @@ static NTSTATUS check_write_access( void *base, size_t size, BOOL *has_write_wat { BYTE vprot = get_page_vprot( addr + i ); if (vprot & VPROT_WRITEWATCH) *has_write_watch = TRUE; diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index a4b8aa58..29e14413 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "54b2a10659871032720df31ae9ca6cba2ff4acf0" + echo "42cb7d2ad1caba08de235e6319b9967296b5d554" } # Show version information diff --git a/patches/winebuild-pe_syscall_thunks/0002-winebuild-Call-__wine_syscall_dispatcher-through-the.patch b/patches/winebuild-pe_syscall_thunks/0002-winebuild-Call-__wine_syscall_dispatcher-through-the.patch index f3b673cc..3f13cd30 100644 --- a/patches/winebuild-pe_syscall_thunks/0002-winebuild-Call-__wine_syscall_dispatcher-through-the.patch +++ b/patches/winebuild-pe_syscall_thunks/0002-winebuild-Call-__wine_syscall_dispatcher-through-the.patch @@ -1,4 +1,4 @@ -From 5c11ca24fef2c1008b0845e53451a895a2f1c42e Mon Sep 17 00:00:00 2001 +From 00809244f00603cadec94cb8f80a92662091b41a Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 14 Jul 2020 14:43:01 +0300 Subject: [PATCH] winebuild: Call __wine_syscall_dispatcher through the fixed @@ -17,18 +17,18 @@ call syscall thunks from the loaded image. 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index b261fa0b5474..f801ffdc5bef 100644 +index ff569762953..f67901678f8 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -2796,20 +2796,22 @@ TEB *virtual_alloc_first_teb(void) +@@ -2802,20 +2802,22 @@ TEB *virtual_alloc_first_teb(void) TEB *teb; PEB *peb; NTSTATUS status; - SIZE_T data_size = page_size; + SIZE_T data_size = page_size * 2; SIZE_T peb_size = page_size; - SIZE_T teb_size = signal_stack_mask + 1; - SIZE_T total = 32 * teb_size; + SIZE_T block_size = signal_stack_size + teb_size; + SIZE_T total = 32 * block_size; /* reserve space for shared user data */ status = NtAllocateVirtualMemory( NtCurrentProcess(), (void **)&user_shared_data, 0, &data_size, @@ -46,7 +46,7 @@ index b261fa0b5474..f801ffdc5bef 100644 MEM_RESERVE | MEM_TOP_DOWN, PAGE_READWRITE ); teb_block_pos = 30; diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c -index 278de20522e1..094b9da0ccf5 100644 +index 278de20522e..094b9da0ccf 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1613,10 +1613,10 @@ void output_syscalls( DLLSPEC *spec ) @@ -73,5 +73,5 @@ index 278de20522e1..094b9da0ccf5 100644 } output( "\t.data\n" ); -- -2.26.2 +2.27.0 diff --git a/staging/upstream-commit b/staging/upstream-commit index 2da62cc0..1aaa1b2c 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -54b2a10659871032720df31ae9ca6cba2ff4acf0 +42cb7d2ad1caba08de235e6319b9967296b5d554