From nobody Tue Nov 18 16:07:24 2025 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1716962740; cv=none; d=zohomail.com; s=zohoarc; b=d1FXzpRwVtxRdCnJ8B+FzbiVe8hcOEWaJ/P6DCBQESxRVR6k2iYy+zAZGQEEJevJgYK3hwmQbVxE3nfxu0DIxu6jwzR9C8OwTSV7mW03FX3g4cP9xD9aFCv3SsMFKoY4nb6Hj3mxvAsrsSjUbXMQQ2c4rlhRL3lbIkO7mEgcrpo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716962740; 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=kgDi6MLNsr7qI6rIPk/laleUZWwZq+fO0JdWIi539M8=; b=IVAGOaNomOv2lsLLOADxjDuPVigH3aWLb8Wi5ovLM1R62ESkXPNcY+g6ExdHczkdQWCKrFeZEbs8yEslED9CEzwSENdykdHw7shXKD4OjGtqRwiaCUF0WD4Bc4Aw+uNyYJLwKUCYhQYFr2ficwmreLCCXUI1KoCrMZ+F8C86J1o= 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 1716962740181466.44634376081297; Tue, 28 May 2024 23:05:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCCQ2-0005Va-Mr; Wed, 29 May 2024 02:04:14 -0400 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 1sCCQ0-0005V1-GJ for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:12 -0400 Received: from mgamail.intel.com ([198.175.65.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCCPz-0002sy-05 for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:12 -0400 Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 23:04:08 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by orviesa003.jf.intel.com with ESMTP; 28 May 2024 23:04:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716962651; x=1748498651; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ngOdced1uceZL1uIE2kvQ+8BlkJIatVjqHcIP6gXYNE=; b=JSWWPsqJGdVkVYr/UkKJOfeMl6LsarqAz4GaoAcA2khKGKDpfinN/Jn+ DMu2till8QtFLrVMXipVU9TkrRFmdwlrCDsP1tacfeaF7uKH0zEDxKr1y LxOOKMJ/1/gZlEuDnK7HwI18LFLGLWn39xxhK1tY6bNFrNrUY92kt4Rrp Os1pkvKVoJEgjYdM19wPrTDhQwojGSj6CUGWhLgNhdAUfnWh6Qdcn2Q4o NYerRgHiz88J8NiOFcuBZAm7dtuG+c+OoKG3q8iPiLR45s8Q60C7wR3o5 JbnkASIDoxZiJcGS9gWH0EImOQd45y88rP0EoI/uSgl09WYFb0HYXS6ua A==; X-CSE-ConnectionGUID: Ip4lhL9gS5GaJgV7xhlOmw== X-CSE-MsgGUID: +woieLH3QrWMVDpYlMjecQ== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13187462" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="13187462" X-CSE-ConnectionGUID: E9/rqUG/SWiL18edXVkNvg== X-CSE-MsgGUID: yEyoO0hJS2em7SpPWuqExQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="40144679" From: Zhao Liu To: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Thomas Huth , qemu-devel@nongnu.org Cc: Yongwei Ma , Zhao Liu Subject: [PATCH 1/8] tests/unit/test-smp-parse: Fix comments of drawers and books case Date: Wed, 29 May 2024 14:19:18 +0800 Message-Id: <20240529061925.350323-2-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529061925.350323-1-zhao1.liu@intel.com> References: <20240529061925.350323-1-zhao1.liu@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: pass client-ip=198.175.65.20; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.034, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1716962741152100003 Content-Type: text/plain; charset="utf-8" Fix the comments to match the actual configurations. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Tested-by: Yongwei Ma --- tests/unit/test-smp-parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 9fdba24fce56..fa8e7d83a7b6 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -474,8 +474,8 @@ static const struct SMPTestData data_with_drawers_inval= id[] =3D { static const struct SMPTestData data_with_drawers_books_invalid[] =3D { { /* - * config: -smp 200,drawers=3D2,books=3D2,sockets=3D2,cores=3D4,\ - * threads=3D2,maxcpus=3D200 + * config: -smp 200,drawers=3D3,books=3D5,sockets=3D2,cores=3D4,\ + * threads=3D2,maxcpus=3D200 */ .config =3D SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 200, T, 3, T, 5, T, 2, T, 4, T, 2, T, 200), @@ -485,8 +485,8 @@ static const struct SMPTestData data_with_drawers_books= _invalid[] =3D { "cores (4) * threads (2) !=3D maxcpus (200)", }, { /* - * config: -smp 242,drawers=3D2,books=3D2,sockets=3D2,cores=3D4,\ - * threads=3D2,maxcpus=3D240 + * config: -smp 242,drawers=3D3,books=3D5,sockets=3D2,cores=3D4,\ + * threads=3D2,maxcpus=3D240 */ .config =3D SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 242, T, 3, T, 5, T, 2, T, 4, T, 2, T, 240), --=20 2.34.1 From nobody Tue Nov 18 16:07:24 2025 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1716962752; cv=none; d=zohomail.com; s=zohoarc; b=kRWw+lAtdDPaLmW4QWeIazlub0L+osAVJUxdkxgH70YTiKD8Jx/y5G5oqQon4JKKlu1z/g7OLxUsoZnJl/zWsc4CeFcQPyr00tUU90qF9V9q9EHKIg3ueUFjTtlxSjw6pQIUDgT3OJl8Mv/J5L5tceRh15zxrpfYfAnI1EDrc2k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716962752; 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=7rnloN5N56ENc/CX6DQWMy2S0CXjhWrUGO3GqwuZBzc=; b=fkl9tvyk1ylMxgSYEKMZ8radfn/udtZrQ7gasW7sjFtqNLkl7cn5/7tVPaPzQVaY1qwFyTpJ5ZjO+b90JzdmEitfwzEFgCDoHm0a8/LjDcTL1WNTnFwxI7ZTfiVLbkCSV3FLt4UuZ+QJ113CEpnT2ZfYveAiRaLbgpf1aPCmcck= 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 1716962752489528.4468250963307; Tue, 28 May 2024 23:05:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCCQ3-0005W7-9g; Wed, 29 May 2024 02:04:15 -0400 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 1sCCQ1-0005VR-Ne for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:13 -0400 Received: from mgamail.intel.com ([198.175.65.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCCPz-0002st-8J for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:13 -0400 Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 23:04:11 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by orviesa003.jf.intel.com with ESMTP; 28 May 2024 23:04:08 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716962652; x=1748498652; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rh2tN87Adt0+ICqb7vzJ4e9H8aV7j0n6tPKtAvVoIbI=; b=jRqBGcrNZMBT8yaT3U6tGe7aD2AiD774CmRygT4aGDlocINJ2FQ+V2lt sdYuNeXWHx4UqS2oulUxgsAbo+OPrnRsTjDycVHSbrP9D7ewbCRiRSi/B B9HbYAWLP3WJNzeHHJrctG1mHR1j+6wF1TgCHspoBtPLMG22MBfHTCnon Lrf0/AQHDVnWMYgZ1QC7hiq/bZLQltEDsDQBuMFmNOeGCzd3uPkyI8Xfv QPYepYEnQQ3s4vw9QqPhES+FTZbmJgwz5uTS/I70Cc5WDgWIF7Dwo+Psy 3z2D9FJzNVVWOrWw8Z9MPvafxz7L1DuqseLN7e+EyDCVdsT9Drf3bO1St w==; X-CSE-ConnectionGUID: 4ZDKwwuaS+uoOY/0NPI98A== X-CSE-MsgGUID: 5AaMuKIVSbmas7bVtEfYuQ== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13187471" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="13187471" X-CSE-ConnectionGUID: 3etaa0T8RvG+zm4oKceLdQ== X-CSE-MsgGUID: 2nwNpp5kQWmEA9g4Vjq06w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="40144695" From: Zhao Liu To: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Thomas Huth , qemu-devel@nongnu.org Cc: Yongwei Ma , Zhao Liu Subject: [PATCH 2/8] tests/unit/test-smp-parse: Fix comment of parameters=1 case Date: Wed, 29 May 2024 14:19:19 +0800 Message-Id: <20240529061925.350323-3-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529061925.350323-1-zhao1.liu@intel.com> References: <20240529061925.350323-1-zhao1.liu@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: pass client-ip=198.175.65.20; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.034, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1716962753216100003 Content-Type: text/plain; charset="utf-8" SMP_CONFIG_WITH_FULL_TOPO hasn't support module level, so the parameter should indicate the "clusters". Additionally, reorder the parameters of -smp to match the topology hierarchy order. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Tested-by: Yongwei Ma --- tests/unit/test-smp-parse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index fa8e7d83a7b6..c9cbc89c21b9 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -333,7 +333,9 @@ static const struct SMPTestData data_generic_valid[] = =3D { }, { /* * Unsupported parameters are always allowed to be set to '1' - * config: -smp 8,books=3D1,drawers=3D1,sockets=3D2,modules=3D1,di= es=3D1,cores=3D2,threads=3D2,maxcpus=3D8 + * config: + * -smp 8,drawers=3D1,books=3D1,sockets=3D2,dies=3D1,clusters=3D= 1,cores=3D2,\ + * threads=3D2,maxcpus=3D8 * expect: cpus=3D8,sockets=3D2,cores=3D2,threads=3D2,maxcpus=3D8 = */ .config =3D SMP_CONFIG_WITH_FULL_TOPO(8, 1, 1, 2, 1, 1, 2, 2, 8), .expect_prefer_sockets =3D CPU_TOPOLOGY_GENERIC(8, 2, 2, 2, 8), --=20 2.34.1 From nobody Tue Nov 18 16:07:24 2025 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1716962743; cv=none; d=zohomail.com; s=zohoarc; b=Dtx6ly2e9QrKvYCuHbDCNPHQu4j9jV5kpEdyutUyQSu9UfrMHX2GOS3KUrZmsIhal6+irjTSasaRrOb/wejgfslRYy1WaEUnXsuhL4eGVx/Xf7ULDf/M7DztB9RqmHq1Ej8N1Wnl8SL4sFtjxwEHgRRzeH7w61YzNkd1Bycctwg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716962743; 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=tTil7w7TYwRLdn01FSO5qCDIjh36lddy9MdukezNXh8=; b=YNGvPeGJoOcz5qu7C3uDOV8slAt0UU+pGAFMtkk33EznFaQan5mV5sJJebUhJJlfqDlb181mgELM1hWmbnrLO5U6ZYGEZnJFiKFGi/HGCY16M/8tRo+tfhJ4rJey7rCeoBT54QBDjpNPUSVRz40W1x5qKO0NfLEUgmzxo7hI8Zk= 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 1716962743897481.92825735766087; Tue, 28 May 2024 23:05:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCCQ5-0005We-Td; Wed, 29 May 2024 02:04:17 -0400 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 1sCCQ3-0005W9-E3 for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:15 -0400 Received: from mgamail.intel.com ([198.175.65.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCCQ1-0002tM-UT for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:15 -0400 Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 23:04:13 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by orviesa003.jf.intel.com with ESMTP; 28 May 2024 23:04:11 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716962654; x=1748498654; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RsdXYkRRI3rmURZbis55cmiquR+HjVYZWgtL+XP6yNo=; b=OnbJjY3R6FaRVc8o742OIr4/zXe8Icr+ojGvLq0mzOllAsk2We5y3tcj WA5JInqPUVMluyXgEDdS3q7Hd5pwAYixurODca2Y7NnHgFN3UjQpELcuN 0qrmHEpq2jAlhPAYdR06siwzE5IMwBNLBU26B9DtnwcPYpqtZf5M3l0a9 aW228M+RJlRRoKdg92sX/RT2JKSUBN6utY/eZH2iDlpW1R0J9SYX/mfwW 8EtW1rJgmNdjKFIfjvwcE8eOO1sjzSVm6foZhp2MqncCCUIUFZPIM+pjd f//ZzJh9vVBvVKUpN316AMyqeW5t/rn4R7Ev5jn6idqBBtIfNtJ0eRIOp w==; X-CSE-ConnectionGUID: UYTqTGcyThSWeXnLHei4OQ== X-CSE-MsgGUID: vcEFS4RMTGm9vFZx1XJrKg== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13187477" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="13187477" X-CSE-ConnectionGUID: JcT+zxvFRAq4CHZumOWong== X-CSE-MsgGUID: zK/fwobnRyCMKmWnShNNDQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="40144707" From: Zhao Liu To: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Thomas Huth , qemu-devel@nongnu.org Cc: Yongwei Ma , Zhao Liu Subject: [PATCH 3/8] tests/unit/test-smp-parse: Fix an invalid topology case Date: Wed, 29 May 2024 14:19:20 +0800 Message-Id: <20240529061925.350323-4-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529061925.350323-1-zhao1.liu@intel.com> References: <20240529061925.350323-1-zhao1.liu@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: pass client-ip=198.175.65.20; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.034, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1716962745208100003 Content-Type: text/plain; charset="utf-8" Adjust the "cpus" parameter to match the comment configuration. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Tested-by: Yongwei Ma --- tests/unit/test-smp-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index c9cbc89c21b9..5d99e0d9234c 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -528,7 +528,7 @@ static const struct SMPTestData data_full_topo_invalid[= ] =3D { * config: -smp 1,drawers=3D3,books=3D5,sockets=3D2,dies=3D4,\ * clusters=3D2,cores=3D7,threads=3D3,maxcpus=3D5040 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(3361, 3, 5, 2, 4, 2, 7, 3, 5= 040), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 3, 5, 2, 4, 2, 7, 3, 5040= ), .expect_error =3D "Invalid SMP CPUs 5040. The max CPUs supported " "by machine '" SMP_MACHINE_NAME "' is 4096", }, --=20 2.34.1 From nobody Tue Nov 18 16:07:24 2025 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1716962746; cv=none; d=zohomail.com; s=zohoarc; b=BVkbvXnWh3IMbF/8w3ShFRybyTBNS3mB4T1gA0W1T7QhDww60nxYx7tHxWLCDuTN/uZtSmhPWc4EsozzKkPlYZWKy/AR+54JkJw/wIQwHshXdJWF9cQE47ZT7LK/kFkPrEXvr3m3X9Yv79HbZjV8mWzMtNxVOvxu0TPl5I3z22I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716962746; 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=cBU284MfzLDXnU8lzT1u2nqg7tOfgpcfbNh75JExA2U=; b=EX7YnNzv4LhvzI/Uz9paREGStJCPtJN9F+uLZKYISt16wc0yAQrQPSzZK8oT/q/QGw4rNkF67t5VO3L6CwsogoVLbgbqSlwy0U5nuW7v+fk0aIwlv1mng8DIEI/lCTgMAYJZSsgDZ13ghv9j6aL93HbqZeurkf6c/h8/2TZ12Bk= 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 1716962746560712.0800950444158; Tue, 28 May 2024 23:05:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCCQ7-0005XH-Bz; Wed, 29 May 2024 02:04:19 -0400 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 1sCCQ6-0005Wt-Bj for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:18 -0400 Received: from mgamail.intel.com ([198.175.65.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCCQ4-0002te-Mf for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:18 -0400 Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 23:04:16 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by orviesa003.jf.intel.com with ESMTP; 28 May 2024 23:04:13 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716962657; x=1748498657; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1fiX4Z8+nFmItgDfCemdyuD7iTt8rkgiZ1jp71LLNzs=; b=BAN2PREgdx64jyNhk8m1UAKTDP5M6njmjRUUZ28572cJ5YcOsUnhe8J9 TbQVdpsANqq3Fou6a7ITn3KyNo81he8aWewbhxdV7GXaI0E2LMHE9Vm+c id3s/CZy5I3mDK187rMEOV3DOpEzES8oaCwJyvmdXo9CX0FsMram8DT/Z aplbCQGdVhyLm1bflwFWWE3gOheMWCLDDWj9+tf0zBRCdER6iSh5/rlKF PeKOLuQiPKECP+hbHh3GbEP8/MKGx4j91ONJk1KqZoyngPPAqww/iiP85 xnwZBuVRXEeqTJ83tx1rDYGPd7RBb9cinAUDZKl8IYW+sZo6Fdr7RCSft A==; X-CSE-ConnectionGUID: IYkLDzD1Th+Jw9Hb1lqmyQ== X-CSE-MsgGUID: C6WcqmulSGK5Lpa2Nz3nAw== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13187486" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="13187486" X-CSE-ConnectionGUID: z7JNqKDORSaQx9kjO+i7RQ== X-CSE-MsgGUID: 7ZTrkwWwQQmRzZTIrNwQKA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="40144722" From: Zhao Liu To: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Thomas Huth , qemu-devel@nongnu.org Cc: Yongwei Ma , Zhao Liu Subject: [PATCH 4/8] tests/unit/test-smp-parse: Use default parameters=0 when not set in -smp Date: Wed, 29 May 2024 14:19:21 +0800 Message-Id: <20240529061925.350323-5-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529061925.350323-1-zhao1.liu@intel.com> References: <20240529061925.350323-1-zhao1.liu@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: pass client-ip=198.175.65.20; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.034, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1716962747218100007 Content-Type: text/plain; charset="utf-8" Since -smp allows parameters=3D1 whether the level is supported by machine, to avoid the test scenarios where the parameter defaults to 1 cause some errors to be masked, explicitly set undesired parameters to 0. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Tested-by: Yongwei Ma --- tests/unit/test-smp-parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 5d99e0d9234c..e3a0a9d12d05 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -436,7 +436,7 @@ static const struct SMPTestData data_with_clusters_inva= lid[] =3D { static const struct SMPTestData data_with_books_invalid[] =3D { { /* config: -smp 16,books=3D2,sockets=3D2,cores=3D4,threads=3D2,max= cpus=3D16 */ - .config =3D SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 16, F, 1, T, 2, T, + .config =3D SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 16, F, 0, T, 2, T, 2, T, 4, T, 2, T, 16), .expect_error =3D "Invalid CPU topology: " "product of the hierarchy must match maxcpus: " @@ -444,7 +444,7 @@ static const struct SMPTestData data_with_books_invalid= [] =3D { "!=3D maxcpus (16)", }, { /* config: -smp 34,books=3D2,sockets=3D2,cores=3D4,threads=3D2,max= cpus=3D32 */ - .config =3D SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 34, F, 1, T, 2, T, + .config =3D SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 34, F, 0, T, 2, T, 2, T, 4, T, 2, T, 32), .expect_error =3D "Invalid CPU topology: " "maxcpus must be equal to or greater than smp: " @@ -456,7 +456,7 @@ static const struct SMPTestData data_with_books_invalid= [] =3D { static const struct SMPTestData data_with_drawers_invalid[] =3D { { /* config: -smp 16,drawers=3D2,sockets=3D2,cores=3D4,threads=3D2,m= axcpus=3D16 */ - .config =3D SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 16, T, 2, F, 1, T, + .config =3D SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 16, T, 2, F, 0, T, 2, T, 4, T, 2, T, 16), .expect_error =3D "Invalid CPU topology: " "product of the hierarchy must match maxcpus: " @@ -464,7 +464,7 @@ static const struct SMPTestData data_with_drawers_inval= id[] =3D { "!=3D maxcpus (16)", }, { /* config: -smp 34,drawers=3D2,sockets=3D2,cores=3D4,threads=3D2,m= axcpus=3D32 */ - .config =3D SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 34, T, 2, F, 1, T, + .config =3D SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 34, T, 2, F, 0, T, 2, T, 4, T, 2, T, 32), .expect_error =3D "Invalid CPU topology: " "maxcpus must be equal to or greater than smp: " --=20 2.34.1 From nobody Tue Nov 18 16:07:24 2025 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1716962681; cv=none; d=zohomail.com; s=zohoarc; b=jVM0Q6KMGKT2lQuNZlCKntMrrVKc5GSo3CrV172UauGlqcugUs6CAvSadEyf5CvcF4DescZ0qK9mhgQclaabyAnG2N2r0pyNU82AK0F48HSfHddPzz3i49YlJKsHbXvE23ZRvz8A2d7g1pEfmfK/7blZP01Zi3hZE+DPxX3iPJg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716962681; 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=dDDvws0WTMw6iwsdaoY+izbJYjIQAWy/9HDEbkvec6E=; b=RgNHgv//7D6NzvMalhVmlzyuiLknU8k7OQa9tPmXG4sGMw6+oXyWqs+vJLrI3D625k/Kt6yxPe0H+ysI1/UlPHnMr0x+UO/0pCSgRNoQyE9zbTd4qVr+FItzwCQVZWoFzPdCLdp46dh9WgnCSER5rk+0kDft6qTJD6FcTCBkdDk= 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 1716962681080414.31462312953784; Tue, 28 May 2024 23:04:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCCQ9-0005Z6-Bf; Wed, 29 May 2024 02:04:21 -0400 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 1sCCQ8-0005Yu-Hv for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:20 -0400 Received: from mgamail.intel.com ([198.175.65.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCCQ6-0002te-SF for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:20 -0400 Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 23:04:18 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by orviesa003.jf.intel.com with ESMTP; 28 May 2024 23:04:15 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716962659; x=1748498659; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sKnaB96zUT2GRUKPpBosCjG9gjJ7DP45HVk50XGB9gc=; b=FB4lhdDCCoNS+Dp16TGYn/g7D0+/quBJRmTF0eiTY33Ne0sWzhOdYKJC HghnRuRuVXfogXJDR4r/n9ahj5r8UXk4k6mQXQfQ7tQxC8rn0siCoxW40 W7DGClRieM1OC5QBi/jGBCeYgGdS9Sdlre6u7YDpAowL/G/eUvnH0Il+M NlLtfLYJB2I/eD97UvXZXvaDWI30MC0UiKrvDF+l564lZGeZc3SFRd//g xdEdCHAjKzdvzb34CYLoQwiEP4x36QsB7fdBnEBYxD4tei5ik/kaCGPtk 78dFOfWTfSaXlxl2ZZI+2F3rlaFI4k0EFqJa1Hc1MQUjHLQsof6IYu6Rz Q==; X-CSE-ConnectionGUID: 2sNcvyczTgGtezkeagRWQw== X-CSE-MsgGUID: bU41UlJRTfO2MHC4tHPIdw== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13187493" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="13187493" X-CSE-ConnectionGUID: wBni+W+cSOeAz0j9URQCEQ== X-CSE-MsgGUID: DdTmXGP5SweZCK5maPmhHw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="40144739" From: Zhao Liu To: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Thomas Huth , qemu-devel@nongnu.org Cc: Yongwei Ma , Zhao Liu Subject: [PATCH 5/8] tests/unit/test-smp-parse: Make test cases aware of module level Date: Wed, 29 May 2024 14:19:22 +0800 Message-Id: <20240529061925.350323-6-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529061925.350323-1-zhao1.liu@intel.com> References: <20240529061925.350323-1-zhao1.liu@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: pass client-ip=198.175.65.20; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.034, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1716962682947100001 Content-Type: text/plain; charset="utf-8" Currently, -smp supports module level. It is necessary to consider the effects of module in the test cases to ensure that the calculations are correct. This is also the preparation to add module test cases. Signed-off-by: Zhao Liu Tested-by: Yongwei Ma --- tests/unit/test-smp-parse.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index e3a0a9d12d05..2214e47ba9c0 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -629,6 +629,7 @@ static char *smp_config_to_string(const SMPConfiguratio= n *config) " .has_sockets =3D %5s, sockets =3D %" PRId64 ",\n" " .has_dies =3D %5s, dies =3D %" PRId64 ",\n" " .has_clusters =3D %5s, clusters =3D %" PRId64 ",\n" + " .has_modules =3D %5s, modules =3D %" PRId64 ",\n" " .has_cores =3D %5s, cores =3D %" PRId64 ",\n" " .has_threads =3D %5s, threads =3D %" PRId64 ",\n" " .has_maxcpus =3D %5s, maxcpus =3D %" PRId64 ",\n" @@ -639,6 +640,7 @@ static char *smp_config_to_string(const SMPConfiguratio= n *config) config->has_sockets ? "true" : "false", config->sockets, config->has_dies ? "true" : "false", config->dies, config->has_clusters ? "true" : "false", config->clusters, + config->has_modules ? "true" : "false", config->modules, config->has_cores ? "true" : "false", config->cores, config->has_threads ? "true" : "false", config->threads, config->has_maxcpus ? "true" : "false", config->maxcpus); @@ -679,6 +681,7 @@ static char *cpu_topology_to_string(const CpuTopology *= topo, " .sockets =3D %u,\n" " .dies =3D %u,\n" " .clusters =3D %u,\n" + " .modules =3D %u,\n" " .cores =3D %u,\n" " .threads =3D %u,\n" " .max_cpus =3D %u,\n" @@ -688,8 +691,8 @@ static char *cpu_topology_to_string(const CpuTopology *= topo, "}", topo->cpus, topo->drawers, topo->books, topo->sockets, topo->dies, topo->clusters, - topo->cores, topo->threads, topo->max_cpus, - threads_per_socket, cores_per_socket, + topo->modules, topo->cores, topo->threads, + topo->max_cpus, threads_per_socket, cores_per_socket, has_clusters ? "true" : "false"); } =20 @@ -732,6 +735,7 @@ static void check_parse(MachineState *ms, const SMPConf= iguration *config, (ms->smp.sockets =3D=3D expect_topo->sockets) && (ms->smp.dies =3D=3D expect_topo->dies) && (ms->smp.clusters =3D=3D expect_topo->clusters) && + (ms->smp.modules =3D=3D expect_topo->modules) && (ms->smp.cores =3D=3D expect_topo->cores) && (ms->smp.threads =3D=3D expect_topo->threads) && (ms->smp.max_cpus =3D=3D expect_topo->max_cpus) && @@ -812,6 +816,11 @@ static void smp_parse_test(MachineState *ms, SMPTestDa= ta *data, bool is_valid) /* The parsed results of the unsupported parameters should be 1 */ static void unsupported_params_init(const MachineClass *mc, SMPTestData *d= ata) { + if (!mc->smp_props.modules_supported) { + data->expect_prefer_sockets.modules =3D 1; + data->expect_prefer_cores.modules =3D 1; + } + if (!mc->smp_props.dies_supported) { data->expect_prefer_sockets.dies =3D 1; data->expect_prefer_cores.dies =3D 1; --=20 2.34.1 From nobody Tue Nov 18 16:07:24 2025 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1716962724; cv=none; d=zohomail.com; s=zohoarc; b=nLf+ELjRDlhfzosy+qkH5ISVA43BuF9s58Re5jnlYVwjGr5na66YoFC217rKvpQrZWUG2x2iscUALvirhz1dl42KTtk92gY2hztF4sFBqPocnM+QtSW8sD2DQVRcZctv/NZiWDZJUF5SoalM7pbbHj9B39v27tb7Fv6x9GFP6C4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716962724; 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=E32euuXbjNm5MEmzx0uXpUf8RyinbLO0JpiKBA6EgGk=; b=I/Og5ELe6205s+mw88T/ryG7KvWcz+DfiTzNczuHGBWjbtxy4TSTyIEr7nrdbJWBZrSGY6df+7O5xyMDtEXCaC+nJQhKmdmijRJdSVCUhg5nd4VXiOBMprhK6pAWLeDy73vDLNq8ZpuyEH041ZUkX4RG7MVM+Mb2OVZEXLpb1cs= 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 1716962724382324.9191491607477; Tue, 28 May 2024 23:05:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCCQB-0005Zd-FC; Wed, 29 May 2024 02:04:23 -0400 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 1sCCQA-0005ZS-Lv for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:22 -0400 Received: from mgamail.intel.com ([198.175.65.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCCQ8-0002tk-OU for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:22 -0400 Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 23:04:20 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by orviesa003.jf.intel.com with ESMTP; 28 May 2024 23:04:18 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716962661; x=1748498661; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RFSrIIphD9gfWDiAZ48qCDzXHovswwaxl9K4x9p8XKs=; b=muGaeLtU1Pgx4kM6S7cVh7G7Bud1QntEQEbi3kQIYWgmcQQQEMWN2dLX BUhhIPHqgkHbjrIL0GScA1n/YS5zaOH4TamxkkUXDPxSOf3qYv8Qo8JxD FDNahK+WKLYLD1VQ99YBYdzRHwmYzKpCqzSbQogAoMQMJYDYuro6fb4gC XdyPsOxDF7LdMO5JnxlQJjUlZ/bFxqQrNsJeZRc7Ti0TFdEShZf+t0h2j /SDaLt8qRVkd46vaFd9RUGPNpTTmvm0SQAB+9Kk0etupvlWMd4W04dOD3 j0v3omOzzYNLfqL5J30ZR4jqLMxtTdqXGnP7AglKNtcNHR6p5DOsfhJNZ A==; X-CSE-ConnectionGUID: mSyTAIewQgKtyVQ80FyvnQ== X-CSE-MsgGUID: Ll80nNUQTDqyJ+Hvqg0Ejg== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13187501" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="13187501" X-CSE-ConnectionGUID: zbA52bhITPOu4aptMjHG0w== X-CSE-MsgGUID: v76N4ltZRJ6tfe71P5sUUg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="40144756" From: Zhao Liu To: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Thomas Huth , qemu-devel@nongnu.org Cc: Yongwei Ma , Zhao Liu Subject: [PATCH 6/8] tests/unit/test-smp-parse: Test "modules" parameter in -smp Date: Wed, 29 May 2024 14:19:23 +0800 Message-Id: <20240529061925.350323-7-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529061925.350323-1-zhao1.liu@intel.com> References: <20240529061925.350323-1-zhao1.liu@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: pass client-ip=198.175.65.20; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.034, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1716962725141100007 Content-Type: text/plain; charset="utf-8" Cover the module cases in test-smp-parse. Signed-off-by: Zhao Liu Tested-by: Yongwei Ma --- tests/unit/test-smp-parse.c | 112 +++++++++++++++++++++++++++++++++--- 1 file changed, 103 insertions(+), 9 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 2214e47ba9c0..01832e5eda32 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -48,17 +48,19 @@ } =20 /* - * Currently a 4-level topology hierarchy is supported on PC machines - * -sockets/dies/cores/threads + * Currently a 5-level topology hierarchy is supported on PC machines + * -sockets/dies/modules/cores/threads */ -#define SMP_CONFIG_WITH_DIES(ha, a, hb, b, hc, c, hd, d, he, e, hf, f) \ +#define SMP_CONFIG_WITH_MODS_DIES(ha, a, hb, b, hc, c, hd, d, \ + he, e, hf, f, hg, g) \ { \ .has_cpus =3D ha, .cpus =3D a, \ .has_sockets =3D hb, .sockets =3D b, \ .has_dies =3D hc, .dies =3D c, \ - .has_cores =3D hd, .cores =3D d, \ - .has_threads =3D he, .threads =3D e, \ - .has_maxcpus =3D hf, .maxcpus =3D f, \ + .has_modules =3D hd, .modules =3D d, \ + .has_cores =3D he, .cores =3D e, \ + .has_threads =3D hf, .threads =3D f, \ + .has_maxcpus =3D hg, .maxcpus =3D g, \ } =20 /* @@ -345,8 +347,14 @@ static const struct SMPTestData data_generic_valid[] = =3D { =20 static const struct SMPTestData data_generic_invalid[] =3D { { + /* config: -smp 2,modules=3D2 */ + .config =3D SMP_CONFIG_WITH_MODS_DIES(T, 2, F, 0, F, 0, T, 2, + F, 0, F, 0, F, 0), + .expect_error =3D "modules > 1 not supported by this machine's CPU= topology", + }, { /* config: -smp 2,dies=3D2 */ - .config =3D SMP_CONFIG_WITH_DIES(T, 2, F, 0, T, 2, F, 0, F, 0, F, = 0), + .config =3D SMP_CONFIG_WITH_MODS_DIES(T, 2, F, 0, T, 2, F, 0, + F, 0, F, 0, F, 0), .expect_error =3D "dies > 1 not supported by this machine's CPU to= pology", }, { /* config: -smp 2,clusters=3D2 */ @@ -397,17 +405,39 @@ static const struct SMPTestData data_generic_invalid[= ] =3D { }, }; =20 +static const struct SMPTestData data_with_modules_invalid[] =3D { + { + /* config: -smp 16,sockets=3D2,modules=3D2,cores=3D4,threads=3D2,m= axcpus=3D16 */ + .config =3D SMP_CONFIG_WITH_MODS_DIES(T, 16, T, 2, F, 0, T, 2, + T, 4, T, 2, T, 16), + .expect_error =3D "Invalid CPU topology: " + "product of the hierarchy must match maxcpus: " + "sockets (2) * modules (2) * cores (4) * threads (= 2) " + "!=3D maxcpus (16)", + }, { + /* config: -smp 34,sockets=3D2,modules=3D2,cores=3D4,threads=3D2,m= axcpus=3D32 */ + .config =3D SMP_CONFIG_WITH_MODS_DIES(T, 34, T, 2, F, 0, T, 2, + T, 4, T, 2, T, 32), + .expect_error =3D "Invalid CPU topology: " + "maxcpus must be equal to or greater than smp: " + "sockets (2) * modules (2) * cores (4) * threads (= 2) " + "=3D=3D maxcpus (32) < smp_cpus (34)", + }, +}; + static const struct SMPTestData data_with_dies_invalid[] =3D { { /* config: -smp 16,sockets=3D2,dies=3D2,cores=3D4,threads=3D2,maxc= pus=3D16 */ - .config =3D SMP_CONFIG_WITH_DIES(T, 16, T, 2, T, 2, T, 4, T, 2, T,= 16), + .config =3D SMP_CONFIG_WITH_MODS_DIES(T, 16, T, 2, T, 2, F, 0, + T, 4, T, 2, T, 16), .expect_error =3D "Invalid CPU topology: " "product of the hierarchy must match maxcpus: " "sockets (2) * dies (2) * cores (4) * threads (2) " "!=3D maxcpus (16)", }, { /* config: -smp 34,sockets=3D2,dies=3D2,cores=3D4,threads=3D2,maxc= pus=3D32 */ - .config =3D SMP_CONFIG_WITH_DIES(T, 34, T, 2, T, 2, T, 4, T, 2, T,= 32), + .config =3D SMP_CONFIG_WITH_MODS_DIES(T, 34, T, 2, T, 2, F, 0, + T, 4, T, 2, T, 32), .expect_error =3D "Invalid CPU topology: " "maxcpus must be equal to or greater than smp: " "sockets (2) * dies (2) * cores (4) * threads (2) " @@ -861,6 +891,13 @@ static void machine_generic_invalid_class_init(ObjectC= lass *oc, void *data) mc->max_cpus =3D MAX_CPUS - 1; } =20 +static void machine_with_modules_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + + mc->smp_props.modules_supported =3D true; +} + static void machine_with_dies_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -945,6 +982,56 @@ static void test_generic_invalid(const void *opaque) object_unref(obj); } =20 +static void test_with_modules(const void *opaque) +{ + const char *machine_type =3D opaque; + Object *obj =3D object_new(machine_type); + MachineState *ms =3D MACHINE(obj); + MachineClass *mc =3D MACHINE_GET_CLASS(obj); + SMPTestData data =3D {}; + unsigned int num_modules =3D 2; + int i; + + for (i =3D 0; i < ARRAY_SIZE(data_generic_valid); i++) { + data =3D data_generic_valid[i]; + unsupported_params_init(mc, &data); + + /* when modules parameter is omitted, it will be set as 1 */ + data.expect_prefer_sockets.modules =3D 1; + data.expect_prefer_cores.modules =3D 1; + + smp_parse_test(ms, &data, true); + + /* when modules parameter is specified */ + data.config.has_modules =3D true; + data.config.modules =3D num_modules; + if (data.config.has_cpus) { + data.config.cpus *=3D num_modules; + } + if (data.config.has_maxcpus) { + data.config.maxcpus *=3D num_modules; + } + + data.expect_prefer_sockets.modules =3D num_modules; + data.expect_prefer_sockets.cpus *=3D num_modules; + data.expect_prefer_sockets.max_cpus *=3D num_modules; + data.expect_prefer_cores.modules =3D num_modules; + data.expect_prefer_cores.cpus *=3D num_modules; + data.expect_prefer_cores.max_cpus *=3D num_modules; + + smp_parse_test(ms, &data, true); + } + + for (i =3D 0; i < ARRAY_SIZE(data_with_modules_invalid); i++) { + data =3D data_with_modules_invalid[i]; + unsupported_params_init(mc, &data); + + smp_parse_test(ms, &data, false); + } + + object_unref(obj); +} + static void test_with_dies(const void *opaque) { const char *machine_type =3D opaque; @@ -1303,6 +1390,10 @@ static const TypeInfo smp_machine_types[] =3D { .name =3D MACHINE_TYPE_NAME("smp-generic-invalid"), .parent =3D TYPE_MACHINE, .class_init =3D machine_generic_invalid_class_init, + }, { + .name =3D MACHINE_TYPE_NAME("smp-with-modules"), + .parent =3D TYPE_MACHINE, + .class_init =3D machine_with_modules_class_init, }, { .name =3D MACHINE_TYPE_NAME("smp-with-dies"), .parent =3D TYPE_MACHINE, @@ -1344,6 +1435,9 @@ int main(int argc, char *argv[]) g_test_add_data_func("/test-smp-parse/generic/invalid", MACHINE_TYPE_NAME("smp-generic-invalid"), test_generic_invalid); + g_test_add_data_func("/test-smp-parse/with_modules", + MACHINE_TYPE_NAME("smp-with-modules"), + test_with_modules); g_test_add_data_func("/test-smp-parse/with_dies", MACHINE_TYPE_NAME("smp-with-dies"), test_with_dies); --=20 2.34.1 From nobody Tue Nov 18 16:07:24 2025 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1716962725; cv=none; d=zohomail.com; s=zohoarc; b=DLD+lWfRxgHgNgnb8L8Q7Kwq2ScfD1n6M+JS6OTK37pEpCtYLTUDbj3w4e4O3bWjM5mPVjOKsDQiCgGe9K7bm0bE+cQnaKmJztKW1APMjUOciTjlGcbi2sbwgXjzsVWTrfTQ909nNYTjyMBJAu4qT3nlMbkKDZisBrvz/k6dClE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716962725; 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=60dLB9my6VNRGmfrfaq6+gaJSdplOkuN7agN/jXvCmQ=; b=XC4jYR1BTv9a8QsmXhQupK26vn5hhY1XTzsISY4b27/D2Mru0iEmdDwYvGmQ2zvvGiljUzn5hP69C7TTCJLEgOXavNK2eExgQIMtCwcHBOXl30hZdaT93brqEuEzpmOFEx2ShpKj0qrYEjkrBtCj/b/9prjgifpyiUT6nYSXIgk= 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 1716962725969318.78596613044306; Tue, 28 May 2024 23:05:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCCQF-0005aY-39; Wed, 29 May 2024 02:04:27 -0400 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 1sCCQD-0005aK-S2 for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:25 -0400 Received: from mgamail.intel.com ([198.175.65.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCCQC-0002vg-2D for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:25 -0400 Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 23:04:23 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by orviesa003.jf.intel.com with ESMTP; 28 May 2024 23:04:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716962664; x=1748498664; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1tROmMxTH8Fj6lqefijwEFqOzoduSv9Zi31JvU5h8iI=; b=aXLvbRABnN9TNBIBN7lvwX8+0KPorbDJ4piq4aQH7MIrVY2NhBY+q8oq TCs9/HHbJIVa4WbYPwvEthQ/4vCaFOZbzQj3rMspCYt2Mb8Jy0Gd+qeJh 0LxMZPjldZwkhaank6Ca/iJvup9lm5CFJjEcXDgVEzwoMG9CNUkO6Z0Lg ARVDYlFqds3IgGdqddaOpbzDAeJYfKSoc+c9ERN/vQrhPPCq4g/lvXmhz 764gvcWeGcwYH65sLmq+FL5PCiepGg/7HEuzVKf24IH5hgg4D0IXB4csV MSLlErgnCYyJhEXGgj95jr03pskksj/+bKg52UvOXKGjhqw9DpX9ASRND g==; X-CSE-ConnectionGUID: U57plTq0R+6RaMssAWveEQ== X-CSE-MsgGUID: WIddqH/HTdaO6YxuEmhEtA== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13187507" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="13187507" X-CSE-ConnectionGUID: KS823CJJTy6ntd77w0bpWw== X-CSE-MsgGUID: BIQ9OmQLRDiyCMqPr1WXUg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="40144765" From: Zhao Liu To: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Thomas Huth , qemu-devel@nongnu.org Cc: Yongwei Ma , Zhao Liu Subject: [PATCH 7/8] tests/unit/test-smp-parse: Test "modules" and "dies" combination case Date: Wed, 29 May 2024 14:19:24 +0800 Message-Id: <20240529061925.350323-8-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529061925.350323-1-zhao1.liu@intel.com> References: <20240529061925.350323-1-zhao1.liu@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: pass client-ip=198.175.65.20; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.034, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1716962727184100011 Content-Type: text/plain; charset="utf-8" Since i386 PC machine supports both "modules" and "dies" in -smp, add the "modules" and "dies" combination test case to match the actual topology usage scenario. Signed-off-by: Zhao Liu Tested-by: Yongwei Ma --- tests/unit/test-smp-parse.c | 103 ++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 01832e5eda32..2ca8530e935e 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -445,6 +445,33 @@ static const struct SMPTestData data_with_dies_invalid= [] =3D { }, }; =20 +static const struct SMPTestData data_with_modules_dies_invalid[] =3D { + { + /* + * config: -smp 200,sockets=3D3,dies=3D5,modules=3D2,cores=3D4,\ + * threads=3D2,maxcpus=3D200 + */ + .config =3D SMP_CONFIG_WITH_MODS_DIES(T, 200, T, 3, T, 5, T, + 2, T, 4, T, 2, T, 200), + .expect_error =3D "Invalid CPU topology: " + "product of the hierarchy must match maxcpus: " + "sockets (3) * dies (5) * modules (2) * " + "cores (4) * threads (2) !=3D maxcpus (200)", + }, { + /* + * config: -smp 242,sockets=3D3,dies=3D5,modules=3D2,cores=3D4,\ + * threads=3D2,maxcpus=3D240 + */ + .config =3D SMP_CONFIG_WITH_MODS_DIES(T, 242, T, 3, T, 5, T, + 2, T, 4, T, 2, T, 240), + .expect_error =3D "Invalid CPU topology: " + "maxcpus must be equal to or greater than smp: " + "sockets (3) * dies (5) * modules (2) * " + "cores (4) * threads (2) " + "=3D=3D maxcpus (240) < smp_cpus (242)", + }, +}; + static const struct SMPTestData data_with_clusters_invalid[] =3D { { /* config: -smp 16,sockets=3D2,clusters=3D2,cores=3D4,threads=3D2,= maxcpus=3D16 */ @@ -905,6 +932,14 @@ static void machine_with_dies_class_init(ObjectClass *= oc, void *data) mc->smp_props.dies_supported =3D true; } =20 +static void machine_with_modules_dies_class_init(ObjectClass *oc, void *da= ta) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + + mc->smp_props.modules_supported =3D true; + mc->smp_props.dies_supported =3D true; +} + static void machine_with_clusters_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -1082,6 +1117,67 @@ static void test_with_dies(const void *opaque) object_unref(obj); } =20 +static void test_with_modules_dies(const void *opaque) +{ + const char *machine_type =3D opaque; + Object *obj =3D object_new(machine_type); + MachineState *ms =3D MACHINE(obj); + MachineClass *mc =3D MACHINE_GET_CLASS(obj); + SMPTestData data =3D {}; + unsigned int num_modules =3D 5, num_dies =3D 3; + int i; + + for (i =3D 0; i < ARRAY_SIZE(data_generic_valid); i++) { + data =3D data_generic_valid[i]; + unsupported_params_init(mc, &data); + + /* + * when modules and dies parameters are omitted, they will + * be both set as 1. + */ + data.expect_prefer_sockets.modules =3D 1; + data.expect_prefer_sockets.dies =3D 1; + data.expect_prefer_cores.modules =3D 1; + data.expect_prefer_cores.dies =3D 1; + + smp_parse_test(ms, &data, true); + + /* when modules and dies parameters are both specified */ + data.config.has_modules =3D true; + data.config.modules =3D num_modules; + data.config.has_dies =3D true; + data.config.dies =3D num_dies; + + if (data.config.has_cpus) { + data.config.cpus *=3D num_modules * num_dies; + } + if (data.config.has_maxcpus) { + data.config.maxcpus *=3D num_modules * num_dies; + } + + data.expect_prefer_sockets.modules =3D num_modules; + data.expect_prefer_sockets.dies =3D num_dies; + data.expect_prefer_sockets.cpus *=3D num_modules * num_dies; + data.expect_prefer_sockets.max_cpus *=3D num_modules * num_dies; + + data.expect_prefer_cores.modules =3D num_modules; + data.expect_prefer_cores.dies =3D num_dies; + data.expect_prefer_cores.cpus *=3D num_modules * num_dies; + data.expect_prefer_cores.max_cpus *=3D num_modules * num_dies; + + smp_parse_test(ms, &data, true); + } + + for (i =3D 0; i < ARRAY_SIZE(data_with_modules_dies_invalid); i++) { + data =3D data_with_modules_dies_invalid[i]; + unsupported_params_init(mc, &data); + + smp_parse_test(ms, &data, false); + } + + object_unref(obj); +} + static void test_with_clusters(const void *opaque) { const char *machine_type =3D opaque; @@ -1398,6 +1494,10 @@ static const TypeInfo smp_machine_types[] =3D { .name =3D MACHINE_TYPE_NAME("smp-with-dies"), .parent =3D TYPE_MACHINE, .class_init =3D machine_with_dies_class_init, + }, { + .name =3D MACHINE_TYPE_NAME("smp-with-modules-dies"), + .parent =3D TYPE_MACHINE, + .class_init =3D machine_with_modules_dies_class_init, }, { .name =3D MACHINE_TYPE_NAME("smp-with-clusters"), .parent =3D TYPE_MACHINE, @@ -1441,6 +1541,9 @@ int main(int argc, char *argv[]) g_test_add_data_func("/test-smp-parse/with_dies", MACHINE_TYPE_NAME("smp-with-dies"), test_with_dies); + g_test_add_data_func("/test-smp-parse/with_modules_dies", + MACHINE_TYPE_NAME("smp-with-modules-dies"), + test_with_modules_dies); g_test_add_data_func("/test-smp-parse/with_clusters", MACHINE_TYPE_NAME("smp-with-clusters"), test_with_clusters); --=20 2.34.1 From nobody Tue Nov 18 16:07:24 2025 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1716962699; cv=none; d=zohomail.com; s=zohoarc; b=H6Tw0MSvOQtTzaoPFdeGzb2Hs8MGNQgIli1M4kGJytHChaNWpsUZA5SdfTI7F/isx93x/Ja1enc+wp9JDWU1xvuWfs+DJoaWDcpt2d+MnVKXHJLCoQzALyQq4FIfPfHowziNtH6KaEoRr2vyIWwsnJ/e/IZ1ncW+xAP7SWrqEy4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716962699; 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=0qLOP/+vJo8XiFrzoYo53TdwOHvFVGu5BmN3l+tP1Kc=; b=NZ7jgZoLy9eSDPRMzdB3M4PiYYDrDPZX1bsVGnRdbe047LLv9pCTH8PBb4eQI2DZLctAgx8xqIa4Or5Ym2mkMOzftydkD8RGm4Ki5mpqkkBIodKZ6qVUbBfEe8FGs+G6VyLCA7C2pv5R6sDigJnOTfGmr7nP5N1BcMq8GoN4ljY= 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 1716962698997659.424198825408; Tue, 28 May 2024 23:04:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCCQJ-0005f0-MH; Wed, 29 May 2024 02:04:31 -0400 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 1sCCQH-0005aq-HX for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:29 -0400 Received: from mgamail.intel.com ([198.175.65.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCCQF-0002vg-9j for qemu-devel@nongnu.org; Wed, 29 May 2024 02:04:29 -0400 Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 23:04:26 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by orviesa003.jf.intel.com with ESMTP; 28 May 2024 23:04:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716962668; x=1748498668; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2vBh3IfNwbawhYc++Jw/OuUr0v/+Zup3/Ru69BmBxJY=; b=XZ612HnBIcRDa48BrnWCHW5YWy5WvgYx7POn5/hsrUk4KNibJnoirkwD /RimfPc/YHuW35nLq8NW9W1jSgGzpgBbJzzecP6tJ3jrFhteCtgsaBKke U1HsZCMtdObxXw8qAjh3aCrej5ya7b4ijEAL8mlFpmgyET4yKA9jBUMol l9lQBdcmcKT+YR7md0V/3QCWE3gTCQWSOVRzEFho/ltWPc8oi5RgGIgX5 BnidGJjuBfBQ/U/xQm9mMW5VNNOdWgLnv3HKscRCnVXppyq6mmYQPm9Dg e/fTbF6pet2QOSfEMiie3TCXPZfOvJMp81ZZWe/o+jRYq8ffrPky77qL/ Q==; X-CSE-ConnectionGUID: jvjBDkJ1Q/e8izCNuLFzJQ== X-CSE-MsgGUID: RlKZhJAyTnWrOs4mHf+F0w== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13187514" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="13187514" X-CSE-ConnectionGUID: PKDxyjSFS2GFoLIMhNEEnQ== X-CSE-MsgGUID: q5cuhUeDTpKRHskcoAX6/A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="40144779" From: Zhao Liu To: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Thomas Huth , qemu-devel@nongnu.org Cc: Yongwei Ma , Zhao Liu Subject: [PATCH 8/8] tests/unit/test-smp-parse: Test the full 8-levels topology hierarchy Date: Wed, 29 May 2024 14:19:25 +0800 Message-Id: <20240529061925.350323-9-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529061925.350323-1-zhao1.liu@intel.com> References: <20240529061925.350323-1-zhao1.liu@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: pass client-ip=198.175.65.20; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.034, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-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: 1716962701021100002 Content-Type: text/plain; charset="utf-8" With module level, QEMU now support 8-levels topology hierarchy. Cover "modules" in SMP_CONFIG_WITH_FULL_TOPO related cases. Signed-off-by: Zhao Liu Tested-by: Yongwei Ma --- tests/unit/test-smp-parse.c | 129 ++++++++++++++++++++++++------------ 1 file changed, 85 insertions(+), 44 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 2ca8530e935e..f9bccb56abc7 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -94,11 +94,11 @@ } =20 /* - * Currently QEMU supports up to a 7-level topology hierarchy, which is the + * Currently QEMU supports up to a 8-level topology hierarchy, which is the * QEMU's unified abstract representation of CPU topology. - * -drawers/books/sockets/dies/clusters/cores/threads + * -drawers/books/sockets/dies/clusters/modules/cores/threads */ -#define SMP_CONFIG_WITH_FULL_TOPO(a, b, c, d, e, f, g, h, i) \ +#define SMP_CONFIG_WITH_FULL_TOPO(a, b, c, d, e, f, g, h, i, j) \ { \ .has_cpus =3D true, .cpus =3D a, \ .has_drawers =3D true, .drawers =3D b, \ @@ -106,9 +106,10 @@ .has_sockets =3D true, .sockets =3D d, \ .has_dies =3D true, .dies =3D e, \ .has_clusters =3D true, .clusters =3D f, \ - .has_cores =3D true, .cores =3D g, \ - .has_threads =3D true, .threads =3D h, \ - .has_maxcpus =3D true, .maxcpus =3D i, \ + .has_modules =3D true, .modules =3D g, \ + .has_cores =3D true, .cores =3D h, \ + .has_threads =3D true, .threads =3D i, \ + .has_maxcpus =3D true, .maxcpus =3D j, \ } =20 /** @@ -336,10 +337,10 @@ static const struct SMPTestData data_generic_valid[] = =3D { /* * Unsupported parameters are always allowed to be set to '1' * config: - * -smp 8,drawers=3D1,books=3D1,sockets=3D2,dies=3D1,clusters=3D= 1,cores=3D2,\ - * threads=3D2,maxcpus=3D8 + * -smp 8,drawers=3D1,books=3D1,sockets=3D2,dies=3D1,clusters=3D= 1,modules=3D1,\ + * cores=3D2,threads=3D2,maxcpus=3D8 * expect: cpus=3D8,sockets=3D2,cores=3D2,threads=3D2,maxcpus=3D8 = */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(8, 1, 1, 2, 1, 1, 2, 2, 8), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(8, 1, 1, 2, 1, 1, 1, 2, 2, 8= ), .expect_prefer_sockets =3D CPU_TOPOLOGY_GENERIC(8, 2, 2, 2, 8), .expect_prefer_cores =3D CPU_TOPOLOGY_GENERIC(8, 2, 2, 2, 8), }, @@ -561,32 +562,37 @@ static const struct SMPTestData data_full_topo_invali= d[] =3D { { /* * config: -smp 200,drawers=3D3,books=3D5,sockets=3D2,dies=3D4,\ - * clusters=3D2,cores=3D7,threads=3D2,maxcpus=3D200 + * clusters=3D2,modules=3D3,cores=3D7,threads=3D2,\ + * maxcpus=3D200 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(200, 3, 5, 2, 4, 2, 7, 2, 20= 0), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(200, 3, 5, 2, 4, 2, 3, 7, 2,= 200), .expect_error =3D "Invalid CPU topology: " "product of the hierarchy must match maxcpus: " "drawers (3) * books (5) * sockets (2) * dies (4) = * " - "clusters (2) * cores (7) * threads (2) " + "clusters (2) * modules (3) * cores (7) * threads = (2) " "!=3D maxcpus (200)", }, { /* - * config: -smp 3361,drawers=3D3,books=3D5,sockets=3D2,dies=3D4,\ - * clusters=3D2,cores=3D7,threads=3D2,maxcpus=3D3360 + * config: -smp 2881,drawers=3D3,books=3D5,sockets=3D2,dies=3D4,\ + * clusters=3D2,modules=3D3,cores=3D2,threads=3D2, + * maxcpus=3D2880 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(3361, 3, 5, 2, 4, 2, 7, 2, 3= 360), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(2881, 3, 5, 2, 4, + 2, 3, 2, 2, 2880), .expect_error =3D "Invalid CPU topology: " "maxcpus must be equal to or greater than smp: " - "drawers (3) * books (5) * sockets (2) * dies (4) = * " - "clusters (2) * cores (7) * threads (2) " - "=3D=3D maxcpus (3360) < smp_cpus (3361)", + "drawers (3) * books (5) * sockets (2) * " + "dies (4) * clusters (2) * modules (3) * " + "cores (2) * threads (2) =3D=3D maxcpus (2880) " + "< smp_cpus (2881)", }, { /* * config: -smp 1,drawers=3D3,books=3D5,sockets=3D2,dies=3D4,\ - * clusters=3D2,cores=3D7,threads=3D3,maxcpus=3D5040 + * clusters=3D2,modules=3D3,cores=3D3,threads=3D3,\ + * maxcpus=3D6480 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 3, 5, 2, 4, 2, 7, 3, 5040= ), - .expect_error =3D "Invalid SMP CPUs 5040. The max CPUs supported " + .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 3, 5, 2, 4, 2, 3, 3, 3, 6= 480), + .expect_error =3D "Invalid SMP CPUs 6480. The max CPUs supported " "by machine '" SMP_MACHINE_NAME "' is 4096", }, }; @@ -596,81 +602,100 @@ static const struct SMPTestData data_zero_topo_inval= id[] =3D { /* * Test "cpus=3D0". * config: -smp 0,drawers=3D1,books=3D1,sockets=3D1,dies=3D1,\ - * clusters=3D1,cores=3D1,threads=3D1,maxcpus=3D1 + * clusters=3D1,modules=3D1,cores=3D1,threads=3D1,\ + * maxcpus=3D1 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(0, 1, 1, 1, 1, 1, 1, 1, 1), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(0, 1, 1, 1, 1, 1, 1, 1, 1, 1= ), .expect_error =3D "Invalid CPU topology: CPU topology parameters m= ust " "be greater than zero", }, { /* * Test "drawers=3D0". * config: -smp 1,drawers=3D0,books=3D1,sockets=3D1,dies=3D1,\ - * clusters=3D1,cores=3D1,threads=3D1,maxcpus=3D1 + * clusters=3D1,modules=3D1,cores=3D1,threads=3D1,\ + * maxcpus=3D1 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 0, 1, 1, 1, 1, 1, 1, 1), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 0, 1, 1, 1, 1, 1, 1, 1, 1= ), .expect_error =3D "Invalid CPU topology: CPU topology parameters m= ust " "be greater than zero", }, { /* * Test "books=3D0". * config: -smp 1,drawers=3D1,books=3D0,sockets=3D1,dies=3D1,\ - * clusters=3D1,cores=3D1,threads=3D1,maxcpus=3D1 + * clusters=3D1,modules=3D1,cores=3D1,threads=3D1,\ + * maxcpus=3D1 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 0, 1, 1, 1, 1, 1, 1), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 0, 1, 1, 1, 1, 1, 1, 1= ), .expect_error =3D "Invalid CPU topology: CPU topology parameters m= ust " "be greater than zero", }, { /* * Test "sockets=3D0". * config: -smp 1,drawers=3D1,books=3D1,sockets=3D0,dies=3D1,\ - * clusters=3D1,cores=3D1,threads=3D1,maxcpus=3D1 + * clusters=3D1,modules=3D1,cores=3D1,threads=3D1, + * maxcpus=3D1 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 0, 1, 1, 1, 1, 1), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 0, 1, 1, 1, 1, 1, 1= ), .expect_error =3D "Invalid CPU topology: CPU topology parameters m= ust " "be greater than zero", }, { /* * Test "dies=3D0". * config: -smp 1,drawers=3D1,books=3D1,sockets=3D1,dies=3D0,\ - * clusters=3D1,cores=3D1,threads=3D1,maxcpus=3D1 + * clusters=3D1,modules=3D1,cores=3D1,threads=3D1,\ + * maxcpus=3D1 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 0, 1, 1, 1, 1), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 0, 1, 1, 1, 1, 1= ), .expect_error =3D "Invalid CPU topology: CPU topology parameters m= ust " "be greater than zero", }, { /* * Test "clusters=3D0". * config: -smp 1,drawers=3D1,books=3D1,sockets=3D1,dies=3D1,\ - * clusters=3D0,cores=3D1,threads=3D1,maxcpus=3D1 + * clusters=3D0,modules=3D1,cores=3D1,threads=3D1,\ + * maxcpus=3D1 + */ + .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 0, 1, 1, 1, 1= ), + .expect_error =3D "Invalid CPU topology: CPU topology parameters m= ust " + "be greater than zero", + }, { + /* + * Test "modules=3D0". + * config: -smp 1,drawers=3D1,books=3D1,sockets=3D1,dies=3D1,\ + * clusters=3D1,modules=3D0,cores=3D1,threads=3D1,\ + * maxcpus=3D1 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 0, 1, 1, 1), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 0, 1, 1, 1= ), .expect_error =3D "Invalid CPU topology: CPU topology parameters m= ust " "be greater than zero", }, { /* * Test "cores=3D0". * config: -smp 1,drawers=3D1,books=3D1,sockets=3D1,dies=3D1,\ - * clusters=3D1,cores=3D0,threads=3D1,maxcpus=3D1 + * clusters=3D1,modules=3D1,cores=3D0,threads=3D1, + * maxcpus=3D1 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 0, 1, 1), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 1, 0, 1, 1= ), .expect_error =3D "Invalid CPU topology: CPU topology parameters m= ust " "be greater than zero", }, { /* * Test "threads=3D0". * config: -smp 1,drawers=3D1,books=3D1,sockets=3D1,dies=3D1,\ - * clusters=3D1,cores=3D1,threads=3D0,maxcpus=3D1 + * clusters=3D1,modules=3D1,cores=3D1,threads=3D0,\ + * maxcpus=3D1 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 1, 0, 1), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 1, 1, 0, 1= ), .expect_error =3D "Invalid CPU topology: CPU topology parameters m= ust " "be greater than zero", }, { /* * Test "maxcpus=3D0". * config: -smp 1,drawers=3D1,books=3D1,sockets=3D1,dies=3D1,\ - * clusters=3D1,cores=3D1,threads=3D1,maxcpus=3D0 + * clusters=3D1,modules=3D1,cores=3D1,threads=3D1,\ + * maxcpus=3D0 */ - .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 1, 1, 0), + .config =3D SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 1, 1, 1, 0= ), .expect_error =3D "Invalid CPU topology: CPU topology parameters m= ust " "be greater than zero", }, @@ -977,6 +1002,7 @@ static void machine_full_topo_class_init(ObjectClass *= oc, void *data) mc->smp_props.books_supported =3D true; mc->smp_props.dies_supported =3D true; mc->smp_props.clusters_supported =3D true; + mc->smp_props.modules_supported =3D true; } =20 static void test_generic_valid(const void *opaque) @@ -1396,30 +1422,41 @@ static void test_full_topo(const void *opaque) MachineState *ms =3D MACHINE(obj); MachineClass *mc =3D MACHINE_GET_CLASS(obj); SMPTestData data =3D {}; - unsigned int drawers =3D 5, books =3D 3, dies =3D 2, clusters =3D 7, m= ultiplier; + unsigned int drawers, books, dies, clusters, modules, multiplier; int i; =20 - multiplier =3D drawers * books * dies * clusters; + drawers =3D 5; + books =3D 3; + dies =3D 2; + clusters =3D 3; + modules =3D 2; + + multiplier =3D drawers * books * dies * clusters * modules; for (i =3D 0; i < ARRAY_SIZE(data_generic_valid); i++) { data =3D data_generic_valid[i]; unsupported_params_init(mc, &data); =20 /* - * when drawers, books, dies and clusters parameters are omitted, - * they will be set as 1. + * when drawers, books, dies, clusters and modules parameters are + * omitted, they will be set as 1. */ data.expect_prefer_sockets.drawers =3D 1; data.expect_prefer_sockets.books =3D 1; data.expect_prefer_sockets.dies =3D 1; data.expect_prefer_sockets.clusters =3D 1; + data.expect_prefer_sockets.modules =3D 1; data.expect_prefer_cores.drawers =3D 1; data.expect_prefer_cores.books =3D 1; data.expect_prefer_cores.dies =3D 1; data.expect_prefer_cores.clusters =3D 1; + data.expect_prefer_cores.modules =3D 1; =20 smp_parse_test(ms, &data, true); =20 - /* when drawers, books, dies and clusters parameters are specified= . */ + /* + * when drawers, books, dies, clusters and modules parameters + * are specified. + */ data.config.has_drawers =3D true; data.config.drawers =3D drawers; data.config.has_books =3D true; @@ -1428,6 +1465,8 @@ static void test_full_topo(const void *opaque) data.config.dies =3D dies; data.config.has_clusters =3D true; data.config.clusters =3D clusters; + data.config.has_modules =3D true; + data.config.modules =3D modules; =20 if (data.config.has_cpus) { data.config.cpus *=3D multiplier; @@ -1440,6 +1479,7 @@ static void test_full_topo(const void *opaque) data.expect_prefer_sockets.books =3D books; data.expect_prefer_sockets.dies =3D dies; data.expect_prefer_sockets.clusters =3D clusters; + data.expect_prefer_sockets.modules =3D modules; data.expect_prefer_sockets.cpus *=3D multiplier; data.expect_prefer_sockets.max_cpus *=3D multiplier; =20 @@ -1447,6 +1487,7 @@ static void test_full_topo(const void *opaque) data.expect_prefer_cores.books =3D books; data.expect_prefer_cores.dies =3D dies; data.expect_prefer_cores.clusters =3D clusters; + data.expect_prefer_cores.modules =3D modules; data.expect_prefer_cores.cpus *=3D multiplier; data.expect_prefer_cores.max_cpus *=3D multiplier; =20 --=20 2.34.1