Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4017744rdh; Fri, 29 Sep 2023 08:52:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHREa1rQfLUkEblbwt/W+5DR6jWNRMBVWFNX3JZTEyHUSAN2Fxa0uVfVPKFeV7KLSS5PFaR X-Received: by 2002:aa7:8882:0:b0:68f:c6f8:144a with SMTP id z2-20020aa78882000000b0068fc6f8144amr4836559pfe.22.1696002725470; Fri, 29 Sep 2023 08:52:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696002725; cv=none; d=google.com; s=arc-20160816; b=BxpmkGoH1YpTwBQ1w5C/oXfUlbWkQW/wYNaqfEO4TVKaYs5xqmNq9hot0+kcPgNln/ mfdK6uMuh7OPu2CVdWUze+lFnH8hBKCbnLx73bnG2OTr09dHA1pktsVDjRgCE8+PgJZ3 CH8SqsNvNLP7cCK9pZzgtHmeXj7KUhtHztMBM9B98g2ma4bHsdceMmh5PANfWssQXc7/ HTBg71Mzwp0vHl9EcEyR7cUBK9c2vcROcopEq2mT59rFcuY5FkKDGD9LWLOX9N1recdX xGPSZZnLfANFT3rkza7Gk3lZEYFRrK/ZTTPcRifirOUsVOUgWJ44D5sIEqaa90K3v5SS ZXYw== 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=CMdn9+9dr3HxLhOw1HJDN5FBxqkHe/3XhNGo6VSBmKo=; fh=iZJRvoZuVJp3Jcg3UWu0imuTLbH0nKChof8pDyzNHj4=; b=Igg05uz0yaelCKZRloFvBq09fI/2w6tnL4MlI1mIFq1aVfRM9cbR6SgGnjO5hjks+c 8BAhKXo215XXtLScHHRgANFMvwzv7EneHQsVOPcK15pu4lyoFxgd75h4ZkR1hXstN66e FCeqNfV0SXoicYRlDLiFUPOvqyw1O6JLBDJ+oyHVkHMf3JseUinBZitTkC/Dme8wM3M6 r9x6yYsjoN+y88jtJTK0AWxNRJaGqyMPpkpFe6ZwGZ87p/L164r6+L/qQ99RlyKctEFF jk6avkMFGz+cowfq7BmkCvjLIDiGZPoCR2fLkgoHatul6rmaFEQ5GTaZ+VUDpMU79EIB YNkA== 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:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id by9-20020a056a00400900b0069026fd5a48si21084235pfb.34.2023.09.29.08.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 08:52:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 907E98567E6E; Fri, 29 Sep 2023 08:03:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233505AbjI2PDz (ORCPT + 99 others); Fri, 29 Sep 2023 11:03:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233418AbjI2PD3 (ORCPT ); Fri, 29 Sep 2023 11:03:29 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E41911B4 for ; Fri, 29 Sep 2023 08:03:27 -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 2845E1FB; Fri, 29 Sep 2023 08:04:06 -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 C59123F5A1; Fri, 29 Sep 2023 08:03:26 -0700 (PDT) From: Sudeep Holla Date: Fri, 29 Sep 2023 16:03:00 +0100 Subject: [PATCH v3 11/17] firmware: arm_ffa: Add interface to send a notification to a given partition MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230929-ffa_v1-1_notif-v3-11-c8e4f15190c8@arm.com> References: <20230929-ffa_v1-1_notif-v3-0-c8e4f15190c8@arm.com> In-Reply-To: <20230929-ffa_v1-1_notif-v3-0-c8e4f15190c8@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=2181; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=f4Gw9qi5dW5Ef+rKySqOZWY9UgWqEziJ+T29fyYYAJQ=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBlFucw0qDNmU79mdBC/Sm4VFjwdP3A5KYk8XFDF lr0YD4RIgaJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZRbnMAAKCRAAQbq8MX7i mEk5EADEAWUv/82JqDbfhVrIMI84gpGtF67+Q77nDFptg0Czw+joaWzzI78ZRTQFg3lkwfn6d82 N49R/38j+mg8mpP96clRyYmcnDs+jkCmMXEZPyrfs31rlMBMdFzILvcUZFOsHhke69LQJJHLFEb w/eqzS4FYuXiHmxsfopzHI8o9HSd7dUCrREGSegHBSd+Qub4UbjN29sQfUyUHUJOrcKkqvzCxnp 7O+D21eP//W2KUVkN7nvTf34yAl7VBVMRAf7S4W2TYn6XmFAeMnzV0T6xZcyy8p29zYqqtCUTef iLGunKeDB2sYEyUQTAuzg5TbH9faXqUd+o60UrjQPqjNE9yEfutyMlbY3IbIwVwbBgCgAtkFEDx ZGw4XTLAWKtoh3MisocU+yEFeGLAS9Luv1ANBivu5CjOzpCbbsIlIh0rG/kL0jWSwATPJ/OzIRD 7wQWzblYr6tT9f+EiswyTjVI5LbxDcuVOCWlKfo6jyMJ6pXDH89GkbPDXwfceI6sp8TJmXCV1DL dx7Hs9cLKXYKoOqNUr8nnklk/Le/GCfs+rv6QDGcHVGpSjBKosswxyMSb67+iAbGhEj0y0Ezzq+ a00K1Bvn1zDjWzRm/jrBLCki+vESjEOGUPlGsNZLJhoHAsG6oJqtK+JAkVZiSDYqmk/nJivdBTj VULpEsARIEChWwA== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Fri, 29 Sep 2023 08:03:57 -0700 (PDT) The framework provides an interface to the sender endpoint to specify the notification to signal to the receiver endpoint. A sender signals a notification by requesting its partition manager to set the corresponding bit in the notifications bitmap of the receiver. Expose the ability to send a notification to another partition. Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 13 +++++++++++++ include/linux/arm_ffa.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index 55707a5d333d..94e39ee83278 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -1044,6 +1044,18 @@ static int ffa_notify_request(struct ffa_device *dev, bool is_per_vcpu, return rc; } +static int ffa_notify_send(struct ffa_device *dev, int notify_id, + bool is_per_vcpu, u16 vcpu) +{ + u32 flags = 0; + + if (is_per_vcpu) + flags |= (PER_VCPU_NOTIFICATION_FLAG | vcpu << 16); + + return ffa_notification_set(dev->vm_id, drv_info->vm_id, flags, + BIT(notify_id)); +} + static const struct ffa_info_ops ffa_drv_info_ops = { .api_version_get = ffa_api_version_get, .partition_info_get = ffa_partition_info_get, @@ -1069,6 +1081,7 @@ static const struct ffa_notifier_ops ffa_drv_notifier_ops = { .sched_recv_cb_unregister = ffa_sched_recv_cb_unregister, .notify_request = ffa_notify_request, .notify_relinquish = ffa_notify_relinquish, + .notify_send = ffa_notify_send, }; static const struct ffa_ops ffa_drv_ops = { diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h index fb6f388a3737..f6df81f14b6d 100644 --- a/include/linux/arm_ffa.h +++ b/include/linux/arm_ffa.h @@ -401,6 +401,8 @@ struct ffa_notifier_ops { int (*notify_request)(struct ffa_device *dev, bool per_vcpu, ffa_notifier_cb cb, void *cb_data, int notify_id); int (*notify_relinquish)(struct ffa_device *dev, int notify_id); + int (*notify_send)(struct ffa_device *dev, int notify_id, bool per_vcpu, + u16 vcpu); }; struct ffa_ops { -- 2.42.0