[PATCH] platform: Uses hart count as the default size of tlb info

Xiang W wxjstz at 126.com
Wed Oct 11 20:59:39 PDT 2023


在 2023-10-12星期四的 11:29 +0800,Inochi Amaoto写道:
> For platform with high number of harts, it is better to auto detect a
> suitable number of entries in tlb fifo. Since allocating tlb entry for
> all online harts can reduce the wait time significantly, using the
> number of the online harts can make most platforms happy. This auto
> detection can avoid most duplicate code for setting tlb fifo size.
> 
> Signed-off-by: Inochi Amaoto <inochiama at outlook.com>
Missing fix for sbi_platform_tlb_fifo_num_entries. Then remove 
SBI_PLATFORM_TLB_FIFO_NUM_ENTRIES.

Regards,
Xiang W

> ---
>  platform/generic/platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/platform/generic/platform.c b/platform/generic/platform.c
> index 66a0b77..4246efd 100644
> --- a/platform/generic/platform.c
> +++ b/platform/generic/platform.c
> @@ -260,7 +260,7 @@ static u32 generic_tlb_num_entries(void)
>  {
>  	if (generic_plat && generic_plat->tlb_num_entries)
>  		return generic_plat->tlb_num_entries(generic_plat_match);
> -	return SBI_PLATFORM_TLB_FIFO_NUM_ENTRIES;
> +	return sbi_scratch_last_hartindex() + 1;
>  }
>  
>  static int generic_pmu_init(void)
> -- 
> 2.42.0
> 
> 




More information about the opensbi mailing list