target/loongarch: fix ASXE flag conflict
PATCH 1/1 target/loongarch: fix ASXE flag conflict
HW_FLAGS_EUEN_ASXE acccidentally conflicts with HW_FLAGS_CRMD_PG, enabling LASX instructions even when CSR_EUEN.ASXE=0.
--- target/loongarch/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/loongarch/cpu.h +1 -1
@@ -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,
Signature · 1 line
2.41.0
Quoted 14 lines · Jiajie Chen
HW_FLAGS_EUEN_ASXEacccidentally conflicts withHW_FLAGS_CRMD_PG, enabling LASX instructions even when CSR_EUEN.ASXE=0.Signed-off-by Jiajie Chen <[email protected]>--- target/loongarch/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/loongarch/cpu.h +0
-0
target/loongarch/cpu.h static inline void set_pc(CPULoongArchState *env, uint64_t value) · line 468
Quoted 8 lines
target/loongarch/cpu.h +1
-1@@ -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,
r~
gaosong
Reviewed-byQuoted 24 lines · Richard Henderson
Quoted 13 lines · Jiajie Chen
HW_FLAGS_EUEN_ASXEacccidentally conflicts withHW_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 <[email protected]>---
target/loongarch/cpu.h| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)target/loongarch/cpu.h +0
-0target/loongarch/cpu.h static inline void set_pc(CPULoongArchState *env, · line 468
Quoted 8 lines
target/loongarch/cpu.h +1
-1@@ -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.
Quoted 5 lines
Quoted 1 line
With that,
Reviewed-by Richard Henderson <[email protected]>r
Thanks.
Song Gao