The working kernel source tree may be found here. Relevant paths are:
The patches subdirectory contains the ready to be applied patch on upstream Linux kernel.
The driver is able to perform post-boot (that is after ramstage ends and payload stage starts) SMRAM unlocking, install Linux-owned code in SMRAM, and lock SMRAM again before any additional SMIs start to arrive. For the design flow, please see main README.
- The "trampoline" code is not doing anything apart from acknowledging its existence in SMM and returning to the coreboot's SMI handler. The next step is to implement (in similar fashion to the Linux realmode trampoline) the code that preserves the registers (in whatever their status was in coreboot SMI handler), brings us up to the kernel space, and first then returns to the coreboot's SMI handler. This will allow to benefit from kernel memory protection, and will give more freedom for implementing more features from the kernel space.