All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Anisov <andrii_anisov@epam.com>
To: Julien Grall <julien.grall@arm.com>, Xen Devel <xen-devel@lists.xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>,
	nd@arm.com, Ian Jackson <ian.jackson@eu.citrix.com>
Subject: Re: 4.9.0-rcX can not be built for ARM64
Date: Mon, 15 May 2017 11:30:52 +0300	[thread overview]
Message-ID: <242f2372-b2da-e399-6f42-e7af3b3ffdc2@epam.com> (raw)
In-Reply-To: <3549b528-1b1e-b2aa-bad2-ffad6cb43629@arm.com>

Julien,


On 15.05.17 11:12, Julien Grall wrote:
> It looks like you compiler does not (validly?) detect that size will 
> always be initialized when (rc > 0). 

The question is if it should be considered as the XEN sources bug and to 
be patched appropriately.

> Can you try this small patch below:
>
> diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c
> index db113dbf85..f61aec672b 100644
> --- a/tools/libxl/libxl_arm_acpi.c
> +++ b/tools/libxl/libxl_arm_acpi.c
> @@ -73,6 +73,8 @@ static int libxl__estimate_madt_size(libxl__gc *gc,
>  {
>      int rc = 0;
>
> +    *size = 0;
> +
>      switch (info->arch_arm.gic_version) {
>      case LIBXL_GIC_VERSION_V2:
>          *size = sizeof(struct acpi_table_madt) +

On my table I initialized size before libxl__estimate_madt_size() usage, 
i.e.:

diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c
index db113db..ccc7ebe 100644
--- a/tools/libxl/libxl_arm_acpi.c
+++ b/tools/libxl/libxl_arm_acpi.c
@@ -98,7 +98,7 @@ int libxl__get_acpi_size(libxl__gc *gc,
                           const libxl_domain_build_info *info,
                           uint64_t *out)
  {
-    uint64_t size;
+    uint64_t size = 0;
      int rc = 0;


@@ -123,7 +123,7 @@ static int libxl__allocate_acpi_tables(libxl__gc *gc,
                                         struct acpitable acpitables[])
  {
      int rc;
-    size_t size;
+    size_t size = 0;

      acpitables[RSDP].addr = GUEST_ACPI_BASE;
      acpitables[RSDP].size = sizeof(struct acpi_table_rsdp);

But your code seems to be leaner.

-- 

*Andrii Anisov*



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-05-15  8:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13 12:38 4.9.0-rcX can not be built for ARM64 Andrii Anisov
2017-05-15  8:12 ` Julien Grall
2017-05-15  8:30   ` Andrii Anisov [this message]
2017-05-15 10:34     ` Julien Grall
2017-05-15 13:20       ` Andrii Anisov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=242f2372-b2da-e399-6f42-e7af3b3ffdc2@epam.com \
    --to=andrii_anisov@epam.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien.grall@arm.com \
    --cc=nd@arm.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.