aboutsummaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorsigsegv7 <ian@vegaa.systems>2023-09-25 05:28:54 -0400
committersigsegv7 <ian@vegaa.systems>2023-09-25 05:30:19 -0400
commitb143f00b1605f588e02349914b6fcb0fd3bab55e (patch)
tree893580beb5c9fe47ffbf58944616c44fb7ac6859 /Makefile.in
parentb46ad8dbf5f8ec212a80a575f0d07e001f825fbf (diff)
kernel/amd64: Add spectre mitigation support
Add spectre mitigation support for AMD64 hosts which may be enabled via the --enable-spectre-mitigation configure flag. This commit currently only adds IBRS support but more techniques may be added later on. Signed-off-by: sigsegv7 <ian@vegaa.systems>
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in16
1 files changed, 15 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index 7f1fa5e..63a0a35 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,5 +1,18 @@
.SILENT:
+
+###############################
+# Feature stuff
+###############################
+override SPECTRE_MITIGATION = @SPECTRE_MITIGATION@
+
+ifeq ($(SPECTRE_MITIGATION), 1)
+ override SPECTRE_FLAGS=-D__SPECTRE_MITIGATION
+else
+ override SPECTRE_FLAGS=
+endif
+
+
###############################
# CFLAGS, QEMU flags + misc
###############################
@@ -9,7 +22,8 @@ override PROMPT := printf "%s\t\t%s\n"
override KERNEL_DEFINES = -DVEGA_VERSION="\"$(VEGA_VERSION)\""\
-DVEGA_BUILDDATE="\"@VEGA_BUILDDATE@\""\
-DVEGA_BUILDBRANCH="\"@VEGA_BUILDBRANCH@\""\
- -DVEGA_ARCH="\"@ARCH@\""
+ -DVEGA_ARCH="\"@ARCH@\""\
+ $(SPECTRE_FLAGS)
override KERNEL_CFLAGS = @KERNEL_CFLAGS@ $(KERNEL_DEFINES)
override KERNEL_LDFLAGS = -nostdlib -zmax-page-size=0x1000 -static -Tconf/link-$(ARCH).ld
override QEMU_FLAGS = @QEMU_FLAGS@