Re: [PATCH] x86/fpu: Fix potential NULL dereference in avx512_status()

From: Dave Hansen
Date: Mon Jul 21 2025 - 10:10:53 EST


On 7/18/25 16:48, Sohil Mehta wrote:
> + /* Do not report AVX512 usage for kernel threads */
> + if (!(task->flags & (PF_KTHREAD | PF_USER_WORKER)))
> + timestamp = READ_ONCE(x86_task_fpu(task)->avx512_timestamp);

But the original reason that folks wanted this was so they can go find
all the AVX-512 users and cluster them together. They obviously can't do
that today if they're oopsing their kernels.

But the real question to ask here is whether kernel threads can use
AVX-512, and whether it's important to let userspace know which threads
are using it.

Let's fix the oops, then circle around and figure out whether tracking
AVX-512 use in kernel threads is needed.