Re: [PATCH] KVM: x86: Advertise AMX-COMPLEX CPUID to userspace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 02, 2023 at 04:36:10PM -0700, Sean Christopherson wrote:
> On Wed, Aug 02, 2023, Tao Su wrote:
> > Latest Intel platform GraniteRapids-D introduces AMX-COMPLEX, which adds
> > two instructions to perform matrix multiplication of two tiles containing
> > complex elements and accumulate the results into a packed single precision
> > tile.
> > 
> > AMX-COMPLEX is enumerated via CPUID.(EAX=7,ECX=1):EDX[bit 8]
> > 
> > Since there are no new VMX controls or additional host enabling required
> > for guests to use this feature, advertise the CPUID to userspace.
> 
> Nit, I would rather justify this (last paragraph) with something like:
> 
>   Advertise AMX_COMPLEX if it's supported in hardware.  There are no VMX
>   controls for the feature, i.e. the instructions can't be interecepted, and
>   KVM advertises base AMX in CPUID if AMX is supported in hardware, even if
>   KVM doesn't advertise AMX as being supported in XCR0, e.g. because the
>   process didn't opt-in to allocating tile data.
> 
> If the above is accurate and there are no objections, I'll fixup the changelog
> when applying.

Totally agree.

> 
> Side topic, this does make me wonder if advertising AMX when XTILE_DATA isn't
> permitted is a bad idea.  But no one has complained, and chasing down all the
> dependent AMX features would get annoying, so I'm inclined to keep the status quo.

>From the description of AMX exception, there is no CPUID checking and #UD will be produced
if XCR0[18:17] != 0b11. Since user applications should check both the XCR0 and CPUIDs
before using related AMX instructions, I don't think there should be bad effects in keeping
the status quo.

Thanks,
Tao



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux