From patchwork Wed Oct 4 08:01:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 729247 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp220255wrs; Wed, 4 Oct 2023 01:08:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFle6CP0nhlBtbz/YR562VzpoX//cLYiAbaEFn/8rZuKbWHJkJw/gNrhCiI3z6dmwQOODeg X-Received: by 2002:a05:620a:458c:b0:767:e994:ff03 with SMTP id bp12-20020a05620a458c00b00767e994ff03mr1988932qkb.15.1696406919266; Wed, 04 Oct 2023 01:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696406919; cv=none; d=google.com; s=arc-20160816; b=kFJjhGV0kQVKS3RcKQDizzGjF3EMaNWrXlUi2lIK8dMNJWi9SxxDKZWhLH1a68A6mV QBowlDaem9lxkrDzLQhyJO/yX6G8JsYyDzYZLXfdoofZwV1ikvoRI0hW49hSpNTQfRBr TzPUXFIcs+LiXRdiZXAEaMNXr0XAPULVCn2RiRmfnDFLj1kDfNbXH40KubU44R5dTRbJ X5VfvDx2Iw7yottpYbeaMGjDNN+YKboLtEz75hWP384psZpZ1gPf0APkqE2trpPSA9il k7X4ryTIq3vO+LaFrE1aR5TFWapsWpsFuI9IdvptMsanMm9veawPfmGw/Tygf9DuQa/W LobA== 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; bh=QwhHa8Ug15W8ajsmY//u47SCtwdZ0TL0IqTw0GnxUBg=; fh=K4abbxCgZAPvqzOXA+PZ7RIZh+KufMVJze7rXLOwES0=; b=knz3iN2/8uuhiHaY2+KYy1KxlMkrgut/dr+FDTa/tawAstQfY8rOebYZ0QRukv6obv Mo4uUUhQhmlzec5j7jsnNEquyK3LCPbwrZZEf6kNvvL2E3zwJtZLigxfzt3p1+/o9L+y 01eysYxBp9qyvO4ShUkIW9Cw4xJ8b/wempYeS4y9KLMWAnBJ7/doczDGEzRIAC6KUkyB LGhhx7XRNcidVbrZqab+X4R0MoStZf4ooJ7QwTqYj/7DTzaE4hXwuj9WCWWlCF3TUKsP BPZl/C5lsML2OTPpXpizHqUeAQpI7UiitdMXNCJ2BbwFpJm+qRzgQflbDopTPtHj0JBq knoQ== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v13-20020a05620a0f0d00b00773db595cccsi1278183qkl.672.2023.10.04.01.08.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 01:08:39 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwu5-0006J1-FX; Wed, 04 Oct 2023 04:06:46 -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 1qnwtW-00060L-Vf; Wed, 04 Oct 2023 04:06:16 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnwtR-0003hU-6H; Wed, 04 Oct 2023 04:06:08 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id BA426275B3; Wed, 4 Oct 2023 11:02:30 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 0E32F2CBEC; Wed, 4 Oct 2023 11:02:30 +0300 (MSK) Received: (nullmailer pid 2702865 invoked by uid 1000); Wed, 04 Oct 2023 08:02:22 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-8.1.2 38/45] accel/tcg: Improve setting of can_do_io at start of TB Date: Wed, 4 Oct 2023 11:01:59 +0300 Message-Id: <20231004080221.2702636-38-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, 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 From: Richard Henderson Initialize can_do_io to true if this the TB has CF_LAST_IO and will consist of a single instruction. This avoids a set to 0 followed immediately by a set to 1. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson (cherry picked from commit a2f99d484c54adda13e62bf75ba512618a3fe470) Signed-off-by: Michael Tokarev diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 850d82e26f..dd507cd471 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -87,12 +87,12 @@ static TCGOp *gen_tb_start(DisasContextBase *db, uint32_t cflags) offsetof(ArchCPU, neg.icount_decr.u16.low) - offsetof(ArchCPU, env)); /* - * cpu->can_do_io is cleared automatically here at the beginning of + * cpu->can_do_io is set automatically here at the beginning of * each translation block. The cost is minimal and only paid for * -icount, plus it would be very easy to forget doing it in the * translator. */ - set_can_do_io(db, false); + set_can_do_io(db, db->max_insns == 1 && (cflags & CF_LAST_IO)); } return icount_start_insn;