Skip to contentSkip to conversation

target/xtensa: enable all coprocessors for linux-user

PATCH Applied Max Filippov 3 participants 3 messages Aug 29, 2020 – Oct 26, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/xtensa: enable all coprocessors for linux-user

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.

---
 target/xtensa/cpu.c | 1 +
 1 file changed, 1 insertion(+)
target/xtensa/cpu.c +1 -0
index 6a033e778c95..88a32268a18b 100644
@@ -93,6 +93,7 @@ static void xtensa_cpu_reset(DeviceState *dev)
         !xtensa_abi_call0()) {
         env->sregs[PS] |= PS_WOE;
     }
+    env->sregs[CPENABLE] = 0xff;
 #endif
     env->sregs[VECBASE] = env->config->vecbase;
     env->sregs[IBREAKENABLE] = 0;
Signature · 1 line
2.20.1
#2 lore raw
In reply to Max Filippov

Le 29/08/2020 à 12:47, Max Filippov a écrit :

Quoted 16 lines

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.

---
 target/xtensa/cpu.c | 1 +
 1 file changed, 1 insertion(+)
target/xtensa/cpu.c +0 -0
index 6a033e778c95..88a32268a18b 100644

target/xtensa/cpu.c static void xtensa_cpu_reset(DeviceState *dev) · line 99

Quoted 7 lines
target/xtensa/cpu.c +1 -0
@@ -93,6 +93,7 @@ static void xtensa_cpu_reset(DeviceState *dev)
         !xtensa_abi_call0()) {
         env->sregs[PS] |= PS_WOE;
     }
+    env->sregs[CPENABLE] = 0xff;
 #endif
     env->sregs[VECBASE] = env->config->vecbase;
     env->sregs[IBREAKENABLE] = 0;

Applied to my linux-user-for-5.2 branch.

Thanks,
Laurent