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

MIPS: Probe guest MVH

Probe for availablility of M{T,F}HC0 instructions used with e.g. XPA in
the VZ guest context, and make it available via cpu_guest_has_mvh. This
will be helpful in properly emulating the MAAR registers in KVM for MIPS
VZ.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org

+7 -1
+3
arch/mips/include/asm/cpu-features.h
··· 532 532 #ifndef cpu_guest_has_htw 533 533 #define cpu_guest_has_htw (cpu_data[0].guest.options & MIPS_CPU_HTW) 534 534 #endif 535 + #ifndef cpu_guest_has_mvh 536 + #define cpu_guest_has_mvh (cpu_data[0].guest.options & MIPS_CPU_MVH) 537 + #endif 535 538 #ifndef cpu_guest_has_msa 536 539 #define cpu_guest_has_msa (cpu_data[0].guest.ases & MIPS_ASE_MSA) 537 540 #endif
+4 -1
arch/mips/kernel/cpu-probe.c
··· 1057 1057 unsigned int config5, config5_dyn; 1058 1058 1059 1059 probe_gc0_config_dyn(config5, config5, config5_dyn, 1060 - MIPS_CONF_M | MIPS_CONF5_MRP); 1060 + MIPS_CONF_M | MIPS_CONF5_MVH | MIPS_CONF5_MRP); 1061 1061 1062 1062 if (config5 & MIPS_CONF5_MRP) 1063 1063 c->guest.options |= MIPS_CPU_MAAR; ··· 1066 1066 1067 1067 if (config5 & MIPS_CONF5_LLB) 1068 1068 c->guest.options |= MIPS_CPU_RW_LLB; 1069 + 1070 + if (config5 & MIPS_CONF5_MVH) 1071 + c->guest.options |= MIPS_CPU_MVH; 1069 1072 1070 1073 if (config5 & MIPS_CONF_M) 1071 1074 c->guest.conf |= BIT(6);