Skip to contentSkip to conversation

RISC-V: hwprobe: Always use u64 for extension bits

PATCH Applied Andrew Jones 2 participants 2 messages Nov 1, 2023 – Dec 7, 2023 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RISC-V: hwprobe: Always use u64 for extension bits

Extensions are getting added quickly and their hwprobe bits will soon exceed 31 (which pair values accommodate, since they're of type u64). However, in one tree, where a bunch of extensions got merged prior to zicboz, zicboz already got pushed to bit 32. Pushing it exposed a 32-bit compilation bug, since unsigned long was used instead of u64.

Fixes 9c7646d5ffd2 ("RISC-V: hwprobe: Expose Zicboz extension and its block size")
---
 arch/riscv/kernel/sys_riscv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/sys_riscv.c +1 -1
index c712037dbe10..a2ca5b7756a5 100644
@@ -169,7 +169,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
 	pair->value &= ~missing;
 }
 
-static bool hwprobe_ext0_has(const struct cpumask *cpus, unsigned long ext)
+static bool hwprobe_ext0_has(const struct cpumask *cpus, u64 ext)
 {
 	struct riscv_hwprobe pair;
 
Signature · 7 lines
2.41.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#1 lore raw
This patch was applied to riscv/linux.git (fixes) by Palmer Dabbelt <[email protected]>:

Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <[email protected]>:

Quoted 6 lines · On Wed, 1 Nov 2023 15:19:09 +0100 you wrote:

Extensions are getting added quickly and their hwprobe bits will soon exceed 31 (which pair values accommodate, since they're of type u64). However, in one tree, where a bunch of extensions got merged prior to zicboz, zicboz already got pushed to bit 32. Pushing it exposed a 32-bit compilation bug, since unsigned long was used instead of u64.

Quoted 6 lines
Fixes 9c7646d5ffd2 ("RISC-V: hwprobe: Expose Zicboz extension and its block size")

[...]

Here is the summary with links:
- [-next] RISC-V: hwprobe: Always use u64 for extension bits

    https://git.kernel.org/riscv/c/777c0d761be7

You are awesome, thank you!

Signature · 9 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv