From: Igor Mammedov <imammedo@redhat.com>
To: Yin Wang <yin.wang@intel.com>
Cc: qemu-devel@nongnu.org, "Eduardo Habkost" <eduardo@habkost.net>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Yanan Wang" <wangyanan55@huawei.com>
Subject: Re: [PATCH] Fix QEMU crash caused when NUMA nodes exceed available CPUs
Date: Tue, 9 May 2023 14:12:43 +0200 [thread overview]
Message-ID: <20230509141243.7ce34dd0@imammedo.users.ipa.redhat.com> (raw)
In-Reply-To: <20230509064452.759834-1-yin.wang@intel.com>
On Tue, 9 May 2023 14:44:52 +0800
Yin Wang <yin.wang@intel.com> wrote:
> command "qemu-system-riscv64 -machine virt
> -m 2G -smp 1 -numa node,mem=1G -numa node,mem=1G"
> would trigger this problem.
> This commit fixes the issue by adding parameter checks.
It seems wrong to apply this to all targets (that
potentially excludes CPU-less nodes in some cases).
PS:
Crash backtrace should be mentioned in commit message.
>
> Signed-off-by: Yin Wang <yin.wang@intel.com>
> ---
> hw/core/numa.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/hw/core/numa.c b/hw/core/numa.c
> index d8d36b16d8..ff249369be 100644
> --- a/hw/core/numa.c
> +++ b/hw/core/numa.c
> @@ -168,6 +168,13 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
> numa_info[nodenr].present = true;
> max_numa_nodeid = MAX(max_numa_nodeid, nodenr + 1);
> ms->numa_state->num_nodes++;
> + if (ms->smp.max_cpus < ms->numa_state->num_nodes) {
> + error_setg(errp,
> + "Number of NUMA nodes:(%d)"
> + " is larger than number of CPUs:(%d)",
> + ms->numa_state->num_nodes, ms->smp.max_cpus);
> + return;
> + }
> }
>
> static
prev parent reply other threads:[~2023-05-09 12:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-09 6:44 [PATCH] Fix QEMU crash caused when NUMA nodes exceed available CPUs Yin Wang
2023-05-09 12:12 ` Igor Mammedov [this message]
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=20230509141243.7ce34dd0@imammedo.users.ipa.redhat.com \
--to=imammedo@redhat.com \
--cc=eduardo@habkost.net \
--cc=marcel.apfelbaum@gmail.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=wangyanan55@huawei.com \
--cc=yin.wang@intel.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).