summaryrefslogtreecommitdiffstats
path: root/arch/riscv/Makefile
diff options
context:
space:
mode:
authorDao Lu <daolu@rivosinc.com>2022-06-20 13:15:25 -0700
committerPalmer Dabbelt <palmer@rivosinc.com>2022-08-11 08:03:49 -0700
commit8eb060e10185cfc97ef0200d197ec246ba0f9f8c (patch)
tree5d72c5ef54b14b6b84b202ceae056cb401cf4284 /arch/riscv/Makefile
parent3aefb2ee5bdd4a8976298415a5a017bf9844bfd5 (diff)
downloadlinux-stable-8eb060e10185cfc97ef0200d197ec246ba0f9f8c.tar.gz
linux-stable-8eb060e10185cfc97ef0200d197ec246ba0f9f8c.tar.bz2
linux-stable-8eb060e10185cfc97ef0200d197ec246ba0f9f8c.zip
arch/riscv: add Zihintpause support
Implement support for the ZiHintPause extension. The PAUSE instruction is a HINT that indicates the current hart’s rate of instruction retirement should be temporarily reduced or paused. Reviewed-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Dao Lu <daolu@rivosinc.com> [Palmer: Some minor merge conflicts.] Link: https://lore.kernel.org/all/20220620201530.3929352-1-daolu@rivosinc.com/ Link: https://lore.kernel.org/all/20220811053356.17375-1-palmer@rivosinc.com/ Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/Makefile')
-rw-r--r--arch/riscv/Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 42d7ff8730aa..3fa8ef336822 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -60,6 +60,10 @@ riscv-march-$(toolchain-need-zicsr-zifencei) := $(riscv-march-y)_zicsr_zifencei
toolchain-supports-zicbom := $(call cc-option-yn, -march=$(riscv-march-y)_zicbom)
riscv-march-$(toolchain-supports-zicbom) := $(riscv-march-y)_zicbom
+# Check if the toolchain supports Zihintpause extension
+toolchain-supports-zihintpause := $(call cc-option-yn, -march=$(riscv-march-y)_zihintpause)
+riscv-march-$(toolchain-supports-zihintpause) := $(riscv-march-y)_zihintpause
+
KBUILD_CFLAGS += -march=$(subst fd,,$(riscv-march-y))
KBUILD_AFLAGS += -march=$(riscv-march-y)