From nobody Mon Mar 07 11:19:50 2022 X-Original-To: dev-commits-src-main@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 8A99B1A06E92; Mon, 7 Mar 2022 11:19:50 +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 4KBwwQ3Sn6z4Wct; Mon, 7 Mar 2022 11:19:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646651990; 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=nB+9rCvl0shi+d41f4dSObog6mQ8RaPioUflcbIkVbA=; b=sTr1oZUcSeSg1mgNBqt0kzxl6fv5+GM2QS0OubR7xPdSL/WPLzINDF8eiVvKz39mtdRsMi SD4Udpjs9o/gfa3vURGelkFJwTqHZkGNLsV1OCVBgssDihNKaHkjaMu8BxTew+np2uhXVn ifkOuPxBaQOKA+W8rpOHdV1F3NIcWz5yICugj08XXJWl8bTAFi/LnaoUrifayiGNFSiVqq Nxn5o0zE/CuHf7a+BmLULjjSX7mcS8NNuT2siC8aiF6PpG+5g4mEDOhzw+bGVTPj9cc7zc 6Vn773rjL31SXti7vuJDTHNpGoJMM232wsqBzUmWNPRU8uccMWp6L1K/QEqNHA== 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 570D4272F6; Mon, 7 Mar 2022 11:19:50 +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 227BJojk084365; Mon, 7 Mar 2022 11:19:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 227BJoCM084364; Mon, 7 Mar 2022 11:19:50 GMT (envelope-from git) Date: Mon, 7 Mar 2022 11:19:50 GMT Message-Id: <202203071119.227BJoCM084364@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: db3a1eec371f - main - Rework the arm64 sigtramp code to be a trampoline List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: db3a1eec371f8c2c060805dbe93eaf76aa92c5f8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646651990; 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=nB+9rCvl0shi+d41f4dSObog6mQ8RaPioUflcbIkVbA=; b=RAjCdWj4jn0ZCL8JK6tzP7COOaYaEr0oRF1fZZDSvTk2MBVDUieu3366j7pFEr+ymkZsDc qr4O4MVSjzKwUjLL8OfsWKuhg4gjRMvJWMMpxJ3L9KVg/wRmDkxCWjURYIcdCPmy+30rCc Tzsz0xuRkpWUshSS+XxazojHkO2JuKMpDF5sqbcFphNKvuiCfpvLLiWGTHRsO0ed68nrt7 LTYI08kF5VXpNbCL+dZKW0SsKlufcr9Sdz3/Cz+5r5cHokJX8RYFrdIReiKwpGCo25NOUl 9g6zE2Bu8EAV4SgcUw+G8m7vnkgjbPoi7NQp/yTOHsIHiYYB0ZOO1z2jOfKlCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646651990; a=rsa-sha256; cv=none; b=AE86eQAafHq/iE2tiaoTVbsXujzBmRVaNrXuQpP3Vk2cx4+etSEtApN26nUxg3Ot6tEZbH FvBOEY+eWGS9WQndrOfzz+iUERwX8STiuLSKICqf6oVM8w0mdRdgYNy8MdCEdfKyHlh28l CgFhFj6oIkqjshojmZJtda2AJ2NIn7QLiRApyF9uMm/TAWF7oxhEQbQ9gxRjdpjItYuyON GkXKObShiRHcxe/CZnQuIBg4RI8dLuqq5dRH/Giwd+l4pXCp+qqmob4xX1kzZj6xdKbxtY ViHWG0Ybs3rwmPQnaGm95zAHpMjaXbpRAQwPHEMpVwjszFPXt4s8eDbI+NbkPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=db3a1eec371f8c2c060805dbe93eaf76aa92c5f8 commit db3a1eec371f8c2c060805dbe93eaf76aa92c5f8 Author: Andrew Turner AuthorDate: 2021-12-29 17:40:42 +0000 Commit: Andrew Turner CommitDate: 2022-03-07 10:03:07 +0000 Rework the arm64 sigtramp code to be a trampoline To help with switching to a vdso sigtramp switch to passing through the sigcode function when entering a signal. This ensures the return address is within the function. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33690 --- sys/arm64/arm64/exec_machdep.c | 5 ++--- sys/arm64/arm64/sigtramp.S | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/exec_machdep.c b/sys/arm64/arm64/exec_machdep.c index b60909c95945..c8e333f330cc 100644 --- a/sys/arm64/arm64/exec_machdep.c +++ b/sys/arm64/arm64/exec_machdep.c @@ -624,10 +624,9 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) tf->tf_x[0] = sig; tf->tf_x[1] = (register_t)&fp->sf_si; tf->tf_x[2] = (register_t)&fp->sf_uc; - - tf->tf_elr = (register_t)catcher; + tf->tf_x[8] = (register_t)catcher; tf->tf_sp = (register_t)fp; - tf->tf_lr = (register_t)p->p_sysent->sv_sigcode_base; + tf->tf_elr = (register_t)p->p_sysent->sv_sigcode_base; /* Clear the single step flag while in the signal handler */ if ((td->td_pcb->pcb_flags & PCB_SINGLE_STEP) != 0) { diff --git a/sys/arm64/arm64/sigtramp.S b/sys/arm64/arm64/sigtramp.S index b06ec6fa109c..a9ad10da766c 100644 --- a/sys/arm64/arm64/sigtramp.S +++ b/sys/arm64/arm64/sigtramp.S @@ -31,6 +31,7 @@ #include ENTRY(sigcode) + blr x8 mov x0, sp add x0, x0, #SF_UC