From patchwork Fri Dec 16 11:22:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 634416 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp739745pvb; Fri, 16 Dec 2022 03:24:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf4XDAqDPNWJBM8KPPaOBpSYMVPzryVhjbZWBboldqd7WQKmbD2cyEWuGeQvbufnIUcIjwzo X-Received: by 2002:a0c:ed46:0:b0:4dd:6e9f:697d with SMTP id v6-20020a0ced46000000b004dd6e9f697dmr28701630qvq.25.1671189843747; Fri, 16 Dec 2022 03:24:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671189843; cv=none; d=google.com; s=arc-20160816; b=hQWxFGeeDQjMQC1kcrfYU0pPIR8LjwLdzFjvEs3sD6+9B6xfFdTxnq4cVzpbk+nsxg /oPou7wttBU1VxSrjq83EPHLi869EhJxX0tDRTyoUGSe92cTEqkCG3fegyu2LHQ/Ikl/ 0oZ7m8sqMdXWFEV+w/8trkyEeNIlQomhs/DIUn0hqVvV6IVBZ6nqAcDbY1+NpF3mA08A ZRCWDn60iNHZiHBj3In+ymLiGdDMiyUWy3B8S1s892CMZz+D25FEmxNNPMIoX1i7AIPx EEMqLtLN2f2vu27Vytcudp2DNjGO/oaYlUbIDyPxbULMp4yNJ70FeiDPfxnm0C2eNaP0 U4Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2SnyGDlnuhSa055HYEbK0Sz9hf/vlp1eR2l+Jrskvn4=; b=bD3zKpz5xhwiOWd225qwtHvh7LMotSTmQJnNuvrQrTmuO9IZbAaZYfKa9r65Qj3fqm Vyl0EXLEO6nziiHaATQ7ra02KmkqyJ4t8CaHElrf/rDYCqodQ55EGMUcEoUa9IRT5Rbh A0rQYh7cQoIZL1zO3gnMK320nRtEkKwEUrihtpWsO8NROztEFgC9CcRdxGuL2eTiTPpK 6vWoQ86r5BYq+l/6KPR30xTxpUDn3DgUvYXAt1ibFQPUIEigBIfChL4KZx1ZISPxTUAG fhK0MV4QCeIWTYYwatBR8UsOux4irssznaFSIJisaiug/aTf3c1+sw8+MoHtSF932uzw XO9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=toU0Z5Hy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 75-20020a370c4e000000b006fa2e7dc051si828409qkm.482.2022.12.16.03.24.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Dec 2022 03:24:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=toU0Z5Hy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p68nB-00024z-LA; Fri, 16 Dec 2022 06:22:17 -0500 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 1p68n9-00023O-Bg for qemu-devel@nongnu.org; Fri, 16 Dec 2022 06:22:15 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p68n7-00068L-5E for qemu-devel@nongnu.org; Fri, 16 Dec 2022 06:22:15 -0500 Received: by mail-wm1-x32f.google.com with SMTP id f13-20020a1cc90d000000b003d08c4cf679so1493183wmb.5 for ; Fri, 16 Dec 2022 03:22:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=2SnyGDlnuhSa055HYEbK0Sz9hf/vlp1eR2l+Jrskvn4=; b=toU0Z5Hy8gTq7fEgcVP5qKn9iNVH4hXTYVexolQQ5czTj17ajtOfYlf3PiuT6ZwzaF LmCE+siDDG+g9iU9kbgDu+WQlOt3Sk2VT6M4tv0Xs3FuKgxXtjDeBrBDL5fS+Hkus0Zo Hom19g7tRo/NOiIoN+R5pGmpRqH1mrDqY1/Pf2HfRY+ge82xyEjgAbvbGZ76EnA26rzB SvzA4JmZlbZ2gp8VQUUrgGUiF2xeVemhJypZCc+gSp6+koveBb/HnFqL5P4rz3NfJsOK AoTiRbSPk0MYpctkRlZTEA4u1If8EHemxw85Lde5PaJtn3qXDyEeShYvvbuja5AV3jk1 40vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=2SnyGDlnuhSa055HYEbK0Sz9hf/vlp1eR2l+Jrskvn4=; b=P6GGWyaUDjIVjmCx/peLdQSBFDmLaMw4+hOLPckrLTHM0F16QvomLbN36igDWBbIhC LsjAKW8hvvEUuFSUo+8W/nVfjhdVnLzyAdgGYO59DAG5cB88aDsEPblxw69aNzRt/xw+ Bd1sWGdqwdMZljs0RDTK8sDjMfodCJ3aEyvfYPHaOnp2nQlXwtpAUATVNf/dOwYa06wM 36En8k8ir9et1OWWDRJY8u80whVyAWNLSy1kPb+FxzSXbMiqCw2eeHdnqHteX8TfsFWd JJHGFRoMJzeS6tAa2K8lfdq9C+uHXdWgAOJUVZLFGoSZ4ld4xB20HalTTFdIax3cVS/d lGLw== X-Gm-Message-State: AFqh2kqs314Sz6zJYsYEmJcmHDRGlbG4lB1WEBOG41/5yiINETWmPH4v gc7H2fu4t38P0BqQiUeoIIXSng== X-Received: by 2002:a1c:f710:0:b0:3d3:3a9d:2fe with SMTP id v16-20020a1cf710000000b003d33a9d02femr4452727wmh.6.1671189731517; Fri, 16 Dec 2022 03:22:11 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id y18-20020a5d4ad2000000b002365cd93d05sm2037892wrs.102.2022.12.16.03.22.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 03:22:09 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9609F1FFBE; Fri, 16 Dec 2022 11:22:07 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: f4bug@amsat.org, mads@ynddal.dk, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Yanan Wang , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , David Gibson , Greg Kurz , Laurent Vivier , Alexandre Iooss , Mahmoud Mandour , Palmer Dabbelt , Alistair Francis , Bin Meng , qemu-ppc@nongnu.org (open list:sPAPR (pseries)), qemu-riscv@nongnu.org (open list:RISC-V TCG CPUs) Subject: [PATCH v1 06/10] includes: move tb_flush into its own header Date: Fri, 16 Dec 2022 11:22:02 +0000 Message-Id: <20221216112206.3171578-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221216112206.3171578-1-alex.bennee@linaro.org> References: <20221216112206.3171578-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This aids subsystems (like gdbstub) that want to trigger a flush without pulling target specific headers. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v2 - actually include the header and rename to tb-flush.h --- include/exec/exec-all.h | 1 - include/exec/tb-flush.h | 19 +++++++++++++++++++ linux-user/user-internals.h | 1 + accel/stubs/tcg-stub.c | 1 + accel/tcg/tb-maint.c | 1 + accel/tcg/translate-all.c | 1 + cpu.c | 1 + gdbstub/gdbstub.c | 1 + hw/ppc/spapr_hcall.c | 1 + plugins/core.c | 1 + plugins/loader.c | 2 +- target/alpha/sys_helper.c | 1 + target/riscv/csr.c | 1 + 13 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 include/exec/tb-flush.h diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 9b7bfbf09a..6be541a85f 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -648,7 +648,6 @@ void tb_invalidate_phys_addr(target_ulong addr); #else void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr, MemTxAttrs attrs); #endif -void tb_flush(CPUState *cpu); void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr); void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end); void tb_set_jmp_target(TranslationBlock *tb, int n, uintptr_t addr); diff --git a/include/exec/tb-flush.h b/include/exec/tb-flush.h new file mode 100644 index 0000000000..fb094a9502 --- /dev/null +++ b/include/exec/tb-flush.h @@ -0,0 +1,19 @@ +/* + * tb-flush prototype for use by the rest of the system. + * + * Copyright (c) 2022 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef _TB_FLUSH_H_ +#define _TB_FLUSH_H_ + +/* + * The following tb helpers don't require the caller to have any + * target specific knowledge (CPUState can be treated as an anonymous + * pointer for most). + */ + +void tb_flush(CPUState *cpu); + +#endif /* _TB_FLUSH_H_ */ diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index 0280e76add..ea11549c41 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -20,6 +20,7 @@ #include "exec/user/thunk.h" #include "exec/exec-all.h" +#include "exec/tb-flush.h" #include "qemu/log.h" extern char *exec_path; diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index c1b05767c0..e0d371c3a7 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -11,6 +11,7 @@ */ #include "qemu/osdep.h" +#include "exec/tb-flush.h" #include "exec/exec-all.h" void tb_flush(CPUState *cpu) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 0cdb35548c..4610208fe8 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -21,6 +21,7 @@ #include "exec/cputlb.h" #include "exec/log.h" #include "exec/exec-all.h" +#include "exec/tb-flush.h" #include "exec/translate-all.h" #include "sysemu/tcg.h" #include "tcg/tcg.h" diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index ac3ee3740c..eb8853a50c 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -47,6 +47,7 @@ #include "exec/cputlb.h" #include "exec/translate-all.h" #include "exec/translator.h" +#include "exec/tb-flush.h" #include "qemu/bitmap.h" #include "qemu/qemu-print.h" #include "qemu/timer.h" diff --git a/cpu.c b/cpu.c index 4a7d865427..1a374ac4a8 100644 --- a/cpu.c +++ b/cpu.c @@ -36,6 +36,7 @@ #include "sysemu/replay.h" #include "exec/cpu-common.h" #include "exec/exec-all.h" +#include "exec/tb-flush.h" #include "exec/translate-all.h" #include "exec/log.h" #include "hw/core/accel-cpu.h" diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index bc43aaf825..28f97a55ea 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -46,6 +46,7 @@ #include "sysemu/runstate.h" #include "semihosting/semihost.h" #include "exec/exec-all.h" +#include "exec/tb-flush.h" #include "exec/hwaddr.h" #include "sysemu/replay.h" diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 925ff523cc..ec4def62f8 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -8,6 +8,7 @@ #include "qemu/module.h" #include "qemu/error-report.h" #include "exec/exec-all.h" +#include "exec/tb-flush.h" #include "helper_regs.h" #include "hw/ppc/ppc.h" #include "hw/ppc/spapr.h" diff --git a/plugins/core.c b/plugins/core.c index ccb770a485..584b5f3c5e 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -24,6 +24,7 @@ #include "exec/cpu-common.h" #include "exec/exec-all.h" +#include "exec/tb-flush.h" #include "exec/helper-proto.h" #include "tcg/tcg.h" #include "tcg/tcg-op.h" diff --git a/plugins/loader.c b/plugins/loader.c index 88c30bde2d..809f3f9b13 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -29,7 +29,7 @@ #include "qemu/plugin.h" #include "qemu/memalign.h" #include "hw/core/cpu.h" -#include "exec/exec-all.h" +#include "exec/tb-flush.h" #ifndef CONFIG_USER_ONLY #include "hw/boards.h" #endif diff --git a/target/alpha/sys_helper.c b/target/alpha/sys_helper.c index 25f6cb8894..c83c92dd4c 100644 --- a/target/alpha/sys_helper.c +++ b/target/alpha/sys_helper.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/tb-flush.h" #include "exec/helper-proto.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h" diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 5c9a7ee287..b02a536bbc 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -25,6 +25,7 @@ #include "time_helper.h" #include "qemu/main-loop.h" #include "exec/exec-all.h" +#include "exec/tb-flush.h" #include "sysemu/cpu-timers.h" #include "qemu/guest-random.h" #include "qapi/error.h"