[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:17:59 +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=axrfCNCbwDyu+3mQDhGKi1oDYTpIDtmCzqfj9oh3uiE=; b=HOeBHb9bfxI/+hj5gzkwZ8UJNmvP67OCUWBYPFw+D8msVtvIzGrXz3Z/kY6W7L+uFTag7Ii4trktoIF2W7AWmbZz23AbImxU7fkTPGpsHIboly88gY30OAcLKoDcW4Gfz3JuYuCw9WztoP+AxH4E8eCU1mbV4zAVZnPUSIrDqOKEsAuJ4rvMknIps/ZohrOR5dmOP3ZyU0AAbs+GHeRxgwjIsaUyvu/TzTumd78AlCJaielxMXUhpwnGooqXCArHkRA2GNj0rroLY32hGb46tIXP0Lu2T6CxUji8RARqd32cE6VPXCIFJWk7La6JPgnE9Uzg6tv7iHRBh4bUfyK/PA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=f/TVtK1ZYMVvpm0ywHUreljo6HehJiM89xpStyjmds6iY1y0+fsvIB5lOJkTaILIDDbzDB4Uori++9NPyz85V9Y+tUYc1OPSqT9cEIk1yKRUp/0LLBji/o6jRDTk0Yr6n/1SBBKwn39vdqqjpOfyUYfwz7yG3bi6HHdDT3V1QM+yxiGwZ1txmpRm+K6TYVFeUv2VV/fQKBZA8frLD71P45t0uZFNadbOnNFbQ/SbcaSGs3GR4vZ5cRBpPS3mZcmCQUyv9DCp1z6wFLRNC9zoebGVPqgSm4eAIwpAP1eHV5k3PxlvhqBLMOL6buvWdpZJTkE2HZfyODMDAshWdMQvvw==
  • 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:18:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

With the second patch, these disappear, which is why _that_ builds.

>
>> -    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>

Thanks.

~Andrew



 


Rackspace

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