From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wei.liu2@citrix.com>,
Julien Grall <julien.grall@arm.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: [PATCH] libxc/arm: initialise p2m_size to make gcc happy
Date: Wed, 14 Mar 2018 12:32:03 +0000 [thread overview]
Message-ID: <20180314123203.30646-1-wei.liu2@citrix.com> (raw)
Gcc with -O3 failed to spot the loop to initialise p2m_size runs at
least once.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
tools/libxc/xc_dom_arm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 5b9eca6087..97d08f055a 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -395,7 +395,7 @@ static int meminit(struct xc_dom_image *dom)
const uint64_t modsize = dtb_size + ramdisk_size;
const uint64_t ram128mb = bankbase[0] + (128<<20);
- xen_pfn_t p2m_size;
+ xen_pfn_t p2m_size = 0; /* make gcc -O3 happy */
uint64_t bank0end;
assert(dom->rambase_pfn << XC_PAGE_SHIFT == bankbase[0]);
@@ -438,6 +438,7 @@ static int meminit(struct xc_dom_image *dom)
assert(dom->rambank_size[0] != 0);
assert(ramsize == 0); /* Too much RAM is rejected above */
+ assert(p2m_size != 0);
dom->p2m_size = p2m_size;
dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * p2m_size);
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next reply other threads:[~2018-03-14 12:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 12:32 Wei Liu [this message]
2018-03-14 12:35 ` [PATCH] libxc/arm: initialise p2m_size to make gcc happy Andrew Cooper
2018-03-14 12:37 ` Wei Liu
2018-03-14 13:45 ` Jan Beulich
2018-03-14 13:27 ` Julien Grall
2018-03-21 16:43 ` Wei Liu
2018-03-22 9:09 ` Julien Grall
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=20180314123203.30646-1-wei.liu2@citrix.com \
--to=wei.liu2@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=julien.grall@arm.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).