Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp402787rdb; Thu, 5 Oct 2023 09:06:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9uhYY25sv8qoKqc1wQSq0EbeNRxsim8N6KUgc1dHynDLnU38Q+DcfomYuxehHV7MWd3l2 X-Received: by 2002:a17:90a:4304:b0:263:5d25:150c with SMTP id q4-20020a17090a430400b002635d25150cmr5245885pjg.29.1696521991749; Thu, 05 Oct 2023 09:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696521991; cv=none; d=google.com; s=arc-20160816; b=D4CpIoC/uoLSXYaP+TqFfF8vIr0DH8RuOuo9JKyx498EISc7TNxm5bq+1LMLUPaGlg zZ6N+1I1jt+JcFk5wY1x4SbEoT1yq1k5qXaRa/wEbgIB/inpCclDHfuLpZL6jsdZWiNz 2eBzkmrQg1LwDcwDHtrU+5cBf6B8XHZqffDFrzvg7ssCLJ8LAMGAIevpeOFZs+VCLGZ6 61t5dW7iauYiOUtuMO0l5QPKPxCjIADqLJgs1xOQBtDBR2XMARX7RiN8LQCKVYZs8qxq eGDddZhjl0HAI8SrbxKEbWDLvVkHL+Y9xOwIlSbH05bvZkTsGoPj7uKZQ2mZNDgCYN7j SHuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from; bh=4j/VoRIvYR9XbIbBn9oHawbWku6KL37hsXJoeEqoAC0=; fh=iZJRvoZuVJp3Jcg3UWu0imuTLbH0nKChof8pDyzNHj4=; b=fg0kIVskJuz9Np9o2YSIc7U2lATGt5Xp60P3ink2Dfwmg2HepTNGpX4RqEmjnNi+LY e1YOwJrnUoQqJ6OXJ9RqJMfk3s835xuuEHpWBhCLTYkYfqDR5mAWne8PGhfbRrUfQlf3 d7l7eFUn1DS2rNK+R6PPemrvp2IAngIBN0OS9siIBEYeQlnXcwO5WI6jaE5JAeh64XxU 3sN3M3Z/k2as9H1b1xKg8WMBqK3pz+M5KpsiBoED3EngGtiz83y6ky5wD+Nk3qlfRxeB 8IUHEsZ2lxLJBDP0Iz9i+9X3jpo+7qvnkY0iYSERlTdGT9gGvSx+Pu927arwtWC058tD Bruw== 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 u15-20020a170903124f00b001c60e273252si1802458plh.25.2023.10.05.09.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:06:31 -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 C8FB382D1C0F; Thu, 5 Oct 2023 09:06:15 -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 S237092AbjJEQE7 (ORCPT + 99 others); Thu, 5 Oct 2023 12:04:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234464AbjJEQDY (ORCPT ); Thu, 5 Oct 2023 12:03:24 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 44EFA9ED2 for ; Thu, 5 Oct 2023 07:45:38 -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 86B101516; Thu, 5 Oct 2023 07:45:53 -0700 (PDT) Received: from e103737-lin.cambridge.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D0B8D3F641; Thu, 5 Oct 2023 07:45:13 -0700 (PDT) From: Sudeep Holla Date: Thu, 05 Oct 2023 15:44:58 +0100 Subject: [PATCH v4 05/17] firmware: arm_ffa: Implement the FFA_NOTIFICATION_SET interface MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231005-ffa_v1-1_notif-v4-5-cddd3237809c@arm.com> References: <20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com> In-Reply-To: <20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , Marc Bonnici , Jens Wiklander , Coboy Chen , Lorenzo Pieralisi , Olivier Deprez X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1504; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=4q7IiagFj1+jcbEerM+tVmHVjhNoYEy9g+TfTOniWJY=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBlHsvxU+OC43JQZl2rh/aQ5hxCbL/2rnY6mISRn pGTv/huwB2JAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZR7L8QAKCRAAQbq8MX7i mONFD/91SNwLzgvbqoev7AcemtwFwEIcUq5ymafJb0GYsSNhSIHyE2Fc0QDnD5JgTQvF8Ww7bCa MyrtPbAxmPj+VkfD75JZmgXC7v0nVPjZ69uR+7D2kP2PxNOFiz2q0HCYkpTe6MumZGA4a+xWlrW il9Rc3Ylp2GYlRp/k4nA+JIhTSoqlqo4p+2Mzr52ESdNQrMyqiPIXM+qjcL13Tlb922K0ZfoNJd ElfDaqGRnnn/6yMZGzItAbsp3BnOXpjZtv4s1ogVe9+P+5RCwTGSrx4J1LM2lD71mQKB2ibjp2R OmErG7UrdKtHSNkfII9fiAffYeIJ++KnBX/1KWzpoRS7ssxnSy42bsi1DxKYUrbuTKLHC3brOxw 1hU8XanUC/u+SxI4ciJ+xpVxxBfdGP0aQQ65qwfgyTAKFNka9IYXK2mDCHjVg51VqEV0Mr8IlK1 VoggYkLvIFjuDM4mdGSf3Hi40v2Jvw2vNmCc05bXgg8re0mkLkdb9QgPbnmtE7y1cQeMiz8PxgL iuvKwiuOc0AFBXYA/pJlKmV3mGH47ffFqhOvSxDGcdYqIG/uh41kL6g+S381gOSz7VPfG/S4ZXS W3YPGIu6toky30eaLCxxby8VqYvn2IRsTMMcrh/6BZmuSXm27BykzpyPoIA9iDds6LVrS+okCZK +vJMXWVolUaXsHw== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 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 09:06:16 -0700 (PDT) The framework provides an interface to the sender to specify the notification to signal to the receiver. A sender signals a notification by requesting its partition manager to set the corresponding bit in the notifications bitmap of the receiver invoking FFA_NOTIFICATION_SET. Implement the FFA_NOTIFICATION_SET to enable the caller(sender) to send the notifications for any other partitions in the system. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index 82e54d231074..4edb3cb48014 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -616,6 +616,26 @@ static int ffa_notification_bind_common(u16 dst_id, u64 bitmap, return 0; } +static +int ffa_notification_set(u16 src_id, u16 dst_id, u32 flags, u64 bitmap) +{ + ffa_value_t ret; + u32 src_dst_ids = PACK_TARGET_INFO(dst_id, src_id); + + invoke_ffa_fn((ffa_value_t) { + .a0 = FFA_NOTIFICATION_SET, .a1 = src_dst_ids, .a2 = flags, + .a3 = NOTIFICATION_BITMAP_LOW(bitmap), + .a4 = NOTIFICATION_BITMAP_HIGH(bitmap), + }, &ret); + + if (ret.a0 == FFA_ERROR) + return ffa_to_linux_errno((int)ret.a2); + else if (ret.a0 != FFA_SUCCESS) + return -EINVAL; + + return 0; +} + static int ffa_run(struct ffa_device *dev, u16 vcpu) { ffa_value_t ret; -- 2.42.0