From nobody Mon Nov 25 11:28:03 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=1715759727; cv=none; d=zohomail.com; s=zohoarc; b=IUSk8urb3QghTYs8zoZWOGMb+OE7NIRGAX8ZDb25wRGPQOqVrf1v43naDJNaWH4AEZdEqcNhQtMLrDq6Pb4nRskh/zqU1wuGdUhj5WBiJVK58zCzaQ7+pcsr802II7qjl+HjF00vG0JJxq9DznLJItyYdeProGO5zsAqlPlUYq0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715759727; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jEfUsltW8rumdTfAvGwXpV5AkkGUJRb2ZtYX2v2b8B4=; b=Hg7DDmR3mLsOjchCXFylFMxGIzhwu1+l5syxKphCy7et4pphIAIVC/J+/kxawUBdkwn8CEJnslNyh93aAcsWJgEcfg1wj8pheggvt6aMsLAGFiVLxf5usAn6CdtCvzgI9XsshUagJQfgEZIM/ig6TThW8QHZP0cmc5BJJ4uli34= 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 1715759727495125.97485916523021; Wed, 15 May 2024 00:55:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s79Rg-000484-F2; Wed, 15 May 2024 03:53:04 -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 1s79RZ-000448-Cz for qemu-devel@nongnu.org; Wed, 15 May 2024 03:53:00 -0400 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s79RW-0001YN-WB for qemu-devel@nongnu.org; Wed, 15 May 2024 03:52:56 -0400 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2e0b2ddc5d1so94803901fa.3 for ; Wed, 15 May 2024 00:52:54 -0700 (PDT) Received: from stoup.. ([149.14.240.163]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccee9292sm222611855e9.37.2024.05.15.00.52.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 00:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715759573; x=1716364373; 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=jEfUsltW8rumdTfAvGwXpV5AkkGUJRb2ZtYX2v2b8B4=; b=BDu0s1/AVAevqwp+t+UuvPkok0WzHr9eUHY7tiYqTL65SD4lcNSql48r2iX3PllbdE yWtfm4uH1q2xXRH7Uf76OFaA5OlCz/T7kvJ7yiEuN8B69RIu9NSDyjNBOf8R5cpL1QS+ XQJWDMio/h7GI7J0GlDw4crowCH3QLJ+n/jJtPdzmjoVPWG5xEAzT14PUYnU4fgrmWkO iXnYaIoWY0NrcSt9ocd7zzuY2aB9SkKo4lKS2YYIVNxIv+qWJk1A/49+pkg5CpikuTeV nKcUy/5l0ajJaazimHN4+BKAw4Ro0cfiI18ij6KGJRmAe1svg/IlRMjBwJ4Nh3CBQhXV YO4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715759573; x=1716364373; 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=jEfUsltW8rumdTfAvGwXpV5AkkGUJRb2ZtYX2v2b8B4=; b=lgAqo6UmXTFwEje/9v+8T++QVJub5Dgx0FXiD0qczi18IR+ctpaTwJK4e0YeQo/9Lw j3XA3YJm5iwl2ZmgzFQ/Mg0ix71wg/jVLEOoG8IWNPBMur0bRjlwisWSkwXyU76y2H7N 9+uir+v+XMPNlRQo/4ImLRXoBAXkrun3t/V6fyoq0DumwlxVf903YOLqRL8bIgmZ7gxC veEU570Wfok039xGOkMzN29kI23tOdS1Y8VgJVF7DZKGZ95RRuRAoT1vibxVdNhf61S8 jZLdexHTSjGjCjPZLEqPWXLcx9PzfUZ0pSXDuqZgrpjfsQM88i9K5BZg4pT2J9V+xwUO ++Hw== X-Gm-Message-State: AOJu0Yz8tE6oLVTZqvCIPd5vag1RhszQ69ncFIuraOkZbk+2nAM9a3Gx 10sMAtk4tB+qWi6pGdzqftk57GRgsf8L06u5K1asQIPlCb3rrcLQIFs/DvoFf5d+yD+X7tnPeSl /Y/Y= X-Google-Smtp-Source: AGHT+IGpx0zsiVHEZYxAklJSyQOzWLf/V1V/o75oNS7t2vF+62O8kPdB8RSJgFFFlQEtrofCKP7pNg== X-Received: by 2002:a2e:954d:0:b0:2df:757c:af13 with SMTP id 38308e7fff4ca-2e5203a4670mr96012101fa.40.1715759571496; Wed, 15 May 2024 00:52:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 05/34] accel/tcg: Cap the translation block when we encounter mmio Date: Wed, 15 May 2024 09:52:18 +0200 Message-Id: <20240515075247.68024-6-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 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::22e; envelope-from=richard.henderson@linaro.org; helo=mail-lj1-x22e.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: 1715759729098100015 Do not allow translation to proceed beyond one insn with mmio, as we will not be caching the TranslationBlock. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 0848026935..18138c61e1 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -240,6 +240,8 @@ static bool translator_ld(CPUArchState *env, DisasConte= xtBase *db, =20 /* Use slow path if first page is MMIO. */ if (unlikely(tb_page_addr0(tb) =3D=3D -1)) { + /* We capped translation with first page MMIO in tb_gen_code. */ + tcg_debug_assert(db->max_insns =3D=3D 1); return false; } =20 @@ -288,6 +290,8 @@ static bool translator_ld(CPUArchState *env, DisasConte= xtBase *db, if (unlikely(new_page1 =3D=3D -1)) { tb_unlock_pages(tb); tb_set_page_addr0(tb, -1); + /* Require that this be the final insn. */ + db->max_insns =3D db->num_insns; return false; } =20 --=20 2.34.1