diff mbox series

[PULL,8/8] target/xtensa: enable all coprocessors for linux-user

Message ID 20201026220339.195790-9-laurent@vivier.eu
State New
Headers show
Series [PULL,1/8] Fix stack smashing when handling PR_GET_PDEATHSIG | expand

Commit Message

Laurent Vivier Oct. 26, 2020, 10:03 p.m. UTC
From: Max Filippov <jcmvbkbc@gmail.com>

Linux userspace always sees coprocessors as enabled. CPENABLE register
and coprocessor exceptions are used internally by the kernel to manage
lazy coprocessor context switch. None of it is needed for linux-user.
Always enable all coprocessors for user emulation.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200829104758.22337-1-jcmvbkbc@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
 target/xtensa/cpu.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series


diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c
index 6a033e778c95..88a32268a18b 100644
--- a/target/xtensa/cpu.c
+++ b/target/xtensa/cpu.c
@@ -93,6 +93,7 @@  static void xtensa_cpu_reset(DeviceState *dev)
         !xtensa_abi_call0()) {
         env->sregs[PS] |= PS_WOE;
+    env->sregs[CPENABLE] = 0xff;
     env->sregs[VECBASE] = env->config->vecbase;
     env->sregs[IBREAKENABLE] = 0;