From nobody Mon Oct 16 10:47:28 2023 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 4S8DMh5Nkwz4xDL7; Mon, 16 Oct 2023 10:47:28 +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 4S8DMh4sbxz3MFN; Mon, 16 Oct 2023 10:47:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697453248; 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=2IqrHDY788YzmIKpLZHvzn7QzeTz5l7c3Abx60TyXqc=; b=IaleBtwDMA36WsdAbk2iqc8x9u/OOqlMV/6N4kieuv2wpr+Cumr1a0XH6nlUK+3O1XVgiZ 9rGSvSria+3gYSARgAWcoWq2/d8UZr44n7jCJ4IaNlqzNNDvkUnXnwtu3HSwtuXPSn8g2r EwojRsTJI7jvhbEULghol3AfJBynScDGhyVfkzva4fR6+nyduwRtiuA9X6j/pxlpF2+fLh zxv3AfTFmtzfiWePw/Vs0bnUvJmZmzhEpyor3xmIH1tuquH4ZpWJr6fVqKfW3ntpYs180j l2gyDZupqH1IgRe+dYJNRi83CS+K7LvfOu389pFzNlHOmfVtxoGPo6/bIXJVaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697453248; a=rsa-sha256; cv=none; b=niZNrM95iQq1ES18PXkxgo5fZlNVIor4jEV6EmMuq6CbaGcynwHuhR8o7TlfQWZytt8S5m F+CTdL2jbQCSjFp2YOL5cC5RH1D3I/jaHPobpdb7E5uoIih1EzLBBq9ao5AkGCNN6JOcx1 OI2fl6qVosMJNatLLjGAg9GMOROVkWeyFimDOZYjp9zz/1DWW+irAJeeH43PvkDizfhbrZ mm1T0bKbIsP8oMLYd25c4u9vQGjzQ4+s9CKSLGraENhsVclpTti6qU9lvGTaBLyAwIuGJI s/behBQmDWHtj0r/eanyX7OrTHrydTj1rEbTEG6r07oVMpiIcpNaFHTQ7x2NHQ== 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=1697453248; 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=2IqrHDY788YzmIKpLZHvzn7QzeTz5l7c3Abx60TyXqc=; b=c62MO/1mwGLM74LR59kT3xc9jaGhV0TdNSvNh5nn7TK5DGPRcosaYgfpf1KTmey4b6ZAWP uA9fLjoTBq3v7EtL4Ih87v4IqDH/5Rgl48JnrXbsCIW0mfLQUVY1XCNNdmfjijUPJ4NQre Ff/eR+dRVaWbOR7sno+Biq0VwvbBIFAa48qQ9czIMAzwkl0wMr9zZ0DV0brkDY76CJ+BUJ BKQh6XA1bJnuNpVb7K1Kh9Ab99gHUio43M1a0qW38t3TBH4O5kvyASBDF9QeGzQEGdFDCZ azVGuOxerE7/fhu3uWjKzJnRdVnYmd6bUBlVpH9oQ0RpXhXruyw4OVy/ehz+hg== 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 4S8DMh3xKrzcC3; Mon, 16 Oct 2023 10:47:28 +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 39GAlSf5003756; Mon, 16 Oct 2023 10:47:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39GAlS4A003753; Mon, 16 Oct 2023 10:47:28 GMT (envelope-from git) Date: Mon, 16 Oct 2023 10:47:28 GMT Message-Id: <202310161047.39GAlS4A003753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: a69450102ff1 - main - 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/main X-Git-Reftype: branch X-Git-Commit: a69450102ff1fe1466077a021a16bb265274d3a2 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a69450102ff1fe1466077a021a16bb265274d3a2 commit a69450102ff1fe1466077a021a16bb265274d3a2 Author: Andrew Turner AuthorDate: 2023-09-29 13:55:48 +0000 Commit: Andrew Turner CommitDate: 2023-10-16 10:38:14 +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 --- 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"); } /*