Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp381020rdb; Thu, 5 Oct 2023 08:32:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHz6pK14BgKYaa8l8xEjiVjP27Z0Ze4Ba5gr9Cmtjtt8nsLjo72nLl2EVAWU9/KqVOJ6AAn X-Received: by 2002:a05:6358:7e07:b0:134:c650:cc0a with SMTP id o7-20020a0563587e0700b00134c650cc0amr5817460rwm.15.1696519968482; Thu, 05 Oct 2023 08:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696519968; cv=none; d=google.com; s=arc-20160816; b=TvOdT1m1/eQ6ZByBrAcPBj6lHYtmHXocKK2bNvaM0qVp3rMKbOHCp9Nh1l+HDhiwoh mmoEFJl6HNHQjwJlok8G+7cIZoF8r9r0eNuzlOyys2P7pQjGYPymAUxJ8OKn9AA26oho EXwYVpQxd/ZeDqlfmyHNG80zyIWPlx8YZKLFqgRgf2S2MMcKlNT9cPDAQMoJTxtrzfpg kcLTYomgvcA8Cqx8z3kO/v10jxQ8xqBdipgGRvEkXcuFiGbjR6SiNxwZGBX3tjcbfdj6 K/OgDvr15upFa0/FFh8LUGf8oTan4r5kk6nHF33cOkfHqKjpZOftLH55ydU0rCKCCKCd Glxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+QwHx3s4hXT4pBNG8t+jdZSlOTNeOr+G1hgnchLp/dc=; fh=a5ysT8je3vD1RFtgKLQo1SiPTvNIJDRtBHCvALDatV0=; b=ByHDhJSSony1CHVy67PP9mr4d1ylYQAl5Lm/yZMZZAjzPHZa8l26MJ5j4zK4BgjQSp BVvd79nMU7sVZh47v3WLLagrnfUf00OWtzJgm+HC1mv4NEsZRuSBVO4VZai/jzmB9Y8s fdogGNNdxb7nWaBz//K6Pso10VxaZQvsG1tC59iYetLgWEMgnf1x2UJj6yMyP7nmpwmJ 2IZw0XflBljAlSv/za2d7DulA72KR218EXoUVNIoJdRbJBBHpkPCD7XUEk/aiRx2z0oW ym7MqaseTVblEYbtoJi1R9a37TJyJEukicZcVvdN/5hYdlbrhJII0SESQsERI9mOtfMX ckQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id d2-20020a633602000000b00578af1e2f3csi1695835pga.426.2023.10.05.08.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 08:32:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C99068235779; Thu, 5 Oct 2023 08:32:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbjJEPci (ORCPT + 99 others); Thu, 5 Oct 2023 11:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232045AbjJEPcM (ORCPT ); Thu, 5 Oct 2023 11:32:12 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 783814DF75 for ; Thu, 5 Oct 2023 07:50:24 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F25701480; Thu, 5 Oct 2023 01:51:57 -0700 (PDT) Received: from bogus (unknown [10.57.93.106]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 04FDD3F5A1; Thu, 5 Oct 2023 01:51:17 -0700 (PDT) Date: Thu, 5 Oct 2023 09:49:46 +0100 From: Sudeep Holla To: Jens Wiklander Cc: Olivier Deprez , Sudeep Holla , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Marc Bonnici , Coboy Chen , Lorenzo Pieralisi Subject: Re: [PATCH v3 03/17] firmware: arm_ffa: Implement the notification bind and unbind interface Message-ID: <20231005084946.vn4mbizdisaw4q5d@bogus> References: <20230929-ffa_v1-1_notif-v3-0-c8e4f15190c8@arm.com> <20230929-ffa_v1-1_notif-v3-3-c8e4f15190c8@arm.com> <20231004091154.GB1091193@rayden> <20231004153234.ktk6egntk7drao47@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 05 Oct 2023 08:32:45 -0700 (PDT) On Thu, Oct 05, 2023 at 08:57:26AM +0200, Jens Wiklander wrote: > Hi Sudeep, > > On Wed, Oct 4, 2023 at 5:32 PM Sudeep Holla 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). Well, I am not exactly sure what is the root cause for the confusion here: My poor choice of variable names and their usage with this macro, or the macro definition itself(I am not sure) OR The wordings in the specification > > 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. > Not really as per my understanding of the specification. > In ffa_msg_send_direct_req() you assign > src_dst_ids = PACK_TARGET_INFO(src_id, dst_id); > Correct and if you look at the callsite, it is ffa_msg_send_direct_req(drv_info->vm_id, dev->vm_id,...) So the driver is the sender and the partition is the receiver. Probably this is simpler. > but here in ffa_notification_bind_common() you assign > src_dst_ids = PACK_TARGET_INFO(dst_id, drv_info->vm_id); > A receiver(FF-A driver) must bind a non-framework notification to a sender(SP) before the latter can signal the notification to the former. Only the sender can ring these doorbells. A receiver uses the FFA_NOTIFICATION_BIND interface to bind one or more notifications to the sender. So, based on this text(modified to refer sender and receiver in the driver context) from the spec, my understanding is the driver is the receiver and the SP is the sender of the notification. Do you think I am missing someting here ? Sorry for agreeing with you in v2 and silently changing it back without this actual discussion. Olivier raised the issue and then when I went back and looked at the spec, I realised why I had it this way from the beginning. -- Regards, Sudeep