All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kameron Carr" <kameroncarr@linux.microsoft.com>
Cc: linux-hyperv@vger.kernel.org
Subject: Re: [PATCH v4 2/6] firmware: smccc: Detect hypervisor via RSI host call in CCA Realms
Date: Fri, 02 Oct 2026 09:13:56 +0000	[thread overview]
Message-ID: <20261002091357.2C41D1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261001220552.1793471-3-kameroncarr@linux.microsoft.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] init: KVM hypervisor detection fails in Realms due to late rsi_present init
--

commit 26246cc162e7aa368ba4bffb04d1af1a21a168c0
Author: Kameron Carr <kameroncarr@linux.microsoft.com>

firmware: smccc: Detect hypervisor via RSI host call in CCA Realms

This commit modifies arm_smccc_hypervisor_has_uuid() to check if the system
is running in a Realm environment. If so, it uses an RSI host call to query
the hypervisor vendor UUID instead of a direct SMC or HVC call.

> diff --git a/drivers/firmware/smccc/smccc.c b/drivers/firmware/smccc/smccc.c
> index afc2e4d602ba6..7e7717076eeb0 100644
> --- a/drivers/firmware/smccc/smccc.c
> +++ b/drivers/firmware/smccc/smccc.c

[ ... ]

> @@ -69,12 +75,45 @@ s32 arm_smccc_get_soc_id_revision(void)
>  bool arm_smccc_hypervisor_has_uuid(const uuid_t *hyp_uuid)
>  {
>  	struct arm_smccc_res res = {};
>  	uuid_t uuid;
>  
> -	arm_smccc_1_1_invoke(ARM_SMCCC_VENDOR_HYP_CALL_UID_FUNC_ID, &res);
> +#ifdef CONFIG_ARM64
> +	if (is_realm_world())

[Severity: Medium]
Does this Realm detection fail for early callers like KVM initialization?

The is_realm_world() check relies on the rsi_present static key being set.
However, during early boot in setup_arch(), arm64_rsi_init() is called
after the PSCI initialization:

arch/arm64/kernel/setup.c:setup_arch() {
	...
	if (acpi_disabled)
		psci_dt_init();
	else
		psci_acpi_init();

	arm64_rsi_init();
	...
}

The PSCI initialization path eventually calls kvm_init_hyp_services(), which
uses arm_smccc_hypervisor_has_uuid() to detect the hypervisor. Since the
rsi_present key has not been set yet, is_realm_world() will return false.

This causes a fallback to the direct SMC invocation, which is intercepted and
fails in Realm environments, preventing the initialization of KVM
paravirtualization features for Realm guests.

> +		arm_smccc_realm_get_hypervisor_uuid(&res);
> +	else
> +#endif
> +		arm_smccc_1_1_invoke(ARM_SMCCC_VENDOR_HYP_CALL_UID_FUNC_ID,
> +				     &res);
> +
>  	if (res.a0 == SMCCC_RET_NOT_SUPPORTED)
>  		return false;
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261001220552.1793471-1-kameroncarr@linux.microsoft.com?part=2

  reply	other threads:[~2026-10-02  9:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 22:05 [PATCH v4 0/6] arm64: hyperv: Add Realm support for Hyper-V Kameron Carr
2026-10-01 22:05 ` [PATCH v4 1/6] arm64: rsi: Add RSI host call structure and helper function Kameron Carr
2026-10-02  9:13   ` sashiko-bot
2026-10-01 22:05 ` [PATCH v4 2/6] firmware: smccc: Detect hypervisor via RSI host call in CCA Realms Kameron Carr
2026-10-02  9:13   ` sashiko-bot [this message]
2026-10-01 22:05 ` [PATCH v4 3/6] arm64: hyperv: Add per-CPU RSI host call infrastructure for " Kameron Carr
2026-10-02  9:13   ` sashiko-bot
2026-10-01 22:05 ` [PATCH v4 4/6] Drivers: hv: Mark shared memory as decrypted " Kameron Carr
2026-10-01 22:05 ` [PATCH v4 5/6] arm64: hyperv: Route hypercalls through RSI host call in " Kameron Carr
2026-10-02  9:13   ` sashiko-bot
2026-10-01 22:05 ` [PATCH v4 6/6] arm64: hyperv: Implement hv_is_isolation_supported() for " Kameron Carr

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=20261002091357.2C41D1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kameroncarr@linux.microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.