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
014f249a
Commit
014f249a
authored
Feb 24, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Don't use FeatureSet for XSAVE compaction support flag.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
43900dd6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
10 deletions
+12
-10
signal_i386.c
dlls/ntdll/unix/signal_i386.c
+2
-2
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+4
-5
system.c
dlls/ntdll/unix/system.c
+3
-1
unix_private.h
dlls/ntdll/unix/unix_private.h
+2
-0
winternl.h
include/winternl.h
+1
-2
No files found.
dlls/ntdll/unix/signal_i386.c
View file @
014f249a
...
...
@@ -716,7 +716,7 @@ static inline NTSTATUS save_xstate( CONTEXT *context )
||
context_ex
->
XState
.
Length
>
sizeof
(
XSTATE
))
return
STATUS_INVALID_PARAMETER
;
if
(
user_shared_data
->
XState
.
CompactionE
nabled
)
if
(
xstate_compaction_e
nabled
)
{
/* xsavec doesn't use anything from the save area. */
__asm__
volatile
(
"xsavec %0"
:
"=m"
(
xsave_area
)
...
...
@@ -1650,7 +1650,7 @@ C_ASSERT( (offsetof(struct stack_layout, xstate) == sizeof(struct stack_layout))
assert
(
!
((
ULONG_PTR
)
dst_xs
&
63
));
context_init_xstate
(
&
stack
->
context
,
stack
->
xstate
);
memset
(
dst_xs
,
0
,
offsetof
(
XSTATE
,
YmmContext
)
);
dst_xs
->
CompactionMask
=
user_shared_data
->
XState
.
CompactionE
nabled
?
0x8000000000000004
:
0
;
dst_xs
->
CompactionMask
=
xstate_compaction_e
nabled
?
0x8000000000000004
:
0
;
if
(
src_xs
->
Mask
&
4
)
{
dst_xs
->
Mask
=
4
;
...
...
dlls/ntdll/unix/signal_x86_64.c
View file @
014f249a
...
...
@@ -1959,16 +1959,15 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
{
struct
syscall_xsave
*
xsave
=
get_syscall_xsave
(
frame
);
CONTEXT_EX
*
context_ex
=
(
CONTEXT_EX
*
)(
context
+
1
);
const
BOOL
compaction_enabled
=
user_shared_data
->
XState
.
CompactionEnabled
;
unsigned
int
mask
;
if
(
context_ex
->
XState
.
Length
<
offsetof
(
XSTATE
,
YmmContext
)
||
context_ex
->
XState
.
Length
>
sizeof
(
XSTATE
))
return
STATUS_INVALID_PARAMETER
;
mask
=
(
compaction_enabled
?
xstate
->
CompactionMask
:
xstate
->
Mask
)
&
XSTATE_MASK_GSSE
;
mask
=
(
xstate_
compaction_enabled
?
xstate
->
CompactionMask
:
xstate
->
Mask
)
&
XSTATE_MASK_GSSE
;
xstate
->
Mask
=
xsave
->
xstate
.
Mask
&
mask
;
xstate
->
CompactionMask
=
compaction_enabled
?
(
0x8000000000000000
|
mask
)
:
0
;
xstate
->
CompactionMask
=
xstate_
compaction_enabled
?
(
0x8000000000000000
|
mask
)
:
0
;
memset
(
xstate
->
Reserved
,
0
,
sizeof
(
xstate
->
Reserved
)
);
if
(
xstate
->
Mask
)
{
...
...
@@ -2044,7 +2043,7 @@ static void setup_raise_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec
assert
(
!
((
ULONG_PTR
)
dst_xs
&
63
)
);
context_init_xstate
(
&
stack
->
context
,
stack
->
xstate
);
memset
(
dst_xs
,
0
,
offsetof
(
XSTATE
,
YmmContext
)
);
dst_xs
->
CompactionMask
=
user_shared_data
->
XState
.
CompactionE
nabled
?
0x8000000000000004
:
0
;
dst_xs
->
CompactionMask
=
xstate_compaction_e
nabled
?
0x8000000000000004
:
0
;
if
(
src_xs
->
Mask
&
4
)
{
dst_xs
->
Mask
=
4
;
...
...
@@ -2807,7 +2806,7 @@ void *signal_init_syscalls(void)
extern
void
__wine_syscall_dispatcher_xsavec
(
void
)
DECLSPEC_HIDDEN
;
NtQuerySystemInformation
(
SystemCpuInformation
,
&
cpu_info
,
sizeof
(
cpu_info
),
NULL
);
if
(
cpu_info
.
FeatureSet
&
CPU_FEATURE_XSAVEC
)
if
(
xstate_compaction_enabled
)
syscall_dispatcher
=
__wine_syscall_dispatcher_xsavec
;
else
if
(
cpu_info
.
FeatureSet
&
CPU_FEATURE_XSAVE
)
syscall_dispatcher
=
__wine_syscall_dispatcher_xsave
;
...
...
dlls/ntdll/unix/system.c
View file @
014f249a
...
...
@@ -178,6 +178,8 @@ static SYSTEM_CPU_INFORMATION cpu_info;
*/
#if defined(__i386__) || defined(__x86_64__)
BOOL
xstate_compaction_enabled
=
FALSE
;
#define AUTH 0x68747541
/* "Auth" */
#define ENTI 0x69746e65
/* "enti" */
#define CAMD 0x444d4163
/* "cAMD" */
...
...
@@ -308,7 +310,7 @@ static void get_cpuinfo( SYSTEM_CPU_INFORMATION *info )
if
(
info
->
FeatureSet
&
CPU_FEATURE_XSAVE
)
{
do_cpuid
(
0x0000000d
,
regs3
);
/* get XSAVE details */
if
(
regs3
[
0
]
&
2
)
info
->
FeatureSet
|=
CPU_FEATURE_XSAVEC
;
if
(
regs3
[
0
]
&
2
)
xstate_compaction_enabled
=
TRUE
;
}
if
(
regs
[
1
]
==
AUTH
&&
regs
[
3
]
==
ENTI
&&
regs
[
2
]
==
CAMD
)
...
...
dlls/ntdll/unix/unix_private.h
View file @
014f249a
...
...
@@ -307,6 +307,8 @@ struct xcontext
};
#if defined(__i386__) || defined(__x86_64__)
extern
BOOL
xstate_compaction_enabled
DECLSPEC_HIDDEN
;
static
inline
XSTATE
*
xstate_from_context
(
const
CONTEXT
*
context
)
{
CONTEXT_EX
*
xctx
=
(
CONTEXT_EX
*
)(
context
+
1
);
...
...
include/winternl.h
View file @
014f249a
...
...
@@ -1754,14 +1754,13 @@ typedef struct _SYSTEM_CPU_INFORMATION {
/* FIXME: following values are made up, actual flags are unknown */
#define CPU_FEATURE_SSSE3 0x00008000
/* SSSE3 instructions */
#define CPU_FEATURE_XSAVEC 0x00400000
/* XSAVEC instructions */
#define CPU_FEATURE_SSE41 0x01000000
/* SSE41 instructions */
#define CPU_FEATURE_SSE42 0x02000000
/* SSE42 instructions */
#define CPU_FEATURE_AVX 0x40000000
/* AVX instructions */
#define CPU_FEATURE_AVX2 0x80000000
/* AVX2 instructions */
#define CPU_FEATURE_PAE 0x00200000
#define CPU_FEATURE_DAZ 0x00400000
#define CPU_FEATURE_ARM_VFP_32 0x00000001
#define CPU_FEATURE_ARM_NEON 0x00000002
#define CPU_FEATURE_ARM_V8_CRC32 0x00000004
...
...
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