From patchwork Tue Sep 6 10:09:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 603005 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp4416008mae; Tue, 6 Sep 2022 04:01:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR61BFBxce2x9AV4og31DYUN38dB1B219jns8tHB9tgOex0U6DYcsAAhjrr9QxS7iss/blDy X-Received: by 2002:a05:622a:24a:b0:343:75d6:ad0a with SMTP id c10-20020a05622a024a00b0034375d6ad0amr43476966qtx.564.1662462071197; Tue, 06 Sep 2022 04:01:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662462071; cv=none; d=google.com; s=arc-20160816; b=Q6pALYpZirmdJPb25Gr6dVsesrHzbvs7CUXdojmVKlTRGEYwEMARMkVtjRSzpz/0HI YrU9PF9o/zyNC+t5qQtuvIzVL2/yxaYL4THnq1bNAbY9wPRP3Aj5Lw/lvYRtNLWEL/A7 Nqp55SQD4ywS+n+vo/Rvp2SxMdtNU10yj4u6KKQdxLSo9Lvyt7g62njVO9pG2l4fiAW4 Eykwosc/61xAXB8NsCYYJt/5C1BjWXPpwuvB1NS6wuahiDdAFGhGqBTZPU9B9JaZGTcv ao9e2dM+JVFD696OvOXkzLjJK5WN0GX5vvarB8d1uP0Q2jDXRT9tAS+NlTk5J9ilvlDo 0XmQ== 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=Od9/5sVYEyw5aM2oCw6JowpUd9okmRwg1CwHbwIH7Qk=; b=mMWQbZWs0ElIuSqBLI7/imE+sFvNB+yLI8pMKpVAJmP4hilMI3vRBbzhF4LJUxM9ES 4czcuDl8joV7EWBH0KHSswPuq+Gs+yfQDmNFp0nSADsAH5oJLexQPQSN1iLZqFZXjppG 9pKDGpg9svThaBv50/Z6+9Z3891ANp6iwy/ersvCDSgsbZ5rSgkCS2Xp97DWegnm1nw8 SJX9lChv/in/RFTXpWRU/ycKdhGKsuQMh1oo8Im3HyUAJBUZs3/PfItX8KWeDSP05Rxw E6jlKnLHPtsKqNOwPxc3ZoV3/5Rz8tztZobc+WAFtC9J5V4IZySd5DnUKLgW4HtLH4FB oClQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a4UOPUzQ; 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 cm11-20020a05622a250b00b00342f32f3018si7350280qtb.519.2022.09.06.04.01.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Sep 2022 04:01: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=a4UOPUzQ; 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]:59874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVWKL-0004QX-FR for patch@linaro.org; Tue, 06 Sep 2022 07:01:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVVWY-00008x-Gi for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:09:43 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:46049) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVVWW-0003Yn-LQ for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:09:42 -0400 Received: by mail-wr1-x436.google.com with SMTP id bj14so1389104wrb.12 for ; Tue, 06 Sep 2022 03:09:39 -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=Od9/5sVYEyw5aM2oCw6JowpUd9okmRwg1CwHbwIH7Qk=; b=a4UOPUzQJcU/Da6iPG6nFaPUAmb/77wDda0oM699OgNCV25EBnZ61+L1pbBcz6dXaV xEdGfxRbg4hBRVrnPFVbfiWqOjiPCWrdSoXKXOnErpjAmMfYE8UKA2t5IL6B3FSv5QE1 Fuo6yNpM23aPyTKIDVJtWSYn13fsG7u6skn3rZT0aI+2GWIJ0kQVJTfG4gy+6X695CnC jn6bMC68ANf1x0x39AVwRX4T4UHdt7V9HhNvEzqPS4leSBgUJUEwrt/rQzYBm1A8Qs7M ku5fFqg3Mo4ppqV4y3M+SLQhgpe0/uj2e1WVs8YCo800JKPZsPKT2QmbPDjOzQEMupKl cpXg== 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=Od9/5sVYEyw5aM2oCw6JowpUd9okmRwg1CwHbwIH7Qk=; b=d2/rzHf6MzPkADkD265VJHd85dfs1siEMjFIvxm+Xc4zAIAucOCgJwqqrAwjPoIYTk b+KCIJkQYvBRJ7S105X8Ieu3+ny0IbnyBBUGcFzosZMGqdsJVXsqolTMQBAu3AOjRIl2 nXwxz+Xbwt5luX3HVIwaDBDl7oNkihggC+IgEOXPxE/sQH7Dqm/k8pSl/Txzigl5ooj8 xauie6GtQUGOR4qtCU46hwwfPmva/1GuQ+jiRRJpNg2j83xqHXizxVNNa9Srja79VXec Ksss4S7saUxtEJ7N8j60J4GwPINPM4M7UFXlSoR/Wpd79NgIsNBtt1Ym9sJgipJKk1ul lGXw== X-Gm-Message-State: ACgBeo2ryZSlkJWqEu4bVmJZV0IPeqoEdoTu+h5+nsKGEQ021+dnixiE IzYUKM6XFWyQQStjkK3qBAfhaQPDqse7EVf+ X-Received: by 2002:adf:fbc7:0:b0:220:6004:18ca with SMTP id d7-20020adffbc7000000b00220600418camr25956955wrs.632.1662458978120; Tue, 06 Sep 2022 03:09:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 03:09:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Subject: [PATCH v2 04/23] target/i386: Remove cur_eip, next_eip arguments to gen_interrupt Date: Tue, 6 Sep 2022 11:09:13 +0100 Message-Id: <20220906100932.343523-5-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::436; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x436.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" All callers pass s->base.pc_next and s->pc, which we can just as well compute within the function. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini --- target/i386/tcg/translate.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 58e74c3162..0210382f77 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2602,13 +2602,12 @@ static void gen_unknown_opcode(CPUX86State *env, DisasContext *s) /* an interrupt is different from an exception because of the privilege checks */ -static void gen_interrupt(DisasContext *s, int intno, - target_ulong cur_eip, target_ulong next_eip) +static void gen_interrupt(DisasContext *s, int intno) { gen_update_cc_op(s); - gen_jmp_im(s, cur_eip); - gen_helper_raise_interrupt(cpu_env, tcg_const_i32(intno), - tcg_const_i32(next_eip - cur_eip)); + gen_jmp_im(s, s->base.pc_next - s->cs_base); + gen_helper_raise_interrupt(cpu_env, tcg_constant_i32(intno), + tcg_constant_i32(s->pc - s->base.pc_next)); s->base.is_jmp = DISAS_NORETURN; } @@ -7307,12 +7306,12 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) } break; case 0xcc: /* int3 */ - gen_interrupt(s, EXCP03_INT3, s->base.pc_next - s->cs_base, s->pc - s->cs_base); + gen_interrupt(s, EXCP03_INT3); break; case 0xcd: /* int N */ val = x86_ldub_code(env, s); if (check_vm86_iopl(s)) { - gen_interrupt(s, val, s->base.pc_next - s->cs_base, s->pc - s->cs_base); + gen_interrupt(s, val); } break; case 0xce: /* into */