[PATCH 13/18] ntdll: Use syscall frame for YMM context in x86_64 NtGetContextThread.

Paul Gofman pgofman at codeweavers.com
Fri Jan 22 10:21:12 CST 2021


On 1/22/21 18:51, Jacek Caban wrote:
> Signed-off-by: Jacek Caban <jacek at codeweavers.com>
> ---
>  dlls/ntdll/unix/signal_x86_64.c | 32 ++++++++++++++++++++++++++------
>  1 file changed, 26 insertions(+), 6 deletions(-)
>
>
This (together with saving all the basice and XMM registers) looks like
a big overhead on every Nt function call. Is it maybe possible to do
that when explicitly requested only (some option)?

I think we still support processors which don't have AVX and thus don't
have xsave instruction (which is reported as a separate cpuid bit).

Also, to save at least this part, it is possible to use xsavec which
won't be saving anything (aside from the mask) if the ymm high part is
zero (that is, in initial state, which is quite the common case when ymm
regs were not used before the call; compilers even tend to reset higher
part of ymm when done with them). There is
user_shared_data->XState.EnabledFeatures which tells if xsave supported
at all and user_shared_data->XState.CompactionEnabled tells if xsavec is
available.




More information about the wine-devel mailing list