[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1637365141-16823-1-git-send-email-mikelley@microsoft.com>
Date: Fri, 19 Nov 2021 15:39:01 -0800
From: Michael Kelley <mikelley@...rosoft.com>
To: mark.rutland@....com, lorenzo.pieralisi@....com,
sudeep.holla@....com, steven.price@....com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: mikelley@...rosoft.com
Subject: [PATCH 1/1] firmware: smccc: Fix check for ARCH_SOC_ID not implemented
The ARCH_FEATURES function ID is a 32-bit SMC call, which returns
a 32-bit result per the SMCCC spec. Current code is doing a 64-bit
comparison against -1 (SMCCC_RET_NOT_SUPPORTED) to detect that the
feature is unimplemented. That check doesn't work in a Hyper-V VM,
where the upper 32-bits are zero as allowed by the spec.
Cast the result as an 'int' so the comparison works. The change also
makes the code consistent with other similar checks in this file.
Fixes: 821b67fa4639 ("firmware: smccc: Add ARCH_SOC_ID support")
Signed-off-by: Michael Kelley <mikelley@...rosoft.com>
---
drivers/firmware/smccc/soc_id.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/smccc/soc_id.c b/drivers/firmware/smccc/soc_id.c
index 581aa5e..dd7c3d5 100644
--- a/drivers/firmware/smccc/soc_id.c
+++ b/drivers/firmware/smccc/soc_id.c
@@ -50,7 +50,7 @@ static int __init smccc_soc_init(void)
arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
ARM_SMCCC_ARCH_SOC_ID, &res);
- if (res.a0 == SMCCC_RET_NOT_SUPPORTED) {
+ if ((int)res.a0 == SMCCC_RET_NOT_SUPPORTED) {
pr_info("ARCH_SOC_ID not implemented, skipping ....\n");
return 0;
}
--
1.8.3.1
Powered by blists - more mailing lists