All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] MIPS: r4k-bugs64: Drop CONFIG_CPU_MIPSR6 checks
  2019-10-01 23:04 [PATCH 1/2] MIPS: r4k-bugs64: Limit R4k bug checks to affected systems Paul Burton
@ 2019-10-01 23:04 ` Paul Burton
  2019-10-07 17:53 ` [PATCH 1/2] MIPS: r4k-bugs64: Limit R4k bug checks to affected systems Paul Burton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Burton @ 2019-10-01 23:04 UTC (permalink / raw)
  To: linux-mips; +Cc: Paul Burton

The r4k-bugs64 code will no longer be built for MIPSr6 kernel
configurations, so there's no need to perform checks for MIPSr6 within
the code. Drop those redundant checks.

Signed-off-by: Paul Burton <paul.burton@mips.com>
---

 arch/mips/kernel/r4k-bugs64.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/arch/mips/kernel/r4k-bugs64.c b/arch/mips/kernel/r4k-bugs64.c
index fa62cd1dff93..a0c2ba728f45 100644
--- a/arch/mips/kernel/r4k-bugs64.c
+++ b/arch/mips/kernel/r4k-bugs64.c
@@ -240,7 +240,7 @@ static inline void check_daddi(void)
 	panic(bug64hit, !DADDI_WAR ? daddiwar : nowar);
 }
 
