lkml.org 
[lkml]   [2021]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] crypto: x86/aes-ni: fix AVX detection
From
On 11/3/21 15:52, Herbert Xu wrote:
> On Wed, Nov 03, 2021 at 07:43:43AM -0700, Dave Hansen wrote:
>> The kernel shouldn't crash in this case. We've got a software
>> dependency which should disable AVX2 if AVX is off:
> It's qemu, I thought it was a qemu bug but Paulo disagrees.

I don't disagree that QEMU could do better in preventing nonsensical
combinations; however, independent of that you shouldn't use AVX2
without factoring XCR0 in the decision. This is true no matter if
userspace/kernel or even bare metal/virt.

That does not have to be done directly with cpu_has_xfeatures as in
Maxim's patch: if boot_cpu_has(AVX) returns false after
xsave_cpuid_features has filtered it out, or if boot_cpu_has(AVX2)
returns false after cpuid_deps has filtered it out, that's fine. I
guess Maxim can look at the pointers that Dave provided and check if
there's another bug somewhere in arch/x86/kernel.

Paolo

\
 
 \ /
  Last update: 2021-11-04 11:01    [W:0.145 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site