From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609350; cv=none; d=zohomail.com; s=zohoarc; b=H49Of1T6j436Phh+nU4YEtak+IvHi0mdTdn2ctM3MnwsKfTUU66YJvGjQtq7EwYFEBw684gcQ4VRHMakpVqjNLq/AFh2g74U+AAYEfqyxGk82IUrE9Up8HWc5AWLfROvQfa3mYoxM58BDgcDVRfNGwbYI1n0vKxxTEoyMF0VBIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609350; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=YI4WZbbT1bZzd2LYFBB3rNk/YqQvkBiNRUUbw7uKvvU=; b=fDg/q9Q2VlTnSRnpPoUCDORubU3hkEGSb49mn3uSmZva809LdmA1NmTX2xAgk4GCirDH/etDBRqL/htot8bptKSHMZea1MRy8Hzg9Uu+aV2fyaxiVttOUVBRS9iFqgTXlr2kqPPb8gQAnpsAqirAsMuz6AqpaNG6Mh5GqCsuTqw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609350523460.9543105070268; Tue, 15 Jul 2025 12:55:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublka-0002gc-QH; Tue, 15 Jul 2025 15:55:41 -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 1ublai-0001oG-9D for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:32 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublag-0002f7-0N for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:27 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4555f89b236so43739495e9.1 for ; Tue, 15 Jul 2025 12:45:24 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4562bacfa41sm9294755e9.40.2025.07.15.12.45.22 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608723; x=1753213523; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=YI4WZbbT1bZzd2LYFBB3rNk/YqQvkBiNRUUbw7uKvvU=; b=LrT3iNjN7B3KpEW/Qy+u9cQNMjrtEGPKHnAbxDzWvBTGG3rwn0IW3lFu1HpeC8BU+S tjbw3p4tH27zN453TQHKNf6N23SCsWTEHRaFQAJnw6q/ra9oybKtNIiZPIwvbhUIpvD3 XpWMoWpzXbmNy+xbYbWSVpbhGPoclAaBczbnVyFHHT3+XGANmWQ9CiK1vsvP3aNsUWzO 3gs13Oi5uz6g6MVVfz9mPYdIbKYWMyukjJoUvWCRSXiIi7TKZ8jUigmFQNtMwAhUOTnb p9xjtTHJ0fhxA6pwKwnV94UX/JuWjAzqGbfL0vFWUeXokvqJdWcHsdGWwaI1eR4X0vyV nsug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608723; x=1753213523; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YI4WZbbT1bZzd2LYFBB3rNk/YqQvkBiNRUUbw7uKvvU=; b=TGTxcqZ+JROm5pUgZw5l+Rto1+StsfY8HlyVuHwYm4RPmcjixlKf6+5mrU0We9Ed7n mHeiGtjdWsQ5L8ozCMVdXi5qTfzoJIPdiExiEN5ijJE7iERYsQ+VkTU6VX3JQMKGwZLk YuIyYmVeAR5sknZjqrkzcaFcZ1l4x4TcAf9+s7j5Dldfl6uyzRHA4/pMT7zfVGCkL5on 7xFs/wQoMXu/dw7wH5tgqeNxiYvrKIch1wGlthSgCu219a3uP+WOROMBAP012MCeQ2vr J7F9u5a2jUMtfCQRu4CEecFXnAYA91+fbeE+oSECPKlgJhu4IjxNdADAxgx24fuBlEfv l8zg== X-Gm-Message-State: AOJu0Yz//oA5R2HVIlXrcrXyt3Pq016Zh+y63VZYXfG/Y4344DAMhIt3 DoPq49vQQLCeQHQk+iD+lLuVyVTd/BL+JrPH5tSIaAslTSAAwk7QMIR+2QvHqbzgGD1CG3HJeIs FaKsM X-Gm-Gg: ASbGncs8WV5Aolff1C0yOQVy/P72Mad5hKo9UZx+GV19rHRJ9/H1b0LPYHSx64HIXSo D3ykfvlUxo/0dJwi2Geg/XoKkfV4weT7FZ0eJN67+iApfkOMyhUh7yIgcgenc27rvvJz1gB+KUv npnU/F6EVp/Ikgd4fFaBNvq7yXDVX+4ZaXDZzBjNDmQa6M85Z7KptsyU7pqI1ku8FH08DlkX+YS up4awHPS8bBX/fEMm6Z8L0quFPXNL7p6rgzZIqxN6Fg/9JoMo1P1LUgirXUULMsWFUm4GNozmKB 4f7C0DG6/sRjnGrPcbDI/14xAqMo1WS8ZiJp89WTraRma19fo9rYwhmYWY+eVn7gMlR+l/FZb1+ YG26MXZL6a6dVGlWoOtYJXh7BUeYbQaGaCAHCu0s09dG7TunroiuhipAkJShzTpsk1V6WUoK6Cc SBuw== X-Google-Smtp-Source: AGHT+IGsnUWm531ir9pIYoF/zMU1qwqlDqdFaAWqt6c/pcjoUI3ai7E+ZaMlKDkeIU+RoL2Tt7yGDQ== X-Received: by 2002:a05:600c:3b11:b0:43d:3df:42d8 with SMTP id 5b1f17b1804b1-4562e364770mr869885e9.6.1752608723049; Tue, 15 Jul 2025 12:45:23 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 01/17] hw/xen/arch_hvm: Unify x86 and ARM variants Date: Tue, 15 Jul 2025 21:45:00 +0200 Message-ID: <20250715194516.91722-2-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609351891116600 As each target declares the same prototypes, we can use a single header, removing the TARGET_XXX uses. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Stefano Stabellini Message-Id: <20250513171737.74386-1-philmd@linaro.org> --- include/hw/arm/xen_arch_hvm.h | 9 --------- include/hw/i386/xen_arch_hvm.h | 11 ----------- include/hw/xen/arch_hvm.h | 14 ++++++++++---- 3 files changed, 10 insertions(+), 24 deletions(-) delete mode 100644 include/hw/arm/xen_arch_hvm.h delete mode 100644 include/hw/i386/xen_arch_hvm.h diff --git a/include/hw/arm/xen_arch_hvm.h b/include/hw/arm/xen_arch_hvm.h deleted file mode 100644 index 8fd645e7232..00000000000 --- a/include/hw/arm/xen_arch_hvm.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef HW_XEN_ARCH_ARM_HVM_H -#define HW_XEN_ARCH_ARM_HVM_H - -#include -void arch_handle_ioreq(XenIOState *state, ioreq_t *req); -void arch_xen_set_memory(XenIOState *state, - MemoryRegionSection *section, - bool add); -#endif diff --git a/include/hw/i386/xen_arch_hvm.h b/include/hw/i386/xen_arch_hvm.h deleted file mode 100644 index 1000f8f5433..00000000000 --- a/include/hw/i386/xen_arch_hvm.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef HW_XEN_ARCH_I386_HVM_H -#define HW_XEN_ARCH_I386_HVM_H - -#include -#include "hw/xen/xen-hvm-common.h" - -void arch_handle_ioreq(XenIOState *state, ioreq_t *req); -void arch_xen_set_memory(XenIOState *state, - MemoryRegionSection *section, - bool add); -#endif diff --git a/include/hw/xen/arch_hvm.h b/include/hw/xen/arch_hvm.h index df39c819c8f..8bacaa4ec41 100644 --- a/include/hw/xen/arch_hvm.h +++ b/include/hw/xen/arch_hvm.h @@ -1,5 +1,11 @@ -#if defined(TARGET_I386) || defined(TARGET_X86_64) -#include "hw/i386/xen_arch_hvm.h" -#elif defined(TARGET_ARM) || defined(TARGET_AARCH64) -#include "hw/arm/xen_arch_hvm.h" +#ifndef HW_XEN_ARCH_HVM_H +#define HW_XEN_ARCH_HVM_H + +#include +#include "hw/xen/xen-hvm-common.h" + +void arch_handle_ioreq(XenIOState *state, ioreq_t *req); +void arch_xen_set_memory(XenIOState *state, + MemoryRegionSection *section, + bool add); #endif --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609352; cv=none; d=zohomail.com; s=zohoarc; b=C5YMc4PfDt1Vj63CW2EUqR8rPDzkj+K4X7xGb/LfKzp9o8anU6ndk34RG4AHTuqS9LmNNlMLGfv1e0DhtNH7FvxDxn1Bqo9YTHOPNa1+VkNJMfDxphsXx0LRTcfLh09LcrZnmnFSSJZvaC3OYcAjU0Q250ef20FWe8f0hTDa4oQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609352; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=FurVbd1eLbO1skSsA8qBStYsslRinQbnXVcbQqhp0RM=; b=jnWVb+bLv8cNxQNnvDCjQz0+aN5vURn12dWwwyUYgsF4IvLHz5wmZmNu7HW+ozkhfeGO/bWPAg4miHVj0YgWd5hzYDoqmYzFeGO1x+Ba5TuzE5tpIph3LysTe/mvgxfWPJnz92WE4W0wUM68EeP9Md2g34skl2zr1BlVOkiDNpM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609352877642.0868950313037; Tue, 15 Jul 2025 12:55:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublke-0002oi-0m; Tue, 15 Jul 2025 15:55:44 -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 1ublam-0001r1-9o for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:36 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublaj-0002fV-Sl for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:31 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3a588da60dfso3934228f8f.1 for ; Tue, 15 Jul 2025 12:45:29 -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-3b5e8bd1997sm16190703f8f.10.2025.07.15.12.45.27 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608728; x=1753213528; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=FurVbd1eLbO1skSsA8qBStYsslRinQbnXVcbQqhp0RM=; b=QWrTxN11eSApbM/CODGrrK9EAJJ3R9UifVRr+CCXamYYzUFwAw5JEM6Db8vB4EIv7C FNbne3xB2+fFR2PAuxKEKAGs9NdKrbw7Dozw1IT1PL4dDPLVyDwKzWyBhf3A4XqsMJ7p A9tUH8xNO/dAL5BoRSFWhcGA9vp5jemj30nYB4opJQZDxFVyZoX0hsZ1LRIlVBikFpox i6jcJrxLuWBrfQxvsXLuNgg445mURCtzXYpxl5H/EasoKH4CiSZ5fJvSFUPSbsS1H9+/ 8uisZH6GVLQ5+HBLnor+1SqGXfExbFZGxUooo82ne52mTmgf6XqWMYbV+o5yH8umNVWA hwcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608728; x=1753213528; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FurVbd1eLbO1skSsA8qBStYsslRinQbnXVcbQqhp0RM=; b=oaTJyhENqm41Udd4FKh5I1JrrwskszrSYiI3Ec8R9Eq1dqPeRg0G1ee+G9e/UFpT6c 5MumjSciYPUeI3jhhh6XMJYOotZAFlsgq6MHADD4yQYd/ihA/DtdOgUCTtvWz1apSzgR OCe+84Tcr9QHirevLZk9hGycIWejMOu1AVWnFA5Ftq59HJqTYa9yDn6CRyhjLBzeX0rt gnLYH8qS0Br1nYRo9IMbzfTaOONGh64Jqu6tu7sfW4pfrTis8WPoy2X8fr/ZodC6aEN6 XLxcKlTeaNvQWiDy2ynQDszE4K2GW4MGyz/6s7Bt4UIvbMHRTQGyCzipKT6eG4mDCj4L HR7Q== X-Gm-Message-State: AOJu0Yw4rbc0oTmN6BJOO6HcxfCGfsQ1w8c+XRABJaVm+W2TggJHy0I9 jdGjtP6XyGYIEzn+IEE/xoDvJA67VzY7aGAdIHcRra1b3ePGjRhGcEykgIcgE50IdFM1cTLvP+p +egu2 X-Gm-Gg: ASbGnctx8cRWRBaPFJK8KaPMuJDWo9PFabo3EQyNhfUKjGGKLN/2yIoiMXSZlOde1ZU N6RtQRfcsr/Sa+ciDie4lUDuWYkav/DAy7K1qcUesPa0i+fA8UL02B5xHUUYyA2hTBpBvwEWWyy Swc3TWmbuBSdAdoWIfvuuYjK9SnrDuoj8waMLTazEJwtlXqqfaqQvJuaznnF9Rk9zZdX64Nc8aX 55XEvFc7AEGHwYotiGv1Lf0cC0tpROkoHVVKToSIn5K4CCF6sLJI7gd9P1ph5cLjxln7Nwn8xi0 kjgAoBqfswIv3aoLzuKpmq/+AvLvacbPl6cIFvrtuYlE786bd6i0Twi2BOttBnao39YMIzPCcf/ k1XS+WF09OulL66orX58B6WjH0X27mZ91iSmfa/Vr7WcOrxmsNoXFaoT8kIpjZw0PDFpoR061SU mD9g== X-Google-Smtp-Source: AGHT+IEQYtnVSLRBKU5Sclkp9o8ExlijViyfXcFDm5GFUk6F9O6+VqJN2NXWJI6X18Pa7/r/4+9wWQ== X-Received: by 2002:a05:6000:40ca:b0:3b6:938:86b7 with SMTP id ffacd0b85a97d-3b60dd780b9mr377900f8f.35.1752608727773; Tue, 15 Jul 2025 12:45:27 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 02/17] hw/arm/xen-pvh: Remove unnecessary 'hw/xen/arch_hvm.h' header Date: Tue, 15 Jul 2025 21:45:01 +0200 Message-ID: <20250715194516.91722-3-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609353692116600 "hw/xen/arch_hvm.h" only declares the arch_handle_ioreq() and arch_xen_set_memory() prototypes, which are not used by xen-pvh.c. Remove the unnecessary header inclusion. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Xiaoyao Li Reviewed-by: Manos Pitsidianakis Message-Id: <20250715071528.46196-1-philmd@linaro.org> --- hw/arm/xen-pvh.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/arm/xen-pvh.c b/hw/arm/xen-pvh.c index 4b26bcff7a5..1a9eeb01c8e 100644 --- a/hw/arm/xen-pvh.c +++ b/hw/arm/xen-pvh.c @@ -10,7 +10,6 @@ #include "hw/boards.h" #include "system/system.h" #include "hw/xen/xen-pvh-common.h" -#include "hw/xen/arch_hvm.h" =20 #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh") =20 --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609548; cv=none; d=zohomail.com; s=zohoarc; b=QcTiGNnSp91JBAvRhfZfT4nWzSvkHBPIh1j2jf+7lBem9TLZ6L+pKDcFlLqueskxLrZjq3Y09NegRRfndLzlXX7NbXG1H7oB2/eEOzqrlN3Kjslo4rrMZBU5h4Zh6ufDQesWp+Ixxrh063ERBwxqSpHPJ2X9sgSVPsmHbgf7zsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609548; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=fEm4PPsUISdbcIL8hauQYYBs3+RjFypTP2CiyzADTEc=; b=ESzNVWyD6gn8+/Kp0qoJZM6k18nqFdW3zHhy4nBQj+8Mhswp87pd94Bb5iJ0DNesEFKM2FHm3ftVSyPOIhJIiTxHAFhXFxiHkWRktIzvEBRv9+39Bho/keN6iXkUC8TNcKY74pLOrpyC4HlLkmnaL6QN3szQsjtZ4vC7rGA8pDU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609548599346.34125644898324; Tue, 15 Jul 2025 12:59:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublns-0000kc-FU; Tue, 15 Jul 2025 15:59:04 -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 1ublas-0001wz-8V for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:40 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublaq-0002fu-2R for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:37 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4561607166aso21269325e9.2 for ; Tue, 15 Jul 2025 12:45:33 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-456084873b0sm109690305e9.39.2025.07.15.12.45.31 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608732; x=1753213532; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=fEm4PPsUISdbcIL8hauQYYBs3+RjFypTP2CiyzADTEc=; b=lNBCKhuecYU9+T4vbW98rvIpXFtwn8CRHo0pjflFDCyWfET5UM6lF1Oa0HvZs6Zv7z coedlTugU4R/jxIIpWwq7e+gDbw8irzMLVIRxUUYdjrEzWhjzT7xxbnRwF1peof7QMqF jeBnyk9b4jhZr3q9nSyFF0mpH5Yo+VA7gmpZtJB5Cxdpv0+X5crYdHdcZAFSNsbf646o cAo/biXO3Y891pbthvlgXwb69IahDbIrtLkWZRVB1jhf6+4ancdyWd2ttllg9KbfX4Ch 3k8C37vYm9+DQC8azkKXSF3LLh3equijU3cSgLTU+8eEefHKHHIsFTt9UaG7t5s124hg 3u8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608732; x=1753213532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fEm4PPsUISdbcIL8hauQYYBs3+RjFypTP2CiyzADTEc=; b=nC1kvgsiUriyQP1FcnLCPcmfrKIKmvefPbqqBdS6Qi7FEahk58k0gAJIG5VwtXPdC6 rN5tno+c0t8ijUmpdsOMkVcnbLW0paGoVlN3ZRWo8oLA5ffuPiba2N168q8csVUkdP4P P/gINB9sk4Pchw8Wmof+EJ/u+o5RftczjuSLQ6MmPvy170u+ZBuEOupEC1/KtfmzYOvt rtSSX9wLdvlynhOTQHyCFCqZAfGa312c3JXhqzkGUdPkMk6m8Ini06nUVgWalF8ehm77 hg4xP3xhTDfvxj2mP4UkrEQk3k5ep3Pkm4Dv18O06gjGrTRItKnXw174QhWP4In0J6KH tPBQ== X-Gm-Message-State: AOJu0YwYROqDr1gcN9I/jRbsIS0SqBrOQJaZf9yiYKG78AL/lzGWj2sh Dp5XbOIGMIUD2OOUvw2JZx63WLWNb3my5yDmiVnyUFDS0m/fqEBCJ/VTokRkKHMbYHSQNgh9s02 ePea9 X-Gm-Gg: ASbGncvw1Z2/+NSXk9uhA7QwQFp57dBoUJf63poSIhV4VATCE0vIMCEpUSw9I8qrMzE BqUIT0cbDX75uk0nNNcsAliPIaHGXC639PIYkYOT4EtGsnX3vk9zGloLPbLkd0AFUzjsDaxHa63 0ZOSgNcUGnyPx/FImtPfoke7X13ex6ZzsprJ1d2HfhicrKv2X1ajp7L/S4hWs+VQkRnA70Ivqt2 K4/4Qfq8B/BMyEzydZIAcVq4wF2GdF8NNA/867UQpB9AKe16QOAmAIofPkVTIaOOVdmwknJjGjx a00FItALZBVvQiz3fHCnl6739K6zlDG/eL1vphv+T8TXyNQfvZUj20dcIcg1ASf03s35PClJXjG FjrakvMa9i4EfvFWtvkh8304BKnNZLqI1I4CsG96u9N7ojrs1IaFHe227kHLVywEyf7rZlIXgz/ s4MN9/X7eIziTJ X-Google-Smtp-Source: AGHT+IG0d+wRCK39ryFCrncq5yv0a2BtHfS46fY09WxS3G3LsJRerUXKkkXstEvAxFTBd7be3ka1Lw== X-Received: by 2002:a05:600c:c16a:b0:442:f4a3:b5f2 with SMTP id 5b1f17b1804b1-4562e03207dmr1648905e9.6.1752608732279; Tue, 15 Jul 2025 12:45:32 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 03/17] qapi/accel: Move definitions related to accelerators in their own file Date: Tue, 15 Jul 2025 21:45:02 +0200 Message-ID: <20250715194516.91722-4-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609549490116600 Extract KVM definitions from machine.json to accelerator.json. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Zhao Liu Message-Id: <20250703105540.67664-29-philmd@linaro.org> --- MAINTAINERS | 1 + qapi/accelerator.json | 39 ++++++++++++++++++++++++++++++++++++++ qapi/machine.json | 29 ---------------------------- qapi/qapi-schema.json | 1 + hw/core/machine-hmp-cmds.c | 1 + hw/core/machine-qmp-cmds.c | 1 + qapi/meson.build | 1 + 7 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 qapi/accelerator.json diff --git a/MAINTAINERS b/MAINTAINERS index e88ed2c0a97..0e945f3bd26 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -509,6 +509,7 @@ F: accel/Makefile.objs F: accel/stubs/Makefile.objs F: cpu-common.c F: cpu-target.c +F: qapi/accelerator.json F: system/cpus.c =20 Apple Silicon HVF CPUs diff --git a/qapi/accelerator.json b/qapi/accelerator.json new file mode 100644 index 00000000000..d55fe1aa0a3 --- /dev/null +++ b/qapi/accelerator.json @@ -0,0 +1,39 @@ +# -*- Mode: Python -*- +# vim: filetype=3Dpython +# +# SPDX-License-Identifier: GPL-2.0-or-later + +## +# =3D Accelerators +## + +{ 'include': 'common.json' } + +## +# @KvmInfo: +# +# Information about support for KVM acceleration +# +# @enabled: true if KVM acceleration is active +# +# @present: true if KVM acceleration is built into this executable +# +# Since: 0.14 +## +{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} } + +## +# @query-kvm: +# +# Return information about KVM acceleration +# +# Returns: @KvmInfo +# +# Since: 0.14 +# +# .. qmp-example:: +# +# -> { "execute": "query-kvm" } +# <- { "return": { "enabled": true, "present": true } } +## +{ 'command': 'query-kvm', 'returns': 'KvmInfo' } diff --git a/qapi/machine.json b/qapi/machine.json index f712e7da6d6..f80ba264b53 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -451,35 +451,6 @@ ## { 'command': 'inject-nmi' } =20 -## -# @KvmInfo: -# -# Information about support for KVM acceleration -# -# @enabled: true if KVM acceleration is active -# -# @present: true if KVM acceleration is built into this executable -# -# Since: 0.14 -## -{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} } - -## -# @query-kvm: -# -# Return information about KVM acceleration -# -# Returns: @KvmInfo -# -# Since: 0.14 -# -# .. qmp-example:: -# -# -> { "execute": "query-kvm" } -# <- { "return": { "enabled": true, "present": true } } -## -{ 'command': 'query-kvm', 'returns': 'KvmInfo' } - ## # @NumaOptionsType: # diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index a8f66163cb7..0477696ff02 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -37,6 +37,7 @@ { 'include': 'run-state.json' } { 'include': 'crypto.json' } { 'include': 'job.json' } +{ 'include': 'accelerator.json' } { 'include': 'block.json' } { 'include': 'block-export.json' } { 'include': 'char.json' } diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c index c6325cdcaaa..5ca0da77b14 100644 --- a/hw/core/machine-hmp-cmds.c +++ b/hw/core/machine-hmp-cmds.c @@ -18,6 +18,7 @@ #include "monitor/monitor.h" #include "qapi/error.h" #include "qapi/qapi-builtin-visit.h" +#include "qapi/qapi-commands-accelerator.h" #include "qapi/qapi-commands-machine.h" #include "qobject/qdict.h" #include "qapi/string-output-visitor.h" diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index d82043e1c68..1af0f29f7d3 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -14,6 +14,7 @@ #include "hw/mem/memory-device.h" #include "qapi/error.h" #include "qapi/qapi-builtin-visit.h" +#include "qapi/qapi-commands-accelerator.h" #include "qapi/qapi-commands-machine.h" #include "qobject/qobject.h" #include "qapi/qobject-input-visitor.h" diff --git a/qapi/meson.build b/qapi/meson.build index 3b035aea339..ca6b61a608d 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -57,6 +57,7 @@ qapi_all_modules =3D [ ] if have_system qapi_all_modules +=3D [ + 'accelerator', 'acpi', 'audio', 'cryptodev', --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609904; cv=none; d=zohomail.com; s=zohoarc; b=icSdpZDdyTZLzjeoimbdgXb57/ndOi16DOujSAkvzUCvGiq5H7+QUbBDRWaeYxD7CgfOJYwXh5Jx+EelFj+7b/YQUk0Php9jnTQXe9faHOV39zjgkr79AJ+cVaoc9blSMhRE/+2kQ2l2Wz2w6umy4czKi+Yjq+VPZRPcvFfp304= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609904; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=Y4H7q6wtMebLP2FB4L+vyKN4sDObDDcyRkuxy6M8jq4=; b=VyydUEINbEoH/vrCqY4KFB9xzryF4W0kmwsUjPszfGTgR+qVNitlHtz6m4gulbYAj5sLwhJ0uQfG/edzHPt2I0keK3WUFTc5bz2B1MaZCR13S7uDFe2LjeDsjyVqbdN6i17Oa/aKDthuUn33+xGzEiRNH2i0PUnWJtMItVPr7fI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609904520755.8927451693911; Tue, 15 Jul 2025 13:05:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublsd-0007gj-12; Tue, 15 Jul 2025 16:03:59 -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 1ublay-000249-EY for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:45 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublav-0002gF-04 for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:43 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3a528243636so3290044f8f.3 for ; Tue, 15 Jul 2025 12:45:39 -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-3b5e8e0d727sm16076581f8f.51.2025.07.15.12.45.36 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:45:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608737; x=1753213537; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Y4H7q6wtMebLP2FB4L+vyKN4sDObDDcyRkuxy6M8jq4=; b=Cr4GL49HyBtSB7fvwVUApXgWlUsWB8HrZMe9Ja7XUMbhOI+Br58D3LVGCJ/1zhhP2d EDN9yBfJkZJeKXx8rCirIC7s7dsUE9tHzIBakw4YjtDObqAI5xyUM8upWEQc9fzxg68c 1Yk+hvkoxuaIf4U521UFoc03cUjrGfhYp28JyuGMdSIsLDFtlubmgHkYalGPvJo3BiX3 k7kQyKyfumc7b/mbkf5072vIbLHBM399s1ovcun/3x7vPyCE82hqi6cALAxhDiflFmWq UN/ofZZj5P/nYeUQ/UBMkzcQKbw5NefjLw3KpzcS8yAce/am2oEC+P222tLJRd5aCbWd 5Dfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608737; x=1753213537; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y4H7q6wtMebLP2FB4L+vyKN4sDObDDcyRkuxy6M8jq4=; b=iC6QZrgntnMSQXYNBw714xCwYSX3+o2v5DQeZZrFlR6/YOVQudyeDfOB16qWNpEvYG az9YIgYWTPyPCe+jS1+YxTBneSeSozx/Bh7SgdExuO3Gurru8PeAK1M8Xgjy/JH1opYK 857W080Q5Hn1E7T7FSzh+HHAX4IsvhYaAE+AnQNxWL2m+HZBg5fqEtpPAoHjTSrZqOew B10ffGsZ3AQMgRwsWzLN00uzZywJYEuG8RDIFbUixdWyQXp4X3s3VBqiw8oMqGE5AoGp tKHvP9v5mEwFXEoZI30B4zX3gUHjpbnKuJsuNdwFf6VnlnzDCZJeJT0DNdqsjp+Bf256 m3uw== X-Gm-Message-State: AOJu0Yz+11ZmDhaL1AUEHM6AHc/WWunnoQZw4CAi7LtFVsjLsMFrxXkN HVogQow0lXRsCHvDKEGl45dzRsKdkZfLylTD1zL+xPhjb93MnGhG8/4oSyIF7pOjW741naGrbh2 Zq/Jv X-Gm-Gg: ASbGncvSUAJ2VXmnhk2n1yeOdm0NlwkwqaCpji36nQ2nKGC/MHxpFRY3OLOmIg1p+e2 zjTIO5QJI1WqsJ0v8YmV+9GvZkGfwOLGPqlQWjYSqXsiC1N2dzRY1sblO14B7zA/LevaaEUgLax MWKDteBclpruwXFMN0lHPeVgdcP54XJI9vHplAhQAlB+DsWXr6WK7j1oOEp55VNO+vHU+nEQOJm d93Nd0QnW9C8kv48X2QATEU/kGy7VQsAeTbapLvXPXAq0QChshhp65pjSW4v+lTAMRqxdBFdUJW gtVn/YcEpW6hGk5vh4BeOll+UEjK8oIkjV1ojN+cBs7fblFyvy8CTOXKbhhmpSjo8YczXVK6g/f 9vCip0rSDkMsgZs0I32tT6An0HJB7LK7JHLTisw+HNrjQQ/Lc22azz20TxtJUqH4+finBG7mdgp +MmQ== X-Google-Smtp-Source: AGHT+IGzFn1iXXKcuAtIW+CAVAlkBf21xtLiltI0CRCZv/aO0rvOumkZPCsA0Z0Ehb0+Gn0xt6KOCw== X-Received: by 2002:a05:6000:4a06:b0:3a4:dc32:6cbc with SMTP id ffacd0b85a97d-3b60dd53fe5mr366440f8f.20.1752608737512; Tue, 15 Jul 2025 12:45:37 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 04/17] qapi/machine: Add @qom-type field to CpuInfoFast structure Date: Tue, 15 Jul 2025 21:45:03 +0200 Message-ID: <20250715194516.91722-5-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609908279116600 Knowing the QOM type name of a CPU can be useful, in particular to infer its model name. Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Xiaoyao Li Message-Id: <20250715090624.52377-2-philmd@linaro.org> --- qapi/machine.json | 3 +++ hw/core/machine-qmp-cmds.c | 1 + 2 files changed, 4 insertions(+) diff --git a/qapi/machine.json b/qapi/machine.json index f80ba264b53..6d3a480bea3 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -76,6 +76,8 @@ # # @cpu-index: index of the virtual CPU # +# @qom-type: QOM type name of the CPU (since 10.1) +# # @qom-path: path to the CPU object in the QOM tree # # @thread-id: ID of the underlying host thread @@ -89,6 +91,7 @@ ## { 'union' : 'CpuInfoFast', 'base' : { 'cpu-index' : 'int', + 'qom-type' : 'str', 'qom-path' : 'str', 'thread-id' : 'int', '*props' : 'CpuInstanceProperties', diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 1af0f29f7d3..b9e7eb64e02 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -48,6 +48,7 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp) value->cpu_index =3D cpu->cpu_index; value->qom_path =3D object_get_canonical_path(OBJECT(cpu)); value->thread_id =3D cpu->thread_id; + value->qom_type =3D g_strdup(object_get_typename(OBJECT(cpu))); =20 if (mc->cpu_index_to_instance_props) { CpuInstanceProperties *props; --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609557; cv=none; d=zohomail.com; s=zohoarc; b=iSZGLpFX5OFzXDjEkzNkJ6JxwoMXpulADlWbW0NQJxvfMq3azCR7O9X+33ymx4pxJjSAdHlbI7cLs07aFHsfvhKRZZiWuaVtZaHX+sqcKN4duaaLPG7ppFdziSaBCaWSkr0MmhFX1Po3Jrs4tOnsyY6BCE6lz9osT5P6FjShS+Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609557; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=Mg0kAtPoLtyuNx//5J8QI2+xgJAwgK4CqzuD5gBbA9M=; b=niGqJ/3+E3RZC7APrNt5D0ObmAGRMnTzd7s9njLCAUyhWt0tDUKgg7yOD4VweqJMc4tCm3fB1J95Ojc9PSNcqfoymxK0lmNwap7udDnjIDDfcf3cojN3Xb5YxBXumJX4MgrQrztcWm1TioMSwnNs+tYJ1lOJoM9Htkz1Q1DHfM8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609556925155.9045943612971; Tue, 15 Jul 2025 12:59:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublnv-00011p-Dr; Tue, 15 Jul 2025 15:59:07 -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 1ublb0-00028M-JI for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:47 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublay-0002gZ-ST for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:46 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4550709f2c1so30723525e9.3 for ; Tue, 15 Jul 2025 12:45:44 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4562bacfa41sm9300245e9.40.2025.07.15.12.45.42 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:45:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608743; x=1753213543; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Mg0kAtPoLtyuNx//5J8QI2+xgJAwgK4CqzuD5gBbA9M=; b=BkJ0S3AZRWNVlrHFb+60BIIkc5EkF89x1g5FUIR4uOIqNQ9WDdKdrKnF5iKZ0ubiZ3 31tkuq99U8X2qgLcv07Q3jtcbQmftTJlTOfb6kDVe8TkTKay49Jj4edEsCcfj4wufE1W naogMe4iTwhOd5UvX2AG2YnObqKXSdV4gsW7zXt76Qkm1h1CrEJJbs9l1CuC3L1UM7Vs WpCJXY0mhTjYmY7acH+AU3vGS+GTrp7AssjUJ1XDXidcGIECEq1T4FSSuC9/z/F5RiiK 7Bn26gzJlupryn0OFTb1YeAsuQQO/DHtbrRqVcMbgIIxCPRFlye1ul6VrvQ98GAuQof/ vi8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608743; x=1753213543; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mg0kAtPoLtyuNx//5J8QI2+xgJAwgK4CqzuD5gBbA9M=; b=pHjPPHD/XuB9SkzEjOdk3cflvDJd/yMLvDNz927hxW3VW2gCu9xiqeBGCqI1IdADVn jp2co5co91BqRkc4ZmFABhanVijBMfxhVQ+XHg2r0mm1/fchUvvjSJ1Vi+ror2Rq02Hf kAwIiT2sQAN3gTlD2AL8u6tvuntAfUXWiJU14PWndXBu1fDV66U+K4bXVl2znwWp/eXn ad66L09oZQaTs3OjCaCAmeF5X0/hTTAw0OVwi8JvpZXdpVgCiLQFsdFXVLYql7oxWnMV P8Kx/i59fobyGQRpKbNIEYhSNB+IWh3py5LD36oKnD9yiGtXd8MjQL/oHY3y+8zm8Lav B8Jg== X-Gm-Message-State: AOJu0Yz/4CLjzuomhqj71XLK45cLfCvRqOcOkABjEDePRqbadqQQAVr9 E1RxsG+icm6wow0rZvDw30/c9sh6urDyHiA92dhw8DSakgIWT7i4ACdPvv8xzMorHCiSSMk3JUz sWmN+ X-Gm-Gg: ASbGncv5GhrQb5mQdJy1s9v97mX2AoWVGOj1C3CR19kxzEnj8AcT/XOYGO8p5cRRVF3 L1KfAYsbiBk3mvoHKWNO0Kc6ugt9b1rqRorY6SkREgmSfvIoBhUrbuLUDta55KSNkZOAF73lXYz 72w5K7nCW/W5b1YBJ2F60ZMb9Vmq2T228yU0dOSFEH9SK00a4gFJ/htjv9I9hMtf0aIhH6T6shm DB79oz10SfbWs9uhLSYZOWO2nKWwVo5NWx6MnqEWl5CB0Lx3LRvYHK4HXosTnp7mr0J4c7mX+GR CAZtExd5xRvaQcLvN7nkhR2GG25g21puLCvVvrsOkaWElDedDKuOctoo7ZPROu5vv5sEyKo3qza qTEyvTY20SuP1jmuvS+UKKc8zxOr/jcTuP0/v01pRFeiMpJ7ghvDYL83K7G9n98Q8avcUMUJzsT pSWw== X-Google-Smtp-Source: AGHT+IGd+YL3xbeMnIF/YY+qKHthQWDxQdpn8zi7r87LKBS/d2aao1Rr3a8Xo6WVMya9+36A3TNASQ== X-Received: by 2002:a05:600c:450f:b0:456:19b2:6aa8 with SMTP id 5b1f17b1804b1-4562e27497dmr1618115e9.19.1752608742907; Tue, 15 Jul 2025 12:45:42 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 05/17] hw/core/machine: Display CPU model name in 'info cpus' command Date: Tue, 15 Jul 2025 21:45:04 +0200 Message-ID: <20250715194516.91722-6-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609559884116600 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=3D42924 CPU #1: thread_id=3D42924 CPU #2: thread_id=3D42924 CPU #3: thread_id=3D42924 (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=3D42916 model=3Dcortex-a72 CPU #1: thread_id=3D42916 model=3Dcortex-a72 CPU #2: thread_id=3D42916 model=3Dcortex-r5f CPU #3: thread_id=3D42916 model=3Dcortex-r5f (qemu) Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu Tested-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Xiaoyao Li Message-Id: <20250715090624.52377-3-philmd@linaro.org> --- hw/core/machine-hmp-cmds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c index 5ca0da77b14..3a612e2232d 100644 --- a/hw/core/machine-hmp-cmds.c +++ b/hw/core/machine-hmp-cmds.c @@ -33,6 +33,7 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict) cpu_list =3D qmp_query_cpus_fast(NULL); =20 for (cpu =3D cpu_list; cpu; cpu =3D cpu->next) { + g_autofree char *cpu_model =3D cpu_model_from_type(cpu->value->qom= _type); int active =3D ' '; =20 if (cpu->value->cpu_index =3D=3D monitor_get_cpu_index(mon)) { @@ -41,7 +42,8 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict) =20 monitor_printf(mon, "%c CPU #%" PRId64 ":", active, cpu->value->cpu_index); - monitor_printf(mon, " thread_id=3D%" PRId64 "\n", cpu->value->thre= ad_id); + monitor_printf(mon, " thread_id=3D%" PRId64 " model=3D%s\n", + cpu->value->thread_id, cpu_model); } =20 qapi_free_CpuInfoFastList(cpu_list); --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609447; cv=none; d=zohomail.com; s=zohoarc; b=D20n+nGYwNvo1vGNUPecPsQAfSp3D82KO5H4ETeB1F5BSnlpxupwlsdRloeAi0a3uhv9epcWVEf9SNWGAv3sgrdbFzY4BN+XCgNKEvEQzolGpkBSnSd1HSzur/G+khYWvhJ+lqokP71BVeHU9eb40VApFLCMk7uZxMvdHlaKoD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609447; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=BSy9aVlBgxijF+Ou2qWAHloWsiUymVdjDuqFpB9M18s=; b=Czil/5rgC6i7tgWxhM1BVnDOQD9pgbew6ibQcCLohvxAs9NweZDWKl0ktUi6B9kenNV1C4Z17BAnT6U1ibtyTK0yogp3VPRlTGpQl4cnlkWCPL4XWkCVoEEhDiUPW0gyt8wePkgLPueYPsSXM0MheC82ZNXfPMfxF9Ib1oVt+k4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609447798207.68172851922145; Tue, 15 Jul 2025 12:57:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublkg-0002uR-Nq; Tue, 15 Jul 2025 15:55:47 -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 1ublb8-0002ql-3v for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:54 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublb6-0002hr-7Y for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:53 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-45618ddd62fso26976155e9.3 for ; Tue, 15 Jul 2025 12:45: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 5b1f17b1804b1-4561efa9301sm54593425e9.24.2025.07.15.12.45.49 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608750; x=1753213550; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=BSy9aVlBgxijF+Ou2qWAHloWsiUymVdjDuqFpB9M18s=; b=kjD/fDAp88hn+eSLd2XUcv0YbPKDg3tGDJMkB+KaEAMXBffwW+GKCtIwAbdIjbRLhX acB5nWH+6AyPG/EstHzElsZ4Xpacb5hTr2EBrhIJ+3X+SzYhNy1yrNNralfi1gNnks4a BLNHfsjRrQE3EfbAc19IPAhpoyKoMUEuqPeiFSYC16aGzJ1+qvdLSR74CDBVhU50n/Jp ak+3YBzS4a8nJbBJAs+OA3NwmguJptNvaWimvmJ03Bz3X4pCX50WUAD5nMmy7ZZGBl0J 6YQ06GsI5eB9QI+ZneIFX+jpt8ZOu0l05NLWqzpN72BnUFTcx+PuoRW22p3dNHgKnFaa cBRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608750; x=1753213550; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BSy9aVlBgxijF+Ou2qWAHloWsiUymVdjDuqFpB9M18s=; b=StbpYuq1YICkqzmRK8YGXw1CduLFbjYGiK69LX03gJewaFdWc9PuIh++vK6F1iBzDt pSwlRT89gyORml6ByT1yYODD5gJN1V5vNRNOEi0TcAZxL8m1Zm8+pLXIeGGwyyo4AnuC UCgFJhG9kIqs6qx46Go0mzCWqenn2M9WlgRCASyXtBFlk4ojzyea0L1DuIyl7GY8V1y/ rQWMxAu5SPMXsVO/efEXeJOHVT/QE/jKMG1KH6gMq18aRUJC7Rx8A96oiOxCM6ZUPHVm DUMcIykjTixbDWmiLAQkWnPZwbfElH6H2Q/pb/RWN9IommYMYmVlofHIH64PcB1gpCSt RfHQ== X-Gm-Message-State: AOJu0YyDmjTED5exlMtoJWnn6+FiqBUdlOKBu/zzZ/V43j1bUF+tsjkV 02AL4z5ON4riQhp6g8scfts8HCdaz0wiGI2+ToY3n6SIGoqZnaEesIMVhtXoLxCZz3Y1dS/SV4k iHRz9 X-Gm-Gg: ASbGncuDxWCNM9xbgw+DZhtYyaRreK94M7/7m4QBI9vbfJyEmmUbTjeazYufkVgsvMl PwPay7AkTn4CFwApqPOljo0oqfFArb2xBcFJVWpTYKoWRCIHAqp3bDYFFrTphym+yGJzE0J/cC4 JveXFAv0255ljH5wg1Hd7wqEpguft6Obyz3TdjqauR97R1WwZr0yvz6lKk/UKZqbVs9nThIoeqL 3jdah1nwkQcncY8WmKJRtlc5wUOOc2Cjb0/4THTavLMDYcJ+/jycJ6mobbAnHyNDkBNhPjpcJCX tAtrlgDqB2UbdrtqtpLPKIwVp6vzWqS1ozYam9MzvwVvooKtwOvLr9Duzncxj3o1ZrcfQQLe74d J89E6KmSXBdgZ9cY2fNoz6yPKJWPfzEYllvgOlKMIgaYBIwT9eohcEs0L0+wEZmpE4VRhm1v4NI LqgTxEeyJE9Q3A X-Google-Smtp-Source: AGHT+IFWke2DaMwS+JRGE8oZj47NTbGVsLSP6yIA61ULQ/3e/LJ7jM+M52uJhLbaMWn4BfeAvAsvrQ== X-Received: by 2002:a05:600c:638e:b0:456:18ca:68fd with SMTP id 5b1f17b1804b1-4562e389d48mr833415e9.10.1752608750177; Tue, 15 Jul 2025 12:45:50 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 06/17] accel/tcg: Do not dump NaN statistics Date: Tue, 15 Jul 2025 21:45:05 +0200 Message-ID: <20250715194516.91722-7-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609448601116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Message-Id: <20250710111303.8917-1-philmd@linaro.org> --- accel/tcg/monitor.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c index e7ed7281a4b..778b12613f4 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/monitor.c @@ -19,7 +19,7 @@ #include "tcg/tcg.h" #include "internal-common.h" #include "tb-context.h" - +#include =20 static void dump_drift_info(GString *buf) { @@ -57,6 +57,7 @@ static void print_qht_statistics(struct qht_stats hst, GS= tring *buf) uint32_t hgram_opts; size_t hgram_bins; char *hgram; + double avg; =20 if (!hst.head_buckets) { return; @@ -73,9 +74,13 @@ static void print_qht_statistics(struct qht_stats hst, G= String *buf) hgram_opts |=3D QDIST_PR_NODECIMAL; } hgram =3D qdist_pr(&hst.occupancy, 10, hgram_opts); - g_string_append_printf(buf, "TB hash occupancy %0.2f%% avg chain occ= . " - "Histogram: %s\n", - qdist_avg(&hst.occupancy) * 100, hgram); + avg =3D qdist_avg(&hst.occupancy); + if (!isnan(avg)) { + g_string_append_printf(buf, "TB hash occupancy " + "%0.2f%% avg chain occ. " + "Histogram: %s\n", + avg * 100, hgram); + } g_free(hgram); =20 hgram_opts =3D QDIST_PR_BORDER | QDIST_PR_LABELS; @@ -87,9 +92,12 @@ static void print_qht_statistics(struct qht_stats hst, G= String *buf) hgram_opts |=3D QDIST_PR_NODECIMAL | QDIST_PR_NOBINRANGE; } hgram =3D qdist_pr(&hst.chain, hgram_bins, hgram_opts); - g_string_append_printf(buf, "TB hash avg chain %0.3f buckets. " - "Histogram: %s\n", - qdist_avg(&hst.chain), hgram); + avg =3D qdist_avg(&hst.chain); + if (!isnan(avg)) { + g_string_append_printf(buf, "TB hash avg chain %0.3f buckets. " + "Histogram: %s\n", + avg, hgram); + } g_free(hgram); } =20 --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609612; cv=none; d=zohomail.com; s=zohoarc; b=hcJl+20k/QzRHAILX49m7JAkjZi2JNFMA151zEmqxVhux1MtDaTc2zzNyGo/Bhhtz+Dz09+a5fwVK6reGOmQCgUSliogQdZxQe6C/z93KCUYzfqOrRKSwQE+MZaFZu6sa4VBh/PAMJwmXUKw3Jw9VwPOUFzfRF1WwbXTTpT3/zw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609612; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=8fk9V0N9x/W+vNzRtti/sddaZjw+YfCrgEKksP+0n4A=; b=QBWK6aBNgbthRvlSVuynA2xElZslmlUDytVs9p9TPgwiYKTvPcBpbsci7/Cj8M/xI64NnDbyP8UbFYJE6Ric/5CWJ30qeH+9Lwfg6tN7ScWGfnjuJu1UC1u++4DX3u04qxeXi70zsPzY7qUiOR7+dVf+d+qLpIoa+5xd5ZbhTWk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609612117976.6535855836346; Tue, 15 Jul 2025 13:00:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublof-0001gC-Sg; Tue, 15 Jul 2025 15:59:53 -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 1ublbE-0002zo-0m for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:04 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublbB-0002iN-Vs for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:45:59 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-454ac069223so1181535e9.1 for ; Tue, 15 Jul 2025 12:45:57 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454dd4669c3sm168689765e9.14.2025.07.15.12.45.55 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608756; x=1753213556; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8fk9V0N9x/W+vNzRtti/sddaZjw+YfCrgEKksP+0n4A=; b=rKlPE0/e9hmcz4HhJjt2kxTWsbs6gP5JyrAg4IGORdDkjos01Gt/XD7T9eap3dUhKB cBAPNS5mlnIGrA4yYL3sF3WLR5OniqXne0v+3N/X58iswWx2hZPcgnqChorTwmJbzG1r Fv2v3oC4/SXipHw3cmCFEK1vwVi6gJoS+JiRdE5yAigD2GF/3Y1rnZvsy17JukdROQrV 9rZY+sgt9ZWmAAKd/6K8eCpz+EuaMoCp+RhY0yEgkLZfsdpsR2wiZ6xbfFv8oIW40Xoo Hp8FjJpOkSWSesInAG6sRZv+B6W/X/V1vofq40yMYuVHyGSuY1jurYoWbVAjmGYicae1 NDug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608756; x=1753213556; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8fk9V0N9x/W+vNzRtti/sddaZjw+YfCrgEKksP+0n4A=; b=Y6EWyN0r/MarpftejIOTAkKSNj05AT228rxZPEMaQy2qTYnDGPyNrYYNAN3AgJfShc +8tIwu3DrNbAe3vYRXqj7b2Mk4Zxaf1Wg6kRoTvEBozrRq/PM2J1b9w9eZYBfnO8zDH0 tLKRDLb0yuY6tog/t56IAM7GJwQr146K0O1qgUI4sXZmhELxetlIKsZW8LPPxPS9o7rq hMSdCpaD9BckjDmz+EKQu+oN6G5gRd/7tbiAZK6hSbidzzAtowUpZtgzBbRjlg8y3v8P EgE1xuL0J0wHvlCyDe8biXwtZUG2Tz0wovDhcqKFUxC2X05c6I+X9CPHrAGyQEOB4z1c DVBA== X-Gm-Message-State: AOJu0YwxbsDYi0z2y/XSrvu/RpUHfwl1gWPH9BcP/+7CmvWBETNTOq0M mbRza+kVcWT6ZpxhItFYnEbG4v0VwKAabQJiD4rmlLMXHJYS7ydJ79q0VX9gRmWkVTNmgDffaTN kwdAK X-Gm-Gg: ASbGncuFCDpvFVkDj0jVa4vF5bn1glXJhtSsocaRTXsR6LwbdsBZL+mayfg8Y2jGHuu etd43StBjuQtBHJMAH0F+GimKFhu/6QTaH7+adHlPvWVhhIQiwD1WoIIx33njXX4qxauLSjLZME J8h3fEZOp4pdVyPvZMxIHErGJdl7cY/UJejfRmHQFyPUsYqMPyuogwxQR2VX/AuenBN1e2eyBux BJqMlis3zELK1oznzdVoq4dYRuSjJ5qBKCjJZw3ap8Mzk46pTHA6B36TGNOgOlx4P4it9qwOaAY OsRNmBtak9xqPS7xYbLs5Kz7xgF+MS/kazY1GDCdgAJy+2mp0mHSsC7E3ACZsmgOLVS+1vP8bjb JP9k78f6isKEvagjbhbFPj8XrCgHuPjfXDUxnrKMPrHpLQuvPAa+HQnv2g0GXUnMHM/XK6L9uux lXNA== X-Google-Smtp-Source: AGHT+IFP+F0+N7LxTOOa23GeO8OWAxEbaY9tRnCFG6/wG8LGRy2Av5Q5skYT0w6Tv/S1NNF7lJcjCA== X-Received: by 2002:a05:600c:3b9f:b0:455:f7b8:235c with SMTP id 5b1f17b1804b1-4562dccb666mr4391545e9.14.1752608755900; Tue, 15 Jul 2025 12:45:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 07/17] accel: Rename 'system/accel-ops.h' -> 'accel/accel-cpu-ops.h' Date: Tue, 15 Jul 2025 21:45:06 +0200 Message-ID: <20250715194516.91722-8-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609614426116600 Unfortunately "system/accel-ops.h" handlers are not only system-specific. For example, the cpu_reset_hold() hook is part of the vCPU creation, after it is realized. Mechanical rename to drop 'system' using: $ sed -i -e s_system/accel-ops.h_accel/accel-cpu-ops.h_g \ $(git grep -l system/accel-ops.h) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu Reviewed-by: Richard Henderson Message-Id: <20250703173248.44995-38-philmd@linaro.org> --- include/{system/accel-ops.h =3D> accel/accel-cpu-ops.h} | 8 ++++---- accel/accel-system.c | 2 +- accel/hvf/hvf-accel-ops.c | 2 +- accel/kvm/kvm-accel-ops.c | 2 +- accel/qtest/qtest.c | 2 +- accel/tcg/tcg-accel-ops.c | 2 +- accel/xen/xen-all.c | 2 +- cpu-target.c | 2 +- gdbstub/system.c | 2 +- system/cpus.c | 2 +- target/i386/nvmm/nvmm-accel-ops.c | 2 +- target/i386/whpx/whpx-accel-ops.c | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) rename include/{system/accel-ops.h =3D> accel/accel-cpu-ops.h} (95%) diff --git a/include/system/accel-ops.h b/include/accel/accel-cpu-ops.h similarity index 95% rename from include/system/accel-ops.h rename to include/accel/accel-cpu-ops.h index bf7383511d0..a9191dded7e 100644 --- a/include/system/accel-ops.h +++ b/include/accel/accel-cpu-ops.h @@ -1,5 +1,5 @@ /* - * Accelerator OPS, used for cpus.c module + * Accelerator per-vCPU handlers * * Copyright 2021 SUSE LLC * @@ -7,8 +7,8 @@ * See the COPYING file in the top-level directory. */ =20 -#ifndef ACCEL_OPS_H -#define ACCEL_OPS_H +#ifndef QEMU_ACCEL_CPU_OPS_H +#define QEMU_ACCEL_CPU_OPS_H =20 #include "qemu/accel.h" #include "exec/vaddr.h" @@ -89,4 +89,4 @@ struct AccelOpsClass { =20 void generic_handle_interrupt(CPUState *cpu, int mask); =20 -#endif /* ACCEL_OPS_H */ +#endif /* QEMU_ACCEL_CPU_OPS_H */ diff --git a/accel/accel-system.c b/accel/accel-system.c index c54c30f18ba..c2a955a6daa 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -26,7 +26,7 @@ #include "qemu/osdep.h" #include "qemu/accel.h" #include "hw/boards.h" -#include "system/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "system/cpus.h" #include "qemu/error-report.h" #include "accel-internal.h" diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index be8724ac896..214454bd0b4 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -54,7 +54,7 @@ #include "gdbstub/enums.h" #include "exec/cpu-common.h" #include "hw/core/cpu.h" -#include "system/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "system/cpus.h" #include "system/hvf.h" #include "system/hvf_int.h" diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c index 0eafc902c3f..b709187c7d7 100644 --- a/accel/kvm/kvm-accel-ops.c +++ b/accel/kvm/kvm-accel-ops.c @@ -16,7 +16,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" -#include "system/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "system/kvm.h" #include "system/kvm_int.h" #include "system/runstate.h" diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index 2b831260201..a7fc8bee6dd 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -18,7 +18,7 @@ #include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/accel.h" -#include "system/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "system/qtest.h" #include "system/cpus.h" #include "qemu/guest-random.h" diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 279dbfa1cf7..58ded9d6f0d 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -26,7 +26,7 @@ */ =20 #include "qemu/osdep.h" -#include "system/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "system/tcg.h" #include "system/replay.h" #include "exec/icount.h" diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index bd0ff64befc..55a60bb42c2 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -19,7 +19,7 @@ #include "chardev/char.h" #include "qemu/accel.h" #include "accel/dummy-cpus.h" -#include "system/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "system/cpus.h" #include "system/xen.h" #include "system/runstate.h" diff --git a/cpu-target.c b/cpu-target.c index 1c90a307593..2049eb1d0f6 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -19,7 +19,7 @@ =20 #include "qemu/osdep.h" #include "cpu.h" -#include "system/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "system/cpus.h" #include "exec/cpu-common.h" #include "exec/tswap.h" diff --git a/gdbstub/system.c b/gdbstub/system.c index 8a32d8e1a1d..5b6f8d07334 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -19,7 +19,7 @@ #include "gdbstub/commands.h" #include "exec/hwaddr.h" #include "exec/tb-flush.h" -#include "system/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "system/cpus.h" #include "system/runstate.h" #include "system/replay.h" diff --git a/system/cpus.c b/system/cpus.c index 8e6da2e0606..256723558d0 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -31,7 +31,7 @@ #include "qapi/qapi-events-run-state.h" #include "qapi/qmp/qerror.h" #include "exec/gdbstub.h" -#include "system/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "system/hw_accel.h" #include "exec/cpu-common.h" #include "qemu/thread.h" diff --git a/target/i386/nvmm/nvmm-accel-ops.c b/target/i386/nvmm/nvmm-acce= l-ops.c index a5517b0abf3..3799260bbde 100644 --- a/target/i386/nvmm/nvmm-accel-ops.c +++ b/target/i386/nvmm/nvmm-accel-ops.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "system/kvm_int.h" #include "qemu/main-loop.h" -#include "system/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "system/cpus.h" #include "qemu/guest-random.h" =20 diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-acce= l-ops.c index 5f4841c9fa4..da58805b1a6 100644 --- a/target/i386/whpx/whpx-accel-ops.c +++ b/target/i386/whpx/whpx-accel-ops.c @@ -11,7 +11,7 @@ #include "qemu/osdep.h" #include "system/kvm_int.h" #include "qemu/main-loop.h" -#include "system/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "system/cpus.h" #include "qemu/guest-random.h" =20 --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609954; cv=none; d=zohomail.com; s=zohoarc; b=N2ed2yf9W9rGwHSPx/N9Cs5V3L2w910cvtZYlYHKwmHLJ75+0Q7kFJYdu/EBLFA/cgqXGnlMN9GO0hDxvmg+3NMlWE8FPpW6u7NbGy7zUdk0GuqYhlLHoNmTT0VIPCw4EFhxvOoZf9lMcaq0nluJFSVWO/H7BHE4wDGdwSHQeEQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609954; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=nJSJKfpTNzHi1jnqzNrlZAkGPIYhBAycDFjBaXl6h9M=; b=RP57aVVzXMd4x9TlxjkiZJ9f8al7c44h3uF7aCOYCJThnVqGFTxC1TBtBXePqzxXMoVzMVMeiMEoP7Nq/tAX9bQCZTb8sk6rKlpbhNh00gQwOg/kxwUNweDEojvOvpzE4HJ6FIwE4BWk2965OX9DR4TmWrik1+ygYvzazrtv4qY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609954053497.76243812786413; Tue, 15 Jul 2025 13:05:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublsh-0007iv-4D; Tue, 15 Jul 2025 16:04:03 -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 1ublbK-00039m-Ds for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:21 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublbG-0002io-Gh for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:04 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3a531fcaa05so3333110f8f.3 for ; Tue, 15 Jul 2025 12:46:02 -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-3b5e8dc201asm15701166f8f.22.2025.07.15.12.45.59 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608761; x=1753213561; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=nJSJKfpTNzHi1jnqzNrlZAkGPIYhBAycDFjBaXl6h9M=; b=BMb3UOuEMQNxrZzURfbigKsgjn0oFFJqpmZGogbO9t/KQT1aa/B1NeIztWJcd6FKha Y1PtP19q5+DEuTSs+bPhbV9iLgzlfUTKKrov8nq+piC6u+2jABj/vp9BspJFkplwiQdz v1nTJH6M8iQIhPltOCPgHSn5E1RPKGyTzuM2RLNKzkDmxVHp4mzzxiaBN1cZXYWYTgGn 8VuUIMhESuPFAWLQLyu6WN5HAQFPOESMPv055pB3S1jcJa5wCEio+52WjerGzWnU0Sm4 DOVw/YkJmQM7d0MwY+sv6RQfBld60a4FhwpoluacvmF92favyyAXPz1ztv+5wWHO1bYG PNfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608761; x=1753213561; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nJSJKfpTNzHi1jnqzNrlZAkGPIYhBAycDFjBaXl6h9M=; b=pv4vJraTxCgCh8czEJrGiY57KajbTUSIutzp3Wt0ChfklBpggyligyH7EEMhvsI8gK DS7kFr8T4rmKqyUhrj2zCiPpT7LiM8XjQG41AW4CJMb1TNra6HrGe1AGlesmP+NsS74w tMeb/m1MONmFiOWCJJx5kdDeowi+Ab15RaKak4+a2BR2dQa82njZJkXKHuZV9oZm/9rO K9fjoRUHk6JYg6ix1LVTEr7G+PeHGsiR1sVpAe8WGT3gtNiEoGHezcs/el/fYQVbv6+y F0bGZR99gLAkuMilUlZ2T4wQxbFa7zVLHmT5ksnB2vnyaWtorXj6ax6bdWLrWATm2+yx 8TRg== X-Gm-Message-State: AOJu0Yz0yfcaBLA0XClB/DSVYEFYsF9VLXUKz/mEy+KGQMicmZa5Dum/ Iu52VhMYLMJLM/vW5NPoA994VhuML3mERGn4fPv+Y/ZEAzcqbOE9MFfZD+Kfssw4Z4gF+HvkS3/ 5bZ+w X-Gm-Gg: ASbGnctG1PUFQVt3SOgmrXVQLec5Srr8Meqo71WJfLHANPfi1QFudGBRlQPsKcUVWuV laA8iT4juO2xFEXnv5sVCAdR9en/CMy4oPSGTa1syJVh5Ml7LJohHHHO5Dkfv+dXC0S9uMX0fZ0 1WeAS4ao3zejEXhNKUritbAJL7jpEnlDsiBK+WQCOictgT5cxjoVZj2XNoBQuIB7dWMkpIiaj0P sk6ATolUbfrNfvEAcW+1Ib5TT1uqpCfryjyFd3lPoyHtn5xHZk0zqyInHaEvtzalarkRsNy5jFU HR1blNUmgrXb8hnm1IjO/VVR6nHpHPFpnkWXS+vV3lI63r+FfbZkycMG5gBVfD3TinDLRw8QiW0 W113FXp3n9Wz12182n9u0eUaAOIjacaQ8wA+WBwyhxJF9bNjolmbzhPiP54Sqs1k6Vm8jNIgxo5 K5BA== X-Google-Smtp-Source: AGHT+IH83fA8jRm1gBDT3szyVaCwNqF+aJh9bmpEmtpeu2mCCaq3/OQjsifnggBgdSWRGiUy8IKJ7g== X-Received: by 2002:a05:6000:2b07:b0:3a5:8934:493a with SMTP id ffacd0b85a97d-3b60dd80da6mr229356f8f.44.1752608760450; Tue, 15 Jul 2025 12:46:00 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 08/17] accel: Extract AccelClass definition to 'accel/accel-ops.h' Date: Tue, 15 Jul 2025 21:45:07 +0200 Message-ID: <20250715194516.91722-9-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609955076116600 Only accelerator implementations (and the common accelator code) need to know about AccelClass internals. Move the definition out but forward declare AccelState and AccelClass. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu Reviewed-by: Richard Henderson Message-Id: <20250703173248.44995-39-philmd@linaro.org> --- MAINTAINERS | 2 +- include/accel/accel-ops.h | 49 +++++++++++++++++++++++++++++++++++++ include/qemu/accel.h | 39 ++--------------------------- include/system/hvf_int.h | 3 ++- include/system/kvm_int.h | 1 + accel/accel-common.c | 2 ++ accel/accel-system.c | 1 + accel/hvf/hvf-all.c | 1 + accel/kvm/kvm-all.c | 1 + accel/qtest/qtest.c | 1 + accel/tcg/tcg-accel-ops.c | 1 + accel/tcg/tcg-all.c | 2 ++ accel/xen/xen-all.c | 1 + bsd-user/main.c | 1 + gdbstub/system.c | 1 + linux-user/main.c | 1 + system/memory.c | 1 + target/i386/nvmm/nvmm-all.c | 1 + target/i386/whpx/whpx-all.c | 1 + 19 files changed, 71 insertions(+), 39 deletions(-) create mode 100644 include/accel/accel-ops.h diff --git a/MAINTAINERS b/MAINTAINERS index 0e945f3bd26..9d88c174331 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -502,7 +502,7 @@ F: include/exec/target_long.h F: include/qemu/accel.h F: include/system/accel-*.h F: include/system/cpus.h -F: include/accel/accel-cpu*.h +F: include/accel/accel-*.h F: accel/accel-*.? F: accel/dummy-cpus.? F: accel/Makefile.objs diff --git a/include/accel/accel-ops.h b/include/accel/accel-ops.h new file mode 100644 index 00000000000..86a27c30fa4 --- /dev/null +++ b/include/accel/accel-ops.h @@ -0,0 +1,49 @@ +/* + * Accelerator handlers + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef ACCEL_OPS_H +#define ACCEL_OPS_H + +#include "exec/hwaddr.h" +#include "qemu/accel.h" +#include "qom/object.h" + +struct AccelState { + Object parent_obj; +}; + +struct AccelClass { + ObjectClass parent_class; + + const char *name; + /* Cached by accel_init_ops_interfaces() when created */ + AccelOpsClass *ops; + + int (*init_machine)(AccelState *as, MachineState *ms); + bool (*cpu_common_realize)(CPUState *cpu, Error **errp); + void (*cpu_common_unrealize)(CPUState *cpu); + + /* system related hooks */ + void (*setup_post)(AccelState *as); + void (*pre_resume_vm)(AccelState *as, bool step_pending); + bool (*has_memory)(AccelState *accel, AddressSpace *as, + hwaddr start_addr, hwaddr size); + + /* gdbstub related hooks */ + int (*gdbstub_supported_sstep_flags)(AccelState *as); + + bool *allowed; + /* + * Array of global properties that would be applied when specific + * accelerator is chosen. It works like MachineClass.compat_props + * but it's for accelerators not machines. Accelerator-provided + * global properties may be overridden by machine-type + * compat_props or user-provided global properties. + */ + GPtrArray *compat_props; +}; + +#endif /* ACCEL_OPS_H */ diff --git a/include/qemu/accel.h b/include/qemu/accel.h index 9e821d0faea..d3638c7bfda 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -26,43 +26,8 @@ #include "qom/object.h" #include "exec/hwaddr.h" =20 -struct AccelState { - /*< private >*/ - Object parent_obj; -}; - -typedef struct AccelClass { - /*< private >*/ - ObjectClass parent_class; - /*< public >*/ - - const char *name; - /* Cached by accel_init_ops_interfaces() when created */ - AccelOpsClass *ops; - - int (*init_machine)(AccelState *as, MachineState *ms); - bool (*cpu_common_realize)(CPUState *cpu, Error **errp); - void (*cpu_common_unrealize)(CPUState *cpu); - - /* system related hooks */ - void (*setup_post)(AccelState *as); - void (*pre_resume_vm)(AccelState *as, bool step_pending); - bool (*has_memory)(AccelState *accel, AddressSpace *as, - hwaddr start_addr, hwaddr size); - - /* gdbstub related hooks */ - int (*gdbstub_supported_sstep_flags)(AccelState *as); - - bool *allowed; - /* - * Array of global properties that would be applied when specific - * accelerator is chosen. It works like MachineClass.compat_props - * but it's for accelerators not machines. Accelerator-provided - * global properties may be overridden by machine-type - * compat_props or user-provided global properties. - */ - GPtrArray *compat_props; -} AccelClass; +typedef struct AccelState AccelState; +typedef struct AccelClass AccelClass; =20 #define TYPE_ACCEL "accel" =20 diff --git a/include/system/hvf_int.h b/include/system/hvf_int.h index 5150c7dd9c9..a3b06a3e75b 100644 --- a/include/system/hvf_int.h +++ b/include/system/hvf_int.h @@ -14,6 +14,7 @@ #include "qemu/queue.h" #include "exec/vaddr.h" #include "qom/object.h" +#include "accel/accel-ops.h" =20 #ifdef __aarch64__ #include @@ -45,7 +46,7 @@ typedef struct hvf_vcpu_caps { } hvf_vcpu_caps; =20 struct HVFState { - AccelState parent; + AccelState parent_obj; =20 hvf_slot slots[32]; int num_slots; diff --git a/include/system/kvm_int.h b/include/system/kvm_int.h index 756a3c0a250..9247493b029 100644 --- a/include/system/kvm_int.h +++ b/include/system/kvm_int.h @@ -14,6 +14,7 @@ #include "qemu/accel.h" #include "qemu/queue.h" #include "system/kvm.h" +#include "accel/accel-ops.h" #include "hw/boards.h" #include "hw/i386/topology.h" #include "io/channel-socket.h" diff --git a/accel/accel-common.c b/accel/accel-common.c index 591ff4cbb65..850c5ab4b8e 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -10,7 +10,9 @@ #include "qemu/osdep.h" #include "qemu/accel.h" #include "qemu/target-info.h" +#include "accel/accel-ops.h" #include "accel/accel-cpu.h" +#include "accel/accel-cpu-ops.h" #include "accel-internal.h" =20 /* Lookup AccelClass from opt_name. Returns NULL if not found */ diff --git a/accel/accel-system.c b/accel/accel-system.c index c2a955a6daa..8df561b9539 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -26,6 +26,7 @@ #include "qemu/osdep.h" #include "qemu/accel.h" #include "hw/boards.h" +#include "accel/accel-ops.h" #include "accel/accel-cpu-ops.h" #include "system/cpus.h" #include "qemu/error-report.h" diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 1fa07c8b695..e67a8105a66 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -10,6 +10,7 @@ =20 #include "qemu/osdep.h" #include "qemu/error-report.h" +#include "accel/accel-ops.h" #include "system/address-spaces.h" #include "system/memory.h" #include "system/hvf.h" diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index a106d1ba0f0..659ff881563 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -32,6 +32,7 @@ #include "system/runstate.h" #include "system/cpus.h" #include "system/accel-blocker.h" +#include "accel/accel-ops.h" #include "qemu/bswap.h" #include "exec/tswap.h" #include "system/memory.h" diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index a7fc8bee6dd..1d4337d698e 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -18,6 +18,7 @@ #include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/accel.h" +#include "accel/accel-ops.h" #include "accel/accel-cpu-ops.h" #include "system/qtest.h" #include "system/cpus.h" diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 58ded9d6f0d..3b0d7d298e6 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -26,6 +26,7 @@ */ =20 #include "qemu/osdep.h" +#include "accel/accel-ops.h" #include "accel/accel-cpu-ops.h" #include "system/tcg.h" #include "system/replay.h" diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 5904582a68d..eaeb465dfd5 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -39,6 +39,8 @@ #ifndef CONFIG_USER_ONLY #include "hw/boards.h" #endif +#include "accel/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "accel/tcg/cpu-ops.h" #include "internal-common.h" =20 diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 55a60bb42c2..97377d67d1c 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -19,6 +19,7 @@ #include "chardev/char.h" #include "qemu/accel.h" #include "accel/dummy-cpus.h" +#include "accel/accel-ops.h" #include "accel/accel-cpu-ops.h" #include "system/cpus.h" #include "system/xen.h" diff --git a/bsd-user/main.c b/bsd-user/main.c index d0cc8e0088f..7e5d4bbce09 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -38,6 +38,7 @@ #include "qemu/plugin.h" #include "user/guest-base.h" #include "user/page-protection.h" +#include "accel/accel-ops.h" #include "tcg/startup.h" #include "qemu/timer.h" #include "qemu/envlist.h" diff --git a/gdbstub/system.c b/gdbstub/system.c index 5b6f8d07334..5be0d3c58ce 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -19,6 +19,7 @@ #include "gdbstub/commands.h" #include "exec/hwaddr.h" #include "exec/tb-flush.h" +#include "accel/accel-ops.h" #include "accel/accel-cpu-ops.h" #include "system/cpus.h" #include "system/runstate.h" diff --git a/linux-user/main.c b/linux-user/main.c index f4f20074396..68972f00a15 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -42,6 +42,7 @@ #include "user/page-protection.h" #include "exec/gdbstub.h" #include "gdbstub/user.h" +#include "accel/accel-ops.h" #include "tcg/startup.h" #include "qemu/timer.h" #include "qemu/envlist.h" diff --git a/system/memory.c b/system/memory.c index e8d9b15b28f..0983ff89622 100644 --- a/system/memory.c +++ b/system/memory.c @@ -29,6 +29,7 @@ #include "system/runstate.h" #include "system/tcg.h" #include "qemu/accel.h" +#include "accel/accel-ops.h" #include "hw/boards.h" #include "migration/vmstate.h" #include "system/address-spaces.h" diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c index b4a4d50e860..aab12d77326 100644 --- a/target/i386/nvmm/nvmm-all.c +++ b/target/i386/nvmm/nvmm-all.c @@ -12,6 +12,7 @@ #include "system/address-spaces.h" #include "system/ioport.h" #include "qemu/accel.h" +#include "accel/accel-ops.h" #include "system/nvmm.h" #include "system/cpus.h" #include "system/runstate.h" diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index faf56e19722..10df2d398f7 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -14,6 +14,7 @@ #include "system/ioport.h" #include "gdbstub/helpers.h" #include "qemu/accel.h" +#include "accel/accel-ops.h" #include "system/whpx.h" #include "system/cpus.h" #include "system/runstate.h" --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609374; cv=none; d=zohomail.com; s=zohoarc; b=DaZ9VFufAxrZw876VhfEUEuetB9gRHMSXeD5AW8sbXG2cLCZBYTsJQPQwaK8wF2H0LKmB+7sjpl2NXNTUcJtZhhj3pmeICGJC0UNofjre6k707iJsG6p4HPTIL6HivxG92oVLEGW4f6YIqojfneYGTjnZw+Ar1DA3lBktc95224= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609374; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=IbiqYat6kh5gVkuB+6mqM5XRDlpnNaNJ+QLnyUJ4G1o=; b=UQTbjUKZbPCQMdDIuJssTo4pUsItYCZdmO5D6kqVryDqxq17o5iwwY96AUrAyXQMs8V9WHbjFX84KSdrcrkXiUVYLEYs+s+w8l9/xTlkyCy0QHe0p5Azg4eEpODb27FZlIQAQo5AMWg8onpwWFYNMjroMTLt1KVmG0UDEzyItCE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609374175748.7822195357049; Tue, 15 Jul 2025 12:56:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublkj-00030Y-62; Tue, 15 Jul 2025 15:55: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 1ublbN-0003AX-BF for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:25 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublbL-0002j9-7p for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:09 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3a52874d593so4657758f8f.0 for ; Tue, 15 Jul 2025 12:46:06 -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-3b5e8e1e135sm16018805f8f.72.2025.07.15.12.46.04 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608765; x=1753213565; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=IbiqYat6kh5gVkuB+6mqM5XRDlpnNaNJ+QLnyUJ4G1o=; b=xVzdqQ1jJ0dG6VeNs2ilrOUrIWk4FnYIJsMX5Iu+BzYK7upjXMACKjbSQt8Qr4bMJF BdA9rT53BWfbjEqZo2hD5ZuP9YcvRY/eIT0zGyThp8NChn7Pocj/h7+tjfuZwmyjlBzv uyextj6PyQCrkxhJLLRZ0IpfpHqlcL7zcPECRCXCcaCQxgoqmrBUr5oXEJbxuHwH414K Sre3KJoYOfFQ+oSBM+D3r97mL87NLkSVg2EVSMc0gPOWlGFkWcJhhyrQ5HWCMNAiMyCx 3oNJSOSY1hMuxGO3tkiG1vs0h7NMrHYCbRofPUucdFf333QldV5w2+cDNrnvK53cCk2F VrZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608765; x=1753213565; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IbiqYat6kh5gVkuB+6mqM5XRDlpnNaNJ+QLnyUJ4G1o=; b=BBd/LwlrcYTzs9TcIzqhvyXunVjle2IixfiPQGVhuTBimspi63NjiG3CUjU38UOWFY mhhYwboK7RkjHSBG//Iq+bwNCVhvlGkR0maqZBSaolqgbhlCgpKEKF1ynGs4eGUGJHAa Kz7xoboxxzQFCBSfkOyPjisumLh3e7YoBKNAlUX0zX1Vf+qs41OHhzAv9Xk1JFnE1ykR JomdDXWrJDyUz5g7+HpZnaf2fEVtAQHdxodkvwFlgvVGQjmhgP8FOo4oNPaonUUJoeR9 bldkpPR2C/VpqLptO8cEQwLyemK8QHvE9dHpFlQIUuSHShprXUdQ1PYMWWURy0b4wlLI 4DZQ== X-Gm-Message-State: AOJu0YybiEBuRe2uoc2wNBCbDXDAf4Rjpk5vEpg8cKSrbOZy8qQpVdUn fp9K+aiofOdlTjYjcXs6UfNJbeHoobdH8QTU97KyA2sK6HZd+/IEm2hw6c6bzNt/w+JCNHAgni4 iT+Y+ X-Gm-Gg: ASbGnctNHuLcDcrAAJkAVn5AzpuWltmwsP9V/sbByOI/vRp0BaF508d6lHm3dXHilO8 w/giu6BC4SmmiI9ncxwHw53d9O84uTnUoD7fZVbReGOtZy9ntwMhVkuyyeEW2eN7nkfQDBmHQcO lnkNV0r6m1pqUYP8spsfiKXkLUIyQktSOnJ0tUFbO+m3OzdcIrQ8cI44vPb6vkyes1zw1rjkc60 H/F+Ht4PKa5VEfmHT1tkaGuSo4zcR8c+HPq7Aye9sKxM13PkL63tr6wRvrDRkLrnwyqqSVbAXxs mHTBgmh3lXZLnr+yjfoOw8nt9PLIFTkJQoq5Vc3UjATCE/aTinVO7Ux9NUKlagvQIJpelJ0/4+t GY5A3S7SbRJFvHD4EW5N2Pp4XYRIGmiR772TzR0iUfnfoicNvsIoN0auRjnFIdslvKKIqFsex43 q3rw== X-Google-Smtp-Source: AGHT+IHkIV3rYRWjgbFKcaWuIBuaqVKEbjbJpzB1StG0ubeWMXu8cBfvyhP8D1wkRwxujhGvlJ1XiA== X-Received: by 2002:a05:6000:23c7:b0:3a4:f8fa:8a3a with SMTP id ffacd0b85a97d-3b60dd555b6mr236015f8f.18.1752608765082; Tue, 15 Jul 2025 12:46:05 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 09/17] Revert "accel/tcg: Unregister the RCU before exiting RR thread" Date: Tue, 15 Jul 2025 21:45:08 +0200 Message-ID: <20250715194516.91722-10-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609375927116600 This reverts commit bc93332fe460211c2d2f4ff50e1a0e030c7b5159, which was merged prematurely, re-introducing Coverity CID 1547782 (unreachable code). Reported-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Reviewed-by: Richard Henderson Message-Id: <20250715104015.72663-2-philmd@linaro.org> --- accel/tcg/tcg-accel-ops-rr.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index a578698d071..6eec5c9eee9 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -302,8 +302,6 @@ static void *rr_cpu_thread_fn(void *arg) rr_deal_with_unplugged_cpus(); } =20 - rcu_unregister_thread(); - g_assert_not_reached(); } =20 --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609618; cv=none; d=zohomail.com; s=zohoarc; b=aZIiznVVaSfvnnVf2Obz1lVlLLttorEkNJwsHYHk41foOL1M9RCYp5owjjjCRm1E1HEqF7Ysj5jctiUSpMTu34Eq/e1UE2CYkcW6fz7n1Ln0uQ3cy1+vFc+WQTy7oDRwDNTSl+h2Daq3mx4zER2+VAKz4HEE8x2+ULgwRdZ2wOA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609618; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=Re3potAxZUBbGkfQYWK+Po/V36iY8dmjZb5MVeIPr/Q=; b=kNTthALaa0qyNE6tzgDEnbpFuSH/qFRm99aBFsJ9kt3JrlO/T+RVaS+PjrfCSAJNkt62z53NxazEB3if3gU+EJqoW+id2B+TCBGULMigTOkmahcFM7Z7o10fuDsZi2yj7rvH+W6x8hHLDpsirTUec+MV66M5wrRBgyhFz99Yzyo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609618732901.1125211423068; Tue, 15 Jul 2025 13:00:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubloj-0001zl-Ha; Tue, 15 Jul 2025 15:59:57 -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 1ublbV-0003Be-3n for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:25 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublbR-0002jk-1z for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:15 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-454ac069223so1182605e9.1 for ; Tue, 15 Jul 2025 12:46:11 -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-3b5e8e0d587sm15617278f8f.46.2025.07.15.12.46.08 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608770; x=1753213570; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Re3potAxZUBbGkfQYWK+Po/V36iY8dmjZb5MVeIPr/Q=; b=WXzX5Ak4mCPK6O5eWTIbRYM5XjOES6vqs/iO9iYPYZe2y5OwW5FYvf65gQJanEDon6 duNLAQwOJMTQlMohlJMEjgOIK6nD30+cEtygf5Sjt6S1Rayju8YBLADKL0KKAQ8ZkRYB KvctFGKFf7iczTLD2fdXmex/879di+5dyuyyaEvYseTV6dN2Nw/mH0vLc7dphajgzy8V c/oiXKqJCixnUsUFyjf+B316zR3m6C7IOJ6KqHJebmbcDc8GqBJDwjOp3NmFA6/y4DJe VoSqcQvnHqOraCpN3eLFEKeiASciDULgp7z0vyrHZ2U8xq0ZKkw2IrLLFKoS8zT7wiOX yC0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608770; x=1753213570; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Re3potAxZUBbGkfQYWK+Po/V36iY8dmjZb5MVeIPr/Q=; b=fMvEl8b8PD9RPaTZNAPCmiIiLx7Bg2E5H89BbYfjBwMOVx0L1Hs4rH9Ku+NH6NO4zd R3KHVcjtW8/BdH2CXRToqAq7RMXWQUCfdz/tQVHAUtcv6LNwtIcyJXF/r+Vd61Xb9ceR Xv8n9JGnQfwGCHmkz+uyniPpTScFQsRXYr2ETrBgamOr4d+el1jNmy1zffpzkLf62PtA 6BrEpsAIGBYQAV4OU8MPTR6mq4VX1wp5q5u/NmsOrpE2FL9kqAGwcBlU3OFQyMsRt+iH 6fiTe+yTWjNj6A7KBWRTWS41ZqJAUFNDVWEwNKyuRlh0ji98+fwydxMMTr9VTFwYq901 ub/w== X-Gm-Message-State: AOJu0YyO/5iqzvH+D5BkyydYYpGMAhZctk8N0JD5nHmapTmOzcMuA80i POyVRw27KorqZz0lH/zlg9duazjpQbgYLE/0iENU6atau8CGYy55RP8JZ30PtVeahbzoCJry/qW piA7V X-Gm-Gg: ASbGncsaQl5en9B/PJOpTFZi9LotxWrbiZ0/wRrU5nw1zTdOJxp6ZAZ7SL8d3Lv4KT/ OX6ADms64zt308VVjCViAht1WifMSB/MUj8R3Ar1TtbyDbw0SpRCBzXjdx1CdzZOHkA6po1L3lF zvLqF3L8pY14if4PS8X36XsHggKOadVBbeBJUGipk6B0E3tz3P2cOSijYjb+dMQbRddML0Zz0Ps 92N6lNzfuxo5Y3onuCLhDsCNNUZgLrizk3yRc0VaXbAr1uS37JylkeXUKCbccXrnXLf0NOdtUzr CnHaCt8SfYT1YjusepgIdCqAKE+r8tvE9FP8YfyQtxyqLUEVPcadBUd3ob4HMp40vQ6q0YjYpqC VIlVw0AZQCn4L/e8eQ9PMSnvxseGcqFQo8cmDYF6pq+mvafIgDp9XUz5hCEjSIjABSZvxzt44gc Og1w== X-Google-Smtp-Source: AGHT+IHYQMFg8KPDg8ggcZyqDdFVo+16NEEbRIVOo/Uhfygh7OO4w0bju47/ShuW6sCd7D388AXIBA== X-Received: by 2002:a05:6000:2481:b0:3b5:f8ea:28ff with SMTP id ffacd0b85a97d-3b609520124mr3359245f8f.6.1752608769732; Tue, 15 Jul 2025 12:46:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 10/17] accel/tcg: Extract statistic related code to tcg-stats.c Date: Tue, 15 Jul 2025 21:45:09 +0200 Message-ID: <20250715194516.91722-11-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609620918116600 Statistic code is not specific to system emulation (except cross-page checks) and can be used to analyze user-mode binaries. Extract statistic related code to its own file: tcg-stats.c, keeping the original LGPL-2.1-or-later license tag. Note, this code is not yet reachable by user-mode. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu Reviewed-by: Richard Henderson Message-Id: <20250715140048.84942-3-philmd@linaro.org> --- accel/tcg/monitor.c | 201 --------------------------------------- accel/tcg/tcg-stats.c | 215 ++++++++++++++++++++++++++++++++++++++++++ accel/tcg/meson.build | 1 + 3 files changed, 216 insertions(+), 201 deletions(-) create mode 100644 accel/tcg/tcg-stats.c diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c index 778b12613f4..adb9de5a1c6 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/monitor.c @@ -7,213 +7,12 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/accel.h" -#include "qemu/qht.h" #include "qapi/error.h" #include "qapi/type-helpers.h" #include "qapi/qapi-commands-machine.h" #include "monitor/monitor.h" -#include "system/cpu-timers.h" -#include "exec/icount.h" #include "system/tcg.h" -#include "tcg/tcg.h" #include "internal-common.h" -#include "tb-context.h" -#include - -static void dump_drift_info(GString *buf) -{ - if (!icount_enabled()) { - return; - } - - g_string_append_printf(buf, "Host - Guest clock %"PRIi64" ms\n", - (cpu_get_clock() - icount_get()) / SCALE_MS); - if (icount_align_option) { - g_string_append_printf(buf, "Max guest delay %"PRIi64" ms\n", - -max_delay / SCALE_MS); - g_string_append_printf(buf, "Max guest advance %"PRIi64" ms\n", - max_advance / SCALE_MS); - } else { - g_string_append_printf(buf, "Max guest delay NA\n"); - g_string_append_printf(buf, "Max guest advance NA\n"); - } -} - -static void dump_accel_info(GString *buf) -{ - AccelState *accel =3D current_accel(); - bool one_insn_per_tb =3D object_property_get_bool(OBJECT(accel), - "one-insn-per-tb", - &error_fatal); - - g_string_append_printf(buf, "Accelerator settings:\n"); - g_string_append_printf(buf, "one-insn-per-tb: %s\n\n", - one_insn_per_tb ? "on" : "off"); -} - -static void print_qht_statistics(struct qht_stats hst, GString *buf) -{ - uint32_t hgram_opts; - size_t hgram_bins; - char *hgram; - double avg; - - if (!hst.head_buckets) { - return; - } - g_string_append_printf(buf, "TB hash buckets %zu/%zu " - "(%0.2f%% head buckets used)\n", - hst.used_head_buckets, hst.head_buckets, - (double)hst.used_head_buckets / - hst.head_buckets * 100); - - hgram_opts =3D QDIST_PR_BORDER | QDIST_PR_LABELS; - hgram_opts |=3D QDIST_PR_100X | QDIST_PR_PERCENT; - if (qdist_xmax(&hst.occupancy) - qdist_xmin(&hst.occupancy) =3D=3D 1) { - hgram_opts |=3D QDIST_PR_NODECIMAL; - } - hgram =3D qdist_pr(&hst.occupancy, 10, hgram_opts); - avg =3D qdist_avg(&hst.occupancy); - if (!isnan(avg)) { - g_string_append_printf(buf, "TB hash occupancy " - "%0.2f%% avg chain occ. " - "Histogram: %s\n", - avg * 100, hgram); - } - g_free(hgram); - - hgram_opts =3D QDIST_PR_BORDER | QDIST_PR_LABELS; - hgram_bins =3D qdist_xmax(&hst.chain) - qdist_xmin(&hst.chain); - if (hgram_bins > 10) { - hgram_bins =3D 10; - } else { - hgram_bins =3D 0; - hgram_opts |=3D QDIST_PR_NODECIMAL | QDIST_PR_NOBINRANGE; - } - hgram =3D qdist_pr(&hst.chain, hgram_bins, hgram_opts); - avg =3D qdist_avg(&hst.chain); - if (!isnan(avg)) { - g_string_append_printf(buf, "TB hash avg chain %0.3f buckets. " - "Histogram: %s\n", - avg, hgram); - } - g_free(hgram); -} - -struct tb_tree_stats { - size_t nb_tbs; - size_t host_size; - size_t target_size; - size_t max_target_size; - size_t direct_jmp_count; - size_t direct_jmp2_count; - size_t cross_page; -}; - -static gboolean tb_tree_stats_iter(gpointer key, gpointer value, gpointer = data) -{ - const TranslationBlock *tb =3D value; - struct tb_tree_stats *tst =3D data; - - tst->nb_tbs++; - tst->host_size +=3D tb->tc.size; - tst->target_size +=3D tb->size; - if (tb->size > tst->max_target_size) { - tst->max_target_size =3D tb->size; - } - if (tb->page_addr[1] !=3D -1) { - tst->cross_page++; - } - if (tb->jmp_reset_offset[0] !=3D TB_JMP_OFFSET_INVALID) { - tst->direct_jmp_count++; - if (tb->jmp_reset_offset[1] !=3D TB_JMP_OFFSET_INVALID) { - tst->direct_jmp2_count++; - } - } - return false; -} - -static void tlb_flush_counts(size_t *pfull, size_t *ppart, size_t *pelide) -{ - CPUState *cpu; - size_t full =3D 0, part =3D 0, elide =3D 0; - - CPU_FOREACH(cpu) { - full +=3D qatomic_read(&cpu->neg.tlb.c.full_flush_count); - part +=3D qatomic_read(&cpu->neg.tlb.c.part_flush_count); - elide +=3D qatomic_read(&cpu->neg.tlb.c.elide_flush_count); - } - *pfull =3D full; - *ppart =3D part; - *pelide =3D elide; -} - -static void tcg_dump_flush_info(GString *buf) -{ - size_t flush_full, flush_part, flush_elide; - - g_string_append_printf(buf, "TB flush count %u\n", - qatomic_read(&tb_ctx.tb_flush_count)); - g_string_append_printf(buf, "TB invalidate count %u\n", - qatomic_read(&tb_ctx.tb_phys_invalidate_count)); - - tlb_flush_counts(&flush_full, &flush_part, &flush_elide); - g_string_append_printf(buf, "TLB full flushes %zu\n", flush_full); - g_string_append_printf(buf, "TLB partial flushes %zu\n", flush_part); - g_string_append_printf(buf, "TLB elided flushes %zu\n", flush_elide); -} - -static void dump_exec_info(GString *buf) -{ - struct tb_tree_stats tst =3D {}; - struct qht_stats hst; - size_t nb_tbs; - - tcg_tb_foreach(tb_tree_stats_iter, &tst); - nb_tbs =3D tst.nb_tbs; - /* XXX: avoid using doubles ? */ - g_string_append_printf(buf, "Translation buffer state:\n"); - /* - * Report total code size including the padding and TB structs; - * otherwise users might think "-accel tcg,tb-size" is not honoured. - * For avg host size we use the precise numbers from tb_tree_stats tho= ugh. - */ - g_string_append_printf(buf, "gen code size %zu/%zu\n", - tcg_code_size(), tcg_code_capacity()); - g_string_append_printf(buf, "TB count %zu\n", nb_tbs); - g_string_append_printf(buf, "TB avg target size %zu max=3D%zu bytes\n= ", - nb_tbs ? tst.target_size / nb_tbs : 0, - tst.max_target_size); - g_string_append_printf(buf, "TB avg host size %zu bytes " - "(expansion ratio: %0.1f)\n", - nb_tbs ? tst.host_size / nb_tbs : 0, - tst.target_size ? - (double)tst.host_size / tst.target_size : 0); - g_string_append_printf(buf, "cross page TB count %zu (%zu%%)\n", - tst.cross_page, - nb_tbs ? (tst.cross_page * 100) / nb_tbs : 0); - g_string_append_printf(buf, "direct jump count %zu (%zu%%) " - "(2 jumps=3D%zu %zu%%)\n", - tst.direct_jmp_count, - nb_tbs ? (tst.direct_jmp_count * 100) / nb_tbs = : 0, - tst.direct_jmp2_count, - nb_tbs ? (tst.direct_jmp2_count * 100) / nb_tbs= : 0); - - qht_statistics_init(&tb_ctx.htable, &hst); - print_qht_statistics(hst, buf); - qht_statistics_destroy(&hst); - - g_string_append_printf(buf, "\nStatistics:\n"); - tcg_dump_flush_info(buf); -} - -void tcg_dump_stats(GString *buf) -{ - dump_accel_info(buf); - dump_exec_info(buf); - dump_drift_info(buf); -} =20 HumanReadableText *qmp_x_query_jit(Error **errp) { diff --git a/accel/tcg/tcg-stats.c b/accel/tcg/tcg-stats.c new file mode 100644 index 00000000000..eb6e20ae985 --- /dev/null +++ b/accel/tcg/tcg-stats.c @@ -0,0 +1,215 @@ +/* + * SPDX-License-Identifier: LGPL-2.1-or-later + * + * QEMU TCG statistics + * + * Copyright (c) 2003-2005 Fabrice Bellard + */ + +#include "qemu/osdep.h" +#include "qemu/accel.h" +#include "qemu/qht.h" +#include "qapi/error.h" +#include "system/cpu-timers.h" +#include "exec/icount.h" +#include "hw/core/cpu.h" +#include "tcg/tcg.h" +#include "internal-common.h" +#include "tb-context.h" +#include + +static void dump_drift_info(GString *buf) +{ + if (!icount_enabled()) { + return; + } + + g_string_append_printf(buf, "Host - Guest clock %"PRIi64" ms\n", + (cpu_get_clock() - icount_get()) / SCALE_MS); + if (icount_align_option) { + g_string_append_printf(buf, "Max guest delay %"PRIi64" ms\n", + -max_delay / SCALE_MS); + g_string_append_printf(buf, "Max guest advance %"PRIi64" ms\n", + max_advance / SCALE_MS); + } else { + g_string_append_printf(buf, "Max guest delay NA\n"); + g_string_append_printf(buf, "Max guest advance NA\n"); + } +} + +static void dump_accel_info(GString *buf) +{ + AccelState *accel =3D current_accel(); + bool one_insn_per_tb =3D object_property_get_bool(OBJECT(accel), + "one-insn-per-tb", + &error_fatal); + + g_string_append_printf(buf, "Accelerator settings:\n"); + g_string_append_printf(buf, "one-insn-per-tb: %s\n\n", + one_insn_per_tb ? "on" : "off"); +} + +static void print_qht_statistics(struct qht_stats hst, GString *buf) +{ + uint32_t hgram_opts; + size_t hgram_bins; + char *hgram; + double avg; + + if (!hst.head_buckets) { + return; + } + g_string_append_printf(buf, "TB hash buckets %zu/%zu " + "(%0.2f%% head buckets used)\n", + hst.used_head_buckets, hst.head_buckets, + (double)hst.used_head_buckets / + hst.head_buckets * 100); + + hgram_opts =3D QDIST_PR_BORDER | QDIST_PR_LABELS; + hgram_opts |=3D QDIST_PR_100X | QDIST_PR_PERCENT; + if (qdist_xmax(&hst.occupancy) - qdist_xmin(&hst.occupancy) =3D=3D 1) { + hgram_opts |=3D QDIST_PR_NODECIMAL; + } + hgram =3D qdist_pr(&hst.occupancy, 10, hgram_opts); + avg =3D qdist_avg(&hst.occupancy); + if (!isnan(avg)) { + g_string_append_printf(buf, "TB hash occupancy " + "%0.2f%% avg chain occ. " + "Histogram: %s\n", + avg * 100, hgram); + } + g_free(hgram); + + hgram_opts =3D QDIST_PR_BORDER | QDIST_PR_LABELS; + hgram_bins =3D qdist_xmax(&hst.chain) - qdist_xmin(&hst.chain); + if (hgram_bins > 10) { + hgram_bins =3D 10; + } else { + hgram_bins =3D 0; + hgram_opts |=3D QDIST_PR_NODECIMAL | QDIST_PR_NOBINRANGE; + } + hgram =3D qdist_pr(&hst.chain, hgram_bins, hgram_opts); + avg =3D qdist_avg(&hst.chain); + if (!isnan(avg)) { + g_string_append_printf(buf, "TB hash avg chain %0.3f buckets. " + "Histogram: %s\n", + avg, hgram); + } + g_free(hgram); +} + +struct tb_tree_stats { + size_t nb_tbs; + size_t host_size; + size_t target_size; + size_t max_target_size; + size_t direct_jmp_count; + size_t direct_jmp2_count; + size_t cross_page; +}; + +static gboolean tb_tree_stats_iter(gpointer key, gpointer value, gpointer = data) +{ + const TranslationBlock *tb =3D value; + struct tb_tree_stats *tst =3D data; + + tst->nb_tbs++; + tst->host_size +=3D tb->tc.size; + tst->target_size +=3D tb->size; + if (tb->size > tst->max_target_size) { + tst->max_target_size =3D tb->size; + } +#ifndef CONFIG_USER_ONLY + if (tb->page_addr[1] !=3D -1) { + tst->cross_page++; + } +#endif + if (tb->jmp_reset_offset[0] !=3D TB_JMP_OFFSET_INVALID) { + tst->direct_jmp_count++; + if (tb->jmp_reset_offset[1] !=3D TB_JMP_OFFSET_INVALID) { + tst->direct_jmp2_count++; + } + } + return false; +} + +static void tlb_flush_counts(size_t *pfull, size_t *ppart, size_t *pelide) +{ + CPUState *cpu; + size_t full =3D 0, part =3D 0, elide =3D 0; + + CPU_FOREACH(cpu) { + full +=3D qatomic_read(&cpu->neg.tlb.c.full_flush_count); + part +=3D qatomic_read(&cpu->neg.tlb.c.part_flush_count); + elide +=3D qatomic_read(&cpu->neg.tlb.c.elide_flush_count); + } + *pfull =3D full; + *ppart =3D part; + *pelide =3D elide; +} + +static void tcg_dump_flush_info(GString *buf) +{ + size_t flush_full, flush_part, flush_elide; + + g_string_append_printf(buf, "TB flush count %u\n", + qatomic_read(&tb_ctx.tb_flush_count)); + g_string_append_printf(buf, "TB invalidate count %u\n", + qatomic_read(&tb_ctx.tb_phys_invalidate_count)); + + tlb_flush_counts(&flush_full, &flush_part, &flush_elide); + g_string_append_printf(buf, "TLB full flushes %zu\n", flush_full); + g_string_append_printf(buf, "TLB partial flushes %zu\n", flush_part); + g_string_append_printf(buf, "TLB elided flushes %zu\n", flush_elide); +} + +static void dump_exec_info(GString *buf) +{ + struct tb_tree_stats tst =3D {}; + struct qht_stats hst; + size_t nb_tbs; + + tcg_tb_foreach(tb_tree_stats_iter, &tst); + nb_tbs =3D tst.nb_tbs; + /* XXX: avoid using doubles ? */ + g_string_append_printf(buf, "Translation buffer state:\n"); + /* + * Report total code size including the padding and TB structs; + * otherwise users might think "-accel tcg,tb-size" is not honoured. + * For avg host size we use the precise numbers from tb_tree_stats tho= ugh. + */ + g_string_append_printf(buf, "gen code size %zu/%zu\n", + tcg_code_size(), tcg_code_capacity()); + g_string_append_printf(buf, "TB count %zu\n", nb_tbs); + g_string_append_printf(buf, "TB avg target size %zu max=3D%zu bytes\n= ", + nb_tbs ? tst.target_size / nb_tbs : 0, + tst.max_target_size); + g_string_append_printf(buf, "TB avg host size %zu bytes " + "(expansion ratio: %0.1f)\n", + nb_tbs ? tst.host_size / nb_tbs : 0, + tst.target_size ? + (double)tst.host_size / tst.target_size : 0); + g_string_append_printf(buf, "cross page TB count %zu (%zu%%)\n", + tst.cross_page, + nb_tbs ? (tst.cross_page * 100) / nb_tbs : 0); + g_string_append_printf(buf, "direct jump count %zu (%zu%%) " + "(2 jumps=3D%zu %zu%%)\n", + tst.direct_jmp_count, + nb_tbs ? (tst.direct_jmp_count * 100) / nb_tbs = : 0, + tst.direct_jmp2_count, + nb_tbs ? (tst.direct_jmp2_count * 100) / nb_tbs= : 0); + + qht_statistics_init(&tb_ctx.htable, &hst); + print_qht_statistics(hst, buf); + qht_statistics_destroy(&hst); + + g_string_append_printf(buf, "\nStatistics:\n"); + tcg_dump_flush_info(buf); +} + +void tcg_dump_stats(GString *buf) +{ + dump_accel_info(buf); + dump_exec_info(buf); + dump_drift_info(buf); +} diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index 575e92bb9e8..002aa8f4588 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -11,6 +11,7 @@ tcg_ss.add(files( 'tcg-runtime-gvec.c', 'tb-maint.c', 'tcg-all.c', + 'tcg-stats.c', 'translate-all.c', 'translator.c', )) --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609632; cv=none; d=zohomail.com; s=zohoarc; b=Ag14DVltmoeuUvAlww+slNMtgabPk93CUgn/WSsQTzKCYQ86dObLj/EelWpgx1Ziur7vcyQ8JdoTEtrUgYZTCQsyI8d02FEwVFUw3FUVHAH1CS9s8JnCoL+bY1jSfWII0Q05HoBayTLodDBeAzPtO7gCbzXaMMxayeLX2loFXtk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609632; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=Er3wPoXaq/J9uxhbCCA2Xu9PBj7t0/pTGh9dFM7WpXI=; b=n8FGmQhe+Kk16KJf/vAaYotM7nor4w4fst3PcR3jjOGgsvw8j2WPiQ9ad7lGWAS7bj8UhhPiL7xCXr5PDSw7xpSFk3VlqRu7UG1ojNuwLSlLISFvWZQ1t9gZLcdrFthlwoiERVUlIvY74Y9MaxDB4DcRvRuKycIMy0QE6JICzFs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 175260963213086.2547227885749; Tue, 15 Jul 2025 13:00:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubloo-0002O4-Ep; Tue, 15 Jul 2025 16:00:02 -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 1ublbb-0003Dj-6D for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:36 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublbU-0002k9-Tv for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:20 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-455fddfa2c3so36141855e9.2 for ; Tue, 15 Jul 2025 12:46:15 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454d5050d34sm211840735e9.9.2025.07.15.12.46.13 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608774; x=1753213574; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Er3wPoXaq/J9uxhbCCA2Xu9PBj7t0/pTGh9dFM7WpXI=; b=NXcFnUsnhgUikRBqeIa8YGwHKbudJCMrqQF5BLkKOpOdhMIVWoocrTTuFFDg5Ux+TW eipTilYNbbeqtQuOwENVVtHkCIQjffsv9/+6qjVNlfdPDgO9nQ5HdwS/xHB0EWtlVjGm aX8Oji+4Gar4gFlGqVn9RKPlMXrD1iMTDeCL5pJmzFdl2BdfZLH8hAx+2QR+wt1YWpLz bmichXVOhyqMwMZ93VWJ5LEnAzO60KmgYGfUb5wKwm1S1OnNGuQGVnhVg2W/eHtM9KG3 CV8/2N0jmp55q2AQl8hZESrDNoWIuwtAKpmpAyGl6yUTofHYPqRWdSNOFq1BrN4sgBEm Kb3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608774; x=1753213574; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Er3wPoXaq/J9uxhbCCA2Xu9PBj7t0/pTGh9dFM7WpXI=; b=lsV71t1/Sf5eVtgjMY9O0H+Xg6XR+ApKubb1281MHwqXP81azxtB7joEZob/ugIINx v2EmUuRjarXG9EqrngHNELdSidYosp1RPT/ajrKgZTFRByhqdW1nDrb3nTnWJvMlTtMR moEVDBb4j6cR+Fny+jADIegucr4hd+h5N5qN6lEifNAjXdTpoiaEHQQj+6Jx/LcmBSXQ AmiJ5JH271j7Gr3Y756e8vN2WpdhbIjU0fq0KFVmGb5r/RRlkt732Rx6zfMl79ohShPM FalowkAnWq9blBS/sCHqRr3P9X+wzF3Ga8FhN4KsEK8oof+X8BFd2k27wL9UnaeR0Z3z KGxg== X-Gm-Message-State: AOJu0YwTgDQ8SO0pCr0QaDpO0DnD2/dKHb1bHaAwfmEhS5HMvBT4Kqnn iIWB13BF+KYic1BbgUKFebpnTDRPh18advpd9idbzFcE8yl22vkpNIYYrIkK071GAbeif2jiuXV KOi/I X-Gm-Gg: ASbGncv73GYgVo88ufHQqVN19Nq/qPnT0/AXl3883v68dmjqUinclt0ueiP51uS5dZ6 wr4qCx7L1EamCY6SiK5xx8NLRU+kwY7YsCSgg7k1/yUEY0QOurbqHoEL/60KXq3zi8mSJ2Tkt2f eNHe7WOz9YjROadCyUlhp5vtlHqRDsMc46LxCSQ57hNA2gd5Y7YDEESdtgRaO2ZF91rhBpBqVW1 8yrfSB1R69CL2OzD24/78N4ZVuSTVJortlC5YZ/koftkmJI/T49qznaVpxNJEQbwuFlN2ZPW1vC Mn8ih0tLksf0K9PurWPzSk/bt2W+o3MOM5gz5odIy1wFyhOwl1LUbnSt1xw63ZAv+ahlZJZL4fh 9X1X8xyBsY8cLPNJRwAJoWdPd/nuSIg82irWfEYiV3DprUw7UVEiklsDO7kkFGMfCSoEi+6VtoU Nllg== X-Google-Smtp-Source: AGHT+IG701mS12Jj5cAms28UWCl7snrD2WhapM0GNRAgJZTilUYiq4aMUrCm72HyQFLlzoHqXgOqRw== X-Received: by 2002:a05:600c:c042:b0:43d:745a:5a50 with SMTP id 5b1f17b1804b1-4562e5893f7mr95335e9.19.1752608774344; Tue, 15 Jul 2025 12:46:14 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 11/17] accel/system: Introduce @x-accel-stats QMP command Date: Tue, 15 Jul 2025 21:45:10 +0200 Message-ID: <20250715194516.91722-12-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609632607116600 Unstable QMP 'x-accel-stats' dispatches to the AccelOpsClass::get_stats() and get_vcpu_stats() handlers. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Markus Armbruster Reviewed-by: Zhao Liu Message-Id: <20250715140048.84942-4-philmd@linaro.org> --- qapi/accelerator.json | 17 +++++++++++++++++ include/accel/accel-cpu-ops.h | 3 +++ include/accel/accel-ops.h | 2 ++ accel/accel-qmp.c | 35 +++++++++++++++++++++++++++++++++++ accel/accel-system.c | 1 + accel/meson.build | 2 +- 6 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 accel/accel-qmp.c diff --git a/qapi/accelerator.json b/qapi/accelerator.json index d55fe1aa0a3..6029e7307a7 100644 --- a/qapi/accelerator.json +++ b/qapi/accelerator.json @@ -37,3 +37,20 @@ # <- { "return": { "enabled": true, "present": true } } ## { 'command': 'query-kvm', 'returns': 'KvmInfo' } + +## +# @x-accel-stats: +# +# Query accelerator statistics +# +# Features: +# +# @unstable: This command is meant for debugging. +# +# Returns: accelerator statistics +# +# Since: 10.1 +## +{ 'command': 'x-accel-stats', + 'returns': 'HumanReadableText', + 'features': [ 'unstable' ] } diff --git a/include/accel/accel-cpu-ops.h b/include/accel/accel-cpu-ops.h index a9191dded7e..0674764914f 100644 --- a/include/accel/accel-cpu-ops.h +++ b/include/accel/accel-cpu-ops.h @@ -65,6 +65,9 @@ struct AccelOpsClass { /* handle_interrupt is mandatory. */ void (*handle_interrupt)(CPUState *cpu, int mask); =20 + /* get_vcpu_stats: Append statistics of this @cpu to @buf */ + void (*get_vcpu_stats)(CPUState *cpu, GString *buf); + /** * @get_virtual_clock: fetch virtual clock * @set_virtual_clock: set virtual clock diff --git a/include/accel/accel-ops.h b/include/accel/accel-ops.h index 86a27c30fa4..23a8c246e15 100644 --- a/include/accel/accel-ops.h +++ b/include/accel/accel-ops.h @@ -25,6 +25,8 @@ struct AccelClass { int (*init_machine)(AccelState *as, MachineState *ms); bool (*cpu_common_realize)(CPUState *cpu, Error **errp); void (*cpu_common_unrealize)(CPUState *cpu); + /* get_stats: Append statistics to @buf */ + void (*get_stats)(AccelState *as, GString *buf); =20 /* system related hooks */ void (*setup_post)(AccelState *as); diff --git a/accel/accel-qmp.c b/accel/accel-qmp.c new file mode 100644 index 00000000000..5fb70c6631f --- /dev/null +++ b/accel/accel-qmp.c @@ -0,0 +1,35 @@ +/* + * QMP commands related to accelerators + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/accel.h" +#include "qapi/type-helpers.h" +#include "qapi/qapi-commands-accelerator.h" +#include "accel/accel-ops.h" +#include "accel/accel-cpu-ops.h" +#include "hw/core/cpu.h" + +HumanReadableText *qmp_x_accel_stats(Error **errp) +{ + AccelState *accel =3D current_accel(); + AccelClass *acc =3D ACCEL_GET_CLASS(accel); + g_autoptr(GString) buf =3D g_string_new(""); + + if (acc->get_stats) { + acc->get_stats(accel, buf); + } + if (acc->ops->get_vcpu_stats) { + CPUState *cpu; + + CPU_FOREACH(cpu) { + acc->ops->get_vcpu_stats(cpu, buf); + } + } + + return human_readable_text_from_str(buf); +} diff --git a/accel/accel-system.c b/accel/accel-system.c index 8df561b9539..76cf4e7ef7a 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -26,6 +26,7 @@ #include "qemu/osdep.h" #include "qemu/accel.h" #include "hw/boards.h" +#include "hw/core/cpu.h" #include "accel/accel-ops.h" #include "accel/accel-cpu-ops.h" #include "system/cpus.h" diff --git a/accel/meson.build b/accel/meson.build index 52909314bfa..25b0f100b51 100644 --- a/accel/meson.build +++ b/accel/meson.build @@ -1,6 +1,6 @@ common_ss.add(files('accel-common.c')) specific_ss.add(files('accel-target.c')) -system_ss.add(files('accel-system.c', 'accel-blocker.c')) +system_ss.add(files('accel-system.c', 'accel-blocker.c', 'accel-qmp.c')) user_ss.add(files('accel-user.c')) =20 subdir('tcg') --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609494; cv=none; d=zohomail.com; s=zohoarc; b=Woj9xL555dpj0wPZTDySXIKHZpHGfsr4YLqhcqCa52ayYXL5AxOW8YlNsGOqhrQelGdpE4oMJPkwVeeh53E1REsFBlDyEvbShlv2IZtSU9jWNsMP010TSVMjn0Z3D3n/jxrYYLadidLIaNcTaeCd+HA5eVTlB37DvIKE7bRrDCY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609494; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=cw+NX1Z/I/vv+7/l6bBturm2d7SORqaw9ensm0XSezs=; b=c48iroPU9pu/FaaJgD5coFUdBuQMzLasX+RqJ+8eOTjTR5icKzM6tA10eUD+nJbzi+UQIxnB/SdAD/IMyfiCrOFuMWHymSopwyH38NZYBUb3na9CXDwXyGepdmc1fpvf2b9jTVxc3xQFJ5xn5WkfZ2po+hxrkKTjJCED8mXWqZM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609494513665.4242489640857; Tue, 15 Jul 2025 12:58:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublkl-00036A-Bi; Tue, 15 Jul 2025 15:55:51 -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 1ublbe-0003EU-SB for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:36 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublba-0002kT-Ve for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:26 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3a50956e5d3so4471501f8f.1 for ; Tue, 15 Jul 2025 12:46:20 -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-3b5e8e26ff9sm15888292f8f.93.2025.07.15.12.46.18 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608779; x=1753213579; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=cw+NX1Z/I/vv+7/l6bBturm2d7SORqaw9ensm0XSezs=; b=m0kUrvRCk+r6u1d7mu+zS2IaVylrF+K8PFLLNFAbj26OO1x28+pZwnq/GEv4A7BIdy tgyEzHmTdfMrHCj95GQx+/i9A2KwVIL0OllX3U/rSkw1cGP2I1gjJloODmODySZ3vvxE ZKfew27rgIeShi5H4xWYirOgMP1QjzeBvOnSdOEpTm3wXj2rUf2UkHDZz7GUonXy6Yqn Lukl93Y6fMtunLtFdnzHAF4cMgLN+9FkPd7JUTuaDsu6JtAwVrxoLf5t9yYdn67cVTbq WFEr6Lv6A/H05MBNJByZ6KymO6fiOBir9XR+ba3VqfE/k61FD9Anvl7oulK5e8h10hBI hPWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608779; x=1753213579; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cw+NX1Z/I/vv+7/l6bBturm2d7SORqaw9ensm0XSezs=; b=q4BacjzGuYrkTDgDqGNEyKcwrm8oT8vp/vfpNMpEb/eACToug+xEl875tR6mf8+HWM Fqpk8BKhFh6rnNtPptg1qlvWGEX+Rsmy3IKvku7sadXlhgczOfhw/LR6Vsa/SjROTGdZ DMGJ+rWVdWO2Osvd2oivOSRLt2Nd7Q6z7grDJqmNQV0wCx++uhbWp9yzuzrduihDvbfI JIQTKB/oCno1azyp/xSGQ1/Cxg+G3R5iKN0xH7AjSQtA7GuqM0raMQj8eDtiffuZMfs3 N/N4RsTrVtmFI9NWLtGKIYIixNRylYHommuM+mOlewDqLxv79wzibDeC8xZ8G9HEEvm0 kKKQ== X-Gm-Message-State: AOJu0YxozMefvX9Spb5d7tPF7L+wPmfgS+DD8pOPIPjvCN2TRir5hudS PzC7xEdJoYikZEjFYoTkGeM4LW4aq3asb6bhm7YTR2Pi6EMFlNNLySZemYmE1juA1gAuBpafs5S aFIVZ X-Gm-Gg: ASbGncuvizSJx5kLKUS3w9H4qfvBy1NVikVcl09h+IkkmPN9VYATWvtvEsgi5aOt3jD mtKcnwh7JtgaevlJFY7rUSYxPwDIk1+k7LPXwUjgN67zHzV5SDVpNczRQIy4pwR6F/MOreqSw7b xWQ01d54Ugp0OXUoPq0lv+xqLfwFnhnvxiu0Rx/itpWgMiwcOR1h+lpL4mq1tW7vt1xAaANd8dA 8picKQ+iU2j7g20IoNbQdAjBfk8pYLSPZ4c81KQiD3D/ZEof7z/NnRIII6Dy9lQsgrty0PMAGFj 5G9x0QvPYYzKC5zSsktuWWpE0I4BEgzQOslBQXMZL1iXw+Qdi1LvFS1kHu/J67Ee5tUiMzMCrKr ZI2hixSB4ZVP+6MRsACIYnLX7p29gHi3YOOr4+3oOc/WV8ZOtLRYGN09dFqzwoVt2Myf/SxIw9B PTKg== X-Google-Smtp-Source: AGHT+IGL1XsWJVBdOttFgS3/lIZFENeG4hW/CfZeJ9Cvt3cOXuMW28tizllZNBLNh0ot7WqjiiZEyw== X-Received: by 2002:a05:6000:4911:b0:3b5:db54:c68e with SMTP id ffacd0b85a97d-3b60dd4aa3dmr365961f8f.9.1752608778921; Tue, 15 Jul 2025 12:46:18 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 12/17] accel/system: Add 'info accel' on human monitor Date: Tue, 15 Jul 2025 21:45:11 +0200 Message-ID: <20250715194516.91722-13-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609495025116600 'info accel' dispatches to the AccelOpsClass::get_stats() and get_vcpu_stats() handlers. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Richard Henderson Reviewed-by: Pierrick Bouvier Message-Id: <20250715140048.84942-5-philmd@linaro.org> --- accel/accel-system.c | 8 ++++++++ hmp-commands-info.hx | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/accel/accel-system.c b/accel/accel-system.c index 76cf4e7ef7a..1e97c64fdca 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -25,6 +25,8 @@ =20 #include "qemu/osdep.h" #include "qemu/accel.h" +#include "qapi/qapi-commands-accelerator.h" +#include "monitor/monitor.h" #include "hw/boards.h" #include "hw/core/cpu.h" #include "accel/accel-ops.h" @@ -103,11 +105,17 @@ void accel_init_ops_interfaces(AccelClass *ac) cpus_register_accel(ops); } =20 +static void accel_ops_class_init(ObjectClass *oc, const void *data) +{ + monitor_register_hmp_info_hrt("accel", qmp_x_accel_stats); +} + static const TypeInfo accel_ops_type_info =3D { .name =3D TYPE_ACCEL_OPS, .parent =3D TYPE_OBJECT, .abstract =3D true, .class_size =3D sizeof(AccelOpsClass), + .class_init =3D accel_ops_class_init, }; =20 static void accel_system_register_types(void) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index d7979222752..6142f60e7b1 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -267,6 +267,18 @@ ERST .cmd =3D hmp_info_sync_profile, }, =20 + { + .name =3D "accel", + .args_type =3D "", + .params =3D "", + .help =3D "show accelerator info", + }, + +SRST + ``info accel`` + Show accelerator info. +ERST + SRST ``info sync-profile [-m|-n]`` [*max*] Show synchronization profiling info, up to *max* entries (default: 10), --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609389; cv=none; d=zohomail.com; s=zohoarc; b=II9sOxDxUBt3jRCYHKM+r8n3CevRp/u3R+eYB/9wf5tbfFhBB7YX3a6nSI+9kCQsiHqVQPPjmDmg90J9Ahrp3YC6HuUnTV5n0xAkd+cnWVgvFQj4Sr/OXQI2zfNUCHmTnhyGvr367wRyAdq761luvcXu0sFiqWw/C0DPJNozHLs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609389; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=GetABoj100DJUi/hV9HckckiDTBWpey47wgWH7b+5xs=; b=eqDZcvXAfJVZxisbJ+pjTDfeb5gOSyF8IF/AGd8DiSzYJkztu5ywvqMrujrnwXrtrnFap3a9t0RokmmV0fCASFV9A7u09UgYtjmsAgejO4GTcW1d5VIqnjt4NjyYtYlvjeVk763rwCfSiWD13SJM890sMM+TOQvmB1LD965XaY4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609389019535.1476591567176; Tue, 15 Jul 2025 12:56:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubll7-0003h2-4h; Tue, 15 Jul 2025 15:56:13 -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 1ublbf-0003EZ-GP for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:36 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublbd-0002ku-Qz for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:27 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-454ac069223so1183515e9.1 for ; Tue, 15 Jul 2025 12:46:25 -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-3b5e8e1e285sm15668405f8f.76.2025.07.15.12.46.22 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608784; x=1753213584; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=GetABoj100DJUi/hV9HckckiDTBWpey47wgWH7b+5xs=; b=PMhwoJ+XyiRp//oBhLgLjyiR/WD/4mSp+G9hw5t6k7+7YJu9lcvANnRxU+pto1wyTZ tnIPyauzYoJ+69eh3RNX8s9wYIFCGaET5E9xcIWF4zgKSo6JOCeCF89En3z9HiyHeg0S zC7UT25gq145GdTj4vbwsqmc/Un5UECbL9+w+MNs7bi2Tj47k/3fensFrAJkG5+hWYaI xZDiom4b9oZrhTmvUCFOH2xizeNkVBjhtPmwXiy1d+yPwNsxoY0kgCJhzS3z59+eL+sT 7oyAkeYs7qplpMeJ0wdCqaIsSioIot0WkM1eBDU2aJ0xgfS8XvGoc2uxEnoqEjkaEbSc GGjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608784; x=1753213584; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GetABoj100DJUi/hV9HckckiDTBWpey47wgWH7b+5xs=; b=dPswQrZYzD5DB0iHnIGay/TN4rjUIMDLvMHwy3kNHrRCrgHqhNgrjjhbCbH8zlGDms jPYfef/7d1skRzAxnmTgFRdmXVtyglBwcrBqI0WweAzsjbgUsWhFI6ffy+AKjj9e4cd9 vOqTXBr52LHSl8Z5sNH5G8HGrbDFgHx2NPgM0CNAFS9ghwRpJVs4ivR3OfQYloeyVbzG aHVkQvyIrbnEOL1Q3hEp/yTxO0GQ7gokpM2Okl/8kjuHZla1Qxv2xhMnRYt2j4GTtPzA LkHY0xkwuOFH1nAgaduv0Ujcb7AVSY7XCFaditRD4WfDUteHxUY1tpYHZ1UGye5StnTN gJ2A== X-Gm-Message-State: AOJu0YznH6nn8/snLvHBalDBZWNJ7mYZ53iwcPZho3I/gDY7X+7NHAWn MtxYQipdXzJBngnl3cXl/Jl2WW4MgBr+0tC97OLtKHmxq+iGiZ+hntANALSGfDl+s7nI1rWdZhZ kRhLo X-Gm-Gg: ASbGncv5tFXNP/8fub0dfF1L2fXyYh9wIxJoYrwvSWH5BRMWMWDuFXGuMtKqaabCsQn Vzmb05y+k5AzRbr+9k64/qc+Y7VKJE10EWmTKyo2jKi6l1ZAmtXT15Qp9cKzwY6sOKJzaw9zDHy ySWPOcZkN2c/7VJXIf1gjC0Arl5fP1AwDYkmnfkAhbzh/BOapB3QdRAzuFheagh54eWPukafPYn /1fVbups3N8E91k4ebOEaDFJ1paAUh57S78vDz8Bcb5VR7tNhAHq/oRJJnC8kP/djtWt6FMjkGM gxT2wL6W4jnHT3p676zwqFlrquZD1IwuMekxF8/MccnGeXKx7yoDn+9MUAIxwkjCUJpms6seKNh XhQkZuMbJxkFrfCl36cxUUU+b2Xjhu8G9QVLebwBtjlo09jlWuFagbWb1zi9U+AHWonzFZn3WUx f8Cg== X-Google-Smtp-Source: AGHT+IHVEGtlFTjp0loZiZv6Oaz9AXpjpHjXQcQ+WDbKsSn9fYmf4s/FeSF8CGdRHlecLWEfnt9Ldw== X-Received: by 2002:a05:600c:3515:b0:456:f22:ca49 with SMTP id 5b1f17b1804b1-45625dbd3c5mr45656925e9.0.1752608783647; Tue, 15 Jul 2025 12:46:23 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 13/17] accel/tcg: Propagate AccelState to dump_accel_info() Date: Tue, 15 Jul 2025 21:45:12 +0200 Message-ID: <20250715194516.91722-14-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609390426116600 Declare tcg_dump_stats() in "tcg/tcg.h" so it can be used out of accel/tcg/, like by {bsd,linux}-user. Next commit will register the TCG AccelClass::get_stats handler, which expects a AccelState, so propagate it to dump_accel_info(). Reviewed-by: Manos Pitsidianakis Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20250715140048.84942-6-philmd@linaro.org> --- accel/tcg/internal-common.h | 2 -- include/tcg/tcg.h | 2 ++ accel/tcg/monitor.c | 1 + accel/tcg/tcg-stats.c | 5 ++--- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index 77a3a0684a5..1dbc45dd955 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -139,6 +139,4 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr= _t retaddr); void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr); void tb_set_jmp_target(TranslationBlock *tb, int n, uintptr_t addr); =20 -void tcg_dump_stats(GString *buf); - #endif diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 0c2a319c11d..a6d9aa50d47 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -1005,5 +1005,7 @@ static inline const TCGOpcode *tcg_swap_vecop_list(co= nst TCGOpcode *n) =20 bool tcg_can_emit_vecop_list(const TCGOpcode *, TCGType, unsigned); void tcg_dump_ops(TCGContext *s, FILE *f, bool have_prefs); +/* tcg_dump_stats: Append TCG statistics to @buf */ +void tcg_dump_stats(GString *buf); =20 #endif /* TCG_H */ diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c index adb9de5a1c6..be5c1950177 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/monitor.c @@ -12,6 +12,7 @@ #include "qapi/qapi-commands-machine.h" #include "monitor/monitor.h" #include "system/tcg.h" +#include "tcg/tcg.h" #include "internal-common.h" =20 HumanReadableText *qmp_x_query_jit(Error **errp) diff --git a/accel/tcg/tcg-stats.c b/accel/tcg/tcg-stats.c index eb6e20ae985..e1a1c4cf4ac 100644 --- a/accel/tcg/tcg-stats.c +++ b/accel/tcg/tcg-stats.c @@ -37,9 +37,8 @@ static void dump_drift_info(GString *buf) } } =20 -static void dump_accel_info(GString *buf) +static void dump_accel_info(AccelState *accel, GString *buf) { - AccelState *accel =3D current_accel(); bool one_insn_per_tb =3D object_property_get_bool(OBJECT(accel), "one-insn-per-tb", &error_fatal); @@ -209,7 +208,7 @@ static void dump_exec_info(GString *buf) =20 void tcg_dump_stats(GString *buf) { - dump_accel_info(buf); + dump_accel_info(current_accel(), buf); dump_exec_info(buf); dump_drift_info(buf); } --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609448; cv=none; d=zohomail.com; s=zohoarc; b=kjyuBtGtb56da7xbxqUQa0tt8JRqivvp2ZbN2CHdmZcbXNsfjEO931m/Lt1A0iKh5CA8Ieixaq8yqvUvMdHlSZH1bZAtBbhyskgj++TgkyEf6+tLY9LJUqhLkZS61eFIJyEZciB5ICQuIWgHe5azy6zRwbYbbruuE7gc9PLD9wg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609448; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=HquHgk/7WbZHZlOnd0Sx4ZEF9PYPrRxaR8gX1Hc6sWo=; b=YlH1feC6LEOTuUDsfD8J/dDyXfD0PLZfIOvLKnGBG4EvbZ8gueINNz9LrmXnc5m5a79IzQDNchWk+c96u7wwy4VgxNSWDgFtSec8rqn5dtP9fLqz97sRJUn/w6U0DOLxYdti5Dbx/hWcYirlgLHlLsyLRbNX3sgQh5yE4OQTtWQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 17526094482941022.9239207917465; Tue, 15 Jul 2025 12:57:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublko-0003Ee-QS; Tue, 15 Jul 2025 15:55:54 -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 1ublbl-0003Go-LF for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:36 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublbj-0002lG-Gs for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:32 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-454f428038eso41148535e9.2 for ; Tue, 15 Jul 2025 12:46:30 -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-3b5e8e0d4b5sm16132335f8f.53.2025.07.15.12.46.27 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608788; x=1753213588; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=HquHgk/7WbZHZlOnd0Sx4ZEF9PYPrRxaR8gX1Hc6sWo=; b=t+a4lSKcCW6sUoQd1xlxNpdOzEkf2uyaAvQ+jQkNXYtH+MtMwLLHwg0txePFjPkvlp m0HELFphXQuFJ0hDGsdFrsKNTcfH+WOnnBTh5f6j0fRo+dK5QHjIPbocVjah20aZeKSg FqdXD2UUiITD4lbpJBmSUhOKnZM03QKaLDf8T0ctkHFMuVDGn2ukXgsUCImpZtP7ROG5 jRvTJdIlAQg43exFZ23Fr7ZuAEMcZL0sI2xoSIGvC5dVCeGqIxQajU6ZT7GonNd6/T/7 udBUV7s+WxDjjzf07c5FmLzmwDWvOb+nDuBJ8OMZgeYvqxaK2N+gTn2i+XVwz+dPuoac Xwxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608788; x=1753213588; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HquHgk/7WbZHZlOnd0Sx4ZEF9PYPrRxaR8gX1Hc6sWo=; b=RFTOmgOXPRT95B7JCQQnzSMFl9n3Ye77cO2OfRsn9EP9XRhB7/5b25CxfN2aBtMaNg 4Ky7Kke7aoyCOrMzzAytyO3o1H76U2Bm3R+q4NnGtKbPFYgFkK5SQc9+xCViaKBLrMzg j7SGxprpIR+MR0ysyuMt6JhWbVlt3j1Q0du8lbPmfNYAxaQdgjYqCujkGghppDebudJI nQuuw9ibd7ynPlzUixQ+epwDFoKwE+9AMotaLFBLzvhcsDyh2i04adBztVde1KPii3VN yDnr3mq7vcvWTat6voxm5cqvn/73/GucOJCvXerCq1M7lMO8lVpveOzvhfWMMZ/kZKNs BB/g== X-Gm-Message-State: AOJu0Yw1a2yKbIsmIM1KhZmU0cC7FnhE1UqW+mIe/noehZu1ZK9DWaFw mq7+PQqld7ugGZGFIhTkCTcBDpdiBvQvSkG7WSkM11OSChuWcKqA8VtKc0EiDNN0nDO1nlT9UQr vEhmC X-Gm-Gg: ASbGncv0mootqRBh9IEJyknNO0HUWRw9SbnDCaVv0DKS5h0/Yg32Sd/0E0Yg6w3y4de oKtYksYtYFqBg7+BU9VQkEF/Sv+oJAiGrKggmlex0Tz9dAu89n7hWCs3J1aupngpmPrae+9akxA MyT+hDEyB3UUu67PQQmOhVJxOxC/OubuajAvXv0AhPigdE9rS+NRUitC7fCjiiaixvCssnvrb2s blyKOTLRagoblkNu9jx+vsxnb7vQ/Lvds067NdZMRZriosLkde6GgRFVQ4/RfxU0dWeP1G3exP5 j3VrtYZJMAh3AjKFQswBAMT4tx7a6lD8opg1mOrWU3Zna09t2YuPTre0nIY06FjNUVkYR9qqkfg 5ofuqlM4JKSJNK7jx0hMWdfCpLJXhutl59M+SE7AUdaxTbRK23sgGdrunDtilMGXkSaw4hdzKG9 8nQQ== X-Google-Smtp-Source: AGHT+IGjBjzcfWBn7iIvF891ru6O3itGP4wwJbxVSsfQpa130OxzHRCeOroeMeR0HORMNA/arePKCA== X-Received: by 2002:a05:600c:3554:b0:450:cabd:b4a9 with SMTP id 5b1f17b1804b1-4562e3b8f65mr501675e9.29.1752608788310; Tue, 15 Jul 2025 12:46:28 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 14/17] accel/tcg: Implement AccelClass::get_stats() handler Date: Tue, 15 Jul 2025 21:45:13 +0200 Message-ID: <20250715194516.91722-15-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609448696116600 Factor tcg_get_stats() out of tcg_dump_stats(), passing the current accelerator argument to match the AccelClass::get_stats() prototype. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20250715140048.84942-7-philmd@linaro.org> --- accel/tcg/internal-common.h | 2 ++ accel/tcg/tcg-all.c | 1 + accel/tcg/tcg-stats.c | 9 +++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index 1dbc45dd955..6adfeefe131 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -139,4 +139,6 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr= _t retaddr); void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr); void tb_set_jmp_target(TranslationBlock *tb, int n, uintptr_t addr); =20 +void tcg_get_stats(AccelState *accel, GString *buf); + #endif diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index eaeb465dfd5..5125e1a4e27 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -243,6 +243,7 @@ static void tcg_accel_class_init(ObjectClass *oc, const= void *data) ac->init_machine =3D tcg_init_machine; ac->cpu_common_realize =3D tcg_exec_realizefn; ac->cpu_common_unrealize =3D tcg_exec_unrealizefn; + ac->get_stats =3D tcg_get_stats; ac->allowed =3D &tcg_allowed; ac->gdbstub_supported_sstep_flags =3D tcg_gdbstub_supported_sstep_flag= s; =20 diff --git a/accel/tcg/tcg-stats.c b/accel/tcg/tcg-stats.c index e1a1c4cf4ac..ced5dec0c4f 100644 --- a/accel/tcg/tcg-stats.c +++ b/accel/tcg/tcg-stats.c @@ -206,9 +206,14 @@ static void dump_exec_info(GString *buf) tcg_dump_flush_info(buf); } =20 -void tcg_dump_stats(GString *buf) +void tcg_get_stats(AccelState *accel, GString *buf) { - dump_accel_info(current_accel(), buf); + dump_accel_info(accel, buf); dump_exec_info(buf); dump_drift_info(buf); } + +void tcg_dump_stats(GString *buf) +{ + tcg_get_stats(current_accel(), buf); +} --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609640; cv=none; d=zohomail.com; s=zohoarc; b=aRS+VspZCOMxumI/GbO8UE8rHGmUrv5JWcvsm94JpdqJ78qN6Psn3RWuXVTzztOdD2GFihs3gjCCwyxXSYvhvICPMyLh/49QfYhM0JB8VwbBhAft9X8RRmMvPd2XsftCJCXqSWnE/Ogx2gqzqsorSai359XXS7tKgySFZxXoAgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609640; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=e6leM8DQht8TUhHC9NZWiwreTxGLFj7ofFNVivVFo60=; b=Nj+rwqyywPRzcVX4sot//PS5SPddsI8XIFQpakfNyUatG2FCbXe8QLw+r0Cb9sIPC87+evm9cPGuB6Z1UwdWkBU4NAUkijGFG/wgEoqLnRTeRD7E/LRsYs9v1MJM8zXBlghm1trsPaGf/Et/nphQPzMYqJSaIgerPf8v2hQcZ7g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609640380717.7555658582878; Tue, 15 Jul 2025 13:00:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublos-0002b6-DE; Tue, 15 Jul 2025 16:00:06 -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 1ublbs-0003Nj-Dw for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:40 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublbn-0002lY-0E for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:40 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-45600581226so38327185e9.1 for ; Tue, 15 Jul 2025 12:46:34 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-456101b60besm96441045e9.1.2025.07.15.12.46.32 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608793; x=1753213593; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=e6leM8DQht8TUhHC9NZWiwreTxGLFj7ofFNVivVFo60=; b=tT/dMAP7gho8xmRFXjTYxvbOszqSSsMrt8WCbby0Zozj3ATTxsOncwy416ZKeyh9HA T0yWOAq+QwRukjWW8qfI6jVnhvmdOuRhmL+s8InogrxxzYa4rndDRNnEQsFDSHBst84q OOXccOzgtPQZN9ickZzlnZdW1GluOmzisMWPL47WIQdz0Q+y7RBNmi1/738sLolWch/J V26Zn45anJvjxervd5/g6brR/IziwHKRlq+kLuS7zGEYJw303fxWLB1EqPW2sJehliXc 0ofcd8iNn9JurZz/B1Z8Nx+xYswcG65uIozWuBdB1kGhqGRKC3yeuYGz3IgtcQ0R8jge GomA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608793; x=1753213593; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e6leM8DQht8TUhHC9NZWiwreTxGLFj7ofFNVivVFo60=; b=gWibTIMW+UqaIa0qFfpqPxgL40ntQ+6nZcU8hecAttQZYhrGdbtYTlHjRjDiBakCdJ uph6gym9URO+mSU/RROtGxzSl/UXRmwzl5NNEA4PLCpTWAcE4pOe8w/4qhC1zTmchKCr ITYQcQH4f3al33wuihG++13bNmoUMgIgyQNS7KRLcE/vla17AZnbL9N2t/D2yZq+lvo5 4MH7VakKId3/w+FKnxzNjPUnq3Wdknt6aLDD2WgkZFTSzbvJZrP/qvKvzrp77jI2/pFL GkkLHNXpBPF5PEnPNSsr4oLZFRlHRr6TfSVGLaUyeESFheKJ4nYVDseBp9WrmJeT1jPl oC8Q== X-Gm-Message-State: AOJu0YzwPfGUgg07TD0X3aP1dTrqYO1dLNkEUjLUtRJIs+IKm0nQy/+T GzrztvhzOJSz+mpNfZXhXxtUbLdy0morG4RmJIOoQlSLBkgZWsAtMrs5MjzL37IPYp7AiW9+hQY 6tVeR X-Gm-Gg: ASbGncuvUP4T6Fjngloq08qMVgJdgoTqB1/9A7VJuNdKOhzbwnyyL3z9+mPCk4t0r6G Pv7AbWZBUOq7Qg+OE7xShjQ4MOne9ZgWK7hQX3lmQ499TFJHnG1OUG8cPtzQYunjXklgqkiwEBs iS7SH0LXg8l2giCNXdCd/NTXeF8Da0SAhBAHOSf61nOp5L38xGySOUHIzqpa1h2egVrNBbvlpNG /ZWr+HnMtmmLN7Rid9xw+iJG1orfJGUUpot2T/Yx2GJIE+BvkLcBwD+sjnSN1j/0GbxgZlhlWSp rgfUkEL/aNH+qRdr5oPWTkHRGeed70pZzrl93NlY3Earmjm208YOrbS5EFWoclTdrAciCOcKZe4 8/SckYzThpiORR+giph2SP2GpVrkVWIrN8yeOO3Z96RKdc6NDQfJ9bjiwPyYShmOqbWeVhK1CwU 58B8xZKNUeTMoO X-Google-Smtp-Source: AGHT+IH7AG93o0aR0eGIoIMQN8amjwKvqq4YbEP8/szKaTL3/B87hXzNZ5m5SjWkgF70cLQKvetiQA== X-Received: by 2002:a05:600c:a089:b0:442:e9eb:cba2 with SMTP id 5b1f17b1804b1-4562dfc0150mr2536945e9.0.1752608793014; Tue, 15 Jul 2025 12:46:33 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 15/17] accel/hvf: Implement AccelClass::get_vcpu_stats() handler Date: Tue, 15 Jul 2025 21:45:14 +0200 Message-ID: <20250715194516.91722-16-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 @linaro.org) X-ZM-MESSAGEID: 1752609640864116600 Co-developed-by: Mads Ynddal Signed-off-by: Mads Ynddal Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20250715104015.72663-8-philmd@linaro.org> --- accel/hvf/hvf-accel-ops.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 214454bd0b4..d488d6afbac 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -58,6 +58,7 @@ #include "system/cpus.h" #include "system/hvf.h" #include "system/hvf_int.h" +#include =20 HVFState *hvf_state; =20 @@ -118,6 +119,12 @@ static void dummy_signal(int sig) { } =20 +static void do_hvf_get_vcpu_exec_time(CPUState *cpu, run_on_cpu_data arg) +{ + int r =3D hv_vcpu_get_exec_time(cpu->accel->fd, arg.host_ptr); + assert_hvf_ok(r); +} + static void hvf_vcpu_destroy(CPUState *cpu) { hv_return_t ret =3D hv_vcpu_destroy(cpu->accel->fd); @@ -347,6 +354,21 @@ static void hvf_remove_all_breakpoints(CPUState *cpu) } } =20 +static void hvf_get_vcpu_stats(CPUState *cpu, GString *buf) +{ + uint64_t time_mach; /* units of mach_absolute_time() */ + + run_on_cpu(cpu, do_hvf_get_vcpu_exec_time, RUN_ON_CPU_HOST_PTR(&time_m= ach)); + + mach_timebase_info_data_t timebase; + mach_timebase_info(&timebase); + uint64_t time_ns =3D time_mach * timebase.numer / timebase.denom; + + g_string_append_printf(buf, "HVF cumulative execution time: %llu.%.3ll= us\n", + time_ns / 1000000000, + (time_ns % 1000000000) / 1000000); +} + static void hvf_accel_ops_class_init(ObjectClass *oc, const void *data) { AccelOpsClass *ops =3D ACCEL_OPS_CLASS(oc); @@ -365,7 +387,10 @@ static void hvf_accel_ops_class_init(ObjectClass *oc, = const void *data) ops->remove_all_breakpoints =3D hvf_remove_all_breakpoints; ops->update_guest_debug =3D hvf_update_guest_debug; ops->supports_guest_debug =3D hvf_arch_supports_guest_debug; + + ops->get_vcpu_stats =3D hvf_get_vcpu_stats; }; + static const TypeInfo hvf_accel_ops_type =3D { .name =3D ACCEL_OPS_NAME("hvf"), =20 --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609952; cv=none; d=zohomail.com; s=zohoarc; b=cFLRfnYzt11ITydZa65YlSjvYDEAVKxA490UfQdOwIy+x/oeCzNkgY0QSPMS9aDwHTqeyRAf+c4U22fvynJpbFzumq0gfrsKcKpg1QnQDUgpqozcjwFlfzwYpux+Jg1MYMn0CfUfcw6tn19vgF+okqfFvqITAFsYoNP08JtHEk8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609952; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=nL2lXZw+q8MLc6/8xrYKH/mR5NWKLcZkaleiPZ9lfnQ=; b=L9AmhQulUzCeNB+mqyiltr6+Nem7zEUJQVRfnofno2iu7hZ2qZD5lM/I0LgMCXSFmEaIs6v89gJcW4GS/ZtMB5/klBnZPs0jBJ3vy/Djwk07H/h27YyNdIf9bBXVnHywEyVQjcj4UOgeJwdDjaNOBbrfquCGOuTOweqlhstumkg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1752609952696237.38700646035477; Tue, 15 Jul 2025 13: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 1ublsi-0007lI-Qb; Tue, 15 Jul 2025 16:04:04 -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 1ublbt-0003V4-G4 for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:41 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublbr-0002m8-ON for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:41 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4537edf2c3cso61067195e9.3 for ; Tue, 15 Jul 2025 12:46:39 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-456030270f8sm113083725e9.22.2025.07.15.12.46.37 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608798; x=1753213598; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=nL2lXZw+q8MLc6/8xrYKH/mR5NWKLcZkaleiPZ9lfnQ=; b=xyEGcB3i7Gdpm+H6LXT9ARVlaecDZyL6mKhiggcq3R/rdWcAbWoe3skH2jHyUnZmmA ncr8q6wJlHsTQdiOZnB+/iFla9wUbgo2K0HK3YfpK6AE2oiCvBa85vFhUTkH7/RAEf/m 0Pgbk1o7qnc4bk/3vF1Jkvpwen8NgOoYilIrqucRL59ylTGWhco5587sUhSSu4WBxIZ+ pQyvwunEbvQ7VRDYZmOnp4TjuOuQc4sekp2bxs7N7+ucz7pRPxkaGQr8UJkBuo0t+b+k YLbUNVO/seVZdEpNR8hN3mHNXzBt1PeoK65jDen3jPR5erXU8081/7XjL1z4Nb899Rze kvBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608798; x=1753213598; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nL2lXZw+q8MLc6/8xrYKH/mR5NWKLcZkaleiPZ9lfnQ=; b=wrykgE7lZegEG/p+5YvpigCLj1x+qKJw7rthPhhFFx5gh6TWsetHOq5oAo77Lj5AX2 EJOg9y4FgoxyxIXlcECuAect8h5wP8sQ7xaTfdQJSn7CbkfYXLSREDKYqjolHtWFeJyw JfN888VdofE7z80nyJmLiCDsVQEKVSYa743TQqWjVwUyHpEEU1jqW9L8HMsvhTfIr/YT 9F99kQBgU+58glFVbPQLwre/0k3+/UnBHrxMvcEFqHm1ilshnJHuXRjbCGA+4CxKiTVo LkEaRQ+dmvACnP+uzVvivj+EFi9H7sV8Fs+qRl3Y4ypbdd/3NtuXCPeJTU8kmzcdZ6vg /RnQ== X-Gm-Message-State: AOJu0YzEGTHzBsTmw02B0c3s2bwsjCCIJMHjaITk+03lo8A8O5uHtPXG s32nQkmc9Ay7LMOzWrH8RAwUokNjB19aoYDiO9cCJZy4CKDvRthJ4pc6hZGxPGfKYS13wKl21QV DUpZz X-Gm-Gg: ASbGncu1+ASEeA/mm6cdw10TUlGb0QsHX4CBQPC6lL5rzcBOxuULvWKYkSUqNV0Acfs urpjcz9CeZS54uh7eCV5ay3CM6lhT2DwsUinGcDTgU6Y+KqicOhPiO/OpP+US3l4W5jnhF0DZmM IDiHxG9vA8ErwVwD00ypo16uv4q1tQ/WWf1Sl9Y0u9Nu/7tl6t1pSmeTKjB2RnpnxQvsvI3A+Kg +s0VIUtDaW+pQ9TdkbTz/2w1SLf2wjOHBU1Xv3VaAiuhotpy25UyCT2qtk5hy5boGYMBS/hS4EK sqG8KeNMnH6DhKRaw1KqNUau3WxLacc4q+T2jpJljtJlGtYzyH9EfHYM9ckiimfH7L1vuiDMbyl bSvfaJo1CUwKnUNJvgXsyqLPhFzBSoWcMsZn1+T8+0u50GQB6FnrRh9P3PLeGGtvRrylS5OMoMR JDQg== X-Google-Smtp-Source: AGHT+IEcy8qqSFCGOyBdgUAzzlfNNPzfRZwJimXC08icgg9nbwvx73zCqxCGIC8IsO68iawmKXkPSQ== X-Received: by 2002:a05:600c:4f91:b0:456:25e7:bed with SMTP id 5b1f17b1804b1-4562e23b6a5mr1759945e9.14.1752608797778; Tue, 15 Jul 2025 12:46:37 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 16/17] system/runstate: Document qemu_add_vm_change_state_handler() Date: Tue, 15 Jul 2025 21:45:15 +0200 Message-ID: <20250715194516.91722-17-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609954741116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Zhao Liu Message-Id: <20250703173248.44995-4-philmd@linaro.org> --- include/system/runstate.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/system/runstate.h b/include/system/runstate.h index fdd5c4a5172..b6e8d6beab7 100644 --- a/include/system/runstate.h +++ b/include/system/runstate.h @@ -14,6 +14,16 @@ void runstate_replay_enable(void); typedef void VMChangeStateHandler(void *opaque, bool running, RunState sta= te); typedef int VMChangeStateHandlerWithRet(void *opaque, bool running, RunSta= te state); =20 +/** + * qemu_add_vm_change_state_handler: + * @cb: the callback to invoke + * @opaque: user data passed to the callback + * + * Register a callback function that is invoked when the vm starts or stops + * running. + * + * Returns: an entry to be freed using qemu_del_vm_change_state_handler() + */ VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler = *cb, void *opaque); VMChangeStateEntry *qemu_add_vm_change_state_handler_prio( --=20 2.49.0 From nobody Sat Nov 15 10:52:11 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752609883; cv=none; d=zohomail.com; s=zohoarc; b=IRKXidgcdOblWX6y0cHAt6RXA7eis5zHbCLGd0oYzAolcyK/IWt59BbzeOtB2+vEbw5SVdnpu2u0pz+0BH1Fm8BI7zOMk5w53G+5Jt0DsJPjxOqTC1IcEGnZXzeieeu89fzXGbNjp+5YtAlj6NKyWe5Zzhc4OrcJjG24nJHCy50= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752609883; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=C5pXkzQHaUuU2g6dRUjmsncT3yyVU5ukELcU+QSiw3k=; b=HnpoHjcOu15haYhylD1EbTzQCfG7GZGohIPJbqC0ATNGHUbCDbcTdHjLtX3GcBs+AURCk4WzJXxF+xMsZAbnHbTDTC5jW+99HGY/HvpGRx/mWsOojDjrMAbbEOyFDRPTV2dMxxTeuCe5wqLc0xaSsaKOGn+d5AOkm+IDm7oFAfw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 175260988317619.221965242624265; Tue, 15 Jul 2025 13:04:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ublsj-0007lm-TE; Tue, 15 Jul 2025 16:04:06 -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 1ublby-0003ww-Ox for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:46 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ublbw-0002mW-Pu for qemu-devel@nongnu.org; Tue, 15 Jul 2025 15:46:46 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-451dbe494d6so53841265e9.1 for ; Tue, 15 Jul 2025 12:46:44 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45617dc1fccsm79628225e9.5.2025.07.15.12.46.41 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Jul 2025 12:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752608803; x=1753213603; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=C5pXkzQHaUuU2g6dRUjmsncT3yyVU5ukELcU+QSiw3k=; b=BWCSM74mYAN8XYGtyNneakN3zLRuYFLmIm3It3oj4/4tpufeMHujXTZydcGEpKf71s Mpw13mOmlFwoclpcWBxbNga9j9FF3CWjq/JOdd1B70oCL09ciYf/VU+9nUGTohIVzM42 FhJOwHeqUJ3eeLBwAWNEarHbSkj3PcrUsYuyGut1a55+A77WVCbVLCSwPRLXB2tNHsTv I09EWK3WyxJNSupwk1c293DlpBZI1gg5Ic8ugzg7u7j6zmuS376fFcYqEEwfXnEK72KR jdP+bGAuEndHxdZYPRot5v3BcS3cQ9wFw1nn4VdSo5OBuwZWdRr/vZvkmdjH6C64nRT+ LDmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752608803; x=1753213603; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C5pXkzQHaUuU2g6dRUjmsncT3yyVU5ukELcU+QSiw3k=; b=px9yhrfhPf71RnYsWuEOEjztQyuYhTkZMjDLuLb0w3oiU3YbDriAg9ukF0ewOGxk3B 8elIa6YPtIAoyNK/VYLqtmSGTj9gsjzGOn/YsiWT8TCS2K3Ay17bYEFdFSHWO81Jkspm qZqKwfwc4RnKzlAMlOCUWEzUp6Ty6XLRuhiGOljZ5eR7giQc3wyfs6IRluWd/OYvruhs jPdp3PQakoDEQ/9IKuyIix6l87i1Ani/ql7krjeOi2vkishutXxY1yiSiJZjezXHH7Po MSlsqbOAs0mb2c8Lo3WyBT4MQJqVFMxpYpNb1RW25M7rIpaAhKW0Tsac/rKdr6kHOCMk m29A== X-Gm-Message-State: AOJu0YysG2jxfRab+0gr5d8fwffg00iHGZiVXbNNk4MtX93cXIbjZXh4 csL5U5q62aGryR7cPF3/JegY6J6tA9X9I7nCqwVPh52y8xe/MH1Sz0Ee2bAtFmcjfQBxx1wjngu ZCQ9X X-Gm-Gg: ASbGncs86WVP5kBCHUxl9hoI0za9pYGRH3XbrsdVv0tiWP1DLfnRjMv8bUQ0XCEm8vG 4ylEo0qDrGFJU/Puq2r1ieycysIzqo+P+/SCuYs6TQuTxugTMRFtTjZ/gSOZWgtQtR09kMnHTeM 5bShZ6b4XfT93rFN+Gcm0mtE049yczzFkTadigc4YrvcT4KIzWOnHjSS3qAaWD3PF8CXURFUNXR u8Wm6GdeJj3R+jYkOxfitLUexfPIBOwOfKhnBnP7UAJUtcjD7lj47UAqWaFAfmtNW9JvIvyJeTI LAIlR4mA3NvPZJieQXuzy+DDVHspmrPv9WxjTKFkf8ABhRKuXhAB3AUoVfsMJrRiKmemelZWjM8 Fh3FJCRcty050TUsMy73l2vL5WFXptHMR3p8fuPBUNJEsFGClMfy7vO0aF48rLCYI3dv4z8bswa vrLnHEbrv5A0Nt X-Google-Smtp-Source: AGHT+IEzq0cOnWr0UxxgkyKNJkYe/svL/RMx+afWzf7BVsfoFfYal8xnNGhJB0t/7gCdogh0F7AfbQ== X-Received: by 2002:a05:600c:310a:b0:456:1e5a:8880 with SMTP id 5b1f17b1804b1-4562e38a0b9mr593335e9.13.1752608802750; Tue, 15 Jul 2025 12:46:42 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 17/17] system/runstate: Document qemu_add_vm_change_state_handler_prio* in hdr Date: Tue, 15 Jul 2025 21:45:16 +0200 Message-ID: <20250715194516.91722-18-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250715194516.91722-1-philmd@linaro.org> References: <20250715194516.91722-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752609886246116600 Generally APIs to the rest of QEMU should be documented in the headers. Comments on individual functions or internal details are fine to live in the C files. Make qemu_add_vm_change_state_handler_prio[_full]() docstrings consistent by moving them from source to header. Suggested-by: Xiaoyao Li Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Message-Id: <20250715171920.89670-1-philmd@linaro.org> --- include/system/runstate.h | 30 ++++++++++++++++++++++++++++++ system/runstate.c | 30 ------------------------------ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/include/system/runstate.h b/include/system/runstate.h index b6e8d6beab7..b8d1bc3d273 100644 --- a/include/system/runstate.h +++ b/include/system/runstate.h @@ -26,9 +26,39 @@ typedef int VMChangeStateHandlerWithRet(void *opaque, bo= ol running, RunState sta */ VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler = *cb, void *opaque); +/** + * qemu_add_vm_change_state_handler_prio: + * @cb: the callback to invoke + * @opaque: user data passed to the callback + * @priority: low priorities execute first when the vm runs and the revers= e is + * true when the vm stops + * + * Register a callback function that is invoked when the vm starts or stops + * running. + * + * Returns: an entry to be freed using qemu_del_vm_change_state_handler() + */ VMChangeStateEntry *qemu_add_vm_change_state_handler_prio( VMChangeStateHandler *cb, void *opaque, int priority); VMChangeStateEntry * +/** + * qemu_add_vm_change_state_handler_prio_full: + * @cb: the main callback to invoke + * @prepare_cb: a callback to invoke before the main callback + * @cb_ret: the main callback to invoke with return value + * @opaque: user data passed to the callbacks + * @priority: low priorities execute first when the vm runs and the revers= e is + * true when the vm stops + * + * Register a main callback function and an optional prepare callback func= tion + * that are invoked when the vm starts or stops running. The main callback= and + * the prepare callback are called in two separate phases: First all prepa= re + * callbacks are called and only then all main callbacks are called. As its + * name suggests, the prepare callback can be used to do some preparatory = work + * before invoking the main callback. + * + * Returns: an entry to be freed using qemu_del_vm_change_state_handler() + */ qemu_add_vm_change_state_handler_prio_full(VMChangeStateHandler *cb, VMChangeStateHandler *prepare_c= b, VMChangeStateHandlerWithRet *cb= _ret, diff --git a/system/runstate.c b/system/runstate.c index 38900c935a3..fa32aa47958 100644 --- a/system/runstate.c +++ b/system/runstate.c @@ -306,18 +306,6 @@ struct VMChangeStateEntry { static QTAILQ_HEAD(, VMChangeStateEntry) vm_change_state_head =3D QTAILQ_HEAD_INITIALIZER(vm_change_state_head); =20 -/** - * qemu_add_vm_change_state_handler_prio: - * @cb: the callback to invoke - * @opaque: user data passed to the callback - * @priority: low priorities execute first when the vm runs and the revers= e is - * true when the vm stops - * - * Register a callback function that is invoked when the vm starts or stops - * running. - * - * Returns: an entry to be freed using qemu_del_vm_change_state_handler() - */ VMChangeStateEntry *qemu_add_vm_change_state_handler_prio( VMChangeStateHandler *cb, void *opaque, int priority) { @@ -325,24 +313,6 @@ VMChangeStateEntry *qemu_add_vm_change_state_handler_p= rio( opaque, priority); } =20 -/** - * qemu_add_vm_change_state_handler_prio_full: - * @cb: the main callback to invoke - * @prepare_cb: a callback to invoke before the main callback - * @cb_ret: the main callback to invoke with return value - * @opaque: user data passed to the callbacks - * @priority: low priorities execute first when the vm runs and the revers= e is - * true when the vm stops - * - * Register a main callback function and an optional prepare callback func= tion - * that are invoked when the vm starts or stops running. The main callback= and - * the prepare callback are called in two separate phases: First all prepa= re - * callbacks are called and only then all main callbacks are called. As its - * name suggests, the prepare callback can be used to do some preparatory = work - * before invoking the main callback. - * - * Returns: an entry to be freed using qemu_del_vm_change_state_handler() - */ VMChangeStateEntry * qemu_add_vm_change_state_handler_prio_full(VMChangeStateHandler *cb, VMChangeStateHandler *prepare_c= b, --=20 2.49.0