Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
b5564cc1
Commit
b5564cc1
authored
Dec 14, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Switch to the kernel stack before restoring the pthread TEB.
Based on a patch by Rémi Bernon.
parent
715b9d86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
31 deletions
+30
-31
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+30
-31
No files found.
dlls/ntdll/unix/signal_x86_64.c
View file @
b5564cc1
...
...
@@ -2666,23 +2666,9 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
__ASM_CFI_REG_IS_AT1
(
r14
,
rbp
,
0x48
)
__ASM_CFI_REG_IS_AT1
(
r15
,
rbp
,
0x50
)
__ASM_CFI_REG_IS_AT1
(
rbp
,
rbp
,
0x00
)
#ifdef __linux__
"testl $12,%r14d
\n\t
"
/* SYSCALL_HAVE_PTHREAD_TEB | SYSCALL_HAVE_WRFSGSBASE */
"jz 2f
\n\t
"
"movq %gs:0x320,%rsi
\n\t
"
/* amd64_thread_data()->pthread_teb */
"testl $8,%r14d
\n\t
"
/* SYSCALL_HAVE_WRFSGSBASE */
"jz 1f
\n\t
"
"wrfsbase %rsi
\n\t
"
"jmp 2f
\n
"
"1:
\t
mov $0x1002,%edi
\n\t
"
/* ARCH_SET_FS */
"mov $158,%eax
\n\t
"
/* SYS_arch_prctl */
"syscall
\n\t
"
"leaq -0x98(%rbp),%rcx
\n
"
"2:
\n\t
"
#endif
"movq 0x28(%rsp),%r12
\n\t
"
/* 5th argument */
"movq 0x30(%rsp),%r13
\n\t
"
/* 6th argument */
"leaq 0x38(%rsp),%r
si
\n\t
"
/* 7th argument */
"leaq 0x38(%rsp),%r
15
\n\t
"
/* 7th argument */
/* switch to kernel stack */
"movq %rcx,%rsp
\n\t
"
/* we're now on the kernel stack, stitch unwind info with previous frame */
...
...
@@ -2696,6 +2682,20 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
__ASM_CFI
(
".cfi_offset %r15,-0x38
\n\t
"
)
__ASM_CFI
(
".cfi_undefined %rdi
\n\t
"
)
__ASM_CFI
(
".cfi_undefined %rsi
\n\t
"
)
#ifdef __linux__
"testl $12,%r14d
\n\t
"
/* SYSCALL_HAVE_PTHREAD_TEB | SYSCALL_HAVE_WRFSGSBASE */
"jz 2f
\n\t
"
"movq %gs:0x320,%rsi
\n\t
"
/* amd64_thread_data()->pthread_teb */
"testl $8,%r14d
\n\t
"
/* SYSCALL_HAVE_WRFSGSBASE */
"jz 1f
\n\t
"
"wrfsbase %rsi
\n\t
"
"jmp 2f
\n
"
"1:
\t
mov $0x1002,%edi
\n\t
"
/* ARCH_SET_FS */
"mov $158,%eax
\n\t
"
/* SYS_arch_prctl */
"syscall
\n\t
"
"leaq -0x98(%rbp),%rcx
\n
"
"2:
\n\t
"
#endif
"movq 0x00(%rcx),%rax
\n\t
"
"movq 0x18(%rcx),%r11
\n\t
"
/* 2nd argument */
"movl %eax,%ebx
\n\t
"
...
...
@@ -2719,6 +2719,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"shrq $3,%rcx
\n\t
"
"andq $~15,%rsp
\n\t
"
"movq %rsp,%rdi
\n\t
"
"movq %r15,%rsi
\n\t
"
"cld
\n\t
"
"rep; movsq
\n
"
"1:
\t
movq %r10,%rdi
\n\t
"
/* 1st argument */
...
...
@@ -2873,6 +2874,19 @@ __ASM_GLOBAL_FUNC( __wine_unix_call_dispatcher,
"movdqa %xmm14,0x240(%rcx)
\n\t
"
"movdqa %xmm15,0x250(%rcx)
\n\t
"
"movl 0xb0(%rcx),%r14d
\n\t
"
/* frame->syscall_flags */
/* switch to kernel stack */
"movq %rcx,%rsp
\n\t
"
/* we're now on the kernel stack, stitch unwind info with previous frame */
__ASM_CFI_CFA_IS_AT2
(
rsp
,
0xa8
,
0x01
)
/* frame->syscall_cfa */
__ASM_CFI
(
".cfi_offset %rip,-0x08
\n\t
"
)
__ASM_CFI
(
".cfi_offset %rbp,-0x10
\n\t
"
)
__ASM_CFI
(
".cfi_offset %rbx,-0x18
\n\t
"
)
__ASM_CFI
(
".cfi_offset %r12,-0x20
\n\t
"
)
__ASM_CFI
(
".cfi_offset %r13,-0x28
\n\t
"
)
__ASM_CFI
(
".cfi_offset %r14,-0x30
\n\t
"
)
__ASM_CFI
(
".cfi_offset %r15,-0x38
\n\t
"
)
__ASM_CFI
(
".cfi_undefined %rdi
\n\t
"
)
__ASM_CFI
(
".cfi_undefined %rsi
\n\t
"
)
#ifdef __linux__
"testl $12,%r14d
\n\t
"
/* SYSCALL_HAVE_PTHREAD_TEB | SYSCALL_HAVE_WRFSGSBASE */
"jz 2f
\n\t
"
...
...
@@ -2883,27 +2897,12 @@ __ASM_GLOBAL_FUNC( __wine_unix_call_dispatcher,
"jmp 2f
\n
"
"1:
\t
mov $0x1002,%edi
\n\t
"
/* ARCH_SET_FS */
"mov $158,%eax
\n\t
"
/* SYS_arch_prctl */
"mov %rcx,%r9
\n\t
"
"syscall
\n\t
"
"mov %r9,%rcx
\n\t
"
"2:
\n\t
"
#endif
/* switch to kernel stack */
"movq %rcx,%rsp
\n
"
/* we're now on the kernel stack, stitch unwind info with previous frame */
__ASM_CFI_CFA_IS_AT2
(
rsp
,
0xa8
,
0x01
)
/* frame->syscall_cfa */
__ASM_CFI
(
".cfi_offset %rip,-0x08
\n\t
"
)
__ASM_CFI
(
".cfi_offset %rbp,-0x10
\n\t
"
)
__ASM_CFI
(
".cfi_offset %rbx,-0x18
\n\t
"
)
__ASM_CFI
(
".cfi_offset %r12,-0x20
\n\t
"
)
__ASM_CFI
(
".cfi_offset %r13,-0x28
\n\t
"
)
__ASM_CFI
(
".cfi_offset %r14,-0x30
\n\t
"
)
__ASM_CFI
(
".cfi_offset %r15,-0x38
\n\t
"
)
__ASM_CFI
(
".cfi_undefined %rdi
\n\t
"
)
__ASM_CFI
(
".cfi_undefined %rsi
\n\t
"
)
"movq %r8,%rdi
\n\t
"
/* args */
"callq *(%r10,%rdx,8)
\n\t
"
"movq %rsp,%rcx
\n
"
"movq %rsp,%rcx
\n
\t
"
"movdqa 0x1c0(%rcx),%xmm6
\n\t
"
"movdqa 0x1d0(%rcx),%xmm7
\n\t
"
"movdqa 0x1e0(%rcx),%xmm8
\n\t
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment