From nobody Mon Feb 19 16:45: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 4TdpLB0tGkz5C96d; Mon, 19 Feb 2024 16:45:06 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL969Jxz4bC1; Mon, 19 Feb 2024 16:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361105; 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=+440LqA/lSYaFmYx7ImjwAUhTo2ztGToOMACniNOHp0=; b=S5Td5VwIot9SZUqgF9KoIX080YOcpAME071tV9t+ksTlgK2T6QsSe9cqVqY6PnodC0a76x QXIEI/3dSp0QfNuNVOajuIyd7uTJYuG3uX/QiYBaSEejg1mpdHgC+v0IvbvbZ5XfynVNRj IvPKukISqECwHSktoxyuMpumjjVR+5IqWHahoFKNSI+ddvzz506FLbItNbJlkFyYbzBdBa Wi3bsB/7aXLGpKG+pzbw1hTbVKl7BH5ATfmZB/HjN5DOhng+TIXfYKzffG77Md8nugb4B8 nzU/qzClsSE8DirPMhSAEbmzKMWMUP+pLoxQ5SZXaROSaJlafxu4BUjyahX1uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361105; 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=+440LqA/lSYaFmYx7ImjwAUhTo2ztGToOMACniNOHp0=; b=HgH1N1UCEH9RKgOvojcGCfB4R20vMGdUJe0ecO43pHsc1C+u9hmvvoolqY2PYH6x/TwfSX h/o1eBGAJCOw4UCz16SU8N8zInCAflm94jVT8kMBOlLYux15O0hcGnKp8wBNTaD9gBljZm W2Xl4AvpigDtiI8hiB0o2er6q7yTEU8Yi/8TZP0trv6T8aU76Rp2VrztnDqq5J9cUsQ2zd KOpu7YeNfBI7XM5WQMwDyRw1B1s3nR1gZEUfm4Su4abyQdO579EVAwWXvTGTLe7Yb9K1R6 pMysJQ+CTmPwZM4xTpT2gf8hKlGDVkJDRk3zPze1RbOqvzgwGcoQvQKx5BYfhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361105; a=rsa-sha256; cv=none; b=fPBptAMMuLe6oV/1H+lp0BK0f3AhlMZYYKLniYgD9TLG5wlPrjINQIYHN08RKqcrE/glUd bCSdHwIi1LSZNK+ndEHFoFOS6DfbmjwX0H7pFY5QsPaUY2hp/j28FYsAH8pbMbSxvKyR3f iMAdFbMnuIyXWVs/zs5ptlNBs76tpXv692Qn2uU/346RczVRB86RemYNVN9Hh3uAwmheQQ DnXNjimMgCOA3mR0MtkGF8X7rrcv5MrQqWM2a1zVUMLF1zPCnL5QM3lJctoGa3TfDt9P67 pw8r9d674Qqmb/ql1HqO40AH5+dYj9GIrS4Duz4/C1RO5zqEqZrUdJ7EL15uTg== 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 4TdpL95GWVzjDN; Mon, 19 Feb 2024 16:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj5jf095269; Mon, 19 Feb 2024 16:45:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj5xe095266; Mon, 19 Feb 2024 16:45:05 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:05 GMT Message-Id: <202402191645.41JGj5xe095266@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: 890008575a43 - stable/14 - arm64: Raise a SIGBUS on a user external abort 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 890008575a436c050a679e1d9e43d05489ee42ac Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=890008575a436c050a679e1d9e43d05489ee42ac commit 890008575a436c050a679e1d9e43d05489ee42ac Author: Andrew Turner AuthorDate: 2023-09-29 13:55:48 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:10:39 +0000 arm64: Raise a SIGBUS on a user external abort When userspace triggers an external abort allow it to handle the abort by raising a SIGBUS. Reviewed by: markj, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42018 (cherry picked from commit a69450102ff1fe1466077a021a16bb265274d3a2) --- sys/arm64/arm64/trap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 2dda8cfc4c20..6534fd2283a1 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -225,19 +225,25 @@ static void external_abort(struct thread *td, struct trapframe *frame, uint64_t esr, uint64_t far, int lower) { + if (lower) { + call_trapsignal(td, SIGBUS, BUS_OBJERR, (void *)far, + ESR_ELx_EXCEPTION(frame->tf_esr)); + userret(td, frame); + return; + } /* * Try to handle synchronous external aborts caused by * bus_space_peek() and/or bus_space_poke() functions. */ - if (!lower && test_bs_fault((void *)frame->tf_elr)) { + if (test_bs_fault((void *)frame->tf_elr)) { frame->tf_elr = (uint64_t)generic_bs_fault; return; } print_registers(frame); print_gp_register("far", far); - panic("Unhandled EL%d external data abort", lower ? 0: 1); + panic("Unhandled external data abort"); } /*