sched: implement user-configurable fs and gs segment base addresses

This commit is contained in:
2026-03-18 21:07:05 +00:00
parent 63703a3d34
commit 24f9ef85bf
14 changed files with 274 additions and 9 deletions

View File

@@ -13,6 +13,22 @@ ml_thread_switch:
push %rax
push %rcx
push %rdx
// set fs-base
mov $0xC0000100, %rcx
movq THREAD_fsbase(%rsi), %rax
movq THREAD_fsbase(%rsi), %rdx
shr $32, %rdx
wrmsr
// set (kernel) gs-base (it will be swapped back into user-gs-base at
// the end of this function)
mov $0xC0000102, %rcx
movq THREAD_gsbase(%rsi), %rax
movq THREAD_gsbase(%rsi), %rdx
shr $32, %rdx
wrmsr
push %rbx
pushq $0
push %rbp