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

Re: [PATCH 2/2] xen/arm: Simplify type handling for SMCCC declarations


  • To: "Orzel, Michal" <michal.orzel@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 24 Feb 2026 16:02:26 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • 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=2iOVr2rKpTPcFlleJfTLbpXf91VeXgKjE/3A2eZ9VZY=; b=VxnAUtg30LSYQhzMx0DV/nE+voKW/5LWoo9V1cNXlZo9ZqHQd87yxRBo3OvABO0VYbkOUP9wIOeuaUgZIhzXmrCxH9dZCJv4b1McZDeWb2Eifx31d14kuXN4dhKAxy9gZ0K4MwsDbUZVESbcl0/vjDgnDcVI8klK6TCJi6LTli89i4WIwILVj/YLsqBYTF2bJPxvrqJ4Mm45McVL2pKO1lfcOPO5skpKp728EsIWMEWpH0JOyx90iQpzc7UMNVlLXa45irdpN5Tyzj/dWyOs4Pm/4TqzInO14OQbR/iQbi8A0qwJwMTpjZnQy8Px8e3Ra3Sx43ejlCiv9PzKr5ZB8g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JacaHmRQ/Db2M9+++pta7yDWFkjCXx8PoRhzEsOYLjjBJYtk7AIa4hwCs1Tj2Coi3OwIuKhfWF/2M8OMDl3IXKF/y0IRYGWBMUBxl8mOYJHbL+Q1tGpSyfPve8BKuguP67UBNkgtIbjvnO8MQ9Ieg0uIXN9qLmajmVtUbLiD0lBfGeryPgJFG1kt7Ul+baUUIY+ngzvm6pcfqJfR+AghGq7IUMs7DHulGeeLI/B4zNyzTHNrvmm+fuTZB237YfUqzgcIFTrYG8Y3p+4KboVhKSURSFO1iWsUmeBfsyGYd3R7xgtEs7a17OMnoIlnn3X2+eMtMaSOqwY5eY30SRhy6g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Tue, 24 Feb 2026 16:02:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24/02/2026 2:18 pm, Orzel, Michal wrote:
>
> On 24/02/2026 13:45, Andrew Cooper wrote:
>> There's no use creating a typed copy of a macro argument, simply to use it to
>> create a second typed copy.  Remove the indirection, halving the number of
>> local variables created in scope.
>>
>> No functional change.
>>
>> 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>
>>
>> This also makes them clearly elliglbe for converstion to auto, where they
>> weren't before (typeof expression not being that of the RHS).
>> ---
>>  xen/arch/arm/include/asm/smccc.h | 21 +++++++--------------
>>  1 file changed, 7 insertions(+), 14 deletions(-)
>>
>> diff --git a/xen/arch/arm/include/asm/smccc.h 
>> b/xen/arch/arm/include/asm/smccc.h
>> index 347c4526d12a..7e90b0b56550 100644
>> --- a/xen/arch/arm/include/asm/smccc.h
>> +++ b/xen/arch/arm/include/asm/smccc.h
>> @@ -113,39 +113,32 @@ struct arm_smccc_res {
>>      register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0)
>>  
>>  #define __declare_arg_1(a0, a1, res)                        \
>> -    typeof(a1) __a1 = (a1);                                 \
>>      __declare_arg_0(a0, res);                               \
>> -    register typeof(a1)     arg1 ASM_REG(1) = __a1
>> +    register typeof(a1)     arg1 ASM_REG(1) = a1
>>  
>>  #define __declare_arg_2(a0, a1, a2, res)                    \
>> -    typeof(a1) __a1 = (a1);                                 \
>>      __declare_arg_1(a0, a1, res);                           \
>> -    register typeof(a2)     arg2 ASM_REG(2) = __a2
>> +    register typeof(a2)     arg2 ASM_REG(2) = a2
> Here you fix the issue introduced in patch 1/2 :) You drop typeof(a1) and
> replace it with correct typeof(a2).
>
> Provided this patch is rebased on fixed 1/2:
> Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

Thanks.  Sadly, ECLAIR rejects this change.  I need to retain the
brackets around the macro parameter after move, so this kind of
incremental diff:

> @@ -114,7 +114,7 @@ struct arm_smccc_res {
>  
>  #define __declare_arg_1(a0, a1, res)                        \
>      __declare_arg_0(a0, res);                               \
> -    register typeof(a1)     arg1 ASM_REG(1) = a1
> +    register typeof(a1)     arg1 ASM_REG(1) = (a1)
>  
>  #define __declare_arg_2(a0, a1, a2, res)                    \
>      __declare_arg_1(a0, a1, res);                           \

~Andrew



 


Rackspace

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