From nobody Wed Dec 29 10:39:55 2021 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 236A11927EA5; Wed, 29 Dec 2021 10:39:57 +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 4JP7Fm2jB4z4q2V; Wed, 29 Dec 2021 10:39:55 +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 8CAB62345F; Wed, 29 Dec 2021 10:39:55 +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 1BTAdt6R087604; Wed, 29 Dec 2021 10:39:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BTAdttW087603; Wed, 29 Dec 2021 10:39:55 GMT (envelope-from git) Date: Wed, 29 Dec 2021 10:39:55 GMT Message-Id: <202112291039.1BTAdttW087603@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: 5143c53dfb28 - stable/13 - Fix dtrace fbt return probes on arm64 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5143c53dfb289d17a796afdd1c3d38d71356533e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640774396; 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=u7X8fqDy0gcacuRSCukNiXB6Cud8806chZRxXfSMdlI=; b=Al4cypi+852am4v/C4IJBg3VZAAw1wEUYXCR4wQcdxfTfOfKxjaGyb7l18YljizfJu9Bxd MpepWWwlW3TY+LyqqQTvNYuVLoOWb/8Jvzsy1aW+3e2cgwEKqSkMqDVR2e1LC1vGvACm7L zMTt8qAXLPiffmNh/Yq+LdIty+qxoUzMxZVZyNTgHhIRSldKh4DulH21fb23MkADMlOA19 Kzket8lPKCoHq09WTq0QfdWXUNY5hNceECUVxs90gdFdlPER+aJNfhcZ0+32WMGpZBr00L QmHO42jWarJKCvuoOsm4nfNfAzCEuB7u7g1LnKnO32CdwmCK/02fsRE59EUEJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640774396; a=rsa-sha256; cv=none; b=KFPsLipuTHvTwJpA63UF++0QGgORUM1fWZak8N2a5XEgZR6IpL+Nqz4SVoq0dYI16TB8hU Yok0hrCVgH3V1C1IbRvDmo7MkyKoIRDmo1khtvFBJUMts0VVKfFSTp7Rt1FjMAwjF5iDH0 Qs85oZiTav/ktif5UmAhp8Sq1PqbAtLKTQ78W9Kse5a3gxFSUZ1FJ+0nCZtGxXBEG/krRA oHKWqigszoiMf99o9yV+mIxeIcMOKVN2x1ksV+sIuWk1IekoWz9vQya3IJnsT25Zqmnuw6 70G1kZKym8fQBmNDBvAmsOoC44uBDBvpI//kkNYvCACefP7Wg5PeprC9SuvZnQ== 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=5143c53dfb289d17a796afdd1c3d38d71356533e commit 5143c53dfb289d17a796afdd1c3d38d71356533e Author: Andrew Turner AuthorDate: 2021-12-14 15:49:07 +0000 Commit: Andrew Turner CommitDate: 2021-12-29 10:06:00 +0000 Fix dtrace fbt return probes on arm64 As with arm and riscv fix return fbt probes on arm64. arg0 should be the offset within the function of the return instruction and arg1 should be the return value. Reviewed by: kp, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33440 (cherry picked from commit e3ccf4f9dee9ae39774639407264199a07fa41ff) --- sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 2 +- sys/cddl/dev/fbt/aarch64/fbt_isa.c | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c index 9bf9f0798bb5..ede6353a803f 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c @@ -270,7 +270,7 @@ dtrace_invop_start(struct trapframe *frame) int tmp; int i; - invop = dtrace_invop(frame->tf_elr, frame, frame->tf_elr); + invop = dtrace_invop(frame->tf_elr, frame, frame->tf_x[0]); tmp = (invop & LDP_STP_MASK); if (tmp == STP_64 || tmp == LDP_64) { diff --git a/sys/cddl/dev/fbt/aarch64/fbt_isa.c b/sys/cddl/dev/fbt/aarch64/fbt_isa.c index 6bc351ad74f6..6a21c7f403de 100644 --- a/sys/cddl/dev/fbt/aarch64/fbt_isa.c +++ b/sys/cddl/dev/fbt/aarch64/fbt_isa.c @@ -56,16 +56,21 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) fbt = fbt_probetab[FBT_ADDR2NDX(addr)]; for (; fbt != NULL; fbt = fbt->fbtp_hashnext) { - if ((uintptr_t)fbt->fbtp_patchpoint == addr) { - cpu->cpu_dtrace_caller = addr; + if ((uintptr_t)fbt->fbtp_patchpoint != addr) + continue; + cpu->cpu_dtrace_caller = addr; + + if (fbt->fbtp_roffset == 0) { dtrace_probe(fbt->fbtp_id, frame->tf_x[0], frame->tf_x[1], frame->tf_x[2], frame->tf_x[3], frame->tf_x[4]); - - cpu->cpu_dtrace_caller = 0; - return (fbt->fbtp_savedval); + } else { + dtrace_probe(fbt->fbtp_id, fbt->fbtp_roffset, rval, + 0, 0, 0); } + cpu->cpu_dtrace_caller = 0; + return (fbt->fbtp_savedval); } return (0); @@ -199,6 +204,7 @@ again: fbt->fbtp_rval = DTRACE_INVOP_B; else fbt->fbtp_rval = DTRACE_INVOP_RET; + fbt->fbtp_roffset = (uintptr_t)instr - (uintptr_t)symval->value; fbt->fbtp_savedval = *instr; fbt->fbtp_patchval = FBT_PATCHVAL; fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)];