From nobody Mon Jul 15 12:38:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WN1vK70Lqz5QrGX; Mon, 15 Jul 2024 12:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WN1vK4jLvz4H7D; Mon, 15 Jul 2024 12:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721047085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UCA5+8iMnK5cfrc1pmQvYaVgUzEG/3bsnTWtvdsMEh8=; b=gP2bvx3mTkgPeLIeT0UiGd/FgOzq8rPBWujTqzg1cuvtnglRZxVjKD6LISMb9/VGeinoBj 7gQFuNNwgv0/wj1c/6N8X/pYZ/0bJdjJI0byew87TlCQyZqrGkyzY6AUnvjwssTbMJZ1qs YFxl6Oa9FBRRBbFGoKJB20aqNNKbssyONmtDnEjdFOvCkty9nd4LNCb5+70AsScS+48BEU NDmeoENUKtfxqZHnxd6hqyMzKQ8cLfXm+Xw+6bitnz4kCOb+/D2BR7xfZ5ILd8jhvj5Tzt qN8mYoKP83bZhRFRIcAVfIiMs2DUPf63fn/+fNseVGqhG7XzUcfjGGMANOiSQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721047085; a=rsa-sha256; cv=none; b=IgdZ4vET+Ua4jJOsdIlF7UKBhVz2yM5uY0+62VfJMcvjDV/X99NTQTzsF6Sm7zQL031VmE KmxHhBhWyv2akf1mjhu65tc/lAtEHlMTNYMZWGuTX3h8HTuepA6hDmuLop72TqAKMpeMWG sWi4hwiAAl77Qm5i+yByXv+6/uF1fJ0wxE9AA+RJpCfxb/l5fPLUbRUrIR85NItXka5hj0 tJY99KnzytdITqskppLRoshJJfT/DTeYsprPmvllvcyaJjSvIeGHD17bQ8U1CT7vcC9p25 ChTNgq/snkMbF3PIz9zbeJDj/KlY2/qW+pQZS/16gzDaqqrH9Sc9oryZligyFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721047085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UCA5+8iMnK5cfrc1pmQvYaVgUzEG/3bsnTWtvdsMEh8=; b=rONoecR2EVz7frDoM4G8lzqT4jHmAnbmqaOtebnOjJCCuzVha8a7QRuXf7nAckw0oLN/OD EQhsKU3/pbDe4GFjTvFtDqLlarfWI1dvTvybDyP+nV9Sq0/UuoFlRoSRENHWCqipf7S1Jz J4EgfTkEVizIquYvwU8PYLLQUFuqri+XK6N3DihCaA42r3LDKtUYpoWiftTKSM1i+UjxoP UTs6B59Fkikf5HJhvrlvtgwEEAxjn0K9aPgw2BPsdqrqJocTwj30/CMNQriIetmBuNNwM/ tllzo2L922DPZHild/nexbBUgBdNpHoR9xvQZTnMsTr4eJmt2gPgUz0jZGkhhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WN1vK4KzdzsJJ; Mon, 15 Jul 2024 12:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46FCc55C059597; Mon, 15 Jul 2024 12:38:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46FCc5rg059594; Mon, 15 Jul 2024 12:38:05 GMT (envelope-from git) Date: Mon, 15 Jul 2024 12:38:05 GMT Message-Id: <202407151238.46FCc5rg059594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 27e9c833bb8f - stable/14 - arm64: Add EL1 hardware breakpoint exceptions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 27e9c833bb8fdb87618649ae8193fe5485ccfdc3 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=27e9c833bb8fdb87618649ae8193fe5485ccfdc3 commit 27e9c833bb8fdb87618649ae8193fe5485ccfdc3 Author: Andrew Turner AuthorDate: 2024-03-12 16:50:04 +0000 Commit: Andrew Turner CommitDate: 2024-07-15 12:23:58 +0000 arm64: Add EL1 hardware breakpoint exceptions Reviewed by: jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44353 (cherry picked from commit c802b486ddfd796ea35b770148af9a5b0cd0ee64) --- sys/arm64/arm64/gdb_machdep.c | 1 + sys/arm64/arm64/trap.c | 2 ++ sys/arm64/include/armreg.h | 1 + sys/arm64/include/db_machdep.h | 4 +++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/gdb_machdep.c b/sys/arm64/arm64/gdb_machdep.c index dcfc91b33eb7..7b21675ea927 100644 --- a/sys/arm64/arm64/gdb_machdep.c +++ b/sys/arm64/arm64/gdb_machdep.c @@ -110,6 +110,7 @@ gdb_cpu_signal(int type, int code __unused) switch (type) { case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: + case EXCP_BRKPT_EL1: case EXCP_BRK: return (SIGTRAP); } diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 50f930b66664..69c5cd73ade8 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -498,6 +498,7 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) */ switch (exception) { case EXCP_BRK: + case EXCP_BRKPT_EL1: case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: break; @@ -549,6 +550,7 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) panic("No debugger in kernel."); #endif break; + case EXCP_BRKPT_EL1: case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: #ifdef KDB diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 6f9e109f4b70..b2dfd61c3083 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -439,6 +439,7 @@ #define EXCP_TRAP_FP 0x2c /* Trapped FP exception */ #define EXCP_SERROR 0x2f /* SError interrupt */ #define EXCP_BRKPT_EL0 0x30 /* Hardware breakpoint, from same EL */ +#define EXCP_BRKPT_EL1 0x31 /* Hardware breakpoint, from same EL */ #define EXCP_SOFTSTP_EL0 0x32 /* Software Step, from lower EL */ #define EXCP_SOFTSTP_EL1 0x33 /* Software Step, from same EL */ #define EXCP_WATCHPT_EL0 0x34 /* Watchpoint, from lower EL */ diff --git a/sys/arm64/include/db_machdep.h b/sys/arm64/include/db_machdep.h index f1f638a7882c..45b97443aec5 100644 --- a/sys/arm64/include/db_machdep.h +++ b/sys/arm64/include/db_machdep.h @@ -36,6 +36,7 @@ #include #define T_BREAKPOINT (EXCP_BRK) +#define T_HW_BREAKPOINT (EXCP_BRKPT_EL1) #define T_SINGLESTEP (EXCP_SOFTSTP_EL1) #define T_WATCHPOINT (EXCP_WATCHPT_EL1) @@ -56,7 +57,8 @@ typedef long db_expr_t; #define db_clear_single_step kdb_cpu_clear_singlestep #define db_set_single_step kdb_cpu_set_singlestep -#define IS_BREAKPOINT_TRAP(type, code) (type == T_BREAKPOINT) +#define IS_BREAKPOINT_TRAP(type, code) \ + (type == T_BREAKPOINT || type == T_HW_BREAKPOINT) #define IS_SSTEP_TRAP(type, code) (type == T_SINGLESTEP) #define IS_WATCHPOINT_TRAP(type, code) (type == T_WATCHPOINT)