From nobody Thu Apr 20 17:36:12 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 4Q2Pvx3ym7z46MMg; Thu, 20 Apr 2023 17:36:13 +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 4Q2Pvx0cvmz3JD0; Thu, 20 Apr 2023 17:36:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682012173; 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=NLNg01ihJmZuMVkypELmRewKVIumAksYk6O39Em5XHQ=; b=NjT1lo7qw56TDTw8UEW1x48AXhvSxihgR8y5uDTfvm6kmfJzW6WW6dA5GqQXhjcNYwRWRA a1+F4ipL5ZUvdPaxUDuJgZ6XaUYDm8lFeg5h+YJJoj5+1ku3GtZrjXuhBdb9OK6rTHup4j joc4GVxZ6I8wqMpBF3qerLSZisi04q66xAXBgwoEiw3UagLB1SoB+3ngdbULzdj5U6G0w2 tIAONpgFtpfpe6LfVaAnZwiQvSUx1ZkyOyKz9G7EsKSE8pQHWsi3yVQfAvNHNU+fAzLN3C nBloT0+v+5Qo1xG7GpgnRCEIYHM9nVYR7FsuQxdE17rgLb7kWlUdQC/zRBcWeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682012173; 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=NLNg01ihJmZuMVkypELmRewKVIumAksYk6O39Em5XHQ=; b=gMPkmXEYoKt6bWESpZNpLArH/cUFlLG7DX2r5ZhOxGQCnvj+jcUen9dp3rhYd9sXQ4futd 4UFcE5P82C7p2Ur0BOWeUcc48li+Jf+oje+saV1BLVPv9oJeJtfnrOGG0eUHm/tIRzS5R8 fj4tENPUwurOwSwv5pEY5W8D3VtsxyETf3yOENNnSvrltavZ6cqtq1wZYPJwPMrhG7bjKD YWD5Z6O1XVfbNEWbFPYwz3dK0pjlRV5ooHr5+pzVccNiL7Zf72FqMc6UXxnXIhhFEWKVZe 6cJ/N2IbSnOQjOH+G400F0uJBev+5VM3llMmgcoJuV5MM+tXe/r2/RL1OdGiFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682012173; a=rsa-sha256; cv=none; b=J7uoqZng1N/8/ZzQnAnxV7/sAf70BJbybpt3TFNsBGdgRB7B1vD15RcCjVgCF07IXUgXpi NO1SEQLZOOtR+ep3ztgVyM13grNiO2vntgbOO+1uAzFV62f0k5CPTUrB7Lf4uvbYVikbFd nUzi0zRiJEJAWHZxCe8CELnjB45rczU+I6mCVg+0/U/dZJrJj5MBDANe/H0joc1ZzatMZ9 Fac6fJIQoO1PfbPAKyG5KP7MI882ZV7evdEtOmU7Yxdpur9GzWrzOtBZ36bA78QujhMpgT 36tU/U/HXCvpMFUnyLkxaTW1EHq5HiFttFKaG7FioMKj+fBttIVm9QE3FE3oIg== 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 4Q2Pvw5zYtzmcD; Thu, 20 Apr 2023 17:36:12 +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 33KHaCwr077267; Thu, 20 Apr 2023 17:36:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33KHaCXC077266; Thu, 20 Apr 2023 17:36:12 GMT (envelope-from git) Date: Thu, 20 Apr 2023 17:36:12 GMT Message-Id: <202304201736.33KHaCXC077266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 75081b9ed8e6 - main - dtrace: use dtrace_instr_size() in the riscv dtrace_subr.c 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75081b9ed8e67c8443551828f1b5ccf3d449b41b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=75081b9ed8e67c8443551828f1b5ccf3d449b41b commit 75081b9ed8e67c8443551828f1b5ccf3d449b41b Author: Christos Margiolis AuthorDate: 2023-04-20 16:24:03 +0000 Commit: Mark Johnston CommitDate: 2023-04-20 17:35:57 +0000 dtrace: use dtrace_instr_size() in the riscv dtrace_subr.c No functional change intended. Reviewed by: mhorne, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39652 --- sys/cddl/dev/dtrace/riscv/dtrace_subr.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/sys/cddl/dev/dtrace/riscv/dtrace_subr.c b/sys/cddl/dev/dtrace/riscv/dtrace_subr.c index 1717b118be7e..f42c073f94c9 100644 --- a/sys/cddl/dev/dtrace/riscv/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/riscv/dtrace_subr.c @@ -190,8 +190,6 @@ dtrace_gethrestime(void) int dtrace_trap(struct trapframe *frame, u_int type) { - uint16_t insn; - /* * A trap can occur while DTrace executes a probe. Before * executing the probe, DTrace blocks re-scheduling and sets @@ -219,15 +217,10 @@ dtrace_trap(struct trapframe *frame, u_int type) /* * Offset the instruction pointer to the instruction - * following the one causing the fault. Check if the - * instruction is compressed or not. Standard - * instructions always have bits [1:0] == 11. + * following the one causing the fault. */ - insn = *(uint16_t *)frame->tf_sepc; - if (match_opcode(insn, 0x3, 0x3)) - frame->tf_sepc += INSN_SIZE; - else - frame->tf_sepc += INSN_C_SIZE; + frame->tf_sepc += + dtrace_instr_size((uint8_t *)frame->tf_sepc); return (1); default: