From patchwork Fri Jun 20 17:13:07 2025 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: 898357 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f54:0:b0:3a4:ee3f:8f15 with SMTP id cm20csp1454862wrb; Fri, 20 Jun 2025 10:21:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXse67fdz5HuAV0h8+vmAbGyoN9EVoWb3mFIDdOIf17cMjcej6tAUSWZOUI0fAyQWsk17uvEw==@linaro.org X-Google-Smtp-Source: AGHT+IFsxD4Szih5FYkKqqekmu7UK6+EwkneQcihqWa9SsHO8teggz9xdBx+a4RKq0SkeyfrWOj/ X-Received: by 2002:a05:620a:2728:b0:7cd:31ca:d81 with SMTP id af79cd13be357-7d3f9936362mr565521085a.27.1750440087783; Fri, 20 Jun 2025 10:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750440087; cv=none; d=google.com; s=arc-20240605; b=BvTS1WPzFpFXhcN/oZPmLt3Dkug7t0oV5mgdlahv7oMJ+W6h18005rNudMZyP22vrC oHFgYeL5Zkc35X9jgDWg/BgF4oDbhAEIYYOtWvBfreDQvb2syPW1JOn0PybsDvh2mcn3 1nVtificALJYS/cOIiPQIEn3cvpDeQVpe7YloYnFMJ3s+kuys66Fw/lOohIuq1XZ6z+V ne63Rik4sXdExIWTOQA25mA8DOC2DRgqFEWtMwR9xKsAyP9i6KpbToEIfTV456piPXMb Uk6faYDafPNwqGrvX40F5gHJ9fKl/gUiFCTc0YLWN4BQiG1hOPsMz3xaqf3SNyrpx3fe MCSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=I1OZb9Kl+4lZDh9KBCT1cYYDblubQbpp2G1iwduVoYo=; fh=8f2AL0Su0K9UlZksY2EEcc9O+An+AQ/T/SEdbs2pdSA=; b=NRXYe7pVPaJfyyeJKuwaeRghc9lfuvaUhyzA3mto+HOiy6hVfBiKg4WnY0wjcz4gFE NtOKd38wR3tzdhD14NpHgzbfRS1XzmO1ueaxeev+dEv+crpaMCf1ve5xhs44yqXuWDft GFj3C9cRjwxA9hqQtS+Vk3zRnKlPUtUI9AlbBYnDC1QnHkXpPWlJ9y8AIvkdOAV/lRGT 7xSPbOA/s3mlXrEpdO/K7oeiQl201F2p2AifhVboxw60p1STm+StxEyUbCt/rDWq3BfU mST9UQuvu+m0Qb6+xnrsz4IhXVXfAJz0IoOyxn2fDriLpO9kXrx1Bk9BzYetYkblvvqv 6Z9Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fSztmfNT; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7d3f9a1b16fsi194037685a.522.2025.06.20.10.21.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jun 2025 10:21:27 -0700 (PDT) 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=fSztmfNT; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uSfM7-0003ew-5k; Fri, 20 Jun 2025 13:16:49 -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 1uSfKM-00012A-Ij for qemu-devel@nongnu.org; Fri, 20 Jun 2025 13:15:01 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uSfKH-0004Fp-SQ for qemu-devel@nongnu.org; Fri, 20 Jun 2025 13:14:58 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3a6cdc27438so1771835f8f.2 for ; Fri, 20 Jun 2025 10:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750439692; x=1751044492; 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=I1OZb9Kl+4lZDh9KBCT1cYYDblubQbpp2G1iwduVoYo=; b=fSztmfNTBrZHWiFGvuOnK4LfTvUHpLVstT9QpoGf6K+nUiIKTfHblgSKEQRnRMOF3+ 76DICWWw0+Ryekt5fYvPaQCJs018hVDGAfcOPU2m/bLDORiFHYcY0CXrIwit6Bfp4s5a EmSbchxSfBGWDMqwbYEypKF0nBf93wgd31iqJn4cfJ/0apk/guCHPrKH2wRkA6z72DOX a6m5TpYR2tt0TIsvVEgwkEFRNRf0k5kKWTXSIn99NJmF8TQfstAUocw6V7D3C3Y3dPa2 nIIfRjYapVTjDHsmsU7jhBn6Svw3csR1VWcw/jeF/CQtN6TobnKP9e1QYdxJkZlOMAL8 t6OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750439692; x=1751044492; 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=I1OZb9Kl+4lZDh9KBCT1cYYDblubQbpp2G1iwduVoYo=; b=ETuu6iPZ/4rZcQLIqlp41/Tap6kctz1CUj08fFIP5fCzEWXNfahKBWOaQgQOrrkEpD lg+mfVZef2FWEGT7JI9s0P3Z170U1sD1OGgXfuzSOpqN5Iuuz/TOWdPO0OFCiOI/khki kluFZbzw1ztgRGJSFWdnAe2M10wXdxh0bEsr4w0sFvfgndXF8zeySiIKLrkGny5hAQqC LQt+HmiLQZvCJRCthDst1skkzTWBosdRcb4GKfIIpy3f6oAWEHOUKeO6pEKuUBsHgviB pzCLEGh3eLSRuYdkROc74MFoeV30/+pQriG9RRaA7HZgwLc3lo2pE7I/3J6T+ptOu+Um 21sw== X-Gm-Message-State: AOJu0YxJ+f5Z+mkzKmFMYcqDxrc2DBOK9RmIZYqCLLbf/4cbB83q9CRP 4Lyv50QLe+PmvuOW9ici4iw1Bh87LmLO8zSQPk2a+m6nhnR/p79Rm1O48EDbawHLkDSQpTe+Wpz 9X/FzKSs= X-Gm-Gg: ASbGncuEZPLOfcfVEcYwngzNznVGvp0RT4lL0WNG4WHKrGAWhHenb0LBk+P/N1YL0lR vIds18d9cJzX5O22WMcrbDeQvpBpuFkPLk0YJ0hmP6GnkJ9yJKrf8gEf1/3pIBII+SF1gAbyz6b 0cXgUavthmB2DClXatsT5S28X7oG2ghFcLOCKk4g5SHOJVWjQvlpOtWZ8Yzag4lKvNhCjICtubU buFh9nliserUlCUI7Wl3d9w2hChogTmuZc9MzOn3Vi1T44tgPAZ+0WGoRaMqiqJxrgJPjsz2RlW eOtXN1qJFdFQ/BkJGgaF/4wgs2DPv9U7FZnwXfXrXQWSfT17UswOVPIIytbYTd4xflTloMD73z8 TUmxbprxxlMxx6w1dccgP215dGT+ko8pOUsVf X-Received: by 2002:a05:6000:65c:b0:3a4:e667:922e with SMTP id ffacd0b85a97d-3a6d12dbe56mr3188809f8f.4.1750439691994; Fri, 20 Jun 2025 10:14:51 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a6d1187e80sm2545362f8f.78.2025.06.20.10.14.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jun 2025 10:14:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Alexander Graf , Richard Henderson , Pierrick Bouvier , Peter Maydell , Thomas Huth , Cameron Esfahani , Julian Armistead , Paolo Bonzini , "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [RFC PATCH v2 14/48] hw/core/machine: Display CPU model name in 'info cpus' command Date: Fri, 20 Jun 2025 19:13:07 +0200 Message-ID: <20250620171342.92678-15-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250620171342.92678-1-philmd@linaro.org> References: <20250620171342.92678-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Display the CPU model in 'info cpus'. Example before: $ qemu-system-aarch64 -M xlnx-versal-virt -S -monitor stdio QEMU 10.0.0 monitor - type 'help' for more information (qemu) info cpus * CPU #0: thread_id=42924 CPU #1: thread_id=42924 CPU #2: thread_id=42924 CPU #3: thread_id=42924 (qemu) q and after: $ qemu-system-aarch64 -M xlnx-versal-virt -S -monitor stdio QEMU 10.0.50 monitor - type 'help' for more information (qemu) info cpus * CPU #0: thread_id=42916 (cortex-a72) CPU #1: thread_id=42916 (cortex-a72) CPU #2: thread_id=42916 (cortex-r5f) CPU #3: thread_id=42916 (cortex-r5f) (qemu) Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine.json | 3 +++ hw/core/machine-hmp-cmds.c | 3 ++- hw/core/machine-qmp-cmds.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/qapi/machine.json b/qapi/machine.json index 0650b8de71a..d5bbb5e367e 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -80,6 +80,8 @@ # # @thread-id: ID of the underlying host thread # +# @model: CPU model name (since 10.1) +# # @props: properties associated with a virtual CPU, e.g. the socket id # # @target: the QEMU system emulation target, which determines which @@ -91,6 +93,7 @@ 'base' : { 'cpu-index' : 'int', 'qom-path' : 'str', 'thread-id' : 'int', + 'model' : 'str', '*props' : 'CpuInstanceProperties', 'target' : 'SysEmuTarget' }, 'discriminator' : 'target', diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c index c6325cdcaaa..65eeb5e9cc2 100644 --- a/hw/core/machine-hmp-cmds.c +++ b/hw/core/machine-hmp-cmds.c @@ -40,7 +40,8 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict) monitor_printf(mon, "%c CPU #%" PRId64 ":", active, cpu->value->cpu_index); - monitor_printf(mon, " thread_id=%" PRId64 "\n", cpu->value->thread_id); + monitor_printf(mon, " thread_id=%" PRId64 " (%s)\n", + cpu->value->thread_id, cpu->value->model); } qapi_free_CpuInfoFastList(cpu_list); diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index d82043e1c68..ab4fd1ec08a 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -47,6 +47,7 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp) value->cpu_index = cpu->cpu_index; value->qom_path = object_get_canonical_path(OBJECT(cpu)); value->thread_id = cpu->thread_id; + value->model = cpu_model_from_type(object_get_typename(OBJECT(cpu))); if (mc->cpu_index_to_instance_props) { CpuInstanceProperties *props;