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

Re: Xen reliance on non-standard GCC features


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Fri, 9 Jun 2023 12:12:19 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=LYwscvVKSm378Zqb4KQqIVqGUwWHCkp1VBCCXv4bPGE=; b=c+FEGfJk7itqh5mf5NQtVq25eTKLXJf8yElqvPQwjlWGveAPrWIpRCljnEOvCtnzNX7gwhfAl9sEzBdadYrGs2JRwToDdyq+fE9/FRy4Uy2e4Cj10fcTcd/cbnhMpuCjPma7Ymfrl98CfzSLvliSgNH1v6NGc7HcFklxgwf//gQsxNfUAQnv+ss/QJbTe/3kPYaXnyc/CQ7slhzHreeoHcl3okaHvsTDkFn0MRjCGlNyOnwmqSelOXk7boUMcN7dTOrGywlRYM3xE+aBztOMtLr2TjtVcSNZu5nJ/diPzAdtPCflmk9JlULg7UeTHP3/587mN6ldSklZioO6WqAK6A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XGwUpvVcvQBvl/O+Qgm0Ju0defp3B4/rADO4cCIPclq2jrWuSZ29eRp65KgrNOqPC+xkpdyCiAyTbDrcszaklYTSxdM5AkuvNBZOUD7bLy8tYJ6aqHqgtjJSBmXtA3LsZstdTm4xHrJzcl1gQROUfYJcyCerigwGGtZUKQAYZ7iWGTc6mi6icJguZ8B76CPOJubCOpY1o4gdqyWVQFOwo3+3q33QxcI0pK5fF2qMkfgI6zeKBBn5sOY8VL79jPe4EemAuSF41y6Fd1p4P1BKw52qDSMzJ6qv7aJZ3VOiER8a5tU8cJDhKHM4W5+GcwKU5/VBHqxpXleEuqnrVHKSJQ==
  • Cc: Stefano Stabellini <stefano.stabellini@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "consulting@xxxxxxxxxxx" <consulting@xxxxxxxxxxx>, Roberto Bagnara <bagnara@xxxxxxxxxxx>
  • Delivery-date: Fri, 09 Jun 2023 10:12:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 09/06/2023 11:47, Jan Beulich wrote:
> 
> 
> On 09.06.2023 11:36, Michal Orzel wrote:
>> On 09/06/2023 10:54, Jan Beulich wrote:
>>> On 08.06.2023 14:18, Roberto Bagnara wrote:
>>>> On 07/06/23 09:39, Jan Beulich wrote:
>>>>> On 05.06.2023 15:26, Roberto Bagnara wrote:
>>>>>> On 05/06/23 11:28, Jan Beulich wrote:
>>>>>>> On 05.06.2023 07:28, Roberto Bagnara wrote:
>>>>>>>> U6) Empty declarations.
>>>>>>
>>>>>> Examples:
>>>>>>
>>>>>> xen/arch/arm/arm64/lib/find_next_bit.c:57.29:
>>>>>> empty declaration (ill-formed for the C99 standard, ISO/IEC 9899:1999 
>>>>>> Section 6.7: "An empty declaration." [STD.emptdecl]). Tool used is 
>>>>>> `/usr/bin/aarch64-linux-gnu-gcc-12'
>>>>>>
>>>>>> xen/arch/arm/arm64/lib/find_next_bit.c:103.34:
>>>>>> empty declaration (ill-formed for the C99 standard, ISO/IEC 9899:1999 
>>>>>> Section 6.7: "An empty declaration." [STD.emptdecl]). Tool used is 
>>>>>> `/usr/bin/aarch64-linux-gnu-gcc-12'
>>>>>
>>>>> Looks like these could be taken care of by finally purging our
>>>>> EXPORT_SYMBOL() stub.
>>>>>
>>>>>> xen/arch/arm/include/asm/vreg.h:143.26:
>>>>>> empty declaration (ill-formed for the C99 standard, ISO/IEC 9899:1999 
>>>>>> Section 6.7: "An empty declaration." [STD.emptdecl]). Tool used is 
>>>>>> `/usr/bin/aarch64-linux-gnu-gcc-12'
>>>>>>
>>>>>> xen/arch/arm/include/asm/vreg.h:144.26:
>>>>>> empty declaration (ill-formed for the C99 standard, ISO/IEC 9899:1999 
>>>>>> Section 6.7: "An empty declaration." [STD.emptdecl]). Tool used is 
>>>>>> `/usr/bin/aarch64-linux-gnu-gcc-12'
>>>>>
>>>>> I'm having trouble spotting anything suspicious there.
>>>>
>>>> The macro expands to definitions of inline functions
>>>> and after the macro invocation there is a ";".
>>>>
>>>> The preprocessed code is then:
>>>>
>>>> static inline void foo() { ... }
>>>> ;
>>>>
>>>> where the final ";" is an empty declaration not allowed by
>>>> the C99 language standard.
>>>
>>> Oh, I see.
>>>
>>>> Removing the ";" after the macro invocation is a possible solution,
>>>> but other possibilities exist if this is strongly unwanted.
>>>
>>> We have other macros to instantiate functions, and there no stray
>>> semicolons are used. I think this wants doing the same way here, but it
>>> being Arm code the ultimate say is with the Arm maintainers.
>> Apart from vreg.h the same applies to TLB_HELPER of arm32/arm64.
>> I think also TYPE_SAFE would want to be fixed.
> 
> Indeed. For this last one I wonder though whether it wouldn't be better
> to continue to permit (really: require) the semicolon at the use sites,
> by putting the typedef-s last and omitting the semicolon in the macro
> definitions.
This would be an error I think since the functions are defined using this type
so it must be defined first. Unless there is a way to forward typedef. All in 
all,
removing semicolon at use sites is simpler.

~Michal



 


Rackspace

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