From nobody Wed Feb 15 16:43:06 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 4PH3mB5xvvz3qXPD; Wed, 15 Feb 2023 16:43:06 +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 4PH3mB4wNJz3p6J; Wed, 15 Feb 2023 16:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676479386; 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=HBAJpJtQdj/3JL1d+0udjDhoqrDB49XCk4+Z4PRUOk4=; b=OMPwgi5m1WpIQlgTXhBk492nmxpMPRHW+sY8nCljMaBiXdlpO1TkftXD2JkDgsXjB9G7mL DpuVLwh4LFEgtWdRL6gd91co84cUwGwm1C2QuqevwKzJ5OdM22QbM5CKBraIUmmUJgQHRJ zSXwNDkryGHGuu+DDszy4eDl6j4pLqUylellMPw4jFhjrhmrsjyUN5OuzhFh32uTPCvWko SJ6mvU4Rl86H8nWz+fQbpsKTxEVZVVg8ORK4LLzHx3wvx7F5mnrhyPloceGV2S65z9UleR 1sYs5e3SGRZTbPUPl3sVm5YSxnr6buwS11f9FYHFQe/Z+rgxgkABSsiLkmvIMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676479386; 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=HBAJpJtQdj/3JL1d+0udjDhoqrDB49XCk4+Z4PRUOk4=; b=wAvCJfMxIdqGUrONQb2YD6Do9STpj3aeMjKmdTlWSM9oMAnLQTPWVqfaZil5gRr/jbXKba tRLL53kuJTkKiYGqH+q5WvnNtvUKxUL8tyOQyk02IGyDwp6YIAWVIBRJf8swQuhQBP0heA TH1HFnGngwkNtyVg43wMlt4Bz8Kokw6Y6Y7UEIfJYc3IPNrlo+Md8F0N3l6Y45K87H5vuZ e+Yu0qJv7MuO5FWzV2g21UcOeyypIcNRZVs5rBAgfkjJNg9blCSyf1QzyTFTYx8ZvRHTXj efln2NdDfpqSLGfQZ7td2nRUM78gpNFTuUD/oYM2cMGen3L6jGplOVODp1v5aA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676479386; a=rsa-sha256; cv=none; b=LljpowZ074m8PgFC+qmE74U4Rmqzhe8zTswKkpUCxncGxmwHPw+6CcL2l371tp5Ir81bqP 9vfiEUCf0rSuTXIByUV0qZ1CXRubVOn7K/xo/MmsmsanRG02Bl5SiYryecc/BDmwQa0bhB j6XuL1YIZxNr9I2XN2IOy/cCdqqi6NEqfaSXoNg21F1Ni4kQNu7cpbMd6Zwxw66r6H3sWr v5p3lnFR+kIRyT8EAb4nlrmb57hsIOKqUb5fr+sYo0WkDXsj8pf5ug4z3qjIqqBqwdfoxi CH4rlDbqoc7DHDZACjP5osaZX3AbD1TZOt1w2y5ykHgSEzl/D9wqntUkrC/Jmg== 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 4PH3mB404pzWr5; Wed, 15 Feb 2023 16:43:06 +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 31FGh6po002132; Wed, 15 Feb 2023 16:43:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FGh6cW002131; Wed, 15 Feb 2023 16:43:06 GMT (envelope-from git) Date: Wed, 15 Feb 2023 16:43:06 GMT Message-Id: <202302151643.31FGh6cW002131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: ed44d21ee847 - stable/13 - dtrace: Fix RISC-V user stack unwinder 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed44d21ee8473f7b73d8160287e2012e2f797bea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ed44d21ee8473f7b73d8160287e2012e2f797bea commit ed44d21ee8473f7b73d8160287e2012e2f797bea Author: Jessica Clarke AuthorDate: 2023-02-06 18:30:57 +0000 Commit: Mitchell Horne CommitDate: 2023-02-15 16:41:39 +0000 dtrace: Fix RISC-V user stack unwinder The unwind logic was copied from AArch64 which follows the peculiar AACPS (where, unlike typical RISC architectures, its frame pointer follows an x86/stack machine-like convention where the frame pointer points at the bottom of the frame record, not the top). Delete the pointless riscv_frame struct and fix this. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28054 (cherry picked from commit 38720107324b3903f342bcb0306c72c4e4235053) --- sys/cddl/dev/dtrace/riscv/dtrace_isa.c | 5 ++--- sys/riscv/include/frame.h | 5 ----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/cddl/dev/dtrace/riscv/dtrace_isa.c b/sys/cddl/dev/dtrace/riscv/dtrace_isa.c index bc8426a752df..6d44a0cee9ee 100644 --- a/sys/cddl/dev/dtrace/riscv/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/riscv/dtrace_isa.c @@ -150,9 +150,8 @@ dtrace_getustack_common(uint64_t *pcstack, int pcstack_limit, uintptr_t pc, if (fp == 0) break; - pc = dtrace_fuword64((void *)(fp + - offsetof(struct riscv_frame, f_retaddr))); - fp = dtrace_fuword64((void *)fp); + pc = dtrace_fuword64((void *)(fp - 1 * sizeof(uint64_t))); + fp = dtrace_fuword64((void *)(fp - 2 * sizeof(uint64_t))); if (fp == oldfp) { *flags |= CPU_DTRACE_BADSTACK; diff --git a/sys/riscv/include/frame.h b/sys/riscv/include/frame.h index 3917aebfac76..a822a285996c 100644 --- a/sys/riscv/include/frame.h +++ b/sys/riscv/include/frame.h @@ -59,11 +59,6 @@ struct trapframe { uint64_t tf_scause; }; -struct riscv_frame { - struct riscv_frame *f_frame; - u_long f_retaddr; -}; - /* * Signal frame. Pushed onto user stack before calling sigcode. */