From nobody Tue Nov 18 06:04:49 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608127400; cv=none; d=zohomail.com; s=zohoarc; b=KgS8Mrxo7zaxtf6LJGvAVqJkS976JZmKCF2A6o09IzPgYXykDWP/nkTtIbNlOwsF4Rb+E4q4SrzivvjgBlArjax7KyiO3IREbnR068EwM3xfXeYYib2sB1+OZhh41NaNnO1zLiVZnnBl4/mDBfui3cwW7q08C4ktlqDFIMnyEGk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608127400; h=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=8qmwRQikb74xjNAftiZxC6fU3xdmkl7yKEzgeqPvSMw=; b=Q1wgw+tYbyGVRZvmgplDUyrtK4uqP7JJUaiuO+042ARklsRQN/r4li6x0OXKsVq71JPuZSoNYbPdhoPyzUY7JXK7o8ScJq/Wxmh9aw9bLvNMlVGjWY2Ce09bHIzdplSjd7KIZlhQji13dmE9UGTlHeeowEyC4ZqRDZmCzJSXUss= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1608127400272846.9021860302275; Wed, 16 Dec 2020 06:03:20 -0800 (PST) Received: from localhost ([::1]:47700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpXOe-0002rd-Oy for importer@patchew.org; Wed, 16 Dec 2020 09:03:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpXHF-0004xr-Ij for qemu-devel@nongnu.org; Wed, 16 Dec 2020 08:55:37 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:44984) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpXHD-0000sX-06 for qemu-devel@nongnu.org; Wed, 16 Dec 2020 08:55:37 -0500 Received: by mail-ej1-x62f.google.com with SMTP id w1so28155781ejf.11 for ; Wed, 16 Dec 2020 05:55:34 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id k16sm1423216ejd.78.2020.12.16.05.55.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 05:55:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8qmwRQikb74xjNAftiZxC6fU3xdmkl7yKEzgeqPvSMw=; b=aaIU3yLdGAiPa5nL2yscO0wr47gzrfrrtE4sjBvsPd+li8V2BVd68uKQ1eUCB4xW8a Vj3Ab0aVoq1IMl/XnrxDooVxOYbLAwsdkVQGN1QSquadlyLX9+EEk6g94im0a2R9OhzY AWWt/FZNDe0Atkf4eQgGV0qqA9Sa0AV7TpoPcTXFXrZzzTigR75MdwZM8hog0hjUVV4T djgG7mx02MicagWbnWr78w/p3SlB4nLuYIXT4THDOKWKv85CYR2qI5qFDLix04aiZJ3l voZXEE7WrnaumgQcuunYyysdBTmpKstzh2i4tyg+UdGzQBVj0yIUQ+wUwKDsjXyvJYXF cktA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8qmwRQikb74xjNAftiZxC6fU3xdmkl7yKEzgeqPvSMw=; b=m9LRxjtjpMEPyaDR73nA9NC/KrvLmD/rHgWp+FnTo3Zmosn+VlNiGMUrMDNJs1VswS ++zOkMPaj+5STNJ4cIrC0z6yl48UXKf1Mm80P9FnKFt66uyaHXqGeg8cLUw19Buj6gpv SsBKxKP4Ba7A9u3RwkXPeyX2SAqZ8IE/0qlhv8/EJQatxNMcsaX28KGzWNWNkapKlH2B uR/YZ36xjGbzOlnBKrJe0hhOepnAEh6HsSrLDSyrNPKJvF25vygOfa+x0QWtUDYDGePh sTvuYXnu1FeF0/Q/oO2ZPffyd2QiEHMLM45pwKy9fURoKw2iS6QFz26Qhm5DwcHm2Oob RlyQ== X-Gm-Message-State: AOAM5317e7eIlRvcFJj11dcB6A2NBXL0X7iDZ4wjTL7476lM9ZP9WjeR OGJ/rlMk3bhQ9XFr1WD/5JS1JDYpxYM= X-Google-Smtp-Source: ABdhPJz8CS7CDV2ogbrTuy68qSpfmb72mA1nvMHV8pCDGP+KzAPmsTi7BHcHW6w4WQUYR3xC/IJBFA== X-Received: by 2002:a17:906:710b:: with SMTP id x11mr32134364ejj.433.1608126933466; Wed, 16 Dec 2020 05:55:33 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 1/3] remove TCG includes from common code Date: Wed, 16 Dec 2020 14:55:27 +0100 Message-Id: <20201216135529.265165-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201216135529.265165-1-pbonzini@redhat.com> References: <20201216135529.265165-1-pbonzini@redhat.com> MIME-Version: 1.0 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::62f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philmd@redhat.com, richard.henderson@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Enable removing tcg/$tcg_arch from the include path when TCG is disabled. Move translate-all.h to include/exec, since stubs exist for the functions defined therein. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- accel/stubs/tcg-stub.c | 1 - accel/tcg/cputlb.c | 2 +- accel/tcg/translate-all.c | 2 +- accel/tcg/user-exec.c | 2 +- cpu.c | 2 +- hw/i386/kvmvapic.c | 1 - {accel/tcg =3D> include/exec}/translate-all.h | 0 monitor/misc.c | 1 - softmmu/physmem.c | 3 +-- 9 files changed, 5 insertions(+), 9 deletions(-) rename {accel/tcg =3D> include/exec}/translate-all.h (100%) diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index e4bbf997aa..8c18d3eabd 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -12,7 +12,6 @@ =20 #include "qemu/osdep.h" #include "cpu.h" -#include "tcg/tcg.h" #include "exec/exec-all.h" =20 void tb_flush(CPUState *cpu) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 42ab79c1a5..ced3dc077e 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -33,7 +33,7 @@ #include "exec/helper-proto.h" #include "qemu/atomic.h" #include "qemu/atomic128.h" -#include "translate-all.h" +#include "exec/translate-all.h" #include "trace/trace-root.h" #include "trace/mem.h" #ifdef CONFIG_PLUGIN diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index b7d50a73d4..a1803a1026 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -49,7 +49,7 @@ =20 #include "exec/cputlb.h" #include "exec/tb-hash.h" -#include "translate-all.h" +#include "exec/translate-all.h" #include "qemu/bitmap.h" #include "qemu/error-report.h" #include "qemu/qemu-print.h" diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 4ebe25461a..abb9555201 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -23,7 +23,7 @@ #include "tcg/tcg.h" #include "qemu/bitops.h" #include "exec/cpu_ldst.h" -#include "translate-all.h" +#include "exec/translate-all.h" #include "exec/helper-proto.h" #include "qemu/atomic128.h" #include "trace/trace-root.h" diff --git a/cpu.c b/cpu.c index 0c485cdf2d..0b245cda2e 100644 --- a/cpu.c +++ b/cpu.c @@ -34,7 +34,7 @@ #include "sysemu/tcg.h" #include "sysemu/kvm.h" #include "sysemu/replay.h" -#include "translate-all.h" +#include "exec/translate-all.h" #include "exec/log.h" =20 uintptr_t qemu_host_page_size; diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 077c3f4866..2c1898032e 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -21,7 +21,6 @@ #include "hw/sysbus.h" #include "hw/boards.h" #include "migration/vmstate.h" -#include "tcg/tcg.h" #include "qom/object.h" =20 #define VAPIC_IO_PORT 0x7e diff --git a/accel/tcg/translate-all.h b/include/exec/translate-all.h similarity index 100% rename from accel/tcg/translate-all.h rename to include/exec/translate-all.h diff --git a/monitor/misc.c b/monitor/misc.c index fde6e36a0b..9a132f73d1 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -77,7 +77,6 @@ #include "qapi/qmp-event.h" #include "sysemu/cpus.h" #include "qemu/cutils.h" -#include "tcg/tcg.h" =20 #if defined(TARGET_S390X) #include "hw/s390x/storage-keys.h" diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 2cd1de4a2c..67b53d39e4 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -25,7 +25,6 @@ #include "cpu.h" #include "exec/exec-all.h" #include "exec/target_page.h" -#include "tcg/tcg.h" #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/boards.h" @@ -53,7 +52,7 @@ =20 #include "qemu/rcu_queue.h" #include "qemu/main-loop.h" -#include "translate-all.h" +#include "exec/translate-all.h" #include "sysemu/replay.h" =20 #include "exec/memory-internal.h" --=20 2.28.0 From nobody Tue Nov 18 06:04:49 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608158315; cv=none; d=zohomail.com; s=zohoarc; b=DEtYef380vAWQokI6esK5RRg1hJPlR9eOmXK+3a3Xm6axYrzoN8lqCu5My5CT5RFziT7R18i8ZtmplJQoCwV6rrSuBuhuLHDd3Hp6RIiIfkyUCf1nhwyj97/9GePMW6GFEzRvXEjCPYSvckiKCZA5EgSGOx9R9OAshVWrQDRBtg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608158315; h=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=iOOVTid6TaZdEBZyZEIXgmDYaXapbxxAU5SjDeskRWA=; b=B4UGzgXf/iyzOvHS/BREurQhIUH0BNwB3yQc5XdZJSQsvB7TamXU+LCTzmEUySLiaxNU6kw0cyzyAw1Fiz8Pa7092Se0y7OxsEyzKFpnoFxva+67d+Smzh5OMSAPy1tXxpnCUAA6jh2RO8cDlC0FjqUvd9H3YpBxXeGV/ebshTA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1608158315336912.0948335281449; Wed, 16 Dec 2020 14:38:35 -0800 (PST) Received: from localhost ([::1]:52644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpXS3-00056C-0j for importer@patchew.org; Wed, 16 Dec 2020 09:06:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpXHH-000509-2a for qemu-devel@nongnu.org; Wed, 16 Dec 2020 08:55:39 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:42869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpXHD-0000t0-Tf for qemu-devel@nongnu.org; Wed, 16 Dec 2020 08:55:38 -0500 Received: by mail-ej1-x62f.google.com with SMTP id d17so32830093ejy.9 for ; Wed, 16 Dec 2020 05:55:35 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id k16sm1423216ejd.78.2020.12.16.05.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 05:55:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iOOVTid6TaZdEBZyZEIXgmDYaXapbxxAU5SjDeskRWA=; b=rIgSakw8g4yfUqcCtbM/UQ6UbPHGgchhnF8CR3DHhjm+mnpEW0yeTg6Q5bMsRUAtvf jjAExZwV4yyLYOwE9JVphdr2RhkpHRgSs/YTR7kf1m84Ix5LR4BFf2tOq3ta6gCJ0Sc5 SLEQGeetTM747JvGOhbMCIfDY1PpxhqKQLchJ0CJys3/BNi76idLJKhlC/ZBasC6GDp1 jFC9d/sb9dvnXbj+t1+uKtQ9HJ12yZQL+kD43ia0MH77Bon9Zo2yoNXCyIFQv0WZT073 I7mGe2Y1JEIu0w+7HqaDIZwAT2rd2TE72nXoF4hhkcI2yFMokccjk4kPnVJZFd2QOIaa 7Tdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iOOVTid6TaZdEBZyZEIXgmDYaXapbxxAU5SjDeskRWA=; b=SKH58eoC8GL4kKzfd08hW62MCIu8tj34dWCHXzw2fVkMQWB4VOX64bywqsdU4R7GFR NHh0SVCs/l4QJNX45lzqM7VYbuBONZO3cVLiy6k9Ct14nyttex237q2kvL2HefVxV87+ WmF4m4wWykdbR0qvM6k/WT43/SUSO+h8InWzUrtlI2YbXnJ1jXq3r7mzdtBZsMgTYeT5 ipH1Xn37Uqut+OXKYl4JAagFxJBRWemSGTbgf3jTcBn3sLNeF1ohufm02rFlOdiQMGN3 PPM6xm5vt1ry4riQTIAOFwoSTU5aGVpKGSHL0KFehbcTZGjw/mZ7YWbRuz7xAzMG5f+n guaQ== X-Gm-Message-State: AOAM533BbU480jY01vslp73zv+h67P8FM+QYjf1UUB8Fh+AF2Xt4vIa6 QZC+0qZFx2ErggfZoGrvqNs20cL8FMs= X-Google-Smtp-Source: ABdhPJyZsVXmbKKedlfbEQdDO/Q7KFnKCzi7sVve0Iyzj57HoDOSQy3NiY7WTMF2SC4WCJQRIto4Ng== X-Received: by 2002:a17:907:9705:: with SMTP id jg5mr31116789ejc.448.1608126934527; Wed, 16 Dec 2020 05:55:34 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 2/3] move icache flush out of tcg.h Date: Wed, 16 Dec 2020 14:55:28 +0100 Message-Id: <20201216135529.265165-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201216135529.265165-1-pbonzini@redhat.com> References: <20201216135529.265165-1-pbonzini@redhat.com> MIME-Version: 1.0 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::62f; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philmd@redhat.com, richard.henderson@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" icache flush is also used by non-TCG accelerators. Do not require users such as physmem.c to include tcg/tcg.h. Signed-off-by: Paolo Bonzini --- include/exec/flush-icache.h | 64 ++++++++++++++++++++++++++++++++++++++++ softmmu/physmem.c | 1 + tcg/aarch64/tcg-target.h | 5 ---- tcg/arm/tcg-target.h | 5 ---- tcg/i386/tcg-target.h | 4 --- tcg/mips/tcg-target.h | 11 ------- tcg/ppc/tcg-target.c.inc | 22 -------------- tcg/ppc/tcg-target.h | 1 - tcg/riscv/tcg-target.h | 5 ---- tcg/s390/tcg-target.h | 4 --- tcg/sparc/tcg-target.h | 8 ----- tcg/tcg.c | 1 + tcg/tci/tcg-target.h | 4 --- util/cacheinfo.c | 25 ++++++++++++++++ 14 files changed, 91 insertions(+), 69 deletions(-) create mode 100644 include/exec/flush-icache.h diff --git a/include/exec/flush-icache.h b/include/exec/flush-icache.h new file mode 100644 index 0000000000..77a7b80ab7 --- /dev/null +++ b/include/exec/flush-icache.h @@ -0,0 +1,64 @@ +/* + * icache flush for QEMU (both TCG or virtualized) + * + * Copyright (c) 2003-2020 QEMU contributors + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + */ + +#ifndef FLUSH_ICACHE_H +#define FLUSH_ICACHE_H + +#if defined HOST_I386 || defined HOST_X86_64 || defined HOST_S390 || defin= ed HOST_S390X +static inline void flush_icache_range(uintptr_t start, uintptr_t stop) +{ +} + +#elif defined HOST_MIPS +#ifdef __OpenBSD__ +#include +#else +#include +#endif + +static inline void flush_icache_range(uintptr_t start, uintptr_t stop) +{ + cacheflush ((void *)start, stop-start, ICACHE); +} + +#elif defined HOST_PPC || defined HOST_PPC64 +extern void flush_icache_range(uintptr_t start, uintptr_t stop); + +#elif defined HOST_SPARC +static inline void flush_icache_range(uintptr_t start, uintptr_t stop) +{ + uintptr_t p; + for (p =3D start & -8; p < ((stop + 7) & -8); p +=3D 8) { + __asm__ __volatile__("flush\t%0" : : "r" (p)); + } +} + +#elif defined HOST_AARCH64 || defined HOST_ARM || defined HOST_RISCV +static inline void flush_icache_range(uintptr_t start, uintptr_t stop) +{ + __builtin___clear_cache((char *)start, (char *)stop); +} +#elif defined CONFIG_TCG_INTERPRETER +static inline void flush_icache_range(uintptr_t start, uintptr_t stop) +{ + assert(tcg_enabled()); +} +#endif + +#endif diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 67b53d39e4..c6a3cb679e 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -53,6 +53,7 @@ #include "qemu/rcu_queue.h" #include "qemu/main-loop.h" #include "exec/translate-all.h" +#include "exec/flush-icache.h" #include "sysemu/replay.h" =20 #include "exec/memory-internal.h" diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index 663dd0b95e..8a6b97598e 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -148,11 +148,6 @@ typedef enum { #define TCG_TARGET_DEFAULT_MO (0) #define TCG_TARGET_HAS_MEMORY_BSWAP 1 =20 -static inline void flush_icache_range(uintptr_t start, uintptr_t stop) -{ - __builtin___clear_cache((char *)start, (char *)stop); -} - void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t); =20 #ifdef CONFIG_SOFTMMU diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 17e771374d..f1955ce4ac 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -134,11 +134,6 @@ enum { #define TCG_TARGET_DEFAULT_MO (0) #define TCG_TARGET_HAS_MEMORY_BSWAP 1 =20 -static inline void flush_icache_range(uintptr_t start, uintptr_t stop) -{ - __builtin___clear_cache((char *) start, (char *) stop); -} - /* not defined -- call should be eliminated at compile time */ void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t); =20 diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index abd4ac7fc0..cd067e0b30 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -206,10 +206,6 @@ extern bool have_avx2; #define TCG_TARGET_extract_i64_valid(ofs, len) \ (((ofs) =3D=3D 8 && (len) =3D=3D 8) || ((ofs) + (len)) =3D=3D 32) =20 -static inline void flush_icache_range(uintptr_t start, uintptr_t stop) -{ -} - static inline void tb_target_set_jmp_target(uintptr_t tc_ptr, uintptr_t jmp_addr, uintptr_t = addr) { diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index c6b091d849..92c1d63da3 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -198,20 +198,9 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_ext16u_i64 0 /* andi rt, rs, 0xffff */ #endif =20 -#ifdef __OpenBSD__ -#include -#else -#include -#endif - #define TCG_TARGET_DEFAULT_MO (0) #define TCG_TARGET_HAS_MEMORY_BSWAP 1 =20 -static inline void flush_icache_range(uintptr_t start, uintptr_t stop) -{ - cacheflush ((void *)start, stop-start, ICACHE); -} - void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t); =20 #ifdef CONFIG_SOFTMMU diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 18ee989f95..0d068ec8ab 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -3863,25 +3863,3 @@ void tcg_register_jit(void *buf, size_t buf_size) tcg_register_jit_int(buf, buf_size, &debug_frame, sizeof(debug_frame)); } #endif /* __ELF__ */ - -void flush_icache_range(uintptr_t start, uintptr_t stop) -{ - uintptr_t p, start1, stop1; - size_t dsize =3D qemu_dcache_linesize; - size_t isize =3D qemu_icache_linesize; - - start1 =3D start & ~(dsize - 1); - stop1 =3D (stop + dsize - 1) & ~(dsize - 1); - for (p =3D start1; p < stop1; p +=3D dsize) { - asm volatile ("dcbst 0,%0" : : "r"(p) : "memory"); - } - asm volatile ("sync" : : : "memory"); - - start &=3D start & ~(isize - 1); - stop1 =3D (stop + isize - 1) & ~(isize - 1); - for (p =3D start1; p < stop1; p +=3D isize) { - asm volatile ("icbi 0,%0" : : "r"(p) : "memory"); - } - asm volatile ("sync" : : : "memory"); - asm volatile ("isync" : : : "memory"); -} diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index be10363956..a509a19628 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -175,7 +175,6 @@ extern bool have_vsx; #define TCG_TARGET_HAS_bitsel_vec have_vsx #define TCG_TARGET_HAS_cmpsel_vec 0 =20 -void flush_icache_range(uintptr_t start, uintptr_t stop); void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t); =20 #define TCG_TARGET_DEFAULT_MO (0) diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index 032439d806..c1bd52bb9a 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -159,11 +159,6 @@ typedef enum { #define TCG_TARGET_HAS_mulsh_i64 1 #endif =20 -static inline void flush_icache_range(uintptr_t start, uintptr_t stop) -{ - __builtin___clear_cache((char *)start, (char *)stop); -} - /* not defined -- call should be eliminated at compile time */ void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t); =20 diff --git a/tcg/s390/tcg-target.h b/tcg/s390/tcg-target.h index 63c8797bd3..b4feb2f55a 100644 --- a/tcg/s390/tcg-target.h +++ b/tcg/s390/tcg-target.h @@ -145,10 +145,6 @@ enum { TCG_AREG0 =3D TCG_REG_R10, }; =20 -static inline void flush_icache_range(uintptr_t start, uintptr_t stop) -{ -} - static inline void tb_target_set_jmp_target(uintptr_t tc_ptr, uintptr_t jmp_addr, uintptr_t = addr) { diff --git a/tcg/sparc/tcg-target.h b/tcg/sparc/tcg-target.h index 633841ebf2..d8b0e32e2e 100644 --- a/tcg/sparc/tcg-target.h +++ b/tcg/sparc/tcg-target.h @@ -168,14 +168,6 @@ extern bool use_vis3_instructions; #define TCG_TARGET_DEFAULT_MO (0) #define TCG_TARGET_HAS_MEMORY_BSWAP 1 =20 -static inline void flush_icache_range(uintptr_t start, uintptr_t stop) -{ - uintptr_t p; - for (p =3D start & -8; p < ((stop + 7) & -8); p +=3D 8) { - __asm__ __volatile__("flush\t%0" : : "r" (p)); - } -} - void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t); =20 #define TCG_TARGET_NEED_POOL_LABELS diff --git a/tcg/tcg.c b/tcg/tcg.c index 43c6cf8f52..9974bb3c56 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -43,6 +43,7 @@ #include "cpu.h" =20 #include "exec/exec-all.h" +#include "exec/flush-icache.h" =20 #if !defined(CONFIG_USER_ONLY) #include "hw/boards.h" diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 8c1c1d265d..b84480f989 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -191,10 +191,6 @@ void tci_disas(uint8_t opc); =20 #define HAVE_TCG_QEMU_TB_EXEC =20 -static inline void flush_icache_range(uintptr_t start, uintptr_t stop) -{ -} - /* We could notice __i386__ or __s390x__ and reduce the barriers depending on the host. But if you want performance, you use the normal backend. We prefer consistency across hosts on this. */ diff --git a/util/cacheinfo.c b/util/cacheinfo.c index 7804c186b6..b49093106d 100644 --- a/util/cacheinfo.c +++ b/util/cacheinfo.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "qemu/host-utils.h" #include "qemu/atomic.h" +#include "exec/flush-icache.h" =20 int qemu_icache_linesize =3D 0; int qemu_icache_linesize_log; @@ -177,6 +178,30 @@ static void fallback_cache_info(int *isize, int *dsize) } } =20 +#if defined HOST_PPC || defined HOST_PPC64 +void flush_icache_range(uintptr_t start, uintptr_t stop) +{ + uintptr_t p, start1, stop1; + size_t dsize =3D qemu_dcache_linesize; + size_t isize =3D qemu_icache_linesize; + + start1 =3D start & ~(dsize - 1); + stop1 =3D (stop + dsize - 1) & ~(dsize - 1); + for (p =3D start1; p < stop1; p +=3D dsize) { + asm volatile ("dcbst 0,%0" : : "r"(p) : "memory"); + } + asm volatile ("sync" : : : "memory"); + + start &=3D start & ~(isize - 1); + stop1 =3D (stop + isize - 1) & ~(isize - 1); + for (p =3D start1; p < stop1; p +=3D isize) { + asm volatile ("icbi 0,%0" : : "r"(p) : "memory"); + } + asm volatile ("sync" : : : "memory"); + asm volatile ("isync" : : : "memory"); +} +#endif + static void __attribute__((constructor)) init_cache_info(void) { int isize =3D 0, dsize =3D 0; --=20 2.28.0 From nobody Tue Nov 18 06:04:49 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608158286; cv=none; d=zohomail.com; s=zohoarc; b=JjDpoTvVShB803WPeSuO26xqgL2DfgF0LoW7uYC/nO4IyUzrai8HvnMBAqgQhWJPMmO4sT4Gs6S4hvSyF0i+UEwyboBA6aA3KHr0l5I27k/iqfkrNKOL3Pf/MBBiQHayr9ZlJFavrUM2+lQqS69c48ROfT3K7LH4+DJjLWYUBIA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608158286; h=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=TOvyryI/ojr/jC4/X02aXVcr3f4plnWTz+dxfZUgd1c=; b=U5DuJ95r6cgj9mepPLUGPJe4ND0v04Z8ai7nE5VemzN+kAPwQk4stfuh70VpJHD/Lcnk4ace1nePRB38WOsINyJiGwSo6cxv5tix43naSIRqMFEwwd8mnopbwndMGrWef4w1tEetAg5NaH0ypvlpslIzH+HwDKIYNi+Er/u9TCM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1608158286773100.55888617650419; Wed, 16 Dec 2020 14:38:06 -0800 (PST) Received: from localhost ([::1]:59196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpXU3-0007qx-Nd for importer@patchew.org; Wed, 16 Dec 2020 09:08:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpXHK-000550-CA for qemu-devel@nongnu.org; Wed, 16 Dec 2020 08:55:42 -0500 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]:32927) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpXHE-0000tV-Vd for qemu-devel@nongnu.org; Wed, 16 Dec 2020 08:55:42 -0500 Received: by mail-ej1-x62b.google.com with SMTP id b9so7889756ejy.0 for ; Wed, 16 Dec 2020 05:55:36 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id k16sm1423216ejd.78.2020.12.16.05.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 05:55:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TOvyryI/ojr/jC4/X02aXVcr3f4plnWTz+dxfZUgd1c=; b=DY0YYo+LhQju5hh0mfiDBE7Li/esELWPO4DgirH+/oQm8zyTIqiadBHyLajHwhN3NQ HVWcGejkUZ6T3byOiHeTtGTEzR8Yy+HQaiY0hNDc4+c3Cr7n1hsH9NOl2RnDXo5JlYb+ s0YEzcK/zG3IRzcTxKJ9qebjtqyE6J9w+waIKJUhw77DJghNz5F96Zhe88PinkfH6AUn Kf9apl7acBM3YoxAEZkNWPfwXcQ812OQQzCvG0U1doHnYAS4tKfvhuL1cwrFo3ojk9L3 BLUemgkai90rswJR53cAa47Bq3vghezGjE/IFaxOXsDmQCZ3hUwwCpSFc+6Mi2hyAxp3 EatQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TOvyryI/ojr/jC4/X02aXVcr3f4plnWTz+dxfZUgd1c=; b=RJkrzfZwysBNxkxWqC36TdHy4piONudDpy27zb8lNRZFRvLhVyhbUAWWrE1vnyrSCH xlP8gra6sDUWZkofU2GS8FjzMRV4HHii66EfLwPxLrmTDnjMVPzcKu/3ZxaPqTaaCN/a jh5XPM5K8CbEuuLkYkKakH1oR9DKYPGMMTe0wrfG4Eg7LuGUJ8CLamzpsaCTBAvKyzE1 pTlfczui1+js20eL3jX9+OnSZm5kFVxE7YKs21SWAgsNaTmXyr4JS+r36ohVfEzYhc5Y qWuSDazEpqzRsqxFjzwL7L8mwnx5mp14lZ6+YBXDwgNFRgMQjxytEvqBcAKnGB8WyUwN VynQ== X-Gm-Message-State: AOAM532r/9rKDuYx/DXeabm3U3xgsLKidhZzMruadiEDwZ56+K1VtLr/ /Cl+xQ8gjbPPeBINQYQUaMD1ZVjl68w= X-Google-Smtp-Source: ABdhPJw8Nk8in4B+f/8SgzkXjhIpehRuSpR6jLzUZ/HDHCFHc+V5Wb2b6tKjeT5fZgknFNX9BS36DQ== X-Received: by 2002:a17:906:895:: with SMTP id n21mr30664554eje.52.1608126935577; Wed, 16 Dec 2020 05:55:35 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 3/3] trace: do not include TCG helper tracepoints in no-TCG builds Date: Wed, 16 Dec 2020 14:55:29 +0100 Message-Id: <20201216135529.265165-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201216135529.265165-1-pbonzini@redhat.com> References: <20201216135529.265165-1-pbonzini@redhat.com> MIME-Version: 1.0 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::62b; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philmd@redhat.com, richard.henderson@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini Acked-by: Richard Henderson --- trace/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trace/meson.build b/trace/meson.build index 3fa760f568..012d0dbceb 100644 --- a/trace/meson.build +++ b/trace/meson.build @@ -71,7 +71,7 @@ foreach d : [ input: meson.project_source_root() / 'trace-events', command: [ tracetool, '--group=3Droot', '--format=3D@0@'.f= ormat(d[1]), '@INPUT@' ], capture: true) - specific_ss.add(gen) + specific_ss.add(when: 'CONFIG_TCG', if_true: gen) endforeach =20 if 'CONFIG_TRACE_UST' in config_host --=20 2.28.0