From nobody Mon Nov 25 12:41:58 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=1715759859; cv=none; d=zohomail.com; s=zohoarc; b=i2HM9JHLDFExVgQLPZV7GWp682H5GidGNdgpcuznRCjyLW5JsqCi9JYppXy7axDmQFymqlGx9IU25OJRdbvjdwI+Jj/x+fu1ALskivOGvsptEnXgQFwsYJUviAnA8KqOILTFev91hYtApHK57gQ6ZqJ+4UevP8lW6NepcrZ1bks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715759859; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=nAVbhs+RqNvGH8rJ76ZP56RL9rwGY3Fja1sdqAVH2vU=; b=g8tc/FxXFGnmLo9O0fEFIjxsQw2+hYCuYzBiILKlcFcmiKVgYcp/Kl/KdiZkuAwVucBVg3KlIX2BVA0BouIRFnCBFQAKfXjI9v5HHo+cf12qbKWo64XJls65i5toGBQGA+vA8zHMi4cicdkXQwnl1OJH9L+/cyHUJAfoxab+7jI= 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 1715759859906230.82599243594302; Wed, 15 May 2024 00:57:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s79Rj-0004Ay-LQ; Wed, 15 May 2024 03:53:07 -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 1s79Re-00047S-Ov for qemu-devel@nongnu.org; Wed, 15 May 2024 03:53:02 -0400 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s79Rc-0001aB-9z for qemu-devel@nongnu.org; Wed, 15 May 2024 03:53:02 -0400 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2e27277d2c1so87258511fa.2 for ; Wed, 15 May 2024 00:52:59 -0700 (PDT) Received: from stoup.. ([149.14.240.163]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccee9292sm222611855e9.37.2024.05.15.00.52.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 00:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715759578; x=1716364378; 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=nAVbhs+RqNvGH8rJ76ZP56RL9rwGY3Fja1sdqAVH2vU=; b=ZqU1SAMb72a2nrqKSrweOxm3I8zg1bPTw8TYNOS8U7IT3662bPrIiMKfUSMYk4dzS+ a3P6B16cp0VXWzx0Sh1glFQgBMXA+oybipod081YalNVN6mMUqsX8qEJM5uY42f5nrlZ Q3fpINdDFQ2JxBDwc8JoXBVLvRLh4nzHo8saQyxcvMQ7y9q0g4cCGvmLGkO13LfvTCe0 Q+i/2YXuHB3ODx7gTEjx84iD/s7FthsBv54FOHHE+zGHKdbU8w8lE8rKBsQW4Qj56lnw o4SCIbvBmHvMiDfZdoKKF5PHCUdVPT5AyM3neGKAShCJIvVeQwv2WBsO4+qRxPvS2OT6 PkLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715759578; x=1716364378; 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=nAVbhs+RqNvGH8rJ76ZP56RL9rwGY3Fja1sdqAVH2vU=; b=YfieW+WscxLIeBIzB9UAmY6ucho+tiiZZt7mMAuyfaGxb3uFNxAi/Duv0TSx3z//8m PeyQnrQvoW0t/QEVnxUIPRKPA28s6gx1JKyGElGHi71Ddfg531RuAkwe/2QECVcaoWKg lbN0toM20UYLcLlCs5aLPBy/88LrRwCyXGkpUxtucB2Fm33AyCw2A+S65yjqX2LOF5YE 5t4cZM+yqkU+SGxR0AuhywQrXp5gYQa3yQzT3P3JFwJaiqjKONd1c9S5tFf91j2x+E3z FkExvyRF/jK/hR3Wx4TXJC8f7hGhXNICvFfHS72St8rOnF5TDfaDmJuwitXburFiMODR LPlA== X-Gm-Message-State: AOJu0Yyv5kJGB46WoJ8dL0PqBCIwPKfG3HTQjnuQXmeW7jUrtvNFPTHD CCFdm7mC4gtwhjZavxL/RWrGOwhX4PRPjO06r0bvl10xfdHOSKV0UY/NdqstaUGfx2BHsk5Wohk JD8w= X-Google-Smtp-Source: AGHT+IG7mcS/uvkhCxXKpUA23tYHaP4Ag0Y/Ym0ofG5+1RkYGaNLPkPYDSKrEgKxBGDQdMVZe/ilhw== X-Received: by 2002:a2e:2a82:0:b0:2d4:3e82:117e with SMTP id 38308e7fff4ca-2e5203a4a9cmr97733391fa.32.1715759578722; Wed, 15 May 2024 00:52:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 14/34] plugins: Use DisasContextBase for qemu_plugin_tb_vaddr Date: Wed, 15 May 2024 09:52:27 +0200 Message-Id: <20240515075247.68024-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240515075247.68024-1-richard.henderson@linaro.org> References: <20240515075247.68024-1-richard.henderson@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::22c; envelope-from=richard.henderson@linaro.org; helo=mail-lj1-x22c.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: 1715759861646100006 We do not need to separately record the start of the TB. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- include/qemu/plugin.h | 1 - accel/tcg/plugin-gen.c | 3 +-- plugins/api.c | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index da0f37e269..7fda6ef126 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -118,7 +118,6 @@ struct qemu_plugin_scoreboard { struct qemu_plugin_tb { GPtrArray *insns; size_t n; - uint64_t vaddr; =20 /* if set, the TB calls helpers that might access guest memory */ bool mem_helper; diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index c36632e8df..b54494712a 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -188,7 +188,7 @@ static void plugin_gen_inject(struct qemu_plugin_tb *pl= ugin_tb) int insn_idx =3D -1; =20 if (unlikely(qemu_loglevel_mask(LOG_TB_OP_PLUGIN) - && qemu_log_in_addr_range(plugin_tb->vaddr))) { + && qemu_log_in_addr_range(tcg_ctx->plugin_db->pc_first)))= { FILE *logfile =3D qemu_log_trylock(); if (logfile) { fprintf(logfile, "OP before plugin injection:\n"); @@ -318,7 +318,6 @@ bool plugin_gen_tb_start(CPUState *cpu, const DisasCont= extBase *db) =20 ret =3D true; =20 - ptb->vaddr =3D db->pc_first; ptb->mem_helper =3D false; =20 tcg_gen_plugin_cb(PLUGIN_GEN_FROM_TB); diff --git a/plugins/api.c b/plugins/api.c index 0ae19774df..02014d4c6e 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -200,7 +200,8 @@ size_t qemu_plugin_tb_n_insns(const struct qemu_plugin_= tb *tb) =20 uint64_t qemu_plugin_tb_vaddr(const struct qemu_plugin_tb *tb) { - return tb->vaddr; + const DisasContextBase *db =3D tcg_ctx->plugin_db; + return db->pc_first; } =20 struct qemu_plugin_insn * --=20 2.34.1