From patchwork Wed Apr 10 11:39:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13624125 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 B82D2CD128A for ; Wed, 10 Apr 2024 11:40:18 +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:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R3aw7ng0IDljZtHGn3FuSc38nFWoP1eN4El0db8cd1M=; b=U5/fK9FCeWd9hU 1Q7HzM1BwZdALJdMlnD+nMg50LLxFtr2vyezyHmYAn37yNApnmPl/wo1Z/y+tBBiiG65R8K7lElEG TRFEwVCa30rz9+pVJuel/O1WnsLOU6GFLTr6aaFbRSorx2r/tTBQH8EO86TX4m16BxiYpik4t+6L9 J4Vi2uMUMW8gmJ6eIyl8pTY9rNZMYe7MUSutnRmNyv4VseddqJSpr4MvDrQVxgVOfq8XccrfIqOao pm1RbNt6O4wq3DOHHGPKNiVgmrKLo0GXXRa+c3smnkdceWYzwBPLS6YMhJTinrpzLT30JdRma7N9W QdSIOuVL9rspiwmCSGqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruWJF-00000006gP7-1jDr; Wed, 10 Apr 2024 11:40:09 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruWJC-00000006gNL-1y24 for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2024 11:40:08 +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 312A41480; Wed, 10 Apr 2024 04:40:32 -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 6E5B93F6C4; Wed, 10 Apr 2024 04:40:01 -0700 (PDT) From: Sudeep Holla Date: Wed, 10 Apr 2024 12:39:46 +0100 Subject: [PATCH 1/3] firmware: arm_ffa: Skip creation of the notification bitmaps MIME-Version: 1.0 Message-Id: <20240410-ffa_npi_support-v1-1-1a5223391bd1@arm.com> References: <20240410-ffa_npi_support-v1-0-1a5223391bd1@arm.com> In-Reply-To: <20240410-ffa_npi_support-v1-0-1a5223391bd1@arm.com> To: linux-arm-kernel@lists.infradead.org Cc: Marc Bonnici , Olivier Deprez , Lorenzo Pieralisi , Bertrand Marquis , Jens Wiklander , Sudeep Holla X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1919; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=yYE2AimCAKquv8X253zD5tNeVF9AH66uvZSRJabNqIM=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBmFnqPZpBEmcHhE5lKgy/AqXZ8Q7NUDM/B81Vvd ZP/HhylzyCJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZhZ6jwAKCRAAQbq8MX7i mGj4D/93Vq7ZXpKnECeCcQF2j1T/xqRunE6E18GdyEYJdICVn3h5cDHKsfkkK6obEq+USFU0OWf iy97gb+uVidAMUOPJrWHRqS71iLm3qa2H1mHIXY0kwZc2a4YRug8uFcb4oGSVOUAbL+SfjWVBYT q2Iv8X76hQSoHMxTH9VWP9q9+2+uKUmLWuy+e/O36L+HULC9Eugj223p2qxLodX4dg+fehFNU/s jZNUTcD67SOQgAUJPmnHsRLmGdE94drMjJwEhREXZydopgvUReFM1vBahH5deB1Tw4iiRmZa1jK Z04dBfU/LaCNfNh0eBYznDmrpum3Zik/V6T+YIar4BujT+8WTghTJI3Ae2ad2jow7PAIxjns+fD upSErhCmf7JQjx/Sa6a7Cgrjr88bGmdTGcXqC0nAY1n4Dw78cXBRr7MVbzov+bADY7BRF0QDi8q GSwgeX+4dZrSMUalUzilvPIzkyHMJCWkykVIy9qxueRp8Blky1sxw7hYh93lEZeSPBVEXH4u18M uN8cLHyRDL/2m8M3aHZ7kFEZtAduxxByTnPIch+RU5ibTOsYkBVQdRFeo3xPTQ+hu0QC5xhv7Q6 UKDIKU37k0f5ow0YVBO+XG7sjyICulkiOClHyrUeOloF5wVTjRrRmdBrh6Nts8x2XdoFYMmPLjx KKMbgeWwztawLOQ== 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-20240410_044006_700984_22F7E840 X-CRM114-Status: GOOD ( 12.07 ) 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 From: Jens Wiklander When the FF-A driver is running inside a guest VM under an hypervisor, the driver/guest VM doesn't have the permission/capability to request the creation of notification bitmaps. For a VM, the hypervisor reserves memory for its VM and hypervisor framework notification bitmaps and the SPMC reserves memory for its SP and SPMC framework notification bitmaps before the hypervisor initializes it. The hypervisor does not initialize a VM if memory cannot be reserved for all its notification bitmaps. So the creation of all the necessary bitmaps are already done when the driver initialises and hence it can be skipped. We rely on FFA_FEATURES(FFA_NOTIFICATION_BITMAP_CREATE) to fail when running in the guest to handle this in the driver. Signed-off-by:Jens Wiklander [sudeep.holla: Updated the commit message] Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index f2556a8e9401..4a576af7b8fd 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -1442,17 +1442,15 @@ static void ffa_notifications_setup(void) int ret, irq; ret = ffa_features(FFA_NOTIFICATION_BITMAP_CREATE, 0, NULL, NULL); - if (ret) { - pr_info("Notifications not supported, continuing with it ..\n"); - return; - } + if (!ret) { + ret = ffa_notification_bitmap_create(); + if (ret) { + pr_info("Notification bitmap create error %d\n", ret); + return; + } - ret = ffa_notification_bitmap_create(); - if (ret) { - pr_info("Notification bitmap create error %d\n", ret); - return; + drv_info->bitmap_created = true; } - drv_info->bitmap_created = true; irq = ffa_sched_recv_irq_map(); if (irq <= 0) {