mythos
mythos copied to clipboard
rewrite kernel TLS (aka Core Local Memory)
Mythos uses %gs as offset and the TLS variable's address as base. This allows to work with 32bit GSBASE. However, the remainder of the world does it the other way around with a separate TLS segment generated by the linker. Hence, it is impossible to integrate the GCC stack and pointer guard features into the mythos kernel.
Use the MSRs GSBASE and FSBASE with 64bit pointers instead of the legacy GDT entries. Load sensible values during early boot and when loading the GDT. Make an TLS section in the linker script.
check the use of __seg_fs and __seg_gs named address spaces in clang and GCC ver>6