From patchwork Fri Sep 29 15:02:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13404499 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 53C29E71D47 for ; Fri, 29 Sep 2023 15:03:49 +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:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6kaaRIiLRYdnfJHpFmCC3E+kEia7UzqeG3Nw3FsXBa8=; b=KCBrEUgIquqMs0 2OXG4DQkFbyxQe606XBqXRiZQqCpyxiuuns1daPvWsznONb7nmg97gB+Swo2Kafc1WXJHJ9GjeqyF z82fdXtB9Bsn3/IsTVMbLOban4TlUmQnX0EPMQan2l9/MEGr3Ct0IaJKXHHp+INegv0lwWkSjmorE DUHCDfxxyfC3JtCEtoXeS+S7oNn/ZigT2MivvTyMxx+yAbn8o8w9mUBc0HtKqZSBEbYgrIGmsb4K1 k2uZyiwJZsQeX6JJQMZPKSC1+uoz/pNmGiX7/OB5VdZstgkZPidKp2WFXWDdVdr3xWdDIlYJqAcIX e+GydhB2ODa+gITkxPkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qmF1U-0088Dg-1t; Fri, 29 Sep 2023 15:03:20 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qmF1R-0088CC-2y for linux-arm-kernel@lists.infradead.org; Fri, 29 Sep 2023 15:03:19 +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 205201FB; Fri, 29 Sep 2023 08:03: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 529B13F5A1; Fri, 29 Sep 2023 08:03:13 -0700 (PDT) From: Sudeep Holla Subject: [PATCH v3 00/17] firmware: arm_ffa: Add FF-A v1.1 support(notification + new memory descriptor format) Date: Fri, 29 Sep 2023 16:02:49 +0100 Message-Id: <20230929-ffa_v1-1_notif-v3-0-c8e4f15190c8@arm.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAB7nFmUC/12OQQqDMBBFryJZN8VkYnS66j1KkTiZ1CxUSCRQx LvX2l1Xn7d4vL+JzClyFrdqE4lLzHGZD4BLJWh084tl9AcLXWuouxpkCK4vSqp+XtYYJCs1EJo G0WpxSIPLLIfkZhpPzRkmrbC1oNpBEXfUkAc2gTxy41uL1AUyX3WMeV3S+7xS9DGPXxUV/leLl rW0ARyQA9RAd5emKy2TeO77/gHHJphO1QAAAA== To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , Marc Bonnici , Jens Wiklander , Coboy Chen , Lorenzo Pieralisi , Olivier Deprez Cc: Marc Zyngier , Oliver Upton , Will Deacon , Quentin Perret X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3926; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=hlrtkVs14qne9no7z22SDk+56gTWNGc6pIOnrJ7hWoM=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBlFucuPA8MQYcxU7n25Hca+uKVBCB6u4xxm7Pt0 8zfx7sZ8l2JAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZRbnLgAKCRAAQbq8MX7i mPdHEACCQ8UizQ8/eOzqo/7Kuqge6W3eCpCcynuYQVm6bzJcX1LF91Gr2D6Nfi2lHwPo5F9WCWP dGxL87OSdCGqxuTDPjYQFzxIPmtm571yez7/olGtUT2/9jGoQ6vaomOXNu3M+NVMDe5OhiSCKG1 GbhoCN4RUFp03AWj/VIiwVttr/jErppMeROhsgDIebq2JxmJK7+2KyeJpwXcgPfuqTab4+i8NyA EBKujr4W/fWGROyT2gFNKfaW9xviw/wo16Q6KFbYgdP1od8OhnJt0ZHxMtuIIzt8rwut0yD2PAu g6ytPTHKJpBQ5WZDcQ0qMbUYeamMebY46O4y8Gr4pGpKAHEyB6VIRDQiFOPZE8EoE9KtbhSjlsM fH9TD1aGbV8INUSzvm5SpcAQD3vy9rBuAD6wS5egtG3WcXngTkP9OxXcflPKGgi4il+/RHMiKeL 2eRs5FMzdA9WZAxCWW0aCCSfMKQ7qJ2aMfKmW9bG/ONtqJyEDbsejGxXmqF4IW/zRCIzbQjCxip mmKVdeAymV+TSR6PSOELjF1BywhAGJPNGXJcfguasHyySqT4YDhDTYpVaSvBOHf4oW5zQLNVRjR 20q7QhZNmMBmBZrCUFjA8134kSUOhpC+Q3Gs+p4e64g07UKtqtXqv5loPdxDuR8A17V8xpGKpE6 Ru7tVxaQ53nvCtw== 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-20230929_080318_050906_8A81425C X-CRM114-Status: GOOD ( 12.66 ) 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 series adds initial support for the notifications and memory transaction descriptor changes added in FF-A v1.1 specification. The notification mechanism enables a requester/sender endpoint to notify a service provider/receiver endpoint about an event with non-blocking semantics. A notification is akin to the doorbell between two endpoints in a communication protocol that is based upon the doorbell/mailbox mechanism. The framework is responsible for the delivery of the notification from the sender to the receiver without blocking the sender. The receiver endpoint relies on the OS scheduler for allocation of CPU cycles to handle a notification. OS is referred as the receiver’s scheduler in the context of notifications. The framework is responsible for informing the receiver’s scheduler that the receiver must be run since it has a pending notification. The series also includes support for the new format of memory transaction descriptors. Signed-off-by: Sudeep Holla --- Changes in v2: - Added a fix for MEMORY LEND operation - Upgraded the driver version - Added support for the new format of memory transaction descriptors - Remove unnecessary partition ID information in the notification callbacks - Fixed setting up drv_info->sched_recv_irq before enabling the SGIs - Added missing resetting of bitmap_created in notifications_cleanup() - Added some comments about GICv3 and SGI assumption - Removed partition ID from the notification hash table entries as they are redundant/incorrect. Added the notification type instead (SP/VM/Framework) - Link to v1: https://lore.kernel.org/all/20230803-ffa_v1-1_notif-v1-0-6613ff2b1f81@arm.com/ Changes in v3: - Fixed ffa_mem_desc_offset() to not use possibly unpopulated structure members - Fixed the parameter of handle_notif_callbacks(), must be notification type instead of the partition ID. - Fetch only secure partitions and SPM framework bitmaps until we add support to this driver run in other than NS physical instance. - Swapped back PACK_TARGET_INFO() arguments which I swapped in v2 with some confusion during the review. - Link to v2: https://lore.kernel.org/r/20230919-ffa_v1-1_notif-v2-0-6f3a3ca3923c@arm.com --- Sudeep Holla (17): firmware: arm_ffa: Update the FF-A command list with v1.1 additions firmware: arm_ffa: Implement notification bitmap create and destroy interfaces firmware: arm_ffa: Implement the notification bind and unbind interface firmware: arm_ffa: Implement the FFA_RUN interface firmware: arm_ffa: Implement the FFA_NOTIFICATION_SET interface firmware: arm_ffa: Implement the FFA_NOTIFICATION_GET interface firmware: arm_ffa: Implement the NOTIFICATION_INFO_GET interface firmware: arm_ffa: Initial support for scheduler receiver interrupt firmware: arm_ffa: Add schedule receiver callback mechanism firmware: arm_ffa: Add interfaces to request notification callbacks firmware: arm_ffa: Add interface to send a notification to a given partition firmware: arm_ffa: Add notification handling mechanism firmware: arm_ffa: Simplify the computation of transmit and fragment length KVM: arm64: FFA: Remove access of endpoint memory access descriptor array firmware: arm_ffa: Switch to using ffa_mem_desc_offset() accessor firmware: arm_ffa: Update memory descriptor to support v1.1 format firmware: arm_ffa: Upgrade the driver version to v1.1 arch/arm64/kvm/hyp/nvhe/ffa.c | 8 +- drivers/firmware/arm_ffa/driver.c | 757 +++++++++++++++++++++++++++++++++++++- include/linux/arm_ffa.h | 78 +++- 3 files changed, 818 insertions(+), 25 deletions(-) --- base-commit: 2a4ec21976317b1ce8c5cd3e4fcd9e5d769c8fc4 change-id: 20230803-ffa_v1-1_notif-e11bc9459962 Best regards,