From nobody Tue Nov 26 06:43:55 2024 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=1709718063; cv=none; d=zohomail.com; s=zohoarc; b=L9DseClCNP+P8I0BP7tr8Yq7rOgOeRydETIPeDDchGpS453vpfsMdgrlnWHfP7DXTppkgcCN+IHZ2dyGEvAUeWtrqz+0TYTGbUB9R3e2wyl6wGi4RWpjy5Ttd+xVPz14u7P17/gt5eU21w/Iq8q2PupB3bdMU+ierGTlfIl5E9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709718063; 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=llfN+CYLuOC7sGMTtmbCxfBDnfcQ4tKki4a2WwmwzcY=; b=YveR53/LDZQbJnYhXlwDlQrLlFlt5rOtWsbzC20xUSuAcME/qXmxTDbqhVG3w7G3gGkzsIyvVdcS39sVW9A4r2mZpe9JJ13PGZEXCNfIWzlpWexeG8+zVTs8jSierPoiRROb2WM/IVyOEdYvkDLylIEABVkY3VMrj25xNmwuhqY= 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 1709718063902266.700606982595; Wed, 6 Mar 2024 01:41:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhnlP-0007Ph-4K; Wed, 06 Mar 2024 04:40:39 -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 1rhnlN-0007PD-FZ for qemu-devel@nongnu.org; Wed, 06 Mar 2024 04:40:37 -0500 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhnlL-00020k-LV for qemu-devel@nongnu.org; Wed, 06 Mar 2024 04:40:37 -0500 Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 01:40:33 -0800 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by fmviesa002.fm.intel.com with ESMTP; 06 Mar 2024 01:40:30 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709718036; x=1741254036; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aeA2s9T7ZHBvx6ENH8YGd6wH3Oj/Qq+YESJhKmgsOC0=; b=M0z6+Zwp4M9LsnA985kbkwOqYqcq7lizTBCBOpzoBkRNS+YAXziITbEV r8Jmlve9AWQTufldn4LBOy2buGJB+dk2EodmaQJOB4N1xiQMd6zg0GEWC sBc705DRnjCTE7zxJGHt9J7oK0Y+R0SePhFn1APrmtj1Y2zTqmTN8rcbB W95QbLc1yMjtqSvseBGoO+mnsuOZGIKAChfukvnUNQmnF+22B+qHA2TSu 3LkWKURBBwCW9Ne89yOmHs07r5txJVf4FiBqU5TbxTXgcSSh1VB52ZsU8 rHkTkB5sRm7xVkX/c0uRQlGgn/7F4kCyF3680TC6Dkf8QxqjJD236UNjv A==; X-IronPort-AV: E=McAfee;i="6600,9927,11004"; a="14897814" X-IronPort-AV: E=Sophos;i="6.06,207,1705392000"; d="scan'208";a="14897814" X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,207,1705392000"; d="scan'208";a="32854129" 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 , devel@lists.libvirt.org Subject: [PATCH 02/14] hw/core/machine-smp: Deprecate unsupported "parameter=1" SMP configurations Date: Wed, 6 Mar 2024 17:53:55 +0800 Message-Id: <20240306095407.3058909-3-zhao1.liu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240306095407.3058909-1-zhao1.liu@linux.intel.com> References: <20240306095407.3058909-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.11; 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.568, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, 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: 1709718065335100001 Content-Type: text/plain; charset="utf-8" From: Zhao Liu Currentlt, 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 depresated 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. Cc: devel@lists.libvirt.org Signed-off-by: Zhao Liu --- 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..2e782e83e952 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`` (Unsopported "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 depresated 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