From patchwork Fri May 3 09:16:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13652538 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4ADCC4345F for ; Fri, 3 May 2024 09:18:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2p2W-0001gK-TY; Fri, 03 May 2024 05:17: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 1s2p2T-0001fo-QK for qemu-devel@nongnu.org; Fri, 03 May 2024 05:17:10 -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 1s2p2S-0003W2-1s for qemu-devel@nongnu.org; Fri, 03 May 2024 05:17:09 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-41c7ac73fddso47135005e9.3 for ; Fri, 03 May 2024 02:17:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714727826; x=1715332626; 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=PjIC0hzeanG/udtndv7wQlWjrcv140/3TttCqxYBKio=; b=vyAsJSFdzRAB59KiGFBTE1CgT6NAo+7hWEYTEt+7+xJcGa/egpYRQs6ZUiK78nmC9A nHMKPgaap9PS6wNbTMtfePZ8+C/NgrSab8MseYZKVQl3TLgiW/rfLBVvLZ76fvi1rd91 B0wBHQRY5TV4mFfrRLXjhfO2qRvJgPfGQ5gHnmZTsy3dtjWmWDj7/EStihuBELz+26HQ Imei76ghl/CYBEgUPNUFjA0S1BbP7wghyc0pLcG+6A1Aw3Cx43hCGjSZDfZQabL5pNwc ueQ3xlcu6O2R6/5/UIqx6Btcdfnnr+dYtH9WHhYxMiffhh2AZD0bfDZTy6I1AG9vuoVi ydLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714727826; x=1715332626; 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=PjIC0hzeanG/udtndv7wQlWjrcv140/3TttCqxYBKio=; b=b20RYfTXBqx1rNcFE1rTW/ErHpxHqnBhlRpCq+rp1Ew1y7PM+01XiB77cwlVhOPDtS akazTXB+pZnH+C58fe/ynYJGkvF2p/v3JZcTqF/541omiJlw72Evg7FE6Y/gRiUepbID km4q9CkhX+baztTYkNx7zHz9EnwkRD3S8c2vWpOrLZIRNk7ElomO1hJQVW2wZAfGpC2M VgCi029z8xbfm9O8weA4qBzF0xeH/OOlitKpkpWQpoMypsdbyq0mlFd7g90wGeouv9Mk Qka0kbl51FuhurTyfvgFZC/7WToVUXdcBRkyT3CZGIjDv2ApAksDMzP2Pj5QlxSBReB/ BZwQ== X-Gm-Message-State: AOJu0Yy9J2VIRjZvPs0yUYvZhr4M9KhqwOrXDax4HMZnPeq1Fi4PmHh1 R/VoHq6PqylnmXUrS04EhFaCj5+nvZbX9xiQ8Ut+KfHOMCMFE3oPoYEgPqmqX01XgJ+MA4wV044 / X-Google-Smtp-Source: AGHT+IG/FFyoXSUNl/gadz+vDS7gFr30tHUVXGHIG9FXGx7e4jbsodR7p3jqV8YChuy9T1TddUipaA== X-Received: by 2002:a05:600c:1d0a:b0:41b:fa34:9e48 with SMTP id l10-20020a05600c1d0a00b0041bfa349e48mr2099286wms.30.1714727825926; Fri, 03 May 2024 02:17:05 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id p9-20020a05600c1d8900b0041563096e15sm8721875wms.5.2024.05.03.02.17.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 02:17:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Warner Losh , Paolo Bonzini , Laurent Vivier , Riku Voipio , Kyle Evans , Ilya Leoshkevich , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 1/5] accel/tcg: Simplify meson.build using subdir_done() Date: Fri, 3 May 2024 11:16:53 +0200 Message-ID: <20240503091657.26468-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503091657.26468-1-philmd@linaro.org> References: <20240503091657.26468-1-philmd@linaro.org> MIME-Version: 1.0 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org If CONFIG_TCG is not defined, skip this directory calling subdir_done(). Then since we know CONFIG_TCG is defined, we don't need to check for it. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/meson.build | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index aef80de967..f40959436e 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -1,8 +1,11 @@ -common_ss.add(when: 'CONFIG_TCG', if_true: files( +if not config_all_accel.has_key('CONFIG_TCG') + subdir_done() +endif + +common_ss.add(files( 'cpu-exec-common.c', )) -tcg_specific_ss = ss.source_set() -tcg_specific_ss.add(files( +specific_ss.add(files( 'tcg-all.c', 'cpu-exec.c', 'tb-maint.c', @@ -11,24 +14,23 @@ tcg_specific_ss.add(files( 'translate-all.c', 'translator.c', )) -tcg_specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c')) -tcg_specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('user-exec-stub.c')) +specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c')) +specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('user-exec-stub.c')) if get_option('plugins') - tcg_specific_ss.add(files('plugin-gen.c')) + specific_ss.add(files('plugin-gen.c')) endif -specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_specific_ss) -specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( +specific_ss.add(when: ['CONFIG_SYSTEM_ONLY'], if_true: files( 'cputlb.c', 'watchpoint.c', )) -system_ss.add(when: ['CONFIG_TCG'], if_true: files( +system_ss.add(files( 'icount-common.c', 'monitor.c', )) -tcg_module_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( +tcg_module_ss.add(when: ['CONFIG_SYSTEM_ONLY'], if_true: files( 'tcg-accel-ops.c', 'tcg-accel-ops-mttcg.c', 'tcg-accel-ops-icount.c', From patchwork Fri May 3 09:16:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13652541 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71F4DC4345F for ; Fri, 3 May 2024 09:18:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2p2b-0001h6-6O; Fri, 03 May 2024 05:17:17 -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 1s2p2Z-0001gr-FI for qemu-devel@nongnu.org; Fri, 03 May 2024 05:17:15 -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 1s2p2X-0003ZV-Ir for qemu-devel@nongnu.org; Fri, 03 May 2024 05:17:15 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-41bab13ca4eso47913325e9.1 for ; Fri, 03 May 2024 02:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714727831; x=1715332631; 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=1/nrhpPctNIFKbTVUUpB8iSj1laj4YlC2viiNoCursk=; b=CWddUIEsDjkjJn/C7tFITvsJvhbVTwmpRy1MdbpZMX19W5vghItn59iOjZjF0O3s7Q ihIfCX8PSPvTkQkNCNEARSWIXKEsM4ik8A01UoGSslC85CY6KYiTtZhpz+Nrbo+bfTF1 OMpIKTVl0lBsHk6uVyaOCmbp49DtSJ0lMfAe34NE/3nQqM3qO+wG0QjW6wK2aU311ocM 3pBVHQW+1V4ZlYbxxPGMJLrbb8MabJtupV4m3msCDMiLnWr92d+/w2nclKNpvp14f8xV eaKW9vc3vakyVZDH2S2siwvQfNbSvbKUCZT4lspF4MOB1XcFFE6uRCerdGsBHhv2ceDI EQYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714727831; x=1715332631; 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=1/nrhpPctNIFKbTVUUpB8iSj1laj4YlC2viiNoCursk=; b=tP8mBrfFxzKcRy3rHtvn3fAo6Svn4bbL5NpsiLCydSkzsnXiQBkYmKi6sO8cy5E1aW vp/GbxeYFsHD7H0akF256/GYcDOy4i/jXm3OkKvf+3pYC//Pxh4W8smxOhekFzMwtRsQ C6ywcrlh8sEbQHzNzLs1g/GQ5eY7jrlLhRcPkY/WZDCwkNy2qi5dNI+fuu61OnWocyQa oajlYpFRyAFBM6H0XYJzxweJ5S4cC/PIDr6UPDTktOHBvCL+Jua2Td1qiSyKVr8TSm8R Sc+Y+ii6wBg0ntUPfDFL6NnaE0j1avLjknM/kfp5LEg9ag9/hb4CJbnFWgPINKRdq65Q Z4Iw== X-Gm-Message-State: AOJu0Yz2Iy2IrndwZYo5ow63Nxe5ghlRmZCW6Gj5TEIaH5dn3OLfJ9oX DaJjDaZ2jOlKYbTaA5qqYjkZKbeo364FoiTqP2ChpdKfnEh/U+kQpVBJT8VNTnumif1jia1AbuJ o X-Google-Smtp-Source: AGHT+IFhMFavlVYSQdlv0sePo5k2M3EhmwgnCeQeIZNBxg4ry9OwgJVPIy/Qax4P7lKC8rhSmdQyRw== X-Received: by 2002:a05:600c:4505:b0:41a:a08f:2696 with SMTP id t5-20020a05600c450500b0041aa08f2696mr1765123wmo.12.1714727831576; Fri, 03 May 2024 02:17:11 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id t1-20020a05600001c100b0034e0a3a9e14sm3273731wrx.75.2024.05.03.02.17.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 02:17:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Warner Losh , Paolo Bonzini , Laurent Vivier , Riku Voipio , Kyle Evans , Ilya Leoshkevich , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 2/5] accel/tcg: Move system emulation files under sysemu/ subdirectory Date: Fri, 3 May 2024 11:16:54 +0200 Message-ID: <20240503091657.26468-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503091657.26468-1-philmd@linaro.org> References: <20240503091657.26468-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Some files are specific to system emulation. Move them under their own sysemu/ directory. This might help to notice what is affected (user, system or both) when doing global refactors. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/{ => sysemu}/tcg-accel-ops-icount.h | 0 accel/tcg/{ => sysemu}/tcg-accel-ops-mttcg.h | 0 accel/tcg/{ => sysemu}/tcg-accel-ops-rr.h | 0 accel/tcg/{ => sysemu}/tcg-accel-ops.h | 0 accel/tcg/{ => sysemu}/icount-common.c | 0 accel/tcg/{ => sysemu}/monitor.c | 4 ++-- accel/tcg/{ => sysemu}/tcg-accel-ops-icount.c | 0 accel/tcg/{ => sysemu}/tcg-accel-ops-mttcg.c | 0 accel/tcg/{ => sysemu}/tcg-accel-ops-rr.c | 0 accel/tcg/{ => sysemu}/tcg-accel-ops.c | 0 accel/tcg/meson.build | 14 ++------------ accel/tcg/sysemu/meson.build | 11 +++++++++++ 12 files changed, 15 insertions(+), 14 deletions(-) rename accel/tcg/{ => sysemu}/tcg-accel-ops-icount.h (100%) rename accel/tcg/{ => sysemu}/tcg-accel-ops-mttcg.h (100%) rename accel/tcg/{ => sysemu}/tcg-accel-ops-rr.h (100%) rename accel/tcg/{ => sysemu}/tcg-accel-ops.h (100%) rename accel/tcg/{ => sysemu}/icount-common.c (100%) rename accel/tcg/{ => sysemu}/monitor.c (99%) rename accel/tcg/{ => sysemu}/tcg-accel-ops-icount.c (100%) rename accel/tcg/{ => sysemu}/tcg-accel-ops-mttcg.c (100%) rename accel/tcg/{ => sysemu}/tcg-accel-ops-rr.c (100%) rename accel/tcg/{ => sysemu}/tcg-accel-ops.c (100%) create mode 100644 accel/tcg/sysemu/meson.build diff --git a/accel/tcg/tcg-accel-ops-icount.h b/accel/tcg/sysemu/tcg-accel-ops-icount.h similarity index 100% rename from accel/tcg/tcg-accel-ops-icount.h rename to accel/tcg/sysemu/tcg-accel-ops-icount.h diff --git a/accel/tcg/tcg-accel-ops-mttcg.h b/accel/tcg/sysemu/tcg-accel-ops-mttcg.h similarity index 100% rename from accel/tcg/tcg-accel-ops-mttcg.h rename to accel/tcg/sysemu/tcg-accel-ops-mttcg.h diff --git a/accel/tcg/tcg-accel-ops-rr.h b/accel/tcg/sysemu/tcg-accel-ops-rr.h similarity index 100% rename from accel/tcg/tcg-accel-ops-rr.h rename to accel/tcg/sysemu/tcg-accel-ops-rr.h diff --git a/accel/tcg/tcg-accel-ops.h b/accel/tcg/sysemu/tcg-accel-ops.h similarity index 100% rename from accel/tcg/tcg-accel-ops.h rename to accel/tcg/sysemu/tcg-accel-ops.h diff --git a/accel/tcg/icount-common.c b/accel/tcg/sysemu/icount-common.c similarity index 100% rename from accel/tcg/icount-common.c rename to accel/tcg/sysemu/icount-common.c diff --git a/accel/tcg/monitor.c b/accel/tcg/sysemu/monitor.c similarity index 99% rename from accel/tcg/monitor.c rename to accel/tcg/sysemu/monitor.c index 093efe9714..620c18d267 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/sysemu/monitor.c @@ -17,8 +17,8 @@ #include "sysemu/cpu-timers.h" #include "sysemu/tcg.h" #include "tcg/tcg.h" -#include "internal-common.h" -#include "tb-context.h" +#include "../internal-common.h" +#include "../tb-context.h" static void dump_drift_info(GString *buf) diff --git a/accel/tcg/tcg-accel-ops-icount.c b/accel/tcg/sysemu/tcg-accel-ops-icount.c similarity index 100% rename from accel/tcg/tcg-accel-ops-icount.c rename to accel/tcg/sysemu/tcg-accel-ops-icount.c diff --git a/accel/tcg/tcg-accel-ops-mttcg.c b/accel/tcg/sysemu/tcg-accel-ops-mttcg.c similarity index 100% rename from accel/tcg/tcg-accel-ops-mttcg.c rename to accel/tcg/sysemu/tcg-accel-ops-mttcg.c diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/sysemu/tcg-accel-ops-rr.c similarity index 100% rename from accel/tcg/tcg-accel-ops-rr.c rename to accel/tcg/sysemu/tcg-accel-ops-rr.c diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/sysemu/tcg-accel-ops.c similarity index 100% rename from accel/tcg/tcg-accel-ops.c rename to accel/tcg/sysemu/tcg-accel-ops.c diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index f40959436e..8d263a71cd 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -20,19 +20,9 @@ if get_option('plugins') specific_ss.add(files('plugin-gen.c')) endif -specific_ss.add(when: ['CONFIG_SYSTEM_ONLY'], if_true: files( +specific_ss.add(when: ['CONFIG_SYSTEM_ONLY'], if_true: files( # SOFTMMU 'cputlb.c', 'watchpoint.c', )) -system_ss.add(files( - 'icount-common.c', - 'monitor.c', -)) - -tcg_module_ss.add(when: ['CONFIG_SYSTEM_ONLY'], if_true: files( - 'tcg-accel-ops.c', - 'tcg-accel-ops-mttcg.c', - 'tcg-accel-ops-icount.c', - 'tcg-accel-ops-rr.c', -)) +subdir('sysemu') diff --git a/accel/tcg/sysemu/meson.build b/accel/tcg/sysemu/meson.build new file mode 100644 index 0000000000..d0b4939ba9 --- /dev/null +++ b/accel/tcg/sysemu/meson.build @@ -0,0 +1,11 @@ +system_ss.add(files( + 'icount-common.c', + 'monitor.c', +)) + +tcg_module_ss.add(when: ['CONFIG_SYSTEM_ONLY'], if_true: files( + 'tcg-accel-ops.c', + 'tcg-accel-ops-mttcg.c', + 'tcg-accel-ops-icount.c', + 'tcg-accel-ops-rr.c', +)) From patchwork Fri May 3 09:16:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13652540 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 51FBCC25B4F for ; Fri, 3 May 2024 09:18:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2p2h-0001hv-9X; Fri, 03 May 2024 05:17: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 1s2p2e-0001hY-4h for qemu-devel@nongnu.org; Fri, 03 May 2024 05:17:20 -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 1s2p2c-0003aM-K5 for qemu-devel@nongnu.org; Fri, 03 May 2024 05:17:19 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-41b5dd5af48so63880165e9.0 for ; Fri, 03 May 2024 02:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714727837; x=1715332637; 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=b8DwnhcqDdYLqJv6uh/ywG6qW/XlS7dFgSw/LzDaIEU=; b=JGWtKHlHW3G7TlKBdB1wnjwifucetiaBr8ST0mZfmhrdDjhzo5/gLwEqbCHguZKtdD zIjspNbo8OKSRfZHHx04ywMjC94r4CC2p6+mk1FZiU4fpM2kx23RQg4JJfcaryBkCAqQ pvcQSpRG/LIjABVxOydCtaExbRwCbe2QSzJ5EuL3jAlbnkSexbEYq2dV4wQyQW7RXHpt 7ErwkLj1q0nl4IiM3Dx+2VA6h98noBWFY1gKLbtyOfyw9BW9AWD/m6u5ZXyBHqs1aU3o PVQHglDpi7IYeI+aXFshwSKNaVvd87X+UAbF7/Rc6Q//8j/pXQ1uizo+MoTxUVPmLZO2 xkTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714727837; x=1715332637; 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=b8DwnhcqDdYLqJv6uh/ywG6qW/XlS7dFgSw/LzDaIEU=; b=n1VZSgQ38TAqZJGt5DZBTldXCAhmFX6FrauPQvDj1acnD7fT2Iybg/aMIGXz3Np4Xh 2aNe5+nElPFLzwsmuTGXUUSLjwYuAx1nIhH43icXDnSyYvDd3i8Zr3yA4vxYn1buomcL 2NapzXqJbGm0jprEDs7oebVix3vmM46EKQj3G7B6tkQEaHVrTj/OaHQetopkJBQVhr4S dg0TKE9x/wmpavLb1Dasp3q50EGixF128Zfw9s1l3igwKtobM/bUFsK4YQdVvuPoPNq1 zF5wvtFVr5UHnJqCBot8cKEuWctDBMbL7Ko860Uee9qSskYoJfU19QgjveeaJ61Qe2MU tylA== X-Gm-Message-State: AOJu0YxftHyJUzRJpRkFuJjKQE3M/tYo6d3wHXSKVSfPvr+QNLys3PpS dOUl/w6DmMBltroylBl8soeoyRQdyPY2S04QUyIQqZS7fobWZnReLqdunalfFrDiE5/iLaSwIB6 s X-Google-Smtp-Source: AGHT+IHibdFYFzUM3tCnTMBN3FzT5eHj6ak13Triqjj8pOwwoHrzAuumP7GpRpdo+l7l/Pmlur4hcQ== X-Received: by 2002:a05:600c:1c09:b0:41a:a4d1:a896 with SMTP id j9-20020a05600c1c0900b0041aa4d1a896mr1749656wms.16.1714727837029; Fri, 03 May 2024 02:17:17 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c478600b004185be4baefsm6847025wmo.0.2024.05.03.02.17.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 02:17:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Warner Losh , Paolo Bonzini , Laurent Vivier , Riku Voipio , Kyle Evans , Ilya Leoshkevich , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 3/5] accel/tcg: Do not define cpu_exec_reset_hold() as stub Date: Fri, 3 May 2024 11:16:55 +0200 Message-ID: <20240503091657.26468-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503091657.26468-1-philmd@linaro.org> References: <20240503091657.26468-1-philmd@linaro.org> MIME-Version: 1.0 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org In commit 1b5120d74b ("accel: Introduce cpu_exec_reset_hold()") we defined the user emulation backend cpu_exec_reset_hold() as a stub. This was a mistake, since common fields are set in CPU reset, and user emulation needs these fields to be resetted. Move cpu_exec_reset_hold() back. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/user-exec-stub.c | 4 ---- accel/tcg/user-exec.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/user-exec-stub.c b/accel/tcg/user-exec-stub.c index 4fbe2dbdc8..2dc6fd9c4e 100644 --- a/accel/tcg/user-exec-stub.c +++ b/accel/tcg/user-exec-stub.c @@ -14,10 +14,6 @@ void qemu_init_vcpu(CPUState *cpu) { } -void cpu_exec_reset_hold(CPUState *cpu) -{ -} - /* User mode emulation does not support record/replay yet. */ bool replay_exception(void) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 1c621477ad..6a108eb212 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -37,6 +37,10 @@ __thread uintptr_t helper_retaddr; //#define DEBUG_SIGNAL +void cpu_exec_reset_hold(CPUState *cpu) +{ +} + /* * Adjust the pc to pass to cpu_restore_state; return the memop type. */ From patchwork Fri May 3 09:16:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13652539 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0A907C4345F for ; Fri, 3 May 2024 09:18:25 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2p2m-0001ih-7E; Fri, 03 May 2024 05:17:28 -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 1s2p2k-0001iX-Pd for qemu-devel@nongnu.org; Fri, 03 May 2024 05:17:26 -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 1s2p2j-0003ak-5x for qemu-devel@nongnu.org; Fri, 03 May 2024 05:17:26 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-347e635b1fcso6635329f8f.1 for ; Fri, 03 May 2024 02:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714727843; x=1715332643; 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=L9C79ZCDN03MmjjHQ6TSF486EGxB4sAu8CtoKMbncco=; b=jbnHbEvsR0Xd7fBy4Vykdq9w6HG2xt09h722ooiDUBJR1EO+cdTQFvCDP0hDjMIo1B 90zba+/17477kCJAZE1k46/PKspjaRHbZ+OaV80XiiYwhYYxEL/PAG7uoNBdzmJSjcqQ 3ISTkbOkDN8LdNAD4lzCNrBVap3B6pq5veslO0LwuNlLue0jIJ9jUZyVWDNawXrcjdqv wZf+Y6RNv4Y1Yg4RYjdpYuUejiM4lpdJ3O8HzAECUAaxmHNXg/7WjJo4u2OHfyb4g9dH jmNQ5D64OaJbVf5w+YlNfP6pD93RbcBD+kTHJIbQd9DazMNYb4PEc+IW0vuYjmqN437R 2Qaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714727843; x=1715332643; 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=L9C79ZCDN03MmjjHQ6TSF486EGxB4sAu8CtoKMbncco=; b=U8WIC5VqW99Oht5xqbo+PjTiuLL4ka1QNazGqwN/rpHARxxMCFFqsKnE+2y7ngO79z u5xMSaAkEY/flUj72PXOsqql16NTLOKlgRMjO5U1LxxtoY57mHk0o+0/HJr7jk3yy15G KTtCVk7xLqml0+s1iwIHXVpxRpoMKT6jAUEJf2pJ7yvtPhC6NYMV80Z/IjQXeNrgxCZk xkMFVBZT8foeQyxziqjOB07XCoeCPeDw/vIBwMbAva4gSgGnMu0mXIVglcEevn+91z4c 3B+3TtENvZx7oeOHkic6ZLbAtPOC6vAdGx+Vo0VPuNWcvIg4RdTvvXsa5Fa3lPLQDPWJ m91g== X-Gm-Message-State: AOJu0Ywnla8nnSugbYYWVLIxbtZ/63DrmpQGBOPZF3h3IQo0PdpasJUd AxCvAPf8bcDi2oHWpTiSbvaD1JukCvzOOrzR9AT6fO3lz1f4W+9LJMcZdZHZgBhu/2Rr69TeX4a o X-Google-Smtp-Source: AGHT+IEEI3G04u6nCTL6TaAiUU/84v+I/3OzETWJTIOnRCl/CJAOF8TXXj0BrxPeHtuvhqdUWTk6uQ== X-Received: by 2002:a05:6000:36f:b0:343:7b6b:dcc6 with SMTP id f15-20020a056000036f00b003437b6bdcc6mr1352192wrf.30.1714727843314; Fri, 03 May 2024 02:17:23 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id p18-20020a056000019200b00347f6b5bb6dsm3256568wrx.30.2024.05.03.02.17.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 02:17:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Warner Losh , Paolo Bonzini , Laurent Vivier , Riku Voipio , Kyle Evans , Ilya Leoshkevich , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 4/5] accel/tcg: Introduce common tcg_exec_cpu_reset_hold() method Date: Fri, 3 May 2024 11:16:56 +0200 Message-ID: <20240503091657.26468-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503091657.26468-1-philmd@linaro.org> References: <20240503091657.26468-1-philmd@linaro.org> MIME-Version: 1.0 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Introduce a method called by cpu_reset(), common to both system and user emulation. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-common.h | 2 ++ accel/tcg/cpu-exec.c | 4 ++++ accel/tcg/sysemu/tcg-accel-ops.c | 3 ++- accel/tcg/user-exec.c | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index edefd0dcb7..b85285e2ff 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -23,4 +23,6 @@ static inline bool cpu_in_serial_context(CPUState *cs) return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs); } +void tcg_exec_cpu_reset_hold(CPUState *cpu); + #endif diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 225e5fbd3e..1bf85c324d 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -1096,3 +1096,7 @@ void tcg_exec_unrealizefn(CPUState *cpu) tlb_destroy(cpu); g_free_rcu(cpu->tb_jmp_cache, rcu); } + +void tcg_exec_cpu_reset_hold(CPUState *cpu) +{ +} diff --git a/accel/tcg/sysemu/tcg-accel-ops.c b/accel/tcg/sysemu/tcg-accel-ops.c index 2c7b0cc09e..82c8368f87 100644 --- a/accel/tcg/sysemu/tcg-accel-ops.c +++ b/accel/tcg/sysemu/tcg-accel-ops.c @@ -36,7 +36,7 @@ #include "exec/hwaddr.h" #include "exec/tb-flush.h" #include "exec/gdbstub.h" - +#include "../internal-common.h" #include "hw/core/cpu.h" #include "tcg-accel-ops.h" @@ -82,6 +82,7 @@ int tcg_cpu_exec(CPUState *cpu) static void tcg_cpu_reset_hold(CPUState *cpu) { + tcg_exec_cpu_reset_hold(cpu); tcg_flush_jmp_cache(cpu); tlb_flush(cpu); diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 6a108eb212..85e92ec8f2 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -39,6 +39,7 @@ __thread uintptr_t helper_retaddr; void cpu_exec_reset_hold(CPUState *cpu) { + tcg_exec_cpu_reset_hold(cpu); } /* From patchwork Fri May 3 09:16:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13652542 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E50BC4345F for ; Fri, 3 May 2024 09:18:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2p2s-0001kF-1h; Fri, 03 May 2024 05:17: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 1s2p2q-0001jY-Ev for qemu-devel@nongnu.org; Fri, 03 May 2024 05:17:32 -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 1s2p2o-0003b7-T7 for qemu-devel@nongnu.org; Fri, 03 May 2024 05:17:32 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-41b4ff362a8so83312705e9.0 for ; Fri, 03 May 2024 02:17:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714727849; x=1715332649; 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=4Tb/CgMjRwAYjJGSlcjkSqdpYLQYMSWtat67VigpwVw=; b=j7v/ejyavBhkW8SAeiXpAheO/6Dyk0yG5Y3UlNyFcg2KZDTpt9ebzh9jwjUwHRNau6 XKMjBgivtcdGUmMe0qFncQdrT5r/auey7o9udv3lZ9NGSRDAB7OCFe5x1ODbs4la57J2 WM8SYcWzjVRmFIHXjY5GX73Mma566Z4N8lME/uqzgYK+/9nXmmIQ5f8J3BKBdzH5cDw6 mVYhqV2aeedBCzCF5CguO681Pwlw4gKG4bPuGv+Hu2ynU+zNvuvcvac8PMkmVHe+NPq6 AHq1Qx51Y6lbE99pDdurvjY44oEUg2PL3QBoIQElOn2tGqOwkBOrqo7+08m3NbiC0d0/ x9FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714727849; x=1715332649; 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=4Tb/CgMjRwAYjJGSlcjkSqdpYLQYMSWtat67VigpwVw=; b=pOuZuLoT7yfXzOp2wml2f2gDR3CJz5iuAzrJrQ5dfMI5DrvlBovgtAO1ooQJjMS0Io IP6NRq6EqabGhPhrCF7Vfl+HUzAjVZUNh3Hxt5Flj/6ZMdERcRCiVAA0M5eo0At8YWQQ WktF74YIuuE2VG3swiDr8WioIBx+OcVnre5WnUDA+ZJRu6FTKP1M00RNpyhL6V6yrRse tav7EUL7n4PlElG09kWJCFY1xIlIQ6PHNcD7nc/7gguXWBQ+gZ61BtTV9dfEeaQmHHLe EfMEeA7e8duMHdqn0FBY6Tomc0StOiGBvb4YO+iweKUbcsyUAgQ33O3r2/TNhfFgNzEa QiqQ== X-Gm-Message-State: AOJu0YzzcJM47r+YdvhDrlLb0tLp6BK0pa+bnjQapMgUhPfzU2Nj4c8A yvnw3t1YgID5LjWygCAVSSYIHgrTyB5SsEmefZb9oBaYMVLRuKVyA8DE6p3uMR5C9jVO3i7H/tW 4 X-Google-Smtp-Source: AGHT+IGmgTY76Kc4tJh9yCqXlOC9f7UFUY+gpFipcKMrAlZNqXIq2YolDGiE/o7hU15BQmF7hRCvjA== X-Received: by 2002:a05:600c:3507:b0:41b:eaf2:f7e6 with SMTP id h7-20020a05600c350700b0041beaf2f7e6mr2189421wmq.2.1714727849170; Fri, 03 May 2024 02:17:29 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id v28-20020a5d591c000000b0034db47c7e6dsm3259435wrd.115.2024.05.03.02.17.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 02:17:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Warner Losh , Paolo Bonzini , Laurent Vivier , Riku Voipio , Kyle Evans , Ilya Leoshkevich , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , qemu-stable@nongnu.org Subject: [PATCH 5/5] accel/tcg: Always call tcg_flush_jmp_cache() on reset Date: Fri, 3 May 2024 11:16:57 +0200 Message-ID: <20240503091657.26468-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503091657.26468-1-philmd@linaro.org> References: <20240503091657.26468-1-philmd@linaro.org> MIME-Version: 1.0 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=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org In commit bb6cf6f016 ("accel/tcg: Factor tcg_cpu_reset_hold() out") we unfortunately restricted the tcg_flush_jmp_cache() to system emulation. Move it to the common tcg_exec_cpu_reset_hold() handler so user emulation gets the jmp_cache initialized when threads are created. Remove the NULL check in tcg_flush_jmp_cache() from commit 4e4fa6c12d ("accel/tcg: Complete cpu initialization before registration") which was a band-aid fix for incorrect commit bb6cf6f016. Cc: qemu-stable@nongnu.org Fixes: bb6cf6f016 ("accel/tcg: Factor tcg_cpu_reset_hold() out") Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 2 ++ accel/tcg/sysemu/tcg-accel-ops.c | 2 -- accel/tcg/translate-all.c | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 1bf85c324d..7e04df2902 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -36,6 +36,7 @@ #include "exec/replay-core.h" #include "sysemu/tcg.h" #include "exec/helper-proto-common.h" +#include "exec/tb-flush.h" #include "tb-jmp-cache.h" #include "tb-hash.h" #include "tb-context.h" @@ -1099,4 +1100,5 @@ void tcg_exec_unrealizefn(CPUState *cpu) void tcg_exec_cpu_reset_hold(CPUState *cpu) { + tcg_flush_jmp_cache(cpu); } diff --git a/accel/tcg/sysemu/tcg-accel-ops.c b/accel/tcg/sysemu/tcg-accel-ops.c index 82c8368f87..13e450c088 100644 --- a/accel/tcg/sysemu/tcg-accel-ops.c +++ b/accel/tcg/sysemu/tcg-accel-ops.c @@ -34,7 +34,6 @@ #include "qemu/timer.h" #include "exec/exec-all.h" #include "exec/hwaddr.h" -#include "exec/tb-flush.h" #include "exec/gdbstub.h" #include "../internal-common.h" #include "hw/core/cpu.h" @@ -83,7 +82,6 @@ int tcg_cpu_exec(CPUState *cpu) static void tcg_cpu_reset_hold(CPUState *cpu) { tcg_exec_cpu_reset_hold(cpu); - tcg_flush_jmp_cache(cpu); tlb_flush(cpu); } diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 83cc14fbde..93202fa3c1 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -663,11 +663,6 @@ void tcg_flush_jmp_cache(CPUState *cpu) { CPUJumpCache *jc = cpu->tb_jmp_cache; - /* During early initialization, the cache may not yet be allocated. */ - if (unlikely(jc == NULL)) { - return; - } - for (int i = 0; i < TB_JMP_CACHE_SIZE; i++) { qatomic_set(&jc->array[i].tb, NULL); }