From patchwork Tue Oct 11 10:26:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 614181 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2548450pvb; Tue, 11 Oct 2022 04:09:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4JPnss7erQ8C79jM53YRosUoaL+tsASvuj0SpN3tvm9M2DARfOm8AutZzREnG30Fjx5Iun X-Received: by 2002:a05:620a:1452:b0:6ec:3f82:522b with SMTP id i18-20020a05620a145200b006ec3f82522bmr9324581qkl.402.1665486561504; Tue, 11 Oct 2022 04:09:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665486561; cv=none; d=google.com; s=arc-20160816; b=dVBXx4hnriBkuOO45a4SmQE4cCn2w/2ciP3E8BtWPxkfTGjNZ2ZuUezjmxBZqVTtBv 2nsIIF84rQPb23kEawdlRtwAtsTRT/zDwAhvl6YE/QM7tIuNZtVGsVV5FAIyOmmFM7fa uv09yp80j2X767BN6DKIsoEA2bJVadLBospgYIURGVO12hno9w+dUlHkaqzVpzQ3AHNb rVMQhTIKIo/CoXtd9zyAsI4YSEYNYjgxdiMkwQGOP9ZD9Z0a7WQnTuORYF5vUtigkoLf Qox4i8J5n50cyNDZXcTwy2XTvBL7Q9DTJq3V4QYEVZKlGbrM6vx4JEq1ZxH1Ad2fRYwj T1Zw== 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=Cr4HwV5vgUKgE+3UKuM8EcKp4MKuhG+a+4lxA7aTRqI=; b=kJ6sLAM/eqTBtBPEmhLJv+FUcOBmsxi5KaytwJm85p6WAr2bpX8U+3Rn8Oz0nEDkeH Trt5l1YVdwufUaKsMrGcSLVlBIvMFtZINqXqMzgbzSsLIbnnrNPpCxwe9pqXozInftyN Rn+bM0fGgjn6FBdGlKb4X3P8M0uR9Jui8JLnP2pA0zffHxw7BhcaIwdvfhAVrABxa7tz MI7fOpObb7kA5HK+bgaUftGeG+y7VoaEkUmaYAZAr6EU+CNN0tDp7/sJnXzjkaC5g3ws mrk8g+R1rd9v3P3xkzWODB+hmeUAxF4inGBfS/gXwjDDXjD8qXNPZZ0WcqvgxhlN8bDy LBbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="DH6/6bnv"; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s8-20020a05622a1a8800b003979e7f2c47si6014325qtc.198.2022.10.11.04.09.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Oct 2022 04:09:21 -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=@redhat.com header.s=mimecast20190719 header.b="DH6/6bnv"; 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=redhat.com Received: from localhost ([::1]:37492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiD8S-0006vq-Ss for patch@linaro.org; Tue, 11 Oct 2022 07:09:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiCUL-0002AZ-OG for qemu-devel@nongnu.org; Tue, 11 Oct 2022 06:27:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:45516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiCUK-0004W7-00 for qemu-devel@nongnu.org; Tue, 11 Oct 2022 06:27:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665484071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cr4HwV5vgUKgE+3UKuM8EcKp4MKuhG+a+4lxA7aTRqI=; b=DH6/6bnv7f3YaafvosBdeIdPpMi7vh1+MXfN07aqOgPNM03P+Rw377GTJ4pwtljUuJquHF egRCytEMgTBK57hdr8sE57/gnmqCgy6eMaLjejYwzfddNcQ4qTLbbnWfz7xggbls8yQemH NcBgo7hxeodJIrye3yR+YMAkN3gKfyU= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-127--M4Q5CpAN5CEE9N9cA4Gpg-1; Tue, 11 Oct 2022 06:27:50 -0400 X-MC-Unique: -M4Q5CpAN5CEE9N9cA4Gpg-1 Received: by mail-ed1-f69.google.com with SMTP id w13-20020a05640234cd00b0045bd246f73bso5713435edc.8 for ; Tue, 11 Oct 2022 03:27:50 -0700 (PDT) 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:message-id:reply-to; bh=Cr4HwV5vgUKgE+3UKuM8EcKp4MKuhG+a+4lxA7aTRqI=; b=qU0e1qYHokt0V2tRtNsnlaE8SvSgLAhXtnDtQGqlZJ0bkmQWt35NJWHreGBs83sU1d dqslOrLyXZXN+0uM9wgXow2lJvsL6C7fqJHvh/JPMSF0PzC0dYTI3/4yY062W2guOS16 fv4+yOJhetr4T8clHiBrCa+wgiwMDidZPp4XYROfeJMRVvEK+H6N5QIrlkGtsWBoUHdI x0BR6RiE8WmUnoeONJR4Pg/0zml5qNN5j5J1IruaEMREuLr+c7ixbOC7Kv2W6esna46A d6EvZOEzzGx3g2EraL1UFEHbH5ajat8BWrm5tkFbIK0bG0weOEHrDQfLN6N3/zWN0HNY Ovuw== X-Gm-Message-State: ACrzQf2uPTQ4An09Yc/oKFzFXi2ckpEJuaTXaHDdekdqE4tWgGkGRn3F F7dU6nntbw5jkgp7cf//qGtyr891RqzwcI+7cxh72k2tLK+epvEVFpeQgwPi7aAqjJ4kh78xG7x RRJVGMxcJy/RhpPNdUGKsCLYZANGpU+ld6lob5dmpyV8HZ1FA3Cj7BURnwI/b9Gmsyto= X-Received: by 2002:a17:907:25cc:b0:77b:a6c7:6d2b with SMTP id ae12-20020a17090725cc00b0077ba6c76d2bmr18648983ejc.148.1665484058597; Tue, 11 Oct 2022 03:27:38 -0700 (PDT) X-Received: by 2002:a17:907:25cc:b0:77b:a6c7:6d2b with SMTP id ae12-20020a17090725cc00b0077ba6c76d2bmr18648964ejc.148.1665484058255; Tue, 11 Oct 2022 03:27:38 -0700 (PDT) Received: from avogadro.local ([2001:b07:6468:f312:aad8:f393:e009:e014]) by smtp.gmail.com with ESMTPSA id mh19-20020a170906eb9300b00781be3e7badsm6746554ejb.53.2022.10.11.03.27.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 03:27:37 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 12/37] target/i386: Introduce DISAS_EOB* Date: Tue, 11 Oct 2022 12:26:35 +0200 Message-Id: <20221011102700.319178-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221011102700.319178-1-pbonzini@redhat.com> References: <20221011102700.319178-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, 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" From: Richard Henderson Add a few DISAS_TARGET_* aliases to reduce the number of calls to gen_eob() and gen_eob_inhibit_irq(). So far, only update i386_tr_translate_insn for exiting the block because of single-step or previous inhibit irq. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson Message-Id: <20221001140935.465607-8-richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 4c1548da8e..caa22af5a7 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -132,6 +132,10 @@ typedef struct DisasContext { TCGOp *prev_insn_end; } DisasContext; +#define DISAS_EOB_ONLY DISAS_TARGET_0 +#define DISAS_EOB_NEXT DISAS_TARGET_1 +#define DISAS_EOB_INHIBIT_IRQ DISAS_TARGET_2 + /* The environment in which user-only runs is constrained. */ #ifdef CONFIG_USER_ONLY #define PE(S) true @@ -8849,7 +8853,7 @@ static void i386_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) * the flag and abort the translation to give the irqs a * chance to happen. */ - dc->base.is_jmp = DISAS_TOO_MANY; + dc->base.is_jmp = DISAS_EOB_NEXT; } else if (!is_same_page(&dc->base, pc_next)) { dc->base.is_jmp = DISAS_TOO_MANY; } @@ -8861,9 +8865,24 @@ static void i386_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) { DisasContext *dc = container_of(dcbase, DisasContext, base); - if (dc->base.is_jmp == DISAS_TOO_MANY) { + switch (dc->base.is_jmp) { + case DISAS_NORETURN: + break; + case DISAS_TOO_MANY: + case DISAS_EOB_NEXT: + gen_update_cc_op(dc); gen_update_eip_cur(dc); + /* fall through */ + case DISAS_EOB_ONLY: gen_eob(dc); + break; + case DISAS_EOB_INHIBIT_IRQ: + gen_update_cc_op(dc); + gen_update_eip_cur(dc); + gen_eob_inhibit_irq(dc, true); + break; + default: + g_assert_not_reached(); } }