[PATCH 1/2] lib: sbi_mpxy: Enable MPXY channel MSI availability determination

David E. Garcia Porras david.garcia at aheadcomputing.com
Thu Apr 9 07:57:15 PDT 2026


Use imsic_get_data() to determine MSI availability for each MPXY
channel based on IMSIC presence per hart, instead of unconditionally
disabling it.

Add a static inline stub for imsic_get_data() when CONFIG_IRQCHIP_IMSIC
is not enabled.

Signed-off-by: David E. Garcia Porras <david.garcia at aheadcomputing.com>
---
 include/sbi_utils/irqchip/imsic.h | 2 ++
 lib/sbi/sbi_mpxy.c                | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/sbi_utils/irqchip/imsic.h b/include/sbi_utils/irqchip/imsic.h
index 88dd3cfb..68f3c4ad 100644
--- a/include/sbi_utils/irqchip/imsic.h
+++ b/include/sbi_utils/irqchip/imsic.h
@@ -54,6 +54,8 @@ static inline void imsic_local_irqchip_init(void) { }
 
 static inline int imsic_data_check(struct imsic_data *imsic) { return 0; }
 
+static inline struct imsic_data *imsic_get_data(u32 hartindex) { return NULL; }
+
 #endif
 
 #endif
diff --git a/lib/sbi/sbi_mpxy.c b/lib/sbi/sbi_mpxy.c
index a83cf16c..8ff52bb6 100644
--- a/lib/sbi/sbi_mpxy.c
+++ b/lib/sbi/sbi_mpxy.c
@@ -20,6 +20,7 @@
 #include <sbi/sbi_bitops.h>
 #include <sbi/sbi_console.h>
 #include <sbi/sbi_byteorder.h>
+#include <sbi_utils/irqchip/imsic.h>
 
 /** Shared memory size across all harts */
 static unsigned long mpxy_shmem_size = PAGE_SIZE;
@@ -255,11 +256,10 @@ static int domain_mpxy_state_data_setup(struct sbi_domain *dom,
 			return SBI_ENOMEM;
 
 		/*
-		 * TODO: Proper support for checking msi support from
-		 * platform. Currently disable msi and sse and use
-		 * polling
+		 * TODO: Proper support for checking sse support from
+		 * platform. Currently disable sse and use polling
 		 */
-		ms->msi_avail = false;
+		ms->msi_avail = !!imsic_get_data(i);
 		ms->sse_avail = false;
 
 		sbi_mpxy_shmem_disable(ms);
-- 
2.43.0




More information about the opensbi mailing list