Skip to contentSkip to conversation

riscv: alternative only works on !XIP_KERNEL

PATCH In review Jisheng Zhang 2 participants 2 messages Feb 10, 2022 – Mar 10, 2022 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: alternative only works on !XIP_KERNEL

The alternative mechanism needs runtime code patching, it can't work on XIP_KERNEL. And the errata workarounds are implemented via the alternative mechanism. So add !XIP_KERNEL dependency for alternative and erratas.

---
 arch/riscv/Kconfig.erratas | 1 +
 arch/riscv/Kconfig.socs    | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/riscv/Kconfig.erratas +1 -0
index b44d6ecdb46e..0aacd7052585 100644
@@ -2,6 +2,7 @@ menu "CPU errata selection"
 
 config RISCV_ERRATA_ALTERNATIVE
 	bool "RISC-V alternative scheme"
+	depends on !XIP_KERNEL
 	default y
 	help
 	  This Kconfig allows the kernel to automatically patch the
arch/riscv/Kconfig.socs +2 -2
index 6ec44a22278a..c112ab2a9052 100644
@@ -14,8 +14,8 @@ config SOC_SIFIVE
 	select CLK_SIFIVE
 	select CLK_SIFIVE_PRCI
 	select SIFIVE_PLIC
-	select RISCV_ERRATA_ALTERNATIVE
-	select ERRATA_SIFIVE
+	select RISCV_ERRATA_ALTERNATIVE if !XIP_KERNEL
+	select ERRATA_SIFIVE if !XIP_KERNEL
 	help
 	  This enables support for SiFive SoC platform hardware.
 
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 28 lines · On Thu, 10 Feb 2022 08:49:43 PST (-0800), [email protected] wrote:

The alternative mechanism needs runtime code patching, it can't work on XIP_KERNEL. And the errata workarounds are implemented via the alternative mechanism. So add !XIP_KERNEL dependency for alternative and erratas.

---
 arch/riscv/Kconfig.erratas | 1 +
 arch/riscv/Kconfig.socs    | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/riscv/Kconfig.erratas +1 -0
index b44d6ecdb46e..0aacd7052585 100644
@@ -2,6 +2,7 @@ menu "CPU errata selection"
 
 config RISCV_ERRATA_ALTERNATIVE
 	bool "RISC-V alternative scheme"
+	depends on !XIP_KERNEL
 	default y
 	help
 	  This Kconfig allows the kernel to automatically patch the
arch/riscv/Kconfig.socs +0 -0
index 6ec44a22278a..c112ab2a9052 100644

arch/riscv/Kconfig.socs config SOC_SIFIVE · line 20

Quoted 9 lines
arch/riscv/Kconfig.socs +2 -2
@@ -14,8 +14,8 @@ config SOC_SIFIVE
 	select CLK_SIFIVE
 	select CLK_SIFIVE_PRCI
 	select SIFIVE_PLIC
-	select RISCV_ERRATA_ALTERNATIVE
-	select ERRATA_SIFIVE
+	select RISCV_ERRATA_ALTERNATIVE if !XIP_KERNEL
+	select ERRATA_SIFIVE if !XIP_KERNEL
 	help
 	  This enables support for SiFive SoC platform hardware.

Thanks, this is on fixes.