From nobody Mon Feb 19 16:44:52 2024 X-Original-To: dev-commits-src-branches@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 4TdpKx2gMfz5C95s; Mon, 19 Feb 2024 16:44:53 +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 4TdpKx0DHqz4b7D; Mon, 19 Feb 2024 16:44:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361093; 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=jEOe5C+G6blV6Zf/bQXe/yHWU9pBNbMKU+e+0W0d2A4=; b=EY6hLrYZ1xvAoOcuGjFf/pWL5ifSluUrdLEWqqW+1+9LElWYb6G8FcbSeI+l42/bymtHQl JIteXyXg2mkwbfDhSuU/ioiIaDy6lUkzmyS/rPwrpVaHcy4PGcbzfFohuMaQuX6zeV/RKg iQqgJoBq99tRKh9fPBfsRSHZXTR2O5X5qo26MLTGl4QTKCRVEj8Gxitcd7TIHe3QG5xI/u xwNL9bgX6r+qkYmzdMhq5BM23aJDxluJLH0Js1W2LPWcP/tBNm+QijRSMk1AjGj6qQObrq /y6iULApOzLRyzLrnNOk8ahp9ntJUrgBaiXLN833AXRa8rQzju9gO27/v3I0hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361093; 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=jEOe5C+G6blV6Zf/bQXe/yHWU9pBNbMKU+e+0W0d2A4=; b=JYKfTVNd5keNXWPb9sHzYk++9yhvMyiHiqT8CwG/L8YLkackIAyawwmG0/sxYsC/qB6/mD YDgfPm9SmzwTN2rzUXRfiDl2c5HSFZMzIr7IW9TaVhae9VDJBUPSjTryEh/fchzf18ahe2 uvEvv6WUy4OIa6XZzR8/meicaZMGtALU+0UNCzbJkFD/VclWPBU9e0LfeqmXq4IS3wQ8f4 Had4mmDC5idVbhurlISkqWR1KlbOWZ+AnaOIVIjfYc4/rK4IXK6eCREawigUtcNNj05C7t vkvOu+8Op6x3Um2Kc1Rzqd+QkBtjryC+CRhdfXlH4o6WhhzUCFRUXi42JeAzJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361093; a=rsa-sha256; cv=none; b=R3yjWfwJEZCDbG9wMOPQLFTOYICn2+LwGdm8y+D4PRN4F0AeZA2peyqqD+e8kIIiccAmo+ ZZgmA8YcDa3tHYvVUhYAaCdWzldHuzt8fXTBaEqpW/r3u+C5mTND59NQMyKHEK9IvG/v4M fqV3F1qrscdBqv61EOfYipJybqrUPnSkzm7aTRQ5CwmfRWbXCsX+xsKdVwRl89Vxe7wk+C GMFg3EhmZyrwfqgFkCcMxmZYLSylb4jcoY+ERC4Vu7eRa7aA5uPuDNy0yBDPEC3go4y9a0 +muyTyiyMFTOMPzkLmAJ/1CWsdSzNlN9mk1nW4SYE5w4/FWyhbMiEo5RKrcIjg== 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 4TdpKw6QJYzjVS; Mon, 19 Feb 2024 16:44:52 +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 41JGiq8W094096; Mon, 19 Feb 2024 16:44:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGiqwu094092; Mon, 19 Feb 2024 16:44:52 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:52 GMT Message-Id: <202402191644.41JGiqwu094092@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: f323ecb4e075 - stable/13 - arm64: Raise a SIGBUS on a user external abort List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: f323ecb4e075f48f23d94f91b2b4b99074c21ebf Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f323ecb4e075f48f23d94f91b2b4b99074c21ebf commit f323ecb4e075f48f23d94f91b2b4b99074c21ebf Author: Andrew Turner AuthorDate: 2023-09-29 13:55:48 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:40:25 +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 d6f847d6b88c..74122cd508ab 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -223,19 +223,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"); } static void