-int daddiu_bug	= IS_ENABLED(CONFIG_CPU_MIPSR6) ? 0 : -1;
+int daddiu_bug	= -1;
 
 static inline void check_daddiu(void)
 {
@@ -310,14 +310,11 @@ static inline void check_daddiu(void)
 
 void __init check_bugs64_early(void)
 {
-	if (!IS_ENABLED(CONFIG_CPU_MIPSR6)) {
-		check_mult_sh();
-		check_daddiu();
-	}
+	check_mult_sh();
+	check_daddiu();
 }
 
 void __init check_bugs64(void)
 {
-	if (!IS_ENABLED(CONFIG_CPU_MIPSR6))
-		check_daddi();
+	check_daddi();
 }
-- 
2.23.0


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

* [PATCH 1/2] MIPS: r4k-bugs64: Limit R4k bug checks to affected systems
@ 2019-10-01 23:04 Paul Burton
  2019-10-01 23:04 ` [PATCH 2/2] MIPS: r4k-bugs64: Drop CONFIG_CPU_MIPSR6 checks Paul Burton
  2019-10-07 17:53 ` [PATCH 1/2] MIPS: r4k-bugs64: Limit R4k bug checks to affected systems Paul Burton
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Burton @ 2019-10-01 23:04 UTC (permalink / raw)
  To: linux-mips; +Cc: Paul Burton

Only build the checks for R4k errata workarounds if we expect that the
kernel might actually run on a system with an R4k CPU - ie.
CONFIG_SYS_HAS_CPU_R4X00=y & we're targeting a pre-MIPSr1 ISA revision.

Rename cpu-bugs64.c to r4k-bugs64.c to indicate the fact that the code
is specific to R4k CPUs.

Signed-off-by: Paul Burton <paul.burton@mips.com>
---

 arch/mips/Kconfig                              |  4 ++++
 arch/mips/include/asm/bugs.h                   | 18 ++++++++----------
 arch/mips/kernel/Makefile                      |  2 +-
 arch/mips/kernel/genex.S                       |  2 +-
 .../mips/kernel/{cpu-bugs64.c => r4k-bugs64.c} |  0
 5 files changed, 14 insertions(+), 12 deletions(-)
 rename arch/mips/kernel/{cpu-bugs64.c => r4k-bugs64.c} (100%)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index a0bd9bdb5f83..8736bf4420bc 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2554,6 +2554,10 @@ config CPU_R4000_WORKAROUNDS
 config CPU_R4400_WORKAROUNDS
 	bool
 
+config CPU_R4X00_BUGS64
+	bool
+	default y if SYS_HAS_CPU_R4X00 && 64BIT && (TARGET_ISA_REV < 1)
+
 config MIPS_ASID_SHIFT
 	int
 	default 6 if CPU_R3000 || CPU_TX39XX
diff --git a/arch/mips/include/asm/bugs.h b/arch/mips/include/asm/bugs.h
index d8ab8b7129b5..d72dc6e1cf3c 100644
--- a/arch/mips/include/asm/bugs.h
+++ b/arch/mips/include/asm/bugs.h
@@ -26,9 +26,8 @@ extern void check_bugs64(void);
 
 static inline void check_bugs_early(void)
 {
-#ifdef CONFIG_64BIT
-	check_bugs64_early();
-#endif
+	if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
+		check_bugs64_early();
 }
 
 static inline void check_bugs(void)
@@ -37,19 +36,18 @@ static inline void check_bugs(void)
 
 	cpu_data[cpu].udelay_val = loops_per_jiffy;
 	check_bugs32();
-#ifdef CONFIG_64BIT
-	check_bugs64();
-#endif
+
+	if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
+		check_bugs64();
 }
 
 static inline int r4k_daddiu_bug(void)
 {
-#ifdef CONFIG_64BIT
+	if (!IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
+		return 0;
+
 	WARN_ON(daddiu_bug < 0);
 	return daddiu_bug != 0;
-#else
-	return 0;
-#endif
 }
 
 #endif /* _ASM_BUGS_H */
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 89b07ea8d249..d6e97df51cfb 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -80,7 +80,7 @@ obj-$(CONFIG_KGDB)		+= kgdb.o
 obj-$(CONFIG_PROC_FS)		+= proc.o
 obj-$(CONFIG_MAGIC_SYSRQ)	+= sysrq.o
 
-obj-$(CONFIG_64BIT)		+= cpu-bugs64.o
+obj-$(CONFIG_CPU_R4X00_BUGS64)	+= r4k-bugs64.o
 
 obj-$(CONFIG_I8253)		+= i8253.o
 
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index efde27c99414..d586cdac9605 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -657,7 +657,7 @@ isrdhwr:
 	.set	pop
 	END(handle_ri_rdhwr)
 
-#ifdef CONFIG_64BIT
+#ifdef CONFIG_CPU_R4X00_BUGS64
 /* A temporary overflow handler used by check_daddi(). */
 
 	__INIT
diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/r4k-bugs64.c
similarity index 100%
rename from arch/mips/kernel/cpu-bugs64.c
rename to arch/mips/kernel/r4k-bugs64.c
-- 
2.23.0


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

* Re: [PATCH 1/2] MIPS: r4k-bugs64: Limit R4k bug checks to affected systems
  2019-10-01 23:04 [PATCH 1/2] MIPS: r4k-bugs64: Limit R4k bug checks to affected systems Paul Burton
  2019-10-01 23:04 ` [PATCH 2/2] MIPS: r4k-bugs64: Drop CONFIG_CPU_MIPSR6 checks Paul Burton
@ 2019-10-07 17:53 ` Paul Burton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Burton @ 2019-10-07 17:53 UTC (permalink / raw)
  To: Paul Burton; +Cc: linux-mips, Paul Burton, linux-mips

Hello,

Paul Burton wrote:
> Only build the checks for R4k errata workarounds if we expect that the
> kernel might actually run on a system with an R4k CPU - ie.
> CONFIG_SYS_HAS_CPU_R4X00=y & we're targeting a pre-MIPSr1 ISA revision.
> 
> Rename cpu-bugs64.c to r4k-bugs64.c to indicate the fact that the code
> is specific to R4k CPUs.

Series applied to mips-next.

> MIPS: r4k-bugs64: Limit R4k bug checks to affected systems
>   commit 071d2f0b5419
>   https://git.kernel.org/mips/c/071d2f0b5419
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
> 
> MIPS: r4k-bugs64: Drop CONFIG_CPU_MIPSR6 checks
>   commit 5045d06b3736
>   https://git.kernel.org/mips/c/5045d06b3736
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]

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

end of thread, other threads:[~2019-10-07 17:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 23:04 [PATCH 1/2] MIPS: r4k-bugs64: Limit R4k bug checks to affected systems Paul Burton
2019-10-01 23:04 ` [PATCH 2/2] MIPS: r4k-bugs64: Drop CONFIG_CPU_MIPSR6 checks Paul Burton
2019-10-07 17:53 ` [PATCH 1/2] MIPS: r4k-bugs64: Limit R4k bug checks to affected systems Paul Burton

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.