diff options
author | Ian Moffett <ian@osmora.org> | 2024-07-29 19:41:02 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-07-29 19:41:02 -0400 |
commit | d9ffdf1527a8b8c8289241893f6411b7a84f7347 (patch) | |
tree | 9ccf130032efacb6f1d40f1a87bd0a4366f173a9 /sys/arch/amd64/amd64 | |
parent | a999c41c98e9c11b8ecd74e265c4d1142669b1de (diff) |
kernel/amd64: cpu: Write cpu_info to IA32_GS_BASE
Instead of writing cpu_info to IA32_KERNEL_GS_BASE then using SWAPGS,
write the cpu_info pointer directly to IA32_GS_BASE
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch/amd64/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 2185028..3a1eeb1 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -159,8 +159,7 @@ cpu_startup(struct cpu_info *ci) idt_load(); setup_vectors(); - amd64_write_gs_base((uintptr_t)ci); - __ASMV("swapgs"); /* Get kernel GS */ + wrmsr(IA32_GS_BASE, (uintptr_t)ci); init_tss(ci); try_mitigate_spectre(); |