From patchwork Wed May 15 07:52:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 796892 Delivered-To: patch@linaro.org Received: by 2002:a5d:452e:0:b0:34e:ceec:bfcd with SMTP id j14csp2854725wra; Wed, 15 May 2024 00:57:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU0x31PmZ5DHO7BJHxzMh6JJqCR3gWc0dTyRtrB9B9XxCDU6fY2Mtmlu4sdVz9/J9Y07PPdviIFATEvk3ccDQzx X-Google-Smtp-Source: AGHT+IERPo+5wtbCLGIGQFnSlXlvT+Ugbz740JmWTq2jh53Iz6w2NEukcsr/kE2fmBeBhpkkTY1T X-Received: by 2002:ac8:570a:0:b0:43d:f943:624c with SMTP id d75a77b69052e-43dfda8cacemr179217811cf.6.1715759859565; Wed, 15 May 2024 00:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715759859; cv=none; d=google.com; s=arc-20160816; b=tXxAYu39k9EhccqBaHUXjGeRr0t/jlWZtNk/hT3TlTdUkQrSXaSaKr5o9KxGp3zUgs AJzD8ZtQBl8BuFuynfRb95BZtU1eKTC2WKD5n7GX0COWPpkwMZKz3DEigZpnlnLELAYJ Ie88yfsYL6SSVv2kC8bvpBWDwyffru0STj0wtDsjmPFO1fRrN+s9hJ2YSNlvHnMVswkB +bZ4Kn7eTJg7fbBtiswhgu4HVD1B+hpy9O28/gCHgQITzITtHvX5dZLnlZOFfTJ5iAuV VDTNJ8/X9OfLmqdesMJSlaLbxkXeQ+3/fd0rAgwEwObn/Awm3IInoBNbVGwyaLw+YteQ Suew== 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=nAVbhs+RqNvGH8rJ76ZP56RL9rwGY3Fja1sdqAVH2vU=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=F1oJ9HoFg1NrTqKm83ClH3ZCU2XpObCE9zwPN0nwNCRqMya5bV2Fg3c65+BixrIzHu Co6vfCW5PGkJVfSoqfXrZJUCTtzbq+xGIACAQqjk8UKtTA1z9G5GlsltMyz/F6UJxIfy WS9lfYufhxyPScGiOY8lwhUGcTsHII/7Tcw8dna08/aDS7mScwWzCdwGbM36czgc77eo 8N2+JiPY0/lqAEyaErqASzyB0jpSqp0QaXcjbnUYI3HcZUZPqcgruo8jQRJ2qNkHwCQc lakTh6dtz4Ivz3HINGH1y/093OdL2oO2JOKZAhLerJ7lTHsHLwD0M+gBbnXJewM9cJKc fbeA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZqU1SAMb; 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 d75a77b69052e-43df7522ab7si135940171cf.697.2024.05.15.00.57.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2024 00:57:39 -0700 (PDT) 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=ZqU1SAMb; 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 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) 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-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) 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) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We do not need to separately record the start of the TB. Reviewed-by: Philippe Mathieu-Daudé 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; /* 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 *plugin_tb) int insn_idx = -1; 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 = qemu_log_trylock(); if (logfile) { fprintf(logfile, "OP before plugin injection:\n"); @@ -318,7 +318,6 @@ bool plugin_gen_tb_start(CPUState *cpu, const DisasContextBase *db) ret = true; - ptb->vaddr = db->pc_first; ptb->mem_helper = false; 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) uint64_t qemu_plugin_tb_vaddr(const struct qemu_plugin_tb *tb) { - return tb->vaddr; + const DisasContextBase *db = tcg_ctx->plugin_db; + return db->pc_first; } struct qemu_plugin_insn *