From nobody Mon Feb 9 16:18:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1709913089; cv=none; d=zohomail.com; s=zohoarc; b=QowQecnPXY/ym+QrXSDO5yiJyyrzBecVMZmzsgMajYxV7zvUkoFqYwSpu0hXzXXfkaiymPoJL6PK90PJu7caLCorCuBsyMffSpz+W6cVUbrpU1ImBcKyz6BmgaqYFBEreoCrNLpB9BRStvLMBVviljvJYAbgXXP7sY29DSdiKe0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709913089; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=y7K7wbix9yENdI8+BCfR2vf6sBSZZ4HfFVYP8ncqiUs=; b=AaYgBSOxFSbKHnYH+w4dPfBqBqw/BRpiFnXq8EHPLLWH2OTBhVT1Kfbf39PUCiMXLayiQr7aytoiQ1/pcHzmQXkXVzA4430vvW33wv6vu7jSjgyN39L5mvVUAcxDXXyiiY3zNxx/uUZVLSvHABDIswPQPYQjUxf8Wza9PYsQTA4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709913089752930.2247146761573; Fri, 8 Mar 2024 07:51:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ricSM-0000YE-Lz; Fri, 08 Mar 2024 10:48:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ricSL-0000Y4-1H for qemu-devel@nongnu.org; Fri, 08 Mar 2024 10:48:21 -0500 Received: from mgamail.intel.com ([198.175.65.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ricSJ-0003yA-7T for qemu-devel@nongnu.org; Fri, 08 Mar 2024 10:48:20 -0500 Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2024 07:48:19 -0800 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by fmviesa007.fm.intel.com with ESMTP; 08 Mar 2024 07:48:16 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709912900; x=1741448900; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FUnxZMIQ+lkqlPhuVllZ5Kf+bp2ultRSFG+6HXooT8A=; b=RR3xSvWAzxC9E2mHEQXsa7ycodwvvgbR9bD5qtRNAlaFGejEMBS7HVPf SEjv6D2dVI1GFY3FZOwOAaVNAAUcoKjfSSnOzpkx670NIIiC0ZAWfuuZl kjFbB1Dk9KY3K0PdWVH2WIhkLmJ4t5HbfgPAy3vqNX1fiOa6sdONKdGG4 todS2LfPb2U/O8eSqRtMCdAwpLsp4BiWOXpkvRa+VJORZucKNjV8yV4Vr anMYGud0QmKA2m2424AyEiD1WdzGL8sGhbyCs7fkb+ss4cATQrwOYzlb/ nXzSMMwTb1qFWdk3gTyz54fLWUn8ExrtI0SwhQGOV7s7HLf/JXhiyb32S A==; X-IronPort-AV: E=McAfee;i="6600,9927,11006"; a="4561022" X-IronPort-AV: E=Sophos;i="6.07,110,1708416000"; d="scan'208";a="4561022" X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,110,1708416000"; d="scan'208";a="10400318" From: Zhao Liu To: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Thomas Huth , Igor Mammedov , Prasad Pandit , qemu-devel@nongnu.org Cc: Xiaoling Song , Zhao Liu Subject: [PATCH v2 02/13] hw/core/machine-smp: Deprecate unsupported "parameter=1" SMP configurations Date: Sat, 9 Mar 2024 00:01:37 +0800 Message-Id: <20240308160148.3130837-3-zhao1.liu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240308160148.3130837-1-zhao1.liu@linux.intel.com> References: <20240308160148.3130837-1-zhao1.liu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=198.175.65.21; envelope-from=zhao1.liu@linux.intel.com; helo=mgamail.intel.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.572, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1709913090712100001 Content-Type: text/plain; charset="utf-8" From: Zhao Liu 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=3D1,books=3D1,clusters=3D1". 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 Reviewed-by: Thomas Huth --- docs/about/deprecated.rst | 14 +++++++++ hw/core/machine-smp.c | 63 +++++++++++++++++++++++++++++---------- 2 files changed, 61 insertions(+), 16 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 872974640252..9cc22523be49 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -47,6 +47,20 @@ as short-form boolean values, and passed to plugins as `= `arg_name=3Don``. However, short-form booleans are deprecated and full explicit ``arg_name= =3Don`` form is preferred. =20 +``-smp`` (Unsupported "parameter=3D1" 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=3D1,books=3D1,clusters=3D1 for x86 PC ma= chine) is +marked deprecated since 9.0, users have to ensure that all the topology me= mbers +described with -smp are supported by the target machine. + QEMU Machine Protocol (QMP) commands ------------------------------------ =20 diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index 96533886b14e..50a5a40dbc3d 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -112,30 +112,61 @@ void machine_parse_smp_config(MachineState *ms, =20 /* * 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 topolog= y"); - return; - } - if (!mc->smp_props.clusters_supported && clusters > 1) { - error_setg(errp, "clusters not supported by this machine's CPU top= ology"); - 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 =3D clusters > 0 ? clusters : 1; =20 + 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 =3D dies > 0 ? dies : 1; - clusters =3D clusters > 0 ? clusters : 1; =20 - if (!mc->smp_props.books_supported && books > 1) { - error_setg(errp, "books not supported by this machine's CPU topolo= gy"); - 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 =3D books > 0 ? books : 1; =20 - 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 =3D drawers > 0 ? drawers : 1; =20 --=20 2.34.1