diff options
author | David Daney <david.daney@cavium.com> | 2013-02-16 17:42:43 -0500 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-02-19 03:36:36 -0500 |
commit | 1e7decdb27ae89b2a0626635a8cf527f930bff1c (patch) | |
tree | 6c59de5d008b7021331c3f49348510e6adb6607e /arch/mips | |
parent | 27ea052acb9eaca98cc90bf1b8738b6d0ea5bc2f (diff) |
MIPS: Probe for and report hardware virtualization support.
The presence of the MIPS Virtualization Application-Specific Extension
is indicated by CP0_Config3[23]. Probe for this and report it in
/proc/cpuinfo.
Signed-off-by: David Daney <david.daney@cavium.com>
Patchwork: http://patchwork.linux-mips.org/patch/4904/
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/include/asm/cpu-features.h | 4 | ||||
-rw-r--r-- | arch/mips/include/asm/cpu.h | 2 | ||||
-rw-r--r-- | arch/mips/include/asm/mipsregs.h | 1 | ||||
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/proc.c | 1 |
5 files changed, 9 insertions, 1 deletions
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h index 00171cddb6d5..c6f64ef0681e 100644 --- a/arch/mips/include/asm/cpu-features.h +++ b/arch/mips/include/asm/cpu-features.h | |||
@@ -263,4 +263,8 @@ | |||
263 | #define cpu_has_perf_cntr_intr_bit (cpu_data[0].options & MIPS_CPU_PCI) | 263 | #define cpu_has_perf_cntr_intr_bit (cpu_data[0].options & MIPS_CPU_PCI) |
264 | #endif | 264 | #endif |
265 | 265 | ||
266 | #ifndef cpu_has_vz | ||
267 | #define cpu_has_vz (cpu_data[0].ases & MIPS_ASE_VZ) | ||
268 | #endif | ||
269 | |||
266 | #endif /* __ASM_CPU_FEATURES_H */ | 270 | #endif /* __ASM_CPU_FEATURES_H */ |
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h index 2de2fee16cc4..4dff3378d96f 100644 --- a/arch/mips/include/asm/cpu.h +++ b/arch/mips/include/asm/cpu.h | |||
@@ -336,6 +336,6 @@ enum cpu_type_enum { | |||
336 | #define MIPS_ASE_DSP 0x00000010 /* Signal Processing ASE */ | 336 | #define MIPS_ASE_DSP 0x00000010 /* Signal Processing ASE */ |
337 | #define MIPS_ASE_MIPSMT 0x00000020 /* CPU supports MIPS MT */ | 337 | #define MIPS_ASE_MIPSMT 0x00000020 /* CPU supports MIPS MT */ |
338 | #define MIPS_ASE_DSP2P 0x00000040 /* Signal Processing ASE Rev 2 */ | 338 | #define MIPS_ASE_DSP2P 0x00000040 /* Signal Processing ASE Rev 2 */ |
339 | 339 | #define MIPS_ASE_VZ 0x00000080 /* Virtualization ASE */ | |
340 | 340 | ||
341 | #endif /* _ASM_CPU_H */ | 341 | #endif /* _ASM_CPU_H */ |
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 9f47cda632ab..5df4cda4991a 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h | |||
@@ -596,6 +596,7 @@ | |||
596 | #define MIPS_CONF3_RXI (_ULCAST_(1) << 12) | 596 | #define MIPS_CONF3_RXI (_ULCAST_(1) << 12) |
597 | #define MIPS_CONF3_ULRI (_ULCAST_(1) << 13) | 597 | #define MIPS_CONF3_ULRI (_ULCAST_(1) << 13) |
598 | #define MIPS_CONF3_ISA (_ULCAST_(3) << 14) | 598 | #define MIPS_CONF3_ISA (_ULCAST_(3) << 14) |
599 | #define MIPS_CONF3_VZ (_ULCAST_(1) << 23) | ||
599 | 600 | ||
600 | #define MIPS_CONF4_MMUSIZEEXT (_ULCAST_(255) << 0) | 601 | #define MIPS_CONF4_MMUSIZEEXT (_ULCAST_(255) << 0) |
601 | #define MIPS_CONF4_MMUEXTDEF (_ULCAST_(3) << 14) | 602 | #define MIPS_CONF4_MMUEXTDEF (_ULCAST_(3) << 14) |
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index ba169022fe1d..0c69d1d14080 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -442,6 +442,8 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c) | |||
442 | c->options |= MIPS_CPU_ULRI; | 442 | c->options |= MIPS_CPU_ULRI; |
443 | if (config3 & MIPS_CONF3_ISA) | 443 | if (config3 & MIPS_CONF3_ISA) |
444 | c->options |= MIPS_CPU_MICROMIPS; | 444 | c->options |= MIPS_CPU_MICROMIPS; |
445 | if (config3 & MIPS_CONF3_VZ) | ||
446 | c->ases |= MIPS_ASE_VZ; | ||
445 | 447 | ||
446 | return config3 & MIPS_CONF_M; | 448 | return config3 & MIPS_CONF_M; |
447 | } | 449 | } |
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index 239ae03f3330..453d55699fef 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c | |||
@@ -74,6 +74,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
74 | if (cpu_has_dsp2) seq_printf(m, "%s", " dsp2"); | 74 | if (cpu_has_dsp2) seq_printf(m, "%s", " dsp2"); |
75 | if (cpu_has_mipsmt) seq_printf(m, "%s", " mt"); | 75 | if (cpu_has_mipsmt) seq_printf(m, "%s", " mt"); |
76 | if (cpu_has_mmips) seq_printf(m, "%s", " micromips"); | 76 | if (cpu_has_mmips) seq_printf(m, "%s", " micromips"); |
77 | if (cpu_has_vz) seq_printf(m, "%s", " vz"); | ||
77 | seq_printf(m, "\n"); | 78 | seq_printf(m, "\n"); |
78 | 79 | ||
79 | seq_printf(m, "shadow register sets\t: %d\n", | 80 | seq_printf(m, "shadow register sets\t: %d\n", |