Re: [PATCH v3 03/17] firmware: arm_ffa: Implement the notification bind and unbind interface

From: Jens Wiklander
Date: Thu Oct 05 2023 - 10:30:12 EST


Hi Sudeep,

On Wed, Oct 4, 2023 at 5:32 PM Sudeep Holla <sudeep.holla@xxxxxxx> wrote:
>
> On Wed, Oct 04, 2023 at 10:50:26AM +0100, Olivier Deprez wrote:
> > Hi Jens,
> >
> > > dst_id and drv_info->vm_id should be swapped.
> >
> > I'm curious about this because swapping like this actually makes hafnium
> > fail. Need to check from the spec.
>
> I did check after I had swapped this in v2(because I was convinced Jens) was
> correct and you reported the failure. Reading the spec again the other day,
> I got corrected myself and agreed with Olivier and my original
> implementation(v1) which matches this patch(v3).

I don't get it. The spec says for FFA_NOTIFICATION_BIND:
Sender and Receiver endpoint IDs.
– Bit[31:16]: Sender endpoint ID.
– Bit[15:0]: Receiver endpoint ID.
This is exactly the same as for instance FFA_MSG_SEND_DIRECT_REQ.

In ffa_msg_send_direct_req() you assign
src_dst_ids = PACK_TARGET_INFO(src_id, dst_id);

but here in ffa_notification_bind_common() you assign
src_dst_ids = PACK_TARGET_INFO(dst_id, drv_info->vm_id);

Thanks,
Jens