DEC: Limit PMAX memory probing to R3k systems
authorMaciej W. Rozycki <macro@orcam.me.uk>
Fri, 4 Mar 2022 20:16:23 +0000 (20:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:08:12 +0000 (09:08 +0200)
commit 244eae91a94c6dab82b3232967d10eeb9dfa21c6 upstream.

Recent tightening of the opcode table in binutils so as to consistently
disallow the assembly or disassembly of CP0 instructions not supported
by the processor architecture chosen has caused a regression like below:

arch/mips/dec/prom/locore.S: Assembler messages:
arch/mips/dec/prom/locore.S:29: Error: opcode not supported on this processor: r4600 (mips3) `rfe'

in a piece of code used to probe for memory with PMAX DECstation models,
which have non-REX firmware.  Those computers always have an R2000 CPU
and consequently the exception handler used in memory probing uses the
RFE instruction, which those processors use.

While adding 64-bit support this code was correctly excluded for 64-bit
configurations, however it should have also been excluded for irrelevant
32-bit configurations.  Do this now then, and only enable PMAX memory
probing for R3k systems.

Reported-by: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Reported-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org # v2.6.12+
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/dec/prom/Makefile
arch/mips/include/asm/dec/prom.h

index ae73e42ac20b163331a77439a75270320a77dfa8..4c369359cdab56cf5bad4b3d0013bd09ff28afe7 100644 (file)
@@ -5,4 +5,4 @@
 
 lib-y                  += init.o memory.o cmdline.o identify.o console.o
 
-lib-$(CONFIG_32BIT)    += locore.o
+lib-$(CONFIG_CPU_R3000)        += locore.o
index b59a2103b61a3f64efd75b29f034e8208c155012..09538ff5e92457f08ac944f00c8dc8c06588666e 100644 (file)
  */
 #define REX_PROM_MAGIC         0x30464354
 
-#ifdef CONFIG_64BIT
-
-#define prom_is_rex(magic)     1       /* KN04 and KN05 are REX PROMs.  */
-
-#else /* !CONFIG_64BIT */
-
-#define prom_is_rex(magic)     ((magic) == REX_PROM_MAGIC)
-
-#endif /* !CONFIG_64BIT */
-
+/* KN04 and KN05 are REX PROMs, so only do the check for R3k systems.  */
+static inline bool prom_is_rex(u32 magic)
+{
+       return !IS_ENABLED(CONFIG_CPU_R3000) || magic == REX_PROM_MAGIC;
+}
 
 /*
  * 3MIN/MAXINE PROM entry points for DS5000/1xx's, DS5000/xx's and