Skip to contentSkip to conversation

lib: sbi: increase the size of the string used for extension display

PATCH New Clément Léger 2 participants 2 messages Jan 23, 2025 – Feb 13, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: sbi: increase the size of the string used for extension display

With the "max" QEMU cpu, the displayed extension string is truncated due to the buffer being too small. Increase it to 256 to display the full set of extensions correctly.

---
 lib/sbi/sbi_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/sbi/sbi_init.c +1 -1
index 58030cf2..2feb37cd 100644
@@ -160,7 +160,7 @@ static void sbi_boot_print_domains(struct sbi_scratch *scratch)
 static void sbi_boot_print_hart(struct sbi_scratch *scratch, u32 hartid)
 {
 	int xlen;
-	char str[128];
+	char str[256];
 	const struct sbi_domain *dom = sbi_domain_thishart_ptr();
 
 	if (scratch->options & SBI_SCRATCH_NO_BOOT_PRINTS)
Signature · 1 line
2.47.1
Applied
#1 lore raw

PATCH 1/1 lib: sbi: increase the size of the string used for extension display

Quoted 6 lines · On Thu, Jan 23, 2025 at 8:32?PM Cl?ment L?ger <[email protected]> wrote:

With the "max" QEMU cpu, the displayed extension string is truncated due to the buffer being too small. Increase it to 256 to display the full set of extensions correctly.

LGTM.

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

Quoted 25 lines
---
 lib/sbi/sbi_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/sbi/sbi_init.c +1 -2
index 58030cf2..2feb37cd 100644
@@ -160,7 +160,7 @@ static void sbi_boot_print_domains(struct sbi_scratch *scratch)
 static void sbi_boot_print_hart(struct sbi_scratch *scratch, u32 hartid)
 {
        int xlen;
-       char str[128];
+       char str[256];
        const struct sbi_domain *dom = sbi_domain_thishart_ptr();
 
        if (scratch->options & SBI_SCRATCH_NO_BOOT_PRINTS)
--

2.47.1

--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi