mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-07-26 15:51:38 +01:00
lib: utils/mpxy: bind channel access to owning domain
The MPXY framework currently stores registered channels in a global list and exposes them to all callers. However, the intended model is that each channel is assigned to a single supervisor domain at boot and remains owned by that domain for its lifetime. Introduce fixed owner-domain tracking in struct sbi_mpxy_channel and make channel lookup and enumeration domain-aware. A channel is now visible only when accessed from its owning domain. Also require the owner to be set before channel registration. This allows MPXY to support systems where the same hart may be reused by multiple domains while keeping channel ownership and visibility fixed to the domain that owns the service. Signed-off-by: Oza Pawandeep <pawandeep.oza@oss.qualcomm.com> Reviewed-by: Rahul Pathak <rahul.pathak@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260721215758.695736-1-pawandeep.oza@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
committed by
Anup Patel
parent
7a90f41fb9
commit
c0f87f10d1
@@ -13,6 +13,7 @@
|
||||
#include <sbi/sbi_list.h>
|
||||
|
||||
struct sbi_scratch;
|
||||
struct sbi_domain;
|
||||
|
||||
#define SBI_MPXY_MSGPROTO_VERSION(Major, Minor) ((Major << 16) | Minor)
|
||||
|
||||
@@ -97,6 +98,8 @@ struct sbi_mpxy_channel {
|
||||
/** List head to a set of channels */
|
||||
struct sbi_dlist head;
|
||||
u32 channel_id;
|
||||
|
||||
struct sbi_domain *owner_domain;
|
||||
struct sbi_mpxy_channel_attrs attrs;
|
||||
|
||||
/**
|
||||
@@ -181,5 +184,4 @@ int sbi_mpxy_send_message(u32 channel_id, u8 msg_id,
|
||||
/** Get Message proxy notification events */
|
||||
int sbi_mpxy_get_notification_events(u32 channel_id,
|
||||
unsigned long *events_len);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user