From nobody Fri Jul 07 16:56:22 2023 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 4QyKKy4DNJz4m44B; Fri, 7 Jul 2023 16:56:22 +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 4QyKKy3Lw4z4Sqf; Fri, 7 Jul 2023 16:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688748982; 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=BPcNy+m3/fzgl9jTmDQBiqkqjVNFvL/G4S+XHT/6I9c=; b=KNSsitdn0YhVCFkftvbuI9PezXJXAADXZVXnF+UtQOA/A6Ws/GxYWhZV33WmYPgaY7yC2T nisblOZmUthvEyczxpcwuNcJGL9iURjFpSj28hIHuQ88AnCa044eVUoQjjVlLAEfu1C/nl KVGbc2P+2E75lR5k+k7HVeLpGKl35iZYa5pdepqHLLJfmTrwmd7BsUhUMeFi5m/HJ8+8Za i3QItnsKgKM4O/LGUFU+49CZhcAFBTLi7mdrx/FC0yBf+SIND5kj6o04c7QvU2bznxD4b1 XZ5m9pRfVaB3WpBNmqeBRznT329JUFM/laqNamIQKn22NKuNWqtlHJIeaSQHbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688748982; 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=BPcNy+m3/fzgl9jTmDQBiqkqjVNFvL/G4S+XHT/6I9c=; b=X8C5BvH1eHJkWI377d74M8N78U3oYLp/ZcAGb0LZLGePe7HgLu1xPezS1KDcX+W92M0NVD Enla0Ogxnf5zLTixblhZqjG7xTIyyAJKx6Fmb+kYbOPIogtHScVFBzbsnh9sv7/uT/a53D J+rrU+NBQfd6rr1LaPB2hDlLf31oD/WJ5P281VjQJ5Q/epJ+E6CyPuhO/VUXxRazM4QxXY VQGOliUeshjZ3dnaKjqpE5vEsAjSE8oyjQuO1HzcsTpOmx6mMw5afG/OH4oHsq9eA1nZE+ 5Yiwci+xCFoBiQ7DK6wWVgY9K5xl9o87Cb+vPrVm9EeeIfXYPVe3NkMP4qVVDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688748982; a=rsa-sha256; cv=none; b=ir8m92ZPi9Oo/l7gQaMS3OgMSHhyTALJLbbM3NAMWR39fQNwoiTRPNHV6NICkp5YBPxC4R 31/SCkreLsyph5Ei9KwiBSU49lqsM/KRjgOnGO4JBzT7Fua1t2+6tx+emtaRdZ/y4Le7IE lKg/XV3jxg4Ex4AUVxeVjtKRXOKa5vyhJE3Jgi2KyJJ4mbnboXLzE1BfEgzqV5pGvFv1Eb TIIXUhZx3SKWjAeSCBUjgx+m0oyXPAFyQAJKKOumTYSz6eT36ONFFkouYDebwYE0FZ5VTj cmo4R1nrfN8xfmMDCFRBp0UTmSR+7c2BINAcaakwotz39UoHZteSFNKmpD0Z0g== 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 4QyKKy2S3Dzm09; Fri, 7 Jul 2023 16:56:22 +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 367GuMW8013881; Fri, 7 Jul 2023 16:56:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 367GuM3H013880; Fri, 7 Jul 2023 16:56:22 GMT (envelope-from git) Date: Fri, 7 Jul 2023 16:56:22 GMT Message-Id: <202307071656.367GuM3H013880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 1a2aa2ffb502 - main - rtld: Clear x29 and lr for thread_start to conform Aarch64 ABI pcs 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a2aa2ffb502403dc1f087722d1482c3c6e8d12b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=1a2aa2ffb502403dc1f087722d1482c3c6e8d12b commit 1a2aa2ffb502403dc1f087722d1482c3c6e8d12b Author: Dmitry Chagin AuthorDate: 2023-07-07 16:55:43 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-07 16:55:43 +0000 rtld: Clear x29 and lr for thread_start to conform Aarch64 ABI pcs Strictly speaking, SYS V Aarch64 ABI does not states that lr should be cleared, however gdb relies on lr and tryes to unwind stack further. Reviewed by: Differential Revision: https://reviews.freebsd.org/D40841 --- sys/arm64/arm64/vm_machdep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index e111995f09b0..7d6e83eb078d 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -223,6 +223,8 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, tf->tf_sp = STACKALIGN((uintptr_t)stack->ss_sp + stack->ss_size); tf->tf_elr = (register_t)entry; tf->tf_x[0] = (register_t)arg; + tf->tf_x[29] = 0; + tf->tf_lr = 0; } int