[PATCH] firmware: smccc: Pass only the required device probe arguments

Suzuki K Poulose suzuki.poulose at arm.com
Sun Oct 11 02:45:10 PDT 2026


Hi Aneesh

On 10/10/2026 11:02, Aneesh Kumar K.V (Arm) wrote:
> The device probe passes zeroes for all seven argument registers to
> arm_smccc_1_1_invoke(). On ARM32 Thumb-2, this binds an input to r7 and
> GCC 8.5 reports "r7 cannot be used in asm here".
> 
> The current smccc_devices entries need at most one argument after the
> function ID: TRNG_VERSION has none and RSI_ABI_VERSION takes a requested
> version. Pass zero for that argument and omit the unused arguments,
> avoiding the r7 constraint. Check argument requirements when adding new
> probe functions to smccc_devices.

Is it safer to use x1-x3 to 0 as they could be the results that we
get back from SMCCC v1.0 onwards ?


Suzuki



> 
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Lorenzo Pieralisi <lpieralisi at kernel.org>
> Cc: Mark Rutland <mark.rutland at arm.com>
> Cc: Sudeep Holla <sudeep.holla at kernel.org>
> Cc: Will Deacon <will at kernel.org>
> Cc: Steven Price <steven.price at arm.com>
> Cc: Suzuki K Poulose <Suzuki.Poulose at arm.com>
> Cc: Andre Przywara <andre.przywara at arm.com>
> Cc: Russell King <linux at armlinux.org.uk>
> Fixes: d8263a131bb0 ("firmware: hwrng: arm_smccc_trng: Register as an SMCCC device")
> Reported-by: kernel test robot <lkp at intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202610070641.B8hxBJcf-lkp@intel.com/
> Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar at kernel.org>
> ---
>   drivers/firmware/smccc/smccc.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/smccc/smccc.c b/drivers/firmware/smccc/smccc.c
> index 07b864ff079d..377d2cda2b6e 100644
> --- a/drivers/firmware/smccc/smccc.c
> +++ b/drivers/firmware/smccc/smccc.c
> @@ -122,8 +122,7 @@ static bool __init smccc_probe_smccc_device(const struct smccc_device_info *smcc
>   	if (IS_ENABLED(CONFIG_ARM) && ARM_SMCCC_IS_64(smccc_dev->func_id))
>   		return false;
>   
> -	arm_smccc_1_1_invoke(smccc_dev->func_id,
> -			     0, 0, 0, 0, 0, 0, 0, &res);
> +	arm_smccc_1_1_invoke(smccc_dev->func_id, 0, &res);
>   	ret = res.a0;
>   
>   	if (ret == SMCCC_RET_NOT_SUPPORTED)




More information about the linux-arm-kernel mailing list