Intel Posts Linux Patches Enabling AMX Use Within KVM Guests

Written by Michael Larabel in Intel on 8 December 2021 at 12:00 AM EST. 6 Comments
INTEL
One of many exciting features/changes with upcoming Intel Xeon Scalable "Sapphire Rapids" processors is the introduction of Advanced Matrix Extensions (AMX). While initial AMX support is premiering with Linux 5.16 due out in stable form as the start of the new year, it currently doesn't allow for KVM virtualized guests to make use of the new capabilities.

Sent out on Tuesday were the set of patches providing the Linux kernel with KVM support for AMX. Due to the eXtended Feature Disable "XFD" handling and new interface where AMX support actually needs to be requested by the user-space software / application before use and other changes compared to just checking on the presence of a CPU feature bit, enabling AMX support for Kernel-based Virtual Machine guests is more involved than say AVX and other prior features.


The current series amounts to 19 patches and includes changes for guest permissions for dynamically-enabled XSAVE features, extending the FP state re-allocation mechanism to cover the guest FPU, and other associated changes. Still being handled is live migration support in the context of AMX usage.

See this patch series for the details on supporting AMX within KVM.

Adding AMX support to KVM shouldn't impair the non-AMX usage or performance. As noted in the patches, "To verify AMX virtualization overhead on non-AMX usages, we run the Phoronix kernel build test in the guest w/ and w/o AMX in cpuid. The result shows no observable difference between two configurations."
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week