[PATCH 1/1] firmware: smccc: Fix check for ARCH_SOC_ID not implemented

Sudeep Holla sudeep.holla at arm.com
Mon Nov 22 00:35:03 PST 2021


On Fri, Nov 19, 2021 at 03:39:01PM -0800, Michael Kelley wrote:
> 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")

Good catch.

Reviewed-by: Sudeep Holla <sudeep.holla at arm.com>

Can you please re-post with my review tag keeping arm at kernel.org and
soc at kernel.org ? I don't have any other fixes at the moment, we can
ask SoC maintainers to fix this up directly.

-- 
Regards,
Sudeep



More information about the linux-arm-kernel mailing list