From nobody Mon Nov 25 08:18:39 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=1716325628; cv=none; d=zohomail.com; s=zohoarc; b=KlECaUVd4xxZzVWnjydxTCfsd79iUBaW2UFUz6urVWQDvEAstHWuqz1jpbBcxXO0k8C4SdOyVWwXiCHg1cJBQc51L/SX2eQ7qkl4n0DZSpww9JH4I9I00av88ju12aWqCAarx4nBqMGV/A4p8ELAH2ogNMZ1Bc77p7ubeQPWB6M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716325628; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tVtyFTBG+iw77EA6qlS0AHGWtWsOsqyovWMI4nng/iQ=; b=b91fRSqAMT5chDMlhywGUPI21lg9aPkkMY78mHSmQMkGtIryyeJjQj6E5Q6TPdbqABP5ajKPQxQuv9VvH362AeKQYIgACjp+9RLWhnRsq/AylERqQ1Qf5o08McJE6ZXuFU616zGZq+AThKxCFIYPrCAC3/qLCwzFZ1mcKQ1qqOg= 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 1716325628082686.7306653844273; Tue, 21 May 2024 14:07:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9WgX-0001hW-4d; Tue, 21 May 2024 17:06:13 -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 1s9WgV-0001fg-Ho for qemu-devel@nongnu.org; Tue, 21 May 2024 17:06:12 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s9WgT-0008Qg-1W for qemu-devel@nongnu.org; Tue, 21 May 2024 17:06:11 -0400 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2b9fe8fc695so1625874a91.1 for ; Tue, 21 May 2024 14:06:08 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2bd70b57953sm5200808a91.30.2024.05.21.14.06.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 14:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716325567; x=1716930367; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=tVtyFTBG+iw77EA6qlS0AHGWtWsOsqyovWMI4nng/iQ=; b=Zk6vXuqUw8NLg5zoo2tdt7EOlzyqPwJ2j8HYo+CSEDLjx+LCthS4J24iRDa/+7KBDt zIJ50dPuV2r4y+nocJ6FlmwASGYd2cJqe3sCeXz/Zgtk+xnqtCb3mNnk1wU/ypQNAzWj qMfMh4+ziD+bL3dwnfi40A8QLiGncf6myEOlTzcfjcFOS//7M5XyT7RLl40igsoHJz1s c4A2ec8yavKWNwDnWZWzN2+qDOYdVuPdmQqSScEIroNkpj4ZmRNyYQERm+DXwQdF0W2P qaMq1nj2VQJlDONGuiqLoi3X94TcuWH/LE+NWp+yEi+0671t7eP4arK0Z9g2REn+ymtG BRwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716325567; x=1716930367; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tVtyFTBG+iw77EA6qlS0AHGWtWsOsqyovWMI4nng/iQ=; b=VnlmQHdvk9lML8zi4uY2iB6C1YXSvq6jo8GrOUyqUv16QBFbIv68O5+0CadW0LslT0 +IpnPYB4eBp/foXOrZQpE7mIA3ARlocp5Zm3sfmkWKiOuDBmC8tVzlvfrfEur6JgDHOH WrzzRv3OE/MDCnq3pezDdCR93oHDWAAkBxn39O1TmqZUOONqMU8iqdMpezLC3akby3UH xLBaat2En7gxdMTnk3l6jXouuEz20ZduyNWOmTQCTbRc/0TKFemn1bSUk99BGxvVdcHP 8uHetqCjV06j4qC0+MYQ5FJRlm51647oKDkVmdF6O07GYDcJ1/1hdr0R+CHExSIUtT+5 YVQQ== X-Gm-Message-State: AOJu0YyDWmK/r3kKOl0fIqHeREZ4oxCiu4wgR82Ub9Y67mUGzwFDI+pe GyHscVbtg2gUuOA/RrdvZBy4EMWChAndLWDONTAKJ2BqcH3UTQDw8hAl/v2xTlkYqvbJQbLOLTp t X-Google-Smtp-Source: AGHT+IELy95ztyxe44lOsIweXkJt36Z+gvkD1Touu36RVKjPvPkLVKt+5HghuFSZTff+51MgDTXeIw== X-Received: by 2002:a17:90a:fa10:b0:2b5:af07:1cde with SMTP id 98e67ed59e1d1-2bd9f5b8ab6mr301614a91.34.1716325567246; Tue, 21 May 2024 14:06:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Bernhard Beschow Subject: [PATCH] accel/tcg: Init tb size and icount before plugin_gen_tb_end Date: Tue, 21 May 2024 14:06:04 -0700 Message-Id: <20240521210604.130837-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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: 1716325630258100003 Content-Type: text/plain; charset="utf-8" When passing disassembly data to plugin callbacks, translator_st_len relies on db->tb->size having been set. Fixes: 4c833c60e047 ("disas: Use translator_st to get disassembly data") Reported-by: Bernhard Beschow Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Tested-by: Bernhard Beschow --- accel/tcg/translator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index c56967eecd..113edcffe3 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -214,14 +214,14 @@ void translator_loop(CPUState *cpu, TranslationBlock = *tb, int *max_insns, set_can_do_io(db, true); tcg_ctx->emit_before_op =3D NULL; =20 + /* May be used by disas_log or plugin callbacks. */ + tb->size =3D db->pc_next - db->pc_first; + tb->icount =3D db->num_insns; + if (plugin_enabled) { plugin_gen_tb_end(cpu, db->num_insns); } =20 - /* The disas_log hook may use these values rather than recompute. */ - tb->size =3D db->pc_next - db->pc_first; - tb->icount =3D db->num_insns; - if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) && qemu_log_in_addr_range(db->pc_first)) { FILE *logfile =3D qemu_log_trylock(); --=20 2.34.1