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@outlook.com>
Acked-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
#define SBI_PLATFORM_HART_INDEX2ID_OFFSET (0x60 + (__SIZEOF_POINTER__ * 2))
#define SBI_PLATFORM_TLB_RANGE_FLUSH_LIMIT_DEFAULT (1UL << 12)
-#define SBI_PLATFORM_TLB_FIFO_NUM_ENTRIES 8
#ifndef __ASSEMBLER__
{
if (plat && sbi_platform_ops(plat)->get_tlb_num_entries)
return sbi_platform_ops(plat)->get_tlb_num_entries();
- return SBI_PLATFORM_TLB_FIFO_NUM_ENTRIES;
+ return sbi_scratch_last_hartindex() + 1;
}
/**
{
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)