Skip to content

Fix TLS in paranoid interrupt handlers

Jacob Lorentzon requested to merge 4lDO2/kernel:fix_interrupt_handlers into master

This MR adds another GDT entry marked non-present, whose lower 32 bits contain the kernel CPU ID. Paranoid entries, which currently are only NMIs, debug exceptions, and machine checks, will utilize this GDT entry to retrieve the processor ID, and then save+restore IA32_GS_BASE, exploiting the fact that all GDTs are currently in percpu. Note that NMIs which can fault (might be necessary for on-demand paging later) are not yet handled, but doing so would hopefully not require too much logic.

Edited by Jacob Lorentzon

Merge request reports