Skip to contentSkip to conversation

RISC-V: Schedule SBI-0.1 for removal

PATCH In review Palmer Dabbelt 3 participants 3 messages Sep 17, 2024 – Sep 25, 2024 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 RISC-V: Schedule SBI-0.1 for removal

We've said we're going to deprecate SBI-0.1 for a while now, but I didn't find that written down anywhere. So mark SBI-0.1 as deprecated and print a timeline for that deprecation on systems that probe it.

---
 arch/riscv/Kconfig      | 17 +++++++++++++----
 arch/riscv/kernel/sbi.c |  1 +
 2 files changed, 14 insertions(+), 4 deletions(-)
arch/riscv/Kconfig +13 -4
index f00d474e13d0..fad197d5e122 100644
@@ -838,12 +838,21 @@ menu "Kernel features"
 
 source "kernel/Kconfig.hz"
 
-config RISCV_SBI_V01
-	bool "SBI v0.1 support"
+config RISCV_SBI_V01_DEPRECATED
+	bool "SBI v0.1 support (DEPRECATED)"
 	depends on RISCV_SBI
 	help
-	  This config allows kernel to use SBI v0.1 APIs. This will be
-	  deprecated in future once legacy M-mode software are no longer in use.
+	  This config allows kernel to use SBI v0.1 APIs.
+
+	  SBI v0.1 support has been deprecated and will be removed after the
+	  2025 LTS.
+
+	  If unsure what to do here, say N.
+
+config RISCV_SBI_V01
+	bool
+	default y
+	depends on RISCV_SBI_V01_DEPRECATED
 
 config RISCV_BOOT_SPINWAIT
 	bool "Spinwait booting method"
arch/riscv/kernel/sbi.c +1 -0
index 837bdab2601b..1209a4e53ed1 100644
@@ -686,6 +686,7 @@ void __init sbi_init(void)
 			sbi_debug_console_available = true;
 		}
 	} else {
+		pr_warn("SBI-0.1 is deprecated and scheduled for removal after the 2025 LTS");
 		__sbi_set_timer = __sbi_set_timer_v01;
 		__sbi_send_ipi	= __sbi_send_ipi_v01;
 		__sbi_rfence	= __sbi_rfence_v01;
Signature · 7 lines
2.45.2


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Reviewed-by on v2 1/1
#1 lore raw
Quoted 27 lines · Palmer Dabbelt

We've said we're going to deprecate SBI-0.1 for a while now, but I didn't find that written down anywhere. So mark SBI-0.1 as deprecated and print a timeline for that deprecation on systems that probe it.

---
 arch/riscv/Kconfig      | 17 +++++++++++++----
 arch/riscv/kernel/sbi.c |  1 +
 2 files changed, 14 insertions(+), 4 deletions(-)
arch/riscv/Kconfig +3 -4
index f00d474e13d0..fad197d5e122 100644
@@ -838,12 +838,21 @@ menu "Kernel features"
 
 source "kernel/Kconfig.hz"
 
-config RISCV_SBI_V01
-	bool "SBI v0.1 support"
+config RISCV_SBI_V01_DEPRECATED
+	bool "SBI v0.1 support (DEPRECATED)"
 	depends on RISCV_SBI
 	help
-	  This config allows kernel to use SBI v0.1 APIs. This will be
-	  deprecated in future once legacy M-mode software are no longer in use.
+	  This config allows kernel to use SBI v0.1 APIs.

arch/riscv/Kconfig menu "Kernel features" · line 855

Quoted 10 lines
arch/riscv/Kconfig +10 -0
+
+	  SBI v0.1 support has been deprecated and will be removed after the
+	  2025 LTS.
+
+	  If unsure what to do here, say N.
+
+config RISCV_SBI_V01
+	bool
+	default y
+	depends on RISCV_SBI_V01_DEPRECATED

I think this could be simplified to

def_bool RISCV_SBI_V01_DEPRECATED

arch/riscv/kernel/sbi.c void __init sbi_init(void) · line 689

Quoted 12 lines
arch/riscv/Kconfig +0 -0
 config RISCV_BOOT_SPINWAIT
 	bool "Spinwait booting method"
arch/riscv/kernel/sbi.c +1 -0
index 837bdab2601b..1209a4e53ed1 100644
@@ -686,6 +686,7 @@ void __init sbi_init(void)
 			sbi_debug_console_available = true;
 		}
 	} else {
+		pr_warn("SBI-0.1 is deprecated and scheduled for removal after the 2025 LTS");

I don't think pr_warn appends a newline.

Quoted 6 lines
arch/riscv/kernel/sbi.c +0 -0
 		__sbi_set_timer = __sbi_set_timer_v01;
 		__sbi_send_ipi	= __sbi_send_ipi_v01;
 		__sbi_rfence	= __sbi_rfence_v01;
Signature · 1 line
2.45.2

Otherwise,

Thanks,
drew

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

Reviewed-by
#2 lore raw
Quoted 44 lines · Andrew Jones
Quoted 27 lines · Palmer Dabbelt

We've said we're going to deprecate SBI-0.1 for a while now, but I didn't find that written down anywhere. So mark SBI-0.1 as deprecated and print a timeline for that deprecation on systems that probe it.

---
  arch/riscv/Kconfig      | 17 +++++++++++++----
  arch/riscv/kernel/sbi.c |  1 +
  2 files changed, 14 insertions(+), 4 deletions(-)
arch/riscv/Kconfig +3 -4
index f00d474e13d0..fad197d5e122 100644
@@ -838,12 +838,21 @@ menu "Kernel features"
 
  source "kernel/Kconfig.hz"
 
-config RISCV_SBI_V01
-	bool "SBI v0.1 support"
+config RISCV_SBI_V01_DEPRECATED
+	bool "SBI v0.1 support (DEPRECATED)"
  	depends on RISCV_SBI
  	help
-	  This config allows kernel to use SBI v0.1 APIs. This will be
-	  deprecated in future once legacy M-mode software are no longer in use.
+	  This config allows kernel to use SBI v0.1 APIs.

arch/riscv/Kconfig menu "Kernel features" · line 855

Quoted 10 lines
arch/riscv/Kconfig +10 -0
+
+	  SBI v0.1 support has been deprecated and will be removed after the
+	  2025 LTS.
+
+	  If unsure what to do here, say N.
+
+config RISCV_SBI_V01
+	bool
+	default y
+	depends on RISCV_SBI_V01_DEPRECATED

I think this could be simplified to

def_bool RISCV_SBI_V01_DEPRECATED

Quoted 1 line
Quoted 21 lines

arch/riscv/kernel/sbi.c void __init sbi_init(void) · line 689

Quoted 11 lines

config RISCV_BOOT_SPINWAIT
bool "Spinwait booting method"

arch/riscv/kernel/sbi.c +1 -0
index 837bdab2601b..1209a4e53ed1 100644
@@ -686,6 +686,7 @@ void __init sbi_init(void)
  			sbi_debug_console_available = true;
  		}
  	} else {
+		pr_warn("SBI-0.1 is deprecated and scheduled for removal after the 2025 LTS");

I don't think pr_warn appends a newline.

Quoted 6 lines
arch/riscv/kernel/sbi.c +0 -0
  		__sbi_set_timer = __sbi_set_timer_v01;
  		__sbi_send_ipi	= __sbi_send_ipi_v01;
  		__sbi_rfence	= __sbi_rfence_v01;
Signature · 1 line
2.45.2

With Drew's comment addressed:

Quoted 11 lines

Otherwise,

Thanks,
drew

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv