From nobody Mon May 20 14:11:14 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=1689667061; cv=none; d=zohomail.com; s=zohoarc; b=U9yVwC8RvmeyC2n3xkKmfbtnWa3Nn0swFsp2Y0YgovXflApmgKBbhqObT9uqTF0sny/U2IOaGYeMk3wWh7DcRACXg9xAURSPsfQ7F8RJLcJ15ZmqQeadHEqNnE2g5eYig9uvGTgK02qaPGcJbx+5OsBDQLibhYV2XJ4K2UWTIeo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689667061; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=LNJrHAonrZxgdCvfgSj3PUH6RknbQJB99a+XOPnYuOU=; b=cVk6/Io4h0TJ1FMgjylQcE88UG30H5gy9Gf/7V9pa8yz9o85NNIoCGTDB5tR+1xto3htlBqf58VPY9lc0ktTX/3XXieUbEBn37a1ghP6MlPtZ+0QI9/ka8MC/SKZVuvSp2/thyzoCneOfaEULxXcyd058dK7x3acZtN/X9nDHmM= 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 1689667060792495.9487352623187; Tue, 18 Jul 2023 00:57:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLfa9-0006u4-PV; Tue, 18 Jul 2023 03:57:18 -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 1qLfa4-0006te-F8; Tue, 18 Jul 2023 03:57:12 -0400 Received: from mga14.intel.com ([192.55.52.115]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qLfa1-0003tD-Oj; Tue, 18 Jul 2023 03:57:12 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2023 00:57:02 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.28]) by FMSMGA003.fm.intel.com with ESMTP; 18 Jul 2023 00:56:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689667029; x=1721203029; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fuVikuyFfzCnsckFD1CKC9effXoHqWwq5hNoHr/oHg8=; b=IZNQVQ/nnbbNUCxSNlfitC8q3F+cgb1Gzk5H8Hc4mjKfqXYLGcvDMRk8 vz5589rlbr3rbpIyOuKCEqleSeRmGcjT7DkO7WtQKCQ8Xo1eYgr9O4Xzo GcpK40HEhk0rgNNRzlOB+pgYE3SPDl5Cqc5kvXnKExL3V/mO6sOHRI7RZ uD+M4KBvB+cWn3IfpEf7D6Uxl6y2+TyA7EcSpU8HTpD7DWC38TUkEcUAz yHq3L5LdNOlZb8bbD5ytAKi8wPqXpOJ2K8Z7jvd3R6Hp3u6q4tgZ4IJOs Dmge8pXDdsMJNPM6yHXBGSoK9wdU35jYJjhkvkhvKvHXNrq0OgaeeRpY/ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10774"; a="366181561" X-IronPort-AV: E=Sophos;i="6.01,213,1684825200"; d="scan'208";a="366181561" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10774"; a="813653664" X-IronPort-AV: E=Sophos;i="6.01,213,1684825200"; d="scan'208";a="813653664" From: Zhao Liu To: Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, qemu-riscv@nongnu.org, Zhenyu Wang , Zhao Liu Subject: [PATCH] hw/riscv: Fix topo field in error_report Date: Tue, 18 Jul 2023 16:07:12 +0800 Message-Id: <20230718080712.503333-1-zhao1.liu@linux.intel.com> X-Mailer: git-send-email 2.34.1 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=192.55.52.115; envelope-from=zhao1.liu@linux.intel.com; helo=mga14.intel.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 1689667062223100001 Content-Type: text/plain; charset="utf-8" From: Zhao Liu "smp.cpus" means the number of online CPUs and "smp.max_cpus" means the total number of CPUs. riscv_numa_get_default_cpu_node_id() checks "smp.cpus" and the "available CPUs" description in the next error message also indicates online CPUs. So report "smp.cpus" in error_report() instand of "smp.max_cpus". Since "smp.cpus" is "unsigned int", use "%u". Signed-off-by: Zhao Liu Reviewed-by: Alistair Francis --- hw/riscv/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/riscv/numa.c b/hw/riscv/numa.c index e0414d5b1b73..d319aefb4511 100644 --- a/hw/riscv/numa.c +++ b/hw/riscv/numa.c @@ -209,8 +209,8 @@ int64_t riscv_numa_get_default_cpu_node_id(const Machin= eState *ms, int idx) =20 if (ms->numa_state->num_nodes > ms->smp.cpus) { error_report("Number of NUMA nodes (%d)" - " cannot exceed the number of available CPUs (%d).", - ms->numa_state->num_nodes, ms->smp.max_cpus); + " cannot exceed the number of available CPUs (%u).", + ms->numa_state->num_nodes, ms->smp.cpus); exit(EXIT_FAILURE); } if (ms->numa_state->num_nodes) { --=20 2.34.1