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

Re: [PATCH] xen: Add macro for version number string


  • To: Leo Yan <leo.yan@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 7 Sep 2022 14:12:25 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; 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=pIm6Lb9lUpyeG1rj/K/O/GvuUTTYgu++SwSYDBeUgTE=; b=lxH1AwUltci1hU5ujAuZHhmW8kbVyKz1/t/DkJMbdOdlJQX3T8fmyD038m7EA4WG0Sqfxkuic2g9Sbl0JQB+zRoaj1EqNa37Hu86gjUq4mbU4b9qAL3idGOG+NgVGVkjlQp2952LhR328AE/oLVuDiCuzO5RYPrWEmGoBU4Uni/q/ICWOULNCC+N6fUKOunzQ3kpFGKE500qgOXZCbedGfnA5iIHDVpFNK332ihBj2Oq94tYhChRkXRjs61kZASMShIvOzzVH87kYMNKVl3i4KO6egWpbGP9LHNiXLjal+xpCNoelGJS2SPVPJrXybmJhe7cjW3G2WRyuQ3vXUNRuQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YX1oBx9yjBMwPuiua1Z1GfjR0ktwwZulkkHJpMAV3FgZJhpkW8+cDH1BGw9ZiGeTYSnzKDJQcZ9DWgBX9uPPQNX8WD5/u1EE7FwnTWVVn2NH4qAahi/XDeFO1aIfp8Dm4v/wrFmfjcKsTK+U3zftKzf9yVI8LHKgDUZ82WAtezIAm5Ve6RVgIguNijj9ejlObp9aiUktTBfoBOS1wn8vR0xb2PITC8dxY1NFhygNFU8HfH1tGcdiznNYwCbEBvWd1qQUbPmq63BtWuJuxqgw8axx34ncDfmVqpsGKbR/LncipSLa0AVSntDC/y3+tcFDBocIp02CBATA8yB6gON8GQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 07 Sep 2022 12:12:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.09.2022 14:04, Leo Yan wrote:
> On Arm64 Linux kernel prints log for Xen version number:
> 
>   Xen XEN_VERSION.XEN_SUBVERSION support found
> 
> The header file "xen/compile.h" is missed so that XEN_VERSION and
> XEN_SUBVERSION are not defined, __stringify() wrongly converts them as
> strings and concatenate to string "XEN_VERSION.XEN_SUBVERSION".
> 
> This patch introduces a string macro XEN_VERSION_STRING, we can directly
> use it as version number string, as a result it drops to use of
> __stringify() to make the code more readable.
> 
> The change has been tested on Ampere AVA Arm64 platform.
> 
> Fixes: 5d797ee199b3 ("xen/arm: split domain_build.c")
> Suggested-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
> Signed-off-by: Leo Yan <leo.yan@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with perhaps a small adjustment (but it'll be the Arm maintainers to judge):

> @@ -91,7 +92,7 @@ static int __init acpi_make_hypervisor_node(const struct 
> kernel_info *kinfo,
>                                              struct membank tbl_add[])
>  {
>      const char compat[] =
> -        "xen,xen-"__stringify(XEN_VERSION)"."__stringify(XEN_SUBVERSION)"\0"
> +        "xen,xen-"XEN_VERSION_STRING"\0"

I think readability would benefit here from adding blanks around
XEN_VERSION_STRING here and ...

> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1367,7 +1367,7 @@ static int __init make_hypervisor_node(struct domain *d,
>                                         int addrcells, int sizecells)
>  {
>      const char compat[] =
> -        "xen,xen-"__stringify(XEN_VERSION)"."__stringify(XEN_SUBVERSION)"\0"
> +        "xen,xen-"XEN_VERSION_STRING"\0"

... here (as an aside I wonder why these variables aren't static
__initconst), just like ...

> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -1341,8 +1341,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE 
> *SystemTable)
>              efi_console_set_mode();
>      }
>  
> -    PrintStr(L"Xen " __stringify(XEN_VERSION) "." __stringify(XEN_SUBVERSION)
> -             XEN_EXTRAVERSION " (c/s " XEN_CHANGESET ") EFI loader\r\n");
> +    PrintStr(L"Xen " XEN_VERSION_STRING XEN_EXTRAVERSION
> +          " (c/s " XEN_CHANGESET ") EFI loader\r\n");

... it is here in particular for XEN_CHANGESET.

The other general remark I have: Please follow patch submission guidelines
and send To: the list with maintainers on Cc:.

Jan



 


Rackspace

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