On 15.03.2024 19:05, Oleksii Kurochko wrote: > Currently, RISC-V requires two extensions: _zbb and _zihintpause.
Do we really require Zbb already? > This patch introduces a compiler check to check if these extensions > are supported. > Additionally, it introduces the riscv/booting.txt file, which contains > information about the extensions that should be supported by the platform. > > In the future, a feature will be introduced to check whether an extension > is supported at runtime. > However, this feature requires functionality for parsing device tree > source (DTS), which is not yet available. Can't you query the CPU for its features? > --- a/xen/arch/riscv/arch.mk > +++ b/xen/arch/riscv/arch.mk > @@ -3,16 +3,22 @@ > > $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS)) > > -CFLAGS-$(CONFIG_RISCV_64) += -mabi=lp64 > +riscv-abi-$(CONFIG_RISCV_32) := -mabi=ilp32 > +riscv-abi-$(CONFIG_RISCV_64) := -mabi=lp64 > > riscv-march-$(CONFIG_RISCV_ISA_RV64G) := rv64g > riscv-march-$(CONFIG_RISCV_ISA_C) := $(riscv-march-y)c > > +extensions := $(call as-insn,$(CC) $(riscv-abi-y) > -march=$(riscv-march-y)_zbb,"",_zbb) \ > + $(call as-insn,$(CC) $(riscv-abi-y) > -march=$(riscv-march-y)_zihintpause,"pause",_zihintpause) Imo you want another helper macro here, where all one needs to pass in is the extension name (i.e. zbb and zihintpause as per above). That'll also help with line length, I hope. Jan
