http://bugs.winehq.org/show_bug.cgi?id=58420
--- Comment #6 from pipcet@protonmail.com --- (In reply to pipcet from comment #4)
However, these are new CPUs, so arch_prctl(ARCH_GET_CPUID) might be available, which would let us trap (just) the CPUID instruction and align the reported maximum size of the XSAVE area. I don't know whether that's an option, particularly since the relevant flag is cleared by execve().
That's available on one of the systems I'm testing on (the Intel one), but not the other one (AMD). On the Intel system, the LD_PRELOAD library I've just attached works, without having to modify Wine, MSYS2, or rebooting. However, even though it works in tests, there's a race condition: to execute the real CPUID instruction, we momentarily disable the arch_prctl which traps on other CPUID instructions (so we don't get caught in an infloop). If another thread chooses that moment to execute the problematic CPUID instruction, it'll get the unfixed result...