From mboxrd@z Thu Jan 1 00:00:00 1970 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 08E51C4345F for ; Fri, 12 Apr 2024 10:43:22 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vNTsWl8df8lsUnLYRe0Cv/ytRPkz2fihj6cl/2GECw8=; b=ZYspzhZNC4XX/A yPupBoKdmqQopHPyueziYnUm9rup7LuxDtsI6UcmGNjiOp173DAa7YDJ2Tl52mLXTs60uP7AII739 2l6Vvx+AfGZfrpJBAhpCWEOIY2hq3AoIVW403XWB6s24cBUkeedADvZpqEV6IwaiXv0IZtnddipIJ 4ZWLOpCnhFhsAbsf9wEWjWnZCsV3uh0mqf1j4bdYl6/IiQEsdfiPYZ/1nmpzvXPiYB6lvp4gBAz9e OeKux3k6WXgpD4wKPxQTOyAJ4jXzmlxd9v5dqa3iXb9ldMxR5hBHU9y4bxF5ebb30Jjbrej+eE4PI CKNXa+9l/ViCDh3dWjQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvENC-0000000GlI9-2F4T; Fri, 12 Apr 2024 10:43:10 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvEMM-0000000Gl01-1gsv for linux-arm-kernel@bombadil.infradead.org; Fri, 12 Apr 2024 10:42:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZLcRrS5LvTF9rKUtAJrEVWU5A8drsf7XjpM2CZbZRHw=; b=i9gbBUe8Lml4y4xytRnBUc+Neb 9gaaPH+yPAWTFNHN+CkcDw8zPj8DHpPhWM5Jpe6r4x0/8XxyjT0aP/FYPx1CKn697jAKYuOYxHP/Y 32v0lFFRQynvl91bcKRgoKdVP8aRKO/zFYKAveXBXyucHohwKuxOkANk0cSBbFm//sU8ssUkvh60y mTOpK1BrxtRMCto5goTDqaPSsVLVILx5E26FJQ+VzssC2fI+b1FcZc0w5rYiF13xvnxTjbVpdTXio Y/pjZ3AlOHIQ8oA88jweQ1GhKgXS+M/dbllvNbLWKYU5WZt9LI0YkFUbhLDJ2G014rioILjMXQ/sj G29TBMHQ==; Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvEMH-000000096Mo-3kCB for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2024 10:42:16 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-41687826509so53455e9.1 for ; Fri, 12 Apr 2024 03:42:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712918530; x=1713523330; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZLcRrS5LvTF9rKUtAJrEVWU5A8drsf7XjpM2CZbZRHw=; b=EQw9uWiRHHEN04a216dwsJCVJzWAGWhidBL/alak9LhBhreSumxWNC8AdiYI0AsCF9 u3QHrvEpIlX/1Lh8qhUDUlR6mEZbMqQMS7SdhM1IYBOlwQ2anshXhhveBEM3TRfU7VKf c+MzYSdjLpUpBdxhbCvsmQc1EYoJPwcQyFafRikW9EwY/2SJqIlALprkOYWW/v69xj9/ gnWT7qPxfiLyCtNxzavnpLGpFFS1t3zvYDpvB7N7+c9z7kzQmrgplPNQWZllMYQiI2uX EVst8BpFJ2bET9qe2qNGxTY+uFQdV0a+DaAHzJfrd9RKjKxUFHjGXD5c5JacbYiBW5/7 2orA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712918530; x=1713523330; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZLcRrS5LvTF9rKUtAJrEVWU5A8drsf7XjpM2CZbZRHw=; b=KAMB89fM3kZyIl+H8PmRLLrGZIz1kdQts5hnxtro1Iq7oCD6SWvq7ZVgkyX1OipqAV D6Ul/43jBd/LIAoXiDNBiN79/aXjrjO9ju9V9s+UhiXacFkyJyeea0GGC/QbGfsB410W N43vituIh+g9e+pMJrRRHDJBV+3vR5ZZ7/T4g0pbpo8cMwhXLWGV+TWv/JQzquKkHZuZ dA7n79HxDtwtKZkdGydN9c/+/ppKyNSdWMYqVF7hw8qpHcxqqQiA56KtjA2Zb9HbLdRT 6tjz3GNxDm7W+svEaYS+HfLcRprCgRvv7eeebSp7puFF71Zxx87TRr4SrCWODa3Nmqku NVSw== X-Gm-Message-State: AOJu0YxrOo04IWgbAcoLkbMHOQfZQlDFtDItxlyb8DUbqeYdaEd5K35Y OdZkBXXtt/K3QWW2+jK7lPBb6S2+jkbEKvQtvf8Bf4GYjnSNZT02IF6Gnp+A7g== X-Google-Smtp-Source: AGHT+IG20coMuMBEs+AKlRYehrOp+nyNR2xed5GR0F35nclmMYkeCyFAHzGZJG+w7P3rUrQ4tgCKRw== X-Received: by 2002:a05:600c:1d2a:b0:417:d7a4:2a0e with SMTP id l42-20020a05600c1d2a00b00417d7a42a0emr118959wms.5.1712918530436; Fri, 12 Apr 2024 03:42:10 -0700 (PDT) Received: from google.com (248.199.140.34.bc.googleusercontent.com. [34.140.199.248]) by smtp.gmail.com with ESMTPSA id o4-20020a05600c510400b0041624ddff48sm8491159wms.28.2024.04.12.03.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 03:42:09 -0700 (PDT) Date: Fri, 12 Apr 2024 10:42:07 +0000 From: Sebastian Ene To: Sudeep Holla Cc: linux-arm-kernel@lists.infradead.org, Marc Bonnici , Olivier Deprez , Lorenzo Pieralisi , Bertrand Marquis , Jens Wiklander Subject: Re: [PATCH v2 1/3] firmware: arm_ffa: Skip creation of the notification bitmaps Message-ID: References: <20240411-ffa_npi_support-v2-0-927a670254e6@arm.com> <20240411-ffa_npi_support-v2-1-927a670254e6@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240411-ffa_npi_support-v2-1-927a670254e6@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240412_114214_468925_58ABB76B X-CRM114-Status: GOOD ( 28.68 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Apr 11, 2024 at 01:57:32PM +0100, Sudeep Holla wrote: > 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 Who restrains them from having this capability ? (to use the FFA_NOTIFICATION_BITMAP_CREATE API). > 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. > This implies that the hypervisor reserves memory in advance to keep the notification bitmaps even though the guest might decide not to use them. For pKVM this assumption does not work because we might have guests that will not be allowed to talk to TZ. > 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); Not a big deal but shouldn't this be a pr_err(..) Thanks, Seb > + 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) { > > -- > 2.43.2 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel