From patchwork Wed Jul 21 06:41:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 483244 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5906968jao; Tue, 20 Jul 2021 23:49:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzl2RWzTBqTCODTW36fSNSFFmWdCdhSZNC78fml3dOGC6iAjnFZZ60kYUgglcs1zFUcMnY5 X-Received: by 2002:a02:8783:: with SMTP id t3mr29470079jai.45.1626850149678; Tue, 20 Jul 2021 23:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626850149; cv=none; d=google.com; s=arc-20160816; b=JLmEXA5OEedtDy64NNftKnUNRrgFJSCQQNd2qUeAgVQxk5qP3LtfPvO8e9OZPaFmrp vvg87UiFAtIcePckkhPmYYjNPmckoit2EyUErR+ztLaZXgz0CaHHUNkvFNtWpu4m+KYP ucZWHtPbep9B+4mbLly5630c87JGPycYVsj9oJmSYJ9yvV4tsM5G+J4eMtKlaLxrE2es rtJN2tNyGfZvQh+/gjffg8UD5q6t+kcZw4uyWyxTOgV50aHK/e7I7w23Dg91KfUtDN0r F+xbcKOZRM7zPfRWCwOQQnjk3vU8gSLxWSWy8rGRZMreWEtUWgn2zjEMSy52Zn10Y/Y0 T91g== 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:to:from :dkim-signature; bh=KI7SkeMtjhEbYkH+2Re6f8L1tCElUFagFm8gC84/Czo=; b=FNyio3fS+8iHForljWmeksxDAcHY6zUnMXLry1cIilwBouAl+/WUHtnC7bWOaPPZJb RolrRc4qEVtMN1AgcVHCN3CegDg6lGHBw81yhxR6xf6vpLr+ZQwny65dQprQJVneNlTe 8R+o04l/mLvXk4aIprv8Ixnb5jH5e5EumBZl/UnNydw/9F+Uz40zDZexaqvC4gn+1b9K Oelhfg9Ini96lLPQZd50aDB7cXrNVYa9n7vZA76HQt56wLbImuHv+G932gw/MmTDaYBl sQZILCWTN0/jRw0ChQ+RGrspSPbZ2PVpUKSIGV15US1g+qiH48elkKHgATuSb4Rc390E m61w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="IEo/eTu4"; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m10si35320276ilu.53.2021.07.20.23.49.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Jul 2021 23:49:09 -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; dkim=pass header.i=@linaro.org header.s=google header.b="IEo/eTu4"; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m662X-0006cD-50 for patch@linaro.org; Wed, 21 Jul 2021 02:49:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m65vl-00057P-6k for qemu-devel@nongnu.org; Wed, 21 Jul 2021 02:42:10 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:42691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m65vj-0005TQ-JB for qemu-devel@nongnu.org; Wed, 21 Jul 2021 02:42:08 -0400 Received: by mail-pj1-x1034.google.com with SMTP id i16-20020a17090acf90b02901736d9d2218so449744pju.1 for ; Tue, 20 Jul 2021 23:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=KI7SkeMtjhEbYkH+2Re6f8L1tCElUFagFm8gC84/Czo=; b=IEo/eTu4COFvw36erdTRwzo3/rk8ON264O4Z6KRJp1uOR0k6YoHWZi4+LM+e/fMQNZ O/VYo6YkL/0v2Ldh1ysxas35rQeOobAc4P3O4nfXzahv6xG3RH8nph1Tb8yXzK+WZ546 iiXuXzZwSkNAHvGCVfzyDZwzv2vuVyrTc63nlx5QR6hR4FClWEJGF+LPXQm8ySTQd2ET nxf2u5mPiw+t1Jt+nhgq6WEp/8Zv5tyD+6Y9ARiZq2luSyeqyMiMZh/Ubm+3Wtrh5HyP N/o4DTNJ7cfKrMsCd4jE24BW68cxdT7TGd7w7Urgm0JugFYNlh5uwhQk8qwnk3wSnkQ2 Kp1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KI7SkeMtjhEbYkH+2Re6f8L1tCElUFagFm8gC84/Czo=; b=jBYGB5uJXbjrXFBRsjh/M7Mno0UEb9XQKjxctqy6Ku2GqROwTWKytJSiFoI/0spGOh UZ34tSFOEYdt49kddcXPVI+5SYRhio2kWhRl0AfCoolHppnEq/7PhfR16nFqXCRcKcUA LWn0gbHxjd3qt47h1b3qUxW1/hwPETZFXLrEI0wXH5I19dqoVfWXRsGFyRIIlGXWXBc+ qm4SKpHO1TB8G+Jd5Tf4C/vQ5DDfPetZOTlqUGhj8BaTyN1XhtoP06frQe+qOANe7igX SROulm3zxIwNHpcJzhsVQeB0wVKbSRixx0fDP55Uh+Gn732EY+mmwTBjWoqY219C6TVV xG1A== X-Gm-Message-State: AOAM5332F0y8x+bheUAPPmZur9pnAN1S4+hhh0PEz+lXgBIDJeCKs3V3 lcnXpw2TpHQIsf4C3j1au/nzlf5xpMyaBQ== X-Received: by 2002:a17:902:9a81:b029:12b:567:6eef with SMTP id w1-20020a1709029a81b029012b05676eefmr26170174plp.35.1626849726313; Tue, 20 Jul 2021 23:42:06 -0700 (PDT) Received: from localhost.localdomain (204-210-126-223.res.spectrum.com. [204.210.126.223]) by smtp.gmail.com with ESMTPSA id q17sm21146132pjd.42.2021.07.20.23.42.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 23:42:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH for-6.2 08/23] target/i386: Check CF_NO_GOTO_TB for dc->jmp_opt Date: Tue, 20 Jul 2021 20:41:40 -1000 Message-Id: <20210721064155.645508-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210721064155.645508-1-richard.henderson@linaro.org> References: <20210721064155.645508-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We were using singlestep_enabled as a proxy for whether translator_use_goto_tb would always return false. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index aacb605eee..4bd947cf86 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -8556,6 +8556,7 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) DisasContext *dc = container_of(dcbase, DisasContext, base); CPUX86State *env = cpu->env_ptr; uint32_t flags = dc->base.tb->flags; + uint32_t cflags = tb_cflags(dc->base.tb); int cpl = (flags >> HF_CPL_SHIFT) & 3; int iopl = (flags >> IOPL_SHIFT) & 3; @@ -8593,14 +8594,14 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) dc->cpuid_ext3_features = env->features[FEAT_8000_0001_ECX]; dc->cpuid_7_0_ebx_features = env->features[FEAT_7_0_EBX]; dc->cpuid_xsave_features = env->features[FEAT_XSAVE]; - dc->jmp_opt = !(dc->base.singlestep_enabled || + dc->jmp_opt = !((cflags & CF_NO_GOTO_TB) || (flags & (HF_TF_MASK | HF_INHIBIT_IRQ_MASK))); /* * If jmp_opt, we want to handle each string instruction individually. * For icount also disable repz optimization so that each iteration * is accounted separately. */ - dc->repz_opt = !dc->jmp_opt && !(tb_cflags(dc->base.tb) & CF_USE_ICOUNT); + dc->repz_opt = !dc->jmp_opt && !(cflags & CF_USE_ICOUNT); dc->T0 = tcg_temp_new(); dc->T1 = tcg_temp_new();