xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: xen-devel@lists.xenproject.org
Cc: Julien Grall <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand.Marquis@arm.com
Subject: [Xen-devel] [PATCH] xen/arm: domain_build: Don't continue if unable to allocate all dom0 banks
Date: Wed, 21 Aug 2019 23:12:21 +0100	[thread overview]
Message-ID: <20190821221221.19456-1-julien.grall@arm.com> (raw)

Xen will only print a warning if there are memory unallocated when using
1:1 mapping (only used by dom0). This also includes the case where no
memory has been allocated.

It will bring to all sort of issues that can be hard to diagnostic for
users (the warning can be difficult to spot or disregard).

If the users request 1GB of memory, then most likely they want the exact
amount and not 512MB. So panic if all the memory has not been allocated.

After this change, the behavior is the same as for non-1:1 memory
allocation (used by domU).

At the same time, reflow the message to have the format on a single
line.

Signed-off-by: Julien Grall <julien.grall@arm.com>

---

Cc: Bertrand.Marquis@arm.com

It took me sometimes this morning to spot the warning in the log. If we
don't honor the size, it feels it is better to crash and request the
user to request less memory (or re-order the binary).

This is inline on how domU memory allocation is handled.
---
 xen/arch/arm/domain_build.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 1a3dcb1bcd..72e14746cd 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -358,10 +358,9 @@ static void __init allocate_memory_11(struct domain *d,
     }
 
     if ( kinfo->unassigned_mem )
-        printk("WARNING: Failed to allocate requested dom0 memory."
-               /* Don't want format this as PRIpaddr (16 digit hex) */
-               " %ldMB unallocated\n",
-               (unsigned long)kinfo->unassigned_mem >> 20);
+        /* Don't want format this as PRIpaddr (16 digit hex) */
+        panic("Failed to allocate requested dom0 memory. %ldMB unallocated\n",
+              (unsigned long)kinfo->unassigned_mem >> 20);
 
     for( i = 0; i < kinfo->mem.nr_banks; i++ )
     {
-- 
2.11.0


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

             reply	other threads:[~2019-08-21 22:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-21 22:12 Julien Grall [this message]
2019-10-02  1:12 ` [Xen-devel] [PATCH] xen/arm: domain_build: Don't continue if unable to allocate all dom0 banks Stefano Stabellini

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=20190821221221.19456-1-julien.grall@arm.com \
    --to=julien.grall@arm.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Volodymyr_Babchuk@epam.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).