From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: agraf@suse.de, andre.przywara@amd.com, stefanha@redhat.com,
mst@redhat.com, peter.maydell@linaro.org, armbru@redhat.com,
ehabkost@redhat.com, lcapitulino@redhat.com, qemu-ppc@nongnu.org,
aliguori@amazon.com, pbonzini@redhat.com, afaerber@suse.de,
gaowanlong@cn.fujitsu.com, rth@twiddle.net
Subject: [Qemu-devel] [PATCH 3/6] NUMA: check if the total numa memory size is equal to ram_size
Date: Mon, 17 Feb 2014 16:49:44 +0100 [thread overview]
Message-ID: <1392652187-28381-4-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1392652187-28381-1-git-send-email-imammedo@redhat.com>
From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
If the total number of the assigned numa nodes memory is not
equal to the assigned ram size, it will write the wrong data
to ACPI table, then the guest will ignore the wrong ACPI table
and recognize all memory to one node. It's buggy, we should
check it to ensure that we write the right data to ACPI table.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
numa.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/numa.c b/numa.c
index 7845036..d12a4f2 100644
--- a/numa.c
+++ b/numa.c
@@ -151,6 +151,16 @@ void set_numa_nodes(void)
node_mem[i] = ram_size - usedmem;
}
+ uint64_t numa_total = 0;
+ for (i = 0; i < nb_numa_nodes; i++) {
+ numa_total += node_mem[i];
+ }
+ if (numa_total != ram_size) {
+ fprintf(stderr, "qemu: numa nodes total memory size "
+ "should equal ram_size\n");
+ exit(1);
+ }
+
for (i = 0; i < nb_numa_nodes; i++) {
if (!bitmap_empty(node_cpumask[i], MAX_CPUMASK_BITS)) {
break;
--
1.7.1
next prev parent reply other threads:[~2014-02-17 15:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 15:49 [Qemu-devel] [PATCH 0/6] convert -numa to QemuOpts/OptsVisitor Igor Mammedov
2014-02-17 15:49 ` [Qemu-devel] [PATCH 1/6] vl.c: fix style issue Igor Mammedov
2014-02-17 15:49 ` [Qemu-devel] [PATCH 2/6] NUMA: move numa related code to new file numa.c Igor Mammedov
2014-02-26 17:00 ` Eduardo Habkost
2014-02-17 15:49 ` Igor Mammedov [this message]
2014-02-26 17:15 ` [Qemu-devel] [PATCH 3/6] NUMA: check if the total numa memory size is equal to ram_size Eduardo Habkost
2014-02-26 17:28 ` Paolo Bonzini
2014-02-17 15:49 ` [Qemu-devel] [PATCH 4/6] NUMA: Add numa_info structure to contain numa nodes info Igor Mammedov
2014-02-26 16:42 ` Michael S. Tsirkin
2014-02-17 15:49 ` [Qemu-devel] [PATCH 5/6] NUMA: convert -numa option to use OptsVisitor Igor Mammedov
2014-02-17 16:36 ` Eric Blake
2014-02-26 14:40 ` [Qemu-devel] [PATCH v2 " Igor Mammedov
2014-02-26 18:08 ` Eduardo Habkost
2014-02-17 15:49 ` [Qemu-devel] [PATCH 6/6] NUMA: expand MAX_NODES from 64 to 128 Igor Mammedov
2014-02-26 18:40 ` Eduardo Habkost
2014-02-26 16:42 ` [Qemu-devel] [PATCH 0/6] convert -numa to QemuOpts/OptsVisitor Michael S. Tsirkin
2014-02-26 16:53 ` Paolo Bonzini
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=1392652187-28381-4-git-send-email-imammedo@redhat.com \
--to=imammedo@redhat.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aliguori@amazon.com \
--cc=andre.przywara@amd.com \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=gaowanlong@cn.fujitsu.com \
--cc=lcapitulino@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanha@redhat.com \
/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).