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 3C14AF99352 for ; Thu, 23 Apr 2026 08:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CDRelJCJUL5USZmCG0/z2df5d8Hv/QTHTVjKGNdkfz4=; b=VrlaNowtuP71m1mDfL6QBvBCMn +d24TXUlU54oQNx1K+aVElr6KMlzDu2MDd2VXRWsOMskExKf2EwwPcZQxp9Uy/MhpOVMlvSUs03aA 908L9nlXUyBWX5pROGZEu/rHHaSkUrIfRccuRK4H5wwVrN3RXxl1f/jygNRk74fm9XEOCO+tmY/3L avpEguFKtSk9m+uqIDFssqhsaXnUgRSHrK84xBxfrGumv54+uVjUeuopiNiiJnsPlrbyRvmfibw4c ZBvFs3d0j87d61iu8pMFoHzzBiXMkBG15yArb3KUusek/Dyq/0XL9El/AvbUlClEvlOPVXlFZ73oE FCWp+qyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wFpWS-0000000BG9i-35GD; Thu, 23 Apr 2026 08:34:56 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wFpWN-0000000BG91-3UhT for linux-arm-kernel@lists.infradead.org; Thu, 23 Apr 2026 08:34:55 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 20C5341859; Thu, 23 Apr 2026 08:34:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBEA9C2BCAF; Thu, 23 Apr 2026 08:34:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776933289; bh=EIwk9piTyhbMoHWk4+ua2V2EAx6ZYOYGjp1O59PohmQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fWqOCSfVY0KKuywuCOYjhjUq1FQq0D2yRg0a0bxNbIDQcWpK43dAvsbM5CVm5rtVP FkkdNPNcu2Q8gZmQcrn2fG82mJkhE7WmxNmd8CGZLmzLL3KK2rrP8jZNNb1PBBUsEE l6IX/djX/1Lx/JfzLxel4B/dtGGzrdR0k/SyEOkXnvWXRxwO9Z7O2k7YHdbib8GUsW x9zbYFL14/KIXxm3hscT5ftn/cVc++rWDbyFDrgeWUJgEiNEYSKOHDH/K32zom7gaU niPPRSyzh0rPGmMxokNJhdVLjwAp7/Ty/+3qtfHznixll+QQHVg0D+75/JxyHR4Udk c16xJIuw/fFpA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wFpWI-0000000Dyaq-2RhD; Thu, 23 Apr 2026 08:34:46 +0000 Date: Thu, 23 Apr 2026 09:34:46 +0100 Message-ID: <865x5i13dl.wl-maz@kernel.org> From: Marc Zyngier To: Yeoreum Yun Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, zohar@linux.ibm.com, roberto.sassu@huawei.com, dmitry.kasatkin@gmail.com, eric.snowberg@oracle.com, jarkko@kernel.org, jgg@ziepe.ca, sudeep.holla@kernel.org, oupton@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, noodles@meta.com, sebastianene@google.com Subject: Re: [RFC PATCH v2 4/4] firmware: arm_ffa: check pkvm initailised when initailise ffa driver In-Reply-To: <20260422162449.1814615-5-yeoreum.yun@arm.com> References: <20260422162449.1814615-1-yeoreum.yun@arm.com> <20260422162449.1814615-5-yeoreum.yun@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: yeoreum.yun@arm.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, zohar@linux.ibm.com, roberto.sassu@huawei.com, dmitry.kasatkin@gmail.com, eric.snowberg@oracle.com, jarkko@kernel.org, jgg@ziepe.ca, sudeep.holla@kernel.org, oupton@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, noodles@meta.com, sebastianene@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260423_013451_912205_1EFB5EB7 X-CRM114-Status: GOOD ( 22.28 ) 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 On Wed, 22 Apr 2026 17:24:49 +0100, Yeoreum Yun wrote: > > When pKVM is enabled, the FF-A driver must be initialized after pKVM. > Otherwise, pKVM cannot negotiate the FF-A version or > obtain RX/TX buffer information, leading to failures in FF-A calls. > > During FF-A driver initialization, check whether pKVM has been initialized. > If pKVM isn't initailised, register notifier and do initialisation > of FF-A driver when pKVM is initialized. > > Signed-off-by: Yeoreum Yun > --- > arch/arm64/include/asm/virt.h | 11 ++++++++++ > arch/arm64/kvm/arm.c | 21 ++++++++++++++++++ > arch/arm64/kvm/pkvm.c | 2 ++ > drivers/firmware/arm_ffa/common.h | 4 ++-- > drivers/firmware/arm_ffa/driver.c | 36 ++++++++++++++++++++++++++++++- > drivers/firmware/arm_ffa/smccc.c | 2 +- > 6 files changed, 72 insertions(+), 4 deletions(-) > > diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h > index b51ab6840f9c..ad038a3b8727 100644 > --- a/arch/arm64/include/asm/virt.h > +++ b/arch/arm64/include/asm/virt.h > @@ -68,6 +68,8 @@ > #include > #include > > +struct notifier_block; > + > /* > * __boot_cpu_mode records what mode CPUs were booted in. > * A correctly-implemented bootloader must start all CPUs in the same mode: > @@ -166,6 +168,15 @@ static inline bool is_hyp_nvhe(void) > return is_hyp_mode_available() && !is_kernel_in_hyp_mode(); > } > > +enum kvm_arm_event { > + PKVM_INITIALISED, > + KVM_ARM_EVENT_MAX, > +}; Well, no. You are adding a whole infrastructure for something that happens *once* in the lifetime of the system. What's next? D-Bus? We already have a dependency mechanism, which I pointed to you last time, and that you conveniently ignored. If that's not working for you, then consider improving it. If we had a whole set of in-kernel users depending on some global KVM state change, we could look into it. But they are none, and all KVM state changes are per-vcpu rather global. So I'm not entertaining this invasive infrastructure for something so limited. M. -- Without deviation from the norm, progress is not possible.