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

Re: [PATCH] xen/arm: ffa: fix build with clang


  • To: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 8 Jan 2025 16:34:55 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=QPQ2RQYmDu4k3droeRPIAf4d8pcxOB0ub7sA/cfNF0c=; b=CeMxEnaSJGpBvHXZ2KOiOGRpwxcvXOsA5aEwBocf4+2Lop3rpUhKs2gwL5tMzq8oPLxWdSeKf6lKuaybLuPB3DC8Glsp2PSkXlcUOEeWR4/jYqxcOyZsktHHfkdW6z+am46KMj8jysqj1lmZx+y/NZQJx2/Yu/qgNLZDm7vh2QzBfErJr1P16r9adbd2mZrADIWY+9hwmaoZ5gQXw2w9ZcJwd+UvJ3bI9AVnXt3TY34e/TO6mZCJLFl8EEYEWDBmn37yXdAyWwVgPZExM9FOyBCsXH4y/jLmU1Z4ckeQcxkj3i2cdHQeM7RSshNvx2r+IOGp4QzK1eF57H0yDfigHg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YkjjBpBC1G7HsqJqT5kndxojGhEz7YlRCHr2RUtpazN+r22VknYYpZXoWxwbn+We4f4zmkeuCyJ7BTdeQldM3dS+43kw/VlDkwORgg8QprChIF42iTAepL9805d6Y9gQ62dJrmtq+cyL98puxZMo7Cu0aakicFrjGbAg+WnMr8OVRiTAEb7a8CA+X8qmBe26POkMmwvely9MpwqxUqGRnXShU9GegdPzZO5XUTstQiOnCFP98+HZ0a1lh3kvxhw99UJUYKhE6FL9g0AZ0CG+vlXKHBv8ZX4L3nDgHQcpQBV3xV5ERNInc+gqjfCssbHSad25B8rxFnP7w3gqUbiEbg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • Delivery-date: Wed, 08 Jan 2025 16:35:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHbYeFGu37kkF0Uuk6Sa5TIC8NMALMNBOYAgAANyoA=
  • Thread-topic: [PATCH] xen/arm: ffa: fix build with clang

Hi,

> On 8 Jan 2025, at 16:45, Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx> 
> wrote:
> 
> Hi,
> 
> On Wed Jan 8, 2025 at 3:23 PM GMT, Stewart Hildebrand wrote:
>> Clang 16 reports:
>> 
>> In file included from arch/arm/tee/ffa.c:72:
>> arch/arm/tee/ffa_private.h:329:17: error: 'used' attribute ignored on a 
>> non-definition declaration [-Werror,-Wignored-attributes]
>> extern uint32_t __ro_after_init ffa_fw_version;
>>                ^
>> 
>> Remove the attribute from the header to resolve this. The attribute in
>> ffa.c is the one the matters anyway.
>> 
>> Fixes: 2f9f240a5e87 ("xen/arm: ffa: Fine granular call support")
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
>> ---
>> It appears the variable ffa_fw_version is only used in ffa.c. Was there
>> any rationale for exporting the symbol in 2f9f240a5e87 ("xen/arm: ffa:
>> Fine granular call support")? If not, perhaps we ought to make it static
>> again and remove the declaration in the header.
> 
> The only reason I can think of is wanting to have it in the symbol table of 
> the
> ELF file for some reason (livepatching?). But that's far fetched at best.
> 
>> ---
>> xen/arch/arm/tee/ffa_private.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
>> index d441c0ca5598..05368d5a88d3 100644
>> --- a/xen/arch/arm/tee/ffa_private.h
>> +++ b/xen/arch/arm/tee/ffa_private.h
>> @@ -326,7 +326,7 @@ extern void *ffa_rx;
>> extern void *ffa_tx;
>> extern spinlock_t ffa_rx_buffer_lock;
>> extern spinlock_t ffa_tx_buffer_lock;
>> -extern uint32_t __ro_after_init ffa_fw_version;
>> +extern uint32_t ffa_fw_version;
>> extern DECLARE_BITMAP(ffa_fw_abi_supported, FFA_ABI_BITMAP_SIZE);
>> 
>> bool ffa_shm_domain_destroy(struct domain *d);
>> 
>> base-commit: 70f5a875becc9444a959830b10a361982c31a366
> 
> IMO, it makes sense to make it static and remove this line altogether as you
> suggest. If it needs to be exported later on it can be adjusted as needed.
> 

Yes in fact it was made global as there was a use case at some point but this 
is not
the case anymore so in fact we can completely remove this from the header and 
make
it static for now.

@stewart: are you happy to push a patch doing this instead ?

Cheers
Bertrand

> Cheers,
> Alejandro





 


Rackspace

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