All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target/xtensa: enable all coprocessors for linux-user
@ 2020-08-29 10:47 Max Filippov
  2020-08-29 15:35 ` Richard Henderson
  2020-10-26 11:07 ` Laurent Vivier
  0 siblings, 2 replies; 3+ messages in thread
From: Max Filippov @ 2020-08-29 10:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Max Filippov

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>
---
 target/xtensa/cpu.c | 1 +
 1 file changed, 1 insertion(+)

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;
 #endif
     env->sregs[VECBASE] = env->config->vecbase;
     env->sregs[IBREAKENABLE] = 0;
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] target/xtensa: enable all coprocessors for linux-user
  2020-08-29 10:47 [PATCH] target/xtensa: enable all coprocessors for linux-user Max Filippov
@ 2020-08-29 15:35 ` Richard Henderson
  2020-10-26 11:07 ` Laurent Vivier
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2020-08-29 15:35 UTC (permalink / raw)
  To: Max Filippov, qemu-devel

On 8/29/20 3:47 AM, Max Filippov wrote:
> 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>


r~


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] target/xtensa: enable all coprocessors for linux-user
  2020-08-29 10:47 [PATCH] target/xtensa: enable all coprocessors for linux-user Max Filippov
  2020-08-29 15:35 ` Richard Henderson
@ 2020-10-26 11:07 ` Laurent Vivier
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2020-10-26 11:07 UTC (permalink / raw)
  To: Max Filippov, qemu-devel

Le 29/08/2020 à 12:47, Max Filippov a écrit :
> 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>
> ---
>  target/xtensa/cpu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> 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;
>  #endif
>      env->sregs[VECBASE] = env->config->vecbase;
>      env->sregs[IBREAKENABLE] = 0;
> 

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

Thanks,
Laurent


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-26 11:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-29 10:47 [PATCH] target/xtensa: enable all coprocessors for linux-user Max Filippov
2020-08-29 15:35 ` Richard Henderson
2020-10-26 11:07 ` Laurent Vivier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.