From patchwork Tue Oct 11 10:26:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 614169 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2534320pvb; Tue, 11 Oct 2022 03:39:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM59XCRgji668j5Qodeu9UbxmvXt9M6HXjSKJdlK4k6BiOFA5OuJVdjM4yWKfj/bWJ7FaXLN X-Received: by 2002:a05:6214:4013:b0:4b4:3f86:b1c with SMTP id kd19-20020a056214401300b004b43f860b1cmr3056394qvb.36.1665484765391; Tue, 11 Oct 2022 03:39:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665484765; cv=none; d=google.com; s=arc-20160816; b=Zc7EmfzosP+KtqXvlqOo0agSdMCS1ycOBw+Cv2ZvAg0OUwPJ0UA8jpDt8amHIbLGZq mSenl7mtXuyfedlef/HZeeOpJhNKNgCac36yQ+efP8dajtJcduQKD5ec0SUmG0Cxb+tO 6njHF9cds4jP9ynIwfoMCFsZkIThTHr0vEjUtk3hJu1KvVCGJ3oG7gBxG+LIDhKZXNXB alP5/bMLAx1ElfXa07te8Mc9Q/JV24jLcveaRNymS6wzgnZspaqY93DnPE9vF03T14JI uwYjtEDepZAHEximE4dGyvaxyhpALVXCO1p8sBFsYP+UYmsxNxoBnr+O1PvCusX8M6tZ 7lVw== 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=C10XqGvscv2Z5J53N3vmn7co32YR0PJyvc5leSysMHY=; b=GaTPi33T5HyHnt0pCqqkgMr0GHNtzXn7MYxGQgZbCdWKMJtamwrYmMZbOrhchlcrSU JGSuidjnZYZoXp2EfuL3dI/SyXaTB+TnE4GzMBN+ONvohg+B9hRTbNHfNGX6m+ooXC/q MxFUhAutiP98a0aG9sBylFl+7qIAVspJyjOxgr/2dQyaZcXCxBfoQnENDxizrZlQ/TFh XPdwiCuE+Zi6JU5+znvR6reBpZ8mY55F1tDmPxkTAs7LCOWtYeotaTsfUpfaonnvkREk FuCicCS+KnsyVCu0+kFkg45pIh89N0K/J7BXyJma1dKPU2dY/mxOOSpNH3L0ZBgsKQW4 F/Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O5uzdNdH; 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 ge7-20020a05621427c700b004afb740a4a2si6218322qvb.518.2022.10.11.03.39.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Oct 2022 03:39:25 -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=O5uzdNdH; 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]:54760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiCfU-0008O2-Th for patch@linaro.org; Tue, 11 Oct 2022 06:39:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiCU3-0001qP-5t for qemu-devel@nongnu.org; Tue, 11 Oct 2022 06:27:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:22881) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiCU1-0004RI-OH for qemu-devel@nongnu.org; Tue, 11 Oct 2022 06:27:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665484052; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C10XqGvscv2Z5J53N3vmn7co32YR0PJyvc5leSysMHY=; b=O5uzdNdH28HCoAA11oozuxi6zUlQa0m57voJQq6oVGeUQ2yaNv9eb7o9x6ntR4HJ83rpv+ Q0LTOyb2prdEf88drM417W5IbH6HA/B/v26Qqu4EEN/Z3IizxPcF5i8KZT1nc3wJwUrEcv w9gPEAhck981UIo0iUaR7yO8+rISzsA= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-111-4HII_IJ-O3idLUxjYsZ7zg-1; Tue, 11 Oct 2022 06:27:31 -0400 X-MC-Unique: 4HII_IJ-O3idLUxjYsZ7zg-1 Received: by mail-ed1-f72.google.com with SMTP id b19-20020a056402351300b0045c129ed62cso4013963edd.6 for ; Tue, 11 Oct 2022 03:27:31 -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=C10XqGvscv2Z5J53N3vmn7co32YR0PJyvc5leSysMHY=; b=MVyzmj6qXqmdG+2v/B7F6T0wTNPgy09Tvkwofat4D5MQ5ixICC5VcK4yCk+nVtOzVo BcpPOnT8/NVv2Wo9dHTH7bTSbMJfK6bgS+JbZ8OAx2NVhJTjNP05sCAUuOyYwstYHDTF tScaAewNqZ54/mBPZ5TUhf9TlOyVPUgGsCa/8Oaefw6PhKct5g3jiQHk0EhvdBj17rel xu9/UVVE5ffixgAR8wBWWC6lqUQXW2LurLMd+3M1OSz03YFt9sP47vtZ0RMykNoaK+JN mJ4TUmwrWwzZ1v0i4pfEeGMtuzuUTdirtrS6K65YLtejwiefYTRDioihSEDGYpMl4K7t HNLQ== X-Gm-Message-State: ACrzQf073lsn4caQ+Koh1kmqYU/XUI6UHtj/ikkBjw8cOR3SQnv5t9Io FuYepRhiql9FPN5uYnyIcPu/xRAKH8izHURspXS2t801rlOfKAvxd9HlEEl9bwEunl6bzkSjk+U aUXULsGuOswTJqIlUGxVDR4dYfVsNtiiRIN8l+o2VBP2OM1LTpkPlpj2RXJ3JiJC/w2g= X-Received: by 2002:a05:6402:27c6:b0:45c:1f1a:6b85 with SMTP id c6-20020a05640227c600b0045c1f1a6b85mr8806757ede.316.1665484050371; Tue, 11 Oct 2022 03:27:30 -0700 (PDT) X-Received: by 2002:a05:6402:27c6:b0:45c:1f1a:6b85 with SMTP id c6-20020a05640227c600b0045c1f1a6b85mr8806741ede.316.1665484050085; Tue, 11 Oct 2022 03:27:30 -0700 (PDT) Received: from avogadro.local ([2001:b07:6468:f312:aad8:f393:e009:e014]) by smtp.gmail.com with ESMTPSA id r23-20020aa7c157000000b0044e937ddcabsm8900445edp.77.2022.10.11.03.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 03:27:29 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PULL 09/37] target/i386: Remove cur_eip, next_eip arguments to gen_interrupt Date: Tue, 11 Oct 2022 12:26:32 +0200 Message-Id: <20221011102700.319178-10-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, PP_MIME_FAKE_ASCII_TEXT=0.001, 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 All callers pass s->base.pc_next and s->pc, which we can just as well compute within the function. Adjust to use tcg_constant_i32 while we're at it. Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <20221001140935.465607-5-richard.henderson@linaro.org> Signed-off-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 617832fcb0..5a9c3b1e71 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2627,13 +2627,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; } @@ -7342,12 +7341,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 */