qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/loongarch: fix ASXE flag conflict
@ 2023-09-30 11:28 Jiajie Chen
  2023-09-30 15:46 ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Jiajie Chen @ 2023-09-30 11:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: richard.henderson, gaosong, git, Jiajie Chen, Xiaojuan Yang

HW_FLAGS_EUEN_ASXE acccidentally conflicts with HW_FLAGS_CRMD_PG,
enabling LASX instructions even when CSR_EUEN.ASXE=0.

Closes: https://gitlab.com/qemu-project/qemu/-/issues/1907
Signed-off-by: Jiajie Chen <c@jia.je>
---
 target/loongarch/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h
index f125a8e49b..79ad79a289 100644
--- a/target/loongarch/cpu.h
+++ b/target/loongarch/cpu.h
@@ -462,7 +462,7 @@ static inline void set_pc(CPULoongArchState *env, uint64_t value)
 #define HW_FLAGS_CRMD_PG    R_CSR_CRMD_PG_MASK   /* 0x10 */
 #define HW_FLAGS_EUEN_FPE   0x04
 #define HW_FLAGS_EUEN_SXE   0x08
-#define HW_FLAGS_EUEN_ASXE  0x10
+#define HW_FLAGS_EUEN_ASXE  0x40
 #define HW_FLAGS_VA32       0x20
 
 static inline void cpu_get_tb_cpu_state(CPULoongArchState *env, vaddr *pc,
-- 
2.41.0



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

* Re: [PATCH] target/loongarch: fix ASXE flag conflict
  2023-09-30 11:28 [PATCH] target/loongarch: fix ASXE flag conflict Jiajie Chen
@ 2023-09-30 15:46 ` Richard Henderson
  2023-10-08  3:58   ` gaosong
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2023-09-30 15:46 UTC (permalink / raw)
  To: Jiajie Chen, qemu-devel; +Cc: gaosong, git, Xiaojuan Yang

On 9/30/23 04:28, Jiajie Chen wrote:
> HW_FLAGS_EUEN_ASXE acccidentally conflicts with HW_FLAGS_CRMD_PG,
> enabling LASX instructions even when CSR_EUEN.ASXE=0.
> 
> Closes: https://gitlab.com/qemu-project/qemu/-/issues/1907
> Signed-off-by: Jiajie Chen <c@jia.je>
> ---
>   target/loongarch/cpu.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h
> index f125a8e49b..79ad79a289 100644
> --- a/target/loongarch/cpu.h
> +++ b/target/loongarch/cpu.h
> @@ -462,7 +462,7 @@ static inline void set_pc(CPULoongArchState *env, uint64_t value)
>   #define HW_FLAGS_CRMD_PG    R_CSR_CRMD_PG_MASK   /* 0x10 */
>   #define HW_FLAGS_EUEN_FPE   0x04
>   #define HW_FLAGS_EUEN_SXE   0x08
> -#define HW_FLAGS_EUEN_ASXE  0x10
> +#define HW_FLAGS_EUEN_ASXE  0x40
>   #define HW_FLAGS_VA32       0x20
>   
>   static inline void cpu_get_tb_cpu_state(CPULoongArchState *env, vaddr *pc,

Better to put all defines in bit order, otherwise it will be easy to make the same mistake 
again.

With that,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


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

* Re: [PATCH] target/loongarch: fix ASXE flag conflict
  2023-09-30 15:46 ` Richard Henderson
@ 2023-10-08  3:58   ` gaosong
  0 siblings, 0 replies; 3+ messages in thread
From: gaosong @ 2023-10-08  3:58 UTC (permalink / raw)
  To: Richard Henderson, Jiajie Chen, qemu-devel; +Cc: git, Xiaojuan Yang

在 2023/9/30 下午11:46, Richard Henderson 写道:
> On 9/30/23 04:28, Jiajie Chen wrote:
>> HW_FLAGS_EUEN_ASXE acccidentally conflicts with HW_FLAGS_CRMD_PG,
>> enabling LASX instructions even when CSR_EUEN.ASXE=0.
>>
>> Closes: https://gitlab.com/qemu-project/qemu/-/issues/1907 >> Signed-off-by: Jiajie Chen <c@jia.je>
>> ---
>>   target/loongarch/cpu.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h
>> index f125a8e49b..79ad79a289 100644
>> --- a/target/loongarch/cpu.h
>> +++ b/target/loongarch/cpu.h
>> @@ -462,7 +462,7 @@ static inline void set_pc(CPULoongArchState *env, 
>> uint64_t value)
>>   #define HW_FLAGS_CRMD_PG    R_CSR_CRMD_PG_MASK   /* 0x10 */
>>   #define HW_FLAGS_EUEN_FPE   0x04
>>   #define HW_FLAGS_EUEN_SXE   0x08
>> -#define HW_FLAGS_EUEN_ASXE  0x10
>> +#define HW_FLAGS_EUEN_ASXE  0x40
>>   #define HW_FLAGS_VA32       0x20
>>   static inline void cpu_get_tb_cpu_state(CPULoongArchState *env, 
>> vaddr *pc,
> 
> Better to put all defines in bit order, otherwise it will be easy to 
> make the same mistake again.
>  > With that,
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> 
> 
> r
Reviewed-by: Song Gao <gaosong@loongson.cn>

Thanks.
Song Gao



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

end of thread, other threads:[~2023-10-08  3:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-30 11:28 [PATCH] target/loongarch: fix ASXE flag conflict Jiajie Chen
2023-09-30 15:46 ` Richard Henderson
2023-10-08  3:58   ` gaosong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).