[PULL 38/66] target/mips: Simplify msa_reset()
Philippe Mathieu-Daudé
f4bug at amsat.org
Thu Jan 7 22:22:25 UTC 2021
Call msa_reset() unconditionally, but only reset
the MSA registers if MSA is implemented.
Reviewed-by: Jiaxun Yang <jiaxun.yang at flygoat.com>
Reviewed-by: Richard Henderson <richard.henderson at linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug at amsat.org>
Tested-by: Jiaxun Yang <jiaxun.yang at flygoat.com>
Message-Id: <20201208003702.4088927-3-f4bug at amsat.org>
---
target/mips/cpu.c | 5 +----
target/mips/cpu-defs.c.inc | 4 ++++
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index 45375ebc45c..4c590b90b25 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -531,10 +531,7 @@ static void mips_cpu_reset(DeviceState *dev)
env->hflags |= MIPS_HFLAG_M16;
}
- /* MSA */
- if (ase_msa_available(env)) {
- msa_reset(env);
- }
+ msa_reset(env);
compute_hflags(env);
restore_fp_status(env);
diff --git a/target/mips/cpu-defs.c.inc b/target/mips/cpu-defs.c.inc
index 535d4c0c702..fe0f47aadf8 100644
--- a/target/mips/cpu-defs.c.inc
+++ b/target/mips/cpu-defs.c.inc
@@ -978,6 +978,10 @@ static void mvp_init(CPUMIPSState *env)
static void msa_reset(CPUMIPSState *env)
{
+ if (!ase_msa_available(env)) {
+ return;
+ }
+
#ifdef CONFIG_USER_ONLY
/* MSA access enabled */
env->CP0_Config5 |= 1 << CP0C5_MSAEn;
--
2.26.2
More information about the libvir-list
mailing list