Intel Preps The Linux Kernel For LKGS - Part Of FRED
Intel on Thursday sent out the initial Linux kernel patches for supporting the LKGS instruction coming with future processors.
LKGS is a new x86_64 instruction Intel originally documented last year as part of FRED, the Flexible Return and Event Delivery specification. The Flexible Return and Event Delivery (FRED) specification overhauls how transitions are handled between privilege levels / CPU rings with goals of allowing lower latency transitions between privilege levels and allowing for more robust software use.
The LKGS instruction is added as part of FRED but also can be supported independent of that change to processor interrupt handling. LKGS is a new instruction for managing the state of the GS segment register in a more flexible manner. LKGS stands for "load into IA32_KERNEL_GS_BASE" and similar to MOV to GS except for loading into the kernel GS base MSR rather than the GS segment's descriptor cache.
LKGS is documented as part of FRED with the specification originally published last year.
These kernel patches out on Thursday add LKGS instruction support by the Linux kernel independent of FRED. Intel engineer Xin Li commented, "LKGS behaves like the MOV to GS instruction except that it loads the base address into the IA32_KERNEL_GS_BASE MSR instead of the GS segment’s descriptor cache, which is exactly what Linux kernel does to load user level GS base. Thus, with LKGS, there is no need to SWAPGS away from the kernel GS base."
I don't believe Intel has publicly commented on when to expect FRED support with their processors, but based on the timing of these patches coming up now, FRED and LKGS might be found with Xeon Scalable "Emerald Rapids" and then Meteor Lake on the client side.
LKGS is a new x86_64 instruction Intel originally documented last year as part of FRED, the Flexible Return and Event Delivery specification. The Flexible Return and Event Delivery (FRED) specification overhauls how transitions are handled between privilege levels / CPU rings with goals of allowing lower latency transitions between privilege levels and allowing for more robust software use.
The LKGS instruction is added as part of FRED but also can be supported independent of that change to processor interrupt handling. LKGS is a new instruction for managing the state of the GS segment register in a more flexible manner. LKGS stands for "load into IA32_KERNEL_GS_BASE" and similar to MOV to GS except for loading into the kernel GS base MSR rather than the GS segment's descriptor cache.
LKGS is documented as part of FRED with the specification originally published last year.
These kernel patches out on Thursday add LKGS instruction support by the Linux kernel independent of FRED. Intel engineer Xin Li commented, "LKGS behaves like the MOV to GS instruction except that it loads the base address into the IA32_KERNEL_GS_BASE MSR instead of the GS segment’s descriptor cache, which is exactly what Linux kernel does to load user level GS base. Thus, with LKGS, there is no need to SWAPGS away from the kernel GS base."
I don't believe Intel has publicly commented on when to expect FRED support with their processors, but based on the timing of these patches coming up now, FRED and LKGS might be found with Xeon Scalable "Emerald Rapids" and then Meteor Lake on the client side.
Add A Comment