The Linux crew has revealed an intermediate Linux 6.13-rc3 to restore a “hilarious” bug inside the kernel-based Digital Machine code — Phoronix experiences, the place CPUID updates are taking significantly longer time to be processed on Sapphire Rapids CPUs than they should be, resulting in loads older Skylake CPUs being as a lot as 4X sooner with regard to CPUID worth.
Phoronix reveals that Google engineers initially discovered this technical problem in how Sapphire Rapids processes CPUID information in nested VMs. Notably, Google’s Sean Christopherson states, “On Intel’s Emerald Rapids, CPUID is *wildly* pricey, to the aim the place recomputing XSAVE offsets and sizes ends in a 4x enhance in latency of nested VM-Enter and VM-Exit (nested transitions can set off xstate_required_size() quite a few situations per transition), relative to using cached values. The issue is unquestionably seen by working `perf prime` whereas triggering nested transitions: kvm_update_cpuid_runtime() reveals up at a whopping 50%…”
This effectivity bug/regression is not going to be purportedly mounted until Linux 6.14, nonetheless the issue is excessive adequate for the Linux devs to restore the outgoing Linux 6.13 kernel shortly. Substitute 6.13-rc3 caches the CPUID information on Sapphire Quick CPUs, dashing up this course of. The Linux 6.14 implementation of the entire restore will result in the entire CPUIDs nested in VM-Enter and VM-Exit being absolutely deleted.
For these unaware, CPUID is an instruction that lets software program program uncover particulars of the processor it is engaged on. On Sapphire Rapids, the software program program finding out CPU information by way of the CPUID instruction takes as a lot as 4X longer than on loads older Skylake CPUs. This solely occurs inside nested virtualization transitions, which solely happen when a VM runs inside a VM.
The Linux 6.13-rc3 comes with assorted totally different bug/regression fixes. However, the caching workaround for pricey CPUID coping with appears to be one among many additional important updates to the kernel. As soon as extra, this caching methodology is just a workaround, with Linux 6.14’s full restore for the issue.