From patchwork Mon May 23 20:47:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 575410 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:c603:0:0:0:0 with SMTP id jv3csp1732708mab; Mon, 23 May 2022 14:00:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIUZuaiRqcIvpahQWycvSiOmqf/mUVtWVTFvPSBQ5XENZYND1wmV8O8mGXkFY/1BTyjsod X-Received: by 2002:a05:620a:2546:b0:680:f744:5bc6 with SMTP id s6-20020a05620a254600b00680f7445bc6mr15197766qko.113.1653339625170; Mon, 23 May 2022 14:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653339625; cv=none; d=google.com; s=arc-20160816; b=kbyvYg7OQQDT6nQ5S/3G8arYGoDd0yKeorj/sc5BcIyTG++4c+oYDEr26+x8BeWi9C npADzEch6x3pPm+k1kcEylo1uOXWJPnKJvnCoUESW/qhU573Fudd4Xjr8YeIvUr1qLj8 78E3uvi2Y5MLPtPTBQWLMmYbBI6+vPLVYofXb1EutH5Y9aTWaOlLA8sI1OnPNpmgkVCA UCxXHAxmDD/ONYVxan8hZoRNfzDcPE6QfTqZaBreEs6SnUfMlF1bKOmUO8YeAZudvcEB RLf46msp8dqmPA1nqgdhYYE6TrL8h2LaPfBhFmS2a9paoN7vjZPLkV77H3sr3uLX5EGs m4zg== 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=jD6P95boxWaFHWGjo6mmW0PDhuVHQHt7cpvcaNfyIzM=; b=npLIZIkk3i5DoQBGq5H5gylYzCr3LHlfjy9kZtsf28jF7+/OVhixdTrzBkkX/u3Qqq SYqM9ZxGYxyjJOR0t1ttlTWJXf0Q28kHYgiXdG3asHerpczOu53vHdrYeSfXhSngmKmF aeQkfXOZPI3baTigKkypbIriDxkAeCniVoMdgAmwM+XEkKln2/Y/oEKBcXQLKyKzmf1Q 6Ndt4QrqeFvDz+EAP9iJGApVDbnDLFvmJ+qbdSptOQmJEPl2jPUK+HKzbzdpkgdQsW0p weqN9j/BbC2INYnXNrGAsJVkFK0nRTjyuDI6wfLoPYYwR8PdeEZC1bOiQs4W7tYH4ytp px/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AGLnsTiu; 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 ay7-20020a05620a178700b0067e4be23a93si3102006qkb.728.2022.05.23.14.00.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 May 2022 14:00: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=@linaro.org header.s=google header.b=AGLnsTiu; 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]:48972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntFA3-00060f-Mb for patch@linaro.org; Mon, 23 May 2022 17:00:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntEyI-0000TC-Ja for qemu-devel@nongnu.org; Mon, 23 May 2022 16:48:10 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:36666) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntEy9-00054H-70 for qemu-devel@nongnu.org; Mon, 23 May 2022 16:48:10 -0400 Received: by mail-pf1-x432.google.com with SMTP id f21so2348782pfa.3 for ; Mon, 23 May 2022 13:48:00 -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=jD6P95boxWaFHWGjo6mmW0PDhuVHQHt7cpvcaNfyIzM=; b=AGLnsTiuOea8q9OM9vQ8LQN5rvwKktk8ok0EGJyznLa4ht4voMoryoVz3zVTDd7fyE +ryzjM9jlZqzWBEzIWRMe1Viba4OTHCMnUnSVUgftIoGsWtg8OsMHAumxEfHu0nfu5Aw +zgtToE8a9eF8sfu0qeeZG2Y7Ai9Wtg08BZScM/fm5C8KfilkFdtYkEZbCOmpBsJkS7z Ifp1f+u/3UutB3Z7VHMV5pDSPRxMMOrcvJi9H2XYxtzcCMq3i6iZ8+dlarjsVt+31PTg W/V2QRdjNKzxifOnoX39Nw0cTKCp8k9WNw7CTk15c4Es+bGt0WArpDDuT9Z818D3ONRs iKaw== 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=jD6P95boxWaFHWGjo6mmW0PDhuVHQHt7cpvcaNfyIzM=; b=yhRA1SeoecbrhCYprjx7kJe8+jAt60s+Zeexc6BFEc5ITtOXIjzXqVNF4P1pIwju9B WiY1EmBtWYt+yxuqof6T/xPCHOeIl4yNLPrLTSRZ9tFh0H5MNHOpSw8CvRFeo2asZMjt 4wvBusW5QFoMQ3ucUK5miA5jg4D0voPIPwPMgqU1ssbGGws4F68m9kqA1sS23groJMXT 21cldbQ8k0DUIHmcCsSSaYYfw8AKvi4aYQvzsU7esyFfMDFIemye0b1VDwOUtO5Z+mhG JKxjXGtbbQKJuXbwoE9xNwzWpqyguBtbQovWLPh6TDovCBHQ3Xz9IddEwa4ZJ9bJ71F4 5R/Q== X-Gm-Message-State: AOAM532MRR6HKrj3h9QXNKfynQJs4VQ7hmun3h7QV7V2xxhOVwtc7+hN jd6or75ypYO1Pdr9XUMDlorHJ8eRBGr9hw== X-Received: by 2002:a63:d211:0:b0:3fa:8733:73a with SMTP id a17-20020a63d211000000b003fa8733073amr2963634pgg.606.1653338879602; Mon, 23 May 2022 13:47:59 -0700 (PDT) Received: from stoup.. ([71.212.142.129]) by smtp.gmail.com with ESMTPSA id c16-20020a624e10000000b0050dc7628142sm7721788pfb.28.2022.05.23.13.47.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 13:47:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 15/18] target/arm: Create helper_exception_swstep Date: Mon, 23 May 2022 13:47:39 -0700 Message-Id: <20220523204742.740932-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220523204742.740932-1-richard.henderson@linaro.org> References: <20220523204742.740932-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-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=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" Move the computation from gen_swstep_exception into a helper. The assert removed here is present in raise_exception_debug. Signed-off-by: Richard Henderson --- target/arm/helper.h | 1 + target/arm/translate.h | 12 +++--------- target/arm/debug_helper.c | 5 +++++ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index 5161cdf73d..f3fd53f3f9 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -47,6 +47,7 @@ DEF_HELPER_FLAGS_3(sel_flags, TCG_CALL_NO_RWG_SE, DEF_HELPER_2(exception_internal, noreturn, env, i32) DEF_HELPER_4(exception_with_syndrome, noreturn, env, i32, i32, i32) DEF_HELPER_2(exception_bkpt_insn, noreturn, env, i32) +DEF_HELPER_2(exception_swstep, noreturn, env, i32) DEF_HELPER_2(exception_pc_alignment, noreturn, env, tl) DEF_HELPER_1(setend, void, env) DEF_HELPER_2(wfi, void, env, i32) diff --git a/target/arm/translate.h b/target/arm/translate.h index 6f0ebdc88e..c03dbfb618 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -340,15 +340,9 @@ static inline void gen_exception(int excp, uint32_t syndrome, /* Generate an architectural singlestep exception */ static inline void gen_swstep_exception(DisasContext *s, int isv, int ex) { - bool same_el = (s->debug_target_el == s->current_el); - - /* - * If singlestep is targeting a lower EL than the current one, - * then s->ss_active must be false and we can never get here. - */ - assert(s->debug_target_el >= s->current_el); - - gen_exception(EXCP_UDEF, syn_swstep(same_el, isv, ex), s->debug_target_el); + /* Fill in the same_el field of the syndrome in the helper. */ + uint32_t syn = syn_swstep(false, isv, ex); + gen_helper_exception_swstep(cpu_env, tcg_constant_i32(syn)); } /* diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c index 181ba7b042..8d87b65a8d 100644 --- a/target/arm/debug_helper.c +++ b/target/arm/debug_helper.c @@ -467,6 +467,11 @@ void HELPER(exception_bkpt_insn)(CPUARMState *env, uint32_t syndrome) raise_exception_debug(env, EXCP_BKPT, syndrome); } +void HELPER(exception_swstep)(CPUARMState *env, uint32_t syndrome) +{ + raise_exception_debug(env, EXCP_UDEF, syndrome); +} + #if !defined(CONFIG_USER_ONLY) vaddr arm_adjust_watchpoint_address(CPUState *cs, vaddr addr, int len)