[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/43] hw/core/machine-smp: Deprecate unsupported "parameter=1" SM
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 31/43] hw/core/machine-smp: Deprecate unsupported "parameter=1" SMP configurations |
Date: |
Sat, 9 Mar 2024 20:21:58 +0100 |
From: Zhao Liu <zhao1.liu@intel.com>
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>
---
docs/about/deprecated.rst | 14 +++++++++
hw/core/machine-smp.c | 65 +++++++++++++++++++++++++++++----------
2 files changed, 62 insertions(+), 17 deletions(-)
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 6e2f557682..dfd681cd02 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -57,6 +57,20 @@ The ``-p`` option pretends to control the host page size.
However,
it is not possible to change the host page size, and using the
option only causes failures.
+``-smp`` (Unsupported "parameter=1" SMP configurations) (since 9.0)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Specified CPU topology parameters must be supported by the machine.
+
+In the SMP configuration, users should provide the CPU topology parameters that
+are supported by the target machine.
+
+However, historically it was allowed for users to specify the unsupported
+topology parameter as "1", which is meaningless. So support for this kind of
+configurations (e.g. -smp drawers=1,books=1,clusters=1 for x86 PC machine) is
+marked deprecated since 9.0, users have to ensure that all the topology members
+described with -smp are supported by the target machine.
+
QEMU Machine Protocol (QMP) commands
------------------------------------
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 && 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");
+ }
}
- if (!mc->smp_props.clusters_supported && clusters > 1) {
- error_setg(errp, "clusters not supported by this machine's CPU
topology");
- return;
- }
-
- 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.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;
+
+ 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;
--
2.41.0
- [PULL 20/43] hw/i386/pc: Use generated NotifyVmexitOption_str(), (continued)
- [PULL 20/43] hw/i386/pc: Use generated NotifyVmexitOption_str(), Philippe Mathieu-Daudé, 2024/03/09
- [PULL 21/43] hw/i386/pc: Remove 'host_type' argument from pc_init1(), Philippe Mathieu-Daudé, 2024/03/09
- [PULL 22/43] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 23/43] hw/intc/apic: fix memory leak, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 24/43] qdev: Add a granule_mode property, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 25/43] hmp: Add option to info qtree to omit details, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 26/43] mac_newworld: change timebase frequency from 100MHz to 25MHz for mac99 machine, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 27/43] hw/intc/grlib_irqmp: abort realize when ncpus value is out of range, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 29/43] docs/interop/firmware.json: Fix doc for FirmwareFlashMode, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 28/43] docs/interop/firmware.json: Align examples, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 31/43] hw/core/machine-smp: Deprecate unsupported "parameter=1" SMP configurations,
Philippe Mathieu-Daudé <=
- [PULL 32/43] hw/core/machine-smp: Calculate total CPUs once in machine_parse_smp_config(), Philippe Mathieu-Daudé, 2024/03/09
- [PULL 34/43] tests/unit/test-smp-parse: Use CPU number macros in invalid topology case, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 30/43] hw/core/machine-smp: Remove deprecated "parameter=0" SMP configurations, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 35/43] tests/unit/test-smp-parse: Bump max_cpus to 4096, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 39/43] tests/unit/test-smp-parse: Test "drawers" and "books" combination case, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 41/43] tests/unit/test-smp-parse: Test smp_props.has_clusters, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 33/43] tests/unit/test-smp-parse: Drop the unsupported "dies=1" case, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 36/43] tests/unit/test-smp-parse: Make test cases aware of the book/drawer, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 38/43] tests/unit/test-smp-parse: Test "drawers" parameter in -smp, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 40/43] tests/unit/test-smp-parse: Test the full 7-levels topology hierarchy, Philippe Mathieu-Daudé, 2024/03/09