From patchwork Sat Mar 9 19:22:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 779177 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853067wrt; Sat, 9 Mar 2024 11:29:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVh+XF2wMdRzmz7zD+06aHHnp7L+dha5VEXdT7z3ZUMUZ0Sm1ZPTiu5vPQeVgkJ9hGV3EJAWev9jLDH5r3AuALo X-Google-Smtp-Source: AGHT+IET9YsxRsxwvTn5METKRyqoLlM7/vMtlMuV+VZy3s5wImo4lHGW6Uzvmw2q1xLcosuli175 X-Received: by 2002:a05:6214:176a:b0:690:abb1:7e92 with SMTP id et10-20020a056214176a00b00690abb17e92mr2835669qvb.3.1710012599055; Sat, 09 Mar 2024 11:29:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012599; cv=none; d=google.com; s=arc-20160816; b=rQyebXokz1UfHbnV3U1dPGCG5sNFOlWh840AukgZKwEfdkuzlWN8WFnnDN8fO4b/aC qj1jRi1hIYqACaMcbpjOVldabIC76U10YhnwYAOFOti7/4e4kYA2/Un+GbIn8Pena7Ud kIhurey6r6/hD0d6IGeasq3mdvFOhUxDaLzUPVZenm8Gum68D8aD8pl3+ZnmsFwBmWEF D/3efL3JFJHPorRDlEEj/nQ/bgIxldhxtvuMMhc7oE/MaWbnyDsV5XKNhuU413JHlr1L gy6kDzRGIOaFQyV4tm3C1YbFLLoWEs9ycK+87eJK1GvOjjtZltVqSKszZi803kIFoVCo 4dIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4izzVDpY+AQ8hh1OPoQkok5+Cmay4u8VvPo/ani8Qjo=; fh=MRpuvAMiIDngljO/1ktWIu7Kho7sXmLGHrYdpgFbLRA=; b=A6Y997HuYNvtlPcvN+964OFbkN9Qba48oYl4bNvQhQfWphkAzLCBLUaLb/uUOzFmXi +4twq6CpRP1rtaargNei52boBpmIV2GdmRpIRHzIbV7OKVVms7vIijL/AlgUOoposAsd qchXM/fs6/XIiO9N8It3WH/qumeN75NdK4bnwhYUxFTshfEi2ICFFaMuuG8ikFkhaBIO MwKbURt85GrbKAR268O/8FwatChUWuLpweK6+S4+9ZbM9y4e2T4iI3FLf54aZ3R0Aj7f GY7cmG/2cLXGh8LK/QnYcQ4eDC6l4Ysp3hyUfTQELAFAV5tgywIKcyJ7tSe6QPXCMhSP r0TQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="N/fn7aln"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id qo19-20020a056214591300b0068fe843bc61si2111552qvb.80.2024.03.09.11.29.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:29:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="N/fn7aln"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lf-0000gQ-0d; Sat, 09 Mar 2024 14:27:11 -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 1rj2KJ-0007NN-Gk for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:54 -0500 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2KF-0003Mf-Jb for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:45 -0500 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-563bb51c36eso3383410a12.2 for ; Sat, 09 Mar 2024 11:25:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012339; x=1710617139; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4izzVDpY+AQ8hh1OPoQkok5+Cmay4u8VvPo/ani8Qjo=; b=N/fn7alnSp9IdsX0dSZWScKpNNh+gwvaIuz+GllWqNE40p3+nUzNYUMqxxGqLDsBkW SY4L09EcM/AswTVjPfQlsbDbkgs3tq4fTnR+qjD6Sk2Qhm0okiO2PfRYbxmOxEPItX2V X9zNZZu6Fro9VLEaELA14czQ8KPOunIX+7N2/XDxFUYwAwCV0Pg3zW3o8a6s5bJ+/Xzf vMAqCm2IhnAF66GvjFAWhbxddPopXFaDbcRKHOngPoBWfjXlEHwesucX+Tfvl2prRX0z JMBZovSm9AWUzezluT4LMTjGIJ+O0Z+nLtvnLFwVIJ6K4XR+XP7+UiyBD6udqWwi9Ywi 9lQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012339; x=1710617139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4izzVDpY+AQ8hh1OPoQkok5+Cmay4u8VvPo/ani8Qjo=; b=n0wmNcK4Jvl0XcjqN0fl20z3FjeN6tyhvhpkLBqOjYLV8eVyySO3HB1jO1rfw2J0vs iviTq6atbEHhYJ90tEPogepAaS/bEki/7IqZyQ/r3cBLbitE5nwniWoLXxzQSoD5XrZx ckWrXIj7+diqNPti0tMidvyq03+bHiTbeCqYIPIFj/xEFVhXCltQuQAM6KxXVFrODpPd T9M5zM89r3HyHSl7XGEGNCH/6SAyDtb+FgT7UtGlCZu0cyAONmi6QbgH9Yzk58umn039 JEa0i42pSjWLTw1hax9j9/7UHP8ZxRuoYp9zrfYWpHvMXbW1zaxrU9gMFCTLvR6M7Gvk /ZoQ== X-Gm-Message-State: AOJu0YxgZgDXxnRPBwazW/HX6U9OCBpz5F/Nk+U6BOM1j01UYzczfC4c 3OTZkvSfq+mBbUSV5HbUZXM3d5MLGw7VcnBCwxlOly9WXd5qmKMhUpMfxNZgBMc7f6QWj0G3YFQ g X-Received: by 2002:a50:cd45:0:b0:568:2578:f520 with SMTP id d5-20020a50cd45000000b005682578f520mr1778835edj.35.1710012339700; Sat, 09 Mar 2024 11:25:39 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id n1-20020aa7c441000000b0056452477a5esm1183979edr.24.2024.03.09.11.25.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 34/43] tests/unit/test-smp-parse: Use CPU number macros in invalid topology case Date: Sat, 9 Mar 2024 20:22:01 +0100 Message-ID: <20240309192213.23420-35-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Zhao Liu Use MAX_CPUS/MIN_CPUS macros in invalid topology case. This gives us the flexibility to change the maximum and minimum CPU limits. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-6-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 1874bea086..84e3422774 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -323,15 +323,21 @@ static const struct SMPTestData data_generic_invalid[] = { "sockets (2) * cores (4) * threads (2) " "== maxcpus (16) < smp_cpus (18)", }, { - /* config: -smp 1 - * should tweak the supported min CPUs to 2 for testing */ - .config = SMP_CONFIG_GENERIC(T, 1, F, 0, F, 0, F, 0, F, 0), + /* + * config: -smp 1 + * The test machine should tweak the supported min CPUs to + * 2 (MIN_CPUS + 1) for testing. + */ + .config = SMP_CONFIG_GENERIC(T, MIN_CPUS, F, 0, F, 0, F, 0, F, 0), .expect_error = "Invalid SMP CPUs 1. The min CPUs supported " "by machine '" SMP_MACHINE_NAME "' is 2", }, { - /* config: -smp 512 - * should tweak the supported max CPUs to 511 for testing */ - .config = SMP_CONFIG_GENERIC(T, 512, F, 0, F, 0, F, 0, F, 0), + /* + * config: -smp 512 + * The test machine should tweak the supported max CPUs to + * 511 (MAX_CPUS - 1) for testing. + */ + .config = SMP_CONFIG_GENERIC(T, MAX_CPUS, F, 0, F, 0, F, 0, F, 0), .expect_error = "Invalid SMP CPUs 512. The max CPUs supported " "by machine '" SMP_MACHINE_NAME "' is 511", }, @@ -575,8 +581,8 @@ static void machine_generic_invalid_class_init(ObjectClass *oc, void *data) MachineClass *mc = MACHINE_CLASS(oc); /* Force invalid min CPUs and max CPUs */ - mc->min_cpus = 2; - mc->max_cpus = 511; + mc->min_cpus = MIN_CPUS + 1; + mc->max_cpus = MAX_CPUS - 1; } static void machine_with_dies_class_init(ObjectClass *oc, void *data)