From patchwork Tue Sep 19 17:40:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 14224 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3568692vqi; Tue, 19 Sep 2023 10:45:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFU7+cG4tvVMSc82aO2HroSw/DxvZWhmp4o0GjAI7r7dXgwvPWOnzVro05DdYrtgDOsTjuQ X-Received: by 2002:a05:6a20:6a27:b0:152:6b63:f1e7 with SMTP id p39-20020a056a206a2700b001526b63f1e7mr286211pzk.1.1695145502167; Tue, 19 Sep 2023 10:45:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695145502; cv=none; d=google.com; s=arc-20160816; b=IXE14bCGRN9fMHgVFn0FGKUMi8R9m7NX8ZnuBoD9lm0Tn2nMLoch87B8QyvlU8r27N YIfJvpvQhk6u/SVVvgnLDF3WLw1c7hjNUsJ6OdlA1RADkgG49Hj3JUFalETjSvr6tnJP 8/CodKjcd7SKdRNRS1A4nPbU5ny3XrdSQ1SMSWlj3MqiSLvtPKU8YL9a3YRAOPG3SlAo Meh/6xMnMvWl2exVVSQq3UTBR55Pv9K2VuV+OD7c3XkdodfG1xpON+zn4jEbWOIwXv+I FB2MNWBrOH4znLira4upyieADRvAx9IKPxDiYY5VEWxqko5Yx52aqeYhoOHw/eJ0mD0B 8pEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from; bh=W9l9/yNokn6RhgsNFbPbJQA2Qn3cGpXM38y9qFYfuUo=; fh=OO+hKwfbS6dVYAFNGDnSXhcVeRtpMIH+ZXdGNfnS+uo=; b=wLIyi8OFBptZTralrKYB6WJlrP85Uvy5RO+HKu84zeFTuT80evCpPq67gmsmv7Ecb1 Nk8ckDbcURtcN3hTodg1iJczIv3o8hnV4g8ZmHL+PZejEv3jzuJLk+4M7FN1Z/4Hg5wx lB3CDN/gJhMP7xxyjuN1OAA2Y/efEB3OuLa+sdya6spKl8IiNwtUwx5TvWhknpClBtbF LJJYvGQUIkAw8kYfD8ZCb5sM/HRHR97JUub0MyTxa8fGPRz/TCwA0R9RARTNgKDw/pCL YTFnhqZMzSguTWWyUss+bBH0RDkuHUISeZZHqbFiDTjlOrRyDqgMXLobLG8/AMvf1Y4T j1zg== 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 Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id cl11-20020a056a0032cb00b00690d8405fe6si136846pfb.317.2023.09.19.10.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 10:45:02 -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 E5E1C8063167; Tue, 19 Sep 2023 10:41:36 -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 S232222AbjISRlb (ORCPT + 26 others); Tue, 19 Sep 2023 13:41:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232153AbjISRl0 (ORCPT ); Tue, 19 Sep 2023 13:41:26 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 45A1EAD for ; Tue, 19 Sep 2023 10:41:19 -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 0DBF71FB; Tue, 19 Sep 2023 10:41:56 -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 2F9363F5A1; Tue, 19 Sep 2023 10:41:17 -0700 (PDT) From: Sudeep Holla Subject: [PATCH RFT v2 00/18] firmware: arm_ffa: Add FF-A v1.1 support(notification + new memory descriptor format) Date: Tue, 19 Sep 2023 18:40:48 +0100 Message-Id: <20230919-ffa_v1-1_notif-v2-0-6f3a3ca3923c@arm.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIACTdCWUC/x3NQQrCMBCF4auUWTuQpCrGA3gAcSclTOLEzsK0J LUUSu9u6vLn8fFWKJyFC1ybFTLPUmRINcyhgdBTejPKqzYYZVp1US3GSG7WqF0aJonIWvtgjyd rzwYq8lQYfaYU+p19xzJlpo+rbJ/HzFGW/98T7rcHdNv2AyVfOb6EAAAA To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , Jens Wiklander , Marc Bonnici , Coboy Chen , Lorenzo Pieralisi , Olivier Deprez Cc: Joao Alves , Marc Zyngier , Oliver Upton , Will Deacon , Quentin Perret X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3511; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=3CdSSoesTcz29vvfc5L+ng97FLRT56WZCuNfC2ibU9k=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBlCd05xRMXBVY1vZARS6YM2GhjcVPopPYKCEnyU Ve6Aqnft0iJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZQndOQAKCRAAQbq8MX7i mCJ7EAC2Wsss473OlrNKXReqyET8abWdDKGxJfdv93aw34Di8aMfO2CyZe8bCg7MesM7pNDPEUb o1pykg98tHgMbp2DrYgDmFm3Uc9X127f+gXGjHTuT0yDlJ3JdvnOwoZuRBN24Hwge81XL6J4L3M iUNCBF97UyWOhdS+y20YIpp5M5/VTaQyD/ehmyrtK7XWqrqvkB26ahiVx/6z0WsUnqFclgxehHu BtWbXQZnw1Z4EBFoo0t4uJff1LPhz5iOuwJbQdhWVAMupUuI1hNMPD3q7rDuIBimW94KaLCEaqr WSHYn/JAe67WbTCZv8EVoCeLFv74wiqDoGE1pLS3WfusEGOqGX7Ma4AX1O/LoJ4/Mc5fCiATlui 1pjDNuPkEy3YAl03JFjaq8Ct9DxADKr2K3Yq1ZRobmLZSZ74hkfzPuC6CGb1GidlJmn1F6IuA9e xtQMFCTwP8tWJ6Bc7ooVoKK5EuBN+8Crzgsrrana/PKHnIoYvWK7aie6vEYhnze4Apah+4yv3ur BxDy+WF0jqxNwgh5EjLNeSbvLpVs7a+lk67pam5Y9lP0jDUuv7I7GU3mEDDpcbshOwa4qQTetJM Xmx4BGkc5GSZiDcN+hr6GvZMyQM9zMnHLrEjatt8g1TwTvZSXj+AN7j5V9JufVqB5Q79bFLi1uK fR7fqtN1ijbNdxA== 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]); Tue, 19 Sep 2023 10:41:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777488889895386834 X-GMAIL-MSGID: 1777488889895386834 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. It also contains one fix for MEMORY LEND operation. v1[1]->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) - [1] https://lore.kernel.org/all/20230803-ffa_v1-1_notif-v1-0-6613ff2b1f81@arm.com/ Signed-off-by: Sudeep Holla --- Sudeep Holla (18): 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: Don't set the memory region attributes for MEM_LEND 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 | 769 +++++++++++++++++++++++++++++++++++++- include/linux/arm_ffa.h | 76 +++- 3 files changed, 827 insertions(+), 26 deletions(-) --- base-commit: ce9ecca0238b140b88f43859b211c9fdfd8e5b70 change-id: 20230803-ffa_v1-1_notif-e11bc9459962 Best regards,