summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorManish Pandey <manish.pandey2@arm.com>2023-10-26 11:14:21 +0100
committerManish Pandey <manish.pandey2@arm.com>2023-11-01 18:42:34 +0000
commita7eff3477dcf3624c74f5217419b1a27b7ebd2aa (patch)
treee6254792570028f25881908de02a909b359dad4b /services
parente712f92408947a5fea79f2f1e106823929dec8ca (diff)
fix(sdei): ensure that interrupt ID is valid
As per SDEI spec (section 5.1.14.1), SDEI_INTERRUPT_BIND interface expects a valid PPI or SPI. SGI's are not allowed to be bounded. Current check in the code only checks for an SGI and returns invalid ID. This check is insufficient as it will not catch architecturally invalid interrupt IDs. Modify the check to ensure that interrupt is either PPI or SPI. Signed-off-by: Manish Pandey <manish.pandey2@arm.com> Change-Id: I52eb0a6d7f88a12f6816cff9b68fb3a7ca12cbb7
Diffstat (limited to 'services')
-rw-r--r--services/std_svc/sdei/sdei_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/std_svc/sdei/sdei_main.c b/services/std_svc/sdei/sdei_main.c
index 44178eddd..0fd3c1d32 100644
--- a/services/std_svc/sdei/sdei_main.c
+++ b/services/std_svc/sdei/sdei_main.c
@@ -710,8 +710,8 @@ static int sdei_interrupt_bind(unsigned int intr_num)
sdei_ev_map_t *map;
bool retry = true, shared_mapping;
- /* SGIs are not allowed to be bound */
- if (plat_ic_is_sgi(intr_num) != 0)
+ /* Interrupt must be either PPI or SPI */
+ if (!(plat_ic_is_ppi(intr_num) || plat_ic_is_spi(intr_num)))
return SDEI_EINVAL;
shared_mapping = (plat_ic_is_spi(intr_num) != 0);