diff options
| author | Xiang W <[email protected]> | 2023-09-06 21:10:03 +0800 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2023-09-10 11:21:05 +0530 |
| commit | cacfba32cc9541b7b9f838df43c1f2bd43222d3a (patch) | |
| tree | 5b38c9301bee234437581f4c8603a496e2165066 /include | |
| parent | 901d3d7bff5a511b5f320aad8a0d65e79c95d09c (diff) | |
platform: Allow platforms to specify the size of tlb fifo
For some platforms with a particularly high number of harts, if the
tlb fifo is too small, it case harts to wait. Platforms should be
allowed to specify the size of the tlb fifo.
Signed-off-by: Xiang W <[email protected]>
Signed-off-by: Xing Xiaoguang <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sbi/sbi_platform.h | 18 | ||||
| -rw-r--r-- | include/sbi/sbi_tlb.h | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h index 3e9616f6..e6a4a317 100644 --- a/include/sbi/sbi_platform.h +++ b/include/sbi/sbi_platform.h @@ -41,6 +41,7 @@ #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__ @@ -125,6 +126,9 @@ struct sbi_platform_operations { /** Get tlb flush limit value **/ u64 (*get_tlbr_flush_limit)(void); + /** Get tlb fifo num entries*/ + u32 (*get_tlb_num_entries)(void); + /** Initialize platform timer for current HART */ int (*timer_init)(bool cold_boot); /** Exit platform timer for current HART */ @@ -326,6 +330,20 @@ static inline u64 sbi_platform_tlbr_flush_limit(const struct sbi_platform *plat) } /** + * Get platform specific tlb fifo num entries. + * + * @param plat pointer to struct sbi_platform + * + * @return number of tlb fifo entries +*/ +static inline u32 sbi_platform_tlb_fifo_num_entries(const struct sbi_platform *plat) +{ + 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; +} + +/** * Get total number of HARTs supported by the platform * * @param plat pointer to struct sbi_platform diff --git a/include/sbi/sbi_tlb.h b/include/sbi/sbi_tlb.h index 48f1962d..55dcab08 100644 --- a/include/sbi/sbi_tlb.h +++ b/include/sbi/sbi_tlb.h @@ -20,8 +20,6 @@ /* clang-format on */ -#define SBI_TLB_FIFO_NUM_ENTRIES 8 - struct sbi_scratch; struct sbi_tlb_info { |
