x86_64: implement proper user/kernel %gs base switching

the %gs base address is now always set to the current cpu block while
in kernel-mode, and is switched back to the userspace %gs base
when returning to user-mode.
This commit is contained in:
2026-02-23 18:26:21 +00:00
parent 273557fa9f
commit dbe117135b
4 changed files with 47 additions and 15 deletions

View File

@@ -3,7 +3,8 @@
#include <stdint.h>
#define MSR_GS_BASE 0xC0000101
#define MSR_GS_BASE 0xC0000101
#define MSR_KERNEL_GS_BASE 0xC0000102
#ifdef __cplusplus
extern "C" {