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

MIPS: Probe for presence of KScratch registers.

Probe c0_config4 for KScratch registers and report them in /proc/cpuinfo.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/1877/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

David Daney and committed by
Ralf Baechle
e77c32fe 487d70d0

+5
+1
arch/mips/include/asm/cpu-info.h
··· 78 78 unsigned int watch_reg_use_cnt; /* Usable by ptrace */ 79 79 #define NUM_WATCH_REGS 4 80 80 u16 watch_reg_masks[NUM_WATCH_REGS]; 81 + unsigned int kscratch_mask; /* Usable KScratch mask. */ 81 82 } __attribute__((aligned(SMP_CACHE_BYTES))); 82 83 83 84 extern struct cpuinfo_mips cpu_data[];
+2
arch/mips/kernel/cpu-probe.c
··· 739 739 && cpu_has_tlb) 740 740 c->tlbsize += (config4 & MIPS_CONF4_MMUSIZEEXT) * 0x40; 741 741 742 + c->kscratch_mask = (config4 >> 16) & 0xff; 743 + 742 744 return config4 & MIPS_CONF_M; 743 745 } 744 746
+2
arch/mips/kernel/proc.c
··· 74 74 ); 75 75 seq_printf(m, "shadow register sets\t: %d\n", 76 76 cpu_data[n].srsets); 77 + seq_printf(m, "kscratch registers\t: %d\n", 78 + hweight8(cpu_data[n].kscratch_mask)); 77 79 seq_printf(m, "core\t\t\t: %d\n", cpu_data[n].core); 78 80 79 81 sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",