]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/uksched: Set bootstrap lcpu's `auxsp` during `uk_sched_start`
authorSergiu Moga <sergiu@unikraft.io>
Wed, 1 Nov 2023 06:57:34 +0000 (08:57 +0200)
committerSergiu Moga <sergiu@unikraft.io>
Sat, 25 Nov 2023 11:07:01 +0000 (13:07 +0200)
Make sure to fill in the value of current lcpu's (bootstrap lcpu in
our case) auxiliary stack pointer with that of the current thread's
(main thread) when initializing scheduling.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
lib/uksched/sched.c

index 7cbcc863e49dfde521620948687da9b3edb3cb18..a656da755a9504bf723722b5ccb1b231cefa1b30 100644 (file)
@@ -232,6 +232,9 @@ int uk_sched_start(struct uk_sched *s)
        /* Set main_thread as current scheduled thread */
        ukplat_per_lcpu_current(__uk_sched_thread_current) = main_thread;
 
+       /* Set current LCPU's Kernel Stack pointer */
+       ukplat_lcpu_set_auxsp(main_thread->auxsp);
+
        /* Add main to the scheduler's thread list */
        UK_TAILQ_INSERT_TAIL(&s->thread_list, main_thread, thread_list);