Re: [RFC PATCH] x86/fpu/xstate: Add more diagnostic information on inconsistent xstate sizes

From: Dave Hansen
Date: Wed Apr 12 2023 - 10:37:27 EST


On 4/11/23 18:21, Fenghua Yu wrote:
> In other words, splitting max_features into XCR0 and IA32_XSS and
> showing them individually provide more useful debug info than one single
> max_features value.
>
> Does it make sense?

Not to me.

>> I still expect some acknowledgment of what is coded here for the
>> kernel calculation details.
>
> The kernel calculation is shown in
> +        print_xstate_offset_size();
> +        pr_info("x86/fpu: total size: %u bytes\n", size);
>
> Isn't that detailed enough to show offset and size of each xstate and
> sum of sizes?
>
> After that,
> +    pr_info("x86/fpu: kernel_size from CPUID.0xd.0x%x:EBX: %u bytes\n",
> +               compacted ? 1 : 0, kernel_size);
> shows how kernel_size is calculated from CPUID?
>
> Using the above debug info, a real platform CPUID issue is shown clearly.
>
> What other details are needed?

I was kinda hoping this would be a simple, non-controversial patch that
would get us better debugging info the next time that the microcode or a
bad VMM screws up. This patch isn't turning out to be as simple as I hoped.

I was wrong. Let's just drop this.