From: Paolo Bonzini <pbonzini@redhat.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
Dave Hansen <dave.hansen@intel.com>
Cc: Maxim Levitsky <mlevitsk@redhat.com>,
linux-kernel@vger.kernel.org,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<x86@kernel.org>,
"open list:CRYPTO API" <linux-crypto@vger.kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>, Ingo Molnar <mingo@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
"H. Peter Anvin" <hpa@zytor.com>,
Tim Chen <tim.c.chen@linux.intel.com>
Subject: Re: [PATCH] crypto: x86/aes-ni: fix AVX detection
Date: Thu, 4 Nov 2021 11:00:15 +0100 [thread overview]
Message-ID: <3f4bf34f-fdc2-37f7-c789-249f19b0653f@redhat.com> (raw)
In-Reply-To: <20211103145231.GA4485@gondor.apana.org.au>
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
next prev parent reply other threads:[~2021-11-04 10:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-03 12:46 [PATCH] crypto: x86/aes-ni: fix AVX detection Maxim Levitsky
2021-11-03 12:49 ` Maxim Levitsky
2021-11-03 14:43 ` Dave Hansen
2021-11-03 14:52 ` Herbert Xu
2021-11-04 10:00 ` Paolo Bonzini [this message]
2022-06-08 11:29 ` Maxim Levitsky
2022-06-08 14:00 ` Dave Hansen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3f4bf34f-fdc2-37f7-c789-249f19b0653f@redhat.com \
--to=pbonzini@redhat.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=hpa@zytor.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mlevitsk@redhat.com \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@linux.intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox