Intel Resurrecting FSGSBASE Support For Linux To Help With Performance
The FSGSBASE instruction allows for reading/write to the FS/GS BASE from any privilege and should help with performance in areas like context switching that has been hurt over the past year and a half due to the likes of Spectre, Meltdown and Foreshadow. User-space programs like Java could also optimize their performance by making use of the FSGSBASE instruction itself to avoid system calls for editing the FS/GS BASE.
Our tests of Intel's FSGSBASE patches from earlier this year confirmed the potential of seeing some minor performance gains particularly in areas affected by the various speculative execution mitigations.
All had been quiet on the FSGSBASE front since the patches were reverted but now a new revision has been volleyed to the kernel mailing list. Also complicating things is that since the patches were rejected, Spectre SWAPGS came to light and warranted changes to this FSGSBASE support.
So with version eight of these patches, there are SWAPGS mitigations to the work and a variety of code fixes to hopefully ease the review and close the previous bugs reported from this code.
But given the timing of this new round of patches, we're unlikely to see the code land for Linux 5.4 with that merge window opening up this weekend. As such, we're unlikely to see this Intel performance-boosting functionality in place until at least Linux 5.5 with that being the first stable kernel release in turn for 2020.