From nobody Thu Dec 26 16:45:17 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675112614; cv=none; d=zohomail.com; s=zohoarc; b=XFrDQq3FI4pb83r3fRS8SfHygNam+aIciCjfdAhC/ewErnGKowktFpc2mvULmsEK6K8JVnJ8tFAeWWQU2O9hF6IG8vfIG+Lho7rZUXaxwuuLEl8I0b58UIDdoOV+h5HLDHrpApa5e5DJ6q2uVXVvkahIrZ+yxx+PDZGcqBNtW0s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675112614; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sTUZLEFCfr7lT34+spBSQV2zfVIDOr8BydY/0R/vz+U=; b=L5H1pn1K4EDVTX3ro2KJpa9L4nFEsziM4H18rtXyDYpVpEvGKVrqMRcUW5ft1VdeWC68ZmBRlUqjAiaK+l9/BjcK8HBJwAhOyQ5THg+PipX9duTxCTzHsEqGw5bKTd5qwUF3qH2fCyxdQcf29NgNa2ndpfURayqEIAPFSznsNGA= 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+importer2=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 1675112614595756.3386264679556; Mon, 30 Jan 2023 13:03:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMbFt-0007vQ-5T; Mon, 30 Jan 2023 15:59:57 -0500 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 1pMbFk-0007Uk-Mq for qemu-devel@nongnu.org; Mon, 30 Jan 2023 15:59:52 -0500 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMbFj-0005D8-6X for qemu-devel@nongnu.org; Mon, 30 Jan 2023 15:59:48 -0500 Received: by mail-pg1-x531.google.com with SMTP id d10so8558876pgm.13 for ; Mon, 30 Jan 2023 12:59:46 -0800 (PST) Received: from stoup.. (rrcs-173-197-98-118.west.biz.rr.com. [173.197.98.118]) by smtp.gmail.com with ESMTPSA id x10-20020aa79a4a000000b00593eb3a5e44sm102933pfj.37.2023.01.30.12.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 12:59:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=sTUZLEFCfr7lT34+spBSQV2zfVIDOr8BydY/0R/vz+U=; b=jxbcnqzXENm8yzrOogANceQlBCWzYok3tfiBo56TQvyE6Z2/E9Yjc/hCIS8kxq2c43 /JZZ2de4ciQEKf4smuInNuAHbUP/b0Zlkjq0DZDtcOtFMSYdiOdcHyBRm6i7S+MvGNrR 9epROmX2lHPjnB1YyNVZVniChUwyApYLP7yYjARJExadQuzel+HsQ4KujvYSVz3KyQ9E I/2K3vFf3lvPf3WT4hr7MJZUSwlKLgbL8yJ2ZDY8GEzO6vtxKcjByAJJRacQ+VltqCot rn1QlJHY+bwFFvklNbgHfFWldpfxUCRam4Ee6VqBSexpJv9xvZZNoQF8lUzPJjedDYG+ rCiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=sTUZLEFCfr7lT34+spBSQV2zfVIDOr8BydY/0R/vz+U=; b=jPji0Nvzkwt6lejSSkXN7K9euYY/iXbKugI1U+RiSjJovcw1Ypqec9INJSbWc3uW4w DQsJcPi3dctJfwlgq3Je3/OG1NYAkRiKUMU+FrHMTjddP+dcxvpMi5/gbXkTyT89AkTd 2n9r80/ivvV0PciGOCXGg0lkcnnaO7t66/OPxl4eIoSuK6IT5QiOrtIHtEYEOBM6ydjl IvwmBcpM0tbdEK4JToEKPL3sUkzjFO+Xiyc4Au+LOyQS2Q6RZgB+Dv/88HzoObqMEs1p m3qrzRmQVSAHZlD0UTSyA6Q0rah8HVDIOpO61qSu/bbpvPtRGraWpDTfwSo9H0EQl/QG KHPA== X-Gm-Message-State: AO0yUKUgFYx1ryawZh1gio/cMTHNaL90Q1EM8yqmA0QTiwEZjHyFbB4/ l9wR72OqDxuQWiZthRAqmdTZ9gq+1ViW+bVT X-Google-Smtp-Source: AK7set+eAKZP26vNr6Q94Zq8GLPJzcX9bGtZ9mZKQpXvam6s0PCc6rrWB4EEV9DOBrUMAAN7LTgDBQ== X-Received: by 2002:a05:6a00:1f0d:b0:593:b470:aeda with SMTP id be13-20020a056a001f0d00b00593b470aedamr5261352pfb.29.1675112385638; Mon, 30 Jan 2023 12:59:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, cota@braap.org Subject: [PATCH 03/27] accel/tcg: Use more accurate max_insns for tb_overflow Date: Mon, 30 Jan 2023 10:59:11 -1000 Message-Id: <20230130205935.1157347-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230130205935.1157347-1-richard.henderson@linaro.org> References: <20230130205935.1157347-1-richard.henderson@linaro.org> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675112615143100017 Content-Type: text/plain; charset="utf-8" Write back the number of insns that we attempt to translate, so that if we longjmp out we have a more accurate limit for the next attempt. This results in fewer restarts when some limit is consumed by few instructions. Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 08a816bffe..250647eb49 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -78,7 +78,7 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb,= int *max_insns, plugin_enabled =3D plugin_gen_tb_start(cpu, db, cflags & CF_MEMI_ONLY); =20 while (true) { - db->num_insns++; + *max_insns =3D ++db->num_insns; ops->insn_start(db, cpu); tcg_debug_assert(db->is_jmp =3D=3D DISAS_NEXT); /* no early exit = */ =20 --=20 2.34.1