Re: [RFC PATCH 07/12] perf/x86: Add YMMH in extended regs
From: Dave Hansen
Date: Fri Jun 13 2025 - 11:48:32 EST
On 6/13/25 06:49, kan.liang@xxxxxxxxxxxxxxx wrote:
> size = FXSAVE_SIZE + XSAVE_HDR_SIZE;
>
> + if (x86_pmu.ext_regs_mask & BIT_ULL(X86_EXT_REGS_YMM))
> + size += XSAVE_YMM_SIZE;
Sorry, but this is probably buggy too:
> The value returned by ECX[1] indicates the alignment of state
> component i when the compacted format of the extended region of an
> XSAVE area is used (see Section 13.4.3).
You can't simply stack all the sizes on top of each other. You have to
align some of the components individually to a 64-byte boundary. It
works for the large components because they're multiples of 64 bytes
already.