[PATCH] linux-user/riscv: Fix definition of RISCV_HWPROBE_EXT_ZVFHMIN

Yao Zi posted 1 patch 4 hours ago
linux-user/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] linux-user/riscv: Fix definition of RISCV_HWPROBE_EXT_ZVFHMIN
Posted by Yao Zi 4 hours ago
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.

Link: https://github.com/torvalds/linux/commit/5ea6764d9095e234b024054f75ebbccc4f0eb146
Fixes: a3432cf227 ("linux-user/riscv: Sync hwprobe keys with Linux")
Cc: qemu-stable@nongnu.org
Signed-off-by: Yao Zi <ziyao@disroot.org>
---
 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1354e75694..ec1a77f23a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -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)
-- 
2.46.2
Re: [PATCH] linux-user/riscv: Fix definition of RISCV_HWPROBE_EXT_ZVFHMIN
Posted by Richard Henderson 2 hours ago
On 10/22/24 09:01, Yao Zi wrote:
> 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.
> 
> Link: https://github.com/torvalds/linux/commit/5ea6764d9095e234b024054f75ebbccc4f0eb146
> Fixes: a3432cf227 ("linux-user/riscv: Sync hwprobe keys with Linux")
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Yao Zi <ziyao@disroot.org>
> ---
>   linux-user/syscall.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 1354e75694..ec1a77f23a 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -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)

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

Queued, thanks.

r~