]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 May 2021 07:26:57 +0000 (09:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 May 2021 07:26:57 +0000 (09:26 +0200)
added patches:
mips-do-not-include-hi-and-lo-in-clobber-list-for-r6.patch

queue-4.19/mips-do-not-include-hi-and-lo-in-clobber-list-for-r6.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/mips-do-not-include-hi-and-lo-in-clobber-list-for-r6.patch b/queue-4.19/mips-do-not-include-hi-and-lo-in-clobber-list-for-r6.patch
new file mode 100644 (file)
index 0000000..64cd2de
--- /dev/null
@@ -0,0 +1,74 @@
+From foo@baz Tue May  4 09:25:47 AM CEST 2021
+From: Romain Naour <romain.naour@gmail.com>
+Date: Tue, 20 Apr 2021 22:12:10 +0100
+Subject: mips: Do not include hi and lo in clobber list for R6
+
+From: Romain Naour <romain.naour@gmail.com>
+
+commit 1d7ba0165d8206ac073f7ac3b14fc0836b66eae7 upstream
+
+>From [1]
+"GCC 10 (PR 91233) won't silently allow registers that are not
+architecturally available to be present in the clobber list anymore,
+resulting in build failure for mips*r6 targets in form of:
+...
+.../sysdep.h:146:2: error: the register ‘lo’ cannot be clobbered in ‘asm’ for the current target
+  146 |  __asm__ volatile (      \
+      |  ^~~~~~~
+
+This is because base R6 ISA doesn't define hi and lo registers w/o DSP
+extension. This patch provides the alternative clobber list for r6 targets
+that won't include those registers."
+
+Since kernel 5.4 and mips support for generic vDSO [2], the kernel fail to
+build for mips r6 cpus with gcc 10 for the same reason as glibc.
+
+[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=020b2a97bb15f807c0482f0faee2184ed05bcad8
+[2] '24640f233b46 ("mips: Add support for generic vDSO")'
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/mips/vdso/gettimeofday.c |   14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+--- a/arch/mips/vdso/gettimeofday.c
++++ b/arch/mips/vdso/gettimeofday.c
+@@ -18,6 +18,12 @@
+ #include <asm/unistd.h>
+ #include <asm/vdso.h>
++#if MIPS_ISA_REV < 6
++#define VDSO_SYSCALL_CLOBBERS "hi", "lo",
++#else
++#define VDSO_SYSCALL_CLOBBERS
++#endif
++
+ #ifdef CONFIG_MIPS_CLOCK_VSYSCALL
+ static __always_inline long gettimeofday_fallback(struct timeval *_tv,
+@@ -34,7 +40,9 @@ static __always_inline long gettimeofday
+       : "=r" (ret), "=r" (error)
+       : "r" (tv), "r" (tz), "r" (nr)
+       : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
+-        "$14", "$15", "$24", "$25", "hi", "lo", "memory");
++        "$14", "$15", "$24", "$25",
++        VDSO_SYSCALL_CLOBBERS
++        "memory");
+       return error ? -ret : ret;
+ }
+@@ -55,7 +63,9 @@ static __always_inline long clock_gettim
+       : "=r" (ret), "=r" (error)
+       : "r" (clkid), "r" (ts), "r" (nr)
+       : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
+-        "$14", "$15", "$24", "$25", "hi", "lo", "memory");
++        "$14", "$15", "$24", "$25",
++        VDSO_SYSCALL_CLOBBERS
++        "memory");
+       return error ? -ret : ret;
+ }
index 1ba7ea4a0e391214a65370567fa9a73f3ec6caf9..c59604fd6339ba9ccc925fd15a93476afb8fa7b5 100644 (file)
@@ -3,3 +3,4 @@ acpi-tables-x86-reserve-memory-occupied-by-acpi-tables.patch
 acpi-x86-call-acpi_boot_table_init-after-acpi_table_upgrade.patch
 net-usb-ax88179_178a-initialize-local-variables-before-use.patch
 iwlwifi-fix-softirq-hardirq-disabling-in-iwl_pcie_enqueue_hcmd.patch
+mips-do-not-include-hi-and-lo-in-clobber-list-for-r6.patch