From nobody Wed Nov 19 05:52:26 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.51 as permitted sender) client-ip=209.85.218.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1614680877; cv=none; d=zohomail.com; s=zohoarc; b=mNvhev/dtKcCDrImgqHCkznNkhKDdho2WvWRhNeOOeiS2eZw222cxZWnapa186AFl6lfj6/vA+3NyIycRhF5bkDpsDzGul4GHGfWw0fCIB+icOWOOiesaE2Dm3vHI/QTAfK8pqAB6UAOELNfKmThnj5JwklQmAvCsN4j4oRnk5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614680877; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CGeOm0jundDRZ1ITFIsaK/vmviPguy9Zg4MX9Tcr6Ys=; b=LStnKRNOetz+nEkswwdU8+yRYmgRN/3hLk9wed06uuZfsd6sl/DNibFCUF+B7Qibgikk2zfiHyA9UiiLlYk1ao6+jTplWCFh4tzeLUmeEpLiN6FmcggCC4igwpimm0FEHcM+PmIcUQiuHCQ3DgOTHWoEAHrWmzUZSA8JSl12K7E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by mx.zohomail.com with SMTPS id 1614680877633181.58937020957092; Tue, 2 Mar 2021 02:27:57 -0800 (PST) Received: by mail-ej1-f51.google.com with SMTP id gt32so22699508ejc.6 for ; Tue, 02 Mar 2021 02:27:56 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id l61sm19862564edl.37.2021.03.02.02.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 02:27:54 -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=CGeOm0jundDRZ1ITFIsaK/vmviPguy9Zg4MX9Tcr6Ys=; b=FxCLDzNz6QdYCdDoY45WVE53tN9ZvFhJ/jwMOjKC8oaESrRhF7MIdsPRyP/PtAqm45 +BZBOuCyrnW5MPhOgWZOSzYbh3paahSGCRQ+BUaZ/UmeZwaxbQHWfRjDf0fp35Qy5HzU a5e3aNUGk0z3rcrp+QAVUaIgdfatSvwNKaa6crhUO6Eun7l2V52NtDQz8pqtKIGUwUZ5 UIbY5lwY9ekZLR2GAVIaVLQqThMZlAqVGbXaJK6LQZzC03NFPWcwpCqAPA7gUflYxFGE bglfG+HwMOaZQ0gTvyITMOTpR1XZLX0vzBOgSXey+rBfV9NgonVfkwBMPHQzeJjiLxUf +WKQ== 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=CGeOm0jundDRZ1ITFIsaK/vmviPguy9Zg4MX9Tcr6Ys=; b=Bnhye3sG9F5Iqvpuwmn2ghBsgRkvv1ym+bD1cD41zYzndSVMacx4dtVQquQtwDAPnj Yb2APBBXsVrc8iZwatFNBsAFsDYlOMwGE9znnW7yHeoJ5nQFlEQE64SZZtOU5hVmOTRT 0xjyt8CBApQ0BryEOevobuLw+X02YYCXnRu2OjkNgR9bv45jk6ss8nqI1hzS/Qu19REx jXwXKLXDCvxgTbj88KB8k7DrdRYPWFNZkjaHClagnGx91qqtlukdcT9dYFMTgwsLhVqI 0VNELmGSGUe8d0ys9DcCuqG6Td08yfQg21GzKZpsF3HS9s8qpkXL+KvhHGw8azoVKDOq tlnQ== X-Gm-Message-State: AOAM5303unA2+IJvI1cQthaGfnvDqi/o8X3D/GVoGMnZeaLdiMAEhooT Cfl2gSmWeb+2OYuPJ76aeYc= X-Google-Smtp-Source: ABdhPJzO+Jhty7XbLj0/S3RSIAptV1dIz+4q3kpugmP/ye1w47tvloBRfq5MthO7lqIoxawRs1hMKg== X-Received: by 2002:a17:906:1b54:: with SMTP id p20mr14852707ejg.307.1614680874854; Tue, 02 Mar 2021 02:27:54 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yoshinori Sato , Chris Wulff , qemu-ppc@nongnu.org, Marcel Apfelbaum , Greg Kurz , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , Michael Walle , Palmer Dabbelt , Sarah Harris , Anthony Green , Eduardo Habkost , Bastian Koppelmann , Laurent Vivier , "Edgar E. Iglesias" , Claudio Fontana , Artyom Tarasenko , qemu-s390x@nongnu.org, Thomas Huth , Paolo Bonzini , Cornelia Huck , Taylor Simpson , Alistair Francis , Michael Rolnik , David Hildenbrand , Aleksandar Rikalo , Stafford Horne , Jiaxun Yang , Marek Vasut , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, David Gibson , Sagar Karandikar , Guan Xuetao , Max Filippov , Aurelien Jarno Subject: [PATCH 2/7] sysemu/tcg: Restrict qemu_tcg_mttcg_enabled() to TCG Date: Tue, 2 Mar 2021 11:27:32 +0100 Message-Id: <20210302102737.1031287-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210302102737.1031287-1-f4bug@amsat.org> References: <20210302102737.1031287-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) qemu_tcg_mttcg_enabled() shouldn't not be used outside of TCG, restrict its declaration. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 9 --------- include/sysemu/tcg.h | 9 +++++++++ accel/tcg/cpu-exec.c | 1 + tcg/tcg.c | 1 + 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index c005d3dc2d8..7f57e57464b 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -454,15 +454,6 @@ static inline void cpu_tb_jmp_cache_clear(CPUState *cp= u) } } =20 -/** - * qemu_tcg_mttcg_enabled: - * Check whether we are running MultiThread TCG or not. - * - * Returns: %true if we are in MTTCG mode %false otherwise. - */ -extern bool mttcg_enabled; -#define qemu_tcg_mttcg_enabled() (mttcg_enabled) - /** * cpu_paging_enabled: * @cpu: The CPU whose state is to be inspected. diff --git a/include/sysemu/tcg.h b/include/sysemu/tcg.h index fddde2b6b9a..c16c13c3c69 100644 --- a/include/sysemu/tcg.h +++ b/include/sysemu/tcg.h @@ -17,6 +17,15 @@ void tcg_exec_init(unsigned long tb_size, int splitwx); extern bool tcg_allowed; #define tcg_enabled() (tcg_allowed) =20 +/** + * qemu_tcg_mttcg_enabled: + * Check whether we are running MultiThread TCG or not. + * + * Returns: %true if we are in MTTCG mode %false otherwise. + */ +extern bool mttcg_enabled; +#define qemu_tcg_mttcg_enabled() (mttcg_enabled) + #endif /* CONFIG_TCG */ =20 #endif diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 16e4fe3ccd8..7e67ade35b9 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -39,6 +39,7 @@ #include "hw/i386/apic.h" #endif #include "sysemu/cpus.h" +#include "sysemu/tcg.h" #include "exec/cpu-all.h" #include "sysemu/cpu-timers.h" #include "sysemu/replay.h" diff --git a/tcg/tcg.c b/tcg/tcg.c index 63a12b197bf..4a4dac0bb3e 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -65,6 +65,7 @@ #include "elf.h" #include "exec/log.h" #include "sysemu/sysemu.h" +#include "sysemu/tcg.h" =20 /* Forward declarations for functions declared in tcg-target.c.inc and used here. */ --=20 2.26.2