From: Anirudh Rayabharam (Microsoft) Date: Wed, 21 May 2025 09:40:48 +0000 (+0000) Subject: firmware: smccc: Support both smc and hvc conduits for getting hyp UUID X-Git-Tag: v6.17-rc1~171^2~19^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1733432638f323d80ec3d6ba411794cc20e2465f;p=thirdparty%2Flinux.git firmware: smccc: Support both smc and hvc conduits for getting hyp UUID 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) Reviewed-by: Sudeep Holla Tested-by: Roman Kisel Reviewed-by: Roman Kisel Message-Id: <20250521094049.960056-1-anirudh@anirudhrb.com> Signed-off-by: Sudeep Holla --- diff --git a/drivers/firmware/smccc/smccc.c b/drivers/firmware/smccc/smccc.c index cd65b434dc6e8..bdee057db2fd3 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;