[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: "Orzel, Michal" <michal.orzel@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 24 Feb 2026 14:23:04 +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=s4ytCpZ3Tpi9Ml3xdMAtu7ETcazy2dztxT4cPcH6rdU=; b=mPdxM2fPFj5JxlD3FRQqFDL9Qnx8o7EcbntoC+t5C6xN6zwFB7Yu3uQpCMeNQTJ7MkDxfKGOwsyhsfcdktTbdPd8oHxc9zftqU9vteEfPon9X4jQMHd34PdI+0RiM8E1xKvDO9ijIbMlIc+MUxT9+Iepub3HHoeSlDRU/R3vdPRPvd8OQ0L7sMQRlcTODMRBcak3fce7AzH0E0ilFBL+pKczQ7noUFXJQRRXyQs6sLb799GvaTGu/+sir37UtaQgtFW7oN+yKyGYry0hzrMidurZ3iIcKi6ExH6tWf57RMPgzktCGLgASWACDC407Ueu8nBmQPz7fNYLaU8Q+LEMAg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iEcdsakT4Bss9tCvWLeJXwZkLdt2BaX70SvGuK5dHkgvPr83+ZHXpkbhChS1PRUyjccN3QFAPav2yheNcmOtf2zQ9vZ3VGIuOn2EcFOjhjfFyCd5a317OTk3ttK2HrwY6lgPL0bh1GMgFv2WS1QgSzGh5TZT55KRMv628OKmeSR56vdy8xI0z1qQImYW3ePqmWsNY5i8cNG3Wk/bcmLQ89JAyVSvTu6wKId2Q2tVFF1ZJi+KGqzdmRDzaYaR2FWwsTkVa9V5nyRSsfMn+fNN9ODWiMSRbPPjh6tbnSIVnWDP8W8VzVb9tV9sxfxFPzVAMB2kCB4bXB/Jbbdy6ipiDQ==
  • 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 14:23:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24/02/2026 2:17 pm, Andrew Cooper wrote:
> On 24/02/2026 2:14 pm, Orzel, Michal wrote:
>> 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.
> Hmm - it built for me.  I'd better figure out why I missed it first.

Ah - a last minute refactor, and I didn't build test on this commit
boundary.

Fixed.  Thanks.

~Andrew



 


Rackspace

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