aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorZhao Liu <zhao1.liu@intel.com>2024-03-09 00:01:37 +0800
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-03-09 19:17:01 +0100
commit54c4ea8f3ae614054079395842128a856a73dbf9 (patch)
treedaba2f11067764bd0554f3fb7c72bb4a368fdcde /hw
parent72d346f3b8504804df047166164af52af4f95708 (diff)
hw/core/machine-smp: Deprecate unsupported "parameter=1" SMP configurations
Currently, it was allowed for users to specify the unsupported topology parameter as "1". For example, x86 PC machine doesn't support drawer/book/cluster topology levels, but user could specify "-smp drawers=1,books=1,clusters=1". This is meaningless and confusing, so that the support for this kind of configurations is marked deprecated since 9.0. And report warning message for such case like: qemu-system-x86_64: warning: Deprecated CPU topology (considered invalid): Unsupported clusters parameter mustn't be specified as 1 qemu-system-x86_64: warning: Deprecated CPU topology (considered invalid): Unsupported books parameter mustn't be specified as 1 qemu-system-x86_64: warning: Deprecated CPU topology (considered invalid): Unsupported drawers parameter mustn't be specified as 1 Users have to ensure that all the topology members described with -smp are supported by the target machine. Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240308160148.3130837-3-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/core/machine-smp.c63
1 files changed, 47 insertions, 16 deletions
diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c
index 96533886b1..50a5a40dbc 100644
--- a/hw/core/machine-smp.c
+++ b/hw/core/machine-smp.c
@@ -112,30 +112,61 @@ void machine_parse_smp_config(MachineState *ms,
/*
* If not supported by the machine, a topology parameter must be
- * omitted or specified equal to 1.
+ * omitted.
*/
- if (!mc->smp_props.dies_supported && dies > 1) {
- error_setg(errp, "dies not supported by this machine's CPU topology");
- return;
- }
- if (!mc->smp_props.clusters_supported && clusters > 1) {
- error_setg(errp, "clusters not supported by this machine's CPU topology");
- return;
+ if (!mc->smp_props.clusters_supported && config->has_clusters) {
+ if (config->clusters > 1) {
+ error_setg(errp, "clusters not supported by this "
+ "machine's CPU topology");
+ return;
+ } else {
+ /* Here clusters only equals 1 since we've checked zero case. */
+ warn_report("Deprecated CPU topology (considered invalid): "
+ "Unsupported clusters parameter mustn't be "
+ "specified as 1");
+ }
}
+ clusters = clusters > 0 ? clusters : 1;
+ if (!mc->smp_props.dies_supported && config->has_dies) {
+ if (config->dies > 1) {
+ error_setg(errp, "dies not supported by this "
+ "machine's CPU topology");
+ return;
+ } else {
+ /* Here dies only equals 1 since we've checked zero case. */
+ warn_report("Deprecated CPU topology (considered invalid): "
+ "Unsupported dies parameter mustn't be "
+ "specified as 1");
+ }
+ }
dies = dies > 0 ? dies : 1;
- clusters = clusters > 0 ? clusters : 1;
- if (!mc->smp_props.books_supported && books > 1) {
- error_setg(errp, "books not supported by this machine's CPU topology");
- return;
+ if (!mc->smp_props.books_supported && config->has_books) {
+ if (config->books > 1) {
+ error_setg(errp, "books not supported by this "
+ "machine's CPU topology");
+ return;
+ } else {
+ /* Here books only equals 1 since we've checked zero case. */
+ warn_report("Deprecated CPU topology (considered invalid): "
+ "Unsupported books parameter mustn't be "
+ "specified as 1");
+ }
}
books = books > 0 ? books : 1;
- if (!mc->smp_props.drawers_supported && drawers > 1) {
- error_setg(errp,
- "drawers not supported by this machine's CPU topology");
- return;
+ if (!mc->smp_props.drawers_supported && config->has_drawers) {
+ if (config->drawers > 1) {
+ error_setg(errp, "drawers not supported by this "
+ "machine's CPU topology");
+ return;
+ } else {
+ /* Here drawers only equals 1 since we've checked zero case. */
+ warn_report("Deprecated CPU topology (considered invalid): "
+ "Unsupported drawers parameter mustn't be "
+ "specified as 1");
+ }
}
drawers = drawers > 0 ? drawers : 1;