Messages in this thread | ![/](/images/icornerl.gif) | | Subject | Re: [RFC PATCH v5 1/2] selftests/x86: add xsave test during and after signal handling | From | Dave Hansen <> | Date | Thu, 9 Dec 2021 10:22:42 -0800 |
| |
On 12/2/21 11:32 PM, Pengfei Xu wrote: > +void populate_xstate_regs(void) > +{ > + set_fpu_reg(); > + set_avx2_ymm(); > + set_avx512_opmask(); > + set_pkru_xstate(); > +}
Pengfei, as I mentioned several times, XMM and YMM registers are not preserved across function calls. This only works by chance. The compiler is free to clobber them at basically any time between when they are populated and the XSAVE happens.
| ![\](/images/icornerr.gif) |