From: Sudeep Holla <sudeep.holla@kernel.org>
To: Yeoreum Yun <yeoreum.yun@arm.com>
Cc: linux-integrity@vger.kernel.org, keyrings@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org,
Sudeep Holla <sudeep.holla@kernel.org>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
jarkko@kernel.org, zohar@linux.ibm.com, roberto.sassu@huawei.com,
dmitry.kasatkin@gmail.com, eric.snowberg@oracle.com,
paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com,
maz@kernel.org, oupton@kernel.org, joey.gouly@arm.com,
suzuki.poulose@arm.com, yuzenghui@huawei.com,
catalin.marinas@arm.com, will@kernel.org
Subject: Re: [RFC PATCH 1/3] arm64: KVM: defer kvm_init() to finalise_pkvm() when pKVM is enabled
Date: Wed, 6 May 2026 08:50:03 +0100 [thread overview]
Message-ID: <20260506-spirited-impartial-sparrow-66efae@sudeepholla> (raw)
In-Reply-To: <20260505095409.1948371-2-yeoreum.yun@arm.com>
On Tue, May 05, 2026 at 10:54:07AM +0100, Yeoreum Yun wrote:
> This patch is a preparatory change to address dependency issues
> between the FF-A driver and pKVM.
>
> kvm_init() should be invoked from finalise_pkvm(),
> as this is the point where pKVM initialisation is finalised and
> the system transitions into the protected mode.
>
> Deferring kvm_init() ensures that KVM is initialised only after pKVM has
> fully established its protected environment.
>
> Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
> ---
> arch/arm64/kvm/arm.c | 8 +++++---
> arch/arm64/kvm/pkvm.c | 15 ++++++++++++++-
> 2 files changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> index 8bb2c7422cc8..663b1d447a9b 100644
> --- a/arch/arm64/kvm/arm.c
> +++ b/arch/arm64/kvm/arm.c
> @@ -3025,9 +3025,11 @@ static __init int kvm_arm_init(void)
> * FIXME: Do something reasonable if kvm_init() fails after pKVM
> * hypervisor protection is finalized.
> */
> - err = kvm_init(sizeof(struct kvm_vcpu), 0, THIS_MODULE);
> - if (err)
> - goto out_subs;
> + if (!is_protected_kvm_enabled()) {
> + err = kvm_init(sizeof(struct kvm_vcpu), 0, THIS_MODULE);
> + if (err)
> + goto out_subs;
> + }
>
> /*
> * This should be called after initialization is done and failure isn't
> diff --git a/arch/arm64/kvm/pkvm.c b/arch/arm64/kvm/pkvm.c
> index 053e4f733e4b..48b06d384570 100644
> --- a/arch/arm64/kvm/pkvm.c
> +++ b/arch/arm64/kvm/pkvm.c
> @@ -17,6 +17,7 @@
> #include "hyp_constants.h"
>
> DEFINE_STATIC_KEY_FALSE(kvm_protected_mode_initialized);
> +EXPORT_SYMBOL_GPL(kvm_protected_mode_initialized);
>
I am not sure if this is needed when FF-A is built as module. If others
are OK with it, I am fine. But I am thinking if we need to use this in
FF-A driver which can be built-in or a module, we can add
IS_BUILTIN(CONFIG_ARM_FFA_*)
--
Regards,
Sudeep
next prev parent reply other threads:[~2026-05-06 7:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 9:54 [RFC PATCH 0/3] initalise ff-a after finalising pKVM Yeoreum Yun
2026-05-05 9:54 ` [RFC PATCH 1/3] arm64: KVM: defer kvm_init() to finalise_pkvm() when pKVM is enabled Yeoreum Yun
2026-05-06 7:50 ` Sudeep Holla [this message]
2026-05-05 9:54 ` [RFC PATCH 2/3] firmware: arm_ffa: initialise ff-a after finalising pKVM initialisation Yeoreum Yun
2026-05-05 14:39 ` Sudeep Holla
2026-05-05 15:06 ` Yeoreum Yun
2026-05-05 16:32 ` Sudeep Holla
2026-05-05 16:58 ` Yeoreum Yun
2026-05-06 7:27 ` Sudeep Holla
2026-05-06 7:49 ` Yeoreum Yun
2026-05-06 8:14 ` Sudeep Holla
2026-05-06 8:58 ` Yeoreum Yun
2026-05-06 9:11 ` Yeoreum Yun
2026-05-06 9:58 ` Sudeep Holla
2026-05-06 7:46 ` Sudeep Holla
2026-05-05 9:54 ` [RFC PATCH 3/3] security: integrity: call load_uefi_certs() at late_initcall_sync Yeoreum Yun
2026-05-05 10:45 ` [RFC PATCH 0/3] initalise ff-a after finalising pKVM Ben Horgan
2026-05-05 10:51 ` Yeoreum Yun
2026-05-05 11:16 ` Yeoreum Yun
2026-05-05 11:24 ` Ben Horgan
2026-05-05 11:33 ` Yeoreum Yun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260506-spirited-impartial-sparrow-66efae@sudeepholla \
--to=sudeep.holla@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=eric.snowberg@oracle.com \
--cc=jarkko@kernel.org \
--cc=jmorris@namei.org \
--cc=joey.gouly@arm.com \
--cc=keyrings@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=paul@paul-moore.com \
--cc=roberto.sassu@huawei.com \
--cc=serge@hallyn.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yeoreum.yun@arm.com \
--cc=yuzenghui@huawei.com \
--cc=zohar@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox