From nobody Sat Dec 13 22:55:07 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=1751564207; cv=none; d=zohomail.com; s=zohoarc; b=mKQmnQWM/xIVs1d+5WcNy2i2nb5W+vUQN6fIboJQj/2zNbO8vbhOnNwtrfMijS8/2UY0wYETjOVE3geLSjpooS+RTSIU0eH3Cvfje6DGnAFgk2RpjKaUbDKjPCWdC6xc133pKxC24LQwKsl7eIadD2ObI5zm8vikYzVrniutRRM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564207; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gyDIfVgkjNXaUsE4JArqlEQoqhWF6dxOZmRK2K42QUQ=; b=B9lOL6+s1CETVEq1vy0ewFcK1Z+lpxnKJyb1TnPSxasf5hCZ6TSLhKxwGO9r+Nr7FotVFRVnyX9nG8x5jsaNklhyRFxxpjNhLgWcoIzMD655jcgDXXLIDSahT3oRBetKc8W3JZlPtyu9bygxqBspGUeTvQeKMh2Ux9JunLjS2xk= 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 1751564207067146.66368768058044; Thu, 3 Jul 2025 10:36:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNo5-0005So-Hf; Thu, 03 Jul 2025 13:33:09 -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 1uXNnx-0005S8-TJ for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:01 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNnv-0007mI-S4 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:01 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3a6d77b43c9so43613f8f.3 for ; Thu, 03 Jul 2025 10:32: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 ffacd0b85a97d-3b47285c6c9sm309916f8f.89.2025.07.03.10.32.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751563976; x=1752168776; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gyDIfVgkjNXaUsE4JArqlEQoqhWF6dxOZmRK2K42QUQ=; b=Jt+vv/9/Hofsij/l1QN3GIO0LWzL3tBJj4euuDYyPxidL4nye6h0SB9jl3agGEkieK mpIwci3s5cNT7XcP44N13Zr7hUVVltQ6ZIvbnaeCl+Apt/d0Gox+hixtSlSe94gNrTOQ vvR7Nvuzslt04Fi2ntSXpdqQC/o8lwBIoh6YfQqWBlbsiJDpNqkZJOk6qk4Ingz1+kKw ZQNhA/b9KgtpSoFvHUBjN5SMuopRgV9JB7bSIjrZpdvHfwpxwG63jdv5WoBFDGVct8zC CckDjRke3Ny8+4uBYTNhDFhKoS14TJFBqYRvJXgTCKjHE8LihETCMTK82dHUbxHnqDrf kgQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751563976; x=1752168776; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gyDIfVgkjNXaUsE4JArqlEQoqhWF6dxOZmRK2K42QUQ=; b=GntU8HzgKC7naddn5zHBwV0sp+E8XQ8P0iX4MdjbBMYJPsVuhSDPrb5ntPBBFBST3L aPcOqyQ/JmJ4bkYItGPJSonGTUt8/srwSjXyrQ6IKejAIfwPw/RBY6Ud+uDaP/LqLE6T lGFIq27CFrDt/lIu7uaAPU1brFbtQBnkCYGM5HXGeMLqn4QcQ6/aJUtODChNaK7rjJ1m uJ9bL1BSKgkJwvocjbC1hGwRCstb0Km13Ciwlmf5CxZ217nYbjyZX5ppPNmYDU7rwP2M TYiV5IPkyeKsOdrYELTKOgThVK3dITHw9C7blWeQklXiYeZKod7W2tgtAH1cSv6sOMSR pnBQ== X-Gm-Message-State: AOJu0YzMMwsL1h2bDFrHQ65YQX+WTTx1NuzXfEvIBIc8b2k5RJDDSOJ6 L3oC5lIH9zeb2fOUwhtP0kr9R6cS6J6aBgZZC+vS2cZWIUfK/58ofiIzbDhtysY6gxllNaR51Pj 6nDay88k= X-Gm-Gg: ASbGncuzsnrVNUS7Ozaqh7aKuiB4JX6Fj+LYJXSK0HXbWR2iY+a9JyNRxGRTromEoc2 Z5BPh3RagR5aLYQ0sDoGfftcELKak2coma+Ft3ia99Vea8nZmZDjoi2tTcVC34+sowA2FW6SjmR eEj8YhkkJq0iyUZsyr5BVv5yh6+p6ZEITPYBQDDEF2SS/Mf4w89Pgj38CQJJcMLMd32c5NWR6Us 81fVJjLyaDXizxy7zyw3WNF7Bvi5ILJFoy2pyVepqgAUg+qSflKnJ8vLxfMerKZ/cxJRu6ZV4UR YR0PsszKNe+0ToO334lxJTYNAmS6f7RqXbi8DqZtHcJ3JdKK271HvyE7+BSRObloihZlcHhFE9t M65DDdYaq0Jgik2aWhJ7GdTQCwFuL2K0tMusk X-Google-Smtp-Source: AGHT+IGvqtx8XoCWZPw9qLTBcUURJ8nlsly8B2AV46B8e0vsOMNe4InR+5t9Ay8sX+jTL2yLsiJLHw== X-Received: by 2002:a05:6000:3106:b0:3a5:8a68:b81d with SMTP id ffacd0b85a97d-3b32de6b426mr3567970f8f.43.1751563975815; Thu, 03 Jul 2025 10:32:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Eric Blake , Markus Armbruster Subject: [PATCH v6 01/39] hw/core/machine: Display CPU model name in 'info cpus' command Date: Thu, 3 Jul 2025 19:32:07 +0200 Message-ID: <20250703173248.44995-2-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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: 1751564208024116600 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 (cortex-a72) CPU #1: thread_id=3D42916 (cortex-a72) CPU #2: thread_id=3D42916 (cortex-r5f) CPU #3: thread_id=3D42916 (cortex-r5f) (qemu) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu Tested-by: Zhao Liu Reviewed-by: Xiaoyao Li --- qapi/machine.json | 3 +++ hw/core/machine-hmp-cmds.c | 3 ++- hw/core/machine-qmp-cmds.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/qapi/machine.json b/qapi/machine.json index 0650b8de71a..d5bbb5e367e 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -80,6 +80,8 @@ # # @thread-id: ID of the underlying host thread # +# @model: CPU model name (since 10.1) +# # @props: properties associated with a virtual CPU, e.g. the socket id # # @target: the QEMU system emulation target, which determines which @@ -91,6 +93,7 @@ 'base' : { 'cpu-index' : 'int', 'qom-path' : 'str', 'thread-id' : 'int', + 'model' : 'str', '*props' : 'CpuInstanceProperties', 'target' : 'SysEmuTarget' }, 'discriminator' : 'target', diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c index c6325cdcaaa..65eeb5e9cc2 100644 --- a/hw/core/machine-hmp-cmds.c +++ b/hw/core/machine-hmp-cmds.c @@ -40,7 +40,8 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict) =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 " (%s)\n", + cpu->value->thread_id, cpu->value->model); } =20 qapi_free_CpuInfoFastList(cpu_list); diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index d82043e1c68..ab4fd1ec08a 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -47,6 +47,7 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp) value->cpu_index =3D cpu->cpu_index; value->qom_path =3D object_get_canonical_path(OBJECT(cpu)); value->thread_id =3D cpu->thread_id; + value->model =3D cpu_model_from_type(object_get_typename(OBJECT(cp= u))); =20 if (mc->cpu_index_to_instance_props) { CpuInstanceProperties *props; --=20 2.49.0 From nobody Sat Dec 13 22:55:07 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=1751564115; cv=none; d=zohomail.com; s=zohoarc; b=L8Fzrd3GQV8tREByS34BDHnTrFw4AXOfJW/vmvDQNgxt0hWMOSOtm3+r8fOSJMxmqIG9DWsZybYKl8s6Q+oLYwnJKOqL6J+w6WO71MtkUQGBOR39OZ0eQeA13yOAOo4pSJPNiApEGlbEt517S6oLFaA1MdP2x801ecNSETEjjfU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564115; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zSMALvjOcbwDFxdBZhQQT9TGvgwhtr1LjNKTHw1swdk=; b=H0tr7TQav8gx23LDCMpy816wP9Xtio1OLxCRe27ZPPCjVU8unReQUTGsjQf4XUAjP38yCNCzzrNA6wmMqVRNitWNlr4+ooRsJ0iLLHflF3NW0QO06AAixpDWIaxHKmEW8Mp0LSUFrUR8bDfvkPmOiWb8dJZbg6MyzCuhQF9PA5o= 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 17515641155741012.322440381302; Thu, 3 Jul 2025 10:35:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNo6-0005TF-Ap; Thu, 03 Jul 2025 13:33:10 -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 1uXNo1-0005Sg-Ci for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:05 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNnz-0007nM-KW for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:05 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3a575a988f9so45526f8f.0 for ; Thu, 03 Jul 2025 10:33: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 5b1f17b1804b1-454a9bea4a9sm31666605e9.37.2025.07.03.10.32.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:33:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751563981; x=1752168781; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zSMALvjOcbwDFxdBZhQQT9TGvgwhtr1LjNKTHw1swdk=; b=gpYej75Xj1bS1X8weRzAo481Z48mh+BE3AxKqHy2MG7YckZTgYrdAZKIiVUAUf/F+p 9CeV2WqxH23qdJ1WyVvNLdtnSK7jf3ple7lUQvbaPnIXEMBDzEXjR29AzkLkHQ/jzwY4 NbYMwywtc8TmHr6kK6nANSiv9RXuE9ixIDfnM25N2Fxjsj+IoA02fXxVBIsLvUJHAcag JepanPSgk7PP8HyP8JjEL0gLqaLNwAUPoLeqFxgjYmH9a0MaPkBKXTxqR2XGEcZkh5AM lz3c+vSJtq3MaVopCa/j2CDa1/Mrr/Y/bbz4cPlr3oiADT3I/Z6YnQLqnQJTpCY+qVXG PmtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751563981; x=1752168781; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zSMALvjOcbwDFxdBZhQQT9TGvgwhtr1LjNKTHw1swdk=; b=Dmn4mV+GHO2J+5J7kqqZrw8H90mlW2akDuL8NFA0NjAi3zGKZsLZExrSlJPSy0RbT6 6yJenvOdD8zbYe3el9Kn5A5leB+dOZm/8FvNGC6A+cP994RG9x0vF5jk9IVn17hVIjl9 y5avsLax4pENLpwbpTzxl+R/+YP5wrRWqWtW5rn4Ug2pHXk3zFDlJUnedYwkbPQxma2N z9bsqkwkNMQd1HgUVPfAhQSxXpRFrD4tKLmVSIqmfAO6iNh1Wcee9rbYmRFwAucmKdKU d5Z2MiGP0LgJh+jxTE7Arj2WmSpCF1xyp3SYpRlEy4As7sel4UHW8mugn9r8xDNkCY3E O4VA== X-Gm-Message-State: AOJu0Yzau92vF4o+B19JkQX8Egqohwy6wjgn3UefRQIjmcBZ2npiiZq5 nkFPmLjwopvPjWRzjyrv3cRoOm8F84YhYMOHmwlgA8UvlZRw3VvMNtI9sZkaJjv2VhBw2zhOC1P PgVgbPro= X-Gm-Gg: ASbGnctQcLcamGPCgf+ef9hNNbr0heiRMbPbnYwx2qbLJuFhIxSRMneP+oFRKAeZUjC PxsGQ3/OH80ZROY+O6N/Mp51PK0Sn9PUG6psWK12fT8otmxyTolRtw/Hh8e1bYFWcMDdooypBGj 31pH2pPP5TqB3qSJbLPLjapA3/0joG5Ld+o2lReL05N5+Kl9kPFer/xpdPP2gHO2qeneTBisXtn ocr/4JQA9ihApUIXWwIigDtyB67aZ5CzIKOXufYt8ljTBuivmA+QOTADeCUF81rd7rERuIG9L87 UNf40I1ADdouTZBZkF6YQwsQ3XsMJRx/uQ2KPb6GMV4TLtzIvsjBsWoLtSNrZEzue2DD/PxZqeI pV5mf70kC8H13MOdA07gnN/NGQMTPQtRmrjyX X-Google-Smtp-Source: AGHT+IGFu80crPNQoEIjjt6dkLl56V2F1tSkb0BEa/Vn6eF8EhrmaihENxnjtBeptWNpVQGwn+pzQA== X-Received: by 2002:a05:6000:2711:b0:3a5:39be:c926 with SMTP id ffacd0b85a97d-3b32ebd78efmr2469546f8f.32.1751563980898; Thu, 03 Jul 2025 10:33:00 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , David Hildenbrand Subject: [PATCH v6 02/39] system/memory: Restrict eventfd dispatch_write() to emulators Date: Thu, 3 Jul 2025 19:32:08 +0200 Message-ID: <20250703173248.44995-3-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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: 1751564116736116600 Commit 8c56c1a592b ("memory: emulate ioeventfd") added a !KVM check because the only accelerator available back then were TCG, QTest and KVM. Then commit 126e7f78036 ("kvm: require KVM_CAP_IOEVENTFD and KVM_CAP_IOEVENTFD_ANY_LENGTH") suggested '!KVM' check should be '(TCG || QTest)'. Later more accelerator were added. Implement the suggestion as a safety measure, not dispatching to eventfd when hardware accelerator is used. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- system/memory.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/system/memory.c b/system/memory.c index 76b44b8220f..4f713889a8e 100644 --- a/system/memory.c +++ b/system/memory.c @@ -25,7 +25,7 @@ #include "qom/object.h" #include "trace.h" #include "system/ram_addr.h" -#include "system/kvm.h" +#include "system/qtest.h" #include "system/runstate.h" #include "system/tcg.h" #include "qemu/accel.h" @@ -1530,12 +1530,7 @@ MemTxResult memory_region_dispatch_write(MemoryRegio= n *mr, =20 adjust_endianness(mr, &data, op); =20 - /* - * FIXME: it's not clear why under KVM the write would be processed - * directly, instead of going through eventfd. This probably should - * test "tcg_enabled() || qtest_enabled()", or should just go away. - */ - if (!kvm_enabled() && + if ((tcg_enabled() || qtest_enabled()) && memory_region_dispatch_write_eventfds(mr, addr, data, size, attrs)= ) { return MEMTX_OK; } --=20 2.49.0 From nobody Sat Dec 13 22:55:07 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=1751564028; cv=none; d=zohomail.com; s=zohoarc; b=AfLMKe/BQwioT29L1eJykL5z21Ejn2XxcAViqVvlt8V11tZ1753PGF6Gr3fjSVo/ZAbQtY/tqFQflinsb0fN2cMx2MNC8sPuQMgQLMG+0JrJjWmSqcncM61sWzrUKU62FSsF9pzgeIIi5NEQ3ScT/9PHKfTkUpyps6oyYAv51ks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564028; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ThHRepOjVOPYIURDCNeQdikGEVpKaGb//EjFvlftJxg=; b=m1/+gUCeDGBYHs/OtGw3o1ZBUry20KzXoTYbF6c0fkOdCNP02692IuWRvmtTLTEvQknxh36IKIneuzi4K48TOAia66qAmI+Ss59CdigMIp42SgWLqhvOZYHxLFQhe+R7xsylrdphtSybZrbPB2Z5C2WimMLr4PpAJElWVA/2Zvk= 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 1751564028502471.32800350143316; Thu, 3 Jul 2025 10:33:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNoC-0005U8-Bm; Thu, 03 Jul 2025 13:33:16 -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 1uXNoB-0005Ty-14 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:15 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNo7-0007rq-Iy for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:14 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3a365a6804eso25213f8f.3 for ; Thu, 03 Jul 2025 10:33:07 -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-453a85b3e2bsm45499325e9.0.2025.07.03.10.33.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751563986; x=1752168786; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ThHRepOjVOPYIURDCNeQdikGEVpKaGb//EjFvlftJxg=; b=M6hku2GWwGT7EyvdP/u5bWuY2zTOkG8H/QodQjqNOLTq+ky+iQrzwrn1rAHanTF7/v svIgpDPBKfFrp9fGX7QmPx+bbdDnErMWVqj07rHE4N4boxc15rU+LfKnUdJANKXHoGbm JV5cBqNFpQvCFCVwJKYeak+XrNVVKsSu0U9SwYt0pVlGW3C85cPujNqBGCPpTAnkyNp4 LhHTy32VsmWqENvFSg3Jvf00NDbPzFpM6MVw07C6os0SbZ2UYvFHuRGjCgT91iDQgMC1 GZnAdyirgVU/BxNuYvbaO/3fxK+6yl85Fw6zX5e0DK02gvu3TpK2VLastLa1gnb524rr 5Sjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751563986; x=1752168786; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ThHRepOjVOPYIURDCNeQdikGEVpKaGb//EjFvlftJxg=; b=RebolDGD66gAdj9ZU3HYOpsW43LzBBHshGXWnG8H8yUgb/wPL5fTPN1hPki2SSKeXb iDmtJ9TbirLjlRfX5Rh9V39Xdc8mxTA0+2t1fzZDrSjIo8pfRubve84ATkTQce6fGVfR 8s4PKMTZ8QIK7ekGU16sfAsqpqULJkbJiM9aWh8epCrFa8A5QJBjHPcv6X37MxVuReK3 g3U5bD851BkuETps9wlLZZC/Kv81jI7TBkIvpYQpQEbB625dezVt6wJYH1U+ILIFWqR4 OeUDfY2vD8BJ8+49D3/88ul4sWh0aP+03HUM8UhkkfAIwDS2Z7y3Pp9J26Z/QYTljL5y uftg== X-Gm-Message-State: AOJu0YwwU88SSggfzH9IgL6b4XKuLOatOqzgBn7aH1/LDWpDsNqJq4+c NYJe2Jl8D0QakBt1FauSMr2ZJAaw6kB6KOD47NLiY292U7huAI6ugTbA2iedUTcU+ziCKhOXJ4l rCWh4+4o= X-Gm-Gg: ASbGnct7kSuk5w66i9OwCi+NNDxj3C1sP4DA+Nc6e5qcpBnsc+JWv6iG9X0s9nEtEsx 8FWTAfRKkB1j8qWZkeE1pm6sYTFIhvH67mgYSrK11IlaRHsWaZsx+y0tq/WD1mGhDWnYiZtL0Sk cSL2ovDRZ3ucsd1uDV/Qn66GvbtBsNnJO/mSl/aQViIzMtwHr20NRwpYcSuChdTN/1KmZy/L7++ Fy/LnJRvOTZopGqMZRzGDhJcWz5WPmBiVLIzwutIrZH2JShjVsCXAw2MOp18nZCkd0B2W+kGqj+ xsakLkOKYjebPnwBgaiFgRt+ydMJf8oOBxV/EizQB1l9F8rbv8+q8bfv+Y+LgBq7fXjPXLuV1nm jCra8SI/TdyHm+8FIquAXpp03Dg3wbJd76vPptwQqmOb3IDw= X-Google-Smtp-Source: AGHT+IH6KOAtvl8q6DlatJDHasb9EU1TBbGw8lJ1wPPJqkjkx9wRjZ16SeGeECqWtsbjqISs7d7OFw== X-Received: by 2002:a05:6000:188f:b0:3a5:85cb:e9f3 with SMTP id ffacd0b85a97d-3b1fd74c288mr6377571f8f.12.1751563985878; Thu, 03 Jul 2025 10:33:05 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 03/39] system/runstate: Document qemu_add_vm_change_state_handler() Date: Thu, 3 Jul 2025 19:32:09 +0200 Message-ID: <20250703173248.44995-4-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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: 1751564030320116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Zhao Liu --- 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 Dec 13 22:55:07 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=1751564072; cv=none; d=zohomail.com; s=zohoarc; b=OukGptQrq+vi0wHaiDogDD75f9I5OGVTmFo7/JuW0HuqBTpE3YUmYcVwiLql7bRz8IyGx0odynaWBusJfJ/+Gvgs/r/zS9PZ6qszc9ZoI8OmBC3e+VBLLU5iw0sE3+tqYJACwjamOL8NBUxltf8GNHDFupyt89j8sOH+KJtkL7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564072; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eMVCQTvVGe/Hz2DEmM07zNOYeNDGY8/7Dwwnom0rM8Q=; b=jvtbe8sVr5qCwrdaou0MKHI5z6CSvgtQ2ZhNEWht3vnJdgM6gcpCsXBZLNS3LLWxAhOFYwcWxi0TS8Wtyb5URcRVlcYZaDOZdCOjREXKNpe4hPyryGScUTGCxpa1eVyjag3GaTlO0isXr5pFLx7JdMxP5Wqpz+jmM11UYqEzIbk= 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 1751564072614891.7105944105007; Thu, 3 Jul 2025 10:34:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNoJ-0005V3-Qu; Thu, 03 Jul 2025 13:33:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uXNoH-0005Ug-0I for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:21 -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 1uXNo9-0007wP-HN for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:20 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3ab112dea41so31776f8f.1 for ; Thu, 03 Jul 2025 10:33:12 -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-454b1628ebcsm3545525e9.14.2025.07.03.10.33.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:33:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751563991; x=1752168791; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eMVCQTvVGe/Hz2DEmM07zNOYeNDGY8/7Dwwnom0rM8Q=; b=oMIVqrK5AArub7iT5TxMlxNycRv6BH4i0lH26jXBFyI8wEgLTeOi7A2P03AXjFG8KK vxzwYBKz+axvsdFspz8dy6zrPDV3gN1ML/it7RR8BRuPiQNARaSjbtLpKFR+odQdga3O oZ3zaGfggXA54T0tXJCEkDMuBGTQHGv9Wy9haCMj0sNakz+4Sequq4FG9Tq1Z2dnvn2d DPtgKCsoVXVkfeRyw3r+ORzD0iWtNpUlOIKTcx8Cbly5OyR9gKEIiSBFpMnS5Xd7H+FV 3Hwiv5J7tlz/z4sa+hmMV+/YEZnceDzqzW9dH8A42raw4BrKgWCdv0fCR8o78rAFNeFF F6Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751563991; x=1752168791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eMVCQTvVGe/Hz2DEmM07zNOYeNDGY8/7Dwwnom0rM8Q=; b=QhdXU4iZVJgZ4qT/Uz3NmyVnDFoFLuEhK2X0DYnzuchZV6JBya+I9/q9o5whQ/IEaP 4c2COu3J3a3PLpZHehaBekMTfnVks95bfBu0Vw7f+xEbaM8KnvSPZ0uh6XtM80MGRHsW 3EJ5Gl+caq+XeGR7UeQm1ikIIEnwjsLk+GwjgKtvZowCiyVNGma9Sskcir7tFQ2lZr9M uXMqkVnRmy4r12flM/BK64bFWvceWhYT/izxHnTTdNy4WeEN0NW1d9gXtsYHUo/8YMEh o2TFME1uVZkZjdh0NPifvUY3MRMeNaK67D5hxm+1Li2EAYqyhgU50bTwd2gGWFsTzvIL RTUw== X-Gm-Message-State: AOJu0Ywq94cmMt4+s77x5eETp7RsO4Sodg6Grd8c+s/kwJhSrbkn2TTv XXcacWX9lEGrDz3OPh3cUoCPfDnBhwn7HeCZQrkjIgcFPvH/7QUTN/KGV3oFlMhUzQQ7MRSsU2S kpg4A+v8= X-Gm-Gg: ASbGnctq00aOriDoCancmkaYn19G4xTcRTQIW9VlSB2k62EGSBNEHbxx1oD2D1CfeVs 1IkI2oB9uZTKy7RBBBCBCTlqegihwtrr/VuLEExmW52ekscjJvqk71fOkFNNdcaj67xCdARbWKK ESjiFLdFc1rEpY0t4yYGj7rF0aOfzJlUW52HK8WnGLFn2w1kGYF3Cj/zwVeO5hFi2e0oyI0j2Ad jflv5nwsHcuYsyraVOijreMHSsrdOYog/KxqSbDSsGVhK8dnG+j5aMt9bWjHQy5krDukcUM4Yof B8AV4dISkjCH4crqlXwJdPL3UJI6CrChnGV9Kq+WEOZC37TokR9Ud3rd9LbvVQYQ+NGrnA5xsBO GbEEI6GVu2GyHix2+CTqcfVY5E21uGkN4mxqn X-Google-Smtp-Source: AGHT+IE3eHyttpF5AjRM2NSGQ74TaN/fjiyPc2BAFxWRz/XEWKG28qNhJROCu2bMLK0jAzBhqfMEDg== X-Received: by 2002:a05:6000:4188:b0:3a6:f2c1:5191 with SMTP id ffacd0b85a97d-3b32c56e040mr2371776f8f.4.1751563990811; Thu, 03 Jul 2025 10:33:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 04/39] system/cpus: Assert interrupt handling is done with BQL locked Date: Thu, 3 Jul 2025 19:32:10 +0200 Message-ID: <20250703173248.44995-5-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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: 1751564074337116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- accel/tcg/tcg-accel-ops.c | 2 -- system/cpus.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index b24d6a75625..6116644d1c0 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -93,8 +93,6 @@ static void tcg_cpu_reset_hold(CPUState *cpu) /* mask must never be zero, except for A20 change call */ void tcg_handle_interrupt(CPUState *cpu, int mask) { - g_assert(bql_locked()); - cpu->interrupt_request |=3D mask; =20 /* diff --git a/system/cpus.c b/system/cpus.c index d16b0dff989..a43e0e4e796 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -265,6 +265,8 @@ static void generic_handle_interrupt(CPUState *cpu, int= mask) =20 void cpu_interrupt(CPUState *cpu, int mask) { + g_assert(bql_locked()); + if (cpus_accel->handle_interrupt) { cpus_accel->handle_interrupt(cpu, mask); } else { --=20 2.49.0 From nobody Sat Dec 13 22:55:07 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=1751564448; cv=none; d=zohomail.com; s=zohoarc; b=e4IydWOZv/fDwLcA7fGxTREm3EmGyxhJgMPwalYTfxQonCHh9kNSpaI8kXMdLes39ljnhvRJn7W5zHBXdcJtSrKp6r04aUZGcxgcuk8OQP4ApuJGF3GDqm/nwkDh6SBZr5Y3bemeZW6nskhNYMOU2elEq2T4Kl+OUBrpyqibKak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564448; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GAzT+CGbAi3kvmYQ13E5MHk/eJNqjsj98Rjqkr8WsQ8=; b=Eo452Ig2OLSI+DWhQ2QkvoVRCovxr/eREbgkejlWekmwbo1WZy8T2AgCK6etMj1pRddipdUC15+5QGNqjXBPOvx3TFd/n19Q8iSVPayrpx/7IHSChfj0+jm5QDIA9VcP64M+p3Bj4hdgyXZ7evXZEvnM9lbD2fHN3flFPoknRFc= 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 1751564448761691.7591771160013; Thu, 3 Jul 2025 10:40:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNoM-0005Vf-Ly; Thu, 03 Jul 2025 13:33:26 -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 1uXNoI-0005Ut-Jn for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:22 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNoE-00081V-Sj for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:21 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3a53359dea5so31142f8f.0 for ; Thu, 03 Jul 2025 10:33:17 -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-3b47225a2dcsm309045f8f.71.2025.07.03.10.33.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:33:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751563996; x=1752168796; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GAzT+CGbAi3kvmYQ13E5MHk/eJNqjsj98Rjqkr8WsQ8=; b=dfm9Uy8f3bONLmL5tOxwnyj8A7st6aOQKBdntnZS7p9U8vQKpPXRyHQaNAEpMXeTBQ AXUB1ZTs8ACC9Rz2ikPtd7rF/XJ9yz6e29IEm+e49fGzwxJXokpRYIp1EJj+s4+dfUcH vTmUifdf4yJbJUU8iTK5Y1BF5zlwLlT1C68Rcl3WqaMo/RSqVVX51l/MzyiVXbOgkkYq ZQJAA7oSEWJ3+/5PlemAZDTKc28Y0AvuS6zJSOylbaCMk3sn79JZK3zDrTnsBKEP0FC4 zK3Tm+7Xid9f1ay4nue8uX+PJTXU3Hwv+rHKfwbdEE7EYJJhTvtGt0rQYi0H1cfeYqXc p4aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751563996; x=1752168796; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GAzT+CGbAi3kvmYQ13E5MHk/eJNqjsj98Rjqkr8WsQ8=; b=txc1vFyURGiNXBfp0GWuLMB196xnuUy4cDQSIcFzFlxGUqelEJAQjaVLKfOuZh71pD nTBs7Crqdn/p/AgRtJU2Gi//IJbAWkjSxZdLcr05c0EzoDQoChCfueuPBVyc0lBuuQiO wlThTbDmzpLQTeRmC563ejHLE0SkfuVWiCkeKGiuZ6NbxNj9Y/PzAaXgrHR+XroUPRWm fhiLufiwYWNqUSZdf6InlmL+zhx+dfUVS+4arUCRyWD7w5OC1q0BlX5NyEC2x41LpvjR QXE6a98NsucKU1THMcjIiJtaxyBSuxyH4jt2Htzd/j/yPtJz+n7WaSwQ6fOCqm70rvus 5akA== X-Gm-Message-State: AOJu0Yxi1OjhMNGwjAm8Gq/1xSWT2dnNfbS2LquLOn6ZWoZ8mkYVwQsa zl8b57ygXI9QQD//00tQeHCnX39ERFipwfEZv9Sr0Dpp8WbITWpUrVPJkAD9EVFHBQM7DMMX/Hb ggmefnjI= X-Gm-Gg: ASbGnctZ+Z8JYnFHCf1cObHDWw4/78DTgMg43Bc/yJpxVAj6tHTKMjrgSSWoagaE0od wPehm6LrDQvV556qRSTZPqgOkWDJ+rP2squXAPtu/8AM7Puzq1czed8iHEPdVxhCe3Z4qCh7iqy U7IHbu7fXp0GJlFIB6lDhh58yVpyXnaPLHXodUUK9lQz1Ijd7joz9NouWehS4u0/5wx+OaBSPo9 eoK16YouxXgsnwWMKdkD4c+nu0JbtUjxVgpUmLc536QHKSdgWHihFU799KKVSo8CxFDAeQpmV74 oF0izdJk3RSld2NS28j5UnvSnAi2YCBPmUrYEI/6eJBma77Ekbgp8jWQs7ieehz5EKsJ7NrdvIs pOhWL5ZlVaetAErVoNy6Ojn8jDuHActAR/3R3 X-Google-Smtp-Source: AGHT+IGh9RS69JWNJgwXCxoG24NZSngb1bZPnTE9GAXQAWzmNTnSn2b0+ZIFTnOK3Brqe8Us0t3MKw== X-Received: by 2002:a05:6000:26cd:b0:3a5:3a3b:6a3a with SMTP id ffacd0b85a97d-3b201ba1ebdmr6134479f8f.54.1751563995936; Thu, 03 Jul 2025 10:33:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org Subject: [PATCH v6 05/39] accel/kvm: Remove kvm_init_cpu_signals() stub Date: Thu, 3 Jul 2025 19:32:11 +0200 Message-ID: <20250703173248.44995-6-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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: 1751564450741116600 Since commit 57038a92bb0 ("cpus: extract out kvm-specific code to accel/kvm") the kvm_init_cpu_signals() stub is not necessary. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- accel/stubs/kvm-stub.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c index ecfd7636f5f..b9b4427c919 100644 --- a/accel/stubs/kvm-stub.c +++ b/accel/stubs/kvm-stub.c @@ -105,11 +105,6 @@ unsigned int kvm_get_free_memslots(void) return 0; } =20 -void kvm_init_cpu_signals(CPUState *cpu) -{ - abort(); -} - bool kvm_arm_supports_user_irq(void) { return false; --=20 2.49.0 From nobody Sat Dec 13 22:55:07 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=1751564306; cv=none; d=zohomail.com; s=zohoarc; b=Fr8f+aKkRDvlevkorYPbqifCpCsd+1vWNF0UOxa19kSEU/GocSKlnwQw5FEnVvAQno47c/6eHB1ZZkf5Zo2mevGp60BaetWT+qssaIDNSfNUQ4t4CIVnA+jcdzktPtqfbVruhtn6Bp2S5VDdVunIMl6eUiMa/5/XLtXjisuSAEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564306; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZLkTPhlZ6ATb7AAc3VGQov8gsRhAPF8MN9ZoezL4e2s=; b=oAioubvS4axm4jm1CWwbjdcdbPk+qtVBLmY5LQgW3TClHzFQpZbCATZ8LHc8attkFuWk2FSPOrTG7m/zAFgLlmshaGk9uxgrY+zJZtpzsDoIeQH4E2RWRyQIeG1U7rQe1kqVAnct7XLQRgc/Abo1+zpMaKAhmbp2x6xtqJh2Yiw= 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 1751564306237864.9840115609315; Thu, 3 Jul 2025 10:38:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNoT-0005Vy-QK; Thu, 03 Jul 2025 13:33:33 -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 1uXNoO-0005Vh-2B for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:28 -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 1uXNoI-00086h-SK for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:27 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-454aaade1fbso1227235e9.3 for ; Thu, 03 Jul 2025 10:33:22 -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-3b4708d099esm332340f8f.21.2025.07.03.10.33.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:33:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564001; x=1752168801; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZLkTPhlZ6ATb7AAc3VGQov8gsRhAPF8MN9ZoezL4e2s=; b=pEFXOpPsjGOxmEBVLb0YlV05H9JeQPnZ9KgooZK3Srk++5bqe9VNFvqA4fdMYzinac MrlTpokIAUpFQBJJFq3MHh2ZYkio6kpWmGmywaZ4KbJE6dIApz6vRardgFeT7odkFBYX aGJinYoZWwEYl6CeDtXMTFBNnMjvHp6zsIs4/Zwx/i5To8EeMTN1gb8ko9fjWFN+2K6R XfAS+T845Zz8jcR6ecNLR/OScJrHSjO1dcnriWYaWPGoJrds2sQ4swzLuiEpUF/AD2UT vRTRzvspe7KYh+RjC6wOwH/E3rYCDbixXlqYs/eM3l9RYWm+ecHl538l8z1p+OXF+XRX CBtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564001; x=1752168801; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZLkTPhlZ6ATb7AAc3VGQov8gsRhAPF8MN9ZoezL4e2s=; b=RVwvgAI6YG2zs4c/xmhbOoNWGMQmGmXxGslEovNURM1kAy/pwIPDOoOKl0Qa1mw4H2 gKBKkv+aEtGZvPlZTUu4P8IjysA5Ajp3/SdXDhyntcDJG7ZCafH7FgTl/6GgjFxJ9+eq JCe5uUlcRdFSlliSpvysnRYK7ys01PFrwejXFJ2PrRlVg2i61FFGnrBfAy8FE9jXz3OQ kPicP8Rcn49XUHVhaI1jieuOw/r5pjn75sKBjJz5BF+KHV7DntGWJLSxvDJwzSFAwhjq 8rclz1w0NzbAIkgEK1/YEUBNc1Q32sRwoJv1RV6aF5GhA86u8Oi3bq8QLxgOnHdyLCiN 8KVg== X-Gm-Message-State: AOJu0Yy8HZuV7z8S8T6tt5oaBGI2j1tc3CcCSac7QayNAP8tst62EvGD LKp/HiSGGk2+kOLu2HRs5bEmRnYS2r/Z8zBLrQ9Rwuzrin1LR87LZDypEChFV8wlZwQBCbcnqll 2NhY3wQU= X-Gm-Gg: ASbGncsc5VdkJIzvXCUxxH6fqQM174olNMgOU/16SebIpAEPYAUYcf3VePML+KYaZ0S jnRvUfBOYI5wbF1LqZtDn9d3SmlxTqLjCEi8fkjRat4yWK9kYs2YDiUiatg4d+FiKjLNgE0lcxU 5MCkk5aHwLG7SW0TlEfDJJDUTC6BOXSrDtcDGs47eT4x8k0VqBT1b6scT7Z3LM0Cvbcp34hnQUi Y5vZSmIciROkRGxaofTlYKE1JAz5gZ1L/rR3Ve0fIBAl37SGncWWD1mz6fM8vgkWxFR5CDwP3eR t9gpZNcXIK4fD8PIRAUYauAP++mcu7A4muRTwrqfIe0e3irgi+hSY2EGuAGhBEXCbBt39B1rCtW B8MNIz8z/PIdkMt7ICBUcf6GoHW24rX3dCxAQ X-Google-Smtp-Source: AGHT+IF7y0Ub+Cf0w0FURKaEgGsSG7UcWWxJaioorDsaWNR4xJx/xmz1NjsWoloY7AE88tq2thGyYg== X-Received: by 2002:a05:600c:4f84:b0:450:d37c:9fc8 with SMTP id 5b1f17b1804b1-454a3e1a96amr87058205e9.13.1751564000930; Thu, 03 Jul 2025 10:33:20 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org Subject: [PATCH v6 06/39] accel/kvm: Reduce kvm_create_vcpu() declaration scope Date: Thu, 3 Jul 2025 19:32:12 +0200 Message-ID: <20250703173248.44995-7-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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: 1751564306988116600 kvm_create_vcpu() is only used within the same file unit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- include/system/kvm.h | 8 -------- accel/kvm/kvm-all.c | 8 +++++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/system/kvm.h b/include/system/kvm.h index 7cc60d26f24..e943df2c09d 100644 --- a/include/system/kvm.h +++ b/include/system/kvm.h @@ -316,14 +316,6 @@ int kvm_create_device(KVMState *s, uint64_t type, bool= test); */ bool kvm_device_supported(int vmfd, uint64_t type); =20 -/** - * kvm_create_vcpu - Gets a parked KVM vCPU or creates a KVM vCPU - * @cpu: QOM CPUState object for which KVM vCPU has to be fetched/created. - * - * @returns: 0 when success, errno (<0) when failed. - */ -int kvm_create_vcpu(CPUState *cpu); - /** * kvm_park_vcpu - Park QEMU KVM vCPU context * @cpu: QOM CPUState object for which QEMU KVM vCPU context has to be par= ked. diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index d095d1b98f8..17235f26464 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -453,7 +453,13 @@ static void kvm_reset_parked_vcpus(KVMState *s) } } =20 -int kvm_create_vcpu(CPUState *cpu) +/** + * kvm_create_vcpu - Gets a parked KVM vCPU or creates a KVM vCPU + * @cpu: QOM CPUState object for which KVM vCPU has to be fetched/created. + * + * @returns: 0 when success, errno (<0) when failed. + */ +static int kvm_create_vcpu(CPUState *cpu) { unsigned long vcpu_id =3D kvm_arch_vcpu_id(cpu); KVMState *s =3D kvm_state; --=20 2.49.0 From nobody Sat Dec 13 22:55:07 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=1751564040; cv=none; d=zohomail.com; s=zohoarc; b=Xr4etr757FLgdauVdj9PR8LGmnvthpNr+e7+pIDZDhcNPVS8+/z1Zr4zXiWsvkqG9LFc5gHLbQ7jehaUnj2CxNEfehke0qwbYE657UXZ3/AONuz6UoNH1n189ZyOXZAtEx/UypVZ9k/+560aQgiPqGHjEx1/RzwSBroQYxXiJGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564040; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vZulNH5mkAwF/TzCScDw4HrR7IGxHx1ghZxE2rlPXYg=; b=AaahN/RoWXwWl+UIDtAjMb/65Ism/hvvSKRV3NYRcV8UVk6hb2bc0I2M2bz1yPOokQ+2OsoIOGhgaHJNYmGj0tddXw5c27+XgWMGgImdA7MLkStjnimMBQ/EYWJPZwRG2jjpDqA3+i/rR7OK4n6bn3s1+qb4Gy1PqXJcfiljgTE= 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 1751564040544234.07812665833762; Thu, 3 Jul 2025 10:34:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNoY-0005Wf-5b; Thu, 03 Jul 2025 13:33:39 -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 1uXNoT-0005W5-H6 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:33 -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 1uXNoR-0008BJ-6Y for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:33 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3a588da60dfso39852f8f.1 for ; Thu, 03 Jul 2025 10:33:28 -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-3b47030ba77sm342996f8f.17.2025.07.03.10.33.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564006; x=1752168806; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vZulNH5mkAwF/TzCScDw4HrR7IGxHx1ghZxE2rlPXYg=; b=SQ+edPPtYFTzZdiFudWCR1aWyUwlNWy0IOZzQUiKgBh/jmcOVsQug4mOmSiSRjLWl6 ydkdseMgFt3WBn2cWmDIAkAtJrJvgvVLPkJIDYrDCqfaP+rV7k8i0H/7YI9K+h0R7cTE YiVMCf+esHSmPgnlX/qfkKmadTrM5GvIa2fjv2H7DfryDsWnY4+qGlzGGFqFn+fRftsO QbR5Nw6VqTeJICVFkuOFaPxgplgkakFPZMPEa09jihfruTUYDDsPdpWCUmgigZbd/bzY SZLTfV4Q26ptQPd1dcApqOO0e9/g2Mru228cKL2cW9jPlQpXu0i3q40iDY+IQUEhDIY0 h8/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564006; x=1752168806; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vZulNH5mkAwF/TzCScDw4HrR7IGxHx1ghZxE2rlPXYg=; b=gsW6S6FZf4zRJepLtTm4pZl4If/gFdIu8BrEd9mS+Y0VVq/wz3Az7F54NIH/ZvK0hv 4OfXa4i191DkMZpyu97Zzdj2a+A2BC0+fIGT6TscyXPC+Lz0LcGNcP0ESo1I8e/YbCYM cnEXHN9qrj1uxqhj7ECXixwEunoJ+Sfvv8WFGjE+rfd7T1VycCPCt44E6S31uU53Sz1O FQCRIpfGHIlSBwSVh7TTfYtBVopV3wM51foBfOpl3dk6v+OLPBKjZP+5685/wQB4H1/u DMZv3R37nh3Xj6wmQ2omLvlDjmKJFpHJAQvpWEUUQl8dMJUD7yT6Y0gYmmfMSWSEJ/GQ pMcw== X-Gm-Message-State: AOJu0Yxg5ZLkkolsu9bTeuJodO1ou+PNQr25RfxWJ7ZQk5tg2i5lOCQo k8XUBvL/h42p1rDTcy0XSHd+pQNLUcYRywTwJ+fULJGXaazt5P8pIhiwzTDR9N4jfBKQPbWj/9H sVjP8UtU= X-Gm-Gg: ASbGncvKeVpm+U/0Y3p6RLwmJDGlnUTa5/8IhinFouKKurIyQEiPourO7q45uwhaZVO E5CndVIxV7r4ABdSDXyo/eU4JiFMqLnuQ4Nl2CoBlWgVBxt29y+EYncmhRsyAN9TUxZxRKCec7i HHRftcpTT5VbxxPapgCVRTobRuIZViggIa7FlzbkpyuhtvRj+5uqZSobW7Y9hSsT4Pq2rWPegs1 82xZYziZEZfZXrxu/71RWJLIoSqjKUxeo506Oion1l2yqkNEKPjEpDmp0a+vX6yZiXip3mKCaZX GnQ2OlAOQA86h6Nc+x/Drivn3XDas6LjPSJIRAvthRKjQ7cjc9lvA0R1HYxGFQKZOxv9ouFaMve 6KQaI2TIg38IYg/czUzIbvzMHQcpk3YFoxCBEUWOEUHAs8Ug= X-Google-Smtp-Source: AGHT+IFJrXavrz4gcHEYbc6mLp3BMnIH4hlLyNy+5zffQ8hUE11DhK5AiKJrHVi2KGZKSRJD/i72dA== X-Received: by 2002:a05:6000:230c:b0:3a5:8abe:a267 with SMTP id ffacd0b85a97d-3b32db890fdmr3631644f8f.29.1751564006205; Thu, 03 Jul 2025 10:33:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Eric Blake , Markus Armbruster , Fabiano Rosas , Laurent Vivier Subject: [PATCH v6 07/39] accel/tcg: Remove 'info opcount' and @x-query-opcount Date: Thu, 3 Jul 2025 19:32:13 +0200 Message-ID: <20250703173248.44995-8-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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: 1751564042115116600 Since commit 1b65b4f54c7 ("accel/tcg: remove CONFIG_PROFILER", released with QEMU v8.1.0) we get pointless output: (qemu) info opcount [TCG profiler not compiled] Remove that unstable and unuseful command. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Dr. David Alan Gilbert Reviewed-by: Richard Henderson Reviewed-by: Markus Armbruster Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- qapi/machine.json | 18 ------------------ accel/tcg/monitor.c | 21 --------------------- tests/qtest/qmp-cmd-test.c | 1 - hmp-commands-info.hx | 14 -------------- 4 files changed, 54 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index d5bbb5e367e..acf6610efa5 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1764,24 +1764,6 @@ 'returns': 'HumanReadableText', 'features': [ 'unstable' ] } =20 -## -# @x-query-opcount: -# -# Query TCG opcode counters -# -# Features: -# -# @unstable: This command is meant for debugging. -# -# Returns: TCG opcode counters -# -# Since: 6.2 -## -{ 'command': 'x-query-opcount', - 'returns': 'HumanReadableText', - 'if': 'CONFIG_TCG', - 'features': [ 'unstable' ] } - ## # @x-query-ramblock: # diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c index 1c182b6bfb5..7c686226b21 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/monitor.c @@ -215,30 +215,9 @@ HumanReadableText *qmp_x_query_jit(Error **errp) return human_readable_text_from_str(buf); } =20 -static void tcg_dump_op_count(GString *buf) -{ - g_string_append_printf(buf, "[TCG profiler not compiled]\n"); -} - -HumanReadableText *qmp_x_query_opcount(Error **errp) -{ - g_autoptr(GString) buf =3D g_string_new(""); - - if (!tcg_enabled()) { - error_setg(errp, - "Opcode count information is only available with accel= =3Dtcg"); - return NULL; - } - - tcg_dump_op_count(buf); - - return human_readable_text_from_str(buf); -} - static void hmp_tcg_register(void) { monitor_register_hmp_info_hrt("jit", qmp_x_query_jit); - monitor_register_hmp_info_hrt("opcount", qmp_x_query_opcount); } =20 type_init(hmp_tcg_register); diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c index 040d042810b..cf718761861 100644 --- a/tests/qtest/qmp-cmd-test.c +++ b/tests/qtest/qmp-cmd-test.c @@ -51,7 +51,6 @@ static int query_error_class(const char *cmd) { "x-query-usb", ERROR_CLASS_GENERIC_ERROR }, /* Only valid with accel=3Dtcg */ { "x-query-jit", ERROR_CLASS_GENERIC_ERROR }, - { "x-query-opcount", ERROR_CLASS_GENERIC_ERROR }, { "xen-event-list", ERROR_CLASS_GENERIC_ERROR }, { NULL, -1 } }; diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 639a450ee51..d7979222752 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -256,20 +256,6 @@ SRST Show dynamic compiler info. ERST =20 -#if defined(CONFIG_TCG) - { - .name =3D "opcount", - .args_type =3D "", - .params =3D "", - .help =3D "show dynamic compiler opcode counters", - }, -#endif - -SRST - ``info opcount`` - Show dynamic compiler opcode counters -ERST - { .name =3D "sync-profile", .args_type =3D "mean:-m,no_coalesce:-n,max:i?", --=20 2.49.0 From nobody Sat Dec 13 22:55:07 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=1751564545; cv=none; d=zohomail.com; s=zohoarc; b=Snvf6JcSOLSHVtxAAG/qo+BCJ+FJcqe+n1zF+V99y6XoXEeAI0SBDQC9hNJzuEFXr69mxk5PNUjlbx5F6Bf/dLiwbSjU/iK0gSjdg+AmsaIRzUJS4ZcraWH0fOfBnluQWQz4hEJTCf2nlHMXdlgxpQqMa5AamsXicHXNAW3+wes= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564545; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CdRe1Eyp3xb/gGYQ1LjLDITtq8GdvFlAG//ViqGqDSk=; b=AsOY9GxTqDGqsCzzrytt0Be3zOjo2QR7Ri4qvf4cV09Yi7iHuVaDwdoiMxizi5XvJTnKCyzYxMxo0It+pF2DmDdY390acDJaRdbBJqr4bMl5HDEUPyKO9rooEJosLHDDZts/IO7KBoa65JwCiRAP0t1wHRbxo27+Uv40RawEbHo= 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 1751564545987806.4415048670169; Thu, 3 Jul 2025 10:42:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNob-0005XR-VE; Thu, 03 Jul 2025 13:33: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 1uXNoU-0005WT-NO for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:35 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNoT-0008EE-4S for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:34 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3a4fb9c2436so33385f8f.1 for ; Thu, 03 Jul 2025 10:33:32 -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-3b471b966c0sm320312f8f.52.2025.07.03.10.33.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564011; x=1752168811; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CdRe1Eyp3xb/gGYQ1LjLDITtq8GdvFlAG//ViqGqDSk=; b=pxKSZnXbaUo3vwtV69vxKhWu5bbKARFobIh44VefwAk/mrTlhkwbZ9AyRwF033vOp5 B/dp0/mSjniCYCgNbXAF6jAe858gr9Gwenb6UMIzIYoOd5UWFazqZQKtBy5a5DuzEOhW YwFBA2R0kRj65K4wEE/l49BVxJoce1/Y4twoDYObAsiz2yccnAl3UztKlT5daWRZAMnc EBa+kIiLd1i4akIq9T+sEFwij16lR/ve5Jcv7yCsCG5XNJqfeoi+QRJQzALRHX9bavFo kbj4tDsrnbWhQB0HnUBhSudA4S5kIvldWM2/5G4qmKrT5sLTlD+PNyzq94HhSwHVa0D6 xlqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564011; x=1752168811; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CdRe1Eyp3xb/gGYQ1LjLDITtq8GdvFlAG//ViqGqDSk=; b=cfQ9fiB1KXvDRKosF5om2mQFdrQka7sJBvQvxesV0Ok7tKZvSowdu23KHFo4tkUfXU w+QFXJ/dlwF2U8FWlVah1czLJyhHshod0cOI0s+Oe4vTE1uhlK1GkaN2i1KMnQ1diq32 oPEQTMDC35h6T4zXSsL1Qrh7dUDjayxBNQRPaw/Oweic5eqf8BYYeShw4kC/JmUct8e3 1HZwvPZTFrxu/cMc6jDggSzS7JCFt6zjZ/2onO0Q0E0MtpAzfXf5KCCQXqrdVyYQqQuA pcIq0eppKOkId13NoVUvv30HzWHiImXst2pazs2fubIyrJqSocJ/g/z+qTKpkTibo0uN 90pA== X-Gm-Message-State: AOJu0YyLNOp0ft4IXm/7b3ciyaLUcuxctS/cE1ict7CP7swu5oLCtcHC lJ+4RLmQHnmHgW4QnDznLi8WkTpIJYQfZ+Q9GYpcj66JYwkCEM1QXLaU8esYtma9AETz4CVVzdQ jIrcSTgA= X-Gm-Gg: ASbGncu764jkKGzfe0XXxsSDRqlnJ91rAh+9O9/i38OwsjsVu7PkRrAclCb6wAC7Mxt uKWcXR4bOsiRQSSSWa+qHc+fFSsVVkKAXaJM0DGuMRmSzqwka9XocY53Zn7NyZPSdQ2wantpDxn oTsJH1RWRnFjPDj2A94pubIgebG5niSsnGxjrAYVf6+h/V9UoYBA18K3ScBnseBaAOthwOcg1tH b4RCqt1VrIiuLUPCZyjPtkW2lXlCBOFUUhCuqKB0C3UNaknD4k+VxqUrM78oAPXiUIyYvjnX2bd ILgi5DoAsNqoK4hmzfAZwHYA4BtJUfLiufCydwIcy+4Xlc5b0RqElJXETAeiRs1YyoiEqFw4B2D XqxCPhVrdxZew6VN6DWvoePAs1g3hxZYSekYuSig2E2TtST4= X-Google-Smtp-Source: AGHT+IFlBhhDe52JTc049hOOly8Sw7KDsmpNVnTPFbLoZLu/v3WEo9FRpfyRo8F61cd3YJZvEeggTA== X-Received: by 2002:a05:6000:4022:b0:3a5:2208:41d9 with SMTP id ffacd0b85a97d-3b32f28d80bmr3833770f8f.40.1751564011250; Thu, 03 Jul 2025 10:33:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 08/39] accel/tcg: Remove profiler leftover Date: Thu, 3 Jul 2025 19:32:14 +0200 Message-ID: <20250703173248.44995-9-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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: 1751564548003116600 TCG profiler was removed in commit 1b65b4f54c7. Fixes: 1b65b4f54c7 ("accel/tcg: remove CONFIG_PROFILER") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- accel/tcg/monitor.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c index 7c686226b21..344ec500473 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/monitor.c @@ -141,11 +141,6 @@ static void tlb_flush_counts(size_t *pfull, size_t *pp= art, size_t *pelide) *pelide =3D elide; } =20 -static void tcg_dump_info(GString *buf) -{ - g_string_append_printf(buf, "[TCG profiler not compiled]\n"); -} - static void dump_exec_info(GString *buf) { struct tb_tree_stats tst =3D {}; @@ -196,7 +191,6 @@ static void dump_exec_info(GString *buf) 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); - tcg_dump_info(buf); } =20 HumanReadableText *qmp_x_query_jit(Error **errp) --=20 2.49.0 From nobody Sat Dec 13 22:55:07 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=1751564035; cv=none; d=zohomail.com; s=zohoarc; b=cOnIw/WGLC8atCgKt6K+5DJKS2n7g02xjUPMIbmMXITaNfUjRQqI4UsQQS9RyiNCZ6uqykVswIYTGzGkA6icn602bi750nP1yymoXmkvYaneVtpuffpdgSk3r2zi6kIxzL7a6tPfzd3uuBGVT86R7tGSD54MTMiWkovyA6B7Fho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564035; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KA0b8Mx/diMOpz5eVRAgzHisGcdWtT3pud+mD+Gv0yw=; b=YNm2ElhQGfv8tVXLIkrmUo+p0CnrsbfMwfAC1kjbvkypJUCgn0XNhB9yhVv0RCXuVXcRO+lHjAljJT/53REjCf3R0qbEGmOrMLq/AMrMDuuclrjw7OtYygTv31YjDt+4uc+d3/FjnnLKyrjNvbbFAUACnMu7buBSLmZ7aW46L7U= 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 1751564035500635.6749744341795; Thu, 3 Jul 2025 10:33:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNoc-0005XU-R9; Thu, 03 Jul 2025 13:33:42 -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 1uXNob-0005XI-82 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:41 -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 1uXNoY-0008JI-Ez for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:39 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-45310223677so853135e9.0 for ; Thu, 03 Jul 2025 10:33:37 -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-454b1698e24sm3369755e9.34.2025.07.03.10.33.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564016; x=1752168816; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KA0b8Mx/diMOpz5eVRAgzHisGcdWtT3pud+mD+Gv0yw=; b=iY5J1U4cZwuYbmCqVT37sh/UWtaDghXCGDA1Wtc3y//feETEYbjrYE+OpRRAPoS2Xz r8bPIYGA02DytedHL+wjdlbDbRBxpwcj8USkeKCNuDy7q83mgc1NJRaptXujlTuc4VQC sXdxJlkf7xTe9NAr2E1DF/XnqNKMFmULqrI3K0QVCDdjwx4xmjW4wMSNVAqLVkruw/QM 5DolwY7vyvdouUqWQo0F57sUVyRuLrFIe8feULVw/+F9HjFTqY/NQmSp50iMzjXCNZXr kYO5Eisgjn06HXtfXYfssfRnInB/y5lNEVUBP+1qgFAfqNh0tiWCAPCp5cbzdl8RK6rb qlmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564016; x=1752168816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KA0b8Mx/diMOpz5eVRAgzHisGcdWtT3pud+mD+Gv0yw=; b=iuv3ROsIBaPYMnchEZtWSs4OSKAk8m+/TC3VMoOXTpQSg0wu0fAnZfTA8BEKFBrT9V Mmb76CixIzF8hlMZT1jfEN+aKpH+OdZ7ClZ6Gd/IVsCPHlRXOKLj2yX9JcXTs6tCudaJ OFTfXlSWG96M3vH8atOze50NWdNG1oQ469iKvl9jhAnGv1CMH21/3DmAxqoFh3PeR9n3 /lE/SUOwkD6ZCJhEL1zr1m0B1V8EoWYgmJmXK1LjYRjD4dBWxhzHH0N7v8hcXajFOeYl PzZRUOZxjUvwk2QrQt5yHNmSiUFxJMFJCyuj6xmK4YH9c5Da+8gQFwFL+klc/gVj06k8 shYg== X-Gm-Message-State: AOJu0YzHdxtZLMqInUSVms0lDneZS8VMjPj0RO58+AGu9ixYgyblhAz8 FlNz1DlYOOlOUsIJE0FudGBDxxiVcPzQ+Y/W6ewU+f2zMSd7cttL09W6dm1QDt5idiXESvj7iMM XlVzMJKw= X-Gm-Gg: ASbGncsafPXiJjQ/7F8JCgmte5xjjUqKAiMOYq8heqGb53hSYB6GqY1B0jHDOlivLw1 lYibxNkqMRuTJmdW+ZcuF5n1KXeYDglSCTH2j8SLuMAwIfYFztjF7296oZrOarfiYnOMtYvjUJJ hnQRvkodgWPbDYsSWvx6DsWfGDxl1IjqjD0mx42EnFKJjsAVJ8hMD6/ONcHzX35W/UuZCn37RAc nNN/vE6WI7ZowX83RXLpq7MTLE0v0D2SU+cNijSLbHliKVmLhOECbIlIQT64NkodtoclUlzwu4S JKPQXrekJAmjTIKfstzrkjKmsnAzDAFU7uRFoQe2V7I7ztKe03l5nOSqopeIbHJ6HMlEeW8uYCP mnUDG1V5j+SOqPnw7sh1nqTN+hkXKiKmyVJyW X-Google-Smtp-Source: AGHT+IGrLN692bB7k8Ayl5O7V9o9uvyHI0QE3MSkBBI4qxyi7en3ThLvxe5qeQ6PPc6pGdIGwE3q0Q== X-Received: by 2002:a05:600c:4752:b0:441:d2d8:bd8b with SMTP id 5b1f17b1804b1-454a36e2c39mr83163645e9.8.1751564016216; Thu, 03 Jul 2025 10:33:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 09/39] accel/tcg: Factor tcg_dump_flush_info() out Date: Thu, 3 Jul 2025 19:32:15 +0200 Message-ID: <20250703173248.44995-10-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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: -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: 1751564038087116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- accel/tcg/monitor.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c index 344ec500473..6d9cc11d94c 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/monitor.c @@ -141,11 +141,26 @@ static void tlb_flush_counts(size_t *pfull, size_t *p= part, size_t *pelide) *pelide =3D elide; } =20 +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, flush_full, flush_part, flush_elide; + size_t nb_tbs; =20 tcg_tb_foreach(tb_tree_stats_iter, &tst); nb_tbs =3D tst.nb_tbs; @@ -182,15 +197,7 @@ static void dump_exec_info(GString *buf) qht_statistics_destroy(&hst); =20 g_string_append_printf(buf, "\nStatistics:\n"); - 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); + tcg_dump_flush_info(buf); } =20 HumanReadableText *qmp_x_query_jit(Error **errp) --=20 2.49.0 From nobody Sat Dec 13 22:55:07 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=1751564575; cv=none; d=zohomail.com; s=zohoarc; b=YGoOguMX1ZNlE6+i4WOmIjCrqqTHp24jZVvPw48k6W21USxyxijhzHzYgTHDgR4LgfelmEESCZA42wsquIiKLF+isg/p4pixq8Ju75NRpPZg+Sb2wDiYpbUYNm9hqzGB9d2iiaeutcmSnMkERFKw6844Xyy4a4yf8VlsYC/Gi30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564575; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PLpptP7XgFdYuwngCEYE9JrU2GvVIYMaqCxqGWt5OzE=; b=lrvSBJDJT73XFdzRQHW+xj3PrRNpkQfzSVjgwrRITQ6oGshWLKaDwhdnxFTvIz3GInDo02aGZrWZZDyj3HWWv5BdnVdtTsigUx20yJ0mXLQA7Zcetb88o2T4fPPRsRuqLIt6NLiixNrbIeR6+iGpMjm1Lvs1JqOvSBnOcvm+wdI= 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 1751564575490543.8836176916409; Thu, 3 Jul 2025 10:42:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNoj-0005ja-LO; Thu, 03 Jul 2025 13:33: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 1uXNoh-0005fR-EI for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:47 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNoe-0008Kb-Ld for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:47 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-450cf214200so656415e9.1 for ; Thu, 03 Jul 2025 10:33:43 -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-454b1699162sm3451435e9.31.2025.07.03.10.33.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564021; x=1752168821; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PLpptP7XgFdYuwngCEYE9JrU2GvVIYMaqCxqGWt5OzE=; b=vFAUlq1OM33NFgwqk4P8rSWtGwJuYuMFj/h8SfrcLsKsFhWmFq2dQvoq8JxyTtLom1 4D1AkqyHi/ZZSbvkrMBgCqWX+Re58BGimjncqle+UWEyVdHxmT5jR9q28yR8L6cppikz EyDN58wYL6+874vLB+9Dk7kk7uTDhqGy2WlY4j0pTQzCHEyQ51jxCvKuenH2OEpLzNx8 AXbOOhk30fT9Su0flXCU+tmRIIdN7Gj7pFEJ6/z63cRyaEQtrtciFR6dHY/LdRzB/vv1 yFkOq3uhuyObur9jB4vXx2fCrqexfgKTKsnSbaciMnp2zzHxNcDDj9Xs/tqK1OdFSSqb nKTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564021; x=1752168821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PLpptP7XgFdYuwngCEYE9JrU2GvVIYMaqCxqGWt5OzE=; b=GdU48n5HiVaNVX41TG/NKHa8uaYaVSYD3PILYI43kmYEkK6JQXLbFV8SnsJvZsXguF VSDVEEZHoJja0igIVaKndheJzIg4EqiOT1WDcQtRmYAz3f5rcnSYiTLniDTsLvTGJexZ D0SDv97oRXXAW9/hP9/OAAp795YofBAci/eWxvCIqiw4OJKzHOHmlJfH8XBRacq7ZxbS wOXQEPg+965zkDT36dcHXTLYbiDdmx2/I2QGSB4Qc/Bp6ccccHpa6eacAYMdSkCDmjly 14T56EN/It8Okkmu9g+nL8sPtQFdcbkQs5NeXtfSB1R95IRwA5DZyjqPD2SdWi+EgSqO aRqg== X-Gm-Message-State: AOJu0Yy/ylkxtrE8a4D8EzC290CA98frY6gR1xAZkjBiujccFDH6omNV qRnDMVJcoOANXUGWIf+cSF/rIC3vwgpaBVCAKsqUho5qWENVNl+q4TOjZXmW9lTvoLPRLg2GzSP NiS9vBpk= X-Gm-Gg: ASbGncv9d8OwOrJcdUhGyZ6x6oHF4vpy7ST45glZNFCUcnh8ScmNS9KAqKhdPV/qG5l ZW48lFRK80ESlyjguuPbFrvmJZMf0S2c6cGnecVRteruV/Az9Zo89SouLMfaJ8Wvqp9to6QVpu9 WkLs0QZ/BGM6u/OfRHb6vFcfoELEvS7Xaa+v4j2D1iaE+1RSQYShEF/cgtYYuuDVwsNnsrDUgbB Q1kjybys90AFEY0n4DnA30du2Qm/hK0eOKXgHqqHyvISprsTdTCBXuwp5CHZbd9AE5FCT/QlCcU yWBJPcyIPaOWA8tx+I5BisU7ciwKnYcBlCTzN9+o9WYlAkcgLp+WocTBzNrkbqg9ORQ5Z+as/kz RgmJxUt9KMJvtqdtfepHauw2nBebu8YGvynn7 X-Google-Smtp-Source: AGHT+IEoniw2Tkah9+tyteyfyEsV9dvLebSbbNOA1tJYC6nokK7s+lGtREJBLSBQ2OHa1jLShrmsmQ== X-Received: by 2002:a05:600c:8883:b0:454:ab1a:8c39 with SMTP id 5b1f17b1804b1-454ab1a8f9cmr29466115e9.26.1751564021219; Thu, 03 Jul 2025 10:33:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 10/39] accel/tcg: Factor tcg_dump_stats() out for re-use Date: Thu, 3 Jul 2025 19:32:16 +0200 Message-ID: <20250703173248.44995-11-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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: 1751564576292116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- accel/tcg/internal-common.h | 2 ++ accel/tcg/monitor.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index 1dbc45dd955..77a3a0684a5 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_dump_stats(GString *buf); + #endif diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c index 6d9cc11d94c..e7ed7281a4b 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/monitor.c @@ -200,6 +200,13 @@ static void dump_exec_info(GString *buf) tcg_dump_flush_info(buf); } =20 +void tcg_dump_stats(GString *buf) +{ + dump_accel_info(buf); + dump_exec_info(buf); + dump_drift_info(buf); +} + HumanReadableText *qmp_x_query_jit(Error **errp) { g_autoptr(GString) buf =3D g_string_new(""); @@ -209,9 +216,7 @@ HumanReadableText *qmp_x_query_jit(Error **errp) return NULL; } =20 - dump_accel_info(buf); - dump_exec_info(buf); - dump_drift_info(buf); + tcg_dump_stats(buf); =20 return human_readable_text_from_str(buf); } --=20 2.49.0 From nobody Sat Dec 13 22:55:07 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=1751564074; cv=none; d=zohomail.com; s=zohoarc; b=PThN0DkXBkqpqXqma8ANFWkNqUAEqHVQCLqlrkwjEXXUf4QrNpSTP0Nl5ve2Ou8ScJBwaTUDklzdX7NSVLrgrsDb4E1/kVtuyOZWdH1k6Nn6Hl+B9ja/NhMwHTW9xcuJwYXI0oq7JjvraR3IXs4n4KlprHXeXROp8Epj01jxaIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564074; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=A30taD1aPEEofESOAsc80jgDmI5t1sj6mCcriwxyD+g=; b=CffTESXgXl60YPbuBni3hRRhLdSIeN5eTs0tm5AiU9dZXJbCSkqwSuc++a+u5b7Yv5lxTbDqzv5MPYoqPLgsGKDdvkP0uJoIVmkaoEV6SDK/qZe6V0oTeV8zpfv3wEMEPI7ofVzV3hypfTjDBrIrzvjHETJfMroZ/wU2AUJZnY0= 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 17515640743990.01933571857921379; Thu, 3 Jul 2025 10:34:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNox-0005wg-JA; Thu, 03 Jul 2025 13:34: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 1uXNop-0005sz-C2 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:55 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNoj-0008Kx-Jq for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:54 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-451d6ade159so1227155e9.1 for ; Thu, 03 Jul 2025 10:33:48 -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-454b1890626sm3350015e9.40.2025.07.03.10.33.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:33:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564026; x=1752168826; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A30taD1aPEEofESOAsc80jgDmI5t1sj6mCcriwxyD+g=; b=zeWM5gWJUwZZvjskGiY6g2hxDYXN0Rnadjgv/g/yQpBjN2CkDfNBKfHVQpslUjd/jX fZ87LHGArGy8hQp3dYYWbZ3+X4zXa0lPlw1gmAra+KARd3bccRIbL15wb6b1OSTSDCyg 43xufZ1pG98appM/wWsFadFpwS498+EWc8Xev4SEdvAjvwyl+fqDRV7EpWkim4qL3MSM SXS1pJhbiKYAx18gsRKZwlpCsBmPRTYpdJGeWaz6+Y0itFxhbBnVN+cRpiGoeH/gCSX4 hWP/YWcS5/rDoLxf5LfRcc8UJ8IW7kibdpayMhz8DqKl/8Bi/s73Hk+yu+JSWc/Eb6j5 Y9CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564026; x=1752168826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A30taD1aPEEofESOAsc80jgDmI5t1sj6mCcriwxyD+g=; b=qabfuTJ0pWdewgLv8nWX0fjYmj/RrIkTRMKsHbAcJgW7TqN/3VL+zq0K5g/uguKyXD L2lvROd8McvsHv/t5BJRk9o8knDAuEGqNvLsWh/upBnWKQkEU4BobvetU6RZdvdtmV06 6xnVCbnAW45vru3f52oVyItmEtVR3KPtN5SxLbMtGNGU8/2lhIFZEry9/igQnDiu2fC/ ylQEUwjXa9IBob5ZL7JOkRS4Y5gyZBNArCaZn8LiF0u0o8LOD34zbyHiFZy74XA67Tmq gi9mKF5A7zUE7EACghqHnOND5RI/Q4HZrprjk7l/Ea/tInGaMjGlbUU6IqwpqLbIRFcT 4L0A== X-Gm-Message-State: AOJu0Yxli+T/vA6pXP51BrWz/HDqXwQgI57QguGIAPz9gG58ZgggODGv CkAvdFCPjVG6kaRroITo1e4qzs2ov0w2Kzp8H83KDAWSMclsyBKFTJ1WuLHTKcHxk53bNE7qAyT UIXTTFLU= X-Gm-Gg: ASbGncvHivIgDCPrEjH3mWdSUEk01kOk1IYZfoJylvxD3zAzevjmqmKZYYf/1N/bPzT 0cogQ7Buy+r1yLBFmi64SGPKb+KHjUqvSjzXCtox0icZVNO5gTFb7tsQqlZ5cf9O4a0sWktTBj6 5F+rJ7PxabGYJ9PEce6a3XnQXnloVI0UUagEbiCOe3UaGhpXzGPEcmVZwDMGeGyh1fWa4Dqan/8 1leeUT5D4RcffoyQ97sMmkDAgn3eJjEsk/d55gaQ4UznCwDOogdJ096LfY/dHfO/zuSTRjMD6RM js61RcUK5hcz+UoBdfcIsj0Y0xemb/LQPO5p2EqZVJ+zMJgAjA9W5VQIi1+gEPtXrc8R8EE2IKk hBy+c9VskAJFfxLVouRISvt3ADYPfrH86ZFkl X-Google-Smtp-Source: AGHT+IHwIDNoVury+sO++O+38FFCgpt/bPUeAOrnvgPx/tPb/xI5mMAiDAMsv72CdRz4/LUz9GTMUQ== X-Received: by 2002:a05:600c:828f:b0:439:86fb:7340 with SMTP id 5b1f17b1804b1-454a430eb1dmr83743085e9.30.1751564026303; Thu, 03 Jul 2025 10:33:46 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 11/39] accel/tcg: Extract statistic related code to tcg-stats.c Date: Thu, 3 Jul 2025 19:32:17 +0200 Message-ID: <20250703173248.44995-12-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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: 1751564076612116600 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. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu --- accel/tcg/monitor.c | 193 --------------------------------------- accel/tcg/tcg-stats.c | 206 ++++++++++++++++++++++++++++++++++++++++++ accel/tcg/meson.build | 1 + 3 files changed, 207 insertions(+), 193 deletions(-) create mode 100644 accel/tcg/tcg-stats.c diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c index e7ed7281a4b..adb9de5a1c6 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/monitor.c @@ -7,205 +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" - - -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; - - 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); - g_string_append_printf(buf, "TB hash occupancy %0.2f%% avg chain occ= . " - "Histogram: %s\n", - qdist_avg(&hst.occupancy) * 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); - g_string_append_printf(buf, "TB hash avg chain %0.3f buckets. " - "Histogram: %s\n", - qdist_avg(&hst.chain), 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..284ac435bdb --- /dev/null +++ b/accel/tcg/tcg-stats.c @@ -0,0 +1,206 @@ +/* + * 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" + +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; + + 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); + g_string_append_printf(buf, "TB hash occupancy %0.2f%% avg chain occ= . " + "Histogram: %s\n", + qdist_avg(&hst.occupancy) * 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); + g_string_append_printf(buf, "TB hash avg chain %0.3f buckets. " + "Histogram: %s\n", + qdist_avg(&hst.chain), 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 Dec 13 22:55:08 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=1751564683; cv=none; d=zohomail.com; s=zohoarc; b=Zu+MkCY/P8A71bGlyBJ9LOexHEFfCZ0LYoaXm3vvaChrizQeUjVxclC5YPRlXM7f1ixxJJAX5sGH+zMfgjq3dxnpzDtKjJtX5QoWOi1lzVkLf5+DYs4/FVGyJ8UourxCmuG20o0iJ/CV54P2c/Ri8WIUB9RTyQZz3vwg3E7WMmY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564683; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XcfnS13GIUjtg983McguNHeXSVu+J5s+ZUMQk0qRbKs=; b=js/uZaEaa087QBJ1VATuSL3TzK+NXFBFU68n4nQFFZ0sNuXdChBLdcA7q41I+sUWVobPgTlF0WcG/M0hnCzwe4V/jyT4Olk4UOcWWBr3J1xQEJimXMlGewKgma4eEczsdnoS9EPxg9hOqPoEfZl3ylD3nABvJrLTklynTjWV160= 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 1751564683690461.68292093108676; Thu, 3 Jul 2025 10:44:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNpN-0006Jo-PN; Thu, 03 Jul 2025 13:34:32 -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 1uXNos-0005tS-A5 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:59 -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 1uXNop-0008LT-5X for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:33:57 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4535fbe0299so488575e9.3 for ; Thu, 03 Jul 2025 10:33:53 -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-454b1628ed7sm3556035e9.15.2025.07.03.10.33.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564032; x=1752168832; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XcfnS13GIUjtg983McguNHeXSVu+J5s+ZUMQk0qRbKs=; b=pZoR2s0e6kbufNWsEzzPXiy1PkuOvxXEiv52Uz5ZVPCafO8GkF87RoZoygMx9FXlyO SQ8m2KUhdjPPfmdFMcsrpUxGJZQHg0fSbQ4fXefMWtKjIV+XHtl8jiI9CYxbWgDjefTh t9clMaYrNKfTX3Vru0DJMJcZo7OIyoIeO2q1oNVuMpVovSl7SzF0k0auWSTgbvO2M0tz 6wmlGgXr5fEo9pLL//fy4IF8frfgsce0HDLXgferqs9eZCz98xs43fKYF5IMDx50o1DV 8cJJOsZBqQhGcLie+u8fSliqk4foCTfJ3Tb+UfZleecijWYtdVecxowvZJrL4noHX42z 4Vhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564032; x=1752168832; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XcfnS13GIUjtg983McguNHeXSVu+J5s+ZUMQk0qRbKs=; b=rKHdNSXfMkPrsXQGfoVZOVnZZPdQ7r/cxe2l0HCkYKPF/UpLMjIZFtOQV4myqJ2nWk uU7vR3Uit8AqGD6HuWrlgrzoiseRttEERDUBhkgvyo4BPWgfxvqirkjd3XsBc6wLyeko pKL373WKMoERnj80R13Qu/M+5o3px1h8YI0CpQiD93u2Xtyz7BB8B6uWbW3WjzEbHFuI b0DJzYukwN40Q9uPzsf3qW4819vKoi6f5qX6m3YRCy2mOjFGOOoM1XtwJKmqdqLKpdTw 0VdmjEck/PxTypBppkFMyp8nFqiAWw1qDA+1E9GcFa21yvMa0uFqDfd56V54wrY2MhpK wL3Q== X-Gm-Message-State: AOJu0Ywy/ZSIUq7E2OdeqmaWDwErDOejMzxQ2+zZDli7ZbFmBlWVJr4P yJUmWBCPdmWtUv1A+O6pnOsTxPXArSV9/L/Fx0atbgs8viLc1hgtLL4gYhNkwK5y0H4zG9DF019 tiQSKurE= X-Gm-Gg: ASbGnctYYdzK/3671tzgjYjT+dcdwGwn3D7iDJj7NjjmEcmSQtpiBg7T4aOsLngjlix MYmt3/3PjvBNHhaPx3DH9cdJ5XPvFTm7R6H2s5ByuH3KI8Z8sfFF6m13Gfhk83LWEuc7pcetUpc ARM5DK3qmchYKuw3z+K44CGp19YBsovCosZrzJHTID8eeBgKxbOZLX7fvtOB2Son3YA45ry1MnZ icXYOUCZijk5fLSV5FCM2dij8ZqwX2wxfrjQFL4nrcEHm23/nqciGCBgAW5vZLNNI7wg2oxsMBQ OTIncRyMliHiLCA9ppiGEee1fUhNF1bJsuXvDbK4bL26zi+e9VMCaHBDIUvOyS0RjzlRtZoAqsf 3clBdJMmsdPrjK7JwVLx7BHxxiBApxoslPeN9 X-Google-Smtp-Source: AGHT+IEFHjox5AGA4sYKqeK/FG7AbGqmsv8ejvJN4rlnX1vF5JW7xikwMjQzSAdkM74+gnv+3GpQ/A== X-Received: by 2002:a05:600c:1554:b0:450:d4a6:79ad with SMTP id 5b1f17b1804b1-454a9ca8543mr46409505e9.23.1751564031784; Thu, 03 Jul 2025 10:33:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Phil Dennis-Jordan , Mads Ynddal , Alexander Graf , Peter Maydell , kvm@vger.kernel.org, qemu-arm@nongnu.org Subject: [PATCH v6 12/39] accel: Move supports_guest_debug() declaration to AccelClass Date: Thu, 3 Jul 2025 19:32:18 +0200 Message-ID: <20250703173248.44995-13-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1751564685848116600 AccelOpsClass is for methods dealing with vCPUs. When only dealing with AccelState, AccelClass is sufficient. In order to have AccelClass methods instrospect their state, we need to pass AccelState by argument. Restrict kvm_supports_guest_debug() scope. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- accel/kvm/kvm-cpus.h | 1 - include/qemu/accel.h | 1 + include/system/accel-ops.h | 1 - include/system/hvf.h | 2 +- accel/hvf/hvf-accel-ops.c | 2 +- accel/kvm/kvm-accel-ops.c | 1 - accel/kvm/kvm-all.c | 5 ++++- accel/tcg/tcg-accel-ops.c | 6 ------ accel/tcg/tcg-all.c | 6 ++++++ gdbstub/system.c | 8 +++++--- target/arm/hvf/hvf.c | 2 +- target/i386/hvf/hvf.c | 2 +- 12 files changed, 20 insertions(+), 17 deletions(-) diff --git a/accel/kvm/kvm-cpus.h b/accel/kvm/kvm-cpus.h index 688511151c8..3185659562d 100644 --- a/accel/kvm/kvm-cpus.h +++ b/accel/kvm/kvm-cpus.h @@ -16,7 +16,6 @@ void kvm_destroy_vcpu(CPUState *cpu); void kvm_cpu_synchronize_post_reset(CPUState *cpu); void kvm_cpu_synchronize_post_init(CPUState *cpu); void kvm_cpu_synchronize_pre_loadvm(CPUState *cpu); -bool kvm_supports_guest_debug(void); int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len); int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len); void kvm_remove_all_breakpoints(CPUState *cpu); diff --git a/include/qemu/accel.h b/include/qemu/accel.h index fbd3d897fef..fb176e89bad 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -47,6 +47,7 @@ typedef struct AccelClass { hwaddr start_addr, hwaddr size); =20 /* gdbstub related hooks */ + bool (*supports_guest_debug)(AccelState *as); int (*gdbstub_supported_sstep_flags)(void); =20 bool *allowed; diff --git a/include/system/accel-ops.h b/include/system/accel-ops.h index 4c99d25aeff..700df92ac6d 100644 --- a/include/system/accel-ops.h +++ b/include/system/accel-ops.h @@ -63,7 +63,6 @@ struct AccelOpsClass { int64_t (*get_elapsed_ticks)(void); =20 /* gdbstub hooks */ - bool (*supports_guest_debug)(void); int (*update_guest_debug)(CPUState *cpu); int (*insert_breakpoint)(CPUState *cpu, int type, vaddr addr, vaddr le= n); int (*remove_breakpoint)(CPUState *cpu, int type, vaddr addr, vaddr le= n); diff --git a/include/system/hvf.h b/include/system/hvf.h index a9a502f0c8f..a9fd13d9bba 100644 --- a/include/system/hvf.h +++ b/include/system/hvf.h @@ -71,7 +71,7 @@ void hvf_arch_update_guest_debug(CPUState *cpu); /* * Return whether the guest supports debugging. */ -bool hvf_arch_supports_guest_debug(void); +bool hvf_arch_supports_guest_debug(AccelState *as); #endif /* COMPILING_PER_TARGET */ =20 #endif diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index b38977207d2..aed791a3f3e 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -366,6 +366,7 @@ static void hvf_accel_class_init(ObjectClass *oc, const= void *data) ac->name =3D "HVF"; ac->init_machine =3D hvf_accel_init; ac->allowed =3D &hvf_allowed; + ac->supports_guest_debug =3D hvf_arch_supports_guest_debug; ac->gdbstub_supported_sstep_flags =3D hvf_gdbstub_sstep_flags; } =20 @@ -600,7 +601,6 @@ static void hvf_accel_ops_class_init(ObjectClass *oc, c= onst void *data) ops->remove_breakpoint =3D hvf_remove_breakpoint; 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; }; static const TypeInfo hvf_accel_ops_type =3D { .name =3D ACCEL_OPS_NAME("hvf"), diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c index e5c15449aa6..96606090889 100644 --- a/accel/kvm/kvm-accel-ops.c +++ b/accel/kvm/kvm-accel-ops.c @@ -104,7 +104,6 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, c= onst void *data) =20 #ifdef TARGET_KVM_HAVE_GUEST_DEBUG ops->update_guest_debug =3D kvm_update_guest_debug_ops; - ops->supports_guest_debug =3D kvm_supports_guest_debug; ops->insert_breakpoint =3D kvm_insert_breakpoint; ops->remove_breakpoint =3D kvm_remove_breakpoint; ops->remove_all_breakpoints =3D kvm_remove_all_breakpoints; diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 17235f26464..c8611552d19 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3533,7 +3533,7 @@ int kvm_update_guest_debug(CPUState *cpu, unsigned lo= ng reinject_trap) return data.err; } =20 -bool kvm_supports_guest_debug(void) +static bool kvm_supports_guest_debug(AccelState *as) { /* probed during kvm_init() */ return kvm_has_guest_debug; @@ -3998,6 +3998,9 @@ static void kvm_accel_class_init(ObjectClass *oc, con= st void *data) ac->has_memory =3D kvm_accel_has_memory; ac->allowed =3D &kvm_allowed; ac->gdbstub_supported_sstep_flags =3D kvm_gdbstub_sstep_flags; +#ifdef TARGET_KVM_HAVE_GUEST_DEBUG + ac->supports_guest_debug =3D kvm_supports_guest_debug; +#endif =20 object_class_property_add(oc, "kernel-irqchip", "on|off|split", NULL, kvm_set_kernel_irqchip, diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 6116644d1c0..f579685a611 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -106,11 +106,6 @@ void tcg_handle_interrupt(CPUState *cpu, int mask) } } =20 -static bool tcg_supports_guest_debug(void) -{ - return true; -} - /* Translate GDB watchpoint type to a flags value for cpu_watchpoint_* */ static inline int xlat_gdb_type(CPUState *cpu, int gdbtype) { @@ -216,7 +211,6 @@ static void tcg_accel_ops_init(AccelOpsClass *ops) } =20 ops->cpu_reset_hold =3D tcg_cpu_reset_hold; - ops->supports_guest_debug =3D tcg_supports_guest_debug; ops->insert_breakpoint =3D tcg_insert_breakpoint; ops->remove_breakpoint =3D tcg_remove_breakpoint; ops->remove_all_breakpoints =3D tcg_remove_all_breakpoints; diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 6e5dc333d59..0cff0f8a0f9 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -219,6 +219,11 @@ static void tcg_set_one_insn_per_tb(Object *obj, bool = value, Error **errp) qatomic_set(&one_insn_per_tb, value); } =20 +static bool tcg_supports_guest_debug(AccelState *as) +{ + return true; +} + static int tcg_gdbstub_supported_sstep_flags(void) { /* @@ -242,6 +247,7 @@ static void tcg_accel_class_init(ObjectClass *oc, const= void *data) ac->cpu_common_realize =3D tcg_exec_realizefn; ac->cpu_common_unrealize =3D tcg_exec_unrealizefn; ac->allowed =3D &tcg_allowed; + ac->supports_guest_debug =3D tcg_supports_guest_debug; ac->gdbstub_supported_sstep_flags =3D tcg_gdbstub_supported_sstep_flag= s; =20 object_class_property_add_str(oc, "thread", diff --git a/gdbstub/system.c b/gdbstub/system.c index 8a32d8e1a1d..03934deed49 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qemu/accel.h" #include "qemu/cutils.h" #include "exec/gdbstub.h" #include "gdbstub/syscalls.h" @@ -634,9 +635,10 @@ int gdb_signal_to_target(int sig) =20 bool gdb_supports_guest_debug(void) { - const AccelOpsClass *ops =3D cpus_get_accel(); - if (ops->supports_guest_debug) { - return ops->supports_guest_debug(); + AccelState *accel =3D current_accel(); + AccelClass *acc =3D ACCEL_GET_CLASS(accel); + if (acc->supports_guest_debug) { + return acc->supports_guest_debug(accel); } return false; } diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 7b6d291e79c..995a6a74b06 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -2352,7 +2352,7 @@ void hvf_arch_update_guest_debug(CPUState *cpu) hvf_arch_set_traps(cpu); } =20 -bool hvf_arch_supports_guest_debug(void) +bool hvf_arch_supports_guest_debug(AccelState *as) { return true; } diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index 99e37a33e50..b25bff0df41 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -1019,7 +1019,7 @@ void hvf_arch_update_guest_debug(CPUState *cpu) { } =20 -bool hvf_arch_supports_guest_debug(void) +bool hvf_arch_supports_guest_debug(AccelState *as) { return false; } --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564243; cv=none; d=zohomail.com; s=zohoarc; b=OEFHDOrfOOhkfZldQTf4+GmnIXIzJs+7Gq1i9ZUZFOCMB4mWwxrQPnNdB5I6fcv4AlT+VUiX8/8vcvP1N6DdQv2PtPOm7RZVptrpSL2JSJbBvt3+GEGB+Dg8VppX7jkdXKWBUd1+/qU7N0FKp45nJwZDRpx3ffnxojS6U1jX2KY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564243; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0/XChvbBlrGhhVuJVL/Zk7Vb78wLAovjWCdTr9DfryE=; b=DDlnpGkjyzJUjO0/KsNTDNtYPD8hLpshk2u6ao/VmvZ3YvZ/a5/hh4EiqYWGzUs6//MbVhwSwiL5p5lpR0t//clLyRDrB0VvioHCS/LoA22qFTzeEMUVCgahcv2BtQg07q5mV2kdtuh5q9tH0YluQAv1AWxzfG5OMWpbqtuiExA= 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 1751564243717703.9751923432632; Thu, 3 Jul 2025 10:37:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNpT-0006hI-F1; Thu, 03 Jul 2025 13:34:35 -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 1uXNov-0005vd-Dt for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:01 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNot-0008Mk-6X for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:00 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4538bc1cffdso882555e9.0 for ; Thu, 03 Jul 2025 10:33:58 -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-3b47030c443sm344279f8f.11.2025.07.03.10.33.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564037; x=1752168837; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0/XChvbBlrGhhVuJVL/Zk7Vb78wLAovjWCdTr9DfryE=; b=Ilj9qHRcfrirgUZHANYUUnT2efukP5TlI6YvdCGxoVz5KwAqF53vJfDkzRrEWRaZ7i y5y4WLt577QnjCSp3pOvudhSBsmq7iTSXE/TkHrgIu84xZ3ux2LlIo7LVG75fgzmS3pv rI23wW+kbYOKApur9Mn8TrIKxMUPT/tijZO9aIqO1DSbBni8x5R0/kyZBLD4WVcKXVLb 1xu67SgoQr5rdJEIEqVW19flpzLz9wNBliGaJbCcIbvL6qa9hSjSMbRTVT0mkUP/CDBw hE1yzd785WgtmQraIyZZJY+PVT8I0jyzjTY301gWuzhTnL498is6ZXGJfSDe63jHSclz ktMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564037; x=1752168837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0/XChvbBlrGhhVuJVL/Zk7Vb78wLAovjWCdTr9DfryE=; b=tcz4ZcNsOF/lUQmyqXqY4Jpw8iEUFJjJyOGpvK+B21lvy3UpnwCjp0o0t78HBLmx/D zSUH9jDNGjRFWpY9J8E7zKzLpkHcd+aCKwwwUdQQUrG+yZavni4ldHw1/OxY7wlaPbmL SFcxc+8X+q29b5rm4oI7ja6rKKACWdFbAJ8Xf+rFJzvj3XG3TqepbAXS2Yy/dYZJqIly qo1Mf1I5wqaHdPp5SgY6C2KAaQ6JrTOJkDOpyugypoce0XbnRNcdh5YDvY4C9AaLgchv KkVu/5NMOYthgyBLk0gHpN8eK63AEU7J5KTx7WQVsdFtc2VtWHPL79XjoeeXvoZyV4fQ aldQ== X-Gm-Message-State: AOJu0YwNN7cUVKsMiaaF7faEasUJVeH/P3Me0HFHtj9x6PIi8SoZ6I7K 8N0IwIL4N6Vimvw0K1QLJi3IDTJWfbktXfheGqVQW/ng7hjQOVo32AHXtqhNCZIw+0W8UyHq0E8 jPuEZu8w= X-Gm-Gg: ASbGncs39FUsuxeBdAg58nWJUMauTh32TOio1keY7tJc4QsjAqTWQZ1Rae8RyLpaBu/ sThLdpOigfLfPT40DOVa2SINgWwCZWlkLVR1iU4WCsZSY1BYdgP1Ggn3lRUnWZzFfZvJQiZzO6R EoNgB486D4mYETBRvex0HS2O8X7ncUveTUphN2iTuwBXLmWtsUJVtGTzj7ICq5iN84+RZoS5sbk Cz98KDi9GCbB+WoqjWols5NHRypaStcntLYF8d/OAvjiDyMs5RXmSxmrgkqOSad0dxEeNne1nYo FmF/n36q5DPzeDmgxTVZTpc4q/FVaW6+gf7ddrfRTDRQ22pjp9mjv95KiOLGx2GQTk2fhvkTJvg ol7gdyt7cnTDStTHPRXqylOhIsWw5NVkiMbJE X-Google-Smtp-Source: AGHT+IEjIcbV0/p4Gzpq8ssp7QneNZeB0/RBRlqRwz4r9eWXtga2gIBfvXxZyNMLZl6Wi93ElXZ5wA== X-Received: by 2002:a05:600c:4e86:b0:453:c39:d0c6 with SMTP id 5b1f17b1804b1-454a3737eccmr66163065e9.32.1751564036915; Thu, 03 Jul 2025 10:33:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org Subject: [PATCH v6 13/39] accel: Move cpus_are_resettable() declaration to AccelClass Date: Thu, 3 Jul 2025 19:32:19 +0200 Message-ID: <20250703173248.44995-14-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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: 1751564244547116600 AccelOpsClass is for methods dealing with vCPUs. When only dealing with AccelState, AccelClass is sufficient. Move cpus_are_resettable() declaration to accel/accel-system.c. In order to have AccelClass methods instrospect their state, we need to pass AccelState by argument. Adapt KVM handler. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- include/qemu/accel.h | 1 + include/system/accel-ops.h | 1 - accel/accel-system.c | 10 ++++++++++ accel/kvm/kvm-accel-ops.c | 6 ------ accel/kvm/kvm-all.c | 6 ++++++ system/cpus.c | 8 -------- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index fb176e89bad..f987d16baaa 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -45,6 +45,7 @@ typedef struct AccelClass { void (*setup_post)(MachineState *ms, AccelState *accel); bool (*has_memory)(MachineState *ms, AddressSpace *as, hwaddr start_addr, hwaddr size); + bool (*cpus_are_resettable)(AccelState *as); =20 /* gdbstub related hooks */ bool (*supports_guest_debug)(AccelState *as); diff --git a/include/system/accel-ops.h b/include/system/accel-ops.h index 700df92ac6d..f19245d0a0e 100644 --- a/include/system/accel-ops.h +++ b/include/system/accel-ops.h @@ -33,7 +33,6 @@ struct AccelOpsClass { /* initialization function called when accel is chosen */ void (*ops_init)(AccelOpsClass *ops); =20 - bool (*cpus_are_resettable)(void); void (*cpu_reset_hold)(CPUState *cpu); =20 void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */ diff --git a/accel/accel-system.c b/accel/accel-system.c index a0f562ae9ff..07b75dae797 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -62,6 +62,16 @@ void accel_setup_post(MachineState *ms) } } =20 +bool cpus_are_resettable(void) +{ + AccelState *accel =3D current_accel(); + AccelClass *acc =3D ACCEL_GET_CLASS(accel); + if (acc->cpus_are_resettable) { + return acc->cpus_are_resettable(accel); + } + return true; +} + /* initialize the arch-independent accel operation interfaces */ void accel_init_ops_interfaces(AccelClass *ac) { diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c index 96606090889..99f61044da5 100644 --- a/accel/kvm/kvm-accel-ops.c +++ b/accel/kvm/kvm-accel-ops.c @@ -78,11 +78,6 @@ static bool kvm_vcpu_thread_is_idle(CPUState *cpu) return !kvm_halt_in_kernel(); } =20 -static bool kvm_cpus_are_resettable(void) -{ - return !kvm_enabled() || !kvm_state->guest_state_protected; -} - #ifdef TARGET_KVM_HAVE_GUEST_DEBUG static int kvm_update_guest_debug_ops(CPUState *cpu) { @@ -96,7 +91,6 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, con= st void *data) =20 ops->create_vcpu_thread =3D kvm_start_vcpu_thread; ops->cpu_thread_is_idle =3D kvm_vcpu_thread_is_idle; - ops->cpus_are_resettable =3D kvm_cpus_are_resettable; ops->synchronize_post_reset =3D kvm_cpu_synchronize_post_reset; ops->synchronize_post_init =3D kvm_cpu_synchronize_post_init; ops->synchronize_state =3D kvm_cpu_synchronize_state; diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index c8611552d19..88fb6d36941 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3979,6 +3979,11 @@ static void kvm_accel_instance_init(Object *obj) s->msr_energy.enable =3D false; } =20 +static bool kvm_cpus_are_resettable(AccelState *as) +{ + return !kvm_enabled() || !kvm_state->guest_state_protected; +} + /** * kvm_gdbstub_sstep_flags(): * @@ -3997,6 +4002,7 @@ static void kvm_accel_class_init(ObjectClass *oc, con= st void *data) ac->init_machine =3D kvm_init; ac->has_memory =3D kvm_accel_has_memory; ac->allowed =3D &kvm_allowed; + ac->cpus_are_resettable =3D kvm_cpus_are_resettable; ac->gdbstub_supported_sstep_flags =3D kvm_gdbstub_sstep_flags; #ifdef TARGET_KVM_HAVE_GUEST_DEBUG ac->supports_guest_debug =3D kvm_supports_guest_debug; diff --git a/system/cpus.c b/system/cpus.c index a43e0e4e796..4fb764ac880 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -195,14 +195,6 @@ void cpu_synchronize_pre_loadvm(CPUState *cpu) } } =20 -bool cpus_are_resettable(void) -{ - if (cpus_accel->cpus_are_resettable) { - return cpus_accel->cpus_are_resettable(); - } - return true; -} - void cpu_exec_reset_hold(CPUState *cpu) { if (cpus_accel->cpu_reset_hold) { --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564417; cv=none; d=zohomail.com; s=zohoarc; b=dkZjABsmhcS/hOijPxA/jZer85cmvDEMG6PfU7xtxgb0RLsLwDtpOoH1buNj3asCOZPmA0CyQT4bg5rX6TuOT8ENa6j01gVmZpjTUipQTmfe8wdhGAWywbk/eDTrloTriKVuktt5xDf5E2Iw4VHkX2nlvoU08mPOctCkNtJNeqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564417; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Bx6KMQw8/FlRNTZmEqVUbDa7PGnyLnMhWj7KkWZFnoM=; b=KFizTVLgMTF6C4iloePErPwKvmA0wW1aJpv2FKnW/Bvp3JxEdXSOJkfPlp3is5EMkkxk0P2Xv/EytV9Tn/KoYM8/Ds08KAMeBmZ7emrzdHwfiuRTW0i3jyqfzVy1AtwU9vHv7SmMWYz214Z1khDlXbhm1UZVgZUGS0PLcpFOgzo= 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 1751564417002367.64771428571623; Thu, 3 Jul 2025 10:40:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNpR-0006Z1-MP; Thu, 03 Jul 2025 13:34:34 -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 1uXNp1-00067j-FV for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:14 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNoz-0008NR-8v for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:06 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3a536ecbf6fso28894f8f.2 for ; Thu, 03 Jul 2025 10:34:04 -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-454a997b492sm32358785e9.13.2025.07.03.10.34.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564042; x=1752168842; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bx6KMQw8/FlRNTZmEqVUbDa7PGnyLnMhWj7KkWZFnoM=; b=Mdo40MewnXquP3Pux+z97q9fHZQT/h8IU8s0PqKWKJUPdGXXfdr4AzXS3x7xJuk3jS DoztxXrjkO4ZbjS2x2Tv/3y1Ge8RhDmtC50+DbqZ9VG3tbhBjAJL2rUlwZ+xDGz+b6fA YhDcgJvZNrVbst+Nf3iPdrhi7BhmWopxeM++MY46LAzXfi+Ihq6PtOV5pQuOx0pf6Xu7 BT5v8M0AivwmMugUOho9WdgjJHLBwrci1RXBBcnnkx83E50AFbWhNiJySNqmqxAL5HV1 V6H+puFOnIu+7XUxqH7RgrJapwo1VAlF0GUtToWjLTvhmA0Tavr6rKQbxUkF7t86ZX6r P5Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564042; x=1752168842; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bx6KMQw8/FlRNTZmEqVUbDa7PGnyLnMhWj7KkWZFnoM=; b=T7S6ruru/JxGmYDhShpME6SFSaIovkz1sUa003V1tgkFTuVl9bEpqhw8aenFCfyE8p dwMiBEvl8+Xzw3u+xQpyxCsNFDBLjfX/B6biV0Q+ku8lI31aya9SFWpe1fWdTp8KdbN6 0/fhETt45u3x84Eg7BkrgVOp4qUnYKB6S6s7EjyO6uEIwfbjlPsueReocH+erPzRoYdY CUCsAoIHk1YHBBtZ0CeDch+ynKlORQ747IYCJ26phcSCC1ZdE9C0MAsVZBcXfAQkHQf1 ImKI6P26vppAsSPOur/aOUaS9zbwM5GR/6yN1nrkqm0EtGCxvr0F0zv79dlqlS8Gew0k fvzw== X-Gm-Message-State: AOJu0Yw7BdDrFlZMwiaY23TmP4YkdM/1w2Fxs4mgZ0nfmcTR4BOkTjVP w6E1NdSl2/Gl2ynIX82zvL9qGTqfoV2Z01hBAGUfdcNGLb8wo2Oal96K7Ti+c2U3TIT2sxbixvQ oV4C2goI= X-Gm-Gg: ASbGncsuXzLh/OmD1tNMMrWTFWbHj+mEvdiYt02dX4sffdF70BuYbY+t2mCfYxh3AGp KUoCrCWgAf3nA1A3W2/fuZqEh9J8hEKvyWv7p+hwDPTmzVV6Bf7gdPGlzRcJ+pR+gFw9AtRrg7N Ch5LAU+RKT7Ur5bSvZiAcbjBy7D8B18go3NhFGTB9jWEGxdXMCbtV9CupfqNLAYkb82jAt3qelH CEdclp6MufXM//rtWwm5GINQtJXWrG3yJtdAfUkfwNvERSbWb5trQxnMRa/QA0SdkgIdJG0W4aF NMPnxo8PEF7FI88GcuY6UUlWq6eP/4eWWPVIhvfrESR8yWDnjEvemSmO3clWcu27MjPJb8GZKfe iWbNBEfrOJWwNhQAnHb9LsGAmuxX6Lxv4kVPm X-Google-Smtp-Source: AGHT+IFnEJvbccQl9NuxDXr6r9kBXQmzF6fHXy9j1Yz5apR3negcqbwZ1xBPZw9TbiuxaRiahJGQmg== X-Received: by 2002:a05:6000:2dc2:b0:3a4:f7e7:416b with SMTP id ffacd0b85a97d-3b1fdd16d21mr6756060f8f.16.1751564042531; Thu, 03 Jul 2025 10:34:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Phil Dennis-Jordan , Mads Ynddal Subject: [PATCH v6 14/39] accel/hvf: Restrict internal declarations Date: Thu, 3 Jul 2025 19:32:20 +0200 Message-ID: <20250703173248.44995-15-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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: 1751564418477116600 Common code only needs to know whether HVF is enabled and the QOM type. Move the rest to "hvf_int.h", removing the need for COMPILING_PER_TARGET #ifdef'ry. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- include/system/hvf.h | 38 -------------------------------------- include/system/hvf_int.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 38 deletions(-) diff --git a/include/system/hvf.h b/include/system/hvf.h index a9fd13d9bba..d3dcf088b3f 100644 --- a/include/system/hvf.h +++ b/include/system/hvf.h @@ -14,10 +14,6 @@ #define HVF_H =20 #include "qemu/accel.h" -#include "qemu/queue.h" -#include "exec/vaddr.h" -#include "qom/object.h" -#include "exec/vaddr.h" =20 #ifdef COMPILING_PER_TARGET # ifdef CONFIG_HVF @@ -40,38 +36,4 @@ typedef struct HVFState HVFState; DECLARE_INSTANCE_CHECKER(HVFState, HVF_STATE, TYPE_HVF_ACCEL) =20 -#ifdef COMPILING_PER_TARGET -struct hvf_sw_breakpoint { - vaddr pc; - vaddr saved_insn; - int use_count; - QTAILQ_ENTRY(hvf_sw_breakpoint) entry; -}; - -struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, - vaddr pc); -int hvf_sw_breakpoints_active(CPUState *cpu); - -int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); -int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); -int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type); -int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type); -void hvf_arch_remove_all_hw_breakpoints(void); - -/* - * hvf_update_guest_debug: - * @cs: CPUState for the CPU to update - * - * Update guest to enable or disable debugging. Per-arch specifics will be - * handled by calling down to hvf_arch_update_guest_debug. - */ -int hvf_update_guest_debug(CPUState *cpu); -void hvf_arch_update_guest_debug(CPUState *cpu); - -/* - * Return whether the guest supports debugging. - */ -bool hvf_arch_supports_guest_debug(AccelState *as); -#endif /* COMPILING_PER_TARGET */ - #endif diff --git a/include/system/hvf_int.h b/include/system/hvf_int.h index d774e58df91..dcf06f53d97 100644 --- a/include/system/hvf_int.h +++ b/include/system/hvf_int.h @@ -12,6 +12,8 @@ #define HVF_INT_H =20 #include "qemu/queue.h" +#include "exec/vaddr.h" +#include "qom/object.h" =20 #ifdef __aarch64__ #include @@ -77,4 +79,36 @@ int hvf_put_registers(CPUState *); int hvf_get_registers(CPUState *); void hvf_kick_vcpu_thread(CPUState *cpu); =20 +struct hvf_sw_breakpoint { + vaddr pc; + vaddr saved_insn; + int use_count; + QTAILQ_ENTRY(hvf_sw_breakpoint) entry; +}; + +struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, + vaddr pc); +int hvf_sw_breakpoints_active(CPUState *cpu); + +int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); +int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); +int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type); +int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type); +void hvf_arch_remove_all_hw_breakpoints(void); + +/* + * hvf_update_guest_debug: + * @cs: CPUState for the CPU to update + * + * Update guest to enable or disable debugging. Per-arch specifics will be + * handled by calling down to hvf_arch_update_guest_debug. + */ +int hvf_update_guest_debug(CPUState *cpu); +void hvf_arch_update_guest_debug(CPUState *cpu); + +/* + * Return whether the guest supports debugging. + */ +bool hvf_arch_supports_guest_debug(AccelState *as); + #endif --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564721; cv=none; d=zohomail.com; s=zohoarc; b=fNt0wjJs3sqTFLPNgIUqnxSihmk0dUVhxCImGCjRseHl+cWAHUANTUQ9LDVE7uHqS2KDvQWZKWSVxJMbN5piXIq+utkgFOW9qOhvZ2PRtggatNG7qhoH21WgGpX6719UHMHsLbyh8ukR5rrN3DJiMmkm5BA981uuMRWGkE3Ab6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564721; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qHktCWHXOq/fuqtnF2me8RbDnjLy8K0ph9fB+eFovTA=; b=a5YXX1/sMNAU5GSdwSpyewe8Zoy+B1Rw9TTA4qGpp2+woJapQLEFnr0y2A5WYqtWt7/pkqQ/CAmmA7k5qAysqplUiaBxTskP7sDEM0zHbi4pCiaClelSnT1HOAw/ek2q8EEg4J4J/5S5JU7mPMV8ObtQsztlPQtt+GnyBEEV92Q= 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 1751564721310724.5187379550758; Thu, 3 Jul 2025 10:45:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNpX-000738-KM; Thu, 03 Jul 2025 13:34:39 -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 1uXNp9-0006BE-1D for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:15 -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 1uXNp7-0008OM-2k for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:14 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-453608ed113so1112275e9.0 for ; Thu, 03 Jul 2025 10:34:09 -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-454a9989fcesm32171615e9.16.2025.07.03.10.34.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564048; x=1752168848; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qHktCWHXOq/fuqtnF2me8RbDnjLy8K0ph9fB+eFovTA=; b=b3q+lv2dqD08T5aIjk+/O5oeqAfEuBBsuG8X5kyltEs2ExUVCvzfKtM1VoSvcHXPcd cDKWkW92HW3pL1OgoqLxpkchBTPJSOPG8m+fwdYMC8wwt0vXCxGz4AjWsHLpVT69PG2n iH9GJUtKExnmaL82LbaQnnDf7TbKAMzt2Q+npl+PZ/T5GUOPcVZTy6RLf0L5l2s0VHlo 06CRRi+MXfLB/dWMp2BoSQTjrlhhNmBpu9sCph1lJft01aWMqc8YhwBkoEvvFZugXcgR 27cxdlaKl3NeWbBkFt9opJYXTyC+o1bLni7beaWP03Eq+Emy3ff11XN/RL3meN1qGhgv ahoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564048; x=1752168848; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qHktCWHXOq/fuqtnF2me8RbDnjLy8K0ph9fB+eFovTA=; b=GEIG8AfGEqofEJ/MyKgNLaVL7uT/+kda3eD5eyaMoGBxfIyIyGdjsEI4iSYgCf63I8 A9ISOV7wSR2PgO45ZMr+dbXpReXnkRgBJzX3WeuqLzyXAjTxZ8TNoO6Gj0120NgnS+XG qKyXM4gXHnx8kxg6eCRh/cOK2SZN/PfMl996ksAKgLfVU6EB0MV2OA4JPuGICIGhfRN+ CExwVK5jOGMpIog3QaM2SMETLbNsLlUawWPq1HfavszFNM2o+WWsvC554pXiqRi+z7UE mey4mfrtAWsWE3KmwQo+yqcefrvSeJdhpzeLkTtg1/rjnTx04yjQN3cZ5V8N1gFG7Gtf irDQ== X-Gm-Message-State: AOJu0Yw2Y0oJ1pTTTnLCJYVeOSVKgNHuRuWqD9FujVMwnDlMUEgJn3C+ zZd0qJaPiyhXNOsoeQsUChvDAVpGdVYTnAxvYU1iBRPzs2ehY43A+jzojwA+MgFTmc2THdp4e3p rGlQ7faU= X-Gm-Gg: ASbGncvXCVbBAb4n6qp1aE9sOD4qARcSD4/Zji3IzUqoS0Yv0udaZbwWIvUPcTmUtpS y3n7+49eltD2CM1lLi979gLe3LiPM8cymGLGoo7wsRVVsEAQ+ADZSySvnjEyOov1rpEHjOcYrox xm5yKPv2Ppr4MHXYJJ+F9AqW/S6i07OoQRzfBh1MgZtZSXqE3vylPturcyVJ4CDNWZ4U0GTEPsJ dQwKU8LoiJp6O48USOcW8K27XaS5W5CL5lIRyJCXgCP+fkroaLJlLrngQNCiCMriO0GLTc6nJyJ rylnHKjlhnTM8/z5WnL2vF0oTALRjp3crwUH7e538bUq48jwXI/6NOmnNLJPapk3EjlITkB4b4y 5gXsLVihsXGdTQyWbKKBjP3BqvZUxCUGmuH3L X-Google-Smtp-Source: AGHT+IHW5sfQHvEdYYSpNdY+nvtPkanFLMgQrVJS6Qp9HQKPJM5pHqYyHIN17dwssogKLWyH3Zg1Ow== X-Received: by 2002:a05:600c:621b:b0:43c:fa52:7d2d with SMTP id 5b1f17b1804b1-454a9c9e61fmr48333445e9.20.1751564047781; Thu, 03 Jul 2025 10:34:07 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Phil Dennis-Jordan , Mads Ynddal Subject: [PATCH v6 15/39] accel/hvf: Move per-cpu method declarations to hvf-accel-ops.c Date: Thu, 3 Jul 2025 19:32:21 +0200 Message-ID: <20250703173248.44995-16-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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: 1751564722086116600 hvf-all.c aims to contain the generic accel methods (TYPE_ACCEL), while hvf-accel-ops.c the per-vcpu methods (TYPE_ACCEL_OPS). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- accel/hvf/hvf-accel-ops.c | 30 ++++++++++++++++++++++++++++++ accel/hvf/hvf-all.c | 28 ---------------------------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index aed791a3f3e..646cd240238 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -50,9 +50,11 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" +#include "qemu/queue.h" #include "system/address-spaces.h" #include "gdbstub/enums.h" #include "hw/boards.h" +#include "hw/core/cpu.h" #include "system/accel-ops.h" #include "system/cpus.h" #include "system/hvf.h" @@ -483,6 +485,34 @@ static void hvf_start_vcpu_thread(CPUState *cpu) cpu, QEMU_THREAD_JOINABLE); } =20 +struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, vaddr pc) +{ + struct hvf_sw_breakpoint *bp; + + QTAILQ_FOREACH(bp, &hvf_state->hvf_sw_breakpoints, entry) { + if (bp->pc =3D=3D pc) { + return bp; + } + } + return NULL; +} + +int hvf_sw_breakpoints_active(CPUState *cpu) +{ + return !QTAILQ_EMPTY(&hvf_state->hvf_sw_breakpoints); +} + +static void do_hvf_update_guest_debug(CPUState *cpu, run_on_cpu_data arg) +{ + hvf_arch_update_guest_debug(cpu); +} + +int hvf_update_guest_debug(CPUState *cpu) +{ + run_on_cpu(cpu, do_hvf_update_guest_debug, RUN_ON_CPU_NULL); + return 0; +} + static int hvf_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vadd= r len) { struct hvf_sw_breakpoint *bp; diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 8c387fda24d..1c72c43ddb4 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -41,31 +41,3 @@ void assert_hvf_ok_impl(hv_return_t ret, const char *fil= e, unsigned int line, =20 abort(); } - -struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, vaddr pc) -{ - struct hvf_sw_breakpoint *bp; - - QTAILQ_FOREACH(bp, &hvf_state->hvf_sw_breakpoints, entry) { - if (bp->pc =3D=3D pc) { - return bp; - } - } - return NULL; -} - -int hvf_sw_breakpoints_active(CPUState *cpu) -{ - return !QTAILQ_EMPTY(&hvf_state->hvf_sw_breakpoints); -} - -static void do_hvf_update_guest_debug(CPUState *cpu, run_on_cpu_data arg) -{ - hvf_arch_update_guest_debug(cpu); -} - -int hvf_update_guest_debug(CPUState *cpu) -{ - run_on_cpu(cpu, do_hvf_update_guest_debug, RUN_ON_CPU_NULL); - return 0; -} --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564448; cv=none; d=zohomail.com; s=zohoarc; b=lbkIpoltzBmeg8KpCvwMfKuv401cNSUPelslK+Av6mP9RotonFE7DMxtGUnct3e3wbSlBZWZqDEgL8kmIiZFtC6E2Ofkyb48p775a2aT69k7Xas4q8YSPa7i+W1BecPPqkToTRZ9UfLmkqSmHVPSM4BgqIjzLU5ql3SLpWkvQhY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564448; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KeBsFGHXLsHGotNyus5vOaCkT/NMYUV/oKT335Y1mlE=; b=J6LHF7sqe5m3JTcPJn8XSKWQ7p0xjdPqF2lDDhHiYC3jkbFw/d7RQwyvN3eKWsfCMqOsRE9inrQAAavIuNWQPav0oHCnNHMmcjhwjORk8lZdlpB0gKCNAx+y0sollXZDK9rkqjgZEvObEHHk3UH53+BZK4Wqxsdts5E4bQZZ50w= 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 1751564448830480.0838732981184; Thu, 3 Jul 2025 10:40:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNpV-0006vv-VH; Thu, 03 Jul 2025 13:34:38 -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 1uXNpC-0006H3-G5 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:20 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNp9-0008Tm-Oy for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:18 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3a582e09144so39333f8f.1 for ; Thu, 03 Jul 2025 10:34:14 -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-454a9bcebf7sm33289065e9.21.2025.07.03.10.34.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564053; x=1752168853; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KeBsFGHXLsHGotNyus5vOaCkT/NMYUV/oKT335Y1mlE=; b=WUU8WDqCuyDe6tWYezIii5rp9k3SgnN0gDrp33vVe+U5P5RY8nkzUUjeKEb7I/+HYm NuvRjFWgbQJe88gNyhrg6LhNijHwopJNXvh+j2Oavix7C6vW0SW7fxAXoxMkKzujNqyU xSQrfrcuVp+Jba3rVz4PkxJ/B2xnjE7lqeUW/mJqvhYXIuZhRfw5eUoH+dUTEB0J515+ ORljNP9tfHwTG5UBLX2BA18Cfw1a5ZnWEDt3Hwg49LpE4b7hsnXsGsJsZBEFPEpVtE0r ekcCBhRiHyNFUAahpsbfGUkCJdukianK+39vVXM3mbmY2iwuv8luLCsc0xsrGX0UM4Za ZAYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564053; x=1752168853; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KeBsFGHXLsHGotNyus5vOaCkT/NMYUV/oKT335Y1mlE=; b=adMQpTrRIMVVwVtm3uP1hTOr5NXScROdb+OXeagZs/YvkTqGHxMbRmZDd0/MxcTgkz 1E2T4d1CGOiTGeRhVWhfm0Ob7Gn5MMEYgSUZLK0oVSHFHN4NqSD1pyaoR87qWr4xfixh WToI83XFAdDL50Jw6T4Vgz7efjJIbdeBl3VvY2Xw8FMxEcueXPxGd9ZwZZwFEBz5xzeN wahUbarYUxz3fZ4XIx6YWSblyihJnpjKX2CNd5TTo4gCckBIo0S3Fc83GnA5+wY9OKJU w8E6Sco7lcToSHw/Q1wNLomKd8KP3apTPlS7piPSdkbP8X1jjhhbXFPw7oiHaaKHIGri jX/A== X-Gm-Message-State: AOJu0YxtZIGchfMApV5rSm70ysW3axGa9MF/ikYgiC/18bAj21+RplQG yh2ih/oiPD0uxFieW9sqCXtDfPIuUcclUdGtnf1fZ+U8qHNvXxgWgSlnePM0oIZ8SA0VVL+T0Ix WBT1A7oQ= X-Gm-Gg: ASbGncu6wlsb+7mzgXSq3LPC+X3WzoawsAsQE7QBuaxvz5S7Vny3OObuCvETs6Q8zQc mtyujI8q1Mm4xPEDjh7nX+lW9yez8kqU16c207ol9Tj0hgL+6PNHhY45xIM/lASTgk4gjz5/c9p V+hBx65hdwBeWnNZW3/UAELGgBaWLMS3pa65ziDgiZV442nQBKh48qkPbsMF16ULo7j/EFY8ZYK T6qAg4U0wIVzkXuPThTpkFbevXNJxavSCJNvyornFZk8inLAIjlF7HC3mOKSWgFyv9I8dnqWUBD Qq3P+VwQdFBwezD5tBTHmy7zZ5xt1MDLuog6u1OliRMW8Cs0jf8AQwN8EFamliJsyL9Ey+S8/8H u2ebKWiRNPHf0raX2JtglYnCJ1vg981v32E9Y X-Google-Smtp-Source: AGHT+IFE7cdiXsgzzl9P+XQ68AH0An71MoAYAUIF7Nz7q8bNviRLxvd3HIRsIH44uKNhQ3XxG4/CGA== X-Received: by 2002:a05:6000:26c2:b0:3a4:f6c4:355a with SMTP id ffacd0b85a97d-3b201d8e2fdmr6773317f8f.57.1751564052761; Thu, 03 Jul 2025 10:34:12 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Phil Dennis-Jordan , Mads Ynddal Subject: [PATCH v6 16/39] accel/hvf: Move generic method declarations to hvf-all.c Date: Thu, 3 Jul 2025 19:32:22 +0200 Message-ID: <20250703173248.44995-17-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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: 1751564450970116600 hvf-all.c aims to contain the generic accel methods (TYPE_ACCEL), while hvf-accel-ops.c the per-vcpu methods (TYPE_ACCEL_OPS). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- accel/hvf/hvf-accel-ops.c | 274 +------------------------------------- accel/hvf/hvf-all.c | 268 +++++++++++++++++++++++++++++++++++++ 2 files changed, 272 insertions(+), 270 deletions(-) diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 646cd240238..6b1a256deb5 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -48,20 +48,16 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/error-report.h" +#include "qemu/guest-random.h" #include "qemu/main-loop.h" #include "qemu/queue.h" -#include "system/address-spaces.h" #include "gdbstub/enums.h" -#include "hw/boards.h" +#include "exec/cpu-common.h" #include "hw/core/cpu.h" #include "system/accel-ops.h" #include "system/cpus.h" #include "system/hvf.h" #include "system/hvf_int.h" -#include "system/runstate.h" -#include "qemu/guest-random.h" -#include "trace.h" =20 HVFState *hvf_state; =20 @@ -81,132 +77,6 @@ hvf_slot *hvf_find_overlap_slot(uint64_t start, uint64_= t size) return NULL; } =20 -struct mac_slot { - int present; - uint64_t size; - uint64_t gpa_start; - uint64_t gva; -}; - -struct mac_slot mac_slots[32]; - -static int do_hvf_set_memory(hvf_slot *slot, hv_memory_flags_t flags) -{ - struct mac_slot *macslot; - hv_return_t ret; - - macslot =3D &mac_slots[slot->slot_id]; - - if (macslot->present) { - if (macslot->size !=3D slot->size) { - macslot->present =3D 0; - trace_hvf_vm_unmap(macslot->gpa_start, macslot->size); - ret =3D hv_vm_unmap(macslot->gpa_start, macslot->size); - assert_hvf_ok(ret); - } - } - - if (!slot->size) { - return 0; - } - - macslot->present =3D 1; - macslot->gpa_start =3D slot->start; - macslot->size =3D slot->size; - trace_hvf_vm_map(slot->start, slot->size, slot->mem, flags, - flags & HV_MEMORY_READ ? 'R' : '-', - flags & HV_MEMORY_WRITE ? 'W' : '-', - flags & HV_MEMORY_EXEC ? 'E' : '-'); - ret =3D hv_vm_map(slot->mem, slot->start, slot->size, flags); - assert_hvf_ok(ret); - return 0; -} - -static void hvf_set_phys_mem(MemoryRegionSection *section, bool add) -{ - hvf_slot *mem; - MemoryRegion *area =3D section->mr; - bool writable =3D !area->readonly && !area->rom_device; - hv_memory_flags_t flags; - uint64_t page_size =3D qemu_real_host_page_size(); - - if (!memory_region_is_ram(area)) { - if (writable) { - return; - } else if (!memory_region_is_romd(area)) { - /* - * If the memory device is not in romd_mode, then we actually = want - * to remove the hvf memory slot so all accesses will trap. - */ - add =3D false; - } - } - - if (!QEMU_IS_ALIGNED(int128_get64(section->size), page_size) || - !QEMU_IS_ALIGNED(section->offset_within_address_space, page_size))= { - /* Not page aligned, so we can not map as RAM */ - add =3D false; - } - - mem =3D hvf_find_overlap_slot( - section->offset_within_address_space, - int128_get64(section->size)); - - if (mem && add) { - if (mem->size =3D=3D int128_get64(section->size) && - mem->start =3D=3D section->offset_within_address_space && - mem->mem =3D=3D (memory_region_get_ram_ptr(area) + - section->offset_within_region)) { - return; /* Same region was attempted to register, go away. */ - } - } - - /* Region needs to be reset. set the size to 0 and remap it. */ - if (mem) { - mem->size =3D 0; - if (do_hvf_set_memory(mem, 0)) { - error_report("Failed to reset overlapping slot"); - abort(); - } - } - - if (!add) { - return; - } - - if (area->readonly || - (!memory_region_is_ram(area) && memory_region_is_romd(area))) { - flags =3D HV_MEMORY_READ | HV_MEMORY_EXEC; - } else { - flags =3D HV_MEMORY_READ | HV_MEMORY_WRITE | HV_MEMORY_EXEC; - } - - /* Now make a new slot. */ - int x; - - for (x =3D 0; x < hvf_state->num_slots; ++x) { - mem =3D &hvf_state->slots[x]; - if (!mem->size) { - break; - } - } - - if (x =3D=3D hvf_state->num_slots) { - error_report("No free slots"); - abort(); - } - - mem->size =3D int128_get64(section->size); - mem->mem =3D memory_region_get_ram_ptr(area) + section->offset_within_= region; - mem->start =3D section->offset_within_address_space; - mem->region =3D area; - - if (do_hvf_set_memory(mem, flags)) { - error_report("Error registering new memory slot"); - abort(); - } -} - static void do_hvf_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data ar= g) { if (!cpu->accel->dirty) { @@ -244,148 +114,10 @@ static void hvf_cpu_synchronize_pre_loadvm(CPUState = *cpu) run_on_cpu(cpu, do_hvf_cpu_synchronize_set_dirty, RUN_ON_CPU_NULL); } =20 -static void hvf_set_dirty_tracking(MemoryRegionSection *section, bool on) -{ - hvf_slot *slot; - - slot =3D hvf_find_overlap_slot( - section->offset_within_address_space, - int128_get64(section->size)); - - /* protect region against writes; begin tracking it */ - if (on) { - slot->flags |=3D HVF_SLOT_LOG; - hv_vm_protect((uintptr_t)slot->start, (size_t)slot->size, - HV_MEMORY_READ | HV_MEMORY_EXEC); - /* stop tracking region*/ - } else { - slot->flags &=3D ~HVF_SLOT_LOG; - hv_vm_protect((uintptr_t)slot->start, (size_t)slot->size, - HV_MEMORY_READ | HV_MEMORY_WRITE | HV_MEMORY_EXEC); - } -} - -static void hvf_log_start(MemoryListener *listener, - MemoryRegionSection *section, int old, int new) -{ - if (old !=3D 0) { - return; - } - - hvf_set_dirty_tracking(section, 1); -} - -static void hvf_log_stop(MemoryListener *listener, - MemoryRegionSection *section, int old, int new) -{ - if (new !=3D 0) { - return; - } - - hvf_set_dirty_tracking(section, 0); -} - -static void hvf_log_sync(MemoryListener *listener, - MemoryRegionSection *section) -{ - /* - * sync of dirty pages is handled elsewhere; just make sure we keep - * tracking the region. - */ - hvf_set_dirty_tracking(section, 1); -} - -static void hvf_region_add(MemoryListener *listener, - MemoryRegionSection *section) -{ - hvf_set_phys_mem(section, true); -} - -static void hvf_region_del(MemoryListener *listener, - MemoryRegionSection *section) -{ - hvf_set_phys_mem(section, false); -} - -static MemoryListener hvf_memory_listener =3D { - .name =3D "hvf", - .priority =3D MEMORY_LISTENER_PRIORITY_ACCEL, - .region_add =3D hvf_region_add, - .region_del =3D hvf_region_del, - .log_start =3D hvf_log_start, - .log_stop =3D hvf_log_stop, - .log_sync =3D hvf_log_sync, -}; - static void dummy_signal(int sig) { } =20 -bool hvf_allowed; - -static int hvf_accel_init(MachineState *ms) -{ - int x; - hv_return_t ret; - HVFState *s; - int pa_range =3D 36; - MachineClass *mc =3D MACHINE_GET_CLASS(ms); - - if (mc->hvf_get_physical_address_range) { - pa_range =3D mc->hvf_get_physical_address_range(ms); - if (pa_range < 0) { - return -EINVAL; - } - } - - ret =3D hvf_arch_vm_create(ms, (uint32_t)pa_range); - assert_hvf_ok(ret); - - s =3D g_new0(HVFState, 1); - - s->num_slots =3D ARRAY_SIZE(s->slots); - for (x =3D 0; x < s->num_slots; ++x) { - s->slots[x].size =3D 0; - s->slots[x].slot_id =3D x; - } - - QTAILQ_INIT(&s->hvf_sw_breakpoints); - - hvf_state =3D s; - memory_listener_register(&hvf_memory_listener, &address_space_memory); - - return hvf_arch_init(); -} - -static inline int hvf_gdbstub_sstep_flags(void) -{ - return SSTEP_ENABLE | SSTEP_NOIRQ; -} - -static void hvf_accel_class_init(ObjectClass *oc, const void *data) -{ - AccelClass *ac =3D ACCEL_CLASS(oc); - ac->name =3D "HVF"; - ac->init_machine =3D hvf_accel_init; - ac->allowed =3D &hvf_allowed; - ac->supports_guest_debug =3D hvf_arch_supports_guest_debug; - ac->gdbstub_supported_sstep_flags =3D hvf_gdbstub_sstep_flags; -} - -static const TypeInfo hvf_accel_type =3D { - .name =3D TYPE_HVF_ACCEL, - .parent =3D TYPE_ACCEL, - .instance_size =3D sizeof(HVFState), - .class_init =3D hvf_accel_class_init, -}; - -static void hvf_type_init(void) -{ - type_register_static(&hvf_accel_type); -} - -type_init(hvf_type_init); - static void hvf_vcpu_destroy(CPUState *cpu) { hv_return_t ret =3D hv_vcpu_destroy(cpu->accel->fd); @@ -639,8 +371,10 @@ static const TypeInfo hvf_accel_ops_type =3D { .class_init =3D hvf_accel_ops_class_init, .abstract =3D true, }; + static void hvf_accel_ops_register_types(void) { type_register_static(&hvf_accel_ops_type); } + type_init(hvf_accel_ops_register_types); diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 1c72c43ddb4..897a02eebe2 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -10,9 +10,24 @@ =20 #include "qemu/osdep.h" #include "qemu/error-report.h" +#include "system/address-spaces.h" +#include "system/memory.h" #include "system/hvf.h" #include "system/hvf_int.h" #include "hw/core/cpu.h" +#include "hw/boards.h" +#include "trace.h" + +bool hvf_allowed; + +struct mac_slot { + int present; + uint64_t size; + uint64_t gpa_start; + uint64_t gva; +}; + +struct mac_slot mac_slots[32]; =20 const char *hvf_return_string(hv_return_t ret) { @@ -41,3 +56,256 @@ void assert_hvf_ok_impl(hv_return_t ret, const char *fi= le, unsigned int line, =20 abort(); } + +static int do_hvf_set_memory(hvf_slot *slot, hv_memory_flags_t flags) +{ + struct mac_slot *macslot; + hv_return_t ret; + + macslot =3D &mac_slots[slot->slot_id]; + + if (macslot->present) { + if (macslot->size !=3D slot->size) { + macslot->present =3D 0; + trace_hvf_vm_unmap(macslot->gpa_start, macslot->size); + ret =3D hv_vm_unmap(macslot->gpa_start, macslot->size); + assert_hvf_ok(ret); + } + } + + if (!slot->size) { + return 0; + } + + macslot->present =3D 1; + macslot->gpa_start =3D slot->start; + macslot->size =3D slot->size; + trace_hvf_vm_map(slot->start, slot->size, slot->mem, flags, + flags & HV_MEMORY_READ ? 'R' : '-', + flags & HV_MEMORY_WRITE ? 'W' : '-', + flags & HV_MEMORY_EXEC ? 'E' : '-'); + ret =3D hv_vm_map(slot->mem, slot->start, slot->size, flags); + assert_hvf_ok(ret); + return 0; +} + +static void hvf_set_phys_mem(MemoryRegionSection *section, bool add) +{ + hvf_slot *mem; + MemoryRegion *area =3D section->mr; + bool writable =3D !area->readonly && !area->rom_device; + hv_memory_flags_t flags; + uint64_t page_size =3D qemu_real_host_page_size(); + + if (!memory_region_is_ram(area)) { + if (writable) { + return; + } else if (!memory_region_is_romd(area)) { + /* + * If the memory device is not in romd_mode, then we actually = want + * to remove the hvf memory slot so all accesses will trap. + */ + add =3D false; + } + } + + if (!QEMU_IS_ALIGNED(int128_get64(section->size), page_size) || + !QEMU_IS_ALIGNED(section->offset_within_address_space, page_size))= { + /* Not page aligned, so we can not map as RAM */ + add =3D false; + } + + mem =3D hvf_find_overlap_slot( + section->offset_within_address_space, + int128_get64(section->size)); + + if (mem && add) { + if (mem->size =3D=3D int128_get64(section->size) && + mem->start =3D=3D section->offset_within_address_space && + mem->mem =3D=3D (memory_region_get_ram_ptr(area) + + section->offset_within_region)) { + return; /* Same region was attempted to register, go away. */ + } + } + + /* Region needs to be reset. set the size to 0 and remap it. */ + if (mem) { + mem->size =3D 0; + if (do_hvf_set_memory(mem, 0)) { + error_report("Failed to reset overlapping slot"); + abort(); + } + } + + if (!add) { + return; + } + + if (area->readonly || + (!memory_region_is_ram(area) && memory_region_is_romd(area))) { + flags =3D HV_MEMORY_READ | HV_MEMORY_EXEC; + } else { + flags =3D HV_MEMORY_READ | HV_MEMORY_WRITE | HV_MEMORY_EXEC; + } + + /* Now make a new slot. */ + int x; + + for (x =3D 0; x < hvf_state->num_slots; ++x) { + mem =3D &hvf_state->slots[x]; + if (!mem->size) { + break; + } + } + + if (x =3D=3D hvf_state->num_slots) { + error_report("No free slots"); + abort(); + } + + mem->size =3D int128_get64(section->size); + mem->mem =3D memory_region_get_ram_ptr(area) + section->offset_within_= region; + mem->start =3D section->offset_within_address_space; + mem->region =3D area; + + if (do_hvf_set_memory(mem, flags)) { + error_report("Error registering new memory slot"); + abort(); + } +} + +static void hvf_set_dirty_tracking(MemoryRegionSection *section, bool on) +{ + hvf_slot *slot; + + slot =3D hvf_find_overlap_slot( + section->offset_within_address_space, + int128_get64(section->size)); + + /* protect region against writes; begin tracking it */ + if (on) { + slot->flags |=3D HVF_SLOT_LOG; + hv_vm_protect((uintptr_t)slot->start, (size_t)slot->size, + HV_MEMORY_READ | HV_MEMORY_EXEC); + /* stop tracking region*/ + } else { + slot->flags &=3D ~HVF_SLOT_LOG; + hv_vm_protect((uintptr_t)slot->start, (size_t)slot->size, + HV_MEMORY_READ | HV_MEMORY_WRITE | HV_MEMORY_EXEC); + } +} + +static void hvf_log_start(MemoryListener *listener, + MemoryRegionSection *section, int old, int new) +{ + if (old !=3D 0) { + return; + } + + hvf_set_dirty_tracking(section, 1); +} + +static void hvf_log_stop(MemoryListener *listener, + MemoryRegionSection *section, int old, int new) +{ + if (new !=3D 0) { + return; + } + + hvf_set_dirty_tracking(section, 0); +} + +static void hvf_log_sync(MemoryListener *listener, + MemoryRegionSection *section) +{ + /* + * sync of dirty pages is handled elsewhere; just make sure we keep + * tracking the region. + */ + hvf_set_dirty_tracking(section, 1); +} + +static void hvf_region_add(MemoryListener *listener, + MemoryRegionSection *section) +{ + hvf_set_phys_mem(section, true); +} + +static void hvf_region_del(MemoryListener *listener, + MemoryRegionSection *section) +{ + hvf_set_phys_mem(section, false); +} + +static MemoryListener hvf_memory_listener =3D { + .name =3D "hvf", + .priority =3D MEMORY_LISTENER_PRIORITY_ACCEL, + .region_add =3D hvf_region_add, + .region_del =3D hvf_region_del, + .log_start =3D hvf_log_start, + .log_stop =3D hvf_log_stop, + .log_sync =3D hvf_log_sync, +}; + +static int hvf_accel_init(MachineState *ms) +{ + int x; + hv_return_t ret; + HVFState *s; + int pa_range =3D 36; + MachineClass *mc =3D MACHINE_GET_CLASS(ms); + + if (mc->hvf_get_physical_address_range) { + pa_range =3D mc->hvf_get_physical_address_range(ms); + if (pa_range < 0) { + return -EINVAL; + } + } + + ret =3D hvf_arch_vm_create(ms, (uint32_t)pa_range); + assert_hvf_ok(ret); + + s =3D g_new0(HVFState, 1); + + s->num_slots =3D ARRAY_SIZE(s->slots); + for (x =3D 0; x < s->num_slots; ++x) { + s->slots[x].size =3D 0; + s->slots[x].slot_id =3D x; + } + + QTAILQ_INIT(&s->hvf_sw_breakpoints); + + hvf_state =3D s; + memory_listener_register(&hvf_memory_listener, &address_space_memory); + + return hvf_arch_init(); +} + +static int hvf_gdbstub_sstep_flags(void) +{ + return SSTEP_ENABLE | SSTEP_NOIRQ; +} + +static void hvf_accel_class_init(ObjectClass *oc, const void *data) +{ + AccelClass *ac =3D ACCEL_CLASS(oc); + ac->name =3D "HVF"; + ac->init_machine =3D hvf_accel_init; + ac->allowed =3D &hvf_allowed; + ac->supports_guest_debug =3D hvf_arch_supports_guest_debug; + ac->gdbstub_supported_sstep_flags =3D hvf_gdbstub_sstep_flags; +} + +static const TypeInfo hvf_accel_type =3D { + .name =3D TYPE_HVF_ACCEL, + .parent =3D TYPE_ACCEL, + .instance_size =3D sizeof(HVFState), + .class_init =3D hvf_accel_class_init, +}; + +static void hvf_type_init(void) +{ + type_register_static(&hvf_accel_type); +} + +type_init(hvf_type_init); --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564384; cv=none; d=zohomail.com; s=zohoarc; b=HDK+l5onMfsRRx/u02ne2rrZZx17CcBxwhb0cVeVXgfYGLQezHsZMmDcsS0AJ3F2UMQ5iWEdnPKlJIwNWYMMwtpRpsmtMdr1drV2Zevhhzk+Zku6d94HaMLKoLZ5GxfmF+MfAKo8S5iQEy4dmflVhXh5zo0tthuZkwX8Ot2Ms10= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564384; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=f7w2y29aMH8m2GXB1cVKamGcDeB4cPEpvmgmQ9G6W5E=; b=OZWTNChWPMLXhSAiWImYs+fRxq3pwkLUOTMB76dI63JkMu8Jh7TD5eG/beQ4nj7kLh/hG1XN/Hqfjdu9a8dp5ZdCz8H0BVXRRTpmGCzvWWGA9/B0lsNW8RgKGN3fDtJ+hqGksfFE2iIytCq5lmW0qWXx5e8wAs/33lXGV0bkTyA= 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 1751564384536311.6048290388493; Thu, 3 Jul 2025 10:39:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNpZ-00077m-Lx; Thu, 03 Jul 2025 13:34: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 1uXNpI-0006JZ-Uj for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:26 -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 1uXNpH-0000KB-99 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:24 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4538bc1cffdso885375e9.0 for ; Thu, 03 Jul 2025 10:34:21 -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-454b16288b5sm3607595e9.9.2025.07.03.10.34.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564060; x=1752168860; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f7w2y29aMH8m2GXB1cVKamGcDeB4cPEpvmgmQ9G6W5E=; b=T28jY78Pqc7y1V29IVWN0gcxnYHa69hTn6z4lJI+Tif3S8EglTDr7XJM6YWUqqDZ5G U5ThG5VeW93x9KUFVwtEivmrTMd0ocm4BQwfM5GQ/wlPmiznCXe47DjLCZBUznI1zTrE GU0QcJddstUTnpxZr2KA51JhKzBc5qoqdNLkd5BPs94Dk6UHpPxYuyhrTzC6AvNSpUz9 Fr1yt7pIvFgEj2izzOvJXb+cPnBXR09kxY9+iG5mBGqO+z/vUd+kz3vl7xiA/OcgP08Q /dqul3TWn+hOQOBulB4SZYnuQcMAIh4QtJfD/onzPbOYDCsTTBkQkm4W5N0L7DF+x8xv NVMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564060; x=1752168860; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f7w2y29aMH8m2GXB1cVKamGcDeB4cPEpvmgmQ9G6W5E=; b=t3fHbd/M9rhVAZFiKopAWx48QmAGZe4s5lWO8PmGzsb/njyHQQkY0CO9YFNX0m1PDv aP0Pz64QfgiL8+LxsUy5vBJajwaUrpRunOZsS3JbfxDbECLv56axJMpD7LTYc7FNdjU/ wADPh//vTBMln0aULtbMkgP3R87oypP3PvCM8tL4VNM3FueeO4AlNxGS1I59haOWZW79 2rjO42FdpmQKXHoCcoeSw1AxI6cMNDmT9zPabnIZChPt3ldhUn9yDuVpj3YsLiRvZRvM KPkzFakg0wKaHLA6XAqJBM++6sI+IKt7mVo9Zoo/6GLpwnGcphrCpvVgCJsJnL+bFNXl C2ug== X-Gm-Message-State: AOJu0YzpWCVvrYjOonYsif+EeAPXdyrIRvdw1cGjPL0VJYUwzYV+33eN VS8kVhJtBNbp2XGbTtex1GE8TQxGbbSuJhG8oCEiisEsq+A9zJWQxNLfdaxO9Wd3EsmQofqFpwD av5yi7+0= X-Gm-Gg: ASbGnctqxSiMS05/Py9Zphp/UfXlYVT2b/+IqgsQutZB3EaWQji40u0pmSbIH3AVx+4 NGkHFZE/yKvYoeZOt2y4yX3fKJ5J85lIEuND2sLGcEbtKjDx6WorqGMkVN5XnnL/wFYVP1fH8U4 fBY5/VCQW1jtrUPlXH/y0E891vjBg1xE4ykNUU8AgZGyy9QjVaqG6eDLy1Tz3gSjI/JanMgWTKI 6R92UpUTDh8tJBuv0/kXWgnqYpp8fTIpwlLiwq4ajtpz/s4V72+jo4DCXhvice2MNzDCmFAePzk DusKxln83ABTWDVxBuh9HGS+xhYUjE/h4C4LbaOOQOebp2k7lxS1aJeNrpY+0JjUGOKl9lI/gYG VByyU8hfQh3fcCIfSvsNMoOT1R0vDrqA0kF67 X-Google-Smtp-Source: AGHT+IF6eMSZZafa8TfN18jd07TqYP40t1K+4NkHapAdazU2PCoffmTqgnOFWnC4qDy+kz7lrdehrw== X-Received: by 2002:a05:600c:638e:b0:450:d104:29eb with SMTP id 5b1f17b1804b1-454a36d7ab3mr75862045e9.5.1751564060252; Thu, 03 Jul 2025 10:34:20 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PATCH v6 17/39] cpus: Document CPUState::vcpu_dirty field Date: Thu, 3 Jul 2025 19:32:23 +0200 Message-ID: <20250703173248.44995-18-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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: 1751564385975116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu Reviewed-by: Xiaoyao Li --- include/hw/core/cpu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 162a56a5daa..5eaf41a566f 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -442,6 +442,7 @@ struct qemu_work_item; * @opaque: User data. * @mem_io_pc: Host Program Counter at which the memory was accessed. * @accel: Pointer to accelerator specific state. + * @vcpu_dirty: Hardware accelerator is not synchronized with QEMU state * @kvm_fd: vCPU file descriptor for KVM. * @work_mutex: Lock to prevent multiple access to @work_list. * @work_list: List of pending asynchronous work. @@ -538,7 +539,6 @@ struct CPUState { uint32_t kvm_fetch_index; uint64_t dirty_pages; int kvm_vcpu_stats_fd; - bool vcpu_dirty; =20 /* Use by accel-block: CPU is executing an ioctl() */ QemuLockCnt in_ioctl_lock; @@ -554,6 +554,7 @@ struct CPUState { uint32_t halted; int32_t exception_index; =20 + bool vcpu_dirty; AccelCPUState *accel; =20 /* Used to keep track of an outstanding cpu throttle thread for migrat= ion --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564415; cv=none; d=zohomail.com; s=zohoarc; b=TQfWwmWkha29AGwXeJ0G8vzie3DtBgF6X2sXIgpyWzheFJ9gePhMJ04rmDKDVnQgEo0a0hzH3pmhz3UFh3nQoaVK4S21RP0ht1iHGs3wjZ9gzAhxr10zyoYmekLLX/GT6IPd6hwynyjahAvzNvhiCD2MQ9nIbMGxVwOfcsKOGmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564415; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=L0qV/fhVJIjz1bwc8Z/fAa3vtgS6Ly+7flgKH+q/xGQ=; b=oMFeQkl5juQib73acyc9sj6mvi0nuttA5eJV51aP750XUjWiP3/bCdHrEvRggmZxbSgOMeanFzG+fSKmL3dGtSMmX3/4CnlzWV8HpuBAEHr0h6QhNzPsIou9jBAXDBqh1bbVSm4ZqHDpkYmSyiz9QNW9W5uxf/hPWYgtxMvas88= 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 1751564415132438.909224207011; Thu, 3 Jul 2025 10:40:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNpd-0007Sk-Qq; Thu, 03 Jul 2025 13:34:46 -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 1uXNpO-0006Sm-Pu for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:32 -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 1uXNpL-0000UC-RH for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:30 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-450ccda1a6eso599525e9.2 for ; Thu, 03 Jul 2025 10:34:27 -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-454a997b1ecsm32801235e9.11.2025.07.03.10.34.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:34:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564066; x=1752168866; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=L0qV/fhVJIjz1bwc8Z/fAa3vtgS6Ly+7flgKH+q/xGQ=; b=i8/osWmGUM5OKFFedS5xSsR7PHejwVBtGUQSgvCqj94Rp3b5hpsiE2a5CQVAYLGR/M CbqFg6L8C8SB3KQxFxNWBZG02d+VYCUhMA+JmgyxYPfPpZJLaAvr8GvTW0XpN5p9QvxS QDdMBDifnuoY9rOQfQhviiYtz+8gJzUsrxCcj9RdwlZRIq86V3xlSlFx6hyMwBE8fcD7 MCBa6Ldx20xF8XskfFvauomQLql8xLYWyXFE0erTqi72y6J9Nf+TsI5Jxpii03pPK+oM ww0k6c9LM7nNE/TS6pOn60WxGNNacEjVE3Wirb7SfVDA7HLKFSCRlp1gCVZoJtoIeGaS r4Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564066; x=1752168866; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L0qV/fhVJIjz1bwc8Z/fAa3vtgS6Ly+7flgKH+q/xGQ=; b=lN2F+EfISNlEnKL/PE8iPNbYxMhaF5+9Q6NjZ5O2mK04jNyF/sWLXt5OXBgPqrVI9r VirGdhIc7D7j2sBiBFayTG+DgsncSHLmi87UQ8L6xFibvvXzUtIzUh8A25QynHltOZmE rozsoB/DAGqOoUihz8ivXkXOSkbbR3WM0Nll5HYUDFZRPaVLrnEgTpDwFXy8GHN/+enW XdPejuESkvH7UDZK79wqDOPtYYic5SUdhb4FCPpUnQfst6zWZ0Stn0mbXQFPqrz8j3Hw JYWFYUQbOsFyo7v0Ds1ThMKPLprM2+mPlt3gVd9OHa4Q2MZ/K3K/llgeqtQOmMO+Ox9T jADw== X-Gm-Message-State: AOJu0Yy90WHcEBjJQeel4pyuXmRqaM+NRmHkN2+WNwzsG/cvJPp+EmB4 AnnL7KpPkRrojlHE58KRVhfdsC7HC4759tMG1HFVj3tcp2sORULkyr2MHpbfXz4cuMV4vCtOf7q +J7ppcRk= X-Gm-Gg: ASbGncuBqQBryi9sTtZR475qLFygnRaZ+USwVsxT2X9FeFFcgpQik6690QuEooOU7J5 2A0M4cTdBWP+cxTudVrywbk2cicemEDM+0hJEuDIi98OgSc/mqdRLLjHqqReHYx7cwsTrtWZSlM H8DHbpzNOh8ZmV3Dg9lVp07HvYAfPufLYcO5OuQhpSjDsyqvp2SBg7pOhLv1Q1SgckD7h6X5f/M uv5ZgLdAHIsJUnKg3J0d68BUbuiNsmt/jJ5JfekBa1YeUWdEwORC250iFdNVmL6BcWEILB6D7s0 p5T1zMjxFWzkHCCekuVvLWU8AxBcqBsEOCGsK9ffCT5LDwNKtrzQKXOmms7xtAFechQZ9MAsU+d dWvitFxF4beM0z1KZn7jKJI6NgWzCNmjEckc0 X-Google-Smtp-Source: AGHT+IHcIHY9lMMNmkvv5V+f3SofuDuAff/K4Ge3x+w//CdiWmivy2xE9xv/5wuK0iKf5DJ+gBSq/A== X-Received: by 2002:a05:600c:3509:b0:453:dbe:7574 with SMTP id 5b1f17b1804b1-454a9c6fe94mr55040495e9.12.1751564065841; Thu, 03 Jul 2025 10:34:25 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Phil Dennis-Jordan , Mads Ynddal , Alexander Graf , Peter Maydell , qemu-arm@nongnu.org Subject: [PATCH v6 18/39] accel/hvf: Replace @dirty field by generic CPUState::vcpu_dirty field Date: Thu, 3 Jul 2025 19:32:24 +0200 Message-ID: <20250703173248.44995-19-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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: -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: 1751564416993116600 No need for accel-specific @dirty field when we have a generic one in CPUState. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- include/system/hvf_int.h | 1 - accel/hvf/hvf-accel-ops.c | 10 +++++----- target/arm/hvf/hvf.c | 4 ++-- target/i386/hvf/hvf.c | 4 ++-- target/i386/hvf/x86hvf.c | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/system/hvf_int.h b/include/system/hvf_int.h index dcf06f53d97..ecc49a309cf 100644 --- a/include/system/hvf_int.h +++ b/include/system/hvf_int.h @@ -62,7 +62,6 @@ struct AccelCPUState { bool vtimer_masked; sigset_t unblock_ipi_mask; bool guest_debug_enabled; - bool dirty; }; =20 void assert_hvf_ok_impl(hv_return_t ret, const char *file, unsigned int li= ne, diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 6b1a256deb5..2944e350ca9 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -79,15 +79,15 @@ hvf_slot *hvf_find_overlap_slot(uint64_t start, uint64_= t size) =20 static void do_hvf_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data ar= g) { - if (!cpu->accel->dirty) { + if (!cpu->vcpu_dirty) { hvf_get_registers(cpu); - cpu->accel->dirty =3D true; + cpu->vcpu_dirty =3D true; } } =20 static void hvf_cpu_synchronize_state(CPUState *cpu) { - if (!cpu->accel->dirty) { + if (!cpu->vcpu_dirty) { run_on_cpu(cpu, do_hvf_cpu_synchronize_state, RUN_ON_CPU_NULL); } } @@ -96,7 +96,7 @@ static void do_hvf_cpu_synchronize_set_dirty(CPUState *cp= u, run_on_cpu_data arg) { /* QEMU state is the reference, push it to HVF now and on next entry */ - cpu->accel->dirty =3D true; + cpu->vcpu_dirty =3D true; } =20 static void hvf_cpu_synchronize_post_reset(CPUState *cpu) @@ -150,8 +150,8 @@ static int hvf_init_vcpu(CPUState *cpu) #else r =3D hv_vcpu_create(&cpu->accel->fd, HV_VCPU_DEFAULT); #endif - cpu->accel->dirty =3D true; assert_hvf_ok(r); + cpu->vcpu_dirty =3D true; =20 cpu->accel->guest_debug_enabled =3D false; =20 diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 995a6a74b06..ac0d6ef8187 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -813,9 +813,9 @@ int hvf_put_registers(CPUState *cpu) =20 static void flush_cpu_state(CPUState *cpu) { - if (cpu->accel->dirty) { + if (cpu->vcpu_dirty) { hvf_put_registers(cpu); - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; } } =20 diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index b25bff0df41..9b8acd5a946 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -733,9 +733,9 @@ int hvf_vcpu_exec(CPUState *cpu) } =20 do { - if (cpu->accel->dirty) { + if (cpu->vcpu_dirty) { hvf_put_registers(cpu); - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 if (hvf_inject_interrupts(cpu)) { diff --git a/target/i386/hvf/x86hvf.c b/target/i386/hvf/x86hvf.c index 2057314892a..17fce1d3cdd 100644 --- a/target/i386/hvf/x86hvf.c +++ b/target/i386/hvf/x86hvf.c @@ -427,7 +427,7 @@ int hvf_process_events(CPUState *cs) X86CPU *cpu =3D X86_CPU(cs); CPUX86State *env =3D &cpu->env; =20 - if (!cs->accel->dirty) { + if (!cs->vcpu_dirty) { /* light weight sync for CPU_INTERRUPT_HARD and IF_MASK */ env->eflags =3D rreg(cs->accel->fd, HV_X86_RFLAGS); } --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564456; cv=none; d=zohomail.com; s=zohoarc; b=I77tdHIRnxiV6PQsFbe5s3sCanjrDr22TdPYuDhpJghcDcxV7CEv4VvZwlwqFehh9xjfjNBKxifkwKxRW3kwY2gLaMfvm0BrbH8/mzR9CKc+hW42n6jXVCEz6bmF7rVGofzHrA5cmaKOhNBVh3x129jdAqAFF2IUzBj9yG7Y1Gs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564456; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JWKEWRHQpEpbh6ailemJvHhnr8Dm9jf2WfUx6in3sZs=; b=K6YcOZ6uzEFHJ/eZomulH1Eby/sJtJsN0L4tQNYgnYCT/tEwGOVg8JsRrFTAFowz002njMGTkZ1j8FTqQQJfnZHkvc17Wn0MLNE2IFpsSWH/mvykSECcAlv2fhN6BQlsWUiY/A0yssYJAvgoaQBsGWqEGfs7xp8kyPd532nJdDg= 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 1751564456287881.4950779922439; Thu, 3 Jul 2025 10:40:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNpd-0007Sb-RR; Thu, 03 Jul 2025 13:34:46 -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 1uXNpT-0006mA-Q2 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:35 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNpR-0000ck-7d for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:35 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3a51481a598so26449f8f.3 for ; Thu, 03 Jul 2025 10:34:32 -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-454a9bcf35csm32146605e9.20.2025.07.03.10.34.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564071; x=1752168871; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JWKEWRHQpEpbh6ailemJvHhnr8Dm9jf2WfUx6in3sZs=; b=m3QMR9mFFgDweC1nuI6a8DtrocSETTj8TiwgO7eSdXcmZzGPexPTtYNl/npKuxb6xC GYjyV5Xqi/Z+5h9LWb66ygRK0KgTmAVJ41oIWNQ50wYLXl7LbscZQNzHJdZW/gJMseuz 6+teu8O5z1C5LOHf6C+XyaznbCKQXf2Roy+0DozZcP/s0iPKd70/WRSHAb93haLRaqAp qr74fvQYrpOC9uDb1uHc7pnV+TGrKcRDiRT6H8QX5jKM0tkFT0xBaCthnYzOT9OUP/d0 XPSOCWM9TmOAjPgPH0C4rDgniLKpTAleXn7HGB+gSJR7eOeZgSmVMAAs46AodPuJW1r/ zxSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564071; x=1752168871; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JWKEWRHQpEpbh6ailemJvHhnr8Dm9jf2WfUx6in3sZs=; b=qPAnsjLHBVuCQJDATeuziUF9vAEUChrQvhQadnrikLL9b0sTlpULTLCWkx0QsuAr1h EZvvardzD2eRtwlGa/5GqjQ/mHQnewaSFWEbtKfr06FcbCbu1xqg5h0F+567KKh6Kfch k3ZuaAHDNS+/X40AGiqRw2gEnLno5hI5DvV8cVbzGC5m57l+3mfo4aq5H79xNMoxwIxF oR7I0jFaqiOo02E0pZrP3pHGWnzygEko3dMDMSemmuiY0J4QzMacwKEWg+2o6nbE/hAE R1ED2nxgm7JTHZKR1QKBSj8F3S75TdbgFWP3GPH4EHLrj31BNlBzPnHM4jRH/9qFkyak 7vMQ== X-Gm-Message-State: AOJu0YwZnKsOGA1fjg70h2SFWhXOgqIP43rTaHFU0p82m+U5mgjj9IWD Ub4F+8bVYoER2AgjgycVjSJVL6z7Pxgyb6Vk3EoWYiU0gv1r3D8LGO/a5EWtlaoYozUHbULVLqc RMwY7bgs= X-Gm-Gg: ASbGncv56zhVkUARFaReyPC+rrKwwXN8Y37VpWdK9O8v+kYQn+M+aLyP4FBvxfncgrK PaKd7fyLPnUkvmN0jdQSnvvTr9kcBkQF+teEQENiLmlplBejwFFTNtjqjnIrz0nOquj4pcSGRUm ySbkuZ3idJtGP6ykJEGoV7bfA/FikOLHfyeV3kc2w4fFVi+dADmz99X7G1tg67NYFuC+/8hKb6l RgUcJvtgHVvfnnJF+yC4rHaqOH2tNJh+tgTJ3tfrLmx+GIezF1Pyxav+VilESETy6i8BB+MtFip C/RRSIy1JiVUSZIwtv1Gvjk6uU/n/xql1UYC8iJKqLyB/Qn4zOP1yDwwt76ap8G5TdMlLC98XJT 3GbqBHmompfY7ZqtZqPx66Avapn4boOndskRt X-Google-Smtp-Source: AGHT+IFie8PMVY64uuF3iyQJVp0HOVjZO76RGho0BQfImVhrebRlQMoujd3ZynngWaeIZg05hFVCRg== X-Received: by 2002:a05:6000:1a8a:b0:3a4:f786:4fa1 with SMTP id ffacd0b85a97d-3b1fe5bf079mr6351189f8f.2.1751564070792; Thu, 03 Jul 2025 10:34:30 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Reinoud Zandijk Subject: [PATCH v6 19/39] accel/nvmm: Replace @dirty field by generic CPUState::vcpu_dirty field Date: Thu, 3 Jul 2025 19:32:25 +0200 Message-ID: <20250703173248.44995-20-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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: 1751564456887116600 No need for accel-specific @dirty field when we have a generic one in CPUState. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- target/i386/nvmm/nvmm-all.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c index f1c6120ccf1..aea61a6fd2a 100644 --- a/target/i386/nvmm/nvmm-all.c +++ b/target/i386/nvmm/nvmm-all.c @@ -30,7 +30,6 @@ struct AccelCPUState { struct nvmm_vcpu vcpu; uint8_t tpr; bool stop; - bool dirty; =20 /* Window-exiting for INTs/NMIs. */ bool int_window_exit; @@ -508,7 +507,7 @@ nvmm_io_callback(struct nvmm_io *io) } =20 /* Needed, otherwise infinite loop. */ - current_cpu->accel->dirty =3D false; + current_cpu->vcpu_dirty =3D false; } =20 static void @@ -517,7 +516,7 @@ nvmm_mem_callback(struct nvmm_mem *mem) cpu_physical_memory_rw(mem->gpa, mem->data, mem->size, mem->write); =20 /* Needed, otherwise infinite loop. */ - current_cpu->accel->dirty =3D false; + current_cpu->vcpu_dirty =3D false; } =20 static struct nvmm_assist_callbacks nvmm_callbacks =3D { @@ -727,9 +726,9 @@ nvmm_vcpu_loop(CPUState *cpu) * Inner VCPU loop. */ do { - if (cpu->accel->dirty) { + if (cpu->vcpu_dirty) { nvmm_set_registers(cpu); - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 if (qcpu->stop) { @@ -827,32 +826,32 @@ static void do_nvmm_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data arg) { nvmm_get_registers(cpu); - cpu->accel->dirty =3D true; + cpu->vcpu_dirty =3D true; } =20 static void do_nvmm_cpu_synchronize_post_reset(CPUState *cpu, run_on_cpu_data arg) { nvmm_set_registers(cpu); - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 static void do_nvmm_cpu_synchronize_post_init(CPUState *cpu, run_on_cpu_data arg) { nvmm_set_registers(cpu); - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 static void do_nvmm_cpu_synchronize_pre_loadvm(CPUState *cpu, run_on_cpu_data arg) { - cpu->accel->dirty =3D true; + cpu->vcpu_dirty =3D true; } =20 void nvmm_cpu_synchronize_state(CPUState *cpu) { - if (!cpu->accel->dirty) { + if (!cpu->vcpu_dirty) { run_on_cpu(cpu, do_nvmm_cpu_synchronize_state, RUN_ON_CPU_NULL); } } @@ -982,7 +981,7 @@ nvmm_init_vcpu(CPUState *cpu) } } =20 - qcpu->dirty =3D true; + qcpu->vcpu_dirty =3D true; cpu->accel =3D qcpu; =20 return 0; --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564685; cv=none; d=zohomail.com; s=zohoarc; b=IqU/6pkscEGIGFLVMmvdH7++ucZoRaosCFrGD+vwc8Qi4t0UWx43Itqk3tAqtv/vIAN2zT0gShJNyL0P9FjKUQDBCtTZOr3KQesFY6MV7r4KplMcZAhcfOloBB+OyyajDVLewQDglvcZ6R8XNt6wbPVlAp/PYTHLH/BwYjGNNU8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564685; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eyTjZz7bBnxk9ld1sqElOmPl+Sebl+xEl5P+valYmlY=; b=gGaiGH4YNYHsEk/32/c8feeLY07Kf82QM58woc21csDm3HJr/MyWyyYN10MjzLrCNWRsdi4rDUizHP5c4DGkJTy2O1574+Ybr6sAYzXfXH2r6iqpmVOrizevhBQKzL9yWtExdaQ8ASgq7T4EaAEWZ9bfISjGpYgetbGldTmjbNs= 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 175156468531898.75576814410238; Thu, 3 Jul 2025 10:44:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNq2-0007qM-Al; Thu, 03 Jul 2025 13:35:10 -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 1uXNpa-0007Lt-Q6 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:43 -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 1uXNpY-0000p7-Rd for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:42 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-450ce671a08so606335e9.3 for ; Thu, 03 Jul 2025 10:34: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-3b47285dc08sm311401f8f.98.2025.07.03.10.34.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564078; x=1752168878; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eyTjZz7bBnxk9ld1sqElOmPl+Sebl+xEl5P+valYmlY=; b=V+qBZRDNXROM56SdOJo5Dy24IKYJNnPYXRT1LxAZwWjeyd50jITmNWpgB0S202uPsJ UqR330aKGeTwhIbc2WmarTwZzMs8A2UfyvnnKaXoHCU3On2lxmOGJDx2Wnb9kDkrApu+ ESwfo/xPnlKeJ2Ti+9iE6pRyCVr1XBJQCfgaHLblhOEan6zQ/36m8IQrcI2bcVkPULGg uXbPDRh+LGr/o9i5L8QgLwhPzKHWWn9ElURPOmgJ4IWE6i9S1JmAX5LuDtOdP/1Tooo9 OD/Qo/Us14bvURPft7Wf/R6wb3cTuFTK0cQjst+GN3niVyVuht+l1k6LX2NlaBAguFTu kGnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564078; x=1752168878; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eyTjZz7bBnxk9ld1sqElOmPl+Sebl+xEl5P+valYmlY=; b=U+2fnxaiarWsLZB18zrLHu5yjOAFGyBiC+bEO844jFwZui17z9p6skMcUVv+ctkdkB sEE7Dl3fGAqVNdXSJO/QEBiWz1xokrDXkZMyL2gOe0sT/am7iL3cQgjYMx9WjYHxTgNU V+dCVx9PjxYMvprWjLTPFEbPW+PQDkGP/EwTAevUh+NUtaQ02tooZmG9Im3EkTcAOszZ k+C1IOfZ96AczPixUyW/yLL2Ejdet4qhaaTFmYsG38j0ewg+X3rbVtrrrKbIDKJxn767 keQ0edgAtpFu3Ib6NUsgXLClEAV/t8L1rvqLqCm/peVy2cxAaCL7faHI0ruFBJ6Sah0u WpIA== X-Gm-Message-State: AOJu0Yw8giqv2SzwE3GvTsHO1gnMGsIuSA56ioqHKd5EXGDR0AsXWEdE cFaIYCBe3vkvZuIX611SVXgtg9FT4EhWZAmCz2zaAaviEW2OIVhkfYh3Uh9LAjp8G7g0kCropHd WxHBshJI= X-Gm-Gg: ASbGnctcO7R+wveVY0p2v9GcSTH+bWlpqMgm7TtOy/x/q4V1OB9uY6804+4GNMYicgS XCt/BbxJ7vkIfI5JvkVtdH3AnNOOdZTzS12D9HAw4Ywdm8IztxthItA6skoNuWrecCaDuyvowoV 6fFhEMRWFMRTeOEu/7zJkDIMFiaGd1rQ1xZh2CxFxlwew3RdMe/0rWcEslGVa3+0AT4MGd36nQD spIFpHEu3WdnxfAgXoVw+nDs3JzVJhUf8GNZCWrAtrXz5PGVvB5fJEST0LpbQrIUgCoRsSXQ5P/ GZs0R3uLz2Si1dDyXgYPyZM1V71GLKAcPEq8KriOWHi1x+ebjZFccxfs5dU3dw0vfAbKbQLzG8c reQQNTBY58cEb3ZCzFFLYpYHVxGZtKleOaisU X-Google-Smtp-Source: AGHT+IFAJHwkgEpIDo3r/dndYw9yiQ+ExEG0BWMSJ0UFCuvq5gnAH+1qx0/80wXcTMZ+W44NRh6H1A== X-Received: by 2002:a05:600c:4e90:b0:43d:fa59:cc8f with SMTP id 5b1f17b1804b1-454a373b017mr79001095e9.33.1751564077925; Thu, 03 Jul 2025 10:34:37 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sunil Muthuswamy Subject: [PATCH v6 20/39] accel/whpx: Replace @dirty field by generic CPUState::vcpu_dirty field Date: Thu, 3 Jul 2025 19:32:26 +0200 Message-ID: <20250703173248.44995-21-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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: 1751564687638116600 No need for accel-specific @dirty field when we have a generic one in CPUState. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- target/i386/whpx/whpx-all.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index cf6d3e4cdd4..5001afad3a7 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -237,7 +237,6 @@ struct AccelCPUState { uint64_t tpr; uint64_t apic_base; bool interruption_pending; - bool dirty; =20 /* Must be the last field as it may have a tail */ WHV_RUN_VP_EXIT_CONTEXT exit_ctx; @@ -836,7 +835,7 @@ static HRESULT CALLBACK whpx_emu_setreg_callback( * The emulator just successfully wrote the register state. We clear t= he * dirty state so we avoid the double write on resume of the VP. */ - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; =20 return hr; } @@ -1391,7 +1390,7 @@ static int whpx_last_vcpu_stopping(CPUState *cpu) /* Returns the address of the next instruction that is about to be execute= d. */ static vaddr whpx_vcpu_get_pc(CPUState *cpu, bool exit_context_valid) { - if (cpu->accel->dirty) { + if (cpu->vcpu_dirty) { /* The CPU registers have been modified by other parts of QEMU. */ return cpu_env(cpu)->eip; } else if (exit_context_valid) { @@ -1704,9 +1703,9 @@ static int whpx_vcpu_run(CPUState *cpu) } =20 do { - if (cpu->accel->dirty) { + if (cpu->vcpu_dirty) { whpx_set_registers(cpu, WHPX_SET_RUNTIME_STATE); - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 if (exclusive_step_mode =3D=3D WHPX_STEP_NONE) { @@ -2054,9 +2053,9 @@ static int whpx_vcpu_run(CPUState *cpu) =20 static void do_whpx_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data a= rg) { - if (!cpu->accel->dirty) { + if (!cpu->vcpu_dirty) { whpx_get_registers(cpu); - cpu->accel->dirty =3D true; + cpu->vcpu_dirty =3D true; } } =20 @@ -2064,20 +2063,20 @@ static void do_whpx_cpu_synchronize_post_reset(CPUS= tate *cpu, run_on_cpu_data arg) { whpx_set_registers(cpu, WHPX_SET_RESET_STATE); - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 static void do_whpx_cpu_synchronize_post_init(CPUState *cpu, run_on_cpu_data arg) { whpx_set_registers(cpu, WHPX_SET_FULL_STATE); - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 static void do_whpx_cpu_synchronize_pre_loadvm(CPUState *cpu, run_on_cpu_data arg) { - cpu->accel->dirty =3D true; + cpu->vcpu_dirty =3D true; } =20 /* @@ -2086,7 +2085,7 @@ static void do_whpx_cpu_synchronize_pre_loadvm(CPUSta= te *cpu, =20 void whpx_cpu_synchronize_state(CPUState *cpu) { - if (!cpu->accel->dirty) { + if (!cpu->vcpu_dirty) { run_on_cpu(cpu, do_whpx_cpu_synchronize_state, RUN_ON_CPU_NULL); } } @@ -2226,7 +2225,7 @@ int whpx_init_vcpu(CPUState *cpu) } =20 vcpu->interruptable =3D true; - vcpu->dirty =3D true; + cpu->vcpu_dirty =3D true; cpu->accel =3D vcpu; max_vcpu_index =3D max(max_vcpu_index, cpu->cpu_index); qemu_add_vm_change_state_handler(whpx_cpu_update_state, env); --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564720; cv=none; d=zohomail.com; s=zohoarc; b=n+DXXH56T/HV/m+AfC/oc9ujTtiZ4pa5HFVU+byRlFKjNVSJMBDo0yAzvb1p1TAWop+UxAo6ZHziq9Cl8GBPhWzNGvj8do384HSOtFc2GKHbsOpf9DxoLWkidhRryOLvdTNEnIZrwHe0BhvP2HIdoddLF2I4cLNNIgnWXBKNaPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564720; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zOj2l0QjwiOWVtDmZos93I73sy6okOj775eGXYWLug4=; b=nODVc4/6nX+CSYEOPQqK7ygYHc0611nB+2sSV3ucR7TM8dhrvlwtmyp+PHxx7UMJDlmaeqUDvx5TCsaFnjOrHICPfO6JlybG62d466NDeSxtiN5UJbuKSUvca6czN/9QXyvNC/5lehdKtCILw8zclbHokEOFv3Icpzxe/POS8Tw= 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 1751564720349440.1465427964316; Thu, 3 Jul 2025 10:45:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNq2-0007uy-GE; Thu, 03 Jul 2025 13:35:10 -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 1uXNpg-0007bq-Pc for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:50 -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 1uXNpe-0000xh-UW for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:48 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-453608ed113so1118925e9.0 for ; Thu, 03 Jul 2025 10:34:45 -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-3b47225afefsm311104f8f.82.2025.07.03.10.34.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564083; x=1752168883; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zOj2l0QjwiOWVtDmZos93I73sy6okOj775eGXYWLug4=; b=XyP4NvrA/eFtLPquR0AUqRBhtdTRMqDh6uiuAZbZfTOHEO0dVmyvOvdbmdSvCuaGAC JKQjNHR4F1oHl4xoJd2bHbabajcHUHZxK1kdPJLVojrNRrznj7SCc8ZceX1uCCJFWXqc XR0vGVwJyVo3q+uGpdzAV8s3vpo8q0d+7byVPHDDMfKfY6qwZGzoZJG3yp1OifP2KnGy Yk2szSA1mhTYCgO7STfWgNvqISSBftSm7BQzJmFwlefasVp+AKRjXz5NrA0qFHbTlVqQ Ocq0NEMHd5b6L1rUriKtanxxOdmaM4mLIhyYhTcX93hmM2pYwDUyG2/PaZOSvCGkI3Bl WsQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564083; x=1752168883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zOj2l0QjwiOWVtDmZos93I73sy6okOj775eGXYWLug4=; b=wc3PL2Pg5GBnI9Wo4qg/qf4dyP1nfN82kSh4EUOlwzQoZ3OZe2oOKlhIhRmHz2umys xJAKkDjVjCgyFWnvUxYSr/eX5+5YncP2waNAvnEDqDi61vEkmrzYWDo32fLRKaxI13mu ixT6O369CUB8tu7qf7hpp3tfTKbSnS1itTjdunOOic012ZaGBNji/Pex9kH+B3dFYSun aQyVGY6ky5Oa+q1osB8tHFHIBN4DJp1US/8kxoCnJRhQeXqywyiP2/SSLu9nbrzGpDsM F7MQADfC+o2d1t4aiCe/u6THxsJgvB9h0voLUM9zO7F/OxAz91AQ8x3QBdpslHEvXkLF +v8w== X-Gm-Message-State: AOJu0Yy3B6R/7FCqDYyk+J5JiFH5CZEM16KkFvIngyhed78FoPWa1rl3 4QyxK193mE6Zx/5fEIwadAuutUip43/kmnDUDj7d7EAIajX98+jQcn7gMUsb+OW3PxSdt3caxWj SKOLaxuA= X-Gm-Gg: ASbGnctkz4b27O4cywnkKIFaKzO8FTHX/frZdv0/XwekqSApZnXMLxtr79/hGocpSIh V/gpZ4xgfoYmaxi5fnY1AaqcB4QFgVhkbn0FQLsi1MoY5e8DWg7Fv5Hxz2cxmqSaBjiYyHW1iZc F/WOTZkpp0a+GRz1tdwDrufwgo0QzIXOXVrdaVDjrSLS5bnbMaaGUgYQhTbtCiRbN3BTgH7lAd3 0XIS8MIX5k1hBrNoXU6ekgkl99kMDY+Id/jPgQ4k+rICMlZTJ72uW8vLxHckSxM7NnNVpkcS5Uh ogWwxdoYLc1Yuy3UCDf8O70+T98OSV7dANr09GqPfX1VAkMnwJ9UwrgxJEujCaivfgixtEHC+kw tqK4SkZ6CcYGJle36MFuft8SoZL0ogyTwzGjV X-Google-Smtp-Source: AGHT+IEf7t3XY9WG5MiyINoO7fyv1zs6ACiM9J1a/TjKhFcJOEWEm+sjYOgNuSXDyqWbySjiSaOs1w== X-Received: by 2002:a05:600c:1c9b:b0:453:5c30:a2c2 with SMTP id 5b1f17b1804b1-454ae6124a8mr32945485e9.8.1751564082777; Thu, 03 Jul 2025 10:34:42 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org Subject: [PATCH v6 21/39] accel/kvm: Remove kvm_cpu_synchronize_state() stub Date: Thu, 3 Jul 2025 19:32:27 +0200 Message-ID: <20250703173248.44995-22-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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: 1751564721986116600 Since commit 57038a92bb0 ("cpus: extract out kvm-specific code to accel/kvm") the kvm_cpu_synchronize_state() stub is not necessary. Fixes: e0715f6abce ("kvm: remove kvm specific functions from global include= s") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- accel/stubs/kvm-stub.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c index b9b4427c919..68cd33ba973 100644 --- a/accel/stubs/kvm-stub.c +++ b/accel/stubs/kvm-stub.c @@ -29,10 +29,6 @@ void kvm_flush_coalesced_mmio_buffer(void) { } =20 -void kvm_cpu_synchronize_state(CPUState *cpu) -{ -} - bool kvm_has_sync_mmu(void) { return false; --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564542; cv=none; d=zohomail.com; s=zohoarc; b=iUlJXI7Uxfut5jnBDWQ9gX2UVZCxX3TckAAZrS5727yej6wPX0cvOHwEIa9Iv1URWOF930nm1GdtLJhSenr0Y1lIVxf0+dLDNeddGjaqs2MHZ6rbu2GvMXI9m/sZEo1n4FMroVszUeCeKHLqQCDS/7Alj8Oq38nu/O0Cp7798xg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564542; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ro5ctCwhGdmPqwtlx9sII1oT9bNsCF22mscjy/dvrsM=; b=dm87kt8Ci3qiHUelKWGCvhodsAh84RRFucUriO1CTVAiLqQvtiifwQstgRP+7e5sBMRDuh4z5EurWD5FvjgnUMliNMoj1TTqrJSZqUJaDKYjU899/BNxBJ1zSJN9sCjCaojSZT7HjZsr0RMoq7sVbV2JIR7WtLBPYhNw0xGm3sg= 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 1751564542975550.9743605798203; Thu, 3 Jul 2025 10:42:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNq4-0007zk-2H; Thu, 03 Jul 2025 13:35:12 -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 1uXNpl-0007l8-UZ for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:00 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNpk-0000yl-7t for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:53 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-453398e90e9so640985e9.1 for ; Thu, 03 Jul 2025 10:34:50 -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-454b1628ebcsm3577095e9.14.2025.07.03.10.34.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564088; x=1752168888; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ro5ctCwhGdmPqwtlx9sII1oT9bNsCF22mscjy/dvrsM=; b=HiM7u4/ZYSFoVex2v0QUmOFg+3WXyS/+UeDxi36vaMR56K9xrF9HRZqcksQqWadza0 GdhrEW1//tAKEUqTl862Pdx1G7DyubEpg1EsbVBf5b8TA3jGjA5C41rUsv7BVnHRBVyj XNDpZgNitomNLKtfwt+XJVS57HycvlXDpmIPC43VL+6J0jYTdaADEWhcHyue5K1DFidS FwSN26srNuGcDTkwbi6Q6WCeq1vgUH90oSj4KX0bjudPmXZAJisu844oNZAH39AGRyhe 8urFWcMPdKZr8KlTNYCQmAN/M+X8vsq2wwNUgBYfuBJWyjs8ye5s1G38UixnSs4vgTwf vtZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564088; x=1752168888; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ro5ctCwhGdmPqwtlx9sII1oT9bNsCF22mscjy/dvrsM=; b=qdShmC5uSoowO0riZ5wqeAzn20Sw3e8yf8aY5XkECnbgjFnF0bkeIhT5lvSd/S3Q6s inTxZKxiMqyGgeNq4piAU/z+H/iY/EiiZBnNpxSZm7Sncaz3tRUVInFkjcujGSw5BEWh xt81AVTGitwdvQvJMPnV1z9wZKWGqKupM9ZSy9wYKpJbVtRaMMFuvp5FbaUs+P+HJvpK t58ipn9TGP2q50pf6sZ+65CYqk3QLlQvBFIaZw2fPUTbXz5oKzHHhFwoZVn51TQM5sku WctEnZc4Qv1ahzmxC0hUeHukt1WhojdfPO/4IJOdEUdqTCf/DAf7j0MjIlqRVGBR1/pR cCqg== X-Gm-Message-State: AOJu0Yz7MD5EesadgkxJp9NHvGvpUWMsg7MyssMW3TTrZswXtWBGd6vF c3HimLsdtLPc0e6DpSAUWs62W8A5/AWI0hIWGOTl4wFjC5c52Q5hC/uvBJas88HMrFMNnns4HTW knaAYV9U= X-Gm-Gg: ASbGncs0fdQz1mjEj6e73bfG16TGmdLTnCr9JrqO1kTq2kgVKifGlafNoxUIV8JsAJn +mb/jJWUC08SY3x8b9wUOqWKgUxe9c/uAG2W6exiZRS0SCTIgB9yjXyGk0msGICfeMYqMLbXhS2 GPE4fsK5eDPpccKTEsLuczCMWK3p3lQIRBtvZWSmbPIpz6eIhxEDe0aYCAtW7j9ZDa1xRRQ+mPA Vq9tZo55B1WZBnv2Ka+ey/qqrm+WpTfXtqeTzvaaHJ7hMgBeCbGwfpzcfrLs6XgP+RBH7JkXJBI 9SmNp6/PVK4IXUgUsRbGVnP1mE66fbyfwWYrp1G/gHDu/1tlTcI65IgFF9oXMHoyCZlmSr+xSRn DszyO/hC2bTXaOkkvzUT8aaxpTj5JI92nsaLG X-Google-Smtp-Source: AGHT+IFGjwTcI9fk7y3VA2kN2LZX02MW3Bm+zUvIkhzMam+WVG6h8xwUqOmOMMDndPlvjdSluq+agQ== X-Received: by 2002:a05:600c:540e:b0:43d:b3:f95 with SMTP id 5b1f17b1804b1-454adabf504mr29483255e9.28.1751564088090; Thu, 03 Jul 2025 10:34:48 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 22/39] accel/system: Document cpu_synchronize_state() Date: Thu, 3 Jul 2025 19:32:28 +0200 Message-ID: <20250703173248.44995-23-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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: 1751564544031116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- include/system/accel-ops.h | 8 ++++++++ include/system/hw_accel.h | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/include/system/accel-ops.h b/include/system/accel-ops.h index f19245d0a0e..6eed1a3cfc8 100644 --- a/include/system/accel-ops.h +++ b/include/system/accel-ops.h @@ -41,6 +41,14 @@ struct AccelOpsClass { =20 void (*synchronize_post_reset)(CPUState *cpu); void (*synchronize_post_init)(CPUState *cpu); + /** + * synchronize_state: + * synchronize_pre_loadvm: + * @cpu: The vCPU to synchronize. + * + * Request to synchronize QEMU vCPU registers from the hardware accele= rator + * (the hardware accelerator is the reference). + */ void (*synchronize_state)(CPUState *cpu); void (*synchronize_pre_loadvm)(CPUState *cpu); void (*synchronize_pre_resume)(bool step_pending); diff --git a/include/system/hw_accel.h b/include/system/hw_accel.h index 380e9e640b6..574c9738408 100644 --- a/include/system/hw_accel.h +++ b/include/system/hw_accel.h @@ -17,9 +17,18 @@ #include "system/whpx.h" #include "system/nvmm.h" =20 +/** + * cpu_synchronize_state: + * cpu_synchronize_pre_loadvm: + * @cpu: The vCPU to synchronize. + * + * Request to synchronize QEMU vCPU registers from the hardware accelerator + * (the hardware accelerator is the reference). + */ void cpu_synchronize_state(CPUState *cpu); -void cpu_synchronize_post_reset(CPUState *cpu); -void cpu_synchronize_post_init(CPUState *cpu); void cpu_synchronize_pre_loadvm(CPUState *cpu); =20 +void cpu_synchronize_post_reset(CPUState *cpu); +void cpu_synchronize_post_init(CPUState *cpu); + #endif /* QEMU_HW_ACCEL_H */ --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564439; cv=none; d=zohomail.com; s=zohoarc; b=FjP+yEGbZ5SIyQvjT/hUgqDna5y+d6xmQv5sABhJ6QcG6q+IByS8LncroToktzw7M0vCdbgJtVi2nzNZBzp2CcA1KfMun7+L97oRqSLEVMC/Y5QE+OiD5Tdj+jsTUXSK0NpaR1Jia3WF0IgG/0CsSf9+GuRr/ZiOzQZgdznz4Ig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564439; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mFByqr7Cms5SGVD7NbyCQaZxrotjotWJ2e6Ypva9zn4=; b=kMaDrKp/Do0FpqqKTleUD3W9wiOXSuGD2qhBHnfuLhsU8PoJQclqJpJYY5+5PYCf3lA5GZk8N6zbrlZBI4/Ru2l3mSyj/P84Xk9v6nrCB2+LO5f581XHkwS4/FrAIRUeBvXob6i1ilwPTX/+hzKwqj9pmgPu949rTVAeO6OhjR0= 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 1751564439118819.8952814327525; Thu, 3 Jul 2025 10:40:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNq7-0008Jw-Sn; Thu, 03 Jul 2025 13:35:16 -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 1uXNpq-0007lp-94 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:00 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNpn-00011o-2Q for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:34:56 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-453749aef9eso476715e9.3 for ; Thu, 03 Jul 2025 10:34:54 -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-3b47285c90esm312556f8f.91.2025.07.03.10.34.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564093; x=1752168893; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mFByqr7Cms5SGVD7NbyCQaZxrotjotWJ2e6Ypva9zn4=; b=GxoMwtS37dcXwOHB2aMWje67KHLNPvSi/Xk6jbZwsZytiYG0TE+59KkfiZLDtUQjOF /k8idkqRq4CIUJcGugI49sVgwoSzSXdK5z8MhT1FR+B1ZvYPpbJPumB3BUO4GqT1Ig5q OquorkUitJQ0h9R4+IjIMyWpAjzoR1rhTyKbQz5L6hDgREsoYTzuwkvk57SsP5ANBmD0 9n0/AccFEY4znKEeIouvyu8kXELtwn5nxUL0UbksFcNntrOqVsy7+IEb9/dK4xqdP5wt s6t+gkLODnGnlxWAta15DOa4ssjwerbWPa0KFICPEnk0ymzqRvgxuuJHdUHdItEfwlwI GPKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564093; x=1752168893; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mFByqr7Cms5SGVD7NbyCQaZxrotjotWJ2e6Ypva9zn4=; b=P2HIQQTXP/KOdrIY7ZC5ZDcND8j5G+Gnuf6DdYM33Yl8CGcw7NOEwwPcwWjKZw6Dmk dyEnszDw15j2zruF2euOPWP6MfrCbRr2oxNgyHhFCGpethy/L11Hud6iyAf7gUa6qNhw w8Ouqrbr/qdUC7sFxmTGIRGDZtk/Y+maJfihOcOI7jcgUIKeRYjQ7lGQmNSUW9p5lxKo mFwDE1Nt/qnppUyeUHcx7NAcWwEsWx8E9gUeWmOUB2mr+mKWN287yxeb5DBajKSAGWh6 iiBU8YDAaXABYl3OfiNkdg2WHaXK6k67d0+YrjhpWOICaAsiGCff0CSfMDWJOqXCL7VM 5roA== X-Gm-Message-State: AOJu0YyWX3z3EuHlTQqHxz5q89xPSzioYuoGZZw5Vij34daku0XOPjlt Dm+hTB7n84N9/uCwflLVaJIOJMyKX/QabAv2kxRmsDrNFPtQlXna+MHdEwmLJLOT/G7MMKWHCFF hDkuIcbE= X-Gm-Gg: ASbGncuiFWxymR4PKY15lcDyraX9Q++QwRqL9TqYK/g6T5AgifFkr33E/0+2aHbC2zm ibG1DPAo1jJr9ppFAHkTxYDfF3Zy4Ve9yE3/fIPeiTKL/1hyhC+tZ2Lkvi3+OB5B9eukW4IvnXf be7wnhOwIAlM3qVmwr0yTJqN/RunNxkIhdNen9je1wWirZ+2m16ZtHCUEyIfzTj8RC1JstCZuc8 OvME7V/Rsc3MSSlsh5ivm9y1wQVmDnWDuy643P7mAyeItQdMzdTrbjj+1LH8JZCMFKzCE2EG5FK c3g2bQ1RRHI10AHIoB+KdBLn2bA9rbDO6AOef46nH+alNOBtk4Ta7z+yFHn2ku2V3rbGrT57MO1 j0cZGd93fQf9HyAWfq/mc1GfxH5JxG6ZXZx6B X-Google-Smtp-Source: AGHT+IFurU062a8TA8FJ1pVkJ3/eV1yksSD4KC7strqfPjpmGqQ3cGZlHxYC8CL2Am1OvnemN6BB+g== X-Received: by 2002:a05:600c:1992:b0:450:d367:c385 with SMTP id 5b1f17b1804b1-454a9cc2141mr57126395e9.16.1751564092976; Thu, 03 Jul 2025 10:34:52 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 23/39] accel/system: Document cpu_synchronize_state_post_init/reset() Date: Thu, 3 Jul 2025 19:32:29 +0200 Message-ID: <20250703173248.44995-24-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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: 1751564440618116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- include/system/accel-ops.h | 8 ++++++++ include/system/hw_accel.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/include/system/accel-ops.h b/include/system/accel-ops.h index 6eed1a3cfc8..2075691331c 100644 --- a/include/system/accel-ops.h +++ b/include/system/accel-ops.h @@ -39,6 +39,14 @@ struct AccelOpsClass { void (*kick_vcpu_thread)(CPUState *cpu); bool (*cpu_thread_is_idle)(CPUState *cpu); =20 + /** + * synchronize_post_reset: + * synchronize_post_init: + * @cpu: The vCPU to synchronize. + * + * Request to synchronize QEMU vCPU registers to the hardware accelera= tor + * (QEMU is the reference). + */ void (*synchronize_post_reset)(CPUState *cpu); void (*synchronize_post_init)(CPUState *cpu); /** diff --git a/include/system/hw_accel.h b/include/system/hw_accel.h index 574c9738408..fa9228d5d2d 100644 --- a/include/system/hw_accel.h +++ b/include/system/hw_accel.h @@ -28,6 +28,14 @@ void cpu_synchronize_state(CPUState *cpu); void cpu_synchronize_pre_loadvm(CPUState *cpu); =20 +/** + * cpu_synchronize_post_reset: + * cpu_synchronize_post_init: + * @cpu: The vCPU to synchronize. + * + * Request to synchronize QEMU vCPU registers to the hardware accelerator + * (QEMU is the reference). + */ void cpu_synchronize_post_reset(CPUState *cpu); void cpu_synchronize_post_init(CPUState *cpu); =20 --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564619; cv=none; d=zohomail.com; s=zohoarc; b=fvFPpLANFPgHN3iaJj6VzGfrYSeeur8nzjs/gJBKY8Rl/IjG8yp9b/hy0NiCNh4J+/pwtNm/G6rAjBDzDkDYj4XlucCU2d0oSlXzfrScnWS0LoJtlU/IrJKzZffNbBsq60KieEGb/0qzmUDM0ATvT1QatT1qrIJdOE22c55fbhY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564619; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eOWWkYUng0bWFtZYS1mlC3Juddgqx712KerwYfB2I6g=; b=mO5YfsHPrz7BO6hF4v8UDIIPfAgWfkEr76VPI4m34FvBlYz/omrNSFd80qpfbN/mgEqXOR/MhYXdvmecwvnS68h1TP3q29DNFHuS7kCvQ/EHIhjW98cAJeAbJK7ZpEOxAu4sRRGk1H3nawyPxOSEpeqXHlv0PGGSFNNpS3BsX5s= 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 1751564619372397.7102313687834; Thu, 3 Jul 2025 10:43:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNqU-0000Ls-Os; Thu, 03 Jul 2025 13:35:39 -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 1uXNpv-0007oy-Db for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:05 -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 1uXNpt-0001Bf-3F for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:02 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-451d41e1ad1so874895e9.1 for ; Thu, 03 Jul 2025 10:35:00 -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-454a9bcebf7sm33304695e9.21.2025.07.03.10.34.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564099; x=1752168899; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eOWWkYUng0bWFtZYS1mlC3Juddgqx712KerwYfB2I6g=; b=n6hiHk1sVWCWXE1C2BXKkkRGWN9AkhvqQKwzvKH3J5hdbr8GAcvKLU1H/KZ/pkuPIX 2+Rw3X8mvby3rp200jecQr/4VDNvs+bPx/uVYF46sZJIhk0l/lrlOSgDAXMsWFY+uQpT HWKR2Z2r5Z3S8+DnunfbrANoZMQ4V+ZlNCogJwKRlPyLaK9lgR4/rTAO7nQ8/xfG7C0z CJQ3AsPPoOgxSr5ooIx92kefadEYv4v01wBX7SAgCszulq/SaMh9jm79hcZykSn0p93x tyeF6Oh9TMUbZtaChsd6xG4Uq4LdpaL+KWL1te5+RU2p4OUOdv3Vs9N2SXjGco3BduA0 UUpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564099; x=1752168899; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eOWWkYUng0bWFtZYS1mlC3Juddgqx712KerwYfB2I6g=; b=cHJD6XM809/aqJ/1w1EWb9YbhzN9XsLEszPHoFsLXFJwMfg1s5rmEFahSyYvp7RUik Z8DKTt924OcF3/zdCpGtmnq7N2JCUKsodW0pARy2Z2vOgPZmrcsQTG1zwuNUmC941nTw D1MzYQVWpgmGDYkta5vAzHuNg9z+Jnxq/lhDehJ6LGN2NJ/RHhgSWjDghTwI9FNhKqJd wHlQ1uhRpMavyHCl2kle0fr36uQCKxEIgAm6XPpt+r9U5VqI0ZTZQXv/zugSLXJWG8SJ LWDYN2E3lMhvzZVWjPf95jFt28QEN+/++pyjWLchXdNe54QWrpT6ELAGGhk54p712i9n Ieeg== X-Gm-Message-State: AOJu0YxGMpTm/SCRYZ+G8QzfRky8YsuTsCF3AYOppcqDjTcwXIlJXL4y 7hCLuzKymXfgCd17ONysO9ZGKXN02xTFm9B20Rp/herAnnW0SwnrUTTjMQC2NEwhrxqeC/NleJX zd14u3v0= X-Gm-Gg: ASbGncuAhVQa40w9CVxIpxNEcgypfjKs9FxSuX1OXHr2TVWLbbpeZI+B1rF+HO/NQ0e 86a0QZmQrcjkYSMAIYjOQWk8WkJ9Aq1Bqwv43v7KNJwFOSPhAR5xVPZQVs+c8r98qeTeOXW0x9j rr3X2fKbLG8Z1jJap4IIU+oB1vKwqeHwiBZ2GBD2F2JDLELMZrD2f0mz6pYpOp0NfZ0wTI32p4Y Rpx6fvesXLFm0pYvZkXVyezgH6QEGHef/8f35q0e/ta8psdpOGiyfwCHhXZ2/NTjqeVQf31KW++ XARq8CKsXi/9wgPh8O5if1r9sdYfCN11n3guYpFHmNenHgjvmgvIegKqXdAsV2F0zTD1v4r47tS R0njL73/9Y2Wnkai/P62PfW6GwAt2Q+tyCraf X-Google-Smtp-Source: AGHT+IEdZXugt44EZMe2Wr+pf29DApGEG1QcxUknPVsPatrBQozI0pUwQi3bhxbIkzCZ0KnzxLmUEQ== X-Received: by 2002:a05:600c:4449:b0:43d:fa58:81d3 with SMTP id 5b1f17b1804b1-454ab3bc45bmr35301495e9.32.1751564098316; Thu, 03 Jul 2025 10:34:58 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Reinoud Zandijk Subject: [PATCH v6 24/39] accel/nvmm: Expose nvmm_enabled() to common code Date: Thu, 3 Jul 2025 19:32:30 +0200 Message-ID: <20250703173248.44995-25-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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: 1751564620857116600 Currently nvmm_enabled() is restricted to target-specific code. By defining CONFIG_NVMM_IS_POSSIBLE we allow its use anywhere. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- include/system/nvmm.h | 23 ++++++++++++----------- accel/stubs/nvmm-stub.c | 12 ++++++++++++ target/i386/nvmm/nvmm-all.c | 8 +------- accel/stubs/meson.build | 1 + 4 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 accel/stubs/nvmm-stub.c diff --git a/include/system/nvmm.h b/include/system/nvmm.h index 6971ddb3a5a..7390def9adb 100644 --- a/include/system/nvmm.h +++ b/include/system/nvmm.h @@ -13,17 +13,18 @@ #define QEMU_NVMM_H =20 #ifdef COMPILING_PER_TARGET - -#ifdef CONFIG_NVMM - -int nvmm_enabled(void); - -#else /* CONFIG_NVMM */ - -#define nvmm_enabled() (0) - -#endif /* CONFIG_NVMM */ - +# ifdef CONFIG_NVMM +# define CONFIG_NVMM_IS_POSSIBLE +# endif /* !CONFIG_NVMM */ +#else +# define CONFIG_NVMM_IS_POSSIBLE #endif /* COMPILING_PER_TARGET */ =20 +#ifdef CONFIG_NVMM_IS_POSSIBLE +extern bool nvmm_allowed; +#define nvmm_enabled() (nvmm_allowed) +#else /* !CONFIG_NVMM_IS_POSSIBLE */ +#define nvmm_enabled() 0 +#endif /* !CONFIG_NVMM_IS_POSSIBLE */ + #endif /* QEMU_NVMM_H */ diff --git a/accel/stubs/nvmm-stub.c b/accel/stubs/nvmm-stub.c new file mode 100644 index 00000000000..cc58114ceb3 --- /dev/null +++ b/accel/stubs/nvmm-stub.c @@ -0,0 +1,12 @@ +/* + * NVMM stubs for QEMU + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "system/hvf.h" + +bool nvmm_allowed; diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c index aea61a6fd2a..2df49d7eeb4 100644 --- a/target/i386/nvmm/nvmm-all.c +++ b/target/i386/nvmm/nvmm-all.c @@ -46,7 +46,7 @@ struct qemu_machine { =20 /* -----------------------------------------------------------------------= --- */ =20 -static bool nvmm_allowed; +bool nvmm_allowed; static struct qemu_machine qemu_mach; =20 static struct nvmm_machine * @@ -1192,12 +1192,6 @@ nvmm_accel_init(MachineState *ms) return 0; } =20 -int -nvmm_enabled(void) -{ - return nvmm_allowed; -} - static void nvmm_accel_class_init(ObjectClass *oc, const void *data) { diff --git a/accel/stubs/meson.build b/accel/stubs/meson.build index 8ca1a4529e2..4c34287215f 100644 --- a/accel/stubs/meson.build +++ b/accel/stubs/meson.build @@ -3,5 +3,6 @@ system_stubs_ss.add(when: 'CONFIG_XEN', if_false: files('xe= n-stub.c')) system_stubs_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) system_stubs_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) system_stubs_ss.add(when: 'CONFIG_HVF', if_false: files('hvf-stub.c')) +system_stubs_ss.add(when: 'CONFIG_NVMM', if_false: files('nvmm-stub.c')) =20 specific_ss.add_all(when: ['CONFIG_SYSTEM_ONLY'], if_true: system_stubs_ss) --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564686; cv=none; d=zohomail.com; s=zohoarc; b=TJZ5lBe/yNrRZtM7E1e1hMTSi77f9OcWX2BEjTGH2SfM3kS2MuqfQm7YZd+LnNlrFUFp8/cmutFW9ybQds2eGpKf7KH8mkZc/YYhRszwtXvM88ASEU3lCjtBmloeciR6R39SPD1UKggIsNMAPglrdCdeo2mECgIjUN27qDrhuYI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564686; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+7NLj1HZVYxEPzWZInSZPj2XYJ8nPbkqoQqpybhaaZc=; b=C1QmG4Rl8MbVhj9uR0V5FkuAFPYLQiHQxneqv/xJcYZcrwTUjNth/IbW3o2SZ+Q+IUUhgV2t1aA423gZzgFniyS1dbBcfOQOSEamSsiLHjDbpnpJxWrsMlJVldESKekqKRiSZVqcJkXf13/Hsc1ePqu1LxKeBWXT48RFuaD6w9w= 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 1751564686466532.8009216713716; Thu, 3 Jul 2025 10:44:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNqZ-0000RY-Uo; Thu, 03 Jul 2025 13:35: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 1uXNpz-0007pw-3b for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:08 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNpx-0001Rv-7v for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:06 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3a582e09144so39786f8f.1 for ; Thu, 03 Jul 2025 10:35:04 -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-3b47285c919sm310292f8f.92.2025.07.03.10.35.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564103; x=1752168903; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+7NLj1HZVYxEPzWZInSZPj2XYJ8nPbkqoQqpybhaaZc=; b=tZU6qVf+Y/ekWaMq+yV4As8r/UTsVo1QKZvT6ObJHfgDCtGaZz975q1zZxK31fwp2w r2yHkoUycZ7PlaO0V4oPN/pr4ECpPDnA5ozUTpNpPz+o6sEjDm69hODorrJsAkUCvEWW iAF+Z+nThgnXtb+B5/aJ/sPDIlvI3N7qKYhIQTAGP8otBeYwns1M3fLsGwYQAxVS9Qjn qvg403aibJXny7sPf3tgn4hZ1ZoFm9oDVdoat2fzI1MEASpNGZmXaaxnkcblBhO9KP6T MdI8TWrpF71NGJRnKt1KXMCPTUFBIio7tPotJL4/AFFT5NnWAV+zcrsgi7Dk5j4PlQ8H UYbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564103; x=1752168903; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+7NLj1HZVYxEPzWZInSZPj2XYJ8nPbkqoQqpybhaaZc=; b=i0G8agA2l2VgnRJ3MddtNU9FwlFlHV/+L0bI/jtPEOI3a6grJyh4WOJlnpdEzvrstI J16SVOo6+fT8BFuPg0dyM9dqUc+ZzKDC28gPq+rrGQ5lHKpWjBGipOyCtt+leP2Eb0OX rOYcqmXNoVsddzt5iV357kcTH105GTLFnGicrNq/b/GEfpKJRJRcqCmYOz2ueNyGgjJJ mFz1OkL0VO8ZZ5ahivhJeiDPB/CmoLxVtJoL2ciF+HXavduDrBx2XJwziYQwQUo2BviO 5u6YdP/DYmsv+mOvIYvJ3RBLulk8P/RitZFlb2jsz3374Uih5zL89dldmZwS0PjUtCov YaGQ== X-Gm-Message-State: AOJu0YytL3nH26qseZbtBDNOgYWA7bGeG45j4dCHF8RzP+nUS4pg9R1U nGzcJAkGU5ky0nAdYNMYzgoD8BrvTkhjGMfUjVsU94Uz1YaEUyX/5L7TPImHOOewVcInOQzQf0/ GnoHD9gs= X-Gm-Gg: ASbGncu3+WmBfm3tG2suFqy44+FA5PzMCK9JyBcHTrVG8QuzdrTZwWxWHCDUe2ily0M rQWUoUNLmNJtpEO0WIWO6hag8S8/Hc1wRbURMwTXlLjCoywt7K9CodFS/30H3jYRCQaAZVKPOPP n5EBSl8N/tz/j/Qz94/BVYk8q880/cxPoyTYBJLZJTYQiYu22I9CGrOkn2bq4Ve6pBKOO89g8Un 0VxlfbwVW/IcWq3761/3FS5vHQOhBmnJ3toEacGlXNfBxr7j9VEyW0JKU3aSOm9oJVZRMsExyRZ 6s2X0ktn/rK3U7gihjP7vzto8UQAHrBcplJZgTDUM5IfpiEXN+yH9MUovrrsXBtXhX93i1dnnjT ZBFxWkjlflBennLyilNrBfm9iGhAUTv9yUT/HQ2a2jDXWAaw= X-Google-Smtp-Source: AGHT+IEyOBQOTlTAlVMkY2/tTLbCpBL5uIRAyviGBtyzz7xTPc6AnaeaAzCRsfUkdFYvOLHbNZtLqw== X-Received: by 2002:a05:6000:2c11:b0:3a6:d255:7eda with SMTP id ffacd0b85a97d-3b20095cf70mr6400736f8f.28.1751564103178; Thu, 03 Jul 2025 10:35:03 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sunil Muthuswamy Subject: [PATCH v6 25/39] accel/whpx: Expose whpx_enabled() to common code Date: Thu, 3 Jul 2025 19:32:31 +0200 Message-ID: <20250703173248.44995-26-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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: 1751564687638116601 Currently whpx_enabled() is restricted to target-specific code. By defining CONFIG_WHPX_IS_POSSIBLE we allow its use anywhere. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- include/system/whpx.h | 27 ++++++++++++++------------- accel/stubs/whpx-stub.c | 12 ++++++++++++ target/i386/whpx/whpx-all.c | 7 +------ accel/stubs/meson.build | 1 + 4 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 accel/stubs/whpx-stub.c diff --git a/include/system/whpx.h b/include/system/whpx.h index 00ff409b682..00f6a3e5236 100644 --- a/include/system/whpx.h +++ b/include/system/whpx.h @@ -16,19 +16,20 @@ #define QEMU_WHPX_H =20 #ifdef COMPILING_PER_TARGET - -#ifdef CONFIG_WHPX - -int whpx_enabled(void); -bool whpx_apic_in_platform(void); - -#else /* CONFIG_WHPX */ - -#define whpx_enabled() (0) -#define whpx_apic_in_platform() (0) - -#endif /* CONFIG_WHPX */ - +# ifdef CONFIG_WHPX +# define CONFIG_WHPX_IS_POSSIBLE +# endif /* !CONFIG_WHPX */ +#else +# define CONFIG_WHPX_IS_POSSIBLE #endif /* COMPILING_PER_TARGET */ =20 +#ifdef CONFIG_WHPX_IS_POSSIBLE +extern bool whpx_allowed; +#define whpx_enabled() (whpx_allowed) +bool whpx_apic_in_platform(void); +#else /* !CONFIG_WHPX_IS_POSSIBLE */ +#define whpx_enabled() 0 +#define whpx_apic_in_platform() (0) +#endif /* !CONFIG_WHPX_IS_POSSIBLE */ + #endif /* QEMU_WHPX_H */ diff --git a/accel/stubs/whpx-stub.c b/accel/stubs/whpx-stub.c new file mode 100644 index 00000000000..c564c89fd0b --- /dev/null +++ b/accel/stubs/whpx-stub.c @@ -0,0 +1,12 @@ +/* + * WHPX stubs for QEMU + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "system/whpx.h" + +bool whpx_allowed; diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 5001afad3a7..94fd5fc7849 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -242,7 +242,7 @@ struct AccelCPUState { WHV_RUN_VP_EXIT_CONTEXT exit_ctx; }; =20 -static bool whpx_allowed; +bool whpx_allowed; static bool whp_dispatch_initialized; static HMODULE hWinHvPlatform, hWinHvEmulation; static uint32_t max_vcpu_index; @@ -2688,11 +2688,6 @@ error: return ret; } =20 -int whpx_enabled(void) -{ - return whpx_allowed; -} - bool whpx_apic_in_platform(void) { return whpx_global.apic_in_platform; } diff --git a/accel/stubs/meson.build b/accel/stubs/meson.build index 4c34287215f..9dfc4f9ddaf 100644 --- a/accel/stubs/meson.build +++ b/accel/stubs/meson.build @@ -4,5 +4,6 @@ system_stubs_ss.add(when: 'CONFIG_KVM', if_false: files('kv= m-stub.c')) system_stubs_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) system_stubs_ss.add(when: 'CONFIG_HVF', if_false: files('hvf-stub.c')) system_stubs_ss.add(when: 'CONFIG_NVMM', if_false: files('nvmm-stub.c')) +system_stubs_ss.add(when: 'CONFIG_WHPX', if_false: files('whpx-stub.c')) =20 specific_ss.add_all(when: ['CONFIG_SYSTEM_ONLY'], if_true: system_stubs_ss) --=20 2.49.0 From nobody Sat Dec 13 22:55:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1751564128; cv=none; d=zohomail.com; s=zohoarc; b=HnLeIipJhY8xSTRmHGOhUaLb9A2lTosDDsZ3JZv6TdlP2N5VkcWr3J2R1yXBxXRhU99fDpLl8yWvho+CypiFphwhCRCzRyC1SZFFT9FY3gaY1KGBE52uzDn4s3XcIP+tt3TAZMzsl+imeriy+XJ/SD8FqUNVHvMh98aOK39T/rk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564128; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Q2RhrPiz7//vskyUlSGbSsu4uaU4qA0h0V9+uZJcvBs=; b=bxq6e+ZN0ar6lSrX2hl6vVfdHrS5v2yVNiHHINGcTexeHnqsAu3VdTp/kVc+0jqqZsPe7fFFtrI7Gc092ooCWz6c+escg0lELxlC1wyyWL78iNluYRspnR/hjq7yxjFPo+Q8wseCgP7o/K1YeZ24BLCOSjcFMQJDmIx0WGnIjcE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751564128891625.0505985856099; Thu, 3 Jul 2025 10:35:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1032338.1405997 (Exim 4.92) (envelope-from ) id 1uXNq5-0001Vh-V1; Thu, 03 Jul 2025 17:35:13 +0000 Received: by outflank-mailman (output) from mailman id 1032338.1405997; Thu, 03 Jul 2025 17:35:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uXNq5-0001Va-RG; Thu, 03 Jul 2025 17:35:13 +0000 Received: by outflank-mailman (input) for mailman id 1032338; Thu, 03 Jul 2025 17:35:12 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uXNq4-0001VU-5K for xen-devel@lists.xenproject.org; Thu, 03 Jul 2025 17:35:12 +0000 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [2a00:1450:4864:20::32c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 112efdc0-5834-11f0-b894-0df219b8e170; Thu, 03 Jul 2025 19:35:10 +0200 (CEST) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4537fdec39fso408485e9.0 for ; Thu, 03 Jul 2025 10:35:10 -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-454b1687196sm3427985e9.21.2025.07.03.10.35.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:35:08 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 112efdc0-5834-11f0-b894-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564109; x=1752168909; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q2RhrPiz7//vskyUlSGbSsu4uaU4qA0h0V9+uZJcvBs=; b=h3RSv9hQS4ApRwNdN3UDdddtZ0HVVRfcoufZhtPPGMBaYpLTLA0WSVclhoe5lb1wcM 88Zjemyio/YuVnEkEagp3McbH7kPx2rGYpjfAbw11UAs1wHJKhypySMmsTNBVm2ASVO+ 8uG+wbeM1QNY6tfmb+nLVvQHqZu+l/osB1T4pJkDvZ/liwvjxHkwdHSD8Li8ZXEpzjbl ntOTEm6FEHtzuV9Wl/TsijL8YKqFE8iNMc3Rzl9svnQY3H2uCRRdYsciTDpcq54YLm2t dA1AMBBDOJywsegDXpw0TDScoyuGO0XF8WgFQa7CPZX3MAn7CAq/7StNrwyp/l1cKbXR B91A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564109; x=1752168909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q2RhrPiz7//vskyUlSGbSsu4uaU4qA0h0V9+uZJcvBs=; b=UXLXZwI/lnDToAkW9DEJEaqOeseHrZJiMTOVmGuDTee1Y6rzrrHJMaV1mib67RaeS5 JU80+H6hIugv1xGJ3Z4yDvTAW3j39bv0sca5fUO7J2DhDS5VcIT51V0R59GL1xMdhwZ7 t88AGDDngbh5ZcFgQbZCLz1hKU0andG2PgMa0Yft0iwsCeog5qNVvNpFYO6aJ91QyvQF ulTayK4PJCOmQzcJ9buXfAFayNRmQbCBxGC8wcE1phFO5bQpUAVAO0vVDwDkhMw/Qhib uFWGq2NEJcb4+mxV/NRZTWe+AONulcR2tZBAmtGcVM98o4Qqsnjgb5DTYqXpNrZjP38K /SLw== X-Forwarded-Encrypted: i=1; AJvYcCVISTo3K81CqW/QSUosjHiyWGPItQM1RA9Cbx0nrBAz+E3cd5LSQpoBTnYkIZUVpoiN4zPsG0l36i4=@lists.xenproject.org X-Gm-Message-State: AOJu0YzLk/H9toJJ8TKH6mu512gut63ielk0SxWdFwJfmpML40JuN4Pg VvPxzJE5Aj7m7RlUY036LflXlOOA1kh6GGHsj02Xvm7mp6ga3fe415HXsZLUBiBd8d4= X-Gm-Gg: ASbGncvdeLBmm7zLWt327zvnTbuH2B4hMA1waYhg39PkICxlCvSTzCKCrEyHsXbTnbn WcD/Udlm/ykbcy6j/DlVfme5p3bSyh3iPC2ZvdqgOK00t9QefX7sYhwRHiFnjwhXTyvJs6ejuRQ twdCzY/vc5LwRuVuQrmY5UOsmqlskNVUkJCVgNVc58smHD9AKLlaaXMpPdZzA79nyiayjFeQDDW 7bgjgHq5XHMjK3rrSJ00YKarWQaN0mD86oT118r4LbEytGaevPe0tOr6gcPivdW5V/Ko2ieEwGI eTa2nGCqimy7lwkXlstyOVykObVFCT5rxyoW9Ek6f2vNwcuSRff4QM/BlTOOMPWYW/AkjqvhOhp sMtli23iEY581vlFqbn7/j/0jmvxhD2SVDFq7 X-Google-Smtp-Source: AGHT+IF/UA/DtD6lXjiLszACK+Pk1isaks747knolJ87gw1k/av0EcLUiE+/w969+nBtehLwL7opBQ== X-Received: by 2002:a05:600c:3593:b0:441:b3eb:570a with SMTP id 5b1f17b1804b1-454a9c620e9mr53209265e9.2.1751564109257; Thu, 03 Jul 2025 10:35:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fabiano Rosas , Laurent Vivier , Stefano Stabellini , Anthony PERARD , Paul Durrant , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org Subject: [PATCH v6 26/39] accel/dummy: Extract 'dummy-cpus.h' header from 'system/cpus.h' Date: Thu, 3 Jul 2025 19:32:32 +0200 Message-ID: <20250703173248.44995-27-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1751564131091116600 'dummy' helpers are specific to accelerator implementations, no need to expose them via "system/cpus.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu --- MAINTAINERS | 1 + accel/dummy-cpus.h | 14 ++++++++++++++ include/system/cpus.h | 5 ----- accel/dummy-cpus.c | 1 + accel/qtest/qtest.c | 1 + accel/xen/xen-all.c | 1 + 6 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 accel/dummy-cpus.h diff --git a/MAINTAINERS b/MAINTAINERS index b1cbfe115bc..37d02b2313c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -503,6 +503,7 @@ F: include/system/accel-*.h F: include/system/cpus.h F: include/accel/accel-cpu*.h F: accel/accel-*.? +F: accel/dummy-cpus.? F: accel/Makefile.objs F: accel/stubs/Makefile.objs F: cpu-common.c diff --git a/accel/dummy-cpus.h b/accel/dummy-cpus.h new file mode 100644 index 00000000000..d18dd0fdc51 --- /dev/null +++ b/accel/dummy-cpus.h @@ -0,0 +1,14 @@ +/* + * Dummy cpu thread code + * + * Copyright IBM, Corp. 2011 + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef ACCEL_DUMMY_CPUS_H +#define ACCEL_DUMMY_CPUS_H + +void dummy_start_vcpu_thread(CPUState *cpu); + +#endif diff --git a/include/system/cpus.h b/include/system/cpus.h index 3226c765d01..69be6a77a75 100644 --- a/include/system/cpus.h +++ b/include/system/cpus.h @@ -7,11 +7,6 @@ void cpus_register_accel(const AccelOpsClass *i); /* return registers ops */ const AccelOpsClass *cpus_get_accel(void); =20 -/* accel/dummy-cpus.c */ - -/* Create a dummy vcpu for AccelOpsClass->create_vcpu_thread */ -void dummy_start_vcpu_thread(CPUState *); - /* interface available for cpus accelerator threads */ =20 /* For temporary buffers for forming a name */ diff --git a/accel/dummy-cpus.c b/accel/dummy-cpus.c index 867276144fa..03cfc0fa01e 100644 --- a/accel/dummy-cpus.c +++ b/accel/dummy-cpus.c @@ -17,6 +17,7 @@ #include "qemu/guest-random.h" #include "qemu/main-loop.h" #include "hw/core/cpu.h" +#include "accel/dummy-cpus.h" =20 static void *dummy_cpu_thread_fn(void *arg) { diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index 92bed9264ce..612cede160b 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -24,6 +24,7 @@ #include "qemu/guest-random.h" #include "qemu/main-loop.h" #include "hw/core/cpu.h" +#include "accel/dummy-cpus.h" =20 static int64_t qtest_clock_counter; =20 diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index de52a8f882a..c150dd43cab 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -18,6 +18,7 @@ #include "hw/xen/xen_igd.h" #include "chardev/char.h" #include "qemu/accel.h" +#include "accel/dummy-cpus.h" #include "system/accel-ops.h" #include "system/cpus.h" #include "system/xen.h" --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564508; cv=none; d=zohomail.com; s=zohoarc; b=F9D/tQC/konWZbSt8nZ9gkr24CciexU+I+wo4SKaDBdNcFUGs+fPXmLW0tILstNe2a7JZzR5kOf1XKszQQoG1TyyNrsKg+v6fQ4LkD3ISZQffrZ+91oRecqDMzhDqLkxGfNS31MXO/W0vAL4jjXitEFhbD19269IGlDVjkfEhGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564508; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gKkY66WSncDjfDBkQ2PUmi6A59h3Sya1fBXJtO0Vmlo=; b=N8BCoiS//TjTKMFWdCdINqA+3Z1toV7/FZ0h+aFn8jOa7KW/cEb2BghRnoMVdsyhz8P/cui6VL84N4Mk84Bo2O6b6cscbP868JNnq//F2kVmcZOSwaY2ScULRoE990fpi0l1YIlficaC+NVT8psPEGVJzF7LGrMG093GnlpelSc= 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 1751564508394758.618827959951; Thu, 3 Jul 2025 10:41:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNql-0000pX-Iw; Thu, 03 Jul 2025 13:35:56 -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 1uXNqJ-0000Lr-4U for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:31 -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 1uXNq8-0001fD-Qf for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:26 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-450ce671a08so609285e9.3 for ; Thu, 03 Jul 2025 10:35:16 -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-3b4708d0941sm335801f8f.26.2025.07.03.10.35.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564114; x=1752168914; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gKkY66WSncDjfDBkQ2PUmi6A59h3Sya1fBXJtO0Vmlo=; b=tPdA24ulhZy6CJQaYWic7IFCZwkqghaerONcbKvJ0pPaMNScifPk5ak8TpS3QF0NTw RT+A/0H4WyWRgUCV3iM4IlGIKtvHRdTkt5bxeUKD6hBZOPAEm/GFpoRn9cmYSBM5kdYu 2YhMJ8gE76W0cu3FmwHyoAVjl742LyLYdIE5wEBG2Eq95WpJspmYuI9fJPkubXLR4VCs n6gedwWzOk5afLtJ8wqNyRxjjB4APrIvbiJg1/3WVhdW+CqsqTMIp67SlaW0keP5ubdw b+11n/ozrjB4EX06VusJbqAoFjcWxz4n3p2CA22Run0XZ123TdgGTj9yHHDLruTB/wXR EbJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564114; x=1752168914; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gKkY66WSncDjfDBkQ2PUmi6A59h3Sya1fBXJtO0Vmlo=; b=qrw1rc38Ct/108nWRteF42HOVkFnGd2zKA243HSoXlJqRFnkum94SYfIl6cGla34rD q4XiiJdaONfYgDN+8f0tLMC/mCscHdtbEVQZHS5DGjx8t91AEZCsz/vKgkzCYXwZTkXO d7f7mKykIjE0fMFNM33fB034hRMNo1joX0cKWQtMMBUL//DrWvqqK+5AiFNhkay5Ki0O VClYH07aTDTGPhNocM8+bGDDPHVnUx5oH8nsrRTzPz9bISV4R3xjmTY7aCCZ1oG0BZYi YhgWeD0RvR0qZWiEgUjUq210FF6xSzCBdadILuG0F3/+6VGlMdHvlB+LrDiE3nVe52F5 Qc5w== X-Gm-Message-State: AOJu0YyE2SHEYKmwyKGIA+ocV889h+y3OQgrTiiTrAYA+XLuVNfgb7nW eaKfndPFo68/Vd6vZj2YD1/i1GqEatWaVc3Wgz+AkvXAkeyLKCKPYLYaeTjroVaDNIgF7xm9z4t 4JV3SmJQ= X-Gm-Gg: ASbGncuK7EsQgxV0t/q3cY6R0v84vxg/sjnPDcvBVQBA2VQmMGm9si5GvvXkUgBn53s VkIWJlbCxv6HZyBtYxNkYyjP1mNSet0CuLSi+lDbnFgQ+7I3etxwFndzJC7vsvJxhXEMMJGqov2 QMJAw+TVMostj3NoogMrlbUsA9WYzLzWnJ495vIxkEajXpmODFPs53EDPz6DjWynJe36lcw37kZ o4n/CaKSzv0t6jcZtXdxayd+H2si6J9y7LdWDIqOwI13e2dRIPuJreEyf5+H/rjehd0PAgXPSuo E3UjQb9TMiXEQew40pmwvR66Bxzbu3pbbtTHEIdc7s96bftB2eLTnUy3hLLGLBIddQdTRXeOiI6 xfFAW8g+Z5jpIxwKOy5uKxaQ9HpXcayEbLpYC X-Google-Smtp-Source: AGHT+IE+oERmztqeh1GValBSAb7xMH8Gnkn6Ou+BXUEMTkBVWQVLxXxIW2RoSLeYtG+owzfK+o46Iw== X-Received: by 2002:a05:600c:c48f:b0:448:e8c0:c778 with SMTP id 5b1f17b1804b1-454a370cd65mr74636835e9.22.1751564114470; Thu, 03 Jul 2025 10:35:14 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 27/39] accel: Pass old/new interrupt mask to handle_interrupt() handler Date: Thu, 3 Jul 2025 19:32:33 +0200 Message-ID: <20250703173248.44995-28-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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, 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: 1751564509609116600 Update CPUState::interrupt_request once in cpu_interrupt(). Pass the old and new masks along. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- accel/tcg/tcg-accel-ops-icount.h | 2 +- accel/tcg/tcg-accel-ops.h | 2 +- include/system/accel-ops.h | 2 +- accel/tcg/tcg-accel-ops-icount.c | 8 +++----- accel/tcg/tcg-accel-ops.c | 4 +--- system/cpus.c | 12 +++++++----- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/accel/tcg/tcg-accel-ops-icount.h b/accel/tcg/tcg-accel-ops-ico= unt.h index 16a301b6dc0..1d9d66f0707 100644 --- a/accel/tcg/tcg-accel-ops-icount.h +++ b/accel/tcg/tcg-accel-ops-icount.h @@ -15,6 +15,6 @@ void icount_prepare_for_run(CPUState *cpu, int64_t cpu_bu= dget); int64_t icount_percpu_budget(int cpu_count); void icount_process_data(CPUState *cpu); =20 -void icount_handle_interrupt(CPUState *cpu, int mask); +void icount_handle_interrupt(CPUState *cpu, int old_mask, int new_mask); =20 #endif /* TCG_ACCEL_OPS_ICOUNT_H */ diff --git a/accel/tcg/tcg-accel-ops.h b/accel/tcg/tcg-accel-ops.h index 6feeb3f3e9b..6e7c2aae5a8 100644 --- a/accel/tcg/tcg-accel-ops.h +++ b/accel/tcg/tcg-accel-ops.h @@ -16,7 +16,7 @@ =20 void tcg_cpu_destroy(CPUState *cpu); int tcg_cpu_exec(CPUState *cpu); -void tcg_handle_interrupt(CPUState *cpu, int mask); +void tcg_handle_interrupt(CPUState *cpu, int old_mask, int new_mask); void tcg_cpu_init_cflags(CPUState *cpu, bool parallel); =20 #endif /* TCG_ACCEL_OPS_H */ diff --git a/include/system/accel-ops.h b/include/system/accel-ops.h index 2075691331c..d84eaa376c2 100644 --- a/include/system/accel-ops.h +++ b/include/system/accel-ops.h @@ -61,7 +61,7 @@ struct AccelOpsClass { void (*synchronize_pre_loadvm)(CPUState *cpu); void (*synchronize_pre_resume)(bool step_pending); =20 - void (*handle_interrupt)(CPUState *cpu, int mask); + void (*handle_interrupt)(CPUState *cpu, int old_mask, int new_mask); =20 /** * @get_virtual_clock: fetch virtual clock diff --git a/accel/tcg/tcg-accel-ops-icount.c b/accel/tcg/tcg-accel-ops-ico= unt.c index d0f7b410fab..500b5dd4942 100644 --- a/accel/tcg/tcg-accel-ops-icount.c +++ b/accel/tcg/tcg-accel-ops-icount.c @@ -147,14 +147,12 @@ void icount_process_data(CPUState *cpu) replay_mutex_unlock(); } =20 -void icount_handle_interrupt(CPUState *cpu, int mask) +void icount_handle_interrupt(CPUState *cpu, int old_mask, int new_mask) { - int old_mask =3D cpu->interrupt_request; - - tcg_handle_interrupt(cpu, mask); + tcg_handle_interrupt(cpu, old_mask, new_mask); if (qemu_cpu_is_self(cpu) && !cpu->neg.can_do_io - && (mask & ~old_mask) !=3D 0) { + && (new_mask & ~old_mask) !=3D 0) { cpu_abort(cpu, "Raised interrupt while not in I/O function"); } } diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index f579685a611..eb16a6bf6db 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -91,10 +91,8 @@ static void tcg_cpu_reset_hold(CPUState *cpu) } =20 /* mask must never be zero, except for A20 change call */ -void tcg_handle_interrupt(CPUState *cpu, int mask) +void tcg_handle_interrupt(CPUState *cpu, int old_mask, int new_mask) { - cpu->interrupt_request |=3D mask; - /* * If called from iothread context, wake the target cpu in * case its halted. diff --git a/system/cpus.c b/system/cpus.c index 4fb764ac880..13535a74e6f 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -246,10 +246,8 @@ int64_t cpus_get_elapsed_ticks(void) return cpu_get_ticks(); } =20 -static void generic_handle_interrupt(CPUState *cpu, int mask) +static void generic_handle_interrupt(CPUState *cpu, int old_mask, int new_= mask) { - cpu->interrupt_request |=3D mask; - if (!qemu_cpu_is_self(cpu)) { qemu_cpu_kick(cpu); } @@ -257,12 +255,16 @@ static void generic_handle_interrupt(CPUState *cpu, i= nt mask) =20 void cpu_interrupt(CPUState *cpu, int mask) { + int old_mask =3D cpu->interrupt_request; + g_assert(bql_locked()); =20 + cpu->interrupt_request |=3D mask; + if (cpus_accel->handle_interrupt) { - cpus_accel->handle_interrupt(cpu, mask); + cpus_accel->handle_interrupt(cpu, old_mask, cpu->interrupt_request= ); } else { - generic_handle_interrupt(cpu, mask); + generic_handle_interrupt(cpu, old_mask, cpu->interrupt_request); } } =20 --=20 2.49.0 From nobody Sat Dec 13 22:55:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1751564136; cv=none; d=zohomail.com; s=zohoarc; b=JOFIM/Ox6cio2HTCFdjRTHQpM2gJdnPXpECVmLKXHPKbFv844UkHYJjW0XfClJY4L7HUzGV6rTV6eRoufnj/ZMimtCMenO2vGkL0u9gTOWPYRbMe25gots3ksViK7A7kYBo5rmnmuYeEU2ZtBk+70hg4Sa+xtXMsvJhdu3uaYjk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564136; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=n8Y0CRVizP1zJqDvu7p6UAH96w8jBU8Dg5EX+XjEepo=; b=eusF0zG+vfuVBj77yHSAXHGlZLDajzYU+7j0z1adWTr1fSp8joadNnb4XYyu/1y19dVFBFKmT2A2RMf/+QAH89JJTq+rkMWKzMeoRKSlL69ZuF/isw2jfd2FTKUmg8A/2NMH0FPJY9VtiFV+SW4fbZLD96wZC+/fV+dFhV+IytY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751564136684552.0872146608782; Thu, 3 Jul 2025 10:35:36 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1032339.1406007 (Exim 4.92) (envelope-from ) id 1uXNqG-0001mx-87; Thu, 03 Jul 2025 17:35:24 +0000 Received: by outflank-mailman (output) from mailman id 1032339.1406007; Thu, 03 Jul 2025 17:35:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uXNqG-0001mq-55; Thu, 03 Jul 2025 17:35:24 +0000 Received: by outflank-mailman (input) for mailman id 1032339; Thu, 03 Jul 2025 17:35:23 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uXNqF-0001VU-Jt for xen-devel@lists.xenproject.org; Thu, 03 Jul 2025 17:35:23 +0000 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [2a00:1450:4864:20::330]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 18422179-5834-11f0-b894-0df219b8e170; Thu, 03 Jul 2025 19:35:21 +0200 (CEST) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-45310223677so861425e9.0 for ; Thu, 03 Jul 2025 10:35:21 -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-454b161e8fcsm3703765e9.7.2025.07.03.10.35.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:35:20 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 18422179-5834-11f0-b894-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564121; x=1752168921; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n8Y0CRVizP1zJqDvu7p6UAH96w8jBU8Dg5EX+XjEepo=; b=eZPhyoify/pomMDUqlarnMtJjCFqlwZETHRmc5JAxkZeLdmO4+eYCy8rMnnEjKS/aU 6FqjmmEhJAEYTKD+KGAh6X+yQ5O0vZCAS151VetRIh2vK9WZ4xyCYgCQ4rziVim2fA2v 0AjwNAjy1YMeu37p/U6gDHhECl1ScKqfX3pCOi4InK8kgBOHs2nAgSPFVt+lEQAX4RNf R3pgctpxt3AGIINgiOrku8pfQikohNK2e6iIKpEHXNVxkjwdHZJnAnfC2urlJiz6muAN KE0R17fUWlwYd82/pmOg3MTS0o8GK4NAEaN5wGGgMTwPM0IrIeqI9lBOvLtFI8UhAtKP xs4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564121; x=1752168921; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n8Y0CRVizP1zJqDvu7p6UAH96w8jBU8Dg5EX+XjEepo=; b=JmN1Tl6hE9ExvcudyeeOlajFm+iOtL3cZPKKW1ax12Ph8iXBVWaQZkxldysc/OKRTD Vftp1UxP/Z+muY4suFiLTi5UeOuSJsl+DNsxwJO1f5V2JL7rB9Q6tA7x/8ykqC/+GSKH jKCKnm8BauOmc1eROhAZW3ZF+5oTwjJHejis4DVKeki7FtW/wB7Ph8rzpQbf6/X909B4 5wl7HDETPVVp7bxKSXn0suGj5R98Tl2EdrjuR+clMAeGEvy5aDu0iSjiCZ2r353K1oeP g1hqKVYj3ftxR5B5BGs0op1ueVtxnuu+/4gqHNFfOIozq8+hHWdi4hw6xVXXQ9kdusaK C/SA== X-Forwarded-Encrypted: i=1; AJvYcCUFPI2pvlDuSVaemi9x7iRyOlKswBOaVTH6xKtkrFLxkBwBkOfk3H5LuB+jLleE/48u19Z0gMG3W9w=@lists.xenproject.org X-Gm-Message-State: AOJu0Yz7hR5ia6moIBJ2DcPwCPPYR54+77/Ws1FfaSKS0TtJ3Emtq3ZJ IXOVOQLDDeCQ2EizJs/rItTdAXFQFO+5+qGzgfrbOCxIxzoWegHl06TNkArNm2ZZCTk= X-Gm-Gg: ASbGnctPSVju9LDZa2jot+FyYKRWhehsoRb7UAh5TyJpEHC7I5uK8aO0ngKLLO3r+uH eHU4PJG/H2n37Bm9MjV+IA5ScPXV7syjWK+gplaZA0PqrKQHq+z19jKDWGM531x7GURNVzl6UXV 79dIpurg6w1+lEN9NttnBjxpzCEemptRwKW5aUnmrksPD5fwZ/TeHpOCclzBFq/NeAa3mHNKmbb 21sKaQOfUzowpuOpq49MltTr1aA1TV8qg9JeQl3lpCuGRvmZ8JyIiPJvws0jY2EryQcX3r4qF1n PMe+zxPR/QQX96UMwXSTXq7/YpMKBF/cPzzsqVV3EosDjtDKqnjeZ8pPrWiS71mnq95bJxMiRxh BvTWgxEZKs3OXNAxOuLUjcw3YmKBzM/jk5q6zSSjFztJtico= X-Google-Smtp-Source: AGHT+IGUIGmRkNOsoFJDwtp7VUBuEXsARIcb9sOIxx6CN5f0AbT6nqsmy0amztwXgQM0zaIcj6KsKw== X-Received: by 2002:a05:600c:4509:b0:441:ac58:eb31 with SMTP id 5b1f17b1804b1-454a3705065mr72661285e9.20.1751564121250; Thu, 03 Jul 2025 10:35:21 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Phil Dennis-Jordan , Mads Ynddal , Fabiano Rosas , Laurent Vivier , Stefano Stabellini , Anthony PERARD , Paul Durrant , "Edgar E. Iglesias" , Reinoud Zandijk , Sunil Muthuswamy , kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v6 28/39] accel: Expose and register generic_handle_interrupt() Date: Thu, 3 Jul 2025 19:32:34 +0200 Message-ID: <20250703173248.44995-29-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1751564137162116600 In order to dispatch over AccelOpsClass::handle_interrupt(), we need it always defined, not calling a hidden handler under the hood. Make AccelOpsClass::handle_interrupt() mandatory. Expose generic_handle_interrupt() prototype and register it for each accelerator. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Zhao Liu Reviewed-by: Richard Henderson Reviewed-by: Xiaoyao Li --- include/system/accel-ops.h | 3 +++ accel/hvf/hvf-accel-ops.c | 1 + accel/kvm/kvm-accel-ops.c | 1 + accel/qtest/qtest.c | 1 + accel/xen/xen-all.c | 1 + system/cpus.c | 10 ++++------ target/i386/nvmm/nvmm-accel-ops.c | 1 + target/i386/whpx/whpx-accel-ops.c | 1 + 8 files changed, 13 insertions(+), 6 deletions(-) diff --git a/include/system/accel-ops.h b/include/system/accel-ops.h index d84eaa376c2..95a0f402cde 100644 --- a/include/system/accel-ops.h +++ b/include/system/accel-ops.h @@ -61,6 +61,7 @@ struct AccelOpsClass { void (*synchronize_pre_loadvm)(CPUState *cpu); void (*synchronize_pre_resume)(bool step_pending); =20 + /* handle_interrupt is mandatory. */ void (*handle_interrupt)(CPUState *cpu, int old_mask, int new_mask); =20 /** @@ -84,4 +85,6 @@ struct AccelOpsClass { void (*remove_all_breakpoints)(CPUState *cpu); }; =20 +void generic_handle_interrupt(CPUState *cpu, int old_mask, int new_mask); + #endif /* ACCEL_OPS_H */ diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 2944e350ca9..a0248942f3a 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -353,6 +353,7 @@ static void hvf_accel_ops_class_init(ObjectClass *oc, c= onst void *data) =20 ops->create_vcpu_thread =3D hvf_start_vcpu_thread; ops->kick_vcpu_thread =3D hvf_kick_vcpu_thread; + ops->handle_interrupt =3D generic_handle_interrupt; =20 ops->synchronize_post_reset =3D hvf_cpu_synchronize_post_reset; ops->synchronize_post_init =3D hvf_cpu_synchronize_post_init; diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c index 99f61044da5..2a744092749 100644 --- a/accel/kvm/kvm-accel-ops.c +++ b/accel/kvm/kvm-accel-ops.c @@ -95,6 +95,7 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, con= st void *data) ops->synchronize_post_init =3D kvm_cpu_synchronize_post_init; ops->synchronize_state =3D kvm_cpu_synchronize_state; ops->synchronize_pre_loadvm =3D kvm_cpu_synchronize_pre_loadvm; + ops->handle_interrupt =3D generic_handle_interrupt; =20 #ifdef TARGET_KVM_HAVE_GUEST_DEBUG ops->update_guest_debug =3D kvm_update_guest_debug_ops; diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index 612cede160b..5474ce73135 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -67,6 +67,7 @@ static void qtest_accel_ops_class_init(ObjectClass *oc, c= onst void *data) ops->create_vcpu_thread =3D dummy_start_vcpu_thread; ops->get_virtual_clock =3D qtest_get_virtual_clock; ops->set_virtual_clock =3D qtest_set_virtual_clock; + ops->handle_interrupt =3D generic_handle_interrupt; }; =20 static const TypeInfo qtest_accel_ops_type =3D { diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index c150dd43cab..c12c22de785 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -153,6 +153,7 @@ static void xen_accel_ops_class_init(ObjectClass *oc, c= onst void *data) AccelOpsClass *ops =3D ACCEL_OPS_CLASS(oc); =20 ops->create_vcpu_thread =3D dummy_start_vcpu_thread; + ops->handle_interrupt =3D generic_handle_interrupt; } =20 static const TypeInfo xen_accel_ops_type =3D { diff --git a/system/cpus.c b/system/cpus.c index 13535a74e6f..f90b8be9eee 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -246,7 +246,7 @@ int64_t cpus_get_elapsed_ticks(void) return cpu_get_ticks(); } =20 -static void generic_handle_interrupt(CPUState *cpu, int old_mask, int new_= mask) +void generic_handle_interrupt(CPUState *cpu, int old_mask, int new_mask) { if (!qemu_cpu_is_self(cpu)) { qemu_cpu_kick(cpu); @@ -261,11 +261,7 @@ void cpu_interrupt(CPUState *cpu, int mask) =20 cpu->interrupt_request |=3D mask; =20 - if (cpus_accel->handle_interrupt) { - cpus_accel->handle_interrupt(cpu, old_mask, cpu->interrupt_request= ); - } else { - generic_handle_interrupt(cpu, old_mask, cpu->interrupt_request); - } + cpus_accel->handle_interrupt(cpu, old_mask, cpu->interrupt_request); } =20 /* @@ -674,6 +670,8 @@ void cpus_register_accel(const AccelOpsClass *ops) { assert(ops !=3D NULL); assert(ops->create_vcpu_thread !=3D NULL); /* mandatory */ + assert(ops->handle_interrupt); + cpus_accel =3D ops; } =20 diff --git a/target/i386/nvmm/nvmm-accel-ops.c b/target/i386/nvmm/nvmm-acce= l-ops.c index 21443078b72..a5517b0abf3 100644 --- a/target/i386/nvmm/nvmm-accel-ops.c +++ b/target/i386/nvmm/nvmm-accel-ops.c @@ -87,6 +87,7 @@ static void nvmm_accel_ops_class_init(ObjectClass *oc, co= nst void *data) =20 ops->create_vcpu_thread =3D nvmm_start_vcpu_thread; ops->kick_vcpu_thread =3D nvmm_kick_vcpu_thread; + ops->handle_interrupt =3D generic_handle_interrupt; =20 ops->synchronize_post_reset =3D nvmm_cpu_synchronize_post_reset; ops->synchronize_post_init =3D nvmm_cpu_synchronize_post_init; diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-acce= l-ops.c index b8bebe403c9..31cf15f0045 100644 --- a/target/i386/whpx/whpx-accel-ops.c +++ b/target/i386/whpx/whpx-accel-ops.c @@ -90,6 +90,7 @@ static void whpx_accel_ops_class_init(ObjectClass *oc, co= nst void *data) ops->create_vcpu_thread =3D whpx_start_vcpu_thread; ops->kick_vcpu_thread =3D whpx_kick_vcpu_thread; ops->cpu_thread_is_idle =3D whpx_vcpu_thread_is_idle; + ops->handle_interrupt =3D generic_handle_interrupt; =20 ops->synchronize_post_reset =3D whpx_cpu_synchronize_post_reset; ops->synchronize_post_init =3D whpx_cpu_synchronize_post_init; --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564418; cv=none; d=zohomail.com; s=zohoarc; b=UnRm5xVvTogi3QaN26MF0pOtT6WJDRUsY/JSsmsCurkViSxjJxnz6XQyrvjUHFmdzWREK6gR1PNpXDLg4Cx67zcUhLzua+Tv6aGkC5cQk5tJ39eNPuns+/jWlPDE39h2n97Ss3NfiRXrEal8FlN4wAXXS+1EpW2u/aLvFc9R+9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564418; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eMC0+nUBwcayhXSZ9VnA1BuCntgKRX/upKf7MQ4uL1o=; b=Rle54ORNIWXk96mT/q1cOFyy/+Rx22/lVP+dVpGJty1Q6V84BqBnpz3s4+enH/Zh9TQoL3qAXH3QnyRWzM7r4FRCfMHHvwuTEz8D0kzWQLRLVoMlIlpbkEmOGiCAlhGaRZS/CX/SVmu0AnB4YY8vcjdftBX0F74wep03i7US0RU= 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 1751564418813182.9141721325036; Thu, 3 Jul 2025 10:40:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNqg-0000hl-WD; Thu, 03 Jul 2025 13:35: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 1uXNqM-0000MS-9c for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:31 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNqK-0001mu-HQ for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:30 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3a507e88b0aso43626f8f.1 for ; Thu, 03 Jul 2025 10:35:27 -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-3b472259842sm313782f8f.72.2025.07.03.10.35.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564126; x=1752168926; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eMC0+nUBwcayhXSZ9VnA1BuCntgKRX/upKf7MQ4uL1o=; b=vS30pJVw2DxnVtOnG70VfQ/hKPm68TnibDEUqhaRo+Mhkf0/KFQ3uOV3EKgQyauH8O rJPW4Mr13arnBFWEiHBFO7fEwZfH2PbrovTibJRY8TsaDSNFYALjr+FCzHnYyMmtRV4X 9LLl4HtaxOeLN2/d9TAtdY8dHuoOOuXiuMzc6eqHQpl0GlTCVUOg2XJsDt55CvSk3A7Y dtyf5wSM2REfcJ/s3YaSVg8wd+fnASk+9qQVC6paOL2LXLgmba9dhZJDC0DIushGJm9V sziuAvD224mSKe4JD9V8ZJxVsDj9vFNj+HTB64TGe3MgurDZPL3SDAZRYcI9xNtuyHXB lhkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564126; x=1752168926; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eMC0+nUBwcayhXSZ9VnA1BuCntgKRX/upKf7MQ4uL1o=; b=BstK88CK8mDAwCSmZb016UJgvZiPiwv/aMzUM5xn+hSpB4R8HJnscpVoIXlK7sk5nt Gq1tVVSTa4/F78nKByopdvrcJ+FFt/dEn9i9s9tWKa/3OHWB5t7x74g1cLOyfooETOsp QIfZhkSuohN9N+P0MndazytYLWPOFg4SerlFj+WMhykuQx3SgjEH3eAfJJSKRRnVxsDA BrYjAq+8Vap3TICJxE3X7h7tL/xmtAGbfSQwLL0bjxmeSBaaUsYbQBW0AZ+qFpi4KU8l MZ6M09deBPCnZCUmJ5LVi4VE7LDBzqI5WC2DdcvDfbDz/Lee45o4c3z2wPpQkKE5DikB 6oJA== X-Gm-Message-State: AOJu0YzU3BPS9O9J7VbxvUuLpjZB5m3Mi/Rl0Ox29BonWnCTQxj6Jk90 elYfaM/qauq6MMw1eg7ReO+n40xHjfmTgR1iOfXimMXgl4Yad6BNa9KTEUerBcOtaJK9WVC6CFr +kU0Et+A= X-Gm-Gg: ASbGncv5fTmnNX2p4O7fDP0/nlxyG2Cxhb10JwV1kxjTvZrZCJFsaqX4Pb2Ro1QbBEG puNMx/oF7B0u8U1EiOpzEr11Kz9gl1JOhZbgoGVbKYfrwEDoz8C/X4Jmk2NEogkgKV/i2X52Ccc GrsSpWnlNqfjHNkKXkb9qeHmeTYlbz3sQTD7jWBb/HTnZW4/c6H6ST2rmZSaMgEnv2H/1Y2XRsI c/GVJiMI7wcJzE09inCyYKgA6Y7iG1F+uEn8CSdKothHUuYGo7XpErsYofxsEMFjrHCflh90v0F TbVRNqP2GbhFA7gqq1Aemtv7lmra2ib2sCZtg+96UoRLs0FsJ3T+aBON2tY3p289NUVRl7qLrLc nbXo6qXpOpa5ioRu28lWf5EB69G5o7u75Cgms X-Google-Smtp-Source: AGHT+IF1zTlhV/pE6jc+dDLOU+oSlfPDF14ZyWfUE6sQo5Gd3pIpXdWFoebQiJ3d/WWSngZcAJFj2g== X-Received: by 2002:a05:6000:43cc:10b0:3a5:1c3c:8d8d with SMTP id ffacd0b85a97d-3b32e9ecaafmr2925229f8f.55.1751564126084; Thu, 03 Jul 2025 10:35:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 29/39] accel: Keep reference to AccelOpsClass in AccelClass Date: Thu, 3 Jul 2025 19:32:35 +0200 Message-ID: <20250703173248.44995-30-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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: 1751564420394116600 Allow dereferencing AccelOpsClass outside of accel/accel-system.c. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Zhao Liu --- include/qemu/accel.h | 3 +++ include/system/accel-ops.h | 3 ++- accel/accel-common.c | 1 + accel/accel-system.c | 3 ++- accel/tcg/tcg-accel-ops.c | 4 +++- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index f987d16baaa..197badcb705 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -37,6 +37,9 @@ typedef struct AccelClass { /*< public >*/ =20 const char *name; + /* Cached by accel_init_ops_interfaces() when created */ + AccelOpsClass *ops; + int (*init_machine)(MachineState *ms); bool (*cpu_common_realize)(CPUState *cpu, Error **errp); void (*cpu_common_unrealize)(CPUState *cpu); diff --git a/include/system/accel-ops.h b/include/system/accel-ops.h index 95a0f402cde..17c80887016 100644 --- a/include/system/accel-ops.h +++ b/include/system/accel-ops.h @@ -10,6 +10,7 @@ #ifndef ACCEL_OPS_H #define ACCEL_OPS_H =20 +#include "qemu/accel.h" #include "exec/vaddr.h" #include "qom/object.h" =20 @@ -31,7 +32,7 @@ struct AccelOpsClass { /*< public >*/ =20 /* initialization function called when accel is chosen */ - void (*ops_init)(AccelOpsClass *ops); + void (*ops_init)(AccelClass *ac); =20 void (*cpu_reset_hold)(CPUState *cpu); =20 diff --git a/accel/accel-common.c b/accel/accel-common.c index 4894b98d64a..56d88940f92 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -10,6 +10,7 @@ #include "qemu/osdep.h" #include "qemu/accel.h" #include "qemu/target-info.h" +#include "system/accel-ops.h" #include "accel/accel-cpu.h" #include "accel-internal.h" =20 diff --git a/accel/accel-system.c b/accel/accel-system.c index 07b75dae797..b5b368c6a9c 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -95,8 +95,9 @@ void accel_init_ops_interfaces(AccelClass *ac) * non-NULL create_vcpu_thread operation. */ ops =3D ACCEL_OPS_CLASS(oc); + ac->ops =3D ops; if (ops->ops_init) { - ops->ops_init(ops); + ops->ops_init(ac); } cpus_register_accel(ops); } diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index eb16a6bf6db..bc809ad5640 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -189,8 +189,10 @@ static inline void tcg_remove_all_breakpoints(CPUState= *cpu) cpu_watchpoint_remove_all(cpu, BP_GDB); } =20 -static void tcg_accel_ops_init(AccelOpsClass *ops) +static void tcg_accel_ops_init(AccelClass *ac) { + AccelOpsClass *ops =3D ac->ops; + if (qemu_tcg_mttcg_enabled()) { ops->create_vcpu_thread =3D mttcg_start_vcpu_thread; ops->kick_vcpu_thread =3D mttcg_kick_vcpu_thread; --=20 2.49.0 From nobody Sat Dec 13 22:55:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1751564150; cv=none; d=zohomail.com; s=zohoarc; b=m5TDclHnYOlCVS35X95HLMB2By86s/w3Qupg1UFXKGfwPepcvyd4PuGDdN/5m+FMHvughR+GJ/dPTOIfN6Sz0g9YaQRthwST2FiNvU7qErgFsVTMzSqRV+tJ9+w/ixDOAAkq7MUDkIpQDwY9/huFe25upU8FD7CMueHVhN1f/eg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564150; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=w3486zTUHknyNnHUemYDF582+L164Ncw9awD18XnK3g=; b=KJoZ+N03qWs6vsjZty8EqQ9FuGARdgbKK8og/gyzTMp7KhxyO+US+8YRuc7yNtpM7AZfRpwO1wPoejtU2td8KjrHuS6rD6XEDUvl4QR8JjHnqKjhjKxp/xVULxOQd80oQ0aFB+MAL3hIIxlZaRTYjuaOZYYY4c68k1AYL8gR5lI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751564150235789.3716918677376; Thu, 3 Jul 2025 10:35:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1032345.1406017 (Exim 4.92) (envelope-from ) id 1uXNqV-0002Ik-H7; Thu, 03 Jul 2025 17:35:39 +0000 Received: by outflank-mailman (output) from mailman id 1032345.1406017; Thu, 03 Jul 2025 17:35:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uXNqV-0002IZ-CZ; Thu, 03 Jul 2025 17:35:39 +0000 Received: by outflank-mailman (input) for mailman id 1032345; Thu, 03 Jul 2025 17:35:38 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uXNqU-0001VU-0z for xen-devel@lists.xenproject.org; Thu, 03 Jul 2025 17:35:38 +0000 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [2a00:1450:4864:20::42c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 20ab4d13-5834-11f0-b894-0df219b8e170; Thu, 03 Jul 2025 19:35:36 +0200 (CEST) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3a6d1369d4eso28210f8f.2 for ; Thu, 03 Jul 2025 10:35:36 -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-3b471b97382sm320521f8f.56.2025.07.03.10.35.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:35:34 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 20ab4d13-5834-11f0-b894-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564135; x=1752168935; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w3486zTUHknyNnHUemYDF582+L164Ncw9awD18XnK3g=; b=Us8xRbEOBLbd0cMfayo+F8zgI65hnex6qwRVWMFTH0kY9nznUSsOdqzUOuEnKeB5nu /+uZY7XM+hU3Xt2Pd2WqAB7JBJwlUmC6zizeZkXb9Ztbcsyw6JzbL2himI1KLEyREEPh x9I5zkUVjOGxCv4k07wBd6WHHjzW3A9XXXnOSNtHpVCgS8THCFusoDQ2oczJrBc9DHqB 5H4cbYGufhUXd00kJNmOspOW9yzHjfUwcgXKxmPu7wdFFUJUwxaLooRL+VqyAIFqISUi kvlv4cpVep+NWdg5T+ff8g5MReoP4srx0t4mTicvabyuPmN6dfCLXOyk9zkzq3tAMp7a 6Brw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564135; x=1752168935; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w3486zTUHknyNnHUemYDF582+L164Ncw9awD18XnK3g=; b=prCiec8YlxlHKoHDKi9iXnQl/T569Y6w110gKdCULN1i1amfhg7Gg6OLh5Ze9ZPGJ6 WlR/6j6X9Ak53pT66n1XXYJnlsscJkDrcWYi8cghjIE9IHWIbdXUztESX4jDQg0dNVKH erBpvUTncyjD5LBqnBIjfSN4KHCaryKcOmh45TjubTL0MYR9DrQGe4z15fn+EWGR38Ix dxWg9j4w9TTW6imqMKPBqGPvhzTuem1F8NqqqYxJADjsT/SdzGFLSMwI3H6YRZxESIei dQlQaDR1eS7/Y0aa14XjbnLERCPb59nr3Uw/M45307va9A6/PiJLKryeiFgMhc0AgxQy ZHkw== X-Forwarded-Encrypted: i=1; AJvYcCWqK9eWErupdHc+1v33Rx8QCvRkKSmaMpHQLEGcBORut8oZP3CpVld/Y4FFvs2KtfSsVgR0o4MUC+U=@lists.xenproject.org X-Gm-Message-State: AOJu0YxEA25yjYn0yS5iZEve9gv2w2zG/9cegKC8oqQisZ6HdZTd3vBR sy3Qz6up0vehu9UbU7J3JDYl/KKdegjohnu82PdZm4yCE0v0v/RTk9ElGQvEbjPOcXM= X-Gm-Gg: ASbGncseQnDlhPvLWqhc/m/ImC5BE52M2I1seBmxWQSMAMgV5bb+1Z7y+FQOz2qz9VD u2NXu5MPEs3obXP2Jl6JwJX8IEYDr02jO16+qOAPARtVQpql4vp7NXId0uptDfdnVDbfGoZOK6q 4HsZXoem4dsjhBDT+QVghg6khCca9ZsIlauckAz+GPOmNqefyZdYPD8xdLEXDF+NIyEdRnxNksm KjFEdGQSqCdHv9VGNstMtOVeSEJlKf6PnZgFzxXt+txen2hVAIgfWfH0Izvhjz4su1F/rTZEZdc meL3FLdAIp42nXpswjrIosREMarPD89n8rZurcentJuySCMQhw+8ovC7ZEJM8/pvjcU1gd1R0uK zIM9+SPCh+4mwmFQJIWejNxjoWklcVZT9wjxe X-Google-Smtp-Source: AGHT+IFkhhlZSbMvBFh6UdUhOeDV184atk4sneL/YpRsGW7A5ClqyXIooVwAUEBKx8X5RV+czV8IYw== X-Received: by 2002:a05:6000:220f:b0:3a8:2f65:373f with SMTP id ffacd0b85a97d-3b32cb36152mr3879437f8f.16.1751564135278; Thu, 03 Jul 2025 10:35:35 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Phil Dennis-Jordan , Mads Ynddal , Fabiano Rosas , Laurent Vivier , Stefano Stabellini , Anthony PERARD , Paul Durrant , "Edgar E. Iglesias" , Warner Losh , Kyle Evans , Reinoud Zandijk , Sunil Muthuswamy , kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v6 30/39] accel: Propagate AccelState to AccelClass::init_machine() Date: Thu, 3 Jul 2025 19:32:36 +0200 Message-ID: <20250703173248.44995-31-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1751564151193116600 In order to avoid init_machine() to call current_accel(), pass AccelState along. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Zhao Liu --- include/qemu/accel.h | 2 +- accel/accel-system.c | 2 +- accel/hvf/hvf-all.c | 2 +- accel/kvm/kvm-all.c | 2 +- accel/qtest/qtest.c | 2 +- accel/tcg/tcg-all.c | 2 +- accel/xen/xen-all.c | 2 +- bsd-user/main.c | 2 +- linux-user/main.c | 2 +- target/i386/nvmm/nvmm-all.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index 197badcb705..b040fa104b6 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -40,7 +40,7 @@ typedef struct AccelClass { /* Cached by accel_init_ops_interfaces() when created */ AccelOpsClass *ops; =20 - int (*init_machine)(MachineState *ms); + int (*init_machine)(AccelState *as, MachineState *ms); bool (*cpu_common_realize)(CPUState *cpu, Error **errp); void (*cpu_common_unrealize)(CPUState *cpu); =20 diff --git a/accel/accel-system.c b/accel/accel-system.c index b5b368c6a9c..fb8abe38594 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -37,7 +37,7 @@ int accel_init_machine(AccelState *accel, MachineState *m= s) int ret; ms->accelerator =3D accel; *(acc->allowed) =3D true; - ret =3D acc->init_machine(ms); + ret =3D acc->init_machine(accel, ms); if (ret < 0) { ms->accelerator =3D NULL; *(acc->allowed) =3D false; diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 897a02eebe2..2cf2b18fd23 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -247,7 +247,7 @@ static MemoryListener hvf_memory_listener =3D { .log_sync =3D hvf_log_sync, }; =20 -static int hvf_accel_init(MachineState *ms) +static int hvf_accel_init(AccelState *as, MachineState *ms) { int x; hv_return_t ret; diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 88fb6d36941..1b6b7006470 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2573,7 +2573,7 @@ static int kvm_setup_dirty_ring(KVMState *s) return 0; } =20 -static int kvm_init(MachineState *ms) +static int kvm_init(AccelState *as, MachineState *ms) { MachineClass *mc =3D MACHINE_GET_CLASS(ms); static const char upgrade_note[] =3D diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index 5474ce73135..2b831260201 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -38,7 +38,7 @@ static void qtest_set_virtual_clock(int64_t count) qatomic_set_i64(&qtest_clock_counter, count); } =20 -static int qtest_init_accel(MachineState *ms) +static int qtest_init_accel(AccelState *as, MachineState *ms) { return 0; } diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 0cff0f8a0f9..7ae7d552d9e 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -80,7 +80,7 @@ static void tcg_accel_instance_init(Object *obj) =20 bool one_insn_per_tb; =20 -static int tcg_init_machine(MachineState *ms) +static int tcg_init_machine(AccelState *as, MachineState *ms) { TCGState *s =3D TCG_STATE(current_accel()); unsigned max_threads =3D 1; diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index c12c22de785..8279746f115 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -77,7 +77,7 @@ static void xen_setup_post(MachineState *ms, AccelState *= accel) } } =20 -static int xen_init(MachineState *ms) +static int xen_init(AccelState *as, MachineState *ms) { MachineClass *mc =3D MACHINE_GET_CLASS(ms); =20 diff --git a/bsd-user/main.c b/bsd-user/main.c index 7c0a059c3ba..d0cc8e0088f 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -474,7 +474,7 @@ int main(int argc, char **argv) opt_one_insn_per_tb, &error_abort); object_property_set_int(OBJECT(accel), "tb-size", opt_tb_size, &error_abort); - ac->init_machine(NULL); + ac->init_machine(accel, NULL); } =20 /* diff --git a/linux-user/main.c b/linux-user/main.c index 5ac5b55dc65..a9142ee7268 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -820,7 +820,7 @@ int main(int argc, char **argv, char **envp) opt_one_insn_per_tb, &error_abort); object_property_set_int(OBJECT(accel), "tb-size", opt_tb_size, &error_abort); - ac->init_machine(NULL); + ac->init_machine(accel, NULL); } =20 /* diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c index 2df49d7eeb4..b4a4d50e860 100644 --- a/target/i386/nvmm/nvmm-all.c +++ b/target/i386/nvmm/nvmm-all.c @@ -1152,7 +1152,7 @@ static struct RAMBlockNotifier nvmm_ram_notifier =3D { /* -----------------------------------------------------------------------= --- */ =20 static int -nvmm_accel_init(MachineState *ms) +nvmm_accel_init(AccelState *as, MachineState *ms) { int ret, err; =20 diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 94fd5fc7849..721c4782b9c 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -2504,7 +2504,7 @@ static void whpx_set_kernel_irqchip(Object *obj, Visi= tor *v, * Partition support */ =20 -static int whpx_accel_init(MachineState *ms) +static int whpx_accel_init(AccelState *as, MachineState *ms) { struct whpx_state *whpx; int ret; --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564515; cv=none; d=zohomail.com; s=zohoarc; b=Y0zzPILNlXCW8QE1+7QcWF5q1CqvfeLc4n9/ZuyoByPdw5OAyYYobQHb3tHNPsP3r/wstULxjWsaBwAA8pRNXZ2BteTtnDmgl8zrGWcV406ArUOfnsag1jjuI1DbAGs/miyjVX+h6h9DJock96Vuf/8JKEQXiEqY/O6AabwFYi8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564515; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fjJ+lcNXcYC5f1FwLpKLJEf76e+ZyGqrMwDm/D97r7I=; b=MYZOFXwSL1+Gmlmifz5l51t7YCInbYRxJSUisMYNw8LPuBOBz1ghWPsZaxi0SBaPbpnNJwgHx8lHUswgApaBud5PhlvrvS8O8FvCy7eI9gs7dq+sgjEbRZ64Pvdka+tycdwx6oe6fhSku9NIP+kh0U5lJJ8eZfxp+H9TMx922yw= 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 1751564515267108.72003062697024; Thu, 3 Jul 2025 10:41:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNqf-0000ee-1r; Thu, 03 Jul 2025 13:35: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 1uXNqb-0000Vy-Dd for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:45 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNqZ-0001oU-Eg for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:45 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-451d7b50815so691635e9.2 for ; Thu, 03 Jul 2025 10:35:43 -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-3b47040161bsm337927f8f.4.2025.07.03.10.35.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564141; x=1752168941; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fjJ+lcNXcYC5f1FwLpKLJEf76e+ZyGqrMwDm/D97r7I=; b=OCBJ+txAeCFQeZQ/qovkre9uALn42SpFJnL1t2WZ9sAnoU48rIA8poL6tDeNZQUB6W hcXwZRWzblUvUV3Z0BthabR42CqTZOyb1aIvBl8wYrAeJYWDafPWhAUwgpMdOELW0JmY ma/fA8+urrJdwC8I4g1DqPH336irXj2FWBFmg1KXRfdkF7x8bcVJrA3Nfk7/2FdBWc1q JLiHUcwSgrBS4HGLf/TWO6F28Wt5MNmYNr2+PVQd5tharMUDMKwBw8fwoR7h8mvHfPQm KWy/NC7F6qQE2IOYGXHDxzQaKzCgyVFF/rXuTuQiP9rDygOqfOLtjk0UtDrdxPsrBj3+ PmBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564141; x=1752168941; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fjJ+lcNXcYC5f1FwLpKLJEf76e+ZyGqrMwDm/D97r7I=; b=aXgSerjlsmtckjFUTD6TlYB/hHYcu/9GpXT7Qa3BandK6eXNwdvhayXihE3c6IpzAV BV+8H46aG76YfdWAoyTVjj7606ojz2UdszDG43aY6WnBcSClHwbkkfG/OQXSuFCbsgEu GEhxHDegUMZAh5wVdr87YwzSyWoFFKPzprVSRI9b/09Phb8ONDdw7P7DRtAsw5z9YNXZ qH7UTd4L2v/sGCl4PMtEqPhOgwCk2+OJYUiajA+1ZjNYKZZHHvkRns3LfcmmOi9aQZnU VbLKJoVXS4wWsyD/kOiWofjKTvuzvrViR3PlKGacO/bYXBFfI+Hw6yOtVIYrKDIxBUwV uHSg== X-Gm-Message-State: AOJu0YyWjFECT4UhbhDFn0nOs70IFC9fBIijnsg1UfAIFqawim7BctQ+ 0CGLhz02zugwBTs/yVlJSwd0Z3Mt8RHNUHn5Z+u8KVci/At9UIaRtBhmJ3YAomnMbEyYx0cfT1V 8XFH/7nM= X-Gm-Gg: ASbGncufXb+P1FvHKWvwmml3PJyhncFhzhpp5Ejc3q9vvlflxNE60V+XGJfZmJvPL3w SGhnxGl0qFSTbG6/dkjB5hFAPXQ2yX79SZdh4Tag793uoDtoa2WkFlJecmLvTirSmQsEmXBycFd qMRQkNoBZWheFoq1Fi5T59c9I5gWi85sK1GUn0uxX+cDBxSf9djY7rwB7MxqcTh6uVmXXIsTMaI yVJ/7wJE6hbpoXu575GZ3o24HMcHXok3FqlYp1k5xO1A4cM/YDreUETEvC8gWx+jBHfZ97DARLG jhOonQ5OBU4gckBKq7ADzovIkoNcn+cv9HmEz5rz3CIlA4zGPmzPOnGPAlqxAE3naitxhcJGuJA gkrZhV/6lo2joCxzO+5A0/+tBQGiOAgnag6bq X-Google-Smtp-Source: AGHT+IF3qpPPLYHCen/OvZ3c3kUwooh29DGaRG1oO4fn0b7UOW7ZJboMWSayZSJdRuauW6FDYFScEw== X-Received: by 2002:a05:600c:c493:b0:43c:f513:9591 with SMTP id 5b1f17b1804b1-454a9c7fac5mr52499855e9.14.1751564140699; Thu, 03 Jul 2025 10:35:40 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org Subject: [PATCH v6 31/39] accel/kvm: Prefer local AccelState over global MachineState::accel Date: Thu, 3 Jul 2025 19:32:37 +0200 Message-ID: <20250703173248.44995-32-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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: 1751564517811116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- accel/kvm/kvm-all.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 1b6b7006470..a6ea2c7f614 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2588,15 +2588,13 @@ static int kvm_init(AccelState *as, MachineState *m= s) { /* end of list */ } }, *nc =3D num_cpus; int soft_vcpus_limit, hard_vcpus_limit; - KVMState *s; + KVMState *s =3D KVM_STATE(as); const KVMCapabilityInfo *missing_cap; int ret; int type; =20 qemu_mutex_init(&kml_slots_lock); =20 - s =3D KVM_STATE(ms->accelerator); - /* * On systems where the kernel can support different base page * sizes, host page size may be different from TARGET_PAGE_SIZE, --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564448; cv=none; d=zohomail.com; s=zohoarc; b=etUIsDlPLFuZvAD/EqzQn1jUe/W4qw/1BAG9sGfYMvvtpvw1P3S7L4040YN2PV5/xTakqvV8JWXhqZamqnbdER5KOI9jhvsPzKuI0BsaeczqAFr54y+k0uuy0BswnhPF4EwTIk0DXPOXYIwHovNEsB/62FWxbcaQRm9EA5psqkY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564448; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/MC92E7FLkNQLrXWkop42r4qYRx+5dbFagdyAugyF5E=; b=n8PgxI9ojN73Ie/7kPMmp20qtnP/XkO2GYAlOopEWWuap+AQXabYXZ9cFYtnOinZaQ7UYF0iUEUe5T30h2Qe/8meNzbE0+i/pbLJV7kDLk3t29n//Ktj1hW2+x4eT9+2YOUo5tfVWcmGc141FP4qnJIQPIJZd7tuV+M2jqGnS1w= 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 1751564448760229.87591154440793; Thu, 3 Jul 2025 10:40:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNqw-00015O-3w; Thu, 03 Jul 2025 13:36: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 1uXNqh-0000ja-9v for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:51 -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 1uXNqf-0001pZ-Cc for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:50 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3a582e09144so40519f8f.1 for ; Thu, 03 Jul 2025 10:35:48 -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-453a85b3016sm66811045e9.0.2025.07.03.10.35.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564147; x=1752168947; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/MC92E7FLkNQLrXWkop42r4qYRx+5dbFagdyAugyF5E=; b=uH12NyoandpNYYX4aMlCv583o0Qc/TIY4z5G691N5TLKJJKt7kUr2QAgGNoeTOORq1 2e/qAkUed7r3kdUf52nUBufoOBssxe79BmeZ67Po/mKsv3bxx71pmGlvJAaPMIZQwK7k ArZwf4FJrWauuwUeqXkqwfOEjWJFj9L/6fnPYk4FWnDvHa6dZeTv1fVUKWJOk5bs5vTI DZj5+8jwbCTu3RsCud8oN1NDA0b4L8zHFjYWPJT0ZcfkYn+HNsVKGb9m/9brJphIO9qP 0QRsb4qsjT27DH9ufizppbtaJkQ9qbKt8Ldk6bU9Th0MJ5AmkKip/7LsStrHQt0nkG3X 9Lpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564147; x=1752168947; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/MC92E7FLkNQLrXWkop42r4qYRx+5dbFagdyAugyF5E=; b=pznsow2RUiMCMgWCVAq1JR9lQ5SoTdD7CbVaTnHJd4qbE3Lr+AqM1woFsy1uOPIHtf Ah6dc0Z17wnZMeLQSkrP2NFWfP6lIDViosFzk5f41EWpXPAGhN61ZJHspNIJva1Ffvd7 iGdhJkBMvvv/7tqIEEEClqyIhLjpW/Enx8ZJXEmQdqZq0QXBndA6HPJr4Sjm3zDsqB9i 2NiHtwO8AwMyr3fIeQtcpi2JaBWafdYZvvfHRgvfWWTGFGq178RyTJdU+taX3P4biMru 526b2WuhFyRbFTTWW2Wdp1VL43d/W/uH//+0ERDXOMbWXmrNQM5xMF8tP9ftJL5/eixS UQ3g== X-Gm-Message-State: AOJu0YzGyF7HVvTJ+RTaDWXlWyQbLfUMFDe5tUWXIsleaSRErJPvwS5r FEr1Uyfdu3e9rXJNNlwf6lBIy3090d6/EgsBjNC84wB4MfoV4QERP6DvSmeQPVYLnh7ZrhXC19G wydiFGa8= X-Gm-Gg: ASbGncsnKEdNaoJVFv8vWwAy45MUcenMthwMjYXynqC1DRbQexl1NyZVsB1JcFY0hVV obvXoShhdL6P4+hF93Gs3550+TcFjSSyHBe7aHW3lMQ00L7iuUR6fO8Vm/vb7kOcR1oLGixMk1i ev8/OTf/Fldfb0a3xgJ5dvsR3ZS7uLojJ8fbvw/dNnZfH0QfTlsN6J2pER9Jpja/7Xjpywc4pKi 68Yh9++KuwG84urNq07TaPenlwJF73z+iJBKbq+dUsRvn90bmfrI2LGnGrhzjgy02YfKWao6Yg+ pujACPhtCG17PF5IVgOIuC4/jHvl/K+PSqZvx05QaECSIzIzC43vrbyPld17SzYlkoP4HMofIXS PiI3kfwD886WZ+wXJFRVjqLV6k55XrBbOUGbBP/bR9p9PZfY= X-Google-Smtp-Source: AGHT+IF++zcaURIEkhv3c911GkgiVo2i34p/sRCY262o8tkwpm8ymeUemtjV0/YYVdtuOeOmYnrO1Q== X-Received: by 2002:a05:6000:4807:b0:3a6:d579:ec21 with SMTP id ffacd0b85a97d-3b1fe5beeeemr6738251f8f.12.1751564147347; Thu, 03 Jul 2025 10:35:47 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 32/39] accel/tcg: Prefer local AccelState over global current_accel() Date: Thu, 3 Jul 2025 19:32:38 +0200 Message-ID: <20250703173248.44995-33-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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: 1751564450714116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- accel/tcg/tcg-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 7ae7d552d9e..969c50c87ea 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -82,7 +82,7 @@ bool one_insn_per_tb; =20 static int tcg_init_machine(AccelState *as, MachineState *ms) { - TCGState *s =3D TCG_STATE(current_accel()); + TCGState *s =3D TCG_STATE(as); unsigned max_threads =3D 1; =20 #ifndef CONFIG_USER_ONLY --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564687; cv=none; d=zohomail.com; s=zohoarc; b=BQfuhp+t21HyDKF/9rcf9Zpcf57HWXQEC8sAyP6/zm3VB7s0qDEDnHCIA8ucozauarB2WDXcbchS7O2Mk7IAVk6x9VK2x7c/srem43w0+DXYXXjPin0UddI51zbpY85iupt4B430LCvNyai6TpESdq/KQrg2CdqWLBRW4Xlx4H8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564687; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WNEz7S5Pg2QTsssvmOiqXSpVHK7X0tn5k6hlRokSPQI=; b=jA6s45WacZg8cY2Gs2flKnIIJt7NEYKED/YgwHPqOwgLKcpNWHcgGkl9MDxgAQ07m02xVj3rMQubD+1FPXu3ONwDsQuGC9PUEE7/4e8eNL8u7GGyy/Z6GU4+yXgombwtrWjNUKxWV23CuyUoS+0Zao1AfxzDfOssgWGBRJgO75g= 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 1751564687010949.5886663031669; Thu, 3 Jul 2025 10:44:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNr2-0001CV-Ec; Thu, 03 Jul 2025 13:36:12 -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 1uXNqm-0000sH-7p for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:56 -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 1uXNqk-0001qA-D9 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:35:55 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-453643020bdso627105e9.1 for ; Thu, 03 Jul 2025 10:35:53 -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-454a997e367sm32048195e9.15.2025.07.03.10.35.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564152; x=1752168952; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WNEz7S5Pg2QTsssvmOiqXSpVHK7X0tn5k6hlRokSPQI=; b=w/eavJLJZwdFiYkEwjcIP8pYqWYLsXG/ueSZ4VEsa0wC9tx7stdCtH4HPESYNi74sF bXeBOalQ8aHlI0rPYnsRHpkdAUsMpz04zETFPSFJj+Hj5r/chLnYtfp1PE/fDofwWlp1 r1niDxlHrUnkpaMyXjl/oYqN9RaJqRY//n+0Z5jGqy1aIGR21y3+DZFAFyOuyQgCxR/5 LyAKw3yJZibJuEkXJ9cU/5QWas3nmd7wDSfTi46lFSMSeK5EIp+kf/7E8xfbR9UHeK+e XhrjBYEcw+FPpUuX5LRuMMbuT5pJ1Nw+ZKZ8H4OOjAx9D5kM/ffq4t1Mfc+W9xqO9fcx SSfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564152; x=1752168952; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WNEz7S5Pg2QTsssvmOiqXSpVHK7X0tn5k6hlRokSPQI=; b=ZkzzPvHU5+lNItO4QfoSkhio98+HAbXuo+VQ2JYg5x+mVZReBLQP0KhPswSfsfgEaC iHVdmJSHGLMQkdeVryDAPv4j9ETnFiMYX/JM+dmCSccDdv2AdywOZPu5KN+p3OBUxxL4 bmMLOhwo/H6UG3ms46ZeoLzusOLhb1QS4OqMyZX0wFbOGH3Mymk2zscPyqTG3Yi2WgOO T5t3sM4axJ3htE5vcYS4n343cEMQiPUY8D1PxTdGGkBYGDoO1QiLawoqPB5MrV2tSGMk in7ozdMZtABqqLrM0uyfxKNDp5SR0yjBAwYSnn8ba/2tM9fPekBEqeIPSm30YiEHtWnl NGTQ== X-Gm-Message-State: AOJu0YzN9jWcpPA75kWTq/6ys0HlTrRcjf9oGEo1jjt9sBPLfqalk/bp OtEOsP7LwkyvwYXVQ0eSETQ06twW2+4nigwjn8G6LUj4UFZT/Dm2l7K+Vy0e/qU3xfHJBHqoNeN gZrIhu+0= X-Gm-Gg: ASbGncuOUreR0N5eutk1GkLFHEB0XDWY74o1Mnr4/WISxxpIB4ENDFir5yNqqz87NAr 7qLxd/HjWIV9OtMnJZb3eDOLsEIwVqnsNDHbrcrjuwEj7bYSp/NnmwMTXqUXXlgJUXTsDwOKaY+ 5nhPZMRCys0q+l626Xa1xw8zVzYcHp13umpT4Md+65k+OyXlTkeCnLfvNMlcCBkC9GiQlYUAVtX uamxwCLjxX8HB6OiDl1ugbzNUD6cIf7bSGGmjqdRuqqne06qR0Lt3D1SMCnbp6J2sHfIuCvEA+t pZVGAfB/T+CXr/n9R4DuQZSGi83Mrd5o4LNxibA1kenF2YVangnkFWbgyzFfVVTbiEudlSehUN6 bHGBuR662WNZRdI7yBGWOHEmX93YctH0s7CR+ X-Google-Smtp-Source: AGHT+IGG9cwkbptc5qjJh/iBIUTkTEqak4gJcRB89ikAjNxYhsBkJvLXzAiMyUL0ZnaTv+toNbITUA== X-Received: by 2002:a05:600c:1c0d:b0:454:ac5d:3919 with SMTP id 5b1f17b1804b1-454ac5d3bbbmr36513685e9.2.1751564152351; Thu, 03 Jul 2025 10:35:52 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , David Hildenbrand , kvm@vger.kernel.org Subject: [PATCH v6 33/39] accel: Directly pass AccelState argument to AccelClass::has_memory() Date: Thu, 3 Jul 2025 19:32:39 +0200 Message-ID: <20250703173248.44995-34-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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: 1751564687591116600 Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu --- include/qemu/accel.h | 2 +- accel/kvm/kvm-all.c | 4 ++-- system/memory.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index b040fa104b6..44189b77daa 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -46,7 +46,7 @@ typedef struct AccelClass { =20 /* system related hooks */ void (*setup_post)(MachineState *ms, AccelState *accel); - bool (*has_memory)(MachineState *ms, AddressSpace *as, + bool (*has_memory)(AccelState *accel, AddressSpace *as, hwaddr start_addr, hwaddr size); bool (*cpus_are_resettable)(AccelState *as); =20 diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index a6ea2c7f614..0cd9b2f29ab 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3789,10 +3789,10 @@ int kvm_get_one_reg(CPUState *cs, uint64_t id, void= *target) return r; } =20 -static bool kvm_accel_has_memory(MachineState *ms, AddressSpace *as, +static bool kvm_accel_has_memory(AccelState *accel, AddressSpace *as, hwaddr start_addr, hwaddr size) { - KVMState *kvm =3D KVM_STATE(ms->accelerator); + KVMState *kvm =3D KVM_STATE(accel); int i; =20 for (i =3D 0; i < kvm->nr_as; ++i) { diff --git a/system/memory.c b/system/memory.c index 4f713889a8e..b072a6bef83 100644 --- a/system/memory.c +++ b/system/memory.c @@ -3496,7 +3496,7 @@ static void mtree_print_flatview(gpointer key, gpoint= er value, if (fvi->ac) { for (i =3D 0; i < fv_address_spaces->len; ++i) { as =3D g_array_index(fv_address_spaces, AddressSpace*, i); - if (fvi->ac->has_memory(current_machine, as, + if (fvi->ac->has_memory(current_machine->accelerator, as, int128_get64(range->addr.start), MR_SIZE(range->addr.size) + 1)) { qemu_printf(" %s", fvi->ac->name); --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564542; cv=none; d=zohomail.com; s=zohoarc; b=cpgDCR4ni/IoUv9IcnS5FfN+sfX6b6O0juvx6dRdqj8VFE4qdZnJq/brz7AA73ehXNs1hqRkAlPxTzBNkKQJEP51M1ADAp6q+DCq6kd3PS2pTo4kRjDC6DBZ0wZIItUXn80lbiUwU9ubhL54z60mPQFCryjA0TKFv7FggNU5cVg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564542; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+kY7uW5JX/anEAPOjEFSJRgZ/Z18sVaGkA4phFJT/u8=; b=hVSHDgkFBzIPmlvBq2jbG+qKphPWC8QC5VaB0thLeXGrb/0j+tSZcCwRzr5/U7B3PDckjw5JcedNUIHNDPGeKmOO2BGKY1/4mNFkWl6Hp4Lpxc5i4glp3dm9sfna1DHGQsr6YPx76sLSBdgAzFt7cHTlJcNmJkv77iN6tjK6V2c= 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 1751564542654926.6899333171403; Thu, 3 Jul 2025 10:42:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNr8-0001II-4m; Thu, 03 Jul 2025 13:36:20 -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 1uXNqv-00015z-Kc for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:36:06 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNqp-0001qy-B5 for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:36:05 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4538a2fc7ffso9296065e9.0 for ; Thu, 03 Jul 2025 10:35:58 -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-454a9bead7csm31899885e9.39.2025.07.03.10.35.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564157; x=1752168957; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+kY7uW5JX/anEAPOjEFSJRgZ/Z18sVaGkA4phFJT/u8=; b=v1lZdTMycv7UDXjNjS4zRl0gGuOzVbS2GyJD+D6cyGlj1dLBG7HC3ViHI8olTsI9ky f6qOTze3yOXlIAvGeOv1Jw+uefjxpND3hJ3sKJd//NYb2/PB9OyQykwkii4sIqYuq0TS o5VqiL4tBIAjuuDa/kC3e2oaES1PQ7tlxzzGX8lUYLsuwXdZAgDgz8lVQU3Rmff0HzKq LkGyrMEEBrGQQd2vzTMmrVQqfgspbayoehNEwYYFvQsdr9fNhM1d9JZqX1lk3jbR/JO8 QABDzTkcdvD9Blj5xN6vorULfZUc/1ocES+u+TJGqHkGl4CM8PmBEkEzgQlt++p1JUc0 LEuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564157; x=1752168957; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+kY7uW5JX/anEAPOjEFSJRgZ/Z18sVaGkA4phFJT/u8=; b=br1XPTmWjS6E+hC6Kk1wxB6rb9fuvHOePKU3cGPJGdU7O2dzGNSV0n58QO0TtuPnP4 xd/rG8nuj2RIZho4AVR7WubxeqAk2BT/yH+19/DE9fqSQ82iTM104g2+8C+WqJZUe9JG 73wPhkfyqPDhzaq4WSUGpPVmvCaY27DL2zpGu42HWv9/Y3y0yPcjXlfyC0wEliIwx3ys O6uzWbEa0hcLqIbYN+72THGCB+/52Aa2OmWOqmhRJ05jl1553d4a+ZrxtWH8hUw3NgaD G/yzmo7nAlrfQT2rvRWLs1BXfoxHHxFBeiB8EF3i4kuEY7dG4exp+ohFM644egEtpw2Z YMWA== X-Gm-Message-State: AOJu0YxiBVMDoHJCIIHZQZY03fqdhqdqw5HXoY6DKz7Q+kAFYazTtDVY qDorMRxzkFxPQ/pFJ0FGZayxmCmXla3BmsuODbyVHQu6BvZwK3Bl+A+triZv3Yj8yPFMq5UvRmG Fi9Sp+UY= X-Gm-Gg: ASbGncujWAH/KbBrcpv3nKTp9O0PqTEk3BspMuwL+1zS7cwCIfmgvPxSeiMpurR2fDU Guufi66Oo924k1HZpXAgxQBCA9EmTZIakX6anmzcWznCfrW4gAZIaGzMde5Z/94bLtbN3nfFqML 1+BUpKjrNJq6zsQewEw7JYldJKCG01UsMssTedf8IBpJjmBISoPByEipmEeoJCBh/Fiy3ifB0jD iow6O/t8jS+RWxWVOVXVhPejwuRKW/+lWPMYhLUv5Kwbi+4kO+8SdoTywtvHGPsuIEQOniZNBMr rj9sLpDT5bDT4h3ea/yO5lb/FZMp+qvYLViqQuV5OfF/JKQYplzRfm/5RpxrTaNB3VpfIPoeoVK MUjLlRnaPiS36moGXRcv2lD1W6pYC/Xrjug0K X-Google-Smtp-Source: AGHT+IEJthAlUnsrPZh7yceFyiLjMsbF3fhEwKPu5c0UU1+XM3fol5UMo8Y8THxiFaE4vLlTRN08ow== X-Received: by 2002:a05:6000:42c2:b0:3a6:daff:9e5 with SMTP id ffacd0b85a97d-3b492c3d957mr48154f8f.7.1751564157347; Thu, 03 Jul 2025 10:35:57 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org Subject: [PATCH v6 34/39] accel/kvm: Directly pass KVMState argument to do_kvm_create_vm() Date: Thu, 3 Jul 2025 19:32:40 +0200 Message-ID: <20250703173248.44995-35-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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: 1751564543976116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- accel/kvm/kvm-all.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 0cd9b2f29ab..f1c3d4d27c7 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2470,13 +2470,10 @@ uint32_t kvm_dirty_ring_size(void) return kvm_state->kvm_dirty_ring_size; } =20 -static int do_kvm_create_vm(MachineState *ms, int type) +static int do_kvm_create_vm(KVMState *s, int type) { - KVMState *s; int ret; =20 - s =3D KVM_STATE(ms->accelerator); - do { ret =3D kvm_ioctl(s, KVM_CREATE_VM, type); } while (ret =3D=3D -EINTR); @@ -2646,7 +2643,7 @@ static int kvm_init(AccelState *as, MachineState *ms) goto err; } =20 - ret =3D do_kvm_create_vm(ms, type); + ret =3D do_kvm_create_vm(s, type); if (ret < 0) { goto err; } --=20 2.49.0 From nobody Sat Dec 13 22:55:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1751564175; cv=none; d=zohomail.com; s=zohoarc; b=Z3s+OT8kZ2gCG9+ZYJR396vaMfJ1rvYKdRa3yqQbZDUC8S+rg7mL/FSYouW/qPol58SaFM96vsZfn7M1zJmLBpE8EPEl6JXR30dnXSddhvgDmvz1ue5+3N9CkTFcwW9sIAiHeJW8IWGPjDmGHxmaa5TYPFlqJXHaareFqJn1G8I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564175; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eZwQanFWBRxwl5aAhr4ZCK6o5mkA78r32e7Wtw3A5EI=; b=d3AVvFvKsQpVLO79hw6H+W/cRUe7My32DRBP3wmIIUNBSqYh1uqw+zIGE1fW76LUGN9wHyEgbniPSGq5f1vSSkRYJntGtNoACHIRoHN4LbjAzWF711Guy9qVNUJr7aFqoW6e7R/eDrTRFNN52Ns3V+B6tL9sFqVfXe9wTIvFDFg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751564175625975.3407657610412; Thu, 3 Jul 2025 10:36:15 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1032355.1406036 (Exim 4.92) (envelope-from ) id 1uXNqu-0003Lb-TQ; Thu, 03 Jul 2025 17:36:04 +0000 Received: by outflank-mailman (output) from mailman id 1032355.1406036; Thu, 03 Jul 2025 17:36:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uXNqu-0003LS-Qd; Thu, 03 Jul 2025 17:36:04 +0000 Received: by outflank-mailman (input) for mailman id 1032355; Thu, 03 Jul 2025 17:36:03 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uXNqt-00021t-IR for xen-devel@lists.xenproject.org; Thu, 03 Jul 2025 17:36:03 +0000 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [2a00:1450:4864:20::32e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 30d467a0-5834-11f0-a315-13f23c93f187; Thu, 03 Jul 2025 19:36:03 +0200 (CEST) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-451d54214adso613665e9.3 for ; Thu, 03 Jul 2025 10:36:03 -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-3b471b97481sm324603f8f.63.2025.07.03.10.36.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:36:01 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 30d467a0-5834-11f0-a315-13f23c93f187 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564162; x=1752168962; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eZwQanFWBRxwl5aAhr4ZCK6o5mkA78r32e7Wtw3A5EI=; b=jM5Oifv3D35XyLru2PfHtTyPLMkWLvabysiKflCAhcqwvDWtAJfZNDLznnkfUYnCGm SsjDxqAnZcR9n/+Zs/ecHWRCLJnMdI3PbJvwgsJ75DGRw4BVjHVXa7csi/JzBaJRrduH uMEO0wXVHlQ+Pc7FSPEpcikQ+FDJw99Wdcajb7U/EOYTiWfB660ggNfzMl2ybDC/yKL9 cFUUSiQoKINIglAejaY3yI1f0fVXKJw7aH4m2NObxfKrWZG7CveluXaZhYp5wSC/0qV4 PdHJ0/VcQiECi4k6D3st3ZquCk4t83mzzdJoAcGzJmHNQnN8M8cKhdi3uL6cKW/3FZkn pS0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564162; x=1752168962; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eZwQanFWBRxwl5aAhr4ZCK6o5mkA78r32e7Wtw3A5EI=; b=tIahBy0Bfg2IMKbAvI+VRMHjb86G09z6TKeSK896oeNUeOxhjTO2W5bqv/89gl+CxA CKhMNidUQawpZGp1hLRl4dtm+bVdezdozwq1gKKvX4T5DQj49sfCs8UK3GzBri93Th3I auFRFi6J/fu+JlFrr3kVl5mmUpXggOjIy5vuPHLjpGN97FZbiXPyQFmCoPld0PhRxf/H AMHMBXsTCIWtQ6V8lPNRUDC65pa2Sr26fhV2jiB9ASjMUbXEahvv9ondok0IqYydkFa5 f8ZZjxTWEUrQHxAw/Ias6DHP5j5WAeg/4Y9x5NmtB8wzA1S9rd10RzrK0pDQTTLUqcD3 2pSw== X-Forwarded-Encrypted: i=1; AJvYcCXFJb/fDK3lk81e9k3C5KOJJM5+dip0jN2hzgfFzWf3eWeBHLzCFpSt+7K7ZNKggGHU3HWjdOsN5Io=@lists.xenproject.org X-Gm-Message-State: AOJu0YydbmVGQyPMNHC9zBRBJl78AL1dSEh5s2UeN3cqoVgTXHLITsz3 NzQAX8fw606Ldvgs/1Ut1cAUVBsW0FuZEyjyDHeTmeJRLjkaHLrNxmbD0EWrMLj5sDU= X-Gm-Gg: ASbGncsILqIGdRaPEb5ti7mp8NqWuSmjIKqEb3c+S0C1AYP9sqVIKreIqA/V1v/ygk+ iao8xXlo4xQiwOjsYKSQzLdl5MDPelFWGelV6NqfzqDFFlv3ubctfXA7JVJwWuG47v7l3cYDiFG KzrfYfHJXlb7+GM0be3qr/2ewdl8b8HgZI5L9XdICqD3ta6H6pPd1jkJ2SfAegrrxVbbn5GrvAH ee9yDO1biijo468dTeSkUr3pwLnEPQyQT4iS7awa2NM0SMA36peVqvCjuvTfR/PaNdEamgXELHl zJ2MReUE8PoEQXT4DPAfoSD29o5zY2ScSQOqvdKe7UHIAKdcvje+HJjmJmjSJZ0yzhwLiVkR2TE Ad7NgiJcI+3l+aZjjGl+JjpQ+9sypR7yjWxP1 X-Google-Smtp-Source: AGHT+IFlGs8qe7BnVu94UCy3WqtQJpzJU7HgdWJZtFJUmkIJbvAs7L+AWB+WvKsRQQGdwDgHXZ8jPA== X-Received: by 2002:a05:600c:8b43:b0:453:6424:48a2 with SMTP id 5b1f17b1804b1-454a3d23106mr87720105e9.10.1751564162373; Thu, 03 Jul 2025 10:36:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Stabellini , Anthony PERARD , Paul Durrant , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org Subject: [PATCH v6 35/39] accel: Remove unused MachineState argument of AccelClass::setup_post() Date: Thu, 3 Jul 2025 19:32:41 +0200 Message-ID: <20250703173248.44995-36-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1751564177457116600 This method only accesses xen_domid/xen_domid_restrict, which are both related to the 'accelerator', not the machine. Besides, xen_domid aims to be in Xen AccelState and xen_domid_restrict a xen_domid_restrict QOM property. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- include/qemu/accel.h | 2 +- accel/accel-system.c | 2 +- accel/xen/xen-all.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index 44189b77daa..19ccc5ef6a1 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -45,7 +45,7 @@ typedef struct AccelClass { void (*cpu_common_unrealize)(CPUState *cpu); =20 /* system related hooks */ - void (*setup_post)(MachineState *ms, AccelState *accel); + void (*setup_post)(AccelState *as); bool (*has_memory)(AccelState *accel, AddressSpace *as, hwaddr start_addr, hwaddr size); bool (*cpus_are_resettable)(AccelState *as); diff --git a/accel/accel-system.c b/accel/accel-system.c index fb8abe38594..637e2390f35 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -58,7 +58,7 @@ void accel_setup_post(MachineState *ms) AccelState *accel =3D ms->accelerator; AccelClass *acc =3D ACCEL_GET_CLASS(accel); if (acc->setup_post) { - acc->setup_post(ms, accel); + acc->setup_post(accel); } } =20 diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 8279746f115..bd0ff64befc 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -64,7 +64,7 @@ static void xen_set_igd_gfx_passthru(Object *obj, bool va= lue, Error **errp) xen_igd_gfx_pt_set(value, errp); } =20 -static void xen_setup_post(MachineState *ms, AccelState *accel) +static void xen_setup_post(AccelState *as) { int rc; =20 --=20 2.49.0 From nobody Sat Dec 13 22:55:08 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=1751564216; cv=none; d=zohomail.com; s=zohoarc; b=A2GxkYGOGi3njeCBCh6xisleIw01sNiXdfGWzgBRCNzi7pVh2h6tDToTQNexDprSwG60XDwsL52oe+hIOfuc9lsJUAI0F1UFZ+1G+4TTIxCqOTScwKahb90umya+0eIE9dVRp/6w6YrQLz6H6XiQL3B32/vp9u82uKkuJ48Sikg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564216; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kicmersWSEwnQxJBAM0jhQPBISipbGX/ta4y64dxhJM=; b=lnKfV23MDI3TFMROpUJZIYmQ16MHF+4hQKiAWzDlholteKKBsYlB3IGqBs3mc2/ABa9370e8lLMmvxuhOUJgvajTGhAzu98uG7m5N80q2TW0HrFDc7FNp+/umrdaEuJG9KzD9W1px3Y6daCzt7njqe+jsqSbBAMyP7F2fIDv48k= 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 1751564216589668.8448242718453; Thu, 3 Jul 2025 10:36:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNrS-0001la-00; Thu, 03 Jul 2025 13:36:38 -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 1uXNr2-0001Cj-BK for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:36:12 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNr0-0001sZ-Dn for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:36:11 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3a5257748e1so39642f8f.2 for ; Thu, 03 Jul 2025 10:36:09 -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-3b47225afd4sm309707f8f.83.2025.07.03.10.36.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564167; x=1752168967; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kicmersWSEwnQxJBAM0jhQPBISipbGX/ta4y64dxhJM=; b=Tzy0Czg0GriP3lCRQlWSn1XVLC47QZFDSBp1iRWLoNBOi/yE1cqRcb3vr0oJH+5eIr jHmH994QU+pMp2VU/aXTWlqp87mXkDNrjfIVawLJdnqHZ54Pv6QxYgRRhU28tCLzcGCp 4Tg/ipx1v67yJ/t8Ax9iA/ONe9qwVvoiwYktAKNp7qSKLXRORWs4UztCEXUiLSSVo+cd dQeuyrIBfMXY2HlAriNdlJ0Nz+H/vIYK6ms5XhSRShNyZ6P/Y5kcNerjLSdnL6MNlMnE VuZJXUYPmPLTdcB+69HJ79ctDZNeAijBKDwyCHcQh0sl3m9lh9yrZymtONVTGKhTUuIb XiSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564167; x=1752168967; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kicmersWSEwnQxJBAM0jhQPBISipbGX/ta4y64dxhJM=; b=xOwiv1uspBWLVo7xsxtb6N5VZoGW1QRZJwwVd8NA1qlCi/0g78jCLMtcRjSmAl3bg3 imA6l4fsYudeWeZuPr01Bs5+9xD0imeccwvHQutAFP5h+PKfe5wnkRxNv3qRbGIRRZYX YyGU7b+FID+7dDOY6CTuPA9YOnPYn2c7IRIFHQYYfDYOu7psI/hoApJ4YdV/YcJqLSTI SgDgckRysJfr47n0VSZqn/5NnGAiiQksEkUWaC3VvQKExjHazejLJr4fgTS4fA18vFUK qPISKr/y//fJsS4uGUqtUUt4mVXAACQLpfjIglv9JOW24hnafVzTaEluRPQz6zd4ozE2 9WDA== X-Gm-Message-State: AOJu0YxslQWExNB+JpYzF4Xn6Xc9cUpLzKpU5LP6sAWY2+FDSqgwPY2p WRLqITVVjQyV+xyjk+jnsxRdOUmpzTacDKIFvcR3m3+dc2NPrlPpemlzTmuyR34dSr1NeFS79dm oXJoShh8= X-Gm-Gg: ASbGnct3kb4+24ZxF3TCorikpoaC+Y9b4CuV8GtY4yvDv6QzmJT56jGiRWXTQQRyc4M iVg/PUgLqmjrd8F7JCgTDo7ulxZOFEwzd5fVZvxzQTUmMv1J2uNd5oCzhggS8tb7hmwgQ5aqlf8 OjXI0Nfn/kOijVf3532iZiMMgfMWKhSsMaYjlrrXUMVEjyVtNZJIBUUKIewrG9YbkXlKoAp9nMu nJN0i/1ydL/ENohHCvFg++hTskJXq93bleb86/vpsZxIznrK8q4cT+3pmbSAGWjWsD0FbaS4AD6 nJOYX2DEz35hrIyPHJb/uDYho33HPrXQYeWn1xU1oaolFA7W6FiBTSHooUZ1/BzlR1vRKoAijPo e5IRXYd1YhEepWPsvYycYGNz3s/1izZfOoftw X-Google-Smtp-Source: AGHT+IG0qQcqhoVbvfzfM31MKr9oMRdxY420l+gPXOEgJg6BZR9qG6bnUXWA/grDOvUug904CFLjvQ== X-Received: by 2002:a5d:5f81:0:b0:3aa:ab93:c7de with SMTP id ffacd0b85a97d-3b20095ce9dmr6768426f8f.34.1751564167394; Thu, 03 Jul 2025 10:36:07 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Phil Dennis-Jordan , Mads Ynddal , kvm@vger.kernel.org Subject: [PATCH v6 36/39] accel: Pass AccelState argument to gdbstub_supported_sstep_flags() Date: Thu, 3 Jul 2025 19:32:42 +0200 Message-ID: <20250703173248.44995-37-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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: 1751564218138116600 In order to have AccelClass methods instrospect their state, we need to pass AccelState by argument. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- include/qemu/accel.h | 2 +- accel/accel-common.c | 2 +- accel/hvf/hvf-all.c | 2 +- accel/kvm/kvm-all.c | 2 +- accel/tcg/tcg-all.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/qemu/accel.h b/include/qemu/accel.h index 19ccc5ef6a1..3c6350d6d63 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -52,7 +52,7 @@ typedef struct AccelClass { =20 /* gdbstub related hooks */ bool (*supports_guest_debug)(AccelState *as); - int (*gdbstub_supported_sstep_flags)(void); + int (*gdbstub_supported_sstep_flags)(AccelState *as); =20 bool *allowed; /* diff --git a/accel/accel-common.c b/accel/accel-common.c index 56d88940f92..b3fbe3216aa 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -125,7 +125,7 @@ int accel_supported_gdbstub_sstep_flags(void) AccelState *accel =3D current_accel(); AccelClass *acc =3D ACCEL_GET_CLASS(accel); if (acc->gdbstub_supported_sstep_flags) { - return acc->gdbstub_supported_sstep_flags(); + return acc->gdbstub_supported_sstep_flags(accel); } return 0; } diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 2cf2b18fd23..4fae4c79805 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -281,7 +281,7 @@ static int hvf_accel_init(AccelState *as, MachineState = *ms) return hvf_arch_init(); } =20 -static int hvf_gdbstub_sstep_flags(void) +static int hvf_gdbstub_sstep_flags(AccelState *as) { return SSTEP_ENABLE | SSTEP_NOIRQ; } diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index f1c3d4d27c7..9d1dc56d7e8 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3985,7 +3985,7 @@ static bool kvm_cpus_are_resettable(AccelState *as) * Returns: SSTEP_* flags that KVM supports for guest debug. The * support is probed during kvm_init() */ -static int kvm_gdbstub_sstep_flags(void) +static int kvm_gdbstub_sstep_flags(AccelState *as) { return kvm_sstep_flags; } diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 969c50c87ea..93972bc0919 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -224,7 +224,7 @@ static bool tcg_supports_guest_debug(AccelState *as) return true; } =20 -static int tcg_gdbstub_supported_sstep_flags(void) +static int tcg_gdbstub_supported_sstep_flags(AccelState *as) { /* * In replay mode all events will come from the log and can't be --=20 2.49.0 From nobody Sat Dec 13 22:55:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1751564186; cv=none; d=zohomail.com; s=zohoarc; b=Xt9qJRnMNorQNTsg1GXADhyUYxUlKC672dfpipqDLukYLIClBVittmbF0Pa9t/15IoY4b54V+mxWLTEwGhEZqrn3M+L3RDRiA54DJcAZcO2OYhrPYUACoiHPvQQK2SCYcVhczV072/4xpbbErWRurHYel0hfo2+EY0N+pKGsEqs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564186; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/MPU0TKBYtEFG1xkEVwMxLJwA3rZpWlg2w7MDgOvBBA=; b=SUPcTiWdR/4AsUX/XqOm5xqiOnZySUQ3eVyDvhCI3v5LwOsNbHbARArzzNNDNdelkpZ3oVNwMYVCDHiCb7v8gFZFgw35jguQPrKZWadyqwTH+gk6OeAw56y6P4FIpFGlJ8pRYcMmp2e3QhAdd4c/R6z0WjEnojtHdx8/c57Ddms= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751564186504954.8558719630832; Thu, 3 Jul 2025 10:36:26 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1032359.1406047 (Exim 4.92) (envelope-from ) id 1uXNr5-0003nD-AG; Thu, 03 Jul 2025 17:36:15 +0000 Received: by outflank-mailman (output) from mailman id 1032359.1406047; Thu, 03 Jul 2025 17:36:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uXNr5-0003n3-6w; Thu, 03 Jul 2025 17:36:15 +0000 Received: by outflank-mailman (input) for mailman id 1032359; Thu, 03 Jul 2025 17:36:14 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uXNr4-00021t-LA for xen-devel@lists.xenproject.org; Thu, 03 Jul 2025 17:36:14 +0000 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [2a00:1450:4864:20::335]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 37512882-5834-11f0-a315-13f23c93f187; Thu, 03 Jul 2025 19:36:14 +0200 (CEST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-45363645a8eso893685e9.1 for ; Thu, 03 Jul 2025 10:36:13 -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-454a997de2asm32406255e9.12.2025.07.03.10.36.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:36:12 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 37512882-5834-11f0-a315-13f23c93f187 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564173; x=1752168973; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/MPU0TKBYtEFG1xkEVwMxLJwA3rZpWlg2w7MDgOvBBA=; b=YgvVKIxjOKCTJBZH4vdPaACJnHnS6twhmE42Hj6Hg+8Y/s9GsFfP4JnYXvm/z2TkH0 eR6CAD0X8Y1NI1c9BDItpf23HsPy3zRaPFwcCx8fBqht4qvQm+MV8ca3fY/7o7acC7yw Ykj0lqa5aLH+ou22HPZC03wq6RUbAbrnunIkWI0YtdeiuEoiBDJJo0QLooIEvMJbcoOr ZJcmCQ6PeiQ7EphAPRE9kj43ukvfiSNqfMiMGk50K/khixqH8AISbYvyhfqzIyuNnw6L Wy/JKHyKzjo8lkhbvLPVJqs2EgZ8nyPTdrz4JueuBmKL9ZyKT9MsTbUDVemLoX3rpMfp uHog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564173; x=1752168973; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/MPU0TKBYtEFG1xkEVwMxLJwA3rZpWlg2w7MDgOvBBA=; b=kps9/NOHFpzW5oeglriPLGr6fljbvwTitXDgQJOUDcNQT3wOrTIrWIAx2H0/jI5Ciu ivhuLIczqXI8WcoqnV6DcFBIM8mLwSyGcAKKdI2xyPqyAU2XjCB0qPJ5PnJfvYsPJs7k XbSpT73Mb6Ve4+eIL19aLJGxJ4JUJyCmefHgRMKatENnX1wKFM8r/UqRK1yGcpmxxjaj FqnWT6dYQnKxij4lnNZXn0eZlPanKS8r6iopjmZFKo35OLHtxqTMM6WTjjVI80Q8XfUi fybZjY61RjMT1/kS8+ljRLHq18Spo5eXHjHSakrFSk0wfFT4xjUPxrfAeAIEXExe9WEo AegQ== X-Forwarded-Encrypted: i=1; AJvYcCVS9EM/GJmn5B1lBCd4KBGa6aGcT2dPrXgNaHlFsXz4I9qHcbX/gYFiPA4fAuR22xHuXCCTvibJucY=@lists.xenproject.org X-Gm-Message-State: AOJu0YwLxwogLMHOXfbKvEV0tN1Wq6SS0Drjo4KD/j7iCDrsl6Owcn6g JaapJCJKApzbjBVPZfW6YNVRrBdXdP202RISzl0OibfYKOVqXSJMWHjlJby6RnnUdJk= X-Gm-Gg: ASbGnctR4MBO/5cEU99mTFxRUIeB1opzRzMkk67SgUEe9c+e5AqIjV/iogSwstxrdiP 9ShlnQS4IznMjH/r0fzW5GOo9yNxH1RJ3I7zMWAGn00NUADDQbZQfn7Wqb/6lufMrPOJLEF1D4l fBwM389sbAdCcQykRr18dNeAa/9Q50I/VCdYYBmV7w0zjWITakulqReOxsAeW3HCtZ0vv3Vv92X Iq/NkYSrZxfdcp5m63T8LNNMnDM7nf+/mONWqQeyl+nz30M8+2wBMVHudX31lDaPA6UQIP4ct1a XdeJEvWYxtaiSiA32W/WedUSGmZ7Gx42KBNotCjdoRLN0sIODu0VRH9YyJDTZ7M6QSwUCM79//U uA3Tu26h5pNpbU2L655sfSn573n/m8GyATgH7 X-Google-Smtp-Source: AGHT+IF1KdJk6c4ueSnjnRty/oc46EojwVkf/EW5AwRmuKQECJq5AW7BgV+yFnxaCbwEOJm8eBUtQQ== X-Received: by 2002:a05:600c:c8f:b0:453:9bf:6f79 with SMTP id 5b1f17b1804b1-454a9cd69d9mr43963695e9.26.1751564173127; Thu, 03 Jul 2025 10:36:13 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Phil Dennis-Jordan , Mads Ynddal , Fabiano Rosas , Laurent Vivier , Stefano Stabellini , Anthony PERARD , Paul Durrant , "Edgar E. Iglesias" , Reinoud Zandijk , Sunil Muthuswamy , kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v6 37/39] accel: Rename 'system/accel-ops.h' -> 'accel/accel-cpu-ops.h' Date: Thu, 3 Jul 2025 19:32:43 +0200 Message-ID: <20250703173248.44995-38-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1751564187809116600 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: Richard Henderson Reviewed-by: Zhao Liu --- include/{system/accel-ops.h =3D> accel/accel-cpu-ops.h} | 8 ++++---- accel/accel-common.c | 2 +- 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 +- 13 files changed, 16 insertions(+), 16 deletions(-) rename include/{system/accel-ops.h =3D> accel/accel-cpu-ops.h} (96%) diff --git a/include/system/accel-ops.h b/include/accel/accel-cpu-ops.h similarity index 96% rename from include/system/accel-ops.h rename to include/accel/accel-cpu-ops.h index 17c80887016..a045d7c5d4a 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 ACCEL_CPU_OPS_H +#define ACCEL_CPU_OPS_H =20 #include "qemu/accel.h" #include "exec/vaddr.h" @@ -88,4 +88,4 @@ struct AccelOpsClass { =20 void generic_handle_interrupt(CPUState *cpu, int old_mask, int new_mask); =20 -#endif /* ACCEL_OPS_H */ +#endif /* ACCEL_CPU_OPS_H */ diff --git a/accel/accel-common.c b/accel/accel-common.c index b3fbe3216aa..b490612447b 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "qemu/accel.h" #include "qemu/target-info.h" -#include "system/accel-ops.h" +#include "accel/accel-cpu-ops.h" #include "accel/accel-cpu.h" #include "accel-internal.h" =20 diff --git a/accel/accel-system.c b/accel/accel-system.c index 637e2390f35..451567e1a50 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 a0248942f3a..b13937b29e1 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 2a744092749..2c8f4fecb17 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 bc809ad5640..8f071d2cfeb 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 03934deed49..1c48915b6a5 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -20,7 +20,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 f90b8be9eee..dae66a1bc4d 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 31cf15f0045..2b51b35bfa6 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 Dec 13 22:55:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1751564471; cv=none; d=zohomail.com; s=zohoarc; b=HKB/DoB2T9/2kuGGEd6xVjzDCQpNBRmwSczuiKPG2yVBNboJjW2//xjqEO1LuF4Qd77wvYtatPS5hlLe0tdDrPuGy41ob+sY0I+p5l/wZ9vkKX5Zg1fWhQjy+Kup6u9A68Max7jaVT56vOfddDEXewAjU5+/mnEoGUEQ5Dxpc/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564471; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5E/SAxbdiV3TRF5Yfo8PH+PsmR3gvFEsRHLctVVyuPU=; b=E3HMf2joTV2+FwjjzVpu9Y5/Exxov69pasvM1ia2TGHIRoQt3Z0+2QsftPbrb9CQ2qa3sd9ajEquIYzC8t2fLHORFOIq3K2VDNRSwIL/jfEdKIbou9vy4XKyc/753cl+KzqFKsfqVSO6E4JxeYexRXr6ZUdesfnGEmfaT3DV4Oc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751564471304750.6206016663921; Thu, 3 Jul 2025 10:41:11 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1032376.1406057 (Exim 4.92) (envelope-from ) id 1uXNvY-0005xa-QO; Thu, 03 Jul 2025 17:40:52 +0000 Received: by outflank-mailman (output) from mailman id 1032376.1406057; Thu, 03 Jul 2025 17:40:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uXNvY-0005xT-Nb; Thu, 03 Jul 2025 17:40:52 +0000 Received: by outflank-mailman (input) for mailman id 1032376; Thu, 03 Jul 2025 17:40:51 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uXNrB-0001VU-Sh for xen-devel@lists.xenproject.org; Thu, 03 Jul 2025 17:36:21 +0000 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [2a00:1450:4864:20::32d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3ad89c75-5834-11f0-b894-0df219b8e170; Thu, 03 Jul 2025 19:36:19 +0200 (CEST) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-45310223677so868765e9.0 for ; Thu, 03 Jul 2025 10:36:19 -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-454a997e367sm32057155e9.15.2025.07.03.10.36.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:36:18 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3ad89c75-5834-11f0-b894-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564179; x=1752168979; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5E/SAxbdiV3TRF5Yfo8PH+PsmR3gvFEsRHLctVVyuPU=; b=emqZIHr1HR3s9Nu+r3VyDkHHlFgaXx/VFNpweR5zCvSXY7TxazCrHoMzONlPaQQnko PBmuHACWAdqUdh8KnyXWxquDPglbP++dszh9D+GakN9ciA90vPNmOYvIKGPirCZEg1Jx jwWDZ/mnkTojfWXZ7Maog3wXF8LpXFe3yICi9sJ+IIF5c7osH5hmzVL48q8i1cGFFkHS QPqoWPl0rK7bc8EfBqQijeT4jwjxu2VGebIm4wr3ZAquWblAJHgvWIzWmJJS9Mn57S8d YqHAjYdYPo22AjJv19WkUkyzLknecsoy66H4acJ4zynI0Ao4Us2lD24DSDrkM98oOx4w Vmrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564179; x=1752168979; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5E/SAxbdiV3TRF5Yfo8PH+PsmR3gvFEsRHLctVVyuPU=; b=wbhnV8VW5aGyECRnBvQZDHWV+mUdd6bDRWyMDFJPpfGapP1y02NTxbrH4Mt/avZQQJ Z4VhUfGyZiJ5WYoi1kT3xKHR4pnC/noha6LDnnw7q9TSPlyl0/xJjVlpNRvfwvAVDkVb 0ddtPOXXOVyklQxOmKQNzf/24pFzt5j7oZ0+1bQVXe4iPOaYGlvazCBaWYOl7r49AKKd VYAzbmRAcnJoo9l7AKNf0DLwJX2aTHxyCzYJhcC7goC0tiukBHtjPmQTNtsUxr8HAfXI 7LVsszMx/kOv8vHosKaY61RZoiMqxElM+L4gR2VAKvSvvtVz3O5XPb34idbYwEBHQbv3 hWPw== X-Forwarded-Encrypted: i=1; AJvYcCVSkMK7gTDBvlkc0lvilba1CjCOpcWdv6VOaWdkh0j5Hx3n8q1ciBhDgLGau+9D9XryWe2mumxntpU=@lists.xenproject.org X-Gm-Message-State: AOJu0YwSwT28g0xKiAfHeXXcuiqDbkMvBIVAuLRhr5ZBPJ+qpBRKDxJd D8QqZBC4X9X+5JGXygj96QHKWB44B4QDbYEtj2DdUHMS6dQLBUIFsxS/gyXJV9PCzdA= X-Gm-Gg: ASbGncvfZ7w3WAKuOR3pDoJ7VNIKcdWe6Jw0Di85XnEajR/rkxFCUF8gsxmjDVw4s7i u7DYr4YVqw/YeOzySuHvv8+9xppBkd62eiLkxKxjP3+Bxgm72Td81gEpn6jJ0hf2IUKVpVMbcB0 ZUQV7bfnFOxsguxWT75b4V0StsFZ5uqd1wEnIcLxn428/Ptplr+rE9YxqmUQGnVMWI/eROZ1s6y PpuUir5pTERCq35Uw6QVMql+gslPsdjn20AOwbl9C0Od/fp2N9LRMcWCdyY5M66aq1z4950ml8X WFWpmVffvtrcA1FanIAwmE0hGPFVCJM9wHERESOw1AIZLLNBBa8kubgpZvBSCxphTRs6Z67EqFQ r3+gjdBPeg/62M+mtlQT1a0MzIWxKUNhSjGaG X-Google-Smtp-Source: AGHT+IGYkuYIeLocc6dsLio4WRAhQTPLG5g0dI2lw9ZYqsX2Hf52uwkNyyuJTdB+GW55XoGAazaZvQ== X-Received: by 2002:a05:600c:4e8b:b0:443:48:66d2 with SMTP id 5b1f17b1804b1-454a3704fc7mr101594355e9.16.1751564179105; Thu, 03 Jul 2025 10:36:19 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Phil Dennis-Jordan , Mads Ynddal , Fabiano Rosas , Laurent Vivier , Stefano Stabellini , Anthony PERARD , Paul Durrant , "Edgar E. Iglesias" , Warner Losh , Kyle Evans , Peter Xu , David Hildenbrand , Reinoud Zandijk , Sunil Muthuswamy , kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v6 38/39] accel: Extract AccelClass definition to 'accel/accel-ops.h' Date: Thu, 3 Jul 2025 19:32:44 +0200 Message-ID: <20250703173248.44995-39-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1751564473551116600 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: Richard Henderson Reviewed-by: Zhao Liu --- MAINTAINERS | 2 +- include/accel/accel-ops.h | 50 +++++++++++++++++++++++++++++++++++++ include/qemu/accel.h | 40 ++--------------------------- include/system/hvf_int.h | 3 ++- include/system/kvm_int.h | 1 + accel/accel-common.c | 1 + 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 | 1 + 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, 70 insertions(+), 40 deletions(-) create mode 100644 include/accel/accel-ops.h diff --git a/MAINTAINERS b/MAINTAINERS index 37d02b2313c..e3e08d4607f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -501,7 +501,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..35e7d4c3b26 --- /dev/null +++ b/include/accel/accel-ops.h @@ -0,0 +1,50 @@ +/* + * 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); + bool (*has_memory)(AccelState *accel, AddressSpace *as, + hwaddr start_addr, hwaddr size); + bool (*cpus_are_resettable)(AccelState *as); + + /* gdbstub related hooks */ + bool (*supports_guest_debug)(AccelState *as); + 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 3c6350d6d63..71293a3e2a9 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -26,44 +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); - bool (*has_memory)(AccelState *accel, AddressSpace *as, - hwaddr start_addr, hwaddr size); - bool (*cpus_are_resettable)(AccelState *as); - - /* gdbstub related hooks */ - bool (*supports_guest_debug)(AccelState *as); - 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 ecc49a309cf..8a443af3454 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 b490612447b..de2504e435e 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -10,6 +10,7 @@ #include "qemu/osdep.h" #include "qemu/accel.h" #include "qemu/target-info.h" +#include "accel/accel-ops.h" #include "accel/accel-cpu-ops.h" #include "accel/accel-cpu.h" #include "accel-internal.h" diff --git a/accel/accel-system.c b/accel/accel-system.c index 451567e1a50..bce03c9ddeb 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 4fae4c79805..11514533a84 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 9d1dc56d7e8..683116f68ff 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 8f071d2cfeb..20802e24d46 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 93972bc0919..829a7293b80 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -39,6 +39,7 @@ #ifndef CONFIG_USER_ONLY #include "hw/boards.h" #endif +#include "accel/accel-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 1c48915b6a5..11870a1585f 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -20,6 +20,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 a9142ee7268..254cf2526a8 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 b072a6bef83..13e833851a6 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 721c4782b9c..2a90cde6d50 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 Dec 13 22:55:08 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=1751564629; cv=none; d=zohomail.com; s=zohoarc; b=fNoN475UzoH9sr9LG5IKmIZTmFIu33DwJR2NacteMX2BFYXI7gBnuSLACLpJ2wQOcDbAHT5cKbcHFpZCR/OVwx1Wtflr6/DVrwKzPsbVDnh0dMMiIK/6S+uSDtua/ezALECr3ypHFGAMvTQJkvUjt8+rCFVZ0G9eVKg8Q4Vi2Ww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751564629; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gnRok8P1GZORflX5U1xcTlyERslFmJh/V5NQp10XCjE=; b=B+M9bc8EywbUR6srBshL3eXEIIGcgxJYTCwQnIch+zWueJNBc18cuoXr6ZF6DwU9xhbxqS1GuxUfpElpQwOTOVT4KS4nPLUc/dL5wJ5RO2qUWHoHyS+aLp650Ldns+ZVHhjzMBk5gR8wBLIiVkbUq1ATjp2jLisLiEi/2rxF9bU= 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 1751564629534353.3909267662201; Thu, 3 Jul 2025 10:43:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uXNrQ-0001gr-HP; Thu, 03 Jul 2025 13:36:37 -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 1uXNrH-0001WP-Ti for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:36:30 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uXNrG-0001uX-7J for qemu-devel@nongnu.org; Thu, 03 Jul 2025 13:36:27 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4530921461aso1053435e9.0 for ; Thu, 03 Jul 2025 10:36: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 5b1f17b1804b1-454a997b492sm32407175e9.13.2025.07.03.10.36.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Jul 2025 10:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751564184; x=1752168984; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gnRok8P1GZORflX5U1xcTlyERslFmJh/V5NQp10XCjE=; b=vip2fofLG2oL10kpuEaWJ8FbbQFC9AyQUthcULC3xC4WWisf/EajSiFoZmTo5BwKyI olQfWryjvhMyHn+7ZBHA0JXyFueLsjjyfz4iZnqEbWLvKxxgNkesbzSjnPj6EK717dgH EPRj5Av8E7zetU3scda5ivpp+iR15B5FkolGKVzoHd9BlQug2IX2FFPWta7CxvC+Iwty 33f6hb/txxUBGZr3Ue3/KkODTYavJrWzMcsdZ88ceBszi8e9sUahohKSruBDDcImrOxR GZ5v2uZcYiKClSl5vMM/MCPyKLGdXq20PZFELOf9qynE8QgUGC/LpkuhOX4yJJ1KGkhw PNtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751564184; x=1752168984; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gnRok8P1GZORflX5U1xcTlyERslFmJh/V5NQp10XCjE=; b=ijdh0sNE1GC0P/nQprd55zlo3vEBFJGyV/hoOHG6AEKGLANfo6W9Y0dTYUCSNdL/gH /QzuV6HifzttI4l4qCQMn2pi2tPO6Y9dc3pItitR3lwSuk4MTr2LalNK8USrIoCvtC9B PG/o0pfHrkxWkdfbTkLFhwdYtbCQOHEhkUqOWd1TIQGmeEOqgkZaysOdtpZUkza4W4yR FbGuQ2NjFCfG3tFMQO2tCGDzt5rrz/NVRtDIYY6hMGDZmZHxdO15dp3ngFONki3ZvAAU YqBZtwxJARnvLrVsasIvQyBmlGTpKvwkm0bx6ATH5nQ992OPDZtjrRU7l1dNL3iyJ85d Pesw== X-Gm-Message-State: AOJu0YxU47QWLcmo+F/MPOnfe1w4rjF0TfK44nfUPm6L8p+69aw+xEE4 ZnDWxt5MMdhBKR4dYtktVroeT4XuVimSVhAokarML1XSGebKb2LyaK4wsPyw774i33MLnioCvtm 3gDwQx5U= X-Gm-Gg: ASbGncsCE586GDBsW3OWX4GPmjBKwrsGCjuSKpUYqbov3fkhH2zEagtCh10fYffQsBz nUBH8SxdBI+0TMdPX19NZbtrahppvUDTCyKYPwacAu1s4bQgjXZnxgrKHD5HvOqAF6xtMfGERa6 TUMmPFcVvibsTYNpa+20lCb/mzCp9YKo7BLRauucH2M5263pPxVW5wtIO1wg7cppylWH5hlk+tH Z94LvgfzbMpjx4/rPTz1dkNdxInWKa6zAZTvXYNZH6xLtwC4rsWJ69pJbATiRZYy8YPi5tVFeap 3uRkJ4F2HbvGPINCVKD6+LnKCFQLL0vCWcjyGv2p4M2qplAR8i0n+wBwhojAX2KwQUtL1oXJ5Zi wuHQMk5xx2k+jJncJiJkMk+HSL4i+UEAUe11P X-Google-Smtp-Source: AGHT+IHqzIqBa/MN4R9Ht+M1b9yL2m4HQ3sMz0FjF3tQ+fZTXi/VewkUnXtw8KNc2E7SJL5j64qIRQ== X-Received: by 2002:a05:6000:2b10:b0:3b2:ef53:5818 with SMTP id ffacd0b85a97d-3b32c56dce7mr2910128f8f.5.1751564183961; Thu, 03 Jul 2025 10:36:23 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 39/39] MAINTAINERS: Add me as reviewer of overall accelerators section Date: Thu, 3 Jul 2025 19:32:45 +0200 Message-ID: <20250703173248.44995-40-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703173248.44995-1-philmd@linaro.org> References: <20250703173248.44995-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::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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: 1751564630816116600 I'd like to be informed of overall changes of accelerators. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index e3e08d4607f..a8bf3f9ccfa 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -495,6 +495,7 @@ Guest CPU Cores (other accelerators) Overall M: Richard Henderson R: Paolo Bonzini +M: Philippe Mathieu-Daud=C3=A9 S: Maintained F: include/exec/cpu*.h F: include/exec/target_long.h --=20 2.49.0