Re: [PATCH v2 1/5] perf/x86/intel/lbr: use setup_clear_cpu_cap instead of clear_cpu_cap

From: H. Peter Anvin
Date: Sat Oct 22 2022 - 17:11:09 EST


On October 20, 2022 1:59:48 AM PDT, Borislav Petkov <bp@xxxxxxxxx> wrote:
>On Wed, Sep 28, 2022 at 01:49:34PM +0300, Maxim Levitsky wrote:
>> Patch 5 is the main fix - it makes the kernel to be tolerant to a
>> broken CPUID config (coming hopefully from hypervisor), where you have
>> a feature (AVX2 in my case) but not a feature on which this feature
>> depends (AVX).
>
>I really really don't like it when people are fixing the wrong thing.
>
>Why does the kernel need to get fixed when something else can't get its
>CPUID dependencies straight? I don't even want to know why something
>would set AVX2 without AVX?!?!
>
>Srsly.
>
>Some of your other bits look sensible and I'd take a deeper look but
>this does not make any sense. This is a hypervisor problem - not a
>kernel one.
>
>Thx.
>

Yes, this is utterly nonsensical and it will break user space applications left, right, and center.