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

Maxim Levitsky
2022-10-20T10:24:16Z

On Thu, 2022-10-20 at 17:05 +0800, Herbert Xu wrote:
> On Thu, Oct 20, 2022 at 10:59:48AM +0200, Borislav Petkov wrote:
> > 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?!?!
>
> That's exactly what I said when this was first reported to me as
> a crypto bug :)

I agree with you, however this patch series is just refactoring/hardening of the kernel -
if the kernel can avoid crashing - why not.

Of course the hypervisor should not present such broken configurations to the guest -
in fact the guest kernel can't fix this - guest userspace will still see wrong CPUID and
can still crash.

TL;DR - this patch series is not intended to workaround a broken hypervisor and such,
it is just a hardening against misconfiguration.

Best regards,
Maxim Levitsky

>
> Cheers,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
>