[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 17:10:00 +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=BJRA6mIJs0flmJtp3knxTSkZbCXND5BJUCKXBSfEPBw=; b=FkN7DYgoFdolcoQm2TYrKccAft7qDLPucuqJILmFFum6GTeMbI1syepnb01I58hWbx6T2wpM/HnnA+K23jXWwQEOXTXAucjmm0rWhZyVLLmuHjJPmmVTmxFGTCK8suDdiuo0qH2ZsKHxHgZ91Je9sair9AzDlfx5EhoKXK50RrS5ouniKLkOmx1GMigTqNJDVvF37MfV6dp4BvJawWWO3QXigOkpFcN56mTXSFCM7OSje217XqpMNkp4jtdh1XFK10J8aDthU5yMI9wJO3RcRD1IFXthWWNx6t0nttjtgRrHOq4jbOsa9oyNsETZng2Qa90A38khT3EjEtminwFdww==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SAFuwMhZeIjUVD2m2N5nC6+Uux33d4cNxpmHHH/Cge08ZeZaVq3JREX1xvcv5SRkHZDWYO3s0BK2mTcYESFfUV41xoMkt5qK0zc+IADEwMh/AT1XQr1E5lZEcbkW2l1Ws/2+E8/iGiorTNMIIzZQo90D6v+AQUadnyzw3mNs/glPszc7rmRVEou1f6lMjbo5RWIj7KuRSLM8MItZgDvQJHvuXSd9J2OtBcdCmPqPQE6QKhzpGqpIlzn9tw1qp4uMLbGZ3b41fEy7Zg6gZYiJD86qfQGvoxm+Gzt5c0TSgHzDzQCfC62RjMct9/1uKB77bs7bJCL1wUztvJkBM9sqGw==
  • 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 17:10:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24/02/2026 4:02 pm, Andrew Cooper wrote:
> 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);                           \

Passing pipeline:

https://gitlab.com/xen-project/hardware/xen-staging/-/jobs/13244194836

~Andrew



 


Rackspace

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