From patchwork Fri May 3 12:34:52 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: 13652733 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 3CDC5C4345F for ; Fri, 3 May 2024 12:36:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2s8n-0007c1-0u; Fri, 03 May 2024 08:35:55 -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 1s2s8A-0007EO-Fn for qemu-devel@nongnu.org; Fri, 03 May 2024 08:35:17 -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 1s2s83-0002nO-WE for qemu-devel@nongnu.org; Fri, 03 May 2024 08:35:11 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-41dc9f98e8dso11334825e9.1 for ; Fri, 03 May 2024 05:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714739706; x=1715344506; 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=DJ2+DminAMBhR7ne1mJVPzDapawzOzMCaGznDAzlaXg=; b=MNlJxYBB3woYKpnxO0ejtIrc1pAtUGax1j8olkw2ANawuy3nLCuMnWb2gnwJahhf5m vOpsooRhQzBYyqHO0DUkAC5wJLJukH+jevtvCeD01bqR2a6Ff8GFySyTBfAePoRHG62O SIz9pV/FjxZyi35shxmlmjVZJ+9AyPjs7NhhAvUHlT30Et1KTopnZHP7z8vypwFaQOCS wxu9beaJc+O0TWhzMtvxJRNqwOpb5EqiyJV9VDHn88QapXxlfZW1Xr6tC9Rv7PxXBXE8 Ks4CE4Z/zJEhfYGZXFQJcal5YzEwD+k5QOR4stf4sZHAmeEBebUTDq3OAe+ZiiLq7OSI wY/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714739706; x=1715344506; 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=DJ2+DminAMBhR7ne1mJVPzDapawzOzMCaGznDAzlaXg=; b=n4aQ8dtU4GvZ9prPGadNvktwOEkGTKPtDuM7b8qxfiemvtaWEGpP3es0x9SyHb2lNw E4MiM3WZFKapYbQXcoHFt6Dz4rqPrLmz1my+lIsVIesaDyVJwQcCZE7C+koVN/qS4HDD hsl7nzmHiQ26R0TXh2VcB4PqlroyymkMlqTEOPhDcqvaXD8F2GdwEknSGcHoLK64xrN+ Xg78uW0TGLZjaaNMxCl8GBCK0m7y/SAJWmT29alyeOTp9WbIMU4Qy41u5xIQx898otoc zOpOKy8oWuhhcGogefMsUN0byvI9yR2DvPOkCcohvoRpKZxMD/vaFTiJdFtkANvVmomD EyvQ== X-Gm-Message-State: AOJu0YyC6Jck7JlytYEQa25+Xh1+ZaNcWquQPq1f70nMoa4NraNjjxs+ 7ODMyvU46IrzyLIVeN5uTTVJy+VUBqwsj67Zp8kZCA004kg29i58aKWGvVrpUYSL83b7j9Q7Zbe W X-Google-Smtp-Source: AGHT+IFeu0CbcdYSV7wYAgXyLrH/jcr1cw1T7GxCvYWl5IqcPzaXLZd9FKC5ooZGhpXE9MU4RWH4Jg== X-Received: by 2002:a05:600c:4f16:b0:41c:66:18c2 with SMTP id l22-20020a05600c4f1600b0041c006618c2mr5073169wmq.4.1714739706095; Fri, 03 May 2024 05:35:06 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id q8-20020a05600c46c800b0041ac4aafd3dsm5500179wmo.12.2024.05.03.05.35.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 05:35:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Warner Losh , Richard Henderson , Kyle Evans , Ilya Leoshkevich , Riku Voipio , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 1/5] accel/tcg: Move SoftMMU specific units to softmmu_specific_ss[] Date: Fri, 3 May 2024 14:34:52 +0200 Message-ID: <20240503123456.28866-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503123456.28866-1-philmd@linaro.org> References: <20240503123456.28866-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 Currently these files are only used in system emulation, but could eventually be used by user emulation. Use the "softmmu_specific_ss" to express they are related to SoftMMU. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/meson.build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index aef80de967..84826f043a 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -16,12 +16,13 @@ tcg_specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('user-exec-stub. if get_option('plugins') tcg_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( +softmmu_specific_ss = ss.source_set() +softmmu_specific_ss.add(files( 'cputlb.c', 'watchpoint.c', )) +tcg_specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: softmmu_specific_ss) system_ss.add(when: ['CONFIG_TCG'], if_true: files( 'icount-common.c', @@ -34,3 +35,5 @@ tcg_module_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( 'tcg-accel-ops-icount.c', 'tcg-accel-ops-rr.c', )) + +specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_specific_ss) From patchwork Fri May 3 12:34: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: 13652734 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 461C9C4345F for ; Fri, 3 May 2024 12:36:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2s8n-0007bw-0W; Fri, 03 May 2024 08:35:55 -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 1s2s8E-0007Fp-Bf for qemu-devel@nongnu.org; Fri, 03 May 2024 08:35: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 1s2s8A-00030F-AA for qemu-devel@nongnu.org; Fri, 03 May 2024 08:35:17 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-41bca450fa3so48323325e9.2 for ; Fri, 03 May 2024 05:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714739712; x=1715344512; 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=tc6dayl5tulhCDU0tgAOjnRfAOhbRHX4YnefxEFrhW4=; b=MsI97ceGgamI3T8MQhU3M/m5VRsbHKtX2ONfnoWq8ADdjTGD+CaMGFCaVZGPyh+HPS USkTm8jJH7QIwGqIxAvTN+ZsaUFB9/txnD6LR4LdhgOUjouR4TPvfgb61ES7JYNTEJZ8 V0XWWRiT9DF4FKiy1zeXBYJ7Pw/tba56VlhQs4iPrF0d7Rph8VQWFdDSB6TBG8BT0Yv7 gAHGjZSfbtOGVyxJwBTWANeXqwMQcu2syVmbBbbxb4UtXHFO2gU0rv50+FY8POmeCbcu YgFAhhWCWBYgK1F5t1tB89qWBRMG64CKX/22bJvXwOoxH+juiIrwVyomfd86mRrpiRsK 1fBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714739712; x=1715344512; 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=tc6dayl5tulhCDU0tgAOjnRfAOhbRHX4YnefxEFrhW4=; b=H9BFaHHlqrY5JK0/9V3IPeZZ0BBkEl9mWSwdgsTHrA6AvaC5EsQF2ewZlU3IDx76W7 HjamoK1o/nqhowvy/iPIxpHvjsdyfcBjwRYqFh7p12o72fDa4MUf5iRxkr0TUkMJpXXl 8P+7WJ+qcBoqOsNoxO6I6kiOrvgcjluRCZr+pfVpVJX488MWLhXhI5b8y05m0UOrW1So Bxy4G3Hst74ooEgrIKmeRQahNYI55Nj6wt0M8HbLLdLJHsUuzDcltLNbJmvUNfvdTuZA a/upHAqKQAq4XHCBXwrnfmJjcLJszN4NyJwGrd7h79zcK5tIct7hz3kw5AGdftG67MIl MvhA== X-Gm-Message-State: AOJu0YzklUFOPyjiYp1ngbt0yIobOWDnEetJ4QAAW5HNhspNfxru4N3v L/4oN2cLwYmKzJmpa4g34CL/MvcGDq1r6KDF34siY42w3v78Q0HbrfHw40JVayR7lT2OBplnGBF D X-Google-Smtp-Source: AGHT+IFL8w7N4nqikQUgNMKqvrgUvrAY7TD0j5uoOjkVIPyD8zvDmejuYwYfnn6tvqBxEMK6rr2tJA== X-Received: by 2002:a05:600c:46cb:b0:41b:d08d:dce4 with SMTP id q11-20020a05600c46cb00b0041bd08ddce4mr1919892wmo.5.1714739712282; Fri, 03 May 2024 05:35:12 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id f20-20020a05600c4e9400b0041b5500e438sm5504276wmq.23.2024.05.03.05.35.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 05:35:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Warner Losh , Richard Henderson , Kyle Evans , Ilya Leoshkevich , Riku Voipio , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 2/5] accel/tcg: Move system emulation files under sysemu/ subdirectory Date: Fri, 3 May 2024 14:34:53 +0200 Message-ID: <20240503123456.28866-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503123456.28866-1-philmd@linaro.org> References: <20240503123456.28866-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 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 | 12 ------------ accel/tcg/sysemu/meson.build | 11 +++++++++++ 12 files changed, 13 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 84826f043a..3539b0b799 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -24,16 +24,4 @@ softmmu_specific_ss.add(files( )) tcg_specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: softmmu_specific_ss) -system_ss.add(when: ['CONFIG_TCG'], if_true: files( - 'icount-common.c', - 'monitor.c', -)) - -tcg_module_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( - 'tcg-accel-ops.c', - 'tcg-accel-ops-mttcg.c', - 'tcg-accel-ops-icount.c', - 'tcg-accel-ops-rr.c', -)) - specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_specific_ss) diff --git a/accel/tcg/sysemu/meson.build b/accel/tcg/sysemu/meson.build new file mode 100644 index 0000000000..5a97cabe7b --- /dev/null +++ b/accel/tcg/sysemu/meson.build @@ -0,0 +1,11 @@ +system_ss.add(when: ['CONFIG_TCG'], if_true: files( + 'icount-common.c', + 'monitor.c', +)) + +tcg_module_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], 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 12:34: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: 13652732 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 8BF9AC4345F for ; Fri, 3 May 2024 12:36:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2s91-0007zp-A3; Fri, 03 May 2024 08:36:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s2s8L-0007Hv-0C for qemu-devel@nongnu.org; Fri, 03 May 2024 08:35: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 1s2s8H-00032O-Te for qemu-devel@nongnu.org; Fri, 03 May 2024 08:35:23 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-41b782405d5so78712165e9.2 for ; Fri, 03 May 2024 05:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714739719; x=1715344519; 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=wjXV8v5+nLa6yd1Elu5FeD7gOCFbngXiTb6DKLq+m2brXsOEg8ygYTqNqO39oqlGGc fss+Omb87pnt5UOs3ny51LMc4F9OnIAeJZ/d47y88FEbV3ny9zqzF7dZyHc1qg5eOnNr d3Jya6/PB8WVbtzEcIE9aas6TJ939bTY2zfuwsGPa1rcLGG0Ic4ggTM9jkqpSQadrNIM aJ4ZH0Jm27KMlB0dFSjwLTN3auOA3/GlcSvo1PNeTfmi7EOYpYY8rR6s6BxeahibSxaf UROnAK5BlMSMHnuW9IqURpvjdM9GAVFylt63s6UodPH8v2lkOCc9DfZLapNsTId9yldV bqNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714739719; x=1715344519; 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=nmZZVhbzoNH2r/O5DZHe1J/fY3hGa75RSLdpI55MZDM/VaWOQmNE0UVZ01fDtyuJV6 XTNp97kEC2FT2Pw47Dp1wgKC8bArieHmUSpyDQOXNwGmQBj/Xln9ywfX8clBCvVqA8dK 6S44BVecWczFi6mVvjMaK3SGODj8jpSrj7wIDa6WhCJQogs81FogfRw8rKGimDJGRHBe fTg+Cis1SHXTL92QALsyG2++9GsH4dVtguvPWhw4rEc9Mhg3z9kCVq2njeQhF25ip3lR dwnVnn3nfV/4r29ZLZ0p0NwcHRgtjukjHNbLxfxHVja4Ho6K3PXYBlAh0QIpKGqHN9d4 Et7w== X-Gm-Message-State: AOJu0YxoaRCx86NEO0ybjazii6/i7cN2aqkNcwuNepTsvwrpPaLUVQMX wVssliXCZG0tzBpYOLqTFEIHA+TJ9IaneByUMvKFoE0Ad8iIbIZTn2mIrbFURwv4lOIPdS7X9+7 q X-Google-Smtp-Source: AGHT+IGegzUkFujYK5Pa61w72uaBEbWpAV6DXB85dKhww77dlfbCWtzx4EfYlQg4SWytArVrtLnV6A== X-Received: by 2002:a05:600c:4fcb:b0:415:540e:74e3 with SMTP id o11-20020a05600c4fcb00b00415540e74e3mr2365576wmq.40.1714739718904; Fri, 03 May 2024 05:35:18 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id p17-20020a05600c469100b0041b083e16e2sm9330778wmo.2.2024.05.03.05.35.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 05:35:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Warner Losh , Richard Henderson , Kyle Evans , Ilya Leoshkevich , Riku Voipio , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 3/5] accel/tcg: Do not define cpu_exec_reset_hold() as stub Date: Fri, 3 May 2024 14:34:54 +0200 Message-ID: <20240503123456.28866-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503123456.28866-1-philmd@linaro.org> References: <20240503123456.28866-1-philmd@linaro.org> MIME-Version: 1.0 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+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 12:34: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: 13652735 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 447E0C4345F for ; Fri, 3 May 2024 12:36:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2s8u-0007or-El; Fri, 03 May 2024 08:36:00 -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 1s2s8Q-0007Kt-Kn for qemu-devel@nongnu.org; Fri, 03 May 2024 08:35:33 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2s8N-00036V-HX for qemu-devel@nongnu.org; Fri, 03 May 2024 08:35:28 -0400 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2e10b6e2bacso36646931fa.0 for ; Fri, 03 May 2024 05:35:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714739725; x=1715344525; 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=FftdX6fy29BiINp8V42kiUQO7LkonRVxTQjAci7LA33uuOkABy4yyedgm6NdVSd2Mb uHSlbuN2nJw56EQhNWN34r1/uk5zW/Nn/MVIFNqJge62yO5Hq2DPNCO9W1La2hdGv5DV XhOTRz9m+qhqc/kcQRHP9oZTqTjF/ips8StkNvqzwGCperz/OTaWFF7U7UpNCzCcmFvI RTbYEOayCP8pOdSgvTEZ3kXe73HcVMcoFKcK0D1jLG7MUju5D1gNodbWH36UVKQP33Y7 t4aW3lYDpr7GMZNu0wrkn1K2UUK+YnUQJ51HYhDZoFjf2qPDe9vG7T9b4W0H8o2WLm9Y NoYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714739725; x=1715344525; 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=uE4Bj/egKjN6r5GHjqK8UJgOIEpImCTGRJKswOoBjvDteu/iZhOgWR81TNqJlnNEtS upPkdVzaXy6BOHA/YLVcQs1UFQ3tf/JZslx7Ba+fQexCNNIDrcr/5U4azhpBwrhD3FLy lRRUI1hwvrg3ZEVrzhv0vp/lDeVYAdz8m/F6o5O4byCA2QprquZojWn3q32uU1spfPKp 6uOJCpcmrMInw/oxNu42uwwlBZ1SFuRV7zGSGEvAskjZMBXEHDoWdDvYLMjDu3hP91IT oZkBTPfxZm2ibQJjQ/G3AXDkfTOYcFh7H9QvnuD1FEODgfAWO75YuawxxI+/o7PiE4p7 +9Iw== X-Gm-Message-State: AOJu0YypyzXJ/dqr5oVE6E7xoN63fwrMx2Pchq5+BRpOdcz7IWlJ3uA8 4+cpTUaawCVsGViXQtgFSwZ496Gr2AQDteUMiU6R5RPLUFdYbq6DhSuhFEElrntzSRdt1ak/2Dp 4 X-Google-Smtp-Source: AGHT+IEkjl1c4zplMPtoIETj7k4yvplmvfLOuYZnnAu805MwIj/FLVK7x/NIrhkk+1Y5IEDmhiDAYQ== X-Received: by 2002:a05:651c:553:b0:2dc:d2c5:ee9 with SMTP id q19-20020a05651c055300b002dcd2c50ee9mr2012704ljp.2.1714739725256; Fri, 03 May 2024 05:35:25 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id n17-20020a05600c4f9100b0041668162b45sm9200100wmq.26.2024.05.03.05.35.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 05:35:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Warner Losh , Richard Henderson , Kyle Evans , Ilya Leoshkevich , Riku Voipio , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 4/5] accel/tcg: Introduce common tcg_exec_cpu_reset_hold() method Date: Fri, 3 May 2024 14:34:55 +0200 Message-ID: <20240503123456.28866-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503123456.28866-1-philmd@linaro.org> References: <20240503123456.28866-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=philmd@linaro.org; helo=mail-lj1-x234.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 12:34: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: 13652731 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 02F66C4345F for ; Fri, 3 May 2024 12:36:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2s8s-0007g0-Us; Fri, 03 May 2024 08:35:58 -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 1s2s8X-0007Uv-B1 for qemu-devel@nongnu.org; Fri, 03 May 2024 08:35:41 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2s8T-00037f-Jb for qemu-devel@nongnu.org; Fri, 03 May 2024 08:35:36 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-41ba1ba5592so50089725e9.1 for ; Fri, 03 May 2024 05:35:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714739732; x=1715344532; 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=U/FbBZDerOkJ2rUe1UU3n5vYfq7NJSfEADoYTFXWpqaRWMHG3FFsrpnimltFrCnOtX 3lpzMEnUjDJ3nKoljxz2sY3N0a+e4Mun3nlwJ2Ydu5GZR+MhrD14x+pbrWwdxfVmLDN+ nwubSI3r3k6H08YZXDJKRNr9o0wPb4G1I3DrIL3Izt6jcI/OE6HRIPXXBJPTdpeib5Cu XBo5PvYBe2BlFqKCOu3vOFZbANfkPjUda82q1GxlHS/q8E2M/u2g+BgQU6lWI7SmSKkT HTEYE6QDwLcYq90Q4qO/6OgppB6iHPqz99zfAiOlcVPqdviWIJ+lBxiwviMpyMKvMooO DE1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714739732; x=1715344532; 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=hmHygPzTtv2HXKumVJqLlFkmT5ngRfdApG6rj/dXdZM1HCuCcyU87KyQO+JfPLHotr AzPgYuxYlMNagabf7qKuzj66X8hy7/32jrugBUCfGJx65/frhhvqBgmbBIV7DAQK8X6J 29A7Q1KEHzJntj4S1J09/n+L6fiFKcQkPX4GSH8PtuxriQfCmUZJsiMZhyinUWj7El2b ZOw6yN6KJ7BrD4WBHHiKz5ZF7AbS0qxpnZXHgQoki0ceOSilDRReAdoiSws/zU/r6k0e aVMOZRX1fk4II70ygQvHdmyFMnYoAWS6cb9wm9f1l+LQgAUDPOC9f/69100Fjf4qmW9o 7KdA== X-Gm-Message-State: AOJu0YxNcCKM/xiwO1H7SS4JxiZyxuP4PXJghzS/yyz8yed75Gj7ssKY 2bMsdeelmvRGaGHT3xC1S1fMV/+U3cllphPjZpSjEpYBfm2ale5BdV81Ou6gs4k9Y47LUogmQpE A X-Google-Smtp-Source: AGHT+IEMSKOulsn6UG0LjCmddKsbVDOiHr8tcMRMGdFoXoQSWXRSM5wqAeL8R441+a2gqqvIHa9wtQ== X-Received: by 2002:a05:600c:1d0a:b0:41c:2699:dd9d with SMTP id l10-20020a05600c1d0a00b0041c2699dd9dmr2273086wms.28.1714739731682; Fri, 03 May 2024 05:35:31 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id je8-20020a05600c1f8800b0041bf28aa11dsm5504533wmb.42.2024.05.03.05.35.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 05:35:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Warner Losh , Richard Henderson , Kyle Evans , Ilya Leoshkevich , Riku Voipio , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org Subject: [PATCH v3 5/5] accel/tcg: Always call tcg_flush_jmp_cache() on reset Date: Fri, 3 May 2024 14:34:56 +0200 Message-ID: <20240503123456.28866-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503123456.28866-1-philmd@linaro.org> References: <20240503123456.28866-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=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); }