Skip to content

Commit

Permalink
DEC: Limit PMAX memory probing to R3k systems
Browse files Browse the repository at this point in the history
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: 1da177e ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org # v2.6.12+
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  • Loading branch information
Maciej W. Rozycki authored and Thomas Bogendoerfer committed Mar 7, 2022
1 parent 97bf039 commit 244eae9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion arch/mips/dec/prom/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

lib-y += init.o memory.o cmdline.o identify.o console.o

lib-$(CONFIG_32BIT) += locore.o
lib-$(CONFIG_CPU_R3000) += locore.o
15 changes: 5 additions & 10 deletions arch/mips/include/asm/dec/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,11 @@
*/
#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
Expand Down

0 comments on commit 244eae9

Please sign in to comment.