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

Max Filippov posted 1 patch 3 years, 8 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200829104758.22337-1-jcmvbkbc@gmail.com
Maintainers: Max Filippov <jcmvbkbc@gmail.com>
target/xtensa/cpu.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] target/xtensa: enable all coprocessors for linux-user
Posted by Max Filippov 3 years, 8 months ago
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


Re: [PATCH] target/xtensa: enable all coprocessors for linux-user
Posted by Richard Henderson 3 years, 8 months ago
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~

Re: [PATCH] target/xtensa: enable all coprocessors for linux-user
Posted by Laurent Vivier 3 years, 6 months ago
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