From patchwork Thu Aug 3 19:02:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13340791 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0ACF9C001DB for ; Thu, 3 Aug 2023 19:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6k5nq904HHL8keFZiJpQl9UrFTpoA6ZVpJgnOhdsLnw=; b=0STId8+gkY1m4k D60qLr2X4Vikpu/TBUOBSFmh9nfi8WOtfyEg42657v41/YBKvBUFEx8dBES8ecYy6V2cjuosFg9xc pc3eyvE2YlPxbmDXbwOeBhZj3eJz6SU/ezuJxcwARxOmZSLAc7Fq+72Az4/y4mO8boAa6mK/aHnM7 BgHvP9y0t2GxDJ9QU0Go4iV33rp3vq0DRFp4JVGn+fYSdRX+Vq8255BouDhQY8vCExH0PaErIfemk kydHBZCNXuvqQHaaLbNNBZtVvBmDaV0eqJpoDMB+FELP0fihj+XMRVrfixmYwOXG0DudCt+FYC3JM xFx+OR7n2yN/rS9fHNNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRdat-00Ah6U-1o; Thu, 03 Aug 2023 19:02:43 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRdan-00AgwO-07 for linux-arm-kernel@lists.infradead.org; Thu, 03 Aug 2023 19:02:39 +0000 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 B14581474; Thu, 3 Aug 2023 12:03:19 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 95BB03F6C4; Thu, 3 Aug 2023 12:02:35 -0700 (PDT) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Sudeep Holla , Jens Wiklander , Lucian Paul-Trifu , Marc Bonnici , Coboy Chen Subject: [PATCH RFT 11/12] firmware: arm_ffa: Add interface to send a notification to a given partition Date: Thu, 3 Aug 2023 20:02:15 +0100 Message-ID: <20230803-ffa_v1-1_notif-v1-11-6613ff2b1f81@arm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230803-ffa_v1-1_notif-v1-0-6613ff2b1f81@arm.com> References: <20230803-ffa_v1-1_notif-v1-0-6613ff2b1f81@arm.com> MIME-Version: 1.0 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=8wR5nAQmif3IV58CHUtYI7AoPHUdSNE2CQ+LZOQjskw=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBky/iOv1HNBdEX3FhKzkZotN+AhpxIqQqaUxIht 4xzQN93ADKJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZMv4jgAKCRAAQbq8MX7i mLCpEACLQdZqfIGT2MeCv8uDmtpNpBXhU4pq0R58YJj1iTIeDSW/Sn6pVA5wPRgLDkwUSqZxAoE XbaE4Ewo/KUkXXnLY1kPZfKslpX5hPwgcguJK0fZescHMeK3lBqTCJvHlR7aLk3NboxpxCQyNYI FLOi/NUwsLGmYq3zRyJGzQ8E8Lo6FYVDfI0y7B6yv2GL29PKMcw1NI7dJLpTy/3wBdaEiotCi66 TSFsqrDBFXUwpxzrttsxGRc08EXwLH4Yjg+4cQSFXEdVWGfURKUXlHYHD6ClvTQMdSev5JsIXdZ Pgn4PMT2LLEPX6haBwPFXPIPSpzvAX2mTt6/Qb49aj2Lm3VWVbIosKaehnZg7RAwJhfR+0UdeHy yDtGtlKxNL5CYRg0UeT7G4Fi6h4KVy+IKtgCKeBpYlQvlxfwc2kH6TizN01d+qNwFmEiXKsRBj6 Gy0US0wZmwk8/5IMDUjSTtv3L0JrenLMRjP0dgMPB6jWXK4Kp9TLKD+9/QpRFVdq4fkkJRh9x13 JgiudN1I6fQ4UvPKNJoNmUHNS330p1PAKb4gkUnEBfM9aFL0D2iYw+qwc873m7ReIa5v2QNw9Vz eU8NuzLx7cdXRAooHTejIaQcmXFzuU/GzA/HupcAXQdJCUGFDdm5V3QFVrUIe16m/u/HSVqzPxV +yxpERWJ APVWPEg== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230803_120237_167483_2E667B60 X-CRM114-Status: GOOD ( 13.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 29f69f7010c9..d98d0fbe5605 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -1015,6 +1015,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, @@ -1040,6 +1052,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 99440129b733..3bba5f999e4f 100644 --- a/include/linux/arm_ffa.h +++ b/include/linux/arm_ffa.h @@ -402,6 +402,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 {