From: Roman Kisel <romank@linux.microsoft.com>
To: anirudh@anirudhrb.com
Cc: linux-arm-kernel@lists.infradead.org,
linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
lpieralisi@kernel.org, mark.rutland@arm.com,
sudeep.holla@arm.com, apais@microsoft.com, benhill@microsoft.com,
bperkins@microsoft.com, sunilmut@microsoft.com
Subject: [PATCH] firmware: smccc: support both conduits for getting hyp UUID
Date: Wed, 4 Jun 2025 14:45:21 -0700 [thread overview]
Message-ID: <20250604214522.3523-1-romank@linux.microsoft.com> (raw)
In-Reply-To: <20250521094049.960056-1-anirudh@anirudhrb.com>
> From: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
>
> When Linux is running as the root partition under Microsoft Hypervisor
> (MSHV) a.k.a Hyper-V, smc is used as the conduit for smc calls.
>
> Extend arm_smccc_hypervisor_has_uuid() to support this usecase. Use
> arm_smccc_1_1_invoke to retrieve and use the appropriate conduit instead
> of supporting only hvc.
>
> Boot tested on MSHV guest, MSHV root & KVM guest.
>
> Signed-off-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
> ---
> drivers/firmware/smccc/smccc.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/firmware/smccc/smccc.c b/drivers/firmware/smccc/smccc.c
> index cd65b434dc6e..bdee057db2fd 100644
> --- a/drivers/firmware/smccc/smccc.c
> +++ b/drivers/firmware/smccc/smccc.c
> @@ -72,10 +72,7 @@ bool arm_smccc_hypervisor_has_uuid(const uuid_t *hyp_uuid)
> struct arm_smccc_res res = {};
> uuid_t uuid;
>
> - if (arm_smccc_1_1_get_conduit() != SMCCC_CONDUIT_HVC)
> - return false;
> -
> - arm_smccc_1_1_hvc(ARM_SMCCC_VENDOR_HYP_CALL_UID_FUNC_ID, &res);
> + arm_smccc_1_1_invoke(ARM_SMCCC_VENDOR_HYP_CALL_UID_FUNC_ID, &res);
> if (res.a0 == SMCCC_RET_NOT_SUPPORTED)
> return false;
The patch is a strict superset of the existing functionality.
Validated on baremetal Linux and KVM, Apple M3 nested virt., various client and
server ARM64 systems running Windows ARM64 with VMs managed by Hyper-V and OpenVMM.
Looks good to me.
Tested-by: Roman Kisel <romank@linux.microsoft.com>
Reviewed-by: Roman Kisel <romank@linux.microsoft.com>
next prev parent reply other threads:[~2025-06-04 21:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-21 9:40 [PATCH] firmware: smccc: support both conduits for getting hyp UUID Anirudh Rayabharam
2025-06-04 21:45 ` Roman Kisel [this message]
2025-06-05 15:33 ` Sudeep Holla
2025-06-10 16:06 ` Roman Kisel
2025-06-11 12:52 ` Sudeep Holla
2025-06-18 12:20 ` Anirudh Rayabharam
2025-06-18 12:20 ` Anirudh Rayabharam
2025-06-18 17:57 ` Roman Kisel
2025-06-27 9:59 ` Sudeep Holla
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=20250604214522.3523-1-romank@linux.microsoft.com \
--to=romank@linux.microsoft.com \
--cc=anirudh@anirudhrb.com \
--cc=apais@microsoft.com \
--cc=benhill@microsoft.com \
--cc=bperkins@microsoft.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mark.rutland@arm.com \
--cc=sudeep.holla@arm.com \
--cc=sunilmut@microsoft.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