From: Sergiu Moga Date: Wed, 1 Nov 2023 07:02:25 +0000 (+0200) Subject: lib/uksched: Update `auxsp` of current LCPU when switching stacks X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3b042bad13a888316d9dd70a528c0d10e362212c;p=unikraft%2Funikraft.git lib/uksched: Update `auxsp` of current LCPU when switching stacks If uksched/ukthread is enabled, make sure that the current LCPU's auxiliary stack pointer is updated to always point to the currently executing thread's auxiliary stack pointer by setting it to that of the thread it is about to switch to during context switching. Signed-off-by: Sergiu Moga --- diff --git a/lib/uksched/include/uk/sched_impl.h b/lib/uksched/include/uk/sched_impl.h index 63f5d3c6f..f953e47d9 100644 --- a/lib/uksched/include/uk/sched_impl.h +++ b/lib/uksched/include/uk/sched_impl.h @@ -106,6 +106,8 @@ void uk_sched_thread_switch(struct uk_thread *next) if (next->ectx) ukarch_ectx_load(next->ectx); + ukplat_lcpu_set_auxsp(next->auxsp); + ukarch_ctx_switch(&prev->ctx, &next->ctx); }