From nobody Thu Apr 3 10:03:38 2025 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=1741276177; cv=none; d=zohomail.com; s=zohoarc; b=eeyaGxW93ISgMWUnGIVXEBJLffkWFKIlLdTrpz4hTFFOF3Tve4dvnZ13V3sKWGMfIEltKsLmAzDlRWm967+VkZEO3OhanrHKKYiGEcfduTMYC49qzlW2/3rEGB55BrQhnxk58n2MOwEdxot6yndTr2HQ4cyZ+E/eXbw6fSLkHLg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741276177; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=M9A95hGDz5OZUoNsympsnyo0yFXJkzG7hpn3X+K4ObM=; b=ScnrPgKwrAWhQvjv7emle5YSGzlp5dbamspsh9HKem4Vnw1YTW6+TyX6j+HUA6fGt1rSK5lvodrRCao6LgijOqgZjDESMojeCK7/egvNt3ga1Ol7382jz9aKO2a6BkYm86P7Mm7a5UxSnbSYuJxZH3k4wUFv74cKTxvS52QU6OA= 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 1741276177159507.0312662661577; Thu, 6 Mar 2025 07:49:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqDSX-0007lV-6S; Thu, 06 Mar 2025 10:48:29 -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 1tqDSO-0007jq-2Z for qemu-devel@nongnu.org; Thu, 06 Mar 2025 10:48:20 -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 1tqDSK-0006Fk-56 for qemu-devel@nongnu.org; Thu, 06 Mar 2025 10:48:18 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43bdc607c16so6556855e9.1 for ; Thu, 06 Mar 2025 07:48:15 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd42c5b33sm55877805e9.22.2025.03.06.07.48.13 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 06 Mar 2025 07:48:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741276094; x=1741880894; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=M9A95hGDz5OZUoNsympsnyo0yFXJkzG7hpn3X+K4ObM=; b=dAbFVFq7kq8b49w8+fUpHWcCb9U8aFnyNRJUH2vKa5Fc5TXF0DWTioMOm9YZkQiZg8 2Nqsuul9x1DJ4myHjgvt+HPv86wjXAVYcx43hg4eX+1aVEL3JN96gwtKogqAZNOkpJJW tY/x9vwRETkV98V1PhghPkLjR0t8YEsiMoZAh4H80u5iRXvFC8nyQgEI8NWQzVekWCbi 6QvT7OTQfHMZrpTXGVIIqiYRS2Q3ofSD7o3Gh+CI+GnezuyTtcp9jEeh56hnun3VxWJc jyxU3bO9JeRuaKlit+ZLB8OdTpNNqWSFUZD9LabMhJ7fHS3OjqvyuGFASCdYmrdTXaJu OKAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741276094; x=1741880894; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M9A95hGDz5OZUoNsympsnyo0yFXJkzG7hpn3X+K4ObM=; b=gzABuwbg3zhnb1NQ8YoM+SQNTyIy/5znFVR+VxCeKjMNDUMx9NxzP9zZHLCjRIInSn 0UFLBUVe73umomVPBWy98bZ5w/yl7ve6AhKH3cJHiej593Y/8ztT7efmffcx7ZfvQ4LK LuJyQ3O7ij3hDpLJawZCf40I1ZcOV8Zz1Q+t0PkrGcw5lFbgpF/YkUE1DS4Fy9F1lfOj fgN7S23AFjqnaqXGxxjENnZ19PPM474blKAaQIgUoZdzZIx9leBYPnmBngLa/3P8h07a Xzv3HTjb0GViQNORbv8mZfMDPXorq4aFDt66i0ug8mkH8GfWJH7xf43nvlUUHwSwMHhN oTdQ== X-Gm-Message-State: AOJu0YyeJ4GkO9rrj2aPgPSssZjXBBFf2MsC4mkkwMkK8LLyDFhm/NbL YNIpbvgoorsGYJPrhiEbe75QICxNXCGxBFioxnx+PWJmDNOI3a2dHUNv1g1/Y53fVBeNUZtLSCj Nir0= X-Gm-Gg: ASbGnctpySGg1KsURS0HHgetDaqHjMhZ7KjU5T7tvNscqypq90Z4piUPOIwXwiGtyvR Tt/nhWlMezzammYsPPnQFLFY4Hb/d3xMuluOaS5KRd/FpKDomodb4JYjOybMmaizpbPyy8YYfAx we20au6gphvTCsc3mp0j+0YdREXxr5RnBUi8N+sWYAEKEHJP2mR00YczrAiAh+G+pEUzZTnvW72 /qa/Zr8tqDD65H+XRFRE8U4rbjrlLXwMlI830z3yhUMoHBHSnRrzw5SEUJ9eGiCuGLEN31nVSNH Xk+bFsiXZEXvvJQSnyvPxdZrrde1QbagCpgk12GLSfVvNKNY/Iz4erwteBrL9Cj+j+PVXOmzjxa QhOS6owPC4lx9wjZf2Gw= X-Google-Smtp-Source: AGHT+IFz6mzpqHceLw8FKO7IXH1mBQK5UFN4W3Xbql906zu/kOUOh+xpQKO4rgdDnNnGIKjdQrRgdA== X-Received: by 2002:a05:600c:354a:b0:439:6ab6:5d45 with SMTP id 5b1f17b1804b1-43bd2ae5e59mr54759715e9.28.1741276094257; Thu, 06 Mar 2025 07:48:14 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 08/54] accel/tcg: Build tcg_flags helpers as common code Date: Thu, 6 Mar 2025 16:46:50 +0100 Message-ID: <20250306154737.70886-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250306154737.70886-1-philmd@linaro.org> References: <20250306154737.70886-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::32f; envelope-from=philmd@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=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: 1741276180353019100 While cpu-exec.c is build for each target,tcg_flags helpers aren't target specific. Move them to cpu-exec-common.c to build them once. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20250123234415.59850-8-philmd@linaro.org> --- accel/tcg/cpu-exec-common.c | 33 +++++++++++++++++++++++++++++++++ accel/tcg/cpu-exec.c | 32 -------------------------------- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c index 6ecfc4e7c21..100746d555a 100644 --- a/accel/tcg/cpu-exec-common.c +++ b/accel/tcg/cpu-exec-common.c @@ -18,6 +18,7 @@ */ =20 #include "qemu/osdep.h" +#include "exec/log.h" #include "system/cpus.h" #include "system/tcg.h" #include "qemu/plugin.h" @@ -25,6 +26,38 @@ =20 bool tcg_allowed; =20 +bool tcg_cflags_has(CPUState *cpu, uint32_t flags) +{ + return cpu->tcg_cflags & flags; +} + +void tcg_cflags_set(CPUState *cpu, uint32_t flags) +{ + cpu->tcg_cflags |=3D flags; +} + +uint32_t curr_cflags(CPUState *cpu) +{ + uint32_t cflags =3D cpu->tcg_cflags; + + /* + * Record gdb single-step. We should be exiting the TB by raising + * EXCP_DEBUG, but to simplify other tests, disable chaining too. + * + * For singlestep and -d nochain, suppress goto_tb so that + * we can log -d cpu,exec after every TB. + */ + if (unlikely(cpu->singlestep_enabled)) { + cflags |=3D CF_NO_GOTO_TB | CF_NO_GOTO_PTR | CF_SINGLE_STEP | 1; + } else if (qatomic_read(&one_insn_per_tb)) { + cflags |=3D CF_NO_GOTO_TB | 1; + } else if (qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { + cflags |=3D CF_NO_GOTO_TB; + } + + return cflags; +} + /* exit the current TB, but without causing any exception to be raised */ void cpu_loop_exit_noexc(CPUState *cpu) { diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 8b773d88478..be2ba199d3d 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -148,38 +148,6 @@ static void init_delay_params(SyncClocks *sc, const CP= UState *cpu) } #endif /* CONFIG USER ONLY */ =20 -bool tcg_cflags_has(CPUState *cpu, uint32_t flags) -{ - return cpu->tcg_cflags & flags; -} - -void tcg_cflags_set(CPUState *cpu, uint32_t flags) -{ - cpu->tcg_cflags |=3D flags; -} - -uint32_t curr_cflags(CPUState *cpu) -{ - uint32_t cflags =3D cpu->tcg_cflags; - - /* - * Record gdb single-step. We should be exiting the TB by raising - * EXCP_DEBUG, but to simplify other tests, disable chaining too. - * - * For singlestep and -d nochain, suppress goto_tb so that - * we can log -d cpu,exec after every TB. - */ - if (unlikely(cpu->singlestep_enabled)) { - cflags |=3D CF_NO_GOTO_TB | CF_NO_GOTO_PTR | CF_SINGLE_STEP | 1; - } else if (qatomic_read(&one_insn_per_tb)) { - cflags |=3D CF_NO_GOTO_TB | 1; - } else if (qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { - cflags |=3D CF_NO_GOTO_TB; - } - - return cflags; -} - struct tb_desc { vaddr pc; uint64_t cs_base; --=20 2.47.1