summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2021-07-19 16:10:00 +0000
committerAndy Fiddaman <omnios@citrus-it.co.uk>2021-07-22 22:54:32 +0000
commit72c7ebd9d162dc4cbe1844d12b6b120771c46960 (patch)
treee165bae95032ae6813acd99185e9b38b87e52046
parent0a8fc1cbac5c0b540cc1948761e1ea321879e522 (diff)
downloadillumos-joyent-72c7ebd9d162dc4cbe1844d12b6b120771c46960.tar.gz
13958 kpti_trampolines.s fails to assemble with binutils 2.37
Reviewed by: Robert Mustacchi <rm@fingolfin.org> Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Alex Wilson <alex@cooperi.net> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/uts/i86pc/ml/kpti_trampolines.s2
-rw-r--r--usr/src/uts/i86pc/sys/machprivregs.h12
-rw-r--r--usr/src/uts/i86xpv/sys/machprivregs.h14
3 files changed, 26 insertions, 2 deletions
diff --git a/usr/src/uts/i86pc/ml/kpti_trampolines.s b/usr/src/uts/i86pc/ml/kpti_trampolines.s
index dd4d4a8afd..4b5102d547 100644
--- a/usr/src/uts/i86pc/ml/kpti_trampolines.s
+++ b/usr/src/uts/i86pc/ml/kpti_trampolines.s
@@ -407,7 +407,7 @@ tr_sysc_ret_start:
2:
swapgs
sti
- sysexit
+ SYSEXITL
SET_SIZE(tr_sysexit)
.global tr_sysc_ret_end
diff --git a/usr/src/uts/i86pc/sys/machprivregs.h b/usr/src/uts/i86pc/sys/machprivregs.h
index faaecfc914..a66577646d 100644
--- a/usr/src/uts/i86pc/sys/machprivregs.h
+++ b/usr/src/uts/i86pc/sys/machprivregs.h
@@ -78,6 +78,18 @@ extern "C" {
#define SYSRETL sysretl
#define SWAPGS swapgs
+/*
+ * As of GNU binutils 2.37, the assembler has split the 'sysexit' instruction
+ * into 'sysexitl' and 'sysexitq'. Using a plain 'sysexit' is interpreted as
+ * 'sysexitl' but comes with a warning about the assumption being made. Since
+ * all warnings are treated as errors in the kernel build, this results in a
+ * build failure. Unfortunately the desired 'sysexitl' cannot be used since
+ * older versions of the GNU assembler do not understand it.
+ * The following macro emits the correct byte sequence for 'sysexitl' on this
+ * platform.
+ */
+#define SYSEXITL .byte 0x0f, 0x35
+
#elif defined(__i386)
#define IRET iret
diff --git a/usr/src/uts/i86xpv/sys/machprivregs.h b/usr/src/uts/i86xpv/sys/machprivregs.h
index 64780f0c4e..eb8ec76b8d 100644
--- a/usr/src/uts/i86xpv/sys/machprivregs.h
+++ b/usr/src/uts/i86xpv/sys/machprivregs.h
@@ -213,7 +213,7 @@ extern "C" {
pushq %r8; \
pushq %r9; \
pushq %r10; \
- TRAP_INSTR; /* clear upcall mask, force upcall */ \
+ TRAP_INSTR; /* clear upcall mask, force upcall */ \
popq %r10; \
popq %r9; \
popq %r8; \
@@ -386,6 +386,18 @@ extern "C" {
#define SYSRETL ud2 /* 32-bit syscall/sysret not supported */
#define SWAPGS /* empty - handled in hypervisor */
+/*
+ * As of GNU binutils 2.37, the assembler has split the 'sysexit' instruction
+ * into 'sysexitl' and 'sysexitq'. Using a plain 'sysexit' is interpreted as
+ * 'sysexitl' but comes with a warning about the assumption being made. Since
+ * all warnings are treated as errors in the kernel build, this results in a
+ * build failure. Unfortunately the desired 'sysexitl' cannot be used since
+ * older versions of the GNU assembler do not understand it.
+ * The following macro emits the correct byte sequence for 'sysexitl' on this
+ * platform.
+ */
+#define SYSEXITL .byte 0x0f, 0x35
+
#elif defined(__i386)
/*