From patchwork Fri Apr 5 10:24:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 786219 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1101:b0:343:f27d:c44e with SMTP id z1csp92946wrw; Fri, 5 Apr 2024 03:26:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV0nYNkiJZ6fSSEbtWMaIr1IryeV9HmMPQm8GBH0eOZ5JEmC1PssYZscugAmlZRH0IwJQu3+EmYwtsfwe5dVuCe X-Google-Smtp-Source: AGHT+IH0hF+LUsTJuOT6CG8vK9AycWfVI5aL2qMjm2OlhPNVIH78guVcls6iUU6HRh/TVhUGDsn4 X-Received: by 2002:a0d:df4e:0:b0:615:119c:b590 with SMTP id i75-20020a0ddf4e000000b00615119cb590mr761787ywe.1.1712312812205; Fri, 05 Apr 2024 03:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712312812; cv=none; d=google.com; s=arc-20160816; b=crkU0I3h8GRwnWxYJjzOn8GcgkrUiOqwNob8sCQTKtBl128H4sWxdIh1xngyd6Cykb yKSSLUY7NoTXHzeUY9rtR1gBs5c2GIo2+JSOg6THI9ICxVD+tmex1V/97iWLgTrJ2Q14 vlOlxI8WoB5TFB4RCPKEDYxxHY7tNTjy3cK2/ifTo7FuLuQo++4p5KKWwFYQru/QQX8T tdj6sHGQ2gKscmeOXjnr3UnBfaVtWGVbiDdhuoGImzhLA2UIGtKYYFdPNhxjgDtZQ7rY KY945pWbvUocf0FZQVNsocRCNgXkCti51443bs2fftreX72eOEdRUEKqQg5BXo4UjEuD T+qA== 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:to:from :dkim-signature; bh=bO7B6oUNG3jW/PSuoPnzK0oY+ojFYCsg6W4mPRZ3c4k=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=n3llkB/W3xA3TQp0VlionBKS4zSeOuWxioA54qFDzqbjEhZqOxd9dsXQb9jX4Xvggz 0T7JjG2ClZnGTHlhBIz8JRvlrNFo+YG6jjffMQmVgpMbwY1GwD+QcbHTCzt5K7BIu5R+ gFBEO48JKjz/fTChoYFSy5yH20g+xAwp0yhE3ketbnBxYjtcG0uDBhzK+g+NkSHeIr// VGA/1wKGRehnA5awmbK4TSZZA5X7I44jhmW12CSWMb9kuDUks6aH/enQ8ljkL/PWCPWF zYhXhCkAK25yNq1emyQKac+7Bc0KbQyJlLpk4H+mVFhFjR+kjhGKvxDwA/q0ARkEP7eL cvGw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q7V1F0+J; 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 s4-20020ac85cc4000000b0043461799ea7si663149qta.742.2024.04.05.03.26.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Apr 2024 03:26:52 -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=Q7V1F0+J; 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 1rsglB-000608-Qk; Fri, 05 Apr 2024 06:25:25 -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 1rsgl9-0005zc-B9 for qemu-devel@nongnu.org; Fri, 05 Apr 2024 06:25:23 -0400 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rsgl7-0004k8-4r for qemu-devel@nongnu.org; Fri, 05 Apr 2024 06:25:22 -0400 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-22edec341c2so90064fac.0 for ; Fri, 05 Apr 2024 03:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712312720; x=1712917520; 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=bO7B6oUNG3jW/PSuoPnzK0oY+ojFYCsg6W4mPRZ3c4k=; b=Q7V1F0+JGJD+pR/8/qfqzKpVF1C9sZmbWp6eMtJ+Y9buIo7/vL3XbNvWSm9Jb3Ic2w O2mteVmNKfLfb5FYDUj8H8kuy4zCRiTzgDy6dViYeRYgdz6ZC4jjlVm3OBPNobJOIhWN d85yyVazuIcvqCwDDbGW3xTILhiuhrUS5HP3C9tKN0IhOiLussUdqMCf5hqj42IEFRS+ XGPPf1lpN6L3l/hLmP+5lpZ/JXHHp/FmXlPvAqZ4zPq5Nh4f6sWlRhTvnqulZgsQICx/ t7Q+pEStV5TlFt7HQ9H5ji/UUu4+rYQKTTg/elz8ey5wsI7DGz/O472b327mj/Ipo8a3 4x7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712312720; x=1712917520; 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=bO7B6oUNG3jW/PSuoPnzK0oY+ojFYCsg6W4mPRZ3c4k=; b=FJs7VYQ67PHA3hF4eg9BLThoDkjbZeVMVFTRkGF8ZNCWkZeXXdXXq4Zl7Emh/VjLtl st+NYOWCo1VKSoz71AiZunjQF2+GfT4SueHHilBtsC7XTJcQqQ5WbojZ5SbnS+dFKuji dl7zmN9Yep28o8O1V+txyqu407XJq/7oI9tH0J9kajvwjfG+I3h1dR/uhSZUpyeHkI6x XYUCTZnA8d4NXA61+B0aeOUTQYwHZZu8OoshOkPIOPe1d2sOYA/El8x/YcdtnbI55jhl liMDzEkNAWJikAB3TFQ3g7wJExS6F2Dz/hmLJrH4ZtyM2Cnr2USqNQfUIzP7gDP4/X08 vJTg== X-Gm-Message-State: AOJu0Yzy3Wt5WFp3m/Ewe5ZTN0ZZzsSx6ATS9vkyZ2IIZ3EzYAjvA/98 9ZiWa13kgOqMWqNsptoy2TlUZ7XEqd6qpJnEWny5K+iF8bzP0VSXF3TifhC+KvM6ZYJBbij1swN u X-Received: by 2002:a05:6870:4d0a:b0:22e:a0f7:8c36 with SMTP id pn10-20020a0568704d0a00b0022ea0f78c36mr976278oab.16.1712312719818; Fri, 05 Apr 2024 03:25:19 -0700 (PDT) Received: from stoup.. (098-147-007-212.res.spectrum.com. [98.147.7.212]) by smtp.gmail.com with ESMTPSA id h10-20020a63f90a000000b005e438fe702dsm1104304pgi.65.2024.04.05.03.25.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 03:25:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 14/32] plugins: Use DisasContextBase for qemu_plugin_tb_vaddr Date: Fri, 5 Apr 2024 00:24:41 -1000 Message-Id: <20240405102459.462551-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240405102459.462551-1-richard.henderson@linaro.org> References: <20240405102459.462551-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::2d; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2d.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. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- 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 3db0e75d16..340e10ef12 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -117,7 +117,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 b036773d3c..2c52306f80 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 4b6690c7d6..36ab47cdae 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 *