Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
ba1e2d5d
Commit
ba1e2d5d
authored
Feb 01, 2024
by
Paul Gofman
Committed by
Alexandre Julliard
Feb 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Mind context compaction mask in context_from_server().
parent
631a43c5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
24 deletions
+6
-24
signal_i386.c
dlls/ntdll/unix/signal_i386.c
+2
-15
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+0
-5
thread.c
dlls/ntdll/unix/thread.c
+4
-4
No files found.
dlls/ntdll/unix/signal_i386.c
View file @
ba1e2d5d
...
@@ -607,7 +607,6 @@ struct xcontext
...
@@ -607,7 +607,6 @@ struct xcontext
{
{
CONTEXT
c
;
CONTEXT
c
;
CONTEXT_EX
c_ex
;
CONTEXT_EX
c_ex
;
ULONG64
host_compaction_mask
;
};
};
static
inline
XSAVE_AREA_HEADER
*
xstate_from_context
(
const
CONTEXT
*
context
)
static
inline
XSAVE_AREA_HEADER
*
xstate_from_context
(
const
CONTEXT
*
context
)
...
@@ -831,11 +830,7 @@ static inline void save_context( struct xcontext *xcontext, const ucontext_t *si
...
@@ -831,11 +830,7 @@ static inline void save_context( struct xcontext *xcontext, const ucontext_t *si
context
->
ContextFlags
|=
CONTEXT_FLOATING_POINT
|
CONTEXT_EXTENDED_REGISTERS
;
context
->
ContextFlags
|=
CONTEXT_FLOATING_POINT
|
CONTEXT_EXTENDED_REGISTERS
;
memcpy
(
context
->
ExtendedRegisters
,
fpux
,
sizeof
(
*
fpux
)
);
memcpy
(
context
->
ExtendedRegisters
,
fpux
,
sizeof
(
*
fpux
)
);
if
(
!
fpu
)
fpux_to_fpu
(
&
context
->
FloatSave
,
fpux
);
if
(
!
fpu
)
fpux_to_fpu
(
&
context
->
FloatSave
,
fpux
);
if
(
xstate_extended_features
()
&&
(
xs
=
XState_sig
(
fpux
)))
if
(
xstate_extended_features
()
&&
(
xs
=
XState_sig
(
fpux
)))
context_init_xstate
(
context
,
xs
);
{
context_init_xstate
(
context
,
xs
);
xcontext
->
host_compaction_mask
=
xs
->
CompactionMask
;
}
}
}
if
(
!
fpu
&&
!
fpux
)
save_fpu
(
context
);
if
(
!
fpu
&&
!
fpux
)
save_fpu
(
context
);
}
}
...
@@ -876,15 +871,7 @@ static inline void restore_context( const struct xcontext *xcontext, ucontext_t
...
@@ -876,15 +871,7 @@ static inline void restore_context( const struct xcontext *xcontext, ucontext_t
SS_sig
(
sigcontext
)
=
context
->
SegSs
;
SS_sig
(
sigcontext
)
=
context
->
SegSs
;
if
(
fpu
)
*
fpu
=
context
->
FloatSave
;
if
(
fpu
)
*
fpu
=
context
->
FloatSave
;
if
(
fpux
)
if
(
fpux
)
memcpy
(
fpux
,
context
->
ExtendedRegisters
,
sizeof
(
*
fpux
)
);
{
XSAVE_AREA_HEADER
*
xs
;
memcpy
(
fpux
,
context
->
ExtendedRegisters
,
sizeof
(
*
fpux
)
);
if
(
xstate_extended_features
()
&&
(
xs
=
XState_sig
(
fpux
)))
xs
->
CompactionMask
=
xcontext
->
host_compaction_mask
;
}
if
(
!
fpu
&&
!
fpux
)
restore_fpu
(
context
);
if
(
!
fpu
&&
!
fpux
)
restore_fpu
(
context
);
}
}
...
...
dlls/ntdll/unix/signal_x86_64.c
View file @
ba1e2d5d
...
@@ -479,7 +479,6 @@ struct xcontext
...
@@ -479,7 +479,6 @@ struct xcontext
{
{
CONTEXT
c
;
CONTEXT
c
;
CONTEXT_EX
c_ex
;
CONTEXT_EX
c_ex
;
ULONG64
host_compaction_mask
;
};
};
static
inline
XSAVE_AREA_HEADER
*
xstate_from_context
(
const
CONTEXT
*
context
)
static
inline
XSAVE_AREA_HEADER
*
xstate_from_context
(
const
CONTEXT
*
context
)
...
@@ -907,7 +906,6 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex
...
@@ -907,7 +906,6 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex
* just reference sigcontext without overflowing 32 bit XState.Offset */
* just reference sigcontext without overflowing 32 bit XState.Offset */
context_init_xstate
(
context
,
xs
);
context_init_xstate
(
context
,
xs
);
assert
(
xcontext
->
c_ex
.
XState
.
Offset
==
(
BYTE
*
)
xs
-
(
BYTE
*
)
&
xcontext
->
c_ex
);
assert
(
xcontext
->
c_ex
.
XState
.
Offset
==
(
BYTE
*
)
xs
-
(
BYTE
*
)
&
xcontext
->
c_ex
);
xcontext
->
host_compaction_mask
=
xs
->
CompactionMask
;
}
}
}
}
}
}
...
@@ -921,7 +919,6 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex
...
@@ -921,7 +919,6 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex
static
void
restore_context
(
const
struct
xcontext
*
xcontext
,
ucontext_t
*
sigcontext
)
static
void
restore_context
(
const
struct
xcontext
*
xcontext
,
ucontext_t
*
sigcontext
)
{
{
const
CONTEXT
*
context
=
&
xcontext
->
c
;
const
CONTEXT
*
context
=
&
xcontext
->
c
;
XSAVE_AREA_HEADER
*
xs
;
amd64_thread_data
()
->
dr0
=
context
->
Dr0
;
amd64_thread_data
()
->
dr0
=
context
->
Dr0
;
amd64_thread_data
()
->
dr1
=
context
->
Dr1
;
amd64_thread_data
()
->
dr1
=
context
->
Dr1
;
...
@@ -931,8 +928,6 @@ static void restore_context( const struct xcontext *xcontext, ucontext_t *sigcon
...
@@ -931,8 +928,6 @@ static void restore_context( const struct xcontext *xcontext, ucontext_t *sigcon
amd64_thread_data
()
->
dr7
=
context
->
Dr7
;
amd64_thread_data
()
->
dr7
=
context
->
Dr7
;
set_sigcontext
(
context
,
sigcontext
);
set_sigcontext
(
context
,
sigcontext
);
if
(
FPU_sig
(
sigcontext
))
*
FPU_sig
(
sigcontext
)
=
context
->
FltSave
;
if
(
FPU_sig
(
sigcontext
))
*
FPU_sig
(
sigcontext
)
=
context
->
FltSave
;
if
(
xstate_extended_features
()
&&
(
xs
=
XState_sig
(
FPU_sig
(
sigcontext
))))
xs
->
CompactionMask
=
xcontext
->
host_compaction_mask
;
leave_handler
(
sigcontext
);
leave_handler
(
sigcontext
);
}
}
...
...
dlls/ntdll/unix/thread.c
View file @
ba1e2d5d
...
@@ -691,7 +691,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
...
@@ -691,7 +691,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
XSTATE
*
xs
=
(
XSTATE
*
)((
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
XSTATE
*
xs
=
(
XSTATE
*
)((
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
xs
->
Mask
&=
~
4
;
xs
->
Mask
&=
~
4
;
if
(
user_shared_data
->
XState
.
CompactionEnabled
)
xs
->
CompactionMask
=
0x8000000000000004
;
if
(
xs
->
CompactionMask
)
xs
->
CompactionMask
=
0x8000000000000004
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
from
->
ymm
.
regs
.
ymm_high
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
from
->
ymm
.
regs
.
ymm_high
);
i
++
)
{
{
if
(
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
low
&&
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
high
)
continue
;
if
(
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
low
&&
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
high
)
continue
;
...
@@ -765,7 +765,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
...
@@ -765,7 +765,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
XSTATE
*
xs
=
(
XSTATE
*
)((
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
XSTATE
*
xs
=
(
XSTATE
*
)((
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
xs
->
Mask
&=
~
4
;
xs
->
Mask
&=
~
4
;
if
(
user_shared_data
->
XState
.
CompactionEnabled
)
xs
->
CompactionMask
=
0x8000000000000004
;
if
(
xs
->
CompactionMask
)
xs
->
CompactionMask
=
0x8000000000000004
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
from
->
ymm
.
regs
.
ymm_high
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
from
->
ymm
.
regs
.
ymm_high
);
i
++
)
{
{
if
(
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
low
&&
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
high
)
continue
;
if
(
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
low
&&
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
high
)
continue
;
...
@@ -840,7 +840,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
...
@@ -840,7 +840,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
XSTATE
*
xs
=
(
XSTATE
*
)((
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
XSTATE
*
xs
=
(
XSTATE
*
)((
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
xs
->
Mask
&=
~
4
;
xs
->
Mask
&=
~
4
;
if
(
user_shared_data
->
XState
.
CompactionEnabled
)
xs
->
CompactionMask
=
0x8000000000000004
;
if
(
xs
->
CompactionMask
)
xs
->
CompactionMask
=
0x8000000000000004
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
from
->
ymm
.
regs
.
ymm_high
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
from
->
ymm
.
regs
.
ymm_high
);
i
++
)
{
{
if
(
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
low
&&
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
high
)
continue
;
if
(
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
low
&&
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
high
)
continue
;
...
@@ -922,7 +922,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
...
@@ -922,7 +922,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
XSTATE
*
xs
=
(
XSTATE
*
)((
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
XSTATE
*
xs
=
(
XSTATE
*
)((
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
xs
->
Mask
&=
~
4
;
xs
->
Mask
&=
~
4
;
if
(
user_shared_data
->
XState
.
CompactionEnabled
)
xs
->
CompactionMask
=
0x8000000000000004
;
if
(
xs
->
CompactionMask
)
xs
->
CompactionMask
=
0x8000000000000004
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
from
->
ymm
.
regs
.
ymm_high
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
from
->
ymm
.
regs
.
ymm_high
);
i
++
)
{
{
if
(
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
low
&&
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
high
)
continue
;
if
(
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
low
&&
!
from
->
ymm
.
regs
.
ymm_high
[
i
].
high
)
continue
;
...
...
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