* [PATCH] hw/riscv: Fix topo field in error_report
@ 2023-07-18 8:07 Zhao Liu
2023-07-19 1:17 ` Alistair Francis
2023-07-19 1:21 ` Alistair Francis
0 siblings, 2 replies; 3+ messages in thread
From: Zhao Liu @ 2023-07-18 8:07 UTC (permalink / raw)
To: Palmer Dabbelt, Alistair Francis, Bin Meng, Weiwei Li,
Daniel Henrique Barboza, Liu Zhiwei
Cc: Philippe Mathieu-Daudé, qemu-devel, qemu-riscv, Zhenyu Wang,
Zhao Liu
From: Zhao Liu <zhao1.liu@intel.com>
"smp.cpus" means the number of online CPUs and "smp.max_cpus" means the
total number of CPUs.
riscv_numa_get_default_cpu_node_id() checks "smp.cpus" and the
"available CPUs" description in the next error message also indicates
online CPUs.
So report "smp.cpus" in error_report() instand of "smp.max_cpus".
Since "smp.cpus" is "unsigned int", use "%u".
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/riscv/numa.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/riscv/numa.c b/hw/riscv/numa.c
index e0414d5b1b73..d319aefb4511 100644
--- a/hw/riscv/numa.c
+++ b/hw/riscv/numa.c
@@ -209,8 +209,8 @@ int64_t riscv_numa_get_default_cpu_node_id(const MachineState *ms, int idx)
if (ms->numa_state->num_nodes > ms->smp.cpus) {
error_report("Number of NUMA nodes (%d)"
- " cannot exceed the number of available CPUs (%d).",
- ms->numa_state->num_nodes, ms->smp.max_cpus);
+ " cannot exceed the number of available CPUs (%u).",
+ ms->numa_state->num_nodes, ms->smp.cpus);
exit(EXIT_FAILURE);
}
if (ms->numa_state->num_nodes) {
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/riscv: Fix topo field in error_report
2023-07-18 8:07 [PATCH] hw/riscv: Fix topo field in error_report Zhao Liu
@ 2023-07-19 1:17 ` Alistair Francis
2023-07-19 1:21 ` Alistair Francis
1 sibling, 0 replies; 3+ messages in thread
From: Alistair Francis @ 2023-07-19 1:17 UTC (permalink / raw)
To: Zhao Liu
Cc: Palmer Dabbelt, Alistair Francis, Bin Meng, Weiwei Li,
Daniel Henrique Barboza, Liu Zhiwei, Philippe Mathieu-Daudé,
qemu-devel, qemu-riscv, Zhenyu Wang, Zhao Liu
On Tue, Jul 18, 2023 at 5:57 PM Zhao Liu <zhao1.liu@linux.intel.com> wrote:
>
> From: Zhao Liu <zhao1.liu@intel.com>
>
> "smp.cpus" means the number of online CPUs and "smp.max_cpus" means the
> total number of CPUs.
>
> riscv_numa_get_default_cpu_node_id() checks "smp.cpus" and the
> "available CPUs" description in the next error message also indicates
> online CPUs.
>
> So report "smp.cpus" in error_report() instand of "smp.max_cpus".
>
> Since "smp.cpus" is "unsigned int", use "%u".
>
> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> hw/riscv/numa.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/riscv/numa.c b/hw/riscv/numa.c
> index e0414d5b1b73..d319aefb4511 100644
> --- a/hw/riscv/numa.c
> +++ b/hw/riscv/numa.c
> @@ -209,8 +209,8 @@ int64_t riscv_numa_get_default_cpu_node_id(const MachineState *ms, int idx)
>
> if (ms->numa_state->num_nodes > ms->smp.cpus) {
> error_report("Number of NUMA nodes (%d)"
> - " cannot exceed the number of available CPUs (%d).",
> - ms->numa_state->num_nodes, ms->smp.max_cpus);
> + " cannot exceed the number of available CPUs (%u).",
> + ms->numa_state->num_nodes, ms->smp.cpus);
> exit(EXIT_FAILURE);
> }
> if (ms->numa_state->num_nodes) {
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/riscv: Fix topo field in error_report
2023-07-18 8:07 [PATCH] hw/riscv: Fix topo field in error_report Zhao Liu
2023-07-19 1:17 ` Alistair Francis
@ 2023-07-19 1:21 ` Alistair Francis
1 sibling, 0 replies; 3+ messages in thread
From: Alistair Francis @ 2023-07-19 1:21 UTC (permalink / raw)
To: Zhao Liu
Cc: Palmer Dabbelt, Alistair Francis, Bin Meng, Weiwei Li,
Daniel Henrique Barboza, Liu Zhiwei, Philippe Mathieu-Daudé,
qemu-devel, qemu-riscv, Zhenyu Wang, Zhao Liu
On Tue, Jul 18, 2023 at 5:57 PM Zhao Liu <zhao1.liu@linux.intel.com> wrote:
>
> From: Zhao Liu <zhao1.liu@intel.com>
>
> "smp.cpus" means the number of online CPUs and "smp.max_cpus" means the
> total number of CPUs.
>
> riscv_numa_get_default_cpu_node_id() checks "smp.cpus" and the
> "available CPUs" description in the next error message also indicates
> online CPUs.
>
> So report "smp.cpus" in error_report() instand of "smp.max_cpus".
>
> Since "smp.cpus" is "unsigned int", use "%u".
>
> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
I fixed up the typo in the commit title
Thanks!
Applied to riscv-to-apply.next
Alistair
> ---
> hw/riscv/numa.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/riscv/numa.c b/hw/riscv/numa.c
> index e0414d5b1b73..d319aefb4511 100644
> --- a/hw/riscv/numa.c
> +++ b/hw/riscv/numa.c
> @@ -209,8 +209,8 @@ int64_t riscv_numa_get_default_cpu_node_id(const MachineState *ms, int idx)
>
> if (ms->numa_state->num_nodes > ms->smp.cpus) {
> error_report("Number of NUMA nodes (%d)"
> - " cannot exceed the number of available CPUs (%d).",
> - ms->numa_state->num_nodes, ms->smp.max_cpus);
> + " cannot exceed the number of available CPUs (%u).",
> + ms->numa_state->num_nodes, ms->smp.cpus);
> exit(EXIT_FAILURE);
> }
> if (ms->numa_state->num_nodes) {
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-19 1:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-18 8:07 [PATCH] hw/riscv: Fix topo field in error_report Zhao Liu
2023-07-19 1:17 ` Alistair Francis
2023-07-19 1:21 ` Alistair Francis
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).