Skip to contentSkip to conversation

linux-user/riscv: Fix definition of RISCV_HWPROBE_EXT_ZVFHMIN

PATCH Applied Yao Zi 2 participants 2 messages Oct 22, 2024

lore
Share & tools
lore

Yao Zi

author
#0 lore raw

PATCH 1/1 linux-user/riscv: Fix definition of RISCV_HWPROBE_EXT_ZVFHMIN

Current definition yields a negative 32bits value, messing up hwprobe result when Zvfhmin extension presents. Replace it by using a 1ULL bit shift value as done in kernel upstream.

Fixes a3432cf227 ("linux-user/riscv: Sync hwprobe keys with Linux")
---
 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/syscall.c +1 -1
index 1354e75694..ec1a77f23a 100644
@@ -8943,7 +8943,7 @@ static int do_getdents64(abi_long dirfd, abi_long arg2, abi_long count)
 #define     RISCV_HWPROBE_EXT_ZFHMIN        (1 << 28)
 #define     RISCV_HWPROBE_EXT_ZIHINTNTL     (1 << 29)
 #define     RISCV_HWPROBE_EXT_ZVFH          (1 << 30)
-#define     RISCV_HWPROBE_EXT_ZVFHMIN       (1 << 31)
+#define     RISCV_HWPROBE_EXT_ZVFHMIN       (1ULL << 31)
 #define     RISCV_HWPROBE_EXT_ZFA           (1ULL << 32)
 #define     RISCV_HWPROBE_EXT_ZTSO          (1ULL << 33)
 #define     RISCV_HWPROBE_EXT_ZACAS         (1ULL << 34)
Signature · 1 line
2.46.2
Reviewed-by on v1 1/1 Applied
#1 lore raw
Quoted 17 lines · Yao Zi

Current definition yields a negative 32bits value, messing up hwprobe result when Zvfhmin extension presents. Replace it by using a 1ULL bit shift value as done in kernel upstream.

Fixes a3432cf227 ("linux-user/riscv: Sync hwprobe keys with Linux")
---
  linux-user/syscall.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/syscall.c +0 -0
index 1354e75694..ec1a77f23a 100644

linux-user/syscall.c static int do_getdents64(abi_long dirfd, abi_long arg2, abi_long count) · line 8949

Quoted 8 lines
linux-user/syscall.c +1 -1
@@ -8943,7 +8943,7 @@ static int do_getdents64(abi_long dirfd, abi_long arg2, abi_long count)
  #define     RISCV_HWPROBE_EXT_ZFHMIN        (1 << 28)
  #define     RISCV_HWPROBE_EXT_ZIHINTNTL     (1 << 29)
  #define     RISCV_HWPROBE_EXT_ZVFH          (1 << 30)
-#define     RISCV_HWPROBE_EXT_ZVFHMIN       (1 << 31)
+#define     RISCV_HWPROBE_EXT_ZVFHMIN       (1ULL << 31)
  #define     RISCV_HWPROBE_EXT_ZFA           (1ULL << 32)
  #define     RISCV_HWPROBE_EXT_ZTSO          (1ULL << 33)
  #define     RISCV_HWPROBE_EXT_ZACAS         (1ULL << 34)

Queued, thanks.

r~