diff mbox series

[7/7] lib: sbi: show the number of PMP Reserved

Message ID tencent_0278C145ED7EC7275CC998B890DA46273E07@qq.com
State Changes Requested
Headers show
Series lib: sbi: Probe PMP locked entries and adjust first usable PMP index | expand

Commit Message

Yangyu Chen Dec. 7, 2023, 10:04 p.m. UTC
Some PMPs may be locked before OpenSBI starts. Mark index 0 to the
highest locked index of PMPs as reserved and show the number of PMPs
being reserved in Boot HART details to let the user know.

Signed-off-by: Yangyu Chen <cyy@cyyself.name>
---
 lib/sbi/sbi_init.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Anup Patel Dec. 12, 2023, 8:40 a.m. UTC | #1
On Fri, Dec 8, 2023 at 3:34 AM Yangyu Chen <cyy@cyyself.name> wrote:
>
> Some PMPs may be locked before OpenSBI starts. Mark index 0 to the
> highest locked index of PMPs as reserved and show the number of PMPs
> being reserved in Boot HART details to let the user know.
>
> Signed-off-by: Yangyu Chen <cyy@cyyself.name>

Looks good to me.

Reviewed-by: Anup Patel <anup@brainfault.org>

Regards,
Anup

> ---
>  lib/sbi/sbi_init.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
> index e723553..0d02186 100644
> --- a/lib/sbi/sbi_init.c
> +++ b/lib/sbi/sbi_init.c
> @@ -174,6 +174,8 @@ static void sbi_boot_print_hart(struct sbi_scratch *scratch, u32 hartid)
>         sbi_printf("Boot HART Base ISA        : %s\n", str);
>         sbi_hart_get_extensions_str(scratch, str, sizeof(str));
>         sbi_printf("Boot HART ISA Extensions  : %s\n", str);
> +       sbi_printf("Boot HART PMP Reserved    : %d\n",
> +                  sbi_hart_pmp_reserved(scratch));
>         sbi_printf("Boot HART PMP Count       : %d\n",
>                    sbi_hart_pmp_count(scratch));
>         sbi_printf("Boot HART PMP Granularity : %lu\n",
> --
> 2.43.0
>
>
> --
> opensbi mailing list
> opensbi@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi
diff mbox series

Patch

diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
index e723553..0d02186 100644
--- a/lib/sbi/sbi_init.c
+++ b/lib/sbi/sbi_init.c
@@ -174,6 +174,8 @@  static void sbi_boot_print_hart(struct sbi_scratch *scratch, u32 hartid)
 	sbi_printf("Boot HART Base ISA        : %s\n", str);
 	sbi_hart_get_extensions_str(scratch, str, sizeof(str));
 	sbi_printf("Boot HART ISA Extensions  : %s\n", str);
+	sbi_printf("Boot HART PMP Reserved    : %d\n",
+		   sbi_hart_pmp_reserved(scratch));
 	sbi_printf("Boot HART PMP Count       : %d\n",
 		   sbi_hart_pmp_count(scratch));
 	sbi_printf("Boot HART PMP Granularity : %lu\n",