From: Dave Hansen <dave.hansen@intel.com>
To: Eric Biggers <ebiggers@kernel.org>,
David Laight <david.laight.linux@gmail.com>
Cc: Xiao Liang <shaw.leon@gmail.com>,
x86@kernel.org, linux-crypto@vger.kernel.org,
linux-kernel@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
Ben Greear <greearb@candelatech.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>
Subject: Re: [RFC PATCH 1/2] x86/fpu: make kernel-mode FPU reliably usable in softirqs
Date: Wed, 26 Feb 2025 09:09:39 -0800 [thread overview]
Message-ID: <5fd6c945-9319-4bde-9c0b-3ab864da111c@intel.com> (raw)
In-Reply-To: <20250225225932.GA2975818@google.com>
On 2/25/25 14:59, Eric Biggers wrote:
> If we had to save/restore a large number of vector registers in every crypto
> function call (not amortized to one save/restore per return to userspace), that
> would be a big performance problem.
I just did a quick trace on my laptop. Looks like I have two main
kernel_fpu_begin() users: LUKS and networking. They both very much seem
to do a bunch of kernel_fpu_begin() operations but very few actual XSAVEs:
26 : save_fpregs_to_fpstate <-kernel_fpu_begin_mask
818 : kernel_fpu_begin_mask <-crc32c_pcl_intel_update
4192 : kernel_fpu_begin_mask <-xts_encrypt_vaes_avx10_256
This is at least _one_ data point very much in favor of Eric's argument
here. It appears that that the cost of one XSAVE is amortized across a
bunch of kernel_fpu_begin()s.
next prev parent reply other threads:[~2025-02-26 17:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 5:13 [RFC PATCH 0/2] Eliminate the no-SIMD en/decryption fallbacks on x86 Eric Biggers
2025-02-20 5:13 ` [RFC PATCH 1/2] x86/fpu: make kernel-mode FPU reliably usable in softirqs Eric Biggers
2025-02-21 7:38 ` Xiao Liang
2025-02-21 19:31 ` Eric Biggers
2025-02-25 22:21 ` David Laight
2025-02-25 22:59 ` Eric Biggers
2025-02-26 17:09 ` Dave Hansen [this message]
2025-02-28 3:59 ` Eric Biggers
2025-02-28 12:39 ` Ard Biesheuvel
2025-02-20 5:13 ` [RFC PATCH 2/2] crypto: x86 - stop using the SIMD helper Eric Biggers
2025-02-21 3:53 ` [RFC PATCH 0/2] Eliminate the no-SIMD en/decryption fallbacks on x86 Herbert Xu
2025-02-24 18:57 ` Eric Biggers
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=5fd6c945-9319-4bde-9c0b-3ab864da111c@intel.com \
--to=dave.hansen@intel.com \
--cc=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david.laight.linux@gmail.com \
--cc=ebiggers@kernel.org \
--cc=greearb@candelatech.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=shaw.leon@gmail.com \
--cc=tglx@linutronix.de \
--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
all inboxes | Powered by JetHome®