Intel Posts Linux Patches Enabling AMX Use Within KVM Guests
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."
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."
6 Comments