From nobody Tue May 21 00:08:22 2024 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=1695033785; cv=none; d=zohomail.com; s=zohoarc; b=WQeSdbLnymnKKz9lEVucB0mvEjRzfk+RTXO0LG4YKwJuJu//QD5xAvezGvvChW4q5PpxQXICr1qBwZeMYIrM8bMVc5EMaSdBB2mmUHePPOW8DsFqnjf3/OTzsx981qaR7pvKrI28Nt/DfBZpZN+9o6+VNN0If2oUdFkc793GALM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695033785; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=y1v7pQRjeJMsEcoQRcYTaf7jB60FlNSE8+h962wr3Pk=; b=GeLrMfTfNAsmVaoD61hWb7poFuYcMOA0s+bCpBLFS+iSHsVg96NLqYIwgGhK/aLGXus+F83MXaW1RjaU1nAia7OWZ5aWacYnRinwwnJ8KcTw+cgQXjfQ7uxGIJJQT+Ak6BIIq4j3WJuvQgho+/vUAGxeVjqfzm+Y9aZ17IVUlmI= 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 1695033785268108.14622114811186; Mon, 18 Sep 2023 03:43:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiBhq-0002c9-IP; Mon, 18 Sep 2023 06:42:18 -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 1qiBhk-0002Zz-MP for qemu-devel@nongnu.org; Mon, 18 Sep 2023 06:42:14 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiBhi-0003np-Fw for qemu-devel@nongnu.org; Mon, 18 Sep 2023 06:42:12 -0400 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-50300e9e75bso2850524e87.1 for ; Mon, 18 Sep 2023 03:42:09 -0700 (PDT) Received: from localhost.localdomain (5.red-88-29-175.dynamicip.rima-tde.net. [88.29.175.5]) by smtp.gmail.com with ESMTPSA id 7-20020a05600c230700b003fefcbe7fa8sm12155307wmo.28.2023.09.18.03.42.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 18 Sep 2023 03:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695033728; x=1695638528; 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=y1v7pQRjeJMsEcoQRcYTaf7jB60FlNSE8+h962wr3Pk=; b=SHbwMVNCS5RNUitpnjOJBODHzXRQyQ4CEq9WPsZlKEnFOYbfoDW2oL66xGZa0QgLc0 T+AIpRPIQu+yXUcQeBqgdSb0yMvuSzqiDufXOuS49/OYVU+sUOepq1yY0BLiaNiekQFJ fpxlb6r5+QlOWjfP0LupkK14K2Ny1sD0k0cbYVTsw2U8vyTQBbPsHoc7a7hwjXOCiTi8 I7gsny4UzPnGy8zKW01TsWySxG+0mYuzpQQ3XcoXFo7lUz0SH2GtcgirGRu+bw4/l+wE h5AO0TRxhPuzP4OLzTmXRihxqduCRAULjIpZrLxvs3fEaFq6N+1Xk6+CzpU7SahtykrF lqnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695033728; x=1695638528; 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=y1v7pQRjeJMsEcoQRcYTaf7jB60FlNSE8+h962wr3Pk=; b=bPR6RdMTdzsU3U1BaJ/8uCNVh5sBAdoRejxoQ98WOexk1Z1yf86e1ixYJuEYfx7amv 0nraqgK0Kq41eI8QmseX3r/Hjbu26mmjRX+VIaa6LOCDQWJelWz4wZnom2ab22r/TVKU yz/TfwJWxfvXzFa4ce9uX5/4djyWQFzlMO/HhO1J3zzQMWFXrm10w/NSXQY8alzxFmUp BDdij5Ms8NqJGNX9nHVrYR2Nn3dHmbHhrptCv67JnCD2OFF6g4xmtIkiF1gU7LrB7geX zZQqu6b04fC5Sop7llbeJ2oswg12iEJopWJDF2aI/Evb2y0INQb7iuvHZg0iksQXbV/6 CaDA== X-Gm-Message-State: AOJu0YwBMuR3u4GIlfwaCS6yjAvYLSjAimY52MTi1yDoIqMflTeg/8TJ AbMDnl3FcmYrf5pGCAzf4zsocZ3/+c0WjTgx7awJ9Q== X-Google-Smtp-Source: AGHT+IF/0ITVInb3zP966Pc9cMZYKmVr/r+GDWnP6iElDu4wy7KVf56WEUcW5GE2f66cRTF9gFAQmg== X-Received: by 2002:a05:6512:971:b0:501:bee7:487b with SMTP id v17-20020a056512097100b00501bee7487bmr6570861lft.11.1695033728282; Mon, 18 Sep 2023 03:42:08 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Anton Johansson , Riku Voipio , Richard Henderson , Claudio Fontana , Yanan Wang , Paolo Bonzini , Alessandro Di Federico , Fabiano Rosas , Marcel Apfelbaum , Daniel Henrique Barboza , Mahmoud Mandour , Eduardo Habkost , Alexandre Iooss , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 1/3] accel/tcg: Declare tcg_flush_jmp_cache() in 'exec/tb-flush.h' Date: Mon, 18 Sep 2023 12:41:50 +0200 Message-ID: <20230918104153.24433-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230918104153.24433-1-philmd@linaro.org> References: <20230918104153.24433-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::132; envelope-from=philmd@linaro.org; helo=mail-lf1-x132.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: 1695033786553100001 "exec/cpu-common.h" is meant to contain the declarations related to CPU usable with any accelerator / target combination. tcg_flush_jmp_cache() is specific to TCG, so restrict its declaration by moving it to "exec/tb-flush.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- include/exec/cpu-common.h | 1 - include/exec/tb-flush.h | 2 ++ accel/tcg/cputlb.c | 1 + accel/tcg/tcg-accel-ops.c | 1 + hw/core/cpu-common.c | 1 + plugins/core.c | 1 - 6 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 41788c0bdd..1eff233565 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -39,7 +39,6 @@ void cpu_list_unlock(void); unsigned int cpu_list_generation_id_get(void); =20 void tcg_flush_softmmu_tlb(CPUState *cs); -void tcg_flush_jmp_cache(CPUState *cs); =20 void tcg_iommu_init_notifier_list(CPUState *cpu); void tcg_iommu_free_notifier_list(CPUState *cpu); diff --git a/include/exec/tb-flush.h b/include/exec/tb-flush.h index d92d06565b..142c240d94 100644 --- a/include/exec/tb-flush.h +++ b/include/exec/tb-flush.h @@ -23,4 +23,6 @@ */ void tb_flush(CPUState *cs); =20 +void tcg_flush_jmp_cache(CPUState *cs); + #endif /* _TB_FLUSH_H_ */ diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index c643d66190..b220c4536c 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -24,6 +24,7 @@ #include "exec/memory.h" #include "exec/cpu_ldst.h" #include "exec/cputlb.h" +#include "exec/tb-flush.h" #include "exec/memory-internal.h" #include "exec/ram_addr.h" #include "tcg/tcg.h" diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 3973591508..748539f289 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -34,6 +34,7 @@ #include "qemu/timer.h" #include "exec/exec-all.h" #include "exec/hwaddr.h" +#include "exec/tb-flush.h" #include "exec/gdbstub.h" =20 #include "tcg-accel-ops.h" diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index ced66c2b34..b3b5ce6702 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -27,6 +27,7 @@ #include "qemu/main-loop.h" #include "exec/log.h" #include "exec/cpu-common.h" +#include "exec/tb-flush.h" #include "qemu/error-report.h" #include "qemu/qemu-print.h" #include "sysemu/tcg.h" diff --git a/plugins/core.c b/plugins/core.c index 3c4e26c7ed..c95c00a830 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -21,7 +21,6 @@ #include "qemu/xxhash.h" #include "qemu/rcu.h" #include "hw/core/cpu.h" -#include "exec/cpu-common.h" =20 #include "exec/exec-all.h" #include "exec/tb-flush.h" --=20 2.41.0 From nobody Tue May 21 00:08:22 2024 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=1695033763; cv=none; d=zohomail.com; s=zohoarc; b=FgLJaVS+ekALu/MidnpVP0XILVb/fSWFxg31qKCDMRoalKmfCgFLHUMzjucFOtFAwCq7EI46ToCnQ920bLBvazpoXV5tuD9RqWAMbjrVHE2HG0V1s3VQF/iYnB4M/c9OTZ3purBek3fez7ib32ny4fe/ZIhCQ4OioLKNlzKY7mM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695033763; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=W52OzMfh5+MNdMUtWyOMIRdFjsJUql/0VwepeW4hS+w=; b=gHlvukYvEclyiegU1JuTIK8nu2fSf/MetbTl53WAgxHp6IWRIW3JTVrudBc4nhtuI1OwdXYj6jC5zCCwQJKxFzScPGKcrgbpbHaPBfLfnrP4RVJ849ZtcqnRscsTumh+gLfuq9/pnNt6RW2qM5rMHEyzU6rVMf1rD/JgjIyH7Zo= 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 169503376348480.65821966656165; Mon, 18 Sep 2023 03:42:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiBhz-0002dL-Vt; Mon, 18 Sep 2023 06:42:29 -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 1qiBhu-0002ct-PX for qemu-devel@nongnu.org; Mon, 18 Sep 2023 06:42:22 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiBht-00041y-3Q for qemu-devel@nongnu.org; Mon, 18 Sep 2023 06:42:22 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-31c5a2e8501so4088672f8f.0 for ; Mon, 18 Sep 2023 03:42:20 -0700 (PDT) Received: from localhost.localdomain (5.red-88-29-175.dynamicip.rima-tde.net. [88.29.175.5]) by smtp.gmail.com with ESMTPSA id n9-20020adfe789000000b003180fdf5589sm7926499wrm.6.2023.09.18.03.42.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 18 Sep 2023 03:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695033739; x=1695638539; 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=W52OzMfh5+MNdMUtWyOMIRdFjsJUql/0VwepeW4hS+w=; b=qlOKRjtKIdvRvHtSeSYFjJKOBvGGIdRIE6p8o4HdJ1w8HwnqWcdeI5bmkcKtbMXaDE stJS8kQVUFo/ZRxOE1aV3jwM0Jn9IB27E5ZfY/op9kM5shIZo4sTKS6rAQXMzYiNXGtH lpjifsVgLaC8zUH6MYPga9NBPMIsXCreKQlUfPtrsPIPAXRssH8cPB/YvQryuzGYIpnD Yy5oFv0aOaHe8siG9ALgSH/9qYlGOFkkb1fBGzgU1AsvDCdEC4oIgCq5M2UPvnouzRFM TqhWJw9eQW8n0M06aCroWX7643wRMCQmuyGPkhO7BxNc95oxLNbq7kwKwcxv2ug1+kcH PsCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695033739; x=1695638539; 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=W52OzMfh5+MNdMUtWyOMIRdFjsJUql/0VwepeW4hS+w=; b=bPzfF+0pOo0OHz2WOqSAtDTOIQFYq/cwtRVW2gyWIGfNVlsKsdxZAxU8iSbgw0Y0Dq KBsBuhWL/qjmkddNG3Js4egodIl/ZpuN/54/phLS90Pch3iVmn2fPpcJHW98bWrHk45D JojDQcyt/STg5SPmpGAm1l+lq67wN59JdioK93U8HUs0aD7I68ezIqLKCnN9czFg75+s I0tiUDDoazbtbAK/+gKVjac0p4gQgbyjtujmuePAZl/L8GsDnfA+vuMTJsUrYqaFWNcG 2N6iesLrORV4/K1aXpIc6r/uRPW9YD0UIHP3N/YT/5i4R9IO0geSaUSLNwsWEOSpY78y KOUw== X-Gm-Message-State: AOJu0YytTlSdJux1qAwi7lRQeRrYgf77IXe0V3NkjuPeCvvoZ5bX0aTe uB3qctEGMi0rJ4O0mLZ/GaDMZqHnn5hzB/Hst38qiQ== X-Google-Smtp-Source: AGHT+IFemvQY3u202U4yXA9Ndn0gpzf58Cw0SkRTOzVyDOSU8Go6BbaoP+LvycBokEyi58PfaPP+bQ== X-Received: by 2002:adf:f34b:0:b0:31f:e756:cbf9 with SMTP id e11-20020adff34b000000b0031fe756cbf9mr6483819wrp.22.1695033739305; Mon, 18 Sep 2023 03:42:19 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Anton Johansson , Riku Voipio , Richard Henderson , Claudio Fontana , Yanan Wang , Paolo Bonzini , Alessandro Di Federico , Fabiano Rosas , Marcel Apfelbaum , Daniel Henrique Barboza , Mahmoud Mandour , Eduardo Habkost , Alexandre Iooss , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 2/3] accel: Introduce cpu_exec_reset_hold() Date: Mon, 18 Sep 2023 12:41:51 +0200 Message-ID: <20230918104153.24433-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230918104153.24433-1-philmd@linaro.org> References: <20230918104153.24433-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::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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: 1695033765444100004 Introduce cpu_exec_reset_hold() which call an accelerator specific AccelOpsClass::cpu_reset_hold() handler. Define a stub on TCG user emulation, because CPU reset is irrelevant there. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- include/hw/core/cpu.h | 1 + include/sysemu/accel-ops.h | 1 + accel/tcg/user-exec-stub.c | 4 ++++ hw/core/cpu-common.c | 1 + softmmu/cpus.c | 7 +++++++ 5 files changed, 14 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 92a4234439..7bbfa81dcd 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1011,6 +1011,7 @@ void cpu_class_init_props(DeviceClass *dc); void cpu_exec_initfn(CPUState *cpu); void cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); +void cpu_exec_reset_hold(CPUState *cpu); =20 /** * target_words_bigendian: diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h index 3c1fab4b1e..ef91fc28bb 100644 --- a/include/sysemu/accel-ops.h +++ b/include/sysemu/accel-ops.h @@ -30,6 +30,7 @@ struct AccelOpsClass { 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 */ void (*kick_vcpu_thread)(CPUState *cpu); diff --git a/accel/tcg/user-exec-stub.c b/accel/tcg/user-exec-stub.c index 874e1f1a20..b1bf8bed89 100644 --- a/accel/tcg/user-exec-stub.c +++ b/accel/tcg/user-exec-stub.c @@ -16,6 +16,10 @@ void qemu_init_vcpu(CPUState *cpu) { } =20 +void cpu_exec_reset_hold(CPUState *cpu) +{ +} + /* User mode emulation does not support record/replay yet. */ =20 bool replay_exception(void) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index b3b5ce6702..b50bc22fb7 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -137,6 +137,7 @@ static void cpu_common_reset_hold(Object *obj) cpu->crash_occurred =3D false; cpu->cflags_next_tb =3D -1; =20 + cpu_exec_reset_hold(cpu); if (tcg_enabled()) { tcg_flush_jmp_cache(cpu); tcg_flush_softmmu_tlb(cpu); diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 0848e0dbdb..952f15868c 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -201,6 +201,13 @@ bool cpus_are_resettable(void) return true; } =20 +void cpu_exec_reset_hold(CPUState *cpu) +{ + if (cpus_accel->cpu_reset_hold) { + cpus_accel->cpu_reset_hold(cpu); + } +} + int64_t cpus_get_virtual_clock(void) { /* --=20 2.41.0 From nobody Tue May 21 00:08:22 2024 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=1695033807; cv=none; d=zohomail.com; s=zohoarc; b=NPCj+FIcP5KpaMcH8oww3cGeeQQua//MLXgQhk4TGn/w+vOVXaTkWryUghl1HVdbAnsAlT3K5Wc+DOh4j9fMJQ8fClLUnfYQb1Tw16eS/hdJt8eA1CQSS/2eLT0DNa3NzKS54lo5pP2nujB1xki51Dq77nbnh7ELG+07Pnf0FuU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695033807; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YZeRMydDkG6M2arrXdQxyoLJFYtUvfDVk8wUBcDyUf4=; b=Qqg/nB/OsX4I1kWrDIHfVyV9QL4902RyBFmoGo4rC9KmyH+CaEup2R+LqJ4qHklCZnE/c419Uw9rDgjuNjsEERZpLbbZ3Y2FWnjIydm97tuyVkm5cq3cQRX+Z8EX1RHCn9tfy/iFBbpBVzC6xtrhUNo1Y1YmC44Jl6w+Cy2kMlQ= 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 1695033807362832.4706472269227; Mon, 18 Sep 2023 03:43:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiBiK-0002xc-1x; Mon, 18 Sep 2023 06:42:48 -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 1qiBiI-0002wF-25 for qemu-devel@nongnu.org; Mon, 18 Sep 2023 06:42:46 -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 1qiBiG-0004Jo-5u for qemu-devel@nongnu.org; Mon, 18 Sep 2023 06:42:45 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31c65820134so3858389f8f.1 for ; Mon, 18 Sep 2023 03:42:43 -0700 (PDT) Received: from localhost.localdomain (5.red-88-29-175.dynamicip.rima-tde.net. [88.29.175.5]) by smtp.gmail.com with ESMTPSA id q11-20020adff50b000000b0031c71693449sm12314748wro.1.2023.09.18.03.42.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 18 Sep 2023 03:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695033762; x=1695638562; 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=YZeRMydDkG6M2arrXdQxyoLJFYtUvfDVk8wUBcDyUf4=; b=rvFfw7+DFMfZOpa4lyOgLD9yy2Elr4YEbIiGQKHzkwCRR8MqBhaTG7wHoU50GwFDEW htkRaOKoIephPHsLPMQwhyOjcQJoxGFU+v9ceO5k/Y58KSJ2vF6VZWY4zQcUMsYcZV6C N7Y1I3//ci9kCQeXKE+Uz6YfyHAwq7BLFfeGNPiqXpUBTidR/kF2YZ/cCdr5/enaG1Xi iufKtcpNkV3ZH2vYWW7NvHg6Hh0U7zWw8iysHgPmKZ9lfLK/OE6Jyxa/8si6R0Xkaps4 NTCvgcwsmjf1TVP0MGLLt0RHXQr0ybt4jff7l6jxRHWVl+A+XgS2gv7oxWmShR1unfde nLaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695033762; x=1695638562; 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=YZeRMydDkG6M2arrXdQxyoLJFYtUvfDVk8wUBcDyUf4=; b=qPOHcj2MnkTDruJ11CIeADaSHaz4Z7W2KdPLtmdFKs35CM91qxVviH8u+ZkILX9vFi hL/X6t058WoLC6Y/PwfXA9yB/GzCf6KJLRDi4Ihq1RjPeFOZhFaK6vhAQWBmLlJdLTDO gfGMsWQH4UKJVOOfI4Fpfn6nQMWW19R+klX8tBJOcRmEG9/lSvJZZDvibNJUG0FazrUZ 1lMvHU3lPE86t/CgNz5eqAc9i+2Q1culDJhbUBOqfX7xs80xjKZ0Pmh8LB2/Wi0Vw35k WzGn+1Pvy8YIwOmc7GiY+DCxvyBOfUdHmODm7mOMHc5hFfXj7civDeIulVXxighbLbsE fa3Q== X-Gm-Message-State: AOJu0YzSvCoaWxXCoqVmYLE3donVZLSRx7XAMILsJnLZick/zIv4XF0O 7Y+7qtBSMSXth5WcjGq3qUSYeylV1eOj2QwgzvWaoA== X-Google-Smtp-Source: AGHT+IEpHrazoyYQn3hRj0X36qJX+O62tVXQ1t1LpKqi6uBrkeq5HjtXGFZ4jCxPOAvnKp0CPyLxTQ== X-Received: by 2002:a5d:58e1:0:b0:319:79bb:980c with SMTP id f1-20020a5d58e1000000b0031979bb980cmr6614964wrd.64.1695033762316; Mon, 18 Sep 2023 03:42:42 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Anton Johansson , Riku Voipio , Richard Henderson , Claudio Fontana , Yanan Wang , Paolo Bonzini , Alessandro Di Federico , Fabiano Rosas , Marcel Apfelbaum , Daniel Henrique Barboza , Mahmoud Mandour , Eduardo Habkost , Alexandre Iooss , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 3/3] accel/tcg: Factor tcg_cpu_reset_hold() out Date: Mon, 18 Sep 2023 12:41:52 +0200 Message-ID: <20230918104153.24433-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230918104153.24433-1-philmd@linaro.org> References: <20230918104153.24433-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: 1695033808364100001 Factor the TCG specific code from cpu_common_reset_hold() to tcg_cpu_reset_hold() within tcg-accel-ops.c. Since this file is sysemu specific, we can inline tcg_flush_softmmu_tlb(), removing its declaration in "exec/cpu-common.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- include/exec/cpu-common.h | 2 -- accel/stubs/tcg-stub.c | 4 ---- accel/tcg/tcg-accel-ops.c | 8 ++++++++ accel/tcg/translate-all.c | 8 -------- hw/core/cpu-common.c | 5 ----- 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 1eff233565..d71b4d712d 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -38,8 +38,6 @@ void cpu_list_lock(void); void cpu_list_unlock(void); unsigned int cpu_list_generation_id_get(void); =20 -void tcg_flush_softmmu_tlb(CPUState *cs); - void tcg_iommu_init_notifier_list(CPUState *cpu); void tcg_iommu_free_notifier_list(CPUState *cpu); =20 diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index a9e7a2d5b4..8a496a2a6f 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -22,10 +22,6 @@ void tlb_set_dirty(CPUState *cpu, vaddr vaddr) { } =20 -void tcg_flush_jmp_cache(CPUState *cpu) -{ -} - int probe_access_flags(CPUArchState *env, vaddr addr, int size, MMUAccessType access_type, int mmu_idx, bool nonfault, void **phost, uintptr_t retaddr) diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 748539f289..0882464d03 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -78,6 +78,13 @@ int tcg_cpus_exec(CPUState *cpu) return ret; } =20 +static void tcg_cpu_reset_hold(CPUState *cpu) +{ + tcg_flush_jmp_cache(cpu); + + tlb_flush(cpu); +} + /* mask must never be zero, except for A20 change call */ void tcg_handle_interrupt(CPUState *cpu, int mask) { @@ -206,6 +213,7 @@ 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; diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index b2d4e22c17..0f3ed835cb 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -801,11 +801,3 @@ void tcg_flush_jmp_cache(CPUState *cpu) qatomic_set(&jc->array[i].tb, NULL); } } - -/* This is a wrapper for common code that can not use CONFIG_SOFTMMU */ -void tcg_flush_softmmu_tlb(CPUState *cs) -{ -#ifdef CONFIG_SOFTMMU - tlb_flush(cs); -#endif -} diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index b50bc22fb7..23040e0398 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -27,7 +27,6 @@ #include "qemu/main-loop.h" #include "exec/log.h" #include "exec/cpu-common.h" -#include "exec/tb-flush.h" #include "qemu/error-report.h" #include "qemu/qemu-print.h" #include "sysemu/tcg.h" @@ -138,10 +137,6 @@ static void cpu_common_reset_hold(Object *obj) cpu->cflags_next_tb =3D -1; =20 cpu_exec_reset_hold(cpu); - if (tcg_enabled()) { - tcg_flush_jmp_cache(cpu); - tcg_flush_softmmu_tlb(cpu); - } } =20 static bool cpu_common_has_work(CPUState *cs) --=20 2.41.0