From patchwork Sat Apr 17 19:42:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1467537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=xDM3I2Pj; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FN3WP2Dhbz9vF3 for ; Sun, 18 Apr 2021 05:47:13 +1000 (AEST) Received: from localhost ([::1]:48234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXquN-0005iX-BN for incoming@patchwork.ozlabs.org; Sat, 17 Apr 2021 15:47:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXqpd-0007yO-6v for qemu-devel@nongnu.org; Sat, 17 Apr 2021 15:42:17 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:34777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXqpa-0008DQ-5X for qemu-devel@nongnu.org; Sat, 17 Apr 2021 15:42:16 -0400 Received: by mail-wr1-x433.google.com with SMTP id r7so17942269wrm.1 for ; Sat, 17 Apr 2021 12:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uRd4G6zXJmrKRNM9MFZAOKSesHEb4XI8oeHJ2++RWXE=; b=xDM3I2PjjUlwm8ktPC4sOfMYbZleTjX5OVLylB55cWvt/x5b3Zi6QTH9OKm5NK0XcW 71/lnD/bK3bZdeFUNPXChPqTVd/UW8jkl+9InX5BLrLy7/VDK634tBUc39gYp5X0GtId d0PrBI/9MiGkWXP2peoQNEW2Q6xy85+vYhhkDwIH1pfu1aMonzotb3FBduY0iIyUG1qK lX3oLETVMpvaK/5hRfdzGWo+6z+Woh5wJQr4EZXk/ugl7jlNgPHvdrhKtL8fhBd+pkUy fN9TR0aczU74UevQDMHaZ+q2iion8fnEZi0M1WL953aVFydoZ5KtmydzFS6wTRwPuL3l xzqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uRd4G6zXJmrKRNM9MFZAOKSesHEb4XI8oeHJ2++RWXE=; b=mlmB6oGAan3QtDhEyTbRIuuz31yje1fPi3lGQmwI7KELjz4Q7h7cdmosZN2+2+UaBe Yv4rteQlS1zoPVmJDn2kC5j/bgtdIS9wPsE0GkG2lhBeVsyxPAuvAKsqW4s45ObymEBn xkB3QDe90/iaIarbEcR0A9GdsWkf2yGCAJ14Np75RWDMiuLDmTf586AS1pUnhptMQraA wiKofm8LylfuxdPJnbp4zeho++8rEJQw6bb0IhKX+GwaOGQRn1J2wuOAdbZ6u2ycaoAT UL6nyxXESCpftvVtKW8NHN/OmsvMxY09VNi1/4EX15MP7rCcejlpg5rLjiHkoAdPe0sv 0d+g== X-Gm-Message-State: AOAM532ZiLNOmE2kJAFOFDAnoD3rpgX+/NWdmolJyWmLVm3SaSzhP2kW x/Qy0K7rWjEpl6jX28CSSRrq37X45MlAJ/EY X-Google-Smtp-Source: ABdhPJwqsJUKYSxAvMltak/Rh9db+hi/IxKNdLDKtOx84CrFZKKndJaqeAAzCNPeHbBuYnzQIUzbfg== X-Received: by 2002:a5d:55d2:: with SMTP id i18mr5416745wrw.280.1618688532870; Sat, 17 Apr 2021 12:42:12 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id c12sm17304374wro.6.2021.04.17.12.42.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 12:42:12 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 7/7] accel/tcg: avoid re-translating one-shot instructions Date: Sat, 17 Apr 2021 20:42:05 +0100 Message-Id: <20210417194205.17057-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210417194205.17057-1-peter.maydell@linaro.org> References: <20210417194205.17057-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x433.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée By definition a single instruction is capable of being an IO instruction. This avoids a problem of triggering a cpu_io_recompile on a non-recorded translation which then fails because it expects tcg_tb_lookup() to succeed unconditionally. The normal use case requires a TB to be able to resolve machine state. The other users of tcg_tb_lookup() are able to tolerate a missing TB if the machine state has been resolved by other means - which in the single-shot case is always true because machine state is synced at the start of a block. Reported-by: Peter Maydell Signed-off-by: Alex Bennée Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20210415162454.22056-1-alex.bennee@linaro.org Signed-off-by: Peter Maydell --- accel/tcg/translate-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index ba6ab09790e..b12d0898d0a 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1863,7 +1863,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, if (phys_pc == -1) { /* Generate a one-shot TB with 1 insn in it */ - cflags = (cflags & ~CF_COUNT_MASK) | 1; + cflags = (cflags & ~CF_COUNT_MASK) | CF_LAST_IO | 1; } max_insns = cflags & CF_COUNT_MASK;