diff mbox series

[v2,21/22] s390x/tcg: Allow linux-user to use vector instructions

Message ID 20190603090635.10631-22-david@redhat.com (mailing list archive)
State New, archived
Headers show
Series s390x/tcg: Vector Instruction Support Part 4 | expand

Commit Message

David Hildenbrand June 3, 2019, 9:06 a.m. UTC
Once we unlock S390_FEAT_VECTOR for TCG, we want linux-user to be
able to make use of it.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 target/s390x/cpu.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Laurent Vivier June 4, 2019, 7:45 a.m. UTC | #1
Le 03/06/2019 à 11:06, David Hildenbrand a écrit :
> Once we unlock S390_FEAT_VECTOR for TCG, we want linux-user to be
> able to make use of it.
> 
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/cpu.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
> index b1df63d82c..6af1a1530f 100644
> --- a/target/s390x/cpu.c
> +++ b/target/s390x/cpu.c
> @@ -145,6 +145,9 @@ static void s390_cpu_full_reset(CPUState *s)
>  #if defined(CONFIG_USER_ONLY)
>      /* user mode should always be allowed to use the full FPU */
>      env->cregs[0] |= CR0_AFP;
> +    if (s390_has_feat(S390_FEAT_VECTOR)) {
> +        env->cregs[0] |= CR0_VECTOR;
> +    }
>  #endif
>  
>      /* architectured initial value for Breaking-Event-Address register */
> 


Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Laurent Vivier June 4, 2019, 8:50 a.m. UTC | #2
Le 03/06/2019 à 11:06, David Hildenbrand a écrit :
> Once we unlock S390_FEAT_VECTOR for TCG, we want linux-user to be
> able to make use of it.
> 
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/cpu.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
> index b1df63d82c..6af1a1530f 100644
> --- a/target/s390x/cpu.c
> +++ b/target/s390x/cpu.c
> @@ -145,6 +145,9 @@ static void s390_cpu_full_reset(CPUState *s)
>  #if defined(CONFIG_USER_ONLY)
>      /* user mode should always be allowed to use the full FPU */
>      env->cregs[0] |= CR0_AFP;
> +    if (s390_has_feat(S390_FEAT_VECTOR)) {
> +        env->cregs[0] |= CR0_VECTOR;
> +    }
>  #endif
>  
>      /* architectured initial value for Breaking-Event-Address register */
> 

Do we need to add some hwcaps in linux-user/elfload.c (HWCAP_S390_VXRS,
HWCAP_S390_VXRS_EXT,...)?

Thanks,
Laurent
David Hildenbrand June 4, 2019, 8:56 a.m. UTC | #3
On 04.06.19 10:50, Laurent Vivier wrote:
> Le 03/06/2019 à 11:06, David Hildenbrand a écrit :
>> Once we unlock S390_FEAT_VECTOR for TCG, we want linux-user to be
>> able to make use of it.
>>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
>> ---
>>  target/s390x/cpu.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
>> index b1df63d82c..6af1a1530f 100644
>> --- a/target/s390x/cpu.c
>> +++ b/target/s390x/cpu.c
>> @@ -145,6 +145,9 @@ static void s390_cpu_full_reset(CPUState *s)
>>  #if defined(CONFIG_USER_ONLY)
>>      /* user mode should always be allowed to use the full FPU */
>>      env->cregs[0] |= CR0_AFP;
>> +    if (s390_has_feat(S390_FEAT_VECTOR)) {
>> +        env->cregs[0] |= CR0_VECTOR;
>> +    }
>>  #endif
>>  
>>      /* architectured initial value for Breaking-Event-Address register */
>>
> 
> Do we need to add some hwcaps in linux-user/elfload.c (HWCAP_S390_VXRS,
> HWCAP_S390_VXRS_EXT,...)?

Good point, I will look into this. Thanks!

> 
> Thanks,
> Laurent
>
diff mbox series

Patch

diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index b1df63d82c..6af1a1530f 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -145,6 +145,9 @@  static void s390_cpu_full_reset(CPUState *s)
 #if defined(CONFIG_USER_ONLY)
     /* user mode should always be allowed to use the full FPU */
     env->cregs[0] |= CR0_AFP;
+    if (s390_has_feat(S390_FEAT_VECTOR)) {
+        env->cregs[0] |= CR0_VECTOR;
+    }
 #endif
 
     /* architectured initial value for Breaking-Event-Address register */