]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/uksched: Update `auxsp` of current LCPU when switching stacks
authorSergiu Moga <sergiu@unikraft.io>
Wed, 1 Nov 2023 07:02:25 +0000 (09:02 +0200)
committerSergiu Moga <sergiu@unikraft.io>
Sat, 25 Nov 2023 11:07:01 +0000 (13:07 +0200)
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 <sergiu@unikraft.io>
lib/uksched/include/uk/sched_impl.h

index 63f5d3c6f550e04fbfbdcdc0a757c0a2b81e28d2..f953e47d98f09d72d82ce4ffeb9ed4ea7f8fc36a 100644 (file)
@@ -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);
 }