From nobody Tue Sep 5 16:12:49 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 4Rg9X14d9dz4sM4q; Tue, 5 Sep 2023 16:12:49 +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 4Rg9X148GYz4j16; Tue, 5 Sep 2023 16:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693930369; 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=jfHHl5LzJYzs7KBdG67nTE3G+8lU5XQsNehjaGVjRhM=; b=pGvbciaDzAWLj/iIVfNTgInY4JNYuhrdNEdyh2HRcPXoUlufaPRf7+OtMnTptyQFdv/JF9 ZFzB2uHz+UudGjGD60od2skNWFkbKnPqQQsuym2eNGUcohqNGNW6s2Nv56nUiNBwswDphy OqLL2eyY1p6Qt7SNvrAqQYWQOCv0W+bPWNM97PFGJ+zAwRN1Y8vUZk3Vwbi+c1l8x0de90 ofHc1yh0SAThYxWCLpEPE5e3r9rTnRXuceto9OWgTS9sD172AOTXrZ0s+ruYD0GWQJZ0sE Xp0TGRRzFTu58fcMdSgubqDVDKBy1bvoFVX4mSFD0Auhi5OQkg3tBlT2oae4Cw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693930369; a=rsa-sha256; cv=none; b=DZTsUpltGHJbeq+Lykxnj0msvuEtjz7ShGJXmwAPJjs/4yOMOpvFxFdnqlC8jZ+ryj47sw M+GyD2hfEgsA0t+FApSUXLP0yzkLhuPa5MHAa3vgzlFpxHee0iH8+MF60douMS66KOCC2e y6D/SDGyo4I4ncwQ9m9LplwIAYJlkh5K1jJS5rrpYKOOuur6FWiWBLjWd2rp7ovonxoiH+ 12ThSwkmzui1ZipQCKqsTHTpOrUcSjjxO+UZD1zZ7xoXHrfm7ABGfIbax60Rbw6JSHiS7O xfiM9OLcnvndsvVkk6PcmSh+jSowt7+7VmlBmNvaL/TEn1ucAuZvw3NrFZkGyw== 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=1693930369; 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=jfHHl5LzJYzs7KBdG67nTE3G+8lU5XQsNehjaGVjRhM=; b=yVi8TUY3sF4afinirHmSvFt4PiMKOHp9/Aq5+LWWtBFnP3XfSW1UGM4C1IJ6xcILMZozP7 tJdKvaq+OobXRn0JN7aD2nlup0PsOkmqvfGbe3lkXa5WmhHacwblOaasNuiqVYWX2a0Sl1 Y2wVRjA0BZxSmgZGksPiG/72/zXWeFQ1rj6g6pIpjVCpQm/HaDFLo0X4q1M37p3EJSzOZ2 nBhkloWfpwjrnv9s9qsW2r1rbkPc/3hhrPeddR0mHvpbo1exyIzs9gNKDWgn2GW0byTFl3 eCxGcSlrBt8xZjRRBy+CjHe/p1lwsAsbqKq5egeDqp2G0Wx+OIIaOxo8R/NvAA== 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 4Rg9X13DS2zftp; Tue, 5 Sep 2023 16:12:49 +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 385GCnAG058938; Tue, 5 Sep 2023 16:12:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 385GCncx058935; Tue, 5 Sep 2023 16:12:49 GMT (envelope-from git) Date: Tue, 5 Sep 2023 16:12:49 GMT Message-Id: <202309051612.385GCncx058935@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 3b35d2a8af43 - main - riscv: Save gp in the trapframe in both modes 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b35d2a8af43c2e3ea8cb5e1363ac87ec5eadeaf Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3b35d2a8af43c2e3ea8cb5e1363ac87ec5eadeaf commit 3b35d2a8af43c2e3ea8cb5e1363ac87ec5eadeaf Author: John Baldwin AuthorDate: 2023-09-05 16:04:54 +0000 Commit: John Baldwin CommitDate: 2023-09-05 16:04:54 +0000 riscv: Save gp in the trapframe in both modes Similar to d95fbf4e1a12565908b04b442263fe60c9e890b4, always save gp in the trapframe even though it is only restored when returning to user mode. This is mostly a debugging aid so that dump_regs() doesn't print out random stack garbage as the value of gp for kernel faults (e.g. sysctl debug.kdb.trap=1) as well as keeping kgdb's trapframe unwinder from reporting bogus values of $gp for lower frames. Reviewed by: mhorne, jrtc27, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D41699 --- sys/riscv/riscv/exception.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/riscv/riscv/exception.S b/sys/riscv/riscv/exception.S index 1aee009a4e00..8acb5cd691d4 100644 --- a/sys/riscv/riscv/exception.S +++ b/sys/riscv/riscv/exception.S @@ -43,9 +43,9 @@ sd ra, (TF_RA)(sp) sd tp, (TF_TP)(sp) + sd gp, (TF_GP)(sp) .if \mode == 0 /* We came from userspace. */ - sd gp, (TF_GP)(sp) .option push .option norelax /* Load the kernel's global pointer */