* [PATCH] riscv: hwprobe: use _BITULL() rather than BIT() in MIPS vendor uapi header
@ 2026-09-17 6:23 Zongmin Zhou
2026-09-17 13:00 ` Jesse Taube
2026-09-19 0:47 ` [PATCH] " Paul Walmsley
0 siblings, 2 replies; 4+ messages in thread
From: Zongmin Zhou @ 2026-09-17 6:23 UTC (permalink / raw)
To: pjw, palmer, aou, alex; +Cc: linux-riscv, linux-kernel, Zongmin Zhou
From: Zongmin Zhou <zhouzongmin@kylinos.cn>
BIT() is a kernel-internal macro that is not available to userspace, but
the MIPS vendor extension uapi header uses it without defining or
including it. Any userspace program that includes this header and uses
RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL fails to build.
Use _BITULL(0) from linux/const.h instead, which keeps the value at 1,
so there is no ABI change.
Fixes: bb4b0f8a1bcb ("riscv: hwprobe: Add MIPS vendor extension probing")
Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn>
---
arch/riscv/include/uapi/asm/vendor/mips.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/riscv/include/uapi/asm/vendor/mips.h b/arch/riscv/include/uapi/asm/vendor/mips.h
index e65ab268b265..a31c23afe74f 100644
--- a/arch/riscv/include/uapi/asm/vendor/mips.h
+++ b/arch/riscv/include/uapi/asm/vendor/mips.h
@@ -1,3 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#define RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL BIT(0)
+#include <linux/const.h>
+
+#define RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL _BITULL(0)
--
2.34.1
No virus found
Checked by Hillstone Network AntiVirus
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] riscv: hwprobe: use _BITULL() rather than BIT() in MIPS vendor uapi header
2026-09-17 6:23 [PATCH] riscv: hwprobe: use _BITULL() rather than BIT() in MIPS vendor uapi header Zongmin Zhou
@ 2026-09-17 13:00 ` Jesse Taube
2026-09-18 7:36 ` [PATCH v2] " Zongmin Zhou
2026-09-19 0:47 ` [PATCH] " Paul Walmsley
1 sibling, 1 reply; 4+ messages in thread
From: Jesse Taube @ 2026-09-17 13:00 UTC (permalink / raw)
To: Zongmin Zhou
Cc: pjw, palmer, aou, alex, linux-riscv, linux-kernel, Zongmin Zhou
On Thu, Sep 17, 2026 at 3:54 AM Zongmin Zhou <min_halo@163.com> wrote:
>
> From: Zongmin Zhou <zhouzongmin@kylinos.cn>
>
> BIT() is a kernel-internal macro that is not available to userspace, but
> the MIPS vendor extension uapi header uses it without defining or
> including it. Any userspace program that includes this header and uses
> RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL fails to build.
Maybe CC stable?
>
> Use _BITULL(0) from linux/const.h instead, which keeps the value at 1,
> so there is no ABI change.
>
> Fixes: bb4b0f8a1bcb ("riscv: hwprobe: Add MIPS vendor extension probing")
> Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn>
Reviewed-by: Jesse Taube <jtaubepe@redhat.com>
> ---
> arch/riscv/include/uapi/asm/vendor/mips.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/include/uapi/asm/vendor/mips.h b/arch/riscv/include/uapi/asm/vendor/mips.h
> index e65ab268b265..a31c23afe74f 100644
> --- a/arch/riscv/include/uapi/asm/vendor/mips.h
> +++ b/arch/riscv/include/uapi/asm/vendor/mips.h
> @@ -1,3 +1,5 @@
> /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
>
> -#define RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL BIT(0)
> +#include <linux/const.h>
> +
> +#define RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL _BITULL(0)
This changes the type from `unsigned long` to `unsigned long long`, though the
type when passed to `hwprobe` is `unsigned long long` so it doesn't
break anything.
Thanks,
Jesse Taube
> --
> 2.34.1
>
>
> No virus found
> Checked by Hillstone Network AntiVirus
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
>
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v2] riscv: hwprobe: use _BITULL() rather than BIT() in MIPS vendor uapi header
2026-09-17 13:00 ` Jesse Taube
@ 2026-09-18 7:36 ` Zongmin Zhou
0 siblings, 0 replies; 4+ messages in thread
From: Zongmin Zhou @ 2026-09-18 7:36 UTC (permalink / raw)
To: jtaubepe; +Cc: alex, aou
From: Zongmin Zhou <zhouzongmin@kylinos.cn>
BIT() is a kernel-internal macro that is not available to userspace, but
the MIPS vendor extension uapi header uses it without defining or
including it. Any userspace program that includes this header and uses
RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL fails to build.
Use _BITULL(0) from linux/const.h instead, which keeps the value at 1,
so there is no ABI change.
Fixes: bb4b0f8a1bcb ("riscv: hwprobe: Add MIPS vendor extension probing")
Cc: stable@vger.kernel.org
Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn>
Reviewed-by: Jesse Taube <jtaubepe@redhat.com>
---
Changes in v2:
- Add Cc: stable@vger.kernel.org as suggested by Jesse Taube.
- Collect Reviewed-by from Jesse Taube (no code changes).
arch/riscv/include/uapi/asm/vendor/mips.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/riscv/include/uapi/asm/vendor/mips.h b/arch/riscv/include/uapi/asm/vendor/mips.h
index e65ab268b265..a31c23afe74f 100644
--- a/arch/riscv/include/uapi/asm/vendor/mips.h
+++ b/arch/riscv/include/uapi/asm/vendor/mips.h
@@ -1,3 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#define RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL BIT(0)
+#include <linux/const.h>
+
+#define RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL _BITULL(0)
--
2.34.1
No virus found
Checked by Hillstone Network AntiVirus
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] riscv: hwprobe: use _BITULL() rather than BIT() in MIPS vendor uapi header
2026-09-17 6:23 [PATCH] riscv: hwprobe: use _BITULL() rather than BIT() in MIPS vendor uapi header Zongmin Zhou
2026-09-17 13:00 ` Jesse Taube
@ 2026-09-19 0:47 ` Paul Walmsley
1 sibling, 0 replies; 4+ messages in thread
From: Paul Walmsley @ 2026-09-19 0:47 UTC (permalink / raw)
To: Zongmin Zhou
Cc: pjw, palmer, aou, alex, linux-riscv, linux-kernel, Zongmin Zhou
On Thu, 17 Sep 2026, Zongmin Zhou wrote:
> From: Zongmin Zhou <zhouzongmin@kylinos.cn>
>
> BIT() is a kernel-internal macro that is not available to userspace, but
> the MIPS vendor extension uapi header uses it without defining or
> including it. Any userspace program that includes this header and uses
> RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL fails to build.
>
> Use _BITULL(0) from linux/const.h instead, which keeps the value at 1,
> so there is no ABI change.
>
> Fixes: bb4b0f8a1bcb ("riscv: hwprobe: Add MIPS vendor extension probing")
> Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn>
Thanks, queued for v7.3-rc.
- Paul
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-19 0:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 6:23 [PATCH] riscv: hwprobe: use _BITULL() rather than BIT() in MIPS vendor uapi header Zongmin Zhou
2026-09-17 13:00 ` Jesse Taube
2026-09-18 7:36 ` [PATCH v2] " Zongmin Zhou
2026-09-19 0:47 ` [PATCH] " Paul Walmsley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®