From patchwork Sat Oct 16 18:14:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515889 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp137464imp; Sat, 16 Oct 2021 11:28:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiMsZaEEOHWBGB2ytCrXj38HmreydmDeEeoE/RyeaXYDGi0k86WJpxORiaAggUafL9/SHi X-Received: by 2002:a25:5e86:: with SMTP id s128mr19384679ybb.79.1634408890316; Sat, 16 Oct 2021 11:28:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408890; cv=none; d=google.com; s=arc-20160816; b=rYgtbpoS2OGxjQZY0hApo32uycjBHve8xzJC7JY3iSSgIpWk7UN5ApuT6FU7aXm6RI 7ZAuZIs5Klld0T65E1oRy7aBBDJBP5hn6jz9zeTPZIT0OibbE7P0mtztcP55XVAxbBh5 Js4o+jnq6Llv/5KozP9t7yci1sBaJSjR7ae10BLW/2HeKuybzKU+TEQdASdKto/5EBnK jE/fymldIE6tJ7E1SKFRme1JSzdd5hrJz9edhX0zrRGruZU5hO0qUsox+zM/x97cxKjA mnMRSYSudq1t172FW4ZCt2tVcAXYerkhP+7j8yI5XEOn908mN0/Ma1tGU9yQpf/xF6nt N8vA== 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=jQKQj7yC7oasjm6gEezfZCoepcbFAh4lW7SLWUNzRbc=; b=OexfuteDn7gtqmYsp5+FDYiuxrmSsyYEIzr6ibh7WailGooX4xlJNxI8AZVetDa5Z3 tjMIvByDnXf1q5j5ZPvnQOs6b7bR6xcAHqvbt3HZxJo9ro7rLgxHLZy9P7zy7ThP4tUG dpwf8J0nLv6Dq2yOpy0Epmgzwcj7FwXkzMdIPTnnQILOSXdqglt2ppkAuZFF25GdNgHK q60JAcK7YN2vKkNAmCIp5T1kLd/q68DL+yyrJP+WZtC/u5A4s5k7Lfo2QbNSybgVAMDP yRgd0VsCt+9jdr4bx3AFSQON5vB0dPL+QzANB2lFTCh5H0C8ywi/sBn/NRsOeoLfbDB8 Xuaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vw6QthaW; 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 e194si10527002ybb.401.2021.10.16.11.28.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:28:10 -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=Vw6QthaW; 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]:50610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboPh-0002LL-Mk for patch@linaro.org; Sat, 16 Oct 2021 14:28:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDX-0008M4-TO for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:35 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:36664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDQ-0001w9-7h for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:34 -0400 Received: by mail-pl1-x629.google.com with SMTP id f21so8500186plb.3 for ; Sat, 16 Oct 2021 11:15:24 -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=jQKQj7yC7oasjm6gEezfZCoepcbFAh4lW7SLWUNzRbc=; b=Vw6QthaW/7gFnrlZHvJy3leedJSKJF4c8amcOpQAjUXv/j7ojMPTfsy1si9IkWWXen lS3vqyMlX4l8Rn9b0UhM0hWGAH2+0Bhv4yh51ZzCRd9L4rB8NldnkQZbImJh00bRB4LY k3MWNhnH5MCmmsLh7OydQHOpSVVFZiumeZ/ROxZzngcb3Pspff/g3MnDgobn1O1ipHtU SsUvmcL9yenEQC63Qw/Ezwia9tH4JlChsiI3LoIYFwgjfme/dqDia60IhDSX95u5ywF/ nxQFzkIsipAPLA9HNR9IHe1Exy/SepYjLTiaRpxC2XJ71qHrAksKOUuaqn9IWgsMPCW9 d51Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jQKQj7yC7oasjm6gEezfZCoepcbFAh4lW7SLWUNzRbc=; b=bzhbQuC62Ef/Z6bngYkG42rspOSm+TVhof/zD4YfSJV8/N2QjJdlaBgppdyxQg4qS7 nYhrd0hmV0OKh7jhvw5jT68UZDrbG5mxjU7yiZ+5uTHL3kDiyme7xHEyJYWJpGl9Ogqm Qwy+ObFrbwUEaJSZbT7UWcMsghMcTg9fcvjdznu4hhQvVZGedJk3r15deAgJmhHn//n9 d5GiCOWztwuB4cneEwLfHds6vcB+8a2DZT2ySkuJQo6OTeA3s3es4251TZbT3jJjjtjW xHTr4wwr5DxmOWRoRPmbe43LblB1h7vXTuOonVi1+SITe5wsu92p7PL2CFm4b1vPyMaC JU8A== X-Gm-Message-State: AOAM530SJa7tPEHWeGTLW0Wvhk2vUQFEe03rSVJsuiu/6GtdLAD+zGVJ 9rQHqXN3Dla7AA3b4lRR+ti1HBUl9pw20A== X-Received: by 2002:a17:903:2c2:b029:101:9c88:d928 with SMTP id s2-20020a17090302c2b02901019c88d928mr17554990plk.62.1634408124067; Sat, 16 Oct 2021 11:15:24 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 08/24] target/i386: Check CF_NO_GOTO_TB for dc->jmp_opt Date: Sat, 16 Oct 2021 11:14:58 -0700 Message-Id: <20211016181514.3165661-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211016181514.3165661-1-richard.henderson@linaro.org> References: <20211016181514.3165661-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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 a46be75b00..c8d919bc3f 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();