From 2d7bc823503167276c6d3c40500c3055d4f38938 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 2 Jul 2024 21:19:49 -0400 Subject: kernel/amd64: Handle the user GS segment register This commit introduces usage of swapgs to switch out the GS register with the user GS register. An md_td_kick() function is also introduced to start up user threads. The this_cpu() function uses the GS register to read the current CPU structure using a new "self" field. Signed-off-by: Ian Moffett --- sys/kern/kern_exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern') diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index b21404b..7825448 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -98,11 +98,11 @@ execve(struct proc *td, const struct execve_args *args) setregs(td, &prog, stack_top); /* - * Done, reset flags and yield + * Done, reset flags and start the user thread. * * XXX: PROC_EXEC is unset by the scheduler so it * can properly start the new exec'd program. */ td->flags &= ~PROC_INEXEC; - sched_enter(); + md_td_kick(td); } -- cgit v1.2.3