[PATCH 2/8] um: Check for missing AVX and AVX-512 xstate bits
David Laight
david.laight.linux at gmail.com
Fri Jun 26 14:33:31 PDT 2026
On Fri, 26 Jun 2026 20:55:44 +0000
Eric Biggers <ebiggers at kernel.org> wrote:
> On Fri, Jun 26, 2026 at 11:49:57AM +0100, David Laight wrote:
> > > UML is just another userland application from this perspective, so
> > > there is no reason for it to behave any different from the rest of
> > > the userland.
>
> Which is why it should do the XCR0 check that the vast majority of
> userspace programs do, right? It has always been part of the documented
> way to detect AVX and AVX-512 support.
That and looking at the other 'cpuid' registers rather than reading
/proc/cpuinfo.
If you want to run 'um' on (say) NetBSD you'd need to do it differently.
> (I think this helps explain why LLMs notice this too. They've been
> trained on lots of code that does it correctly.)
>
> That being said, it does seem likely that it's basically obsolete now.
> So maybe we could take a shortcut and omit it.
It would need the linux kernel to report a cpu feature that needed
kernel support, but that the kernel didn't support.
But for things like popcnt um should probably check the relevant cpuid bit
rather than scanning /proc/cpuinfo.
>
> The important thing is really that we make a definitive decision *once*
> for each of UML and native x86. The status quo is that the decision is
> instead punted to every individual AVX optimized function in the kernel,
> which isn't working well.
Indeed.
David
>
> - Eric
More information about the linux-um
mailing list