[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] xen/arm: Simplify SMCCC handling by reusing __declare_arg_$()


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Tue, 24 Feb 2026 15:14:03 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PwF2Hy8nkHE/baHPoCLHkv0AMVvgnCOSRvJcC3RQz8Q=; b=Su+ZYzPipSmYOh3BF1melwBWElqbh2pE0/MawGXqf1ZsUt4iPdeIYt/eqNRD92AKkybNPMxMxgSbE1nEazw3Mh+gJrZzi9BWgqN1tvff4ns6HEBqpNUMCsZ5cfA+9EzsvJMkQ4+onYcXjkFEz1lzOGPqyNc1AvNr2oYPzCOjDw9W0BVYv85C5NkgGbvHRiHYzyxIoB/HYNIrraFPla1jLB3fztTQq7PZwLJwrrP9F9539So5V3+p260H9bzrtrVLfuIFqfkla+XA5XVCZzU6jmjfGzwnps00wnOrYMPooxWy0hL2PCci0sCzWb9DdI7rU+Fy5phJx6EzI/nNLi5CXA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sB7Hxawh7TAjTefm6NuFAA58bz/qUqzJ3zEca+bYpjlzQXt2imLzZKM/XPutEvT1tudaXv+J+s+UixNTzUEn8LA2O1fmy1FhRxl1KMwQp29MXTX5wVYQZLe/1W91sSOiLTkKDvnt2KQ6kRMEuvlPBBVF8AAhogrnlseEuF0/fiw/iRqOe4E7ZKsT0FdYJx5GoCvPmC9yUioE77fKSgFZFvqolFW0IVFKl6KQcc44GjjxyH9UpWgn+821FMKEnX98b0KC+qGXq76vMu0LOM0G76uez5qT0jnfGub9RzdBOwuyOP5aNXMMSnj3VMDTfY7kfIG/Oi//RhF5XOpjrNhFfw==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "Bertrand Marquis" <bertrand.marquis@xxxxxxx>
  • Delivery-date: Tue, 24 Feb 2026 14:14:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 24/02/2026 13:45, Andrew Cooper wrote:
> Now that the type handling is entirely uniform, it's easier to see that
> __declare_arg_3() can use __declare_arg_2() and so on, just like the larger
> __declare_arg_$()'s already do.
> 
> No functional change.
This patch won't build.

> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> CC: Julien Grall <julien@xxxxxxx>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
> CC: Bertrand Marquis <bertrand.marquis@xxxxxxx>
> CC: Michal Orzel <michal.orzel@xxxxxxx>
> ---
>  xen/arch/arm/include/asm/smccc.h | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/smccc.h 
> b/xen/arch/arm/include/asm/smccc.h
> index 5b30dd57b69d..347c4526d12a 100644
> --- a/xen/arch/arm/include/asm/smccc.h
> +++ b/xen/arch/arm/include/asm/smccc.h
> @@ -114,26 +114,17 @@ struct arm_smccc_res {
>  
>  #define __declare_arg_1(a0, a1, res)                        \
>      typeof(a1) __a1 = (a1);                                 \
> -    struct arm_smccc_res    *___res = (res);                \
> -    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
> +    __declare_arg_0(a0, res);                               \
>      register typeof(a1)     arg1 ASM_REG(1) = __a1
>  
>  #define __declare_arg_2(a0, a1, a2, res)                    \
>      typeof(a1) __a1 = (a1);                                 \
You should remove this line and ...

> -    typeof(a2) __a2 = (a2);                                 \
keep this line.

> -    struct arm_smccc_res    *___res = (res);                \
> -    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
> -    register typeof(a1)     arg1 ASM_REG(1) = __a1;         \
> +    __declare_arg_1(a0, a1, res);                           \
>      register typeof(a2)     arg2 ASM_REG(2) = __a2
>  
>  #define __declare_arg_3(a0, a1, a2, a3, res)                \
>      typeof(a1) __a1 = (a1);                                 \
> -    typeof(a2) __a2 = (a2);                                 \
Same here.

> -    typeof(a3) __a3 = (a3);                                 \
> -    struct arm_smccc_res    *___res = (res);                \
> -    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
> -    register typeof(a1)     arg1 ASM_REG(1) = __a1;         \
> -    register typeof(a2)     arg2 ASM_REG(2) = __a2;         \
> +    __declare_arg_2(a0, a1, a2, res);                       \
>      register typeof(a3)     arg3 ASM_REG(3) = __a3
>  
>  #define __declare_arg_4(a0, a1, a2, a3, a4, res)        \

In principal, with the remarks addressed:
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.