From patchwork Tue Jun 7 02:47:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 579309 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp4673840max; Mon, 6 Jun 2022 20:07:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRggL4LGMvJ5Lhg3FzR1/R/cxsRA3mVl4iNL0VzSHOziplEb3oXv9zzj8y8BfV6zmyiKsU X-Received: by 2002:ad4:5c84:0:b0:464:5827:c6a7 with SMTP id o4-20020ad45c84000000b004645827c6a7mr30929269qvh.37.1654571249555; Mon, 06 Jun 2022 20:07:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654571249; cv=none; d=google.com; s=arc-20160816; b=OkjkmJqtbThf/IHsgGcRSYcKJRYNhXZGjQvs6/vO67cQRnmDjyCJTQr9jui+godlm5 SDfF2j5tQhT8bjlrywr1IWEHaydKHD9a8Rb8qLWNOYWDKJyQZdH9akfEN3aA41T0u3e1 AslzWzjAtvIHnD54TJ0mJMVuUQWzRtk8igMUXB1Dw73XnjZSEqCCi039WKIT69RTOZl6 8rjKXPl3+Gm5vBbmvjxAgeTqEk5otHZilGemNk/n9qgv7q2z6zMpbIms9tMfXfFhbhXi 6lwEV4JvNWPZLaTmWGcirrg1RTrXe3bfe8KnNL6yGI/IdVxM+UdnAfqFoeVjy4v70p9N r3ag== 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=5ek6PL1aZJ6QfF3jqkeBuGSpjxRGu0Fp0N+Z+wPmIoE=; b=HQXL4A0sgbHzTqa92WWE9yf3T1c2UlLtqd54vhamCwdpltDWmbNKvZie1KJyvhN00C NOmPcH02RdVIC8g1w1g6xpi5yonvhbF3VgsnODzEUaJAymDkB7K3KguVNDvtzbxJV0YA i7yxUO1Ia6VX+dvqOt+z4cttbiR1LI6P8mFSBJR/KYzORdfQzU8XaUp1Bj0NlfuUjHha fcU7L7i+yh86RnBRQ2/N0XB5bt8CRzS2slLsymY0GzLfmKIggak/Txcp4iF8br8jlcHJ JcVndv9DlejmI9P6ts7bgs+gBCQxcD33H9yvzgGhhxYWqvRdh8EBZ8MDgamYKi2Z2BY2 74KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nmS6EnzY; 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 d9-20020ac85d89000000b00304da77c356si7183678qtx.636.2022.06.06.20.07.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Jun 2022 20:07:29 -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=nmS6EnzY; 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]:40872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nyPZ3-0004BX-5K for patch@linaro.org; Mon, 06 Jun 2022 23:07:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyPG7-0007EG-Cl for qemu-devel@nongnu.org; Mon, 06 Jun 2022 22:47:55 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:35376) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nyPG4-0000NI-EF for qemu-devel@nongnu.org; Mon, 06 Jun 2022 22:47:55 -0400 Received: by mail-pl1-x62b.google.com with SMTP id o6so8581834plg.2 for ; Mon, 06 Jun 2022 19:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5ek6PL1aZJ6QfF3jqkeBuGSpjxRGu0Fp0N+Z+wPmIoE=; b=nmS6EnzY7A7b2UlbQcSL3YdbbctjWmW2MQYoo8ahBHDemu28b/eVZnPz4S6AzoKWeE +FkGAvIbWki1DzdScYp3H7S60UlOLFO77igZsha9ewT3EQC2FipBqjE10U1fb/+EB7BM S2MCTzZNIaJg9ZYauYn5aS6Ou0KfGK+Q0D0eJKCkUAJp7DyM869h0TEzOt66vFkrNDr8 5sCDDP0elmBYtyf75P1GUYNDi3LQNMyZQPGa2vyxygnOr3ImhMKKJHVbWlEk3PCLoGBU ZH9EC75jHyBQP4SEVyo7lqR2uCMxPTDdMS3RCpHkdCgzlv+k0t1wZ5x7Q3OViwH6MbN7 Vfqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5ek6PL1aZJ6QfF3jqkeBuGSpjxRGu0Fp0N+Z+wPmIoE=; b=3clD5OAkvWi53MzVtdfNsF3jqkmfaYUXjet2I9jvSwoJyO2BHb6t74y/SU9c1I1cGm Awop8T7B1SoC/d8nohjcI8KYqUOmnVG3AcshJ8ZQjRP+kcKwpt47uzqd/BSch5mFQ/gp meBqLszygL9Am7/Zl7DVC9Za6y6mHqUe65l44+7YSzqY3L9iZrPDUEQlRb+bGGOmWpTm iUEyyrHCCXtNCwJP6Ip2Ueyfj9885OZqxDvn5ymYp3tkMZw2690s4J6aeQiKrGtrGejd P1FBwwTkAHkwdxoGla1kPUtYiOqGvExpwtW46HakbztODz+7NCI38WW/PUZjOGyDD5LW ELvA== X-Gm-Message-State: AOAM533wus5/wLyvkg9NLbbgL2O4MEz8sGb369gE446TYz4FmlGeP6Qf 5OejKI65GGEWuklmMUnCE3Z9SYMoP43I+A== X-Received: by 2002:a17:90b:1d08:b0:1e3:2a4f:6935 with SMTP id on8-20020a17090b1d0800b001e32a4f6935mr42556887pjb.174.1654570071071; Mon, 06 Jun 2022 19:47:51 -0700 (PDT) Received: from stoup.. ([2602:ae:1547:e101:d3db:cca:e5c9:6531]) by smtp.gmail.com with ESMTPSA id y26-20020aa7805a000000b0051876d83714sm7476904pfm.196.2022.06.06.19.47.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 19:47:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 18/25] target/arm: Introduce gen_exception Date: Mon, 6 Jun 2022 19:47:27 -0700 Message-Id: <20220607024734.541321-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220607024734.541321-1-richard.henderson@linaro.org> References: <20220607024734.541321-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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=unavailable 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" Create a new wrapper function that passes the default exception target to gen_exception_el. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/translate.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index edb7d3f394..5a48937ede 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -1093,6 +1093,11 @@ static void gen_exception_el(int excp, uint32_t syndrome, uint32_t target_el) tcg_constant_i32(target_el)); } +static void gen_exception(DisasContext *s, int excp, uint32_t syndrome) +{ + gen_exception_el(excp, syndrome, default_exception_el(s)); +} + static void gen_exception_insn_el_v(DisasContext *s, uint64_t pc, int excp, uint32_t syn, TCGv_i32 tcg_el) { @@ -9758,8 +9763,7 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) switch (dc->base.is_jmp) { case DISAS_SWI: gen_ss_advance(dc); - gen_exception_el(EXCP_SWI, syn_aa32_svc(dc->svc_imm, dc->thumb), - default_exception_el(dc)); + gen_exception(dc, EXCP_SWI, syn_aa32_svc(dc->svc_imm, dc->thumb)); break; case DISAS_HVC: gen_ss_advance(dc); @@ -9828,8 +9832,7 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) gen_helper_yield(cpu_env); break; case DISAS_SWI: - gen_exception_el(EXCP_SWI, syn_aa32_svc(dc->svc_imm, dc->thumb), - default_exception_el(dc)); + gen_exception(dc, EXCP_SWI, syn_aa32_svc(dc->svc_imm, dc->thumb)); break; case DISAS_HVC: gen_exception_el(EXCP_HVC, syn_aa32_hvc(dc->svc_imm), 2);