Re: [PATCH 2/4] KVM: x86: Advertise AMX CPUIDs in subleaf 0x1E.0x1 to userspace
From: Sean Christopherson
Date: Tue Jul 21 2026 - 18:03:30 EST
On Wed, Jul 15, 2026, Jim Mattson wrote:
> On Sat, Jan 24, 2026 at 11:25 PM Zhao Liu <zhao1.liu@xxxxxxxxx> wrote:
> >
> > > Unless someone feels *very* strongly about the "mirror" terminology, I'm going to
> > > use ALIAS instead of MIRROR when applying, to match KVM's existing terminology for
> > > the 8000_0001.EDX => 1.EDX aliases.
> > >
> > > /*
> > > * Intel-defined sub-features, CPUID level 0x0000001E:1 (EAX). Note, several
> > > * of the bits are aliases to features of the same name that are enumerated via
> > > * various CPUID.0x7 sub-leafs.
> > > */
> > > #define X86_FEATURE_AMX_INT8_ALIAS KVM_X86_FEATURE(CPUID_1E_1_EAX, 0)
> > > #define X86_FEATURE_AMX_BF16_ALIAS KVM_X86_FEATURE(CPUID_1E_1_EAX, 1)
> > > #define X86_FEATURE_AMX_COMPLEX_ALIAS KVM_X86_FEATURE(CPUID_1E_1_EAX, 2)
> > > #define X86_FEATURE_AMX_FP16_ALIAS KVM_X86_FEATURE(CPUID_1E_1_EAX, 3)
> >
> > LGTM, yes, ALIAS sounds better than MIRROR.
>
> Our friendly AI reviewer asks: given that these are aliases, shouldn't
> they be hidden from the guest if the features they alias to are hidden
> (e.g. clearcpuid=amx_int8).
Eh, clearcpuid taints the kernel and is quite firmly "experts only" functionality.
And practically speaking, clearing things like amx_int8 can't work because it won't
hide the feature from host userspace doing raw CPUID.