[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250521094049.960056-1-anirudh@anirudhrb.com>
Date: Wed, 21 May 2025 09:40:48 +0000
From: Anirudh Rayabharam <anirudh@...rudhrb.com>
To: Mark Rutland <mark.rutland@....com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Sudeep Holla <sudeep.holla@....com>
Cc: anirudh@...rudhrb.com,
linux-hyperv@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] firmware: smccc: support both conduits for getting hyp UUID
From: Anirudh Rayabharam (Microsoft) <anirudh@...rudhrb.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@...rudhrb.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;
--
2.34.1
Powered by blists - more mailing lists