From nobody Tue Feb 10 11:32:40 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629248797; cv=none; d=zohomail.com; s=zohoarc; b=FNme6+SxjieUe4zfS0aWvhBYS33rMsU5cNBFrVbPBqiJhnMmbbopZi/LBaphMsHEvz+6N9IXdRntM7UfHWo23QmnD8L0c0YRMD6KLHIuIgMbSEfobmznSPgehTpVaYcrEDJCbOUSdI0LX9A1ZayacXPjNY5ijNjJObnGy22ngRo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629248797; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3++UiM9Nvpex33sDYBqi5LO8w14qjh3qiR4geB26iKQ=; b=QY6rWT5OdZxAYUypJJqDpiiMaA5DQLkE4rsNBVe8Wb1KxV7L2M0O9N176k6dj/2sMzp1iUQ2wOTVsqrBo7ZvwU37l5YXkMbrfs5p/7czvAUZZDPJym+ZGP6rjweG8GmFwwNZ6IhEBzaxyZphkijmXRt4Wm1+43ZCP5RD6QdMa0M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162924879751526.882715506728687; Tue, 17 Aug 2021 18:06:37 -0700 (PDT) Received: from localhost ([::1]:58460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGA2O-0004h1-HU for importer@patchew.org; Tue, 17 Aug 2021 21:06:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mG9wu-000491-72 for qemu-devel@nongnu.org; Tue, 17 Aug 2021 21:00:57 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:45807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mG9wp-0001OD-Ib for qemu-devel@nongnu.org; Tue, 17 Aug 2021 21:00:55 -0400 Received: by mail-pj1-x102a.google.com with SMTP id m24-20020a17090a7f98b0290178b1a81700so1218537pjl.4 for ; Tue, 17 Aug 2021 18:00:51 -0700 (PDT) Received: from localhost.localdomain ([173.197.107.15]) by smtp.gmail.com with ESMTPSA id r13sm4567422pgl.90.2021.08.17.18.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 18:00:49 -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=3++UiM9Nvpex33sDYBqi5LO8w14qjh3qiR4geB26iKQ=; b=HvtvifipWcMTSCAtENYbf4UhBK5dI7dfEyiX/nAFe88Q+DvjPLBFxu8vhUMWCCrYRr g+vIjImlTxeKvD9E5NHuxHXhuIf+zKyABupvCBLGLnpw75+TkXkTw2RCMgzIqLGkWvb7 cLu2s0AtS+1gSW+Rm2eJQEEfv0zHt8qHHgxexBJ1jlpUk2kmEkzMpq8E4dgwgFJhgUE0 aGVJWdMxd7y1isERpqRRfLxQ5I8/djLnRA1TtVZaseQvWqfXQOgTDqd/obGEo69UVzXc +26OzUUBKc3ClFhwRTtE3gPa8ZGLy5dHTqhJ2wDJZ93Z5S2N4TtlUF4KHDcV7NKq+3Bp Y4cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3++UiM9Nvpex33sDYBqi5LO8w14qjh3qiR4geB26iKQ=; b=Du+R9OmAAw/J3gxzPZ+juN9S7GlGN2o1podOR/kjvsiVCjkvEDDM0BEkdgNYkB3U60 DmhD56XRZ1q8fQxw+QBtwnBfgVQgZUkslJ66yFEUwrlngDRVCJtSSkAXZuKaZ3Q8Uc3z p7eSfzJfgBtIlJN1EU0lNqW4eGxYpx/aa9G9IvO9tT+vIs9IWoViIqiFKI63D6VN7wNP KLJOV2AY9SKZ1LdbOrJSjoE2+chDTMjTSQGCF9Wf5SIZzkiGu19+63s9+SE7kBVLd/Q7 jX4XmZNGHoMWVmGy71cOuY67EY5F28mrD6zp+BhJ29rNvduBmKyfT5dghN2SSOX5PENw /FIA== X-Gm-Message-State: AOAM533PRxkPXjh7ZrqGqCAkDnUVeC+nNu0/IHyoZySaWV2VmCckWDeg X0SGKvTEQZfFQ5HsEzBGfdbYxJP45T61qg== X-Google-Smtp-Source: ABdhPJxc0SfwYtON37beOPlI7sMeis1QDfxvI8bRP9ydXRPkYPvsDevz3FLuZcOMDQU92L0Jamrl+A== X-Received: by 2002:a17:90b:507:: with SMTP id r7mr6408192pjz.47.1629248450220; Tue, 17 Aug 2021 18:00:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/4] target/arm: Suppress bp for exceptions with more priority Date: Tue, 17 Aug 2021 15:00:41 -1000 Message-Id: <20210818010041.337010-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210818010041.337010-1-richard.henderson@linaro.org> References: <20210818010041.337010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629248797833100001 Content-Type: text/plain; charset="utf-8" Both single-step and pc alignment faults have priority over breakpoint exceptions. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/debug_helper.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c index 2983e36dd3..32f3caec23 100644 --- a/target/arm/debug_helper.c +++ b/target/arm/debug_helper.c @@ -220,6 +220,7 @@ bool arm_debug_check_breakpoint(CPUState *cs) { ARMCPU *cpu =3D ARM_CPU(cs); CPUARMState *env =3D &cpu->env; + target_ulong pc; int n; =20 /* @@ -231,6 +232,28 @@ bool arm_debug_check_breakpoint(CPUState *cs) return false; } =20 + /* + * Single-step exceptions have priority over breakpoint exceptions. + * If single-step state is active-pending, suppress the bp. + */ + if (arm_singlestep_active(env) && !(env->pstate & PSTATE_SS)) { + return false; + } + + /* + * PC alignment faults have priority over breakpoint exceptions. + */ + pc =3D is_a64(env) ? env->pc : env->regs[15]; + if ((is_a64(env) || !env->thumb) && (pc & 3) !=3D 0) { + return false; + } + + /* + * Instruction aborts have priority over breakpoint exceptions. + * TODO: We would need to look up the page for PC and verify that + * it is present and executable. + */ + for (n =3D 0; n < ARRAY_SIZE(env->cpu_breakpoint); n++) { if (bp_wp_matches(cpu, n, false)) { return true; --=20 2.25.1