Intel Sends Out Initial Linux Kernel Patches For FRED
This morning an initial request for comments (RFC) set of 32 patches were sent out for enabling the Intel Flexible Return and Event Delivery (FRED) functionality within the Linux kernel. As a refresher on the feature, Intel engineers summed up FRED as:
The Intel flexible return and event delivery (FRED) architecture defines simple new transitions that change privilege level (ring transitions). The FRED architecture was designed with the following goals:
1) Improve overall performance and response time by replacing event delivery through the interrupt descriptor table (IDT event delivery) and event return by the IRET instruction with lower latency transitions.
2) Improve software robustness by ensuring that event delivery establishes the full supervisor context and that event return establishes the full user context.
The new transitions defined by the FRED architecture are FRED event delivery and, for returning from events, two FRED return instructions. FRED event delivery can effect a transition from ring 3 to ring 0, but it is used also to deliver events incident to ring 0. One FRED instruction (ERETU) effects a return from ring 0 to ring 3, while the other (ERETS) returns while remaining in ring 0.
In addition to these transitions, the FRED architecture defines a new instruction (LKGS) for managing the state of the GS segment register. The LKGS instruction can be used by 64-bit operating systems that do not use the new FRED transitions.
Simply put, FRED is basically about lower-latency transitions between CPU privilege levels. This FRED Linux kernel work follows Intel in October having published Linux patches for LKGS, a new instruction that is part of FRED but can also be used independent of FRED being enabled.
Intel has maintained FRED documentation for those interested in learning more about this feature coming with future generation processors.
The current RFC patch series amounts to around one thousand lines of new code for enabling the Intel Flexible Return and Event Delivery for Linux. The patches are now public for undergoing review and their eventual upstreaming into the Linux kernel. As usual, Intel has sent these patches out early and well in advance of any CPUs being released with FRED to allow sufficient time for review and inclusion upstream before (ideally) shipping products.