All of lore.kernel.org
 help / color / mirror / Atom feed
* backport of 1d7ba0165d82 ("mips: Do not include hi and lo in clobber list for R6") for 4.19-stable
@ 2021-05-02 23:13 Sudip Mukherjee
  2021-05-04  7:25 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2021-05-02 23:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: stable, Romain Naour, Thomas Bogendoerfer

[-- Attachment #1: Type: text/plain, Size: 145 bytes --]

Hi Greg,

Attached is the backport of 1d7ba0165d82 ("mips: Do not include hi and
lo in clobber list for R6") for 4.19-stable.


--
Regards
Sudip

[-- Attachment #2: 0001-mips-Do-not-include-hi-and-lo-in-clobber-list-for-R6.patch --]
[-- Type: text/x-diff, Size: 2786 bytes --]

From 5f2fac41073b083bec0463ac3d40b162d0fffaed Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Tue, 20 Apr 2021 22:12:10 +0100
Subject: [PATCH] mips: Do not include hi and lo in clobber list for R6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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>
---
 arch/mips/vdso/gettimeofday.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/mips/vdso/gettimeofday.c b/arch/mips/vdso/gettimeofday.c
index e22b422f282c..9fdc84fc3985 100644
--- 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_fallback(struct timeval *_tv,
 	: "=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_gettime_fallback(clockid_t _clkid,
 	: "=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;
 }
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: backport of 1d7ba0165d82 ("mips: Do not include hi and lo in clobber list for R6") for 4.19-stable
  2021-05-02 23:13 backport of 1d7ba0165d82 ("mips: Do not include hi and lo in clobber list for R6") for 4.19-stable Sudip Mukherjee
@ 2021-05-04  7:25 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-04  7:25 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: stable, Romain Naour, Thomas Bogendoerfer

On Mon, May 03, 2021 at 12:13:13AM +0100, Sudip Mukherjee wrote:
> Hi Greg,
> 
> Attached is the backport of 1d7ba0165d82 ("mips: Do not include hi and
> lo in clobber list for R6") for 4.19-stable.

All now queued up, thanks!

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-04  7:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-02 23:13 backport of 1d7ba0165d82 ("mips: Do not include hi and lo in clobber list for R6") for 4.19-stable Sudip Mukherjee
2021-05-04  7:25 ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.