aboutsummaryrefslogtreecommitdiff
path: root/sys/arch/amd64/machdep.c
diff options
context:
space:
mode:
authorsigsegv7 <ian@vegaa.systems>2023-09-30 09:23:20 -0400
committersigsegv7 <ian@vegaa.systems>2023-09-30 09:23:20 -0400
commitb371c50b2fd724bf9c005d75361952b67dbbd161 (patch)
tree756f28be4cdf20717189dd23c67ea5e5ad9a5e30 /sys/arch/amd64/machdep.c
parentf36625eef934bcee24635ac76a520898881ffb9a (diff)
kernel/amd64: machdep: Enable spectre mitigation
Signed-off-by: sigsegv7 <ian@vegaa.systems>
Diffstat (limited to 'sys/arch/amd64/machdep.c')
-rw-r--r--sys/arch/amd64/machdep.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/arch/amd64/machdep.c b/sys/arch/amd64/machdep.c
index e6088a0..9fd7a12 100644
--- a/sys/arch/amd64/machdep.c
+++ b/sys/arch/amd64/machdep.c
@@ -34,6 +34,7 @@
#include <machine/gdt.h>
#include <machine/ioapic.h>
#include <machine/lapic.h>
+#include <machine/spectre.h>
#define ISR(func) ((uintptr_t)func)
#define INIT_FLAG_IOAPIC 0x00000001U
@@ -75,4 +76,8 @@ processor_init(void)
lapic_init(); /* Per core */
gdt_load(&g_gdtr);
interrupts_init();
+
+ /* Enable spectre mitigation if enabled */
+ if (try_spectre_mitigate != NULL)
+ try_spectre_mitigate();
}