From nobody Mon Jan 10 11:32:58 2022 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 240771932795; Mon, 10 Jan 2022 11:32:59 +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 4JXWsQ59jbz4T96; Mon, 10 Jan 2022 11:32:58 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 8D40D247B0; Mon, 10 Jan 2022 11:32:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20ABWwrt038929; Mon, 10 Jan 2022 11:32:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20ABWwA2038928; Mon, 10 Jan 2022 11:32:58 GMT (envelope-from git) Date: Mon, 10 Jan 2022 11:32:58 GMT Message-Id: <202201101132.20ABWwA2038928@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: dfe221502f45 - stable/13 - Extract the arm64 signal code to a new file 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: dfe221502f45d5d9a31490be4ec7dfa44092d3db Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641814378; 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=WzZaeywKZnTWZ+JLK1ITh1SWOB7KjvZPRq9qVtJT7Ow=; b=xEb3nfdCK4MirGHvxo3tSas+tWtDxdT/FyWyPNSU5Aa9RS/OAKOcMTBdHsr68NM+XYlzJv yQEItitNshF/c1UFvcjZufuULkCl+47hchLhCHFt/W1Zfc1BhyvQgM0lY0rKppAvgQre+g E6cdiNHK3e3OHBd13L7xYQG0pD9gNQvdBA9rmSRbkG83ZJYJK8Mq8tRs3kPmI6jvy6fOW0 vbCAtt8rBclroTgL+7QPV8UOAYqYfsPrwhWOsEWpQ82V9KY6yZO+QqxlpdQmQY6qQuAJ1W Z/CJckd1LmUSuDi8uQ/ugo8fNoamHjo9Viq76l/LtdNXROeoNRBn1sFYbOwO1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641814378; a=rsa-sha256; cv=none; b=cDQ61Oxt9fko71lX0Tt6QAm8/r8PHZnu4V9OIBjEV6A2JTAsrXiCeM4Cok8AwZXv1X970d lvy4ylEpM2I3TRaLU1vJuc8Hup+ckCaRcIdBeC6225WH7EphDd6glhSlY1EJP6i3mFYELk LlGvetegJJYklRLrL6FGIvfb0U1VvjcOE8k2HLfgBJJuDcyT0GXJxjWsQ68+1kepuDnewE WQx0YCRdaJPlGhRMUHMFuV4l2W53qPBGij4JPjkL6iVz7SEEdcZvc9S3LwdXyb5PPZAh5c /QfbUTiV5xULEGwgaF6yGS5gczvzqlKm7iGKczuX3AIbADH3CpoV3pehL0/p9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=dfe221502f45d5d9a31490be4ec7dfa44092d3db commit dfe221502f45d5d9a31490be4ec7dfa44092d3db Author: Andrew Turner AuthorDate: 2021-12-14 18:05:29 +0000 Commit: Andrew Turner CommitDate: 2022-01-10 10:54:19 +0000 Extract the arm64 signal code to a new file This will be used by the vdso signal trampoline on arm64. While here fix the license as this part of locore.S to correct the copyright owner. Sponsored by: The FreeBSD Foundation (cherry picked from commit 8ddb4b9b6668f88acc70042923384383247340dc) --- sys/arm64/arm64/locore.S | 25 +-------------------- sys/arm64/arm64/sigtramp.S | 55 ++++++++++++++++++++++++++++++++++++++++++++++ sys/conf/files.arm64 | 1 + 3 files changed, 57 insertions(+), 24 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index d906128ae9dc..64067ac31c8f 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -809,30 +809,7 @@ initstack: initstack_end: -ENTRY(sigcode) - mov x0, sp - add x0, x0, #SF_UC - -1: - mov x8, #SYS_sigreturn - svc 0 - - /* sigreturn failed, exit */ - mov x8, #SYS_exit - svc 0 - - b 1b -END(sigcode) - /* This may be copied to the stack, keep it 16-byte aligned */ - .align 3 -esigcode: - - .data - .align 3 - .global szsigcode -szsigcode: - .quad esigcode - sigcode - +.text EENTRY(aarch32_sigcode) .word 0xe1a0000d // mov r0, sp .word 0xe2800040 // add r0, r0, #SIGF_UC diff --git a/sys/arm64/arm64/sigtramp.S b/sys/arm64/arm64/sigtramp.S new file mode 100644 index 000000000000..b06ec6fa109c --- /dev/null +++ b/sys/arm64/arm64/sigtramp.S @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2014 The FreeBSD Foundation + * + * This software was developed by Andrew Turner under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "assym.inc" +#include +#include + +ENTRY(sigcode) + mov x0, sp + add x0, x0, #SF_UC + +1: + mov x8, #SYS_sigreturn + svc 0 + + /* sigreturn failed, exit */ + mov x8, #SYS_exit + svc 0 + + b 1b +END(sigcode) + /* This may be copied to the stack, keep it 16-byte aligned */ + .align 3 +esigcode: + + .data + .align 3 + .global szsigcode +szsigcode: + .quad esigcode - sigcode diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index c855d908bfc9..df7eb81aeac5 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -68,6 +68,7 @@ arm64/arm64/nexus.c standard arm64/arm64/ofw_machdep.c optional fdt arm64/arm64/pmap.c standard arm64/arm64/ptrace_machdep.c standard +arm64/arm64/sigtramp.S standard arm64/arm64/stack_machdep.c optional ddb | stack arm64/arm64/support.S standard arm64/arm64/swtch.S standard