lib: utils/ipi: Fix size check in aclint_mswi_cold_init()

Currently, the ACLINT MSWI size check is forcing size to be at least
0x4000. This is inappropriate check because most systems will never
utilize full 16KB for a single ACLINT MSWI device so instead we should
check that ACLINT MSWI size is enough for on the associated HARTs.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Dong Du <Dd_nirvana@sjtu.edu.cn>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
Anup Patel 2022-01-06 09:02:45 +05:30 committed by Anup Patel
parent 48f91ee9c9
commit 5b9960379f
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ int aclint_mswi_cold_init(struct aclint_mswi_data *mswi)
/* Sanity checks */
if (!mswi || (mswi->addr & (ACLINT_MSWI_ALIGN - 1)) ||
(mswi->size < ACLINT_MSWI_SIZE) ||
(mswi->size < (mswi->hart_count * sizeof(u32))) ||
(mswi->first_hartid >= SBI_HARTMASK_MAX_BITS) ||
(mswi->hart_count > ACLINT_MSWI_MAX_HARTS))
return SBI_EINVAL;