Commit a929bdc5 authored by James Hogan's avatar James Hogan

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: default avatarJames Hogan <james.hogan@imgtec.com>
Acked-by: default avatarRalf 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
parent a7c7ad6c
...@@ -532,6 +532,9 @@ ...@@ -532,6 +532,9 @@
#ifndef cpu_guest_has_htw #ifndef cpu_guest_has_htw
#define cpu_guest_has_htw (cpu_data[0].guest.options & MIPS_CPU_HTW) #define cpu_guest_has_htw (cpu_data[0].guest.options & MIPS_CPU_HTW)
#endif #endif
#ifndef cpu_guest_has_mvh
#define cpu_guest_has_mvh (cpu_data[0].guest.options & MIPS_CPU_MVH)
#endif
#ifndef cpu_guest_has_msa #ifndef cpu_guest_has_msa
#define cpu_guest_has_msa (cpu_data[0].guest.ases & MIPS_ASE_MSA) #define cpu_guest_has_msa (cpu_data[0].guest.ases & MIPS_ASE_MSA)
#endif #endif
......
...@@ -1057,7 +1057,7 @@ static inline unsigned int decode_guest_config5(struct cpuinfo_mips *c) ...@@ -1057,7 +1057,7 @@ static inline unsigned int decode_guest_config5(struct cpuinfo_mips *c)
unsigned int config5, config5_dyn; unsigned int config5, config5_dyn;
probe_gc0_config_dyn(config5, config5, config5_dyn, probe_gc0_config_dyn(config5, config5, config5_dyn,
MIPS_CONF_M | MIPS_CONF5_MRP); MIPS_CONF_M | MIPS_CONF5_MVH | MIPS_CONF5_MRP);
if (config5 & MIPS_CONF5_MRP) if (config5 & MIPS_CONF5_MRP)
c->guest.options |= MIPS_CPU_MAAR; c->guest.options |= MIPS_CPU_MAAR;
...@@ -1067,6 +1067,9 @@ static inline unsigned int decode_guest_config5(struct cpuinfo_mips *c) ...@@ -1067,6 +1067,9 @@ static inline unsigned int decode_guest_config5(struct cpuinfo_mips *c)
if (config5 & MIPS_CONF5_LLB) if (config5 & MIPS_CONF5_LLB)
c->guest.options |= MIPS_CPU_RW_LLB; c->guest.options |= MIPS_CPU_RW_LLB;
if (config5 & MIPS_CONF5_MVH)
c->guest.options |= MIPS_CPU_MVH;
if (config5 & MIPS_CONF_M) if (config5 & MIPS_CONF_M)
c->guest.conf |= BIT(6); c->guest.conf |= BIT(6);
return config5 & MIPS_CONF_M; return config5 & MIPS_CONF_M;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment