From patchwork Tue Sep 6 10:09:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 602997 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp4409244mae; Tue, 6 Sep 2022 03:51:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR6s3b8DuohoPUbwFKADc2vp5Cj6cJwKozemCuqzPwBOAurtcDFVge7lAm2/+2UnUa2CUOEi X-Received: by 2002:ad4:5d62:0:b0:4aa:9d09:2d63 with SMTP id fn2-20020ad45d62000000b004aa9d092d63mr3358211qvb.100.1662461464025; Tue, 06 Sep 2022 03:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662461464; cv=none; d=google.com; s=arc-20160816; b=XhsZKLSTCe6uZdG8JZRGyXMcJvZHcJKc9R4bzMRK+J61nZQsby0zAylCQyx0eYVIr4 UYrtI2KoewiSScnKOgzWgpCtVsKj3kPmg2TJxIDmgbJVCWXeolMf0mlEqHP3WxBuxrOF r1N0cpXSQuUT5lVhM+3TvuNGlNhw1NtRrC26PjL26pQbrQJzP4HTx9InNfVRfy/WPPZf oTHz6bFbYs8UhdXFAWjQmPM/ZvdRGLArKnrqXWchrRhDmXkrBgN50XHDT2YYWGCk0pNE qJuc2uVlRc5hbqkZ8YbsADrtlll/qKwQktep81t6h5CaAyHGPqT0/cT/b1V1vqceB8R7 72pg== 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:dkim-signature; bh=pstCvedhP85R8a4eYJRnMyGD8r8ruJDFqMM28CjwXss=; b=TEjSd5/6WbCskOnpLs8duYAZTwdmm07XAyqtpo5TgIchmK3cH1AX3X09xtljmJyZR6 ymeBDiC9R6F9B6FCg7E7wcbKbT6cWq41n3HalpBGn5e221M7ZnbdBxMg+O5B6fzTQa1Z hp15MbNVhHqdSndLKIgl8R+KLSJ56nTb0JcFzZkNfMTxqHh6yvWWrej/URRzQcAfEyqZ 5gIEUvXqxqemW/EQzRU8wZHEcWpEVy7JHgOlul2mZUhmBLVWzqOu2ZIAZ3sVkEOlqY6i P3/f1gL6khiBhKWcdqtRFw5X3KbjtMm4wjBoCLP07sShvWe5HYaQjhiBXMLPz7R+ohKe U1NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wpVKiuOU; 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 y187-20020a37afc4000000b006b8fd9819cbsi6179047qke.457.2022.09.06.03.51.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Sep 2022 03:51:04 -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=wpVKiuOU; 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]:58624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVWAZ-0000Qa-FL for patch@linaro.org; Tue, 06 Sep 2022 06:51:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVVWa-0000AL-Qf for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:09:45 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:41610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVVWZ-0003ZW-7r for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:09:44 -0400 Received: by mail-wr1-x42b.google.com with SMTP id t14so7376935wrx.8 for ; Tue, 06 Sep 2022 03:09:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=pstCvedhP85R8a4eYJRnMyGD8r8ruJDFqMM28CjwXss=; b=wpVKiuOUdI8S3iKZUVvK/AtW2n2MwE+kHP/pz6XYU87YPoI9siPsmqnGQvVjvU6uU6 0LtyXr14pvgbWBAWAE2FUSKJ8WHJeMaZn2kZ/amZLNDkIVVVEQcLWywv5uUeWnCyt+gL +NQhxacKbowQ9pkHIqfJIlzEI/xUEvacak3FsUAeoPZiePrdbwZOxSx+GZHMU+5owP1D FmWObJBvWmX2ZLHSPg0d+EooFSxPJGAzPiPdANQuE5sXzyOs9QAtUh00sw/F+80pseaj 0Aae+cNWdjBeNvUrQ2BvHN99HznxZk2YErTIKHUAMqSGeXak1hxEeV/rMjEDchjqtML9 Dfzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=pstCvedhP85R8a4eYJRnMyGD8r8ruJDFqMM28CjwXss=; b=CH9+xqdWfKww2jngzuexgUT/Fu9dcS78VRk14kKsscWBeewhlOy4rhsVWtlfTRltfE R/5WxIBQi0zQYO3c3d5L+wf7JInx+Hr50aNVMa8rKrP2Obi9kzPpzDXqhiMdOxUodFO7 N3kALxLgeHsM7cEG64hXsQLW96KRvwiW0SQ+j1JkDNERTt2uYrZv2vswOT94iG6Uc1nw RfOE/IQViLS7OfFhzZjVdjN54BFC+mDJeakhijhKnVsGk5qZBK5ozFKtTSvbowLQ4dbf +zIXTm+qZxGwtwncZosVRm/qtO6nKPzDJDiW9jvzjVkqxfkyhiyr7/p99fBXDYCkxMAq VSyw== X-Gm-Message-State: ACgBeo0/M2JTSkL67xSbL3azsYOBvWugAZ1ZW5xQTnQjNsgkwO9RQyHp TOLE1cu2oC1mlmLrxtSK27+rWAwhunAuLH3d X-Received: by 2002:a05:6000:2c5:b0:225:618e:1708 with SMTP id o5-20020a05600002c500b00225618e1708mr28128838wry.510.1662458981979; Tue, 06 Sep 2022 03:09:41 -0700 (PDT) Received: from localhost.localdomain ([2a02:8084:a5c0:5a80:ba98:3a71:8524:e0b1]) by smtp.gmail.com with ESMTPSA id f25-20020a1c6a19000000b003a840690609sm23125014wmc.36.2022.09.06.03.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 03:09:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Subject: [PATCH v2 08/23] target/i386: Use DISAS_EOB* in gen_movl_seg_T0 Date: Tue, 6 Sep 2022 11:09:17 +0100 Message-Id: <20220906100932.343523-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220906100932.343523-1-richard.henderson@linaro.org> References: <20220906100932.343523-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42b.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, T_SCC_BODY_TEXT_LINE=-0.01 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" Set is_jmp properly in gen_movl_seg_T0, so that the callers need to nothing special. Signed-off-by: Richard Henderson Reviewed-by: Paolo Bonzini --- target/i386/tcg/translate.c | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 778ee4ed4c..ea35d3e9b4 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2432,13 +2432,15 @@ static void gen_movl_seg_T0(DisasContext *s, X86Seg seg_reg) because ss32 may change. For R_SS, translation must always stop as a special handling must be done to disable hardware interrupts for the next instruction */ - if (seg_reg == R_SS || (CODE32(s) && seg_reg < R_FS)) { - s->base.is_jmp = DISAS_TOO_MANY; + if (seg_reg == R_SS) { + s->base.is_jmp = DISAS_EOB_INHIBIT_IRQ; + } else if (CODE32(s) && seg_reg < R_FS) { + s->base.is_jmp = DISAS_EOB_NEXT; } } else { gen_op_movl_seg_T0_vm(s, seg_reg); if (seg_reg == R_SS) { - s->base.is_jmp = DISAS_TOO_MANY; + s->base.is_jmp = DISAS_EOB_INHIBIT_IRQ; } } } @@ -5682,26 +5684,12 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) ot = gen_pop_T0(s); gen_movl_seg_T0(s, reg); gen_pop_update(s, ot); - /* Note that reg == R_SS in gen_movl_seg_T0 always sets is_jmp. */ - if (s->base.is_jmp) { - gen_update_eip_next(s); - if (reg == R_SS) { - s->flags &= ~HF_TF_MASK; - gen_eob_inhibit_irq(s, true); - } else { - gen_eob(s); - } - } break; case 0x1a1: /* pop fs */ case 0x1a9: /* pop gs */ ot = gen_pop_T0(s); gen_movl_seg_T0(s, (b >> 3) & 7); gen_pop_update(s, ot); - if (s->base.is_jmp) { - gen_update_eip_next(s); - gen_eob(s); - } break; /**************************/ @@ -5748,16 +5736,6 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; gen_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); gen_movl_seg_T0(s, reg); - /* Note that reg == R_SS in gen_movl_seg_T0 always sets is_jmp. */ - if (s->base.is_jmp) { - gen_update_eip_next(s); - if (reg == R_SS) { - s->flags &= ~HF_TF_MASK; - gen_eob_inhibit_irq(s, true); - } else { - gen_eob(s); - } - } break; case 0x8c: /* mov Gv, seg */ modrm = x86_ldub_code(env, s); @@ -5956,10 +5934,6 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) gen_movl_seg_T0(s, op); /* then put the data */ gen_op_mov_reg_v(s, ot, reg, s->T1); - if (s->base.is_jmp) { - gen_update_eip_next(s); - gen_eob(s); - } break; /************************/