From nobody Thu Aug 08 15:58:02 2024 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 4WfsBz12wNz5T79S; Thu, 08 Aug 2024 15:58:03 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WfsBz0HV7z4Jss; Thu, 8 Aug 2024 15:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723132683; 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=vqm4cdICJlk8BOf75lveHQnj/gB9HNBl8p+WC4m4Xk8=; b=srXdTMZxIUT5XmCzyIeMY5IHjbmGSvwsRr8hILsn2hOjMdPvgSnjDQ9XVumxXmykNlSVZ0 HqxcgRIiyNNcTT9Hp2qx1p9Su5JGLExAcbne/CrSJRi+iL88ZSZ7DXkmxFKGnZC3anLrdV 5f6daKmajU9kUGD1zO6zTbYg+q1NhRi/HtvK+NcXQIlEhjwnYxa+rSyBtcFDC10xEBvw9/ IajuWAGeldChjTgcNC4JOUW9O3KxXlYbgL9nXDjricBiX5Z0OTkVe78DyNMflqI1YX7RQ6 7qM/00kK/SpMOr7ueS9FVr4iz6qP1q4R8y1sj7V986+WbIbiuD7MCRw8fTykMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723132683; a=rsa-sha256; cv=none; b=IYZ+Zb+hkqPlUkDEZ1rKBqeiwobkTK8xXjLG5D5nCi4l+cxjvK6LSNe9sx8rW3slM9bXrA DsFXjN4UtKThckE22uIWXtTclDkI36upJGvTBC1gGKu7tD+YBAlOqbRte9gwqxCrgaiUUT s0/2j2DxT9N5ai6qgad2Ep2llrmMpjJ7mm9JnM9JI1NoNuDT3KFeLK3zqWcGVUstSyXneU RD9R12uZs4R9aq4FnlyGiZJRmMNCzMnAiKHvmg6NiyghLcKwZ9iOC0qLagP+LmfByytpgW 1z6IyXLDQwL++OQ5W6KiJCQR/5n/ZqalnWmhRQBQqo8JSWI+uC2pvMGkbXrzYQ== 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=1723132683; 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=vqm4cdICJlk8BOf75lveHQnj/gB9HNBl8p+WC4m4Xk8=; b=hX0YaET7y8cT8TaJGHPWQrQImwmGdz3YiS1n+ATEx1ZDvLVDcEu53A8j/BYx4fq5b8+nGU 8FrLUrafFpEtGCgZnXtRM20ME9h2yAwTEpc20IuZE6YoozySV1vrhGEAY5EslG2Eu4SiTs fPB6K1gAYCrFP1Rj5EubytFqBGyCpDS84DeSKv3i5rgmyaOvt9RmpmsOPjGQ7DtohHv07L EnCQZUFqMc8ej04wRDqIFfMOJK1KZIEaj1wngn7vIf43E8d+Z9bfCMD9NI14f8Kbmvtr5E /v5o/S9AIyu3SIafb5ywlCLj5evzJajMmmhRGeUgIhHvTAz911g/DX+Dn+/1rw== 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 4WfsBy6tM1zflm; Thu, 8 Aug 2024 15:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 478Fw2ih092457; Thu, 8 Aug 2024 15:58:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 478Fw2op092454; Thu, 8 Aug 2024 15:58:02 GMT (envelope-from git) Date: Thu, 8 Aug 2024 15:58:02 GMT Message-Id: <202408081558.478Fw2op092454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 096cb89033a4 - stable/14 - dtrace: Avoid including dtrace_isa.c directly into dtrace.c 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 096cb89033a4ee78aa891cfef06d3b48a96537b0 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=096cb89033a4ee78aa891cfef06d3b48a96537b0 commit 096cb89033a4ee78aa891cfef06d3b48a96537b0 Author: Mark Johnston AuthorDate: 2024-07-24 20:10:33 +0000 Commit: Mark Johnston CommitDate: 2024-08-08 15:53:50 +0000 dtrace: Avoid including dtrace_isa.c directly into dtrace.c This was done in the original DTrace import, presumably because that made it a bit easier to handle includes. However, this can cause dtrace_getpcstack() to be inlined into dtrace_probe(), resulting in a missing frame in stack traces since dtrace_getpcstack() takes care to bump "aframes" to account for its own stack frame. To avoid this, compile dtrace_isa.c separately on all platforms. Add requisite includes. MFC after: 2 weeks Sponsored by: Innovate UK (cherry picked from commit 82283cad12a417abfb1469d899b2d7cfb1d38f77) --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 1 - sys/cddl/dev/dtrace/aarch64/dtrace_isa.c | 3 +++ sys/cddl/dev/dtrace/amd64/dtrace_isa.c | 3 ++- sys/cddl/dev/dtrace/arm/dtrace_isa.c | 1 + sys/cddl/dev/dtrace/i386/dtrace_isa.c | 3 ++- sys/cddl/dev/dtrace/powerpc/dtrace_isa.c | 2 ++ sys/cddl/dev/dtrace/riscv/dtrace_isa.c | 1 + sys/cddl/dev/fbt/x86/fbt_isa.c | 2 +- sys/conf/files.arm | 1 + sys/conf/files.riscv | 1 + sys/modules/dtrace/dtrace/Makefile | 1 + 11 files changed, 15 insertions(+), 4 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index ce02676e0dc1..d3e40e96e897 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -18446,7 +18446,6 @@ static struct cdevsw helper_cdevsw = { #include #include #include -#include SYSINIT(dtrace_load, SI_SUB_DTRACE, SI_ORDER_FIRST, dtrace_load, NULL); SYSUNINIT(dtrace_unload, SI_SUB_DTRACE, SI_ORDER_FIRST, dtrace_unload, NULL); diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c index 72944e8a5ae2..ff0e068006bd 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -46,6 +47,8 @@ #include #include +#include + #include "regset.h" #define MAX_USTACK_DEPTH 2048 diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c index 0b7162998536..9db5a16190db 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -368,7 +369,7 @@ dtrace_getarg(int arg, int aframes) for (i = 1; i <= aframes; i++) { fp = fp->f_frame; - if (P2ROUNDUP(fp->f_retaddr, 16) == + if (roundup2(fp->f_retaddr, 16) == (long)dtrace_invop_callsite) { /* * In the case of amd64, we will use the pointer to the diff --git a/sys/cddl/dev/dtrace/arm/dtrace_isa.c b/sys/cddl/dev/dtrace/arm/dtrace_isa.c index c3783b77c2d4..ed03e5ca0006 100644 --- a/sys/cddl/dev/dtrace/arm/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/arm/dtrace_isa.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/sys/cddl/dev/dtrace/i386/dtrace_isa.c b/sys/cddl/dev/dtrace/i386/dtrace_isa.c index 64c8de2a8d3a..7a30587120ba 100644 --- a/sys/cddl/dev/dtrace/i386/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/i386/dtrace_isa.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -428,7 +429,7 @@ dtrace_getarg(int arg, int aframes) for (i = 1; i <= aframes; i++) { fp = fp->f_frame; - if (P2ROUNDUP(fp->f_retaddr, 4) == + if (roundup2(fp->f_retaddr, 4) == (long)dtrace_invop_callsite) { /* * If we pass through the invalid op handler, we will diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c index 7185a01c125d..acde4f0aeab2 100644 --- a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -37,6 +38,7 @@ #include #include #include +#include #include #include diff --git a/sys/cddl/dev/dtrace/riscv/dtrace_isa.c b/sys/cddl/dev/dtrace/riscv/dtrace_isa.c index 87f52b809dfa..7a66d93d4ba9 100644 --- a/sys/cddl/dev/dtrace/riscv/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/riscv/dtrace_isa.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/sys/cddl/dev/fbt/x86/fbt_isa.c b/sys/cddl/dev/fbt/x86/fbt_isa.c index 41e2823a1543..8f8a79ef31ef 100644 --- a/sys/cddl/dev/fbt/x86/fbt_isa.c +++ b/sys/cddl/dev/fbt/x86/fbt_isa.c @@ -55,7 +55,7 @@ #define FBT_PATCHVAL 0xf0 #endif -#define FBT_AFRAMES 2 +#define FBT_AFRAMES 3 int fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t scratch __unused) diff --git a/sys/conf/files.arm b/sys/conf/files.arm index fbd294ebdb42..886ffebae28c 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -77,6 +77,7 @@ arm/arm/unwind.c optional ddb | kdtrace_hooks | stack arm/arm/vm_machdep.c standard arm/arm/vfp.c optional vfp cddl/dev/dtrace/arm/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" +cddl/dev/dtrace/arm/dtrace_isa.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/dtrace/arm/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/arm/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index cf121811ba23..42f1787489ac 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -1,4 +1,5 @@ cddl/dev/dtrace/riscv/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" +cddl/dev/dtrace/riscv/dtrace_isa.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/dtrace/riscv/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/dtrace/riscv/instr_size.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/riscv/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" diff --git a/sys/modules/dtrace/dtrace/Makefile b/sys/modules/dtrace/dtrace/Makefile index 53e5f1792ad5..80490952f97e 100644 --- a/sys/modules/dtrace/dtrace/Makefile +++ b/sys/modules/dtrace/dtrace/Makefile @@ -13,6 +13,7 @@ KMOD= dtrace SRCS= dtrace.c \ dtrace_xoroshiro128_plus.c \ dtrace_asm.S \ + dtrace_isa.c \ dtrace_subr.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"