Skip to content

Commit

Permalink
riscv:Kconfig: Don't enable ZAWRS if toolchain does not support it
Browse files Browse the repository at this point in the history
Kconfig: If the toolchain or cpu does not support the zawrs extension
we should not enable it.

th1520_defconfig: Enable CONFIG_JUMP_LABEL to optimize performance
and resolve compilation errors.

Signed-off-by: Chen Pei <[email protected]>
  • Loading branch information
cp0613 authored and RevySR committed Sep 3, 2024
1 parent ef58212 commit 7c000ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/riscv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,17 @@ config RISCV_ISA_V_DEFAULT_ENABLE

If you don't know what to do here, say Y.

config TOOLCHAIN_HAS_ZAWRS
bool
default y
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zawrs)
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zawrs)
depends on AS_HAS_OPTION_ARCH

config RISCV_ISA_ZAWRS
bool "Zawrs extension support for more efficient busy waiting"
depends on RISCV_ALTERNATIVE
depends on TOOLCHAIN_HAS_ZAWRS
default y
help
The Zawrs extension defines instructions to be used in polling loops
Expand Down
1 change: 1 addition & 0 deletions arch/riscv/configs/th1520_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CONFIG_CPU_IDLE=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
CONFIG_ACPI=y
CONFIG_JUMP_LABEL=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_BLK_DEV_THROTTLING=y
Expand Down

0 comments on commit 7c000ca

Please sign in to comment.