summaryrefslogtreecommitdiff
path: root/lib/utils/ipi
diff options
context:
space:
mode:
authorAnup Patel <[email protected]>2022-01-06 09:02:45 +0530
committerAnup Patel <[email protected]>2022-01-11 18:17:07 +0530
commit5b9960379fae14b554c953b0d4139f4b1a57cd5e (patch)
treeffbb92363e0d24d9daf57d03da86ee8aff323bac /lib/utils/ipi
parent48f91ee9c960f048c4a7d1da4447d31e04931e38 (diff)
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 <[email protected]> Reviewed-by: Dong Du <[email protected]> Reviewed-by: Alistair Francis <[email protected]>
Diffstat (limited to 'lib/utils/ipi')
-rw-r--r--lib/utils/ipi/aclint_mswi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/ipi/aclint_mswi.c b/lib/utils/ipi/aclint_mswi.c
index a3de2f55..832e223f 100644
--- a/lib/utils/ipi/aclint_mswi.c
+++ b/lib/utils/ipi/aclint_mswi.c
@@ -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;