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

@@ -73,4 +73,5 @@ ml_thread_switch_user:
pop %rax
add $16, %rsp
swapgs
iretq