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

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


  • To: "leo.yan@xxxxxxxxxx" <leo.yan@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 7 Sep 2022 12:20:14 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=vMjq3052Fx6FmowpHIC6oeufP1w0FdLbadls3QqBZ7I=; b=LAtibjyD+XgaTwNh3jFEFTfRnVSvd49BzBn0zvBylK6FgLEF7NHTKue04cZJEAYhAshq403d23WMtBPsYvb+2HyosDUJjZKwjRj1jJl2nzj6UNmMenRUYEoC9i4wHMDzRo0VNeSQ6wVywm3fylh0OXZ1kt7rJQ/rWxvw5pEZ6IOSb4Gr83pRGXdkX/YrurFfSTwETkQIfA8dWdVw/l2eZzrsl/LEWWH+CZu9fbTccyKiKg5cd9JVj7aUaCck2hxmYZuEI3p6qdTf3VAPeoDvlSUI5In2In5h1VzoMRpcypOG5C65yPT85gvgewQjzF8mnbBSysIcIdhRldHaXYiCGA==
  • 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=vMjq3052Fx6FmowpHIC6oeufP1w0FdLbadls3QqBZ7I=; b=kHmqlLUE87Z3kwTLuB7gTs1cMFwPJWLIT7jlNtRiE7UyL45BtWepLTiMthBy/6r4eCzFwWzbRFbvVucMBFmQrZE/BsVn93mS1UD/o8QRwlT9BOX8Hz9utXMygFZKbZ5dBc7boTsHwWz2iqFd+Ci5hrdDybrLRzwgvuCbMjp9lOy6xwTDdEC7Lbr4obAu1tXRhEauBIdLsaSms5Qc2CcJSClPebw87O2ygPI+NNoJ4arUyMvRO3d4eUdktE5PdzKY5VpyTXQ1Xcp2QjktpDKQR9NsPEzo9D9Q7ywOn1l9UxkKkQ/MBjsReM/1RDL9xlEJWFtBxJfTyfXUgNlO+SgoYA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=DtItO6PxkskM0UIBZ7zAcAqf2amZ9b8T6F2i8C5vPFpuJeWWz76rIF4jNVU8dgvWbYyP91UWaNCgZQ5zaa9K3XqVkD8Fin/P9HL/YnynK0YpM0B44NLsEJfrksmyzrEP5ZJjtV8KmuDXqqLB6b6S5Gi6v8LfAR2MrwA4fg+UaNqFSGYxUG7AIukuXB/Lcj0TmmPNSSF5zfvIq0tf2OhscfEWPn0pAmkiCQ+hGiLkbh3m8UED0K5H8RO1Ms5C4YY3vn2+8GEZeVtI+jO7+vAKIXOiiUlO8LI+ggPw3THnDagJQT6z2IluGzOKdEQq2QRmKUmR1s/g9LWqYKvlLKWRYw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e02A7UHxUlIq9096lsDy5ymKHI9wybMMa1VfAHnVfcm2TNav7yNM4tx2lZoJUODTcLbS4LFC9fTwN9bj6l54i60Aj+NRZ6JAE15XLjIbaJ6e6btS6M04cgoBNTNC4Sen3yuoewn/ZvavdAW+bdv9baTYzRmd0mvQ7n41GLNeXtw9N5wQXK0xQ9fO/P6ZpGmAFR+RT9/FXmD9y2NWjSp2W1CI9yls1Obdpn4YhJdiGY9brkUykdZLtaD8APdu1zG9QuWMSisBAUN1hzii7PcpA7qWR/9Cg0kuvUt3iiPT833k8xRjB6mlFyirfrPJAMfgQ5GPYA+s/MknVh1nig+7Fw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 07 Sep 2022 12:20:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYwrIAv1XtejytxUaSGPsSo1mE/K3T4vkA
  • Thread-topic: [PATCH] xen: Add macro for version number string

Hi Leo,

Thanks a lot for the quick handling here.

> On 7 Sep 2022, at 13:04, Leo Yan <leo.yan@xxxxxxxxxx> 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: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Regarding the change suggested by Jan to add spaces, I think it is a
good idea so if the commiter agrees to do on it on commit please do,
otherwise we can keep this as is.

Cheers
Bertrand

> ---
> xen/arch/arm/acpi/domain_build.c | 3 ++-
> xen/arch/arm/domain_build.c      | 2 +-
> xen/common/efi/boot.c            | 4 ++--
> xen/include/xen/compile.h.in     | 1 +
> 4 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/arch/arm/acpi/domain_build.c 
> b/xen/arch/arm/acpi/domain_build.c
> index bbdc90f92c..b23c7cad7a 100644
> --- a/xen/arch/arm/acpi/domain_build.c
> +++ b/xen/arch/arm/acpi/domain_build.c
> @@ -9,6 +9,7 @@
>  * GNU General Public License for more details.
>  */
> 
> +#include <xen/compile.h>
> #include <xen/mm.h>
> #include <xen/sched.h>
> #include <xen/acpi.h>
> @@ -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"
>         "xen,xen";
>     int res;
>     /* Convenience alias */
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 3fd1186b53..62602d2b86 100644
> --- 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"
>         "xen,xen";
>     __be32 *reg, *cells;
>     gic_interrupt_t intr;
> diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> index a5b2d6ddb8..db0340c8e2 100644
> --- 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");
> 
>     efi_arch_relocate_image(0);
> 
> diff --git a/xen/include/xen/compile.h.in b/xen/include/xen/compile.h.in
> index 440ecb25c1..3151d1e7d1 100644
> --- a/xen/include/xen/compile.h.in
> +++ b/xen/include/xen/compile.h.in
> @@ -7,6 +7,7 @@
> 
> #define XEN_VERSION           @@version@@
> #define XEN_SUBVERSION                @@subversion@@
> +#define XEN_VERSION_STRING   "@@version@@.@@subversion@@"
> #define XEN_EXTRAVERSION      "@@extraversion@@"
> 
> #define XEN_CHANGESET         "@@changeset@@"
> -- 
> 2.34.1
> 




 


Rackspace

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