From: Paul Gofman pgofman@codeweavers.com
--- dlls/ntdll/unix/signal_i386.c | 17 ++--------------- dlls/ntdll/unix/signal_x86_64.c | 5 ----- dlls/ntdll/unix/thread.c | 8 ++++---- 3 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 93bcf607f41..1439ee7df97 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -607,7 +607,6 @@ struct xcontext { CONTEXT c; CONTEXT_EX c_ex; - ULONG64 host_compaction_mask; };
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 context->ContextFlags |= CONTEXT_FLOATING_POINT | CONTEXT_EXTENDED_REGISTERS; memcpy( context->ExtendedRegisters, fpux, sizeof(*fpux) ); if (!fpu) fpux_to_fpu( &context->FloatSave, fpux ); - if (xstate_extended_features() && (xs = XState_sig(fpux))) - { - context_init_xstate( context, xs ); - xcontext->host_compaction_mask = xs->CompactionMask; - } + if (xstate_extended_features() && (xs = XState_sig(fpux))) context_init_xstate( context, xs ); } if (!fpu && !fpux) save_fpu( context ); } @@ -876,15 +871,7 @@ static inline void restore_context( const struct xcontext *xcontext, ucontext_t SS_sig(sigcontext) = context->SegSs;
if (fpu) *fpu = context->FloatSave; - if (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 (fpux) memcpy( fpux, context->ExtendedRegisters, sizeof(*fpux) ); if (!fpu && !fpux) restore_fpu( context ); }
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 501ae14cae5..fc5add7c432 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -479,7 +479,6 @@ struct xcontext { CONTEXT c; CONTEXT_EX c_ex; - ULONG64 host_compaction_mask; };
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 * just reference sigcontext without overflowing 32 bit XState.Offset */ context_init_xstate( context, xs ); 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 static void restore_context( const struct xcontext *xcontext, ucontext_t *sigcontext ) { const CONTEXT *context = &xcontext->c; - XSAVE_AREA_HEADER *xs;
amd64_thread_data()->dr0 = context->Dr0; amd64_thread_data()->dr1 = context->Dr1; @@ -931,8 +928,6 @@ static void restore_context( const struct xcontext *xcontext, ucontext_t *sigcon amd64_thread_data()->dr7 = context->Dr7; set_sigcontext( context, sigcontext ); 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 ); }
diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 52cb0f26e97..bd1fbcdbfc2 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -688,7 +688,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma XSTATE *xs = (XSTATE *)((char *)xctx + xctx->XState.Offset);
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++) { if (!from->ymm.regs.ymm_high[i].low && !from->ymm.regs.ymm_high[i].high) continue; @@ -762,7 +762,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma XSTATE *xs = (XSTATE *)((char *)xctx + xctx->XState.Offset);
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++) { if (!from->ymm.regs.ymm_high[i].low && !from->ymm.regs.ymm_high[i].high) continue; @@ -837,7 +837,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma XSTATE *xs = (XSTATE *)((char *)xctx + xctx->XState.Offset);
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++) { if (!from->ymm.regs.ymm_high[i].low && !from->ymm.regs.ymm_high[i].high) continue; @@ -919,7 +919,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma XSTATE *xs = (XSTATE *)((char *)xctx + xctx->XState.Offset);
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++) { if (!from->ymm.regs.ymm_high[i].low && !from->ymm.regs.ymm_high[i].high) continue;