From patchwork Fri Jun 10 16:07:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 580619 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp1903896max; Fri, 10 Jun 2022 09:33:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhhbp+6m5qxNPsNeykNF+F/XAZmF7encpqKaLX2d7ChmtCkYFsJhbDzzR981F0fPBq2zHr X-Received: by 2002:a37:5f84:0:b0:6a6:80ef:d01a with SMTP id t126-20020a375f84000000b006a680efd01amr29298874qkb.252.1654878810739; Fri, 10 Jun 2022 09:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654878810; cv=none; d=google.com; s=arc-20160816; b=q9nHb80jV3p5bJt1COKaKEKDhyWbevOSmdjExE2cTmicpRM2r2PifCvYloCtc/M0GO aVtjPbBSr7HLOa1Vh2X4HxhlorB8bzh6E8WBY1a6bYPMUvNzezykvXEhuMeSUHE2gcWh rCX7gRtsd4LiAXTkxwEtVv957JvUv5MnWs0L8Q+5p3KOeS9QxNJ81WaJHr93YqoQu3fd ouDGrKkMi9xGriG13t0BJ7tQ+rF8VA58Mc7krW+/KanePAbJZN3GLBcyI0VjlsxhvHTB g0nAudm0Lk1FdZfiSVky882mqkhU64mNUuOdknZrbvNpsjr08WeYMgCMo7gi6TEwkEXZ oOyA== 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:to:from :dkim-signature; bh=PBYKiE6bpDTEnaJSKy1zk0rkD9aLj61WBo6X+OhO46o=; b=Hlgwce6yr/zI306VPpUUsKshut+k3P32dLH32MJYcAFk5gs/Dja3DgHQ20c1ZuMFy6 VWdsa9e+ILu5TwP1dmc8j/3bEgduLTUziCLL1+aWpZvbU91zMm7ROE+68Co+RU2fiz/m RO0S6SZS41ZJ3hDAJu1XP8QggkDah+iupLT3nWdZ9ByZlIc8NUq6ViNuKl103xJOLwEe nQX7nhJQyYowz1abHqtt5McTVhpYn2+SHCkbIv5pwDqPRSGFYEcQ4Mug9efvTPP8Nz5Z VFgJsTlGihD5ADfHdLFyOyIRp2tGhXCQUrXL/+4Iv/uEmX4oV3uuUlV9fWov6x7O3IAs thcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UV3wRSdm; 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 jm5-20020ad45ec5000000b004622a46e776si854302qvb.303.2022.06.10.09.33.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jun 2022 09:33:30 -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=UV3wRSdm; 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]:53312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzhZg-0005m7-Hu for patch@linaro.org; Fri, 10 Jun 2022 12:33:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzhAy-0007XW-6k for qemu-devel@nongnu.org; Fri, 10 Jun 2022 12:07:56 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:34767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzhAu-0007Fs-MC for qemu-devel@nongnu.org; Fri, 10 Jun 2022 12:07:54 -0400 Received: by mail-wr1-x432.google.com with SMTP id c21so4035353wrb.1 for ; Fri, 10 Jun 2022 09:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=PBYKiE6bpDTEnaJSKy1zk0rkD9aLj61WBo6X+OhO46o=; b=UV3wRSdm8V6+tPlVAHKpu4iromjLJ3OyfkA28L6IC7xXgpI2IFzzRVW6pFhMsNTIt9 qM2a0tLzmEKUkV85zflec7Ke3eoY9vN7iZQCl7x2CVLaah2ajnWbNCrkssYyr3QAFtZj a4fc7BsHrE3ddUyOEDNLbzJw4l3RDKzesr2pexZh0N+o3e4fAiC9h0JSVJ/ACdKx3xDJ Q5wvPt9KiaSrxuJ3Z7W36Tvct1Juh2dtgh68MapszU8CiP9ykHkNm8ezVfBTotDY1nqi b59lGlv3NX4nJCsV2ga8QVV6rm8CkzY1TU5hGeXPne3dM2vUiVB//3wB7TlMRJoEzeGj E6Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PBYKiE6bpDTEnaJSKy1zk0rkD9aLj61WBo6X+OhO46o=; b=iNGUk6y3umlxHjDwIWi+xKg9nNLJGm42SueC5Ez2HUaq0B+czkfwoUMlNRU079laCL uTsPn1x4zc0fH9sDtJ8vYfhI9IKKpWBWVTt8YoBaXf3bXRxVwrM+cvAIjrkAk8u9Whu0 Phw3MeajD0ulQDCcBoCliL6SlHn02R+M0Z2vxzUHNYCp+0Frum7xiX6sfZoKSnMzmRj9 23MR6Skzw2TbJ6nZBN8CsgwFW47Ofv7+AJeDGvrZ/MbiQb3F25/wsyS18KWjG194F/Kl VpOhfqUpSTmBWx824dwAwVBKZHlfPvfoEICJmzjcOfD1R+k0TjvwnQ6H54L2mXf85JeA JhCQ== X-Gm-Message-State: AOAM533WgLgFGIIjwIrS4wgTqwkXYP7AAgosRT1EWLTXpb9PT3O3Jd/C iXnDLrTgFHEVUAjRE71KWOG0Kwvunajc5A== X-Received: by 2002:adf:fb03:0:b0:20a:e253:b8c7 with SMTP id c3-20020adffb03000000b0020ae253b8c7mr43439336wrr.119.1654877270259; Fri, 10 Jun 2022 09:07:50 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id bp11-20020a5d5a8b000000b0020c5253d926sm14276053wrb.114.2022.06.10.09.07.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 09:07:49 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/28] target/arm: Introduce gen_exception_insn_el_v Date: Fri, 10 Jun 2022 17:07:20 +0100 Message-Id: <20220610160738.2230762-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610160738.2230762-1-peter.maydell@linaro.org> References: <20220610160738.2230762-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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" From: Richard Henderson Create a function below gen_exception_insn that takes the target_el as a TCGv_i32, replacing gen_exception_el. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20220609202901.1177572-11-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/translate.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index dc033600c0e..9cb31663ddb 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -1086,8 +1086,8 @@ static void gen_exception_internal_insn(DisasContext *s, uint32_t pc, int excp) s->base.is_jmp = DISAS_NORETURN; } -void gen_exception_insn(DisasContext *s, uint64_t pc, int excp, - uint32_t syn, uint32_t target_el) +static void gen_exception_insn_el_v(DisasContext *s, uint64_t pc, int excp, + uint32_t syn, TCGv_i32 tcg_el) { if (s->aarch64) { gen_a64_set_pc_im(pc); @@ -1095,10 +1095,17 @@ void gen_exception_insn(DisasContext *s, uint64_t pc, int excp, gen_set_condexec(s); gen_set_pc_im(s, pc); } - gen_exception(excp, syn, target_el); + gen_helper_exception_with_syndrome_el(cpu_env, tcg_constant_i32(excp), + tcg_constant_i32(syn), tcg_el); s->base.is_jmp = DISAS_NORETURN; } +void gen_exception_insn(DisasContext *s, uint64_t pc, int excp, + uint32_t syn, uint32_t target_el) +{ + gen_exception_insn_el_v(s, pc, excp, syn, tcg_constant_i32(target_el)); +} + static void gen_exception_bkpt_insn(DisasContext *s, uint32_t syn) { gen_set_condexec(s); @@ -1114,17 +1121,6 @@ void unallocated_encoding(DisasContext *s) default_exception_el(s)); } -static void gen_exception_el(DisasContext *s, int excp, uint32_t syn, - TCGv_i32 tcg_el) -{ - gen_set_condexec(s); - gen_set_pc_im(s, s->pc_curr); - gen_helper_exception_with_syndrome_el(cpu_env, - tcg_constant_i32(excp), - tcg_constant_i32(syn), tcg_el); - s->base.is_jmp = DISAS_NORETURN; -} - /* Force a TB lookup after an instruction that changes the CPU state. */ void gen_lookup_tb(DisasContext *s) { @@ -2847,7 +2843,8 @@ static bool msr_banked_access_decode(DisasContext *s, int r, int sysm, int rn, tcg_el = tcg_constant_i32(3); } - gen_exception_el(s, EXCP_UDEF, syn_uncategorized(), tcg_el); + gen_exception_insn_el_v(s, s->pc_curr, EXCP_UDEF, + syn_uncategorized(), tcg_el); tcg_temp_free_i32(tcg_el); return false; }