Re: [RFC PATCH v5 1/2] selftests/x86: add xsave test during and after signal handling

From: Dave Hansen
Date: Thu Dec 09 2021 - 13:23:15 EST


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.