Re: [PATCH v2] lib: utils/mpxy: bind channel access to owning domain

Rahul Pathak <[email protected]> Sat, 11 Jul 2026 14:02:47 +0530
Newsgroups org.infradead.lists.opensbi
Message-ID <CAFR3w37TW2q=QzMvD-aiSASucc+aCUoVzyV_DA=g90iUHU+Mxw@mail.gmail.com>
On Thu, Jul 9, 2026 at 6:29 AM Pawandeep Oza
<[email protected]> wrote:
>
> From: Oza Pawandeep <[email protected]>
>
> 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 <[email protected]>
> ---
>  include/sbi/sbi_mpxy.h              |  5 +--
>  lib/sbi/sbi_mpxy.c                  | 53 ++++++++++++++++++++++++-----
>  lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c |  2 ++
>  3 files changed, 49 insertions(+), 11 deletions(-)
>
> diff --git a/lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c b/lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c
> index 84b7a67d..d2d420de 100644
> --- a/lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c
> +++ b/lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c
> @@ -299,6 +299,8 @@ int mpxy_rpmi_mbox_init(const void *fdt, int nodeoff, const struct fdt_match *ma
>         /* Setup MPXY mbox client */
>         /* Channel ID*/
>         rmb->channel.channel_id = channel_id;
> +       /* Set the onwer domain */

%s/onwer/owner

> +       rmb->channel.owner_domain = &root;
>         /* Callback for read RPMI attributes */
>         rmb->channel.read_attributes = mpxy_mbox_read_attributes;
>         /* Callback for write RPMI attributes */
> --

Reviewed-by: Rahul Pathak <[email protected]>

Thanks
Rahul

-- 
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi