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

MIPS: Print segment physical address when EU=1

Currently the debugfs interface to print the segment configuration
refuses to print the physical address of mapped segments. However if the
EU bit is set these become unmapped at error level (when
CP0_Status.ERL=1), so the physical address is still relevant.

Update the logic to print the physical address of mapped segments when
the EU bit is set, while still hiding the Cache Coherency Attribute
(since EU overrides that to uncached when ERL=1 too).

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/13833/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

James Hogan and committed by
Ralf Baechle
5573f6ad 2f8f8c04

+8 -5
+8 -5
arch/mips/kernel/segment.c
··· 26 26 27 27 /* 28 28 * Access modes MK, MSK and MUSK are mapped segments. Therefore 29 - * there is no direct physical address mapping. 29 + * there is no direct physical address mapping unless it becomes 30 + * unmapped uncached at error level due to EU. 30 31 */ 31 - if ((am == 0) || (am > 3)) { 32 + if ((am == 0) || (am > 3) || (cfg & MIPS_SEGCFG_EU)) 32 33 str += sprintf(str, " %03lx", 33 34 ((cfg & MIPS_SEGCFG_PA) >> MIPS_SEGCFG_PA_SHIFT)); 35 + else 36 + str += sprintf(str, " UND"); 37 + 38 + if ((am == 0) || (am > 3)) 34 39 str += sprintf(str, " %01ld", 35 40 ((cfg & MIPS_SEGCFG_C) >> MIPS_SEGCFG_C_SHIFT)); 36 - } else { 37 - str += sprintf(str, " UND"); 41 + else 38 42 str += sprintf(str, " U"); 39 - } 40 43 41 44 /* Exception configuration. */ 42 45 str += sprintf(str, " %01ld\n",