]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/common/x86: Init `GS_BASE`/`KERNEL_GS_BASE` in `lcpu_arch_init`
authorSergiu Moga <sergiu@unikraft.io>
Thu, 23 Nov 2023 12:52:10 +0000 (14:52 +0200)
committerSergiu Moga <sergiu@unikraft.io>
Fri, 24 Nov 2023 17:16:10 +0000 (19:16 +0200)
Every LCPU shall have their `GS_BASE` and `KERNEL_GS_BASE` registers
assigned to their own `struct lcpu` element of the `lcpus` array.

Co-authored-by: Marco Schlumpp <marco@unikraft.io>
Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
plat/common/x86/lcpu.c

index 002465a1772640cb4b7cbb7bb66b6a705e13d6c9..fd812f0988b8b09470a1b971d4bc131212922aff 100644 (file)
@@ -39,6 +39,7 @@
 #include <uk/print.h>
 #include <x86/irq.h>
 #include <x86/cpu.h>
+#include <x86/gsbase.h>
 #include <x86/traps.h>
 #include <x86/delay.h>
 #include <uk/plat/common/acpi.h>
@@ -76,6 +77,9 @@ int lcpu_arch_init(struct lcpu *this_lcpu)
 
        traps_lcpu_init(this_lcpu);
 
+       wrkgsbase((__uptr)this_lcpu);
+       wrgsbase((__uptr)this_lcpu);
+
        return 0;
 }