Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Add base architecture support for RI and XI.

Originally both Read Inhibit (RI) and Execute Inhibit (XI) were
supported by the TLB only for a SmartMIPS core. The MIPSr3(TM)
Architecture now defines an optional feature to implement these
TLB bits separately. Support for one or both features can be
checked by looking at the Config3.RXI bit.

Signed-off-by: Steven J. Hill <sjhill@mips.com>
Acked-by: David Daney <david.daney@cavium.com>

+10 -1
+3
arch/mips/include/asm/cpu-features.h
··· 95 95 #ifndef cpu_has_smartmips 96 96 #define cpu_has_smartmips (cpu_data[0].ases & MIPS_ASE_SMARTMIPS) 97 97 #endif 98 + #ifndef cpu_has_rixi 99 + #define cpu_has_rixi (cpu_data[0].options & MIPS_CPU_RIXI) 100 + #endif 98 101 #ifndef kernel_uses_smartmips_rixi 99 102 #define kernel_uses_smartmips_rixi 0 100 103 #endif
+1
arch/mips/include/asm/cpu.h
··· 319 319 #define MIPS_CPU_VINT 0x00080000 /* CPU supports MIPSR2 vectored interrupts */ 320 320 #define MIPS_CPU_VEIC 0x00100000 /* CPU supports MIPSR2 external interrupt controller mode */ 321 321 #define MIPS_CPU_ULRI 0x00200000 /* CPU has ULRI feature */ 322 + #define MIPS_CPU_RIXI 0x00400000 /* CPU has TLB Read/eXec Inhibit */ 322 323 323 324 /* 324 325 * CPU ASE encodings
+1
arch/mips/include/asm/mipsregs.h
··· 590 590 #define MIPS_CONF3_VEIC (_ULCAST_(1) << 6) 591 591 #define MIPS_CONF3_LPA (_ULCAST_(1) << 7) 592 592 #define MIPS_CONF3_DSP (_ULCAST_(1) << 10) 593 + #define MIPS_CONF3_RXI (_ULCAST_(1) << 12) 593 594 #define MIPS_CONF3_ULRI (_ULCAST_(1) << 13) 594 595 595 596 #define MIPS_CONF4_MMUSIZEEXT (_ULCAST_(255) << 0)
+5 -1
arch/mips/kernel/cpu-probe.c
··· 421 421 422 422 config3 = read_c0_config3(); 423 423 424 - if (config3 & MIPS_CONF3_SM) 424 + if (config3 & MIPS_CONF3_SM) { 425 425 c->ases |= MIPS_ASE_SMARTMIPS; 426 + c->options |= MIPS_CPU_RIXI; 427 + } 428 + if (config3 & MIPS_CONF3_RXI) 429 + c->options |= MIPS_CPU_RIXI; 426 430 if (config3 & MIPS_CONF3_DSP) 427 431 c->ases |= MIPS_ASE_DSP; 428 432 if (config3 & MIPS_CONF3_VINT)