From patchwork Sat Oct 1 14: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: 611359 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp222056pvb; Sat, 1 Oct 2022 07:23:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4E9QY04Cmrp7F1VPqZqhBKiZdIC1+dVsyzIqwkCh8oKOSwaoPtR36NTf+R7jvzw5mYaHO5 X-Received: by 2002:a05:622a:1827:b0:35b:bb7f:6851 with SMTP id t39-20020a05622a182700b0035bbb7f6851mr10615296qtc.457.1664634223567; Sat, 01 Oct 2022 07:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664634223; cv=none; d=google.com; s=arc-20160816; b=EQh4QJVG86gp2p74IS6KJU3fZ0ok8WAVT31q1i2FRH5XHAMOtAJmneZj4wCtM2r3ND wH6L8vY6IBa96+FbwAgGRxNM4L+VseM4hZsk0tjiSIS3IZxYLOT77FBVsoI7xWsFaPg5 Qm+tGTp9BCOzeo8zhWJ6fjteNnpeTafItcjprYfJK29aa3RuAU+IL3WFcbBsL6DtR3m2 YBjeYtnk50wF/ZnRD3KlLwUD4WGCVWSEAebGz7fdKZNzhD7nlI9s4Hpz3UEV6yIdby50 OoGcwMVBtR7PD2qdqLBYgb1bMpcv+XCvrTNCnaUO7o0PsPC9XIXmhEg5DWWt15HmlAvd AI1A== 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=a/xQsKyfDAJVBnWrdlFFbEpL92rK/XhCYn8netaVPz4=; b=Xv2SpQXSh8XTsqswgDQh4YW5WA7CFMo7HBFp9B6kx+pA1GjK2+3NHjumTM3OAbd7mx pag2hpKJdFXoqe+8lDFY/VZskzJrNmpwordSTYO74UEgkzDVddXUMyiHjfytBFPmSXnd qw6p730dA1cJzGXuDRVTtsaF5wEyHSAqnIKMFFW4TbdT/YJZ8WyfWatGvNfvVn5WwKdb bwdEllEarJ3XpEJUqplQoO9JhmhGBVc+oRKyrwctWiO839punaT0amNtinGw7BB8gbC1 EMBbUM8BMH/6cjK0Z2uD4slfQSnUbDBcOGPwtxhSL3sGiF5CwvKFYMIwWQeHI1DwoeP/ yKMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bwWIBlwg; 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 bq36-20020a05620a46a400b006b94aa1ad49si2528652qkb.76.2022.10.01.07.23.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Oct 2022 07:23:43 -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=bwWIBlwg; 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]:47538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oedP5-0005vk-3B for patch@linaro.org; Sat, 01 Oct 2022 10:23:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oedBu-0002cE-9z for qemu-devel@nongnu.org; Sat, 01 Oct 2022 10:10:06 -0400 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]:38642) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oedBq-00040K-Sb for qemu-devel@nongnu.org; Sat, 01 Oct 2022 10:10:05 -0400 Received: by mail-qv1-xf2b.google.com with SMTP id de14so4386229qvb.5 for ; Sat, 01 Oct 2022 07:10:00 -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=a/xQsKyfDAJVBnWrdlFFbEpL92rK/XhCYn8netaVPz4=; b=bwWIBlwgWeIVsR74BXv0tM96nFp8L4K1Wnih4l6ey9eUl8StLaslAC37jXe99UJyVp QXwcm7MTMEpKLGvgStlvNh1LeVrKvYmUJviSiWihWflMHt+L06O8MsBaDq6PsNp+5cVw WQ8u2y9LmPqXjmFQ4gUdIB12HX+b4djC8zti7su7LCVd3swrNzUaKHi3545Jrk9hBT1M YQuSaYzHUQYoSi1TbKkOEAz4+DUzmQ/L9LljKIM2F/qhPDbcy/kC5KyBktwxUBgEZO6B 5dbo/khDbZzVwdEJu1Df+jrGaHI0vK4GjUnFM15ExhZ6xCyq0tuTV9TI6OQ2ZmjN4pBl VPxw== 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=a/xQsKyfDAJVBnWrdlFFbEpL92rK/XhCYn8netaVPz4=; b=dAjvZOg0RQ3yMcDGxZcEDHIntNHSC1+82kUwhAYkNWTrIxQUSaNeMzJSib+BsPlYvs xRaVpo/qulNLBgZ/GTQcNU4vGHycgBbctPbacIGuYXt1YDqUKtcUXcQi/R6Bf3gjeKdp 1ym0EGbB83vcAVeBmwtjO3TmTh4UbcoNh02OGWXcFlpzUYoAW3uf61TU6iwlDryBuV6t 5ebEqYUBQPLbi2PTh7XdalLj2R6UhDn/CuAkcab2aP9Yn3JMQSNlfRuvrE7Bg+Do9gQv eMjsGZ/rhsrIinXwirziBWqzDrlACgON2Fy9pcogOobOC8vWFLFNHR7ZMowEZrLIbFI3 RI2Q== X-Gm-Message-State: ACrzQf0JYWOFwjU+lMDtv1TFMVHSuVCWvrDMf4dZpi40ToapMcb1dfV1 UOPBoK8sBECm6BQXLl40cLCMuYxkHxdCeSak X-Received: by 2002:a05:6214:29e7:b0:4af:487d:c049 with SMTP id jv7-20020a05621429e700b004af487dc049mr11175054qvb.96.1664633400009; Sat, 01 Oct 2022 07:10:00 -0700 (PDT) Received: from stoup.. ([2605:ef80:8080:8162:afc7:8362:2616:ac15]) by smtp.gmail.com with ESMTPSA id j16-20020a05620a289000b006b615cd8c13sm6075914qkp.106.2022.10.01.07.09.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Oct 2022 07:09:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Subject: [PATCH v3 08/26] target/i386: Use DISAS_EOB* in gen_movl_seg_T0 Date: Sat, 1 Oct 2022 07:09:17 -0700 Message-Id: <20221001140935.465607-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221001140935.465607-1-richard.henderson@linaro.org> References: <20221001140935.465607-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f2b; envelope-from=richard.henderson@linaro.org; helo=mail-qv1-xf2b.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.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. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- 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 caa22af5a7..8c0ef0f212 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2457,13 +2457,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; } } } @@ -5726,26 +5728,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; /**************************/ @@ -5792,16 +5780,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); @@ -5991,10 +5969,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; /************************/