qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Dou Liyang <douly.fnst@cn.fujitsu.com>
Cc: qemu-devel@nongnu.org, imammedo@redhat.com, dgilbert@redhat.com,
	armbru@redhat.com, david@redhat.com
Subject: Re: [Qemu-devel] [PATCH] numa: Add a check whether the node0 has memory or not
Date: Mon, 14 Aug 2017 09:44:39 -0300	[thread overview]
Message-ID: <20170814124439.GM3108@localhost.localdomain> (raw)
In-Reply-To: <1502705471-28407-1-git-send-email-douly.fnst@cn.fujitsu.com>

On Mon, Aug 14, 2017 at 06:11:11PM +0800, Dou Liyang wrote:
> Currently, Using the fisrt node without memory on the machine makes
> QEMU unhappy. With this example command line:
>   ... \
>   -m 1024M,slots=4,maxmem=32G \
>   -numa node,nodeid=0 \
>   -numa node,mem=1024M,nodeid=1 \
>   -numa node,nodeid=2 \
>   -numa node,nodeid=3 \
> Guest reports "No NUMA configuration found" and the NUMA topology is
> wrong.
> 
> This is because when QEMU builds ACPI SRAT, it regards node0 as the
> default node to deal with the memory hole(640K-1M). this means the
> node0 must have some memory(>1M) firstly.
> 
> Add a check in parse_numa_opts to avoid this situation.
> 
> Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
> ---
>  numa.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/numa.c b/numa.c
> index e32af04..1d6f73f 100644
> --- a/numa.c
> +++ b/numa.c
> @@ -464,6 +464,10 @@ void parse_numa_opts(MachineState *ms)
>          if (i == nb_numa_nodes) {
>              assert(mc->numa_auto_assign_ram);
>              mc->numa_auto_assign_ram(mc, numa_info, nb_numa_nodes, ram_size);
> +        } else if (i != 0) {
> +            error_report("The first NUMA node must have some memory"
> +                          " for building ACPI SART");
> +            exit(1);

This doesn't belong to numa.c.  numa.c is generic code, and the
requirement you described is specific for PC.

Anyway, adding this check would make existing VM configurations
refuse to run after a QEMU upgrade.  I suggest fixing the bug in
the ACPI code instead.

-- 
Eduardo

  parent reply	other threads:[~2017-08-14 12:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14 10:11 [Qemu-devel] [PATCH] numa: Add a check whether the node0 has memory or not Dou Liyang
2017-08-14 10:20 ` Dou Liyang
2017-08-14 12:44 ` Eduardo Habkost [this message]
2017-08-15  1:26   ` Dou Liyang
2017-08-15  8:04     ` Igor Mammedov
2017-08-15  9:04       ` Dou Liyang

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=20170814124439.GM3108@localhost.localdomain \
    --to=ehabkost@redhat.com \
    --cc=armbru@redhat.com \
    --cc=david@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=douly.fnst@cn.fujitsu.com \
    --cc=imammedo@redhat.com \
    --cc=qemu-devel@nongnu.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).