maylay has quit [Read error: Connection reset by peer]
maylay has joined #riscv
dramforever[m] has joined #riscv
<dramforever[m]>
<Eric43> "it seems excessive to have to..." <- linux dynamically checks at runtime whether the processor has zbb and selects which function to use, grep for `ALTERNATIVE` to see
<dramforever[m]>
this way the kernel works whether or not it can use zbb
maylay has quit [Read error: Connection reset by peer]
<dramforever[m]>
the ifdef on strcmp_zbb is there so it doesn't try to include useless code if the toolchain can't assemble zbb instructions, or if the support is disabled altogether
lucmann has joined #riscv
JanC_ has joined #riscv
JanC_ is now known as JanC
maylay has joined #riscv
<dramforever[m]>
i guess there is just no way to raise the baseline to above rv{32,64}imac
<Eric90>
dramforever i wouldn't want to check it at runtime. it would be during compilation. if the architecture supports the extension, those instructions would be generated instead of the default
BootLayer has joined #riscv
<dramforever[m]>
Eric90: then there's no idiomatic way to do that, you need to add your own configurations
<Eric90>
talks about how various preprocessor definitions exist depending upon the architecture. it mentions that if an extension like zbb is present, the macro __riscv_zbb will be defined
<Eric90>
on that page is also the value for XLEN, with the __riscv_xlen macro. an example file in the kernel, /arch/riscv/include/asm/cmpxchg.h uses this macro. yet elsewhere in the code i see CONFIG_64BIT used. it's confusing to me because i don't know what's the proper convention. is it the __riscv_* macros? or is it the other ones like RISCV_ISA_EXT_ZBB?
<dramforever[m]>
okay, my answer remains that there is no existing way to do what you want in linux, but let's explain everything you've mentioned
<dramforever[m]>
RISCV_ISA_EXT_ZBB: it's a constant 30, has nothing to do with config
<dramforever[m]>
TOOLCHAIN_HAS_ZBB: there's no such identifier
<dramforever[m]>
that's the "definitely not" out of the way
<dramforever[m]>
CONFIG_TOOLCHAIN_HAS_ZBB: The assembler can handle zbb instructions at all
<dramforever[m]>
CONFIG_RISCV_ISA_ZBB: Whether to use Zbb when it's helpful. Does not raise the baseline requirements of the kernel
<dramforever[m]>
In other words if you enable it the kernel will take advantage of Zbb if available at runtime, and use non-Zbb if not available
<dramforever[m]>
__riscv_zbb: You have -march=...zbb... on the compiler command line. This will never happen on Linux
<dramforever[m]>
in conclusion, none of the above is what you want
<Eric90>
thank you. it's definitely way more involved than i expected. considering how many extensions there are, it seems like an explosion of combinations the kernel would have to check for during runtime to see what's available and what's not
hexdump0815 has quit [Ping timeout: 252 seconds]
hexdump0815 has joined #riscv
Eric90 has quit [Ping timeout: 240 seconds]
Eric96 has joined #riscv
BootLayer has quit [Quit: Leaving]
JanC_ has joined #riscv
JanC has quit [Killed (zirconium.libera.chat (Nickname regained by services))]
JanC_ is now known as JanC
Eric96 has quit [Quit: Client closed]
lucmann has quit [Remote host closed the connection]
paulk-bis has joined #riscv
paulk has quit [Ping timeout: 248 seconds]
ldevulder has joined #riscv
teiresias has quit [Ping timeout: 248 seconds]
teiresias has joined #riscv
ungeskriptet has quit [Remote host closed the connection]
cleger has joined #riscv
naoki has quit [Remote host closed the connection]