[PATCH] hw/i386: Expand the range of CPU topologies between smp and maxcpus

caodongli@tsinghua.edu.cn posted 1 patch 3 years ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/2021042519220937479214@tsinghua.edu.cn
There is a newer version of this series
hw/i386/pc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] hw/i386: Expand the range of CPU topologies between smp and maxcpus
Posted by caodongli@tsinghua.edu.cn 3 years ago
Change the criteria for the initial CPU topology and maxcpus, user can
have more settings

Signed-off-by: Dongli Cao <caodongli@kingsoft.com>
---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 8a84b25..ef2e819 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -751,7 +751,7 @@ void pc_smp_parse(MachineState *ms, QemuOpts *opts)
             exit(1);
         }

-        if (sockets * dies * cores * threads != ms->smp.max_cpus) {
+        if (sockets * dies * cores * threads > ms->smp.max_cpus) {
             error_report("Invalid CPU topology deprecated: "
                          "sockets (%u) * dies (%u) * cores (%u) * threads (%u) "
                          "!= maxcpus (%u)",
-- 
1.8.3.1





caodongli@tsinghua.edu.cn