Show Your Support: Did you know that you can get Phoronix Premium for under $4 per month? Try it today to view our site ad-free, multi-page articles on a single page, and more while the proceeds allow us to write more Linux hardware reviews. At the very least, please disable your ad-blocker.
Linux Kernel Prepping To Make Use Of Intel's New SERIALIZE Instruction
On Sunday a patch series was sent out by an Intel Linux engineer for making use of the Intel SERIALIZE instruction within the kernel's sync_core() function. Linux's sync_core function is called for stopping the speculative execution and prefetching of modified code.
Sync_core has traditionally used CPUID within this function but there are complications with that or using IRET-to-self works on newer CPUs but is slower. Or come Sapphire Rapids and Alder Lake this new SERIALIZE instruction can be used. The performance cost of this new SERIALIZE instruction will be interesting to see in practice.
The patch notes one of the benefits of using SERIALIZE is that there are no "side effects" like clobbering of registers or exiting to a hypervisor.
Thus the work is moving forward for the Linux kernel to begin making use of SERIALIZE. The SERIALIZE instruction can also be used from user mode as well so we'll see how well adopted this instruction is by the time Sapphire Rapids and Alder Lake finally ship.
Three of the four patches in this series have already been queued up in x86/cpu as prep work while the actual SERIALIZE patch within sync_core() was said by x86/cpu maintainer Ingo Molnar as still needing more work before it will be ready. Thus the SERIALIZE usage might not make it into the upcoming Linux 5.9 cycle but come for a later release, which still should be fine given the timing of Alder Lake and Sapphire Rapids.