Re: [PATCH RESEND] xor: add missing vzeroupper to AVX code

From: Christoph Hellwig

Date: Thu Sep 03 2026 - 01:54:41 EST


On Wed, Sep 02, 2026 at 09:23:59AM -0700, Eric Biggers wrote:
> >
> > Can we do kernel_avx_{begin,end} instead of having to open code
> > and document this everywhere, please?
>
> Again, there are cases in the kernel where both AVX and SSE are used
> within a single kernel-mode FPU section, or where a CPU feature check
> occurs within the section and one or the other is used. So that
> abstraction will not work as-is,

So don't use it for that one case (which I've seen, but make it two or
three and the same still applies), and everyone else gets to use the
easy case.

> and it would be different from all
> userspace code as well.

I don't know how you defined "all". Almost no userspace code has
kernel_fpu_{begin,end} to start with. The one code base I've recently
ported to the kernel that has it, also has kernel_avx_{begin,end}
already.