WSL2-Linux-Kernel/drivers/firmware/smccc
Michael Kelley 88f6b5f10f firmware: smccc: Fix check for ARCH_SOC_ID not implemented
[ Upstream commit e95d8eaee2 ]

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: 821b67fa46 ("firmware: smccc: Add ARCH_SOC_ID support")
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-12-01 09:04:49 +01:00
..
Kconfig
Makefile
kvm_guest.c
smccc.c
soc_id.c firmware: smccc: Fix check for ARCH_SOC_ID not implemented 2021-12-01 09:04:49 +01:00