From: Sergiu Moga Date: Wed, 1 Nov 2023 06:57:34 +0000 (+0200) Subject: lib/uksched: Set bootstrap lcpu's `auxsp` during `uk_sched_start` X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=aa96b824b4aa1a0e8bc9b59eafb951c458830d49;p=unikraft%2Funikraft.git lib/uksched: Set bootstrap lcpu's `auxsp` during `uk_sched_start` 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 --- diff --git a/lib/uksched/sched.c b/lib/uksched/sched.c index 7cbcc863e..a656da755 100644 --- a/lib/uksched/sched.c +++ b/lib/uksched/sched.c @@ -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);