From patchwork Tue Apr 9 19:35:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 787236 Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp383306wrs; Tue, 9 Apr 2024 12:36:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXqfjjw4vq6HsaUwBW7dPCflk+qP2ZeGT3KOpbEdwSzcH2MTRoDaL4FlxumN+EqEynC/szPMkLBGmujzPZyz3QW X-Google-Smtp-Source: AGHT+IH3Zfq0uEhkJRrPRtOa9k8ZfK0PSwCEjfokh9akmLyi0MO9BKbzim8gJiCAolOfhUZ6Ml14 X-Received: by 2002:a5b:9c8:0:b0:dd1:6fab:81e4 with SMTP id y8-20020a5b09c8000000b00dd16fab81e4mr757224ybq.37.1712691407313; Tue, 09 Apr 2024 12:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712691407; cv=none; d=google.com; s=arc-20160816; b=K++7gvwrc0JOptKiMQ1qHIHslGn88dbaDEUSakt2d+AdsfLOncwafeVhn95w88qZWi wNIZXvGPDSu4RzEjH23ag3PjgzOgz0yhykzTJ2v15Hk6BQygwk1Xjhm+y7+4C/QUZrn4 8Py6xTisT3p2PLgUs22+ZJmSYOiUBnLy1pLAgm93hF6f+l4T7GonO+HjALGjSs0Z0pWO iDdM8tjW4634RqqV5AibwbATBUqlbq/iInOc60f8k2NhKiuDJTjNX/98X8QDB7hvlCFZ mezvPUuaHp4zL2TGLnbFYLF9Jw1/Q2YSA1iopgCgOxhS3o55/LkwENGzRe0jMMP9EZ/Q cV5w== 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=7jtBLExS0tGWR2Q7Hyghjc2ZDJ4QMJ89vJLFL0IAkpg=; fh=feciRXMMXjL5Zdx/9FYuVSJ4fTkSvjANJ3wyTAeS3QU=; b=XpRGK9wlKTJIpLK1ldRt1ceBE3Kv7S1Kkbzf0pmG2ofqiS62p5NVwZ70i1TPWOrz8D t4I3kth0geNWR+HCoBHg0beEt6jRno+KMrJLKgHZfblUzKRi9pynN0WnTBEizWlp4jh9 KD7XtCcXlYaaWv6wgMSf2fY949qWU19hPmB+l7zFhDLf5BbIVOvR/5/19fNAsU1m46U5 RiDWfziTSFqiHrf1ZWjtcTkqJ5Sy4MZzqYTocFEyEqEB7c6qjPz/FEss+hBLlihtAuBp 70L+8MpTxMbsZCqAXu+D/DFv+2rPWAS3HfUMqJUFG38SlXCBID5Nf2hnDLy7MlpgNdpr qVNQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DE7+tfS1; 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 i10-20020a0cf94a000000b00696a7b66b6dsi11050325qvo.12.2024.04.09.12.36.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2024 12:36:47 -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=DE7+tfS1; 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 1ruHGe-0000br-Sx; Tue, 09 Apr 2024 15:36:28 -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 1ruHGc-0000bf-Pe for qemu-devel@nongnu.org; Tue, 09 Apr 2024 15:36:27 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruHGb-0004et-5d for qemu-devel@nongnu.org; Tue, 09 Apr 2024 15:36:26 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1e4bf0b3e06so6927745ad.1 for ; Tue, 09 Apr 2024 12:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712691384; x=1713296184; 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=7jtBLExS0tGWR2Q7Hyghjc2ZDJ4QMJ89vJLFL0IAkpg=; b=DE7+tfS1CW0d35m42dYOF78cC4Rxy9Gp4aOG1pi2/GYpIdTmMLh4r56c6O/XPoL0sK B8BG4vwx/tFFQ8FW9GhJhuH80q05gny+fhAguXplem1mgpsMxChUhK54Dbuzn6cN/PWq CKrE+JJ7BkYFGEd2VMdDTD1b2IdkwWa+U8lAYJmHW19R0MpIsauhBpMvIZrpE3z5QBha GaVn/HmO5uR27s2vUmWg9DHHmMb+tsMKpO+/PhKLHydhUoDJi5pqji16XRBBKyvxZOKa Qde+6xHGDRa0w9fYiYKRTz8jRGlFmfNX/t6kpMJBhZZ4CtNaJyHGzc3UywOcQ1Ypah8W ZjiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712691384; x=1713296184; 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=7jtBLExS0tGWR2Q7Hyghjc2ZDJ4QMJ89vJLFL0IAkpg=; b=IhZXXnIkjj80m8TjLFJSklvqwSiifJ+8rcEndj3Dc+5keiLdcWRYdQUX/qqJzKs4lf ty7NE2Q3ey+nXRrNtDXzMgjXhsNF2scTOSK91b5xPO29hGVyyEJpoU33Gm4gmPOkMzM7 a5M0IR49Pm2qH0STF3FpEVoS8rAdA8j4gT21qxtbVQ9TxIYeZtpv28TqIjVNm+y2a4XM s65AWXHQBEGD8jcQ3/ecllWlZHyTGwMndCpNvo1S0lN6Olpo/iY3UEGzo9VxCK3z1xFU g0OVcBuWF20hqr2jv6VIfS3+HgzJkVxIJWMvzbxnNi8PTkBN1WHDSS8h2gYOqd2zUOLm YbVg== X-Gm-Message-State: AOJu0YymX/vF1/XQUUlVGXGrgbJu+kxSaXVJ7vmzE2A+Yd0DFVGUK8jA lZDc8NSNC3p0vL4SLv4CIdHrZIf8zpwT9rSmeD3Wmu8gc07233+hOkSE0vEz5iY9vNHY1ZhSbNo F X-Received: by 2002:a17:902:cece:b0:1e2:61c9:85de with SMTP id d14-20020a170902cece00b001e261c985demr883385plg.4.1712691383985; Tue, 09 Apr 2024 12:36:23 -0700 (PDT) Received: from stoup.. (098-147-007-212.res.spectrum.com. [98.147.7.212]) by smtp.gmail.com with ESMTPSA id c17-20020a170902d49100b001e1071cf0bbsm6065843plg.302.2024.04.09.12.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 12:36:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?J=C3=B8rgen_Hansen?= , =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 12/20] accel/tcg: Add insn_start to DisasContextBase Date: Tue, 9 Apr 2024 09:35:55 -1000 Message-Id: <20240409193603.1703216-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240409193603.1703216-1-richard.henderson@linaro.org> References: <20240409193603.1703216-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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 This is currently target-specific for many; begin making it target independent. Tested-by: Jørgen Hansen Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/translator.h | 3 +++ accel/tcg/translator.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/include/exec/translator.h b/include/exec/translator.h index 51624feb10..ceaeca8c91 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -74,6 +74,8 @@ typedef enum DisasJumpType { * @singlestep_enabled: "Hardware" single stepping enabled. * @saved_can_do_io: Known value of cpu->neg.can_do_io, or -1 for unknown. * @plugin_enabled: TCG plugin enabled in this TB. + * @insn_start: The last op emitted by the insn_start hook, + * which is expected to be INDEX_op_insn_start. * * Architecture-agnostic disassembly context. */ @@ -87,6 +89,7 @@ typedef struct DisasContextBase { bool singlestep_enabled; int8_t saved_can_do_io; bool plugin_enabled; + struct TCGOp *insn_start; void *host_addr[2]; } DisasContextBase; diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 38c34009a5..ae61c154c2 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -140,6 +140,7 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns, db->max_insns = *max_insns; db->singlestep_enabled = cflags & CF_SINGLE_STEP; db->saved_can_do_io = -1; + db->insn_start = NULL; db->host_addr[0] = host_pc; db->host_addr[1] = NULL; @@ -157,6 +158,7 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns, while (true) { *max_insns = ++db->num_insns; ops->insn_start(db, cpu); + db->insn_start = tcg_last_op(); tcg_debug_assert(db->is_jmp == DISAS_NEXT); /* no early exit */ if (plugin_enabled) {