From nobody Mon Dec 27 00:15:37 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 E909A1907DE8; Mon, 27 Dec 2021 00:15:37 +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 4JMdVK3bFBz50VS; Mon, 27 Dec 2021 00:15:37 +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 451CE13FC5; Mon, 27 Dec 2021 00:15:37 +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 1BR0Fbnq016792; Mon, 27 Dec 2021 00:15:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BR0FbSt016791; Mon, 27 Dec 2021 00:15:37 GMT (envelope-from git) Date: Mon, 27 Dec 2021 00:15:37 GMT Message-Id: <202112270015.1BR0FbSt016791@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: 6c9c924b4387 - stable/13 - dtrace: Disable getf() as it is broken on FreeBSD 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6c9c924b43876469d8654d2f368661c7bd14f73e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640564137; 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=fvleSedMeldnMuW3lO+ZNrm02o1k8Xs9iIzIRkkDwl4=; b=Dy6109teqehh+gz4Rdt9PzG9Qj8aayIhIPt+pbMBpe98VB8GNJrrHKycg+08DxmpZ5qDHB IViyV4inrJrojNtHFU61mlctENUKLUpUQCYxaMF2J87/e0xZ9vhGAvE2dasxgcs9Ddy5EC 0DIzCMAdpxiTr9qMtPR2fC+ROrnxnESPU3Ay2e1HN9zlSNzeflTMiHSu/NxlPzmJgnb4wB 7Y8HBnKfz1bkAArbLghcSTybE+8TqT5Q00o0bFezOZxs2rdCYti/nSUVgOcesk81EvQS3h auLSN7d8SqgdyC9lYXRiUGbeRuO5s0dFd7XxULI5441Ipm6hHMB+LhcFd3MFUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640564137; a=rsa-sha256; cv=none; b=xsoKvjEZ4W2iLjDDoDqDb7Dj2OurO0+Ay8wVYWCwF2rWhOSHb5AGHRGD35SxSemeMYX5jJ QPEwdj2Lq3pJxiopNz2kn/6hMQiEOlGj+i+309E7dBmJH+ah6W8puzhlFr418sDXrwz0Cy WjOM8pX/T/n5se3KKyLcCQ+CnNKB4tLjn0BRVTQAzrCq2D/ms4QfPRof2pUwUbaJPQfnzp SruvVdnAMX5kpO+j0NzcEyeHv4jcUgJeRdIEI8yAS2TB9lf3oB7AD4jLqLa+yxZ+mKKsms /fRF85jIVdJSQV7WUGO2a3d8f9Kd5a9CQS41KJOiTN5NwBjFoNhs502Sfu0ejA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6c9c924b43876469d8654d2f368661c7bd14f73e commit 6c9c924b43876469d8654d2f368661c7bd14f73e Author: Domagoj Stolfa AuthorDate: 2021-12-17 16:01:54 +0000 Commit: Mark Johnston CommitDate: 2021-12-27 00:15:07 +0000 dtrace: Disable getf() as it is broken on FreeBSD getf() on FreeBSD calls _sx_slock(), _sx_sunlock() and fget_locked(). Furthermore, it does not set the per-core fault flag, meaning it usually ends up in a double fault panic once getf() does get called, especially from fbt. Reviewing the DTrace Toolkit + a number of other scripts scattered around FreeBSD, I have not been able to find one use of getf(). Given how broken the implementation currently is, we disable it until it can be implemented properly. Also comment out a test in aggs/tst.subr.d for getf(). Reviewed by: markj (cherry picked from commit 30ec3138edc9d491446409910f52ccb1b158253e) --- cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d | 2 +- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d index 9b02e982fe0d..6668f80d81a0 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d @@ -98,7 +98,7 @@ INTFUNC(ntohll(0x1234567890abcdefL)) STRFUNC(inet_ntoa((ipaddr_t *)alloca(sizeof (ipaddr_t)))) STRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof (in6_addr_t)))) STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof (ipaddr_t)))) -INTFUNC(getf(0)) +/* INTFUNC(getf(0)) */ INTFUNC(strtoll("0x12EE5D5", 16)) STRFUNC(json("{\"systemtap\": false}", "systemtap")) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index ca6fa5481856..40ef286805ab 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -10014,6 +10014,9 @@ dtrace_difo_validate(dtrace_difo_t *dp, dtrace_vstate_t *vstate, uint_t nregs, } if (subr == DIF_SUBR_GETF) { +#ifdef __FreeBSD__ + err += efunc(pc, "getf() not supported"); +#else /* * If we have a getf() we need to record that * in our state. Note that our state can be @@ -10024,6 +10027,7 @@ dtrace_difo_validate(dtrace_difo_t *dp, dtrace_vstate_t *vstate, uint_t nregs, */ if (vstate->dtvs_state != NULL) vstate->dtvs_state->dts_getf++; +#endif } break;