From owner-svn-src-head@freebsd.org Sun Nov 6 00:31:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58C09BED53A for ; Sun, 6 Nov 2016 00:31:14 +0000 (UTC) (envelope-from areilly@bigpond.net.au) Received: from nsstlmta31p.bpe.bigpond.com (nsstlmta31p.bpe.bigpond.com [203.38.21.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "", Issuer "Openwave Messaging Inc." (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A4242DA4; Sun, 6 Nov 2016 00:31:12 +0000 (UTC) (envelope-from areilly@bigpond.net.au) Received: from smtp.telstra.com ([10.10.24.4]) by nsstlfep31p-svc.bpe.nexus.telstra.com.au with ESMTP id <20161106003058.KDDI4586.nsstlfep31p-svc.bpe.nexus.telstra.com.au@smtp.telstra.com>; Sun, 6 Nov 2016 11:30:58 +1100 X-RG-Spam: Unknown X-Junkmail-Premium-Raw: score=8/50, refid=2.7.2:2016.11.5.233917:17:8.317, ip=, rules=__HAS_FROM, __FRAUD_WEBMAIL_FROM, __CT, __CT_TEXT_PLAIN, __CTE, __MIME_VERSION, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __HAS_MSGID, __SANE_MSGID, __MSGID_APPLEMAIL, __TO_MALFORMED_2, __TO_NO_NAME, __HAS_X_MAILER, __X_MAILER_APPLEMAIL, __UNUSABLE_MSGID, MIME_LOWER_CASE, __ANY_URI, __HTTPS_URI, __URI_WITH_PATH, URI_ENDS_IN_HTML, __URI_NO_MAILTO, __URI_NO_WWW, __CP_URI_IN_BODY, __SUBJ_ALPHA_NEGATE, SUPERLONG_LINE, __URI_IN_BODY, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_1600_1699, __MIME_TEXT_P1, __MIME_TEXT_ONLY, __URI_NS, HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, __FRAUD_WEBMAIL, __USER_AGENT_APPLEMAIL, __SINGLE_URI_TEXT, SINGLE_URI_IN_BODY, __PHISH_SPEAR_STRUCTURE_1, BODY_SIZE_2000_LESS, __MIME_TEXT_P, BODY_SIZE_7000_LESS X-RG-Spam: Unknown X-Authentication-Info: Submitted using ID areilly@bigpond.net.au Received: from ghanamia.reilly.home (124.190.40.182) by smtp.telstra.com (9.0.018.03.01) (authenticated as areilly@bigpond.net.au) id 580EDDA5008023AC; Sun, 6 Nov 2016 11:30:58 +1100 From: Andrew Reilly Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r307227 - in head: include lib/libc/stdlib lib/libc/tests/stdlib Message-Id: Date: Sun, 6 Nov 2016 11:30:55 +1100 To: svn-src-head@freebsd.org, ed@freebsd.org X-Mailer: Apple Mail (2.3251) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 00:31:14 -0000 Hi there, Re: = https://lists.freebsd.org/pipermail/svn-src-head/2016-October/092694.html In a rebuild of stable/11 today (and yesterday), the build stops in = lib/libc/tests/stdlib: /usr/src/lib/libc/tests/stdlib/tsearch_test.c:37:20: error: unknown type = name 'posix_tnode' tnode_assert(const posix_tnode *n) ^ /usr/src/lib/libc/tests/stdlib/tsearch_test.c:82:2: error: use of = undeclared identifier 'posix_tnode' posix_tnode *root =3D NULL; ^ /usr/src/lib/libc/tests/stdlib/tsearch_test.c:82:15: error: use of = undeclared identifier 'root' posix_tnode *root =3D NULL; ^ /usr/src/lib/libc/tests/stdlib/tsearch_test.c:89:30: error: use of = undeclared identifier 'root' ATF_CHECK(tdelete(&key, &root, compar) = !=3D NULL); etc This commit seems related, although I wonder if something else is going = on with the build? I would expect that make buildworld in /usr/src would use = /usr/src/include, instead of the system one, but this failure seems to = relate to the use of the system /usr/include/search.h (which doesn't = include the change above) instead of /usr/src/include/search.h, which = does. When the buildworld started, there was a comment to the effect that the = system clang looked to be the same as the source clang, so it would use = that instead. Is clang somehow hanging onto the system include = directories, when it shouldn't? After copying /usr/src/include/search.h to /usr/include and restarting = make buildworld, the lib/libc/tests/stdlib (all) passes OK... Cheers, --=20 Andrew Reilly From owner-svn-src-head@freebsd.org Sun Nov 6 02:33:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8BDBC303B9; Sun, 6 Nov 2016 02:33:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 882DAB29; Sun, 6 Nov 2016 02:33:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA62X4fC013457; Sun, 6 Nov 2016 02:33:04 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA62X4td013456; Sun, 6 Nov 2016 02:33:04 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201611060233.uA62X4td013456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 6 Nov 2016 02:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308358 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 02:33:05 -0000 Author: ae Date: Sun Nov 6 02:33:04 2016 New Revision: 308358 URL: https://svnweb.freebsd.org/changeset/base/308358 Log: Initialize ip6 pointer before use. PR: 214169 MFC after: 1 week Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sun Nov 6 00:35:43 2016 (r308357) +++ head/sys/netinet/tcp_subr.c Sun Nov 6 02:33:04 2016 (r308358) @@ -2731,6 +2731,7 @@ tcp_signature_do_compute(struct mbuf *m, * Note: Upper-Layer Packet Length comes before Next Header. */ case (IPV6_VERSION >> 4): + ip6 = mtod(m, struct ip6_hdr *); in6 = ip6->ip6_src; in6_clearscope(&in6); MD5Update(&ctx, (char *)&in6, sizeof(struct in6_addr)); From owner-svn-src-head@freebsd.org Sun Nov 6 09:14:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9442C30FB8 for ; Sun, 6 Nov 2016 09:14:18 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x235.google.com (mail-yb0-x235.google.com [IPv6:2607:f8b0:4002:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 829BE2D9 for ; Sun, 6 Nov 2016 09:14:17 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x235.google.com with SMTP id v78so45126188ybe.3 for ; Sun, 06 Nov 2016 01:14:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/D+j96WZGUQyizzoiH4v1GiUg/Qx/UPt5QoegqD6clU=; b=Eb41zEtNUVmivJXhAJ16lDE0Af/Bg9JycowxIrNIM7WFbNsgK9410hfRxHn13zZX6t xZzMNICdHOKYaQEIN1CZspMM0GPzkVCsXF7UwoRPokuz152NYzwLhOCNvlIqSComipPw pZ77H0X3FpoHoYOEeCT8ICW35UJ/I/+Ph8Zua0hqKAoYnK7Z4QtKA9DnwavTx27cLNsG GVwt4nzneBhag8Ci/0UGOrOsZffL83xL6kJr35gGGAZ0dRSBI8vCtq9rX739BPIlsjso pyk5bKGZwJY6otL3UdD/QYRYS8SRG2J69HykQfH+SKLXEVVDbjKCkMnz2wQN7Qdq3sHg MVBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/D+j96WZGUQyizzoiH4v1GiUg/Qx/UPt5QoegqD6clU=; b=Ar6/NDeVLJhZG5oCqAqwgffK2oHYQcFpD8S7/bSOYSdMzOViypT6rjvrnWHJx8OST9 IEbPjaAh6j1qBZpNVKZLeJF2v3cFOf45G/HLVgYcuWQHb0xzSJpn4X2SjEL3tRZLYOrZ FveLBPpDGuuquumv/6y+HlikrFmfvPXyUBSIyxkTiFI6hMkROfRTR6eonkYH2yNTyJfO VKdNbLH3Fz/ZxFLRuqlIDMUx7qJsrQhqRkizQpMXqWW/kF83JnXGAmu+icn/v3cTkHQ7 pAIZuDQkuEix0cfDasE3YkEbV2NAAKczsDqgK+WXLWyjwAEXmJJTkbhokNJTohYxX0AZ +3Eg== X-Gm-Message-State: ABUngvcK1Gjojxo+ksLeqD22QlD8+b7/BSfkE5U6KUDSTEHAWd3F7+3MQTMcoucgeGWucnPhiEzOaX+3gLuADQ== X-Received: by 10.37.43.6 with SMTP id r6mr1205456ybr.24.1478423656772; Sun, 06 Nov 2016 01:14:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.13.246.129 with HTTP; Sun, 6 Nov 2016 01:13:46 -0800 (PST) In-Reply-To: References: From: Ed Schouten Date: Sun, 6 Nov 2016 10:13:46 +0100 Message-ID: Subject: Re: svn commit: r307227 - in head: include lib/libc/stdlib lib/libc/tests/stdlib To: Andrew Reilly Cc: svn-src-head@freebsd.org, "ed@FreeBSD.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 09:14:18 -0000 Hi Andrew, 2016-11-06 1:30 GMT+01:00 Andrew Reilly : > Hi there, > > Re: https://lists.freebsd.org/pipermail/svn-src-head/2016-October/092694.html > > In a rebuild of stable/11 today (and yesterday), the build stops in lib/libc/tests/stdlib: > > /usr/src/lib/libc/tests/stdlib/tsearch_test.c:37:20: error: unknown type name 'posix_tnode' I just checked out the latest copy of stable/11 and things seem to build all right, even on a 10.x system. Do you have anything special in src.conf? How did you invoke 'make buildworld' exactly? What happens if you delete /usr/obj prior to starting the build? Best regards, -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Sun Nov 6 16:27:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EEBFC30B90; Sun, 6 Nov 2016 16:27:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C83ACC31; Sun, 6 Nov 2016 16:27:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA6GR9wW038026; Sun, 6 Nov 2016 16:27:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA6GR9YS038025; Sun, 6 Nov 2016 16:27:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201611061627.uA6GR9YS038025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 6 Nov 2016 16:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308375 - head/contrib/llvm/lib/Target/AArch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 16:27:11 -0000 Author: dim Date: Sun Nov 6 16:27:09 2016 New Revision: 308375 URL: https://svnweb.freebsd.org/changeset/base/308375 Log: Pull in r278002 from upstream llvm trunk (by Silviu Baranga): [AArch64] PR28877: Don't assume we're running after legalization when creating vcvtfp2fxs Summary: The DAG combine transformation that was generating the aarch64_neon_vcvtfp2fxs node was assuming that all inputs where legal and wasn't accounting that the input could be a v4f64 if we're trying to do the transformation before legalization. We now bail out in this case. All illegal types besides v4f64 were already rejected. Fixes https://llvm.org/bugs/show_bug.cgi?id=28877 Reviewers: jmolloy Subscribers: aemerson, rengolin, llvm-commits Differential Revision: https://reviews.llvm.org/D23261 This fixes several ports on AArch64. Requested by: andrew MFC after: 3 days Modified: head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Modified: head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Sun Nov 6 15:25:46 2016 (r308374) +++ head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Sun Nov 6 16:27:09 2016 (r308375) @@ -7562,6 +7562,7 @@ static SDValue performIntToFpCombine(SDN /// Fold a floating-point multiply by power of two into floating-point to /// fixed-point conversion. static SDValue performFpToIntCombine(SDNode *N, SelectionDAG &DAG, + TargetLowering::DAGCombinerInfo &DCI, const AArch64Subtarget *Subtarget) { if (!Subtarget->hasNEON()) return SDValue(); @@ -7604,10 +7605,16 @@ static SDValue performFpToIntCombine(SDN ResTy = FloatBits == 32 ? MVT::v2i32 : MVT::v2i64; break; case 4: - ResTy = MVT::v4i32; + ResTy = FloatBits == 32 ? MVT::v4i32 : MVT::v4i64; break; } + if (ResTy == MVT::v4i64 && DCI.isBeforeLegalizeOps()) + return SDValue(); + + assert((ResTy != MVT::v4i64 || DCI.isBeforeLegalizeOps()) && + "Illegal vector type after legalization"); + SDLoc DL(N); bool IsSigned = N->getOpcode() == ISD::FP_TO_SINT; unsigned IntrinsicOpcode = IsSigned ? Intrinsic::aarch64_neon_vcvtfp2fxs @@ -9711,7 +9718,7 @@ SDValue AArch64TargetLowering::PerformDA return performIntToFpCombine(N, DAG, Subtarget); case ISD::FP_TO_SINT: case ISD::FP_TO_UINT: - return performFpToIntCombine(N, DAG, Subtarget); + return performFpToIntCombine(N, DAG, DCI, Subtarget); case ISD::FDIV: return performFDivCombine(N, DAG, Subtarget); case ISD::OR: From owner-svn-src-head@freebsd.org Sun Nov 6 17:12:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E2A6C333A9; Sun, 6 Nov 2016 17:12:03 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00510920; Sun, 6 Nov 2016 17:12:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA6HC2kh065924; Sun, 6 Nov 2016 17:12:02 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA6HC2Ql065923; Sun, 6 Nov 2016 17:12:02 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201611061712.uA6HC2Ql065923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 6 Nov 2016 17:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308377 - head/sys/dev/rtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 17:12:03 -0000 Author: avos Date: Sun Nov 6 17:12:02 2016 New Revision: 308377 URL: https://svnweb.freebsd.org/changeset/base/308377 Log: rtwn: reset watchdog timer on device shutdown. Modified: head/sys/dev/rtwn/if_rtwn.c Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Sun Nov 6 16:44:33 2016 (r308376) +++ head/sys/dev/rtwn/if_rtwn.c Sun Nov 6 17:12:02 2016 (r308377) @@ -1966,6 +1966,7 @@ rtwn_stop(struct rtwn_softc *sc) #ifndef D4054 callout_stop(&sc->sc_watchdog_to); + sc->sc_tx_timer = 0; #endif sc->sc_flags &= ~(RTWN_STARTED | RTWN_RUNNING | RTWN_FW_LOADED); sc->sc_flags &= ~RTWN_TEMP_MEASURED; From owner-svn-src-head@freebsd.org Sun Nov 6 17:21:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D8D4C33932; Sun, 6 Nov 2016 17:21:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C39561D; Sun, 6 Nov 2016 17:21:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA6HLQGQ073383; Sun, 6 Nov 2016 17:21:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA6HLQHk073382; Sun, 6 Nov 2016 17:21:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611061721.uA6HLQHk073382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 6 Nov 2016 17:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308379 - head/lib/libgcc_s X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 17:21:27 -0000 Author: emaste Date: Sun Nov 6 17:21:26 2016 New Revision: 308379 URL: https://svnweb.freebsd.org/changeset/base/308379 Log: add __divdi3 and __udivdi3 to libgcc_s symbol version map After r308294 they were missing on i386 (and previously were exported only accidentally). Reported by: antoine Modified: head/lib/libgcc_s/Version.map Modified: head/lib/libgcc_s/Version.map ============================================================================== --- head/lib/libgcc_s/Version.map Sun Nov 6 17:17:52 2016 (r308378) +++ head/lib/libgcc_s/Version.map Sun Nov 6 17:21:26 2016 (r308379) @@ -15,6 +15,7 @@ global: __deregister_frame; __deregister_frame_info; __deregister_frame_info_bases; + __divdi3; __divti3; __ffsdi2; __ffsti2; @@ -47,6 +48,7 @@ global: __subvdi3; __subvsi3; __ucmpti2; + __udivdi3; __udivmodti4; __udivti3; __umodti3; From owner-svn-src-head@freebsd.org Sun Nov 6 17:24:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8FA0C33B58; Sun, 6 Nov 2016 17:24:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 892B9A36; Sun, 6 Nov 2016 17:24:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA6HOGGV073957; Sun, 6 Nov 2016 17:24:16 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA6HOGGd073956; Sun, 6 Nov 2016 17:24:16 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201611061724.uA6HOGGd073956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 6 Nov 2016 17:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308380 - head/sys/dev/rtwn/rtl8192c/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 17:24:17 -0000 Author: avos Date: Sun Nov 6 17:24:16 2016 New Revision: 308380 URL: https://svnweb.freebsd.org/changeset/base/308380 Log: rtwn: reduce shutdown time for RTL8188CE. Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_fw.c Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_fw.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce_fw.c Sun Nov 6 17:21:26 2016 (r308379) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce_fw.c Sun Nov 6 17:24:16 2016 (r308380) @@ -69,6 +69,7 @@ r92ce_fw_reset(struct rtwn_softc *sc, in * We must sleep for one second to let the firmware settle. * Accessing registers too early will hang the whole system. */ - rtwn_delay(sc, 1000 * 1000); + if (reason == RTWN_FW_RESET_DOWNLOAD) + rtwn_delay(sc, 1000 * 1000); } #endif From owner-svn-src-head@freebsd.org Sun Nov 6 18:11:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A7FAC33F60; Sun, 6 Nov 2016 18:11:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D6642F7; Sun, 6 Nov 2016 18:11:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA6IBJ4G095150; Sun, 6 Nov 2016 18:11:19 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA6IBJO4095149; Sun, 6 Nov 2016 18:11:19 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201611061811.uA6IBJO4095149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 6 Nov 2016 18:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308381 - head/sys/dev/rtwn/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 18:11:20 -0000 Author: avos Date: Sun Nov 6 18:11:19 2016 New Revision: 308381 URL: https://svnweb.freebsd.org/changeset/base/308381 Log: rtwn: fix Tx ring cleanup. Do not try to clear stale Tx descriptor entries when there are some running vaps; just free node references - rtwn_pci_tx_done() will free mbufs without creating holes in the Tx descriptor space. Also, reset only 2 first entries in the beacon ring - other will not be used anyway. Tested with RTL8188CE, STA + STA mode. Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_attach.c Sun Nov 6 17:24:16 2016 (r308380) +++ head/sys/dev/rtwn/pci/rtwn_pci_attach.c Sun Nov 6 18:11:19 2016 (r308381) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -75,6 +76,8 @@ static int rtwn_pci_alloc_rx_list(struct static void rtwn_pci_reset_rx_list(struct rtwn_softc *); static void rtwn_pci_free_rx_list(struct rtwn_softc *); static int rtwn_pci_alloc_tx_list(struct rtwn_softc *, int); +static void rtwn_pci_reset_tx_ring_stopped(struct rtwn_softc *, int); +static void rtwn_pci_reset_beacon_ring(struct rtwn_softc *, int); static void rtwn_pci_reset_tx_list(struct rtwn_softc *, struct ieee80211vap *, int); static void rtwn_pci_free_tx_list(struct rtwn_softc *, int); @@ -312,48 +315,109 @@ fail: } static void -rtwn_pci_reset_tx_list(struct rtwn_softc *sc, struct ieee80211vap *vap, - int qid) +rtwn_pci_reset_tx_ring_stopped(struct rtwn_softc *sc, int qid) { - struct rtwn_vap *uvp = RTWN_VAP(vap); struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); - struct rtwn_tx_ring *tx_ring = &pc->tx_ring[qid]; - int i, id; - - id = (uvp != NULL ? uvp->id : RTWN_VAP_ID_INVALID); + struct rtwn_tx_ring *ring = &pc->tx_ring[qid]; + int i; for (i = 0; i < RTWN_PCI_TX_LIST_COUNT; i++) { - struct rtwn_tx_data *tx_data = &tx_ring->tx_data[i]; + struct rtwn_tx_data *data = &ring->tx_data[i]; + void *desc = (uint8_t *)ring->desc + sc->txdesc_len * i; - if (vap == NULL || (tx_data->ni == NULL && - (tx_data->id == id || id == RTWN_VAP_ID_INVALID)) || - (tx_data->ni != NULL && tx_data->ni->ni_vap == vap)) { - void *tx_desc = - (uint8_t *)tx_ring->desc + sc->txdesc_len * i; - - rtwn_pci_copy_tx_desc(pc, tx_desc, NULL); - - if (tx_data->m != NULL) { - bus_dmamap_sync(tx_ring->data_dmat, - tx_data->map, BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(tx_ring->data_dmat, - tx_data->map); - m_freem(tx_data->m); - tx_data->m = NULL; - } - if (tx_data->ni != NULL) { - ieee80211_free_node(tx_data->ni); - tx_data->ni = NULL; - } + rtwn_pci_copy_tx_desc(pc, desc, NULL); + + if (data->m != NULL) { + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(ring->data_dmat, data->map); + m_freem(data->m); + data->m = NULL; + } + if (data->ni != NULL) { + ieee80211_free_node(data->ni); + data->ni = NULL; } } - bus_dmamap_sync(tx_ring->desc_dmat, tx_ring->desc_map, + bus_dmamap_sync(ring->desc_dmat, ring->desc_map, BUS_DMASYNC_POSTWRITE); sc->qfullmsk &= ~(1 << qid); - tx_ring->queued = 0; - tx_ring->last = tx_ring->cur = 0; + ring->queued = 0; + ring->last = ring->cur = 0; +} + +/* + * Clear entry 0 (or 1) in the beacon queue (other are not used). + */ +static void +rtwn_pci_reset_beacon_ring(struct rtwn_softc *sc, int id) +{ + struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); + struct rtwn_tx_ring *ring = &pc->tx_ring[RTWN_PCI_BEACON_QUEUE]; + struct rtwn_tx_data *data = &ring->tx_data[id]; + struct rtwn_tx_desc_common *txd = (struct rtwn_tx_desc_common *) + ((uint8_t *)ring->desc + id * sc->txdesc_len); + + bus_dmamap_sync(ring->desc_dmat, ring->desc_map, BUS_DMASYNC_POSTREAD); + if (txd->flags0 & RTWN_FLAGS0_OWN) { + /* Clear OWN bit. */ + txd->flags0 &= ~RTWN_FLAGS0_OWN; + bus_dmamap_sync(ring->desc_dmat, ring->desc_map, + BUS_DMASYNC_PREWRITE); + + /* Unload mbuf. */ + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(ring->data_dmat, data->map); + } +} + +/* + * Drop stale entries from Tx ring before the vap will be deleted. + * In case if vap is NULL just free everything and reset cur / last pointers. + */ +static void +rtwn_pci_reset_tx_list(struct rtwn_softc *sc, struct ieee80211vap *vap, + int qid) +{ + int i; + + if (vap == NULL) { + if (qid != RTWN_PCI_BEACON_QUEUE) { + /* + * Device was stopped; just clear all entries. + */ + rtwn_pci_reset_tx_ring_stopped(sc, qid); + } else { + for (i = 0; i < RTWN_PORT_COUNT; i++) + rtwn_pci_reset_beacon_ring(sc, i); + } + } else if (qid == RTWN_PCI_BEACON_QUEUE && + (vap->iv_opmode == IEEE80211_M_HOSTAP || + vap->iv_opmode == IEEE80211_M_IBSS)) { + struct rtwn_vap *uvp = RTWN_VAP(vap); + + rtwn_pci_reset_beacon_ring(sc, uvp->id); + } else { + struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); + struct rtwn_tx_ring *ring = &pc->tx_ring[qid]; + + for (i = 0; i < RTWN_PCI_TX_LIST_COUNT; i++) { + struct rtwn_tx_data *data = &ring->tx_data[i]; + if (data->ni != NULL && data->ni->ni_vap == vap) { + /* + * NB: if some vap is still running + * rtwn_pci_tx_done() will free the mbuf; + * otherwise, rtwn_stop() will reset all rings + * after device shutdown. + */ + ieee80211_free_node(data->ni); + data->ni = NULL; + } + } + } } static void From owner-svn-src-head@freebsd.org Sun Nov 6 19:16:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13CA1C34130; Sun, 6 Nov 2016 19:16:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4731C44; Sun, 6 Nov 2016 19:16:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA6JGkLf019565; Sun, 6 Nov 2016 19:16:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA6JGk5V019563; Sun, 6 Nov 2016 19:16:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611061916.uA6JGk5V019563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 6 Nov 2016 19:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308383 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 19:16:48 -0000 Author: adrian Date: Sun Nov 6 19:16:46 2016 New Revision: 308383 URL: https://svnweb.freebsd.org/changeset/base/308383 Log: [net80211] add a method to also explicitly tear down RX A-MPDU. The ath10k firmware API doesn't pass up the ADDBA/DELBA frames, only WMI firmware notifications. Tested: * ath10k (QCA9880), doing actual (ha!) 11n! Modified: head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_ht.h Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun Nov 6 18:40:12 2016 (r308382) +++ head/sys/net80211/ieee80211_ht.c Sun Nov 6 19:16:46 2016 (r308383) @@ -597,6 +597,19 @@ ieee80211_ampdu_rx_start_ext(struct ieee } /* + * Public function; manually stop the RX AMPDU state. + */ +void +ieee80211_ampdu_rx_stop_ext(struct ieee80211_node *ni, int tid) +{ + struct ieee80211_rx_ampdu *rap; + + /* XXX TODO: sanity check tid, seq, baw */ + rap = &ni->ni_rx_ampdu[tid]; + ampdu_rx_stop(ni, rap); +} + +/* * Stop A-MPDU rx processing for the specified TID. */ static void Modified: head/sys/net80211/ieee80211_ht.h ============================================================================== --- head/sys/net80211/ieee80211_ht.h Sun Nov 6 18:40:12 2016 (r308382) +++ head/sys/net80211/ieee80211_ht.h Sun Nov 6 19:16:46 2016 (r308383) @@ -220,6 +220,7 @@ void ieee80211_ht_update_beacon(struct i struct ieee80211_beacon_offsets *); int ieee80211_ampdu_rx_start_ext(struct ieee80211_node *ni, int tid, int seq, int baw); +void ieee80211_ampdu_rx_stop_ext(struct ieee80211_node *ni, int tid); int ieee80211_ampdu_tx_request_ext(struct ieee80211_node *ni, int tid); int ieee80211_ampdu_tx_request_active_ext(struct ieee80211_node *ni, int tid, int status); From owner-svn-src-head@freebsd.org Sun Nov 6 19:17:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8F8EC341B5; Sun, 6 Nov 2016 19:17:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 891BFDC4; Sun, 6 Nov 2016 19:17:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA6JHd2B019647; Sun, 6 Nov 2016 19:17:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA6JHdrs019645; Sun, 6 Nov 2016 19:17:39 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201611061917.uA6JHdrs019645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 6 Nov 2016 19:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308384 - in head/sys/dev/rtwn: pci usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 19:17:40 -0000 Author: avos Date: Sun Nov 6 19:17:39 2016 New Revision: 308384 URL: https://svnweb.freebsd.org/changeset/base/308384 Log: rtwn_pci: omit tx_done() stage if device is not running. rtwn_usb: drain USB transfers during device shutdown; this fixes possible panic with 'options IEEE80211_SUPPORT_SUPERG' during device detach. Tested with RTL8188CE, STA mode. Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c head/sys/dev/rtwn/usb/rtwn_usb_attach.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_rx.c Sun Nov 6 19:16:46 2016 (r308383) +++ head/sys/dev/rtwn/pci/rtwn_pci_rx.c Sun Nov 6 19:17:39 2016 (r308384) @@ -274,13 +274,14 @@ rtwn_pci_intr(void *arg) status = rtwn_classify_intr(sc, &tx_rings, 0); RTWN_DPRINTF(sc, RTWN_DEBUG_INTR, "%s: status %08X, tx_rings %08X\n", __func__, status, tx_rings); - if (status == 0 && tx_rings == 0) { - RTWN_UNLOCK(sc); - return; - } + if (status == 0 && tx_rings == 0) + goto unlock; - if (status & RTWN_PCI_INTR_RX) + if (status & RTWN_PCI_INTR_RX) { rtwn_pci_rx_done(sc); + if (!(sc->sc_flags & RTWN_RUNNING)) + goto unlock; + } if (tx_rings != 0) for (i = 0; i < RTWN_PCI_NTXQUEUES; i++) @@ -289,5 +290,6 @@ rtwn_pci_intr(void *arg) if (sc->sc_flags & RTWN_RUNNING) rtwn_pci_enable_intr(pc); +unlock: RTWN_UNLOCK(sc); } Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.c Sun Nov 6 19:16:46 2016 (r308383) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.c Sun Nov 6 19:17:39 2016 (r308384) @@ -273,8 +273,10 @@ rtwn_usb_abort_xfers(struct rtwn_softc * RTWN_ASSERT_LOCKED(sc); /* abort any pending transfers */ + RTWN_UNLOCK(sc); for (i = 0; i < RTWN_N_TRANSFER; i++) - usbd_transfer_stop(uc->uc_xfer[i]); + usbd_transfer_drain(uc->uc_xfer[i]); + RTWN_LOCK(sc); } static int From owner-svn-src-head@freebsd.org Sun Nov 6 19:18:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C00DFC3422A; Sun, 6 Nov 2016 19:18:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F9B4F2C; Sun, 6 Nov 2016 19:18:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA6JIP5U019719; Sun, 6 Nov 2016 19:18:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA6JIP1J019717; Sun, 6 Nov 2016 19:18:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611061918.uA6JIP1J019717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 6 Nov 2016 19:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308385 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 19:18:26 -0000 Author: adrian Date: Sun Nov 6 19:18:25 2016 New Revision: 308385 URL: https://svnweb.freebsd.org/changeset/base/308385 Log: [net80211] extend the net80211 ALQ code to support variable payloads. Also - allow driver specific bits to be added, rather than just net80211. This still isn't as useful as it should be by default; it needs to be a standalone struct/instance so it can be done before net80211 registration occurs, and it can log per-device items. But, it's getting there. Modified: head/sys/net80211/ieee80211_alq.c head/sys/net80211/ieee80211_alq.h Modified: head/sys/net80211/ieee80211_alq.c ============================================================================== --- head/sys/net80211/ieee80211_alq.c Sun Nov 6 19:17:39 2016 (r308384) +++ head/sys/net80211/ieee80211_alq.c Sun Nov 6 19:18:25 2016 (r308385) @@ -79,14 +79,13 @@ ieee80211_alq_setlogging(int enable) ieee80211_alq_logfile, curthread->td_ucred, ALQ_DEFAULT_CMODE, - sizeof (struct ieee80211_alq_rec), - ieee80211_alq_qsize); + ieee80211_alq_qsize, 0); ieee80211_alq_lost = 0; ieee80211_alq_logged = 0; printf("net80211: logging to %s enabled; " "struct size %d bytes\n", ieee80211_alq_logfile, - sizeof(struct ieee80211_alq_rec)); + (int) sizeof(struct ieee80211_alq_rec)); } else { if (ieee80211_alq) alq_close(ieee80211_alq); @@ -113,18 +112,19 @@ sysctl_ieee80211_alq_log(SYSCTL_HANDLER_ SYSCTL_PROC(_net_wlan, OID_AUTO, alq, CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_ieee80211_alq_log, "I", "Enable net80211 alq logging"); SYSCTL_INT(_net_wlan, OID_AUTO, alq_size, CTLFLAG_RW, - &ieee80211_alq_qsize, 0, "In-memory log size (#records)"); + &ieee80211_alq_qsize, 0, "In-memory log size (bytes)"); SYSCTL_INT(_net_wlan, OID_AUTO, alq_lost, CTLFLAG_RW, &ieee80211_alq_lost, 0, "Debugging operations not logged"); SYSCTL_INT(_net_wlan, OID_AUTO, alq_logged, CTLFLAG_RW, &ieee80211_alq_logged, 0, "Debugging operations logged"); static struct ale * -ieee80211_alq_get(void) +ieee80211_alq_get(size_t len) { struct ale *ale; - ale = alq_get(ieee80211_alq, ALQ_NOWAIT); + ale = alq_getn(ieee80211_alq, len + sizeof(struct ieee80211_alq_rec), + ALQ_NOWAIT); if (!ale) ieee80211_alq_lost++; else @@ -132,25 +132,44 @@ ieee80211_alq_get(void) return ale; } -void -ieee80211_alq_log(struct ieee80211vap *vap, uint8_t op, u_char *p, int l) +int +ieee80211_alq_log(struct ieee80211com *ic, struct ieee80211vap *vap, + uint32_t op, uint32_t flags, uint16_t srcid, const uint8_t *src, + size_t len) { struct ale *ale; struct ieee80211_alq_rec *r; + char *dst; + /* Don't log if we're disabled */ if (ieee80211_alq == NULL) - return; + return (0); - ale = ieee80211_alq_get(); + if (len > IEEE80211_ALQ_MAX_PAYLOAD) + return (ENOMEM); + + ale = ieee80211_alq_get(len); if (! ale) - return; + return (ENOMEM); r = (struct ieee80211_alq_rec *) ale->ae_data; - r->r_timestamp = htonl(ticks); - r->r_version = 1; - r->r_wlan = htons(vap->iv_ifp->if_dunit); - r->r_op = op; - r->r_threadid = htonl((uint32_t) curthread->td_tid); - memcpy(&r->r_payload, p, MIN(l, sizeof(r->r_payload))); + dst = ((char *) r) + sizeof(struct ieee80211_alq_rec); + r->r_timestamp = htobe64(ticks); + if (vap != NULL) { + r->r_wlan = htobe16(vap->iv_ifp->if_dunit); + } else { + r->r_wlan = 0xffff; + } + r->r_src = htobe16(srcid); + r->r_flags = htobe32(flags); + r->r_op = htobe32(op); + r->r_len = htobe32(len + sizeof(struct ieee80211_alq_rec)); + r->r_threadid = htobe32((uint32_t) curthread->td_tid); + + if (src != NULL) + memcpy(dst, src, len); + alq_post(ieee80211_alq, ale); + + return (0); } Modified: head/sys/net80211/ieee80211_alq.h ============================================================================== --- head/sys/net80211/ieee80211_alq.h Sun Nov 6 19:17:39 2016 (r308384) +++ head/sys/net80211/ieee80211_alq.h Sun Nov 6 19:18:25 2016 (r308385) @@ -27,7 +27,7 @@ #ifndef __IEEE80211_ALQ_H__ #define __IEEE80211_ALQ_H__ -#define IEEE80211_ALQ_PAYLOAD_SIZE 24 +#define IEEE80211_ALQ_MAX_PAYLOAD 1024 /* * timestamp @@ -36,18 +36,24 @@ * sub-operation * rest of structure - operation specific */ + +#define IEEE80211_ALQ_SRC_NET80211 0x0001 +/* Drivers define their own numbers above 0xff */ + struct ieee80211_alq_rec { - uint32_t r_timestamp; /* XXX may wrap! */ + uint64_t r_timestamp; /* XXX may wrap! */ uint32_t r_threadid; /* current thread id */ uint16_t r_wlan; /* wlan interface number */ - uint8_t r_version; /* version */ - uint8_t r_op; /* top-level operation id */ - u_char r_payload[IEEE80211_ALQ_PAYLOAD_SIZE]; - /* operation-specific payload */ + uint16_t r_src; /* source - driver, net80211 */ + uint32_t r_flags; /* flags */ + uint32_t r_op; /* top-level operation id */ + uint32_t r_len; /* length of hdr + payload */ + /* Operation payload follows here */ }; /* General logging function */ -extern void ieee80211_alq_log(struct ieee80211vap *vap, uint8_t op, - u_char *p, int l); +extern int ieee80211_alq_log(struct ieee80211com *ic, + struct ieee80211vap *vap, uint32_t op, uint32_t flags, + uint16_t srcid, const uint8_t *src, size_t len); #endif /* __IEEE80211_ALQ_H__ */ From owner-svn-src-head@freebsd.org Sun Nov 6 19:37:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C7DC3208B; Sun, 6 Nov 2016 19:37:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0D727A6; Sun, 6 Nov 2016 19:37:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA6JbMDq027363; Sun, 6 Nov 2016 19:37:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA6JbMBI027362; Sun, 6 Nov 2016 19:37:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201611061937.uA6JbMBI027362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 6 Nov 2016 19:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308386 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 19:37:24 -0000 Author: trasz Date: Sun Nov 6 19:37:22 2016 New Revision: 308386 URL: https://svnweb.freebsd.org/changeset/base/308386 Log: Document that getfsstat(2) called with MNT_NOWAIT skips file systems that are in the process of being unmounted. Reviewed by: des@ (earlier version) MFC after: 1 month Modified: head/lib/libc/sys/getfsstat.2 Modified: head/lib/libc/sys/getfsstat.2 ============================================================================== --- head/lib/libc/sys/getfsstat.2 Sun Nov 6 19:18:25 2016 (r308385) +++ head/lib/libc/sys/getfsstat.2 Sun Nov 6 19:37:22 2016 (r308386) @@ -28,7 +28,7 @@ .\" @(#)getfsstat.2 8.3 (Berkeley) 5/25/95 .\" $FreeBSD$ .\" -.Dd November 20, 2003 +.Dd November 6, 2016 .Dt GETFSSTAT 2 .Os .Sh NAME @@ -88,6 +88,8 @@ Thus, some of the information will be ou .Fn getfsstat will not block waiting for information from a file system that is unable to respond. +It will also skip any file system that is in the process of being +unmounted, even if the unmount would eventually fail. .Sh RETURN VALUES Upon successful completion, the number of .Fa statfs From owner-svn-src-head@freebsd.org Sun Nov 6 19:51:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F24CC32F6B; Sun, 6 Nov 2016 19:51:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AFA8EA3; Sun, 6 Nov 2016 19:51:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA6Jp1Ba031642; Sun, 6 Nov 2016 19:51:01 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA6Jp1CJ031641; Sun, 6 Nov 2016 19:51:01 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201611061951.uA6Jp1CJ031641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 6 Nov 2016 19:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308387 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 19:51:02 -0000 Author: avos Date: Sun Nov 6 19:51:01 2016 New Revision: 308387 URL: https://svnweb.freebsd.org/changeset/base/308387 Log: Fix device driver name if devd.conf + move it into appropriate place. Noticed by: Idwer Vollering Modified: head/etc/devd.conf Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Sun Nov 6 19:37:22 2016 (r308386) +++ head/etc/devd.conf Sun Nov 6 19:51:01 2016 (r308387) @@ -23,8 +23,8 @@ options { esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm)\ [0-9]+"; set wifi-driver-regex - "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rum|run|uath|\ - upgt|ural|urtw|rtwn_usb|wi|wpi|wtap|zyd)[0-9]+"; + "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rtwn|rum|run|\ + uath|upgt|ural|urtw|wi|wpi|wtap|zyd)[0-9]+"; }; # Note that the attach/detach with the highest value wins, so that one can From owner-svn-src-head@freebsd.org Sun Nov 6 23:13:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEA3AC3319C; Sun, 6 Nov 2016 23:13:15 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FCC4E15; Sun, 6 Nov 2016 23:13:15 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA6NDEvP014257; Sun, 6 Nov 2016 23:13:14 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA6NDDdv014248; Sun, 6 Nov 2016 23:13:13 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201611062313.uA6NDDdv014248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 6 Nov 2016 23:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308389 - in head/sys/dev/rtwn: . pci rtl8192c rtl8192c/pci usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 23:13:15 -0000 Author: avos Date: Sun Nov 6 23:13:13 2016 New Revision: 308389 URL: https://svnweb.freebsd.org/changeset/base/308389 Log: rtwn: add HOSTAP / IBSS mode support for RTL8188CE. NOTE: some multi-vap configurations (e.g., STA+IBSS) are not stable; that will be fixed later. Tested with: - RTL8188CE, STA + AP mode; - RTL8188CE, IBSS mode; - RTL8188CUS, IBSS mode; - RTL8188EU, IBSS mode. Relnotes: yes Modified: head/sys/dev/rtwn/if_rtwn.c head/sys/dev/rtwn/if_rtwn_beacon.c head/sys/dev/rtwn/if_rtwnvar.h head/sys/dev/rtwn/pci/rtwn_pci_attach.c head/sys/dev/rtwn/pci/rtwn_pci_tx.c head/sys/dev/rtwn/pci/rtwn_pci_var.h head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c head/sys/dev/rtwn/rtl8192c/r92c_beacon.c head/sys/dev/rtwn/usb/rtwn_usb_attach.c Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Sun Nov 6 21:41:26 2016 (r308388) +++ head/sys/dev/rtwn/if_rtwn.c Sun Nov 6 23:13:13 2016 (r308389) @@ -628,10 +628,10 @@ rtwn_vap_delete(struct ieee80211vap *vap ieee80211_draintask(ic, &ic->ic_parent_task); RTWN_LOCK(sc); - if (uvp->bcn_mbuf != NULL) - m_freem(uvp->bcn_mbuf); /* Cancel any unfinished Tx. */ rtwn_reset_lists(sc, vap); + if (uvp->bcn_mbuf != NULL) + m_freem(uvp->bcn_mbuf); rtwn_vap_decrement_counters(sc, vap->iv_opmode, uvp->id); rtwn_set_ic_opmode(sc); if (sc->sc_flags & RTWN_RUNNING) @@ -822,8 +822,10 @@ rtwn_push_nulldata(struct rtwn_softc *sc rtwn_setbits_1_shift(sc, R92C_FWHW_TXQ_CTRL, R92C_FWHW_TXQ_CTRL_REAL_BEACON, 0, 2); - if (uvp->bcn_mbuf != NULL) + if (uvp->bcn_mbuf != NULL) { + rtwn_beacon_unload(sc, uvp->id); m_freem(uvp->bcn_mbuf); + } m->m_pkthdr.len = m->m_len = required_size - sc->txdesc_len; uvp->bcn_mbuf = m; @@ -1268,6 +1270,9 @@ rtwn_run(struct rtwn_softc *sc, struct i } #endif + /* Enable TSF synchronization. */ + rtwn_tsf_sync_enable(sc, vap); + if (vap->iv_opmode == IEEE80211_M_HOSTAP || vap->iv_opmode == IEEE80211_M_IBSS) { error = rtwn_setup_beacon(sc, ni); @@ -1282,9 +1287,6 @@ rtwn_run(struct rtwn_softc *sc, struct i /* Set ACK preamble type. */ rtwn_set_ack_preamble(sc); - /* Enable TSF synchronization. */ - rtwn_tsf_sync_enable(sc, vap); - /* Set basic rates mask. */ rtwn_calc_basicrates(sc); Modified: head/sys/dev/rtwn/if_rtwn_beacon.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn_beacon.c Sun Nov 6 21:41:26 2016 (r308388) +++ head/sys/dev/rtwn/if_rtwn_beacon.c Sun Nov 6 23:13:13 2016 (r308389) @@ -54,6 +54,7 @@ rtwn_reset_beacon_valid(struct rtwn_soft KASSERT (id == 0 || id == 1, ("wrong port id %d\n", id)); + /* XXX cannot be cleared on RTL8188CE */ rtwn_setbits_1_shift(sc, sc->bcn_status_reg[id], R92C_TDECTRL_BCN_VALID, 0, 2); @@ -79,7 +80,7 @@ rtwn_check_beacon_valid(struct rtwn_soft __func__, id); break; } - rtwn_delay(sc, 100); + rtwn_delay(sc, sc->bcn_check_interval); } if (ntries == 10) return (ETIMEDOUT); @@ -123,8 +124,10 @@ rtwn_setup_beacon(struct rtwn_softc *sc, return (ENOMEM); } - if (uvp->bcn_mbuf != NULL) + if (uvp->bcn_mbuf != NULL) { + rtwn_beacon_unload(sc, uvp->id); m_freem(uvp->bcn_mbuf); + } uvp->bcn_mbuf = m; @@ -173,6 +176,7 @@ rtwn_update_beacon(struct ieee80211vap * return; } } + rtwn_beacon_update_begin(sc, vap); RTWN_UNLOCK(sc); if (item == IEEE80211_BEACON_TIM) @@ -183,6 +187,7 @@ rtwn_update_beacon(struct ieee80211vap * RTWN_LOCK(sc); rtwn_tx_beacon(sc, uvp); + rtwn_beacon_update_end(sc, vap); RTWN_UNLOCK(sc); } Modified: head/sys/dev/rtwn/if_rtwnvar.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnvar.h Sun Nov 6 21:41:26 2016 (r308388) +++ head/sys/dev/rtwn/if_rtwnvar.h Sun Nov 6 23:13:13 2016 (r308389) @@ -277,6 +277,14 @@ struct rtwn_softc { uint16_t (*sc_get_qmap)(struct rtwn_softc *); void (*sc_set_desc_addr)(struct rtwn_softc *); void (*sc_drop_incorrect_tx)(struct rtwn_softc *); + void (*sc_beacon_update_begin)(struct rtwn_softc *, + struct ieee80211vap *); + void (*sc_beacon_update_end)(struct rtwn_softc *, + struct ieee80211vap *); + void (*sc_beacon_unload)(struct rtwn_softc *, int); + + /* XXX drop checks for PCIe? */ + int bcn_check_interval; /* Device-specific. */ uint32_t (*sc_rf_read)(struct rtwn_softc *, int, uint8_t); @@ -445,6 +453,12 @@ void rtwn_suspend(struct rtwn_softc *); (((_sc)->sc_set_desc_addr)((_sc))) #define rtwn_drop_incorrect_tx(_sc) \ (((_sc)->sc_drop_incorrect_tx)((_sc))) +#define rtwn_beacon_update_begin(_sc, _vap) \ + (((_sc)->sc_beacon_update_begin)((_sc), (_vap))) +#define rtwn_beacon_update_end(_sc, _vap) \ + (((_sc)->sc_beacon_update_end)((_sc), (_vap))) +#define rtwn_beacon_unload(_sc, _id) \ + (((_sc)->sc_beacon_unload)((_sc), (_id))) /* Aliases. */ #define rtwn_bb_write rtwn_write_4 Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_attach.c Sun Nov 6 21:41:26 2016 (r308388) +++ head/sys/dev/rtwn/pci/rtwn_pci_attach.c Sun Nov 6 23:13:13 2016 (r308389) @@ -87,6 +87,10 @@ static int rtwn_pci_fw_write_block(struc const uint8_t *, uint16_t, int); static uint16_t rtwn_pci_get_qmap(struct rtwn_softc *); static void rtwn_pci_set_desc_addr(struct rtwn_softc *); +static void rtwn_pci_beacon_update_begin(struct rtwn_softc *, + struct ieee80211vap *); +static void rtwn_pci_beacon_update_end(struct rtwn_softc *, + struct ieee80211vap *); static void rtwn_pci_attach_methods(struct rtwn_softc *); @@ -539,6 +543,27 @@ rtwn_pci_set_desc_addr(struct rtwn_softc } static void +rtwn_pci_beacon_update_begin(struct rtwn_softc *sc, struct ieee80211vap *vap) +{ + struct rtwn_vap *rvp = RTWN_VAP(vap); + + RTWN_ASSERT_LOCKED(sc); + + rtwn_beacon_enable(sc, rvp->id, 0); +} + +static void +rtwn_pci_beacon_update_end(struct rtwn_softc *sc, struct ieee80211vap *vap) +{ + struct rtwn_vap *rvp = RTWN_VAP(vap); + + RTWN_ASSERT_LOCKED(sc); + + if (rvp->curr_mode != R92C_MSR_NOLINK) + rtwn_beacon_enable(sc, rvp->id, 1); +} + +static void rtwn_pci_attach_methods(struct rtwn_softc *sc) { sc->sc_write_1 = rtwn_pci_write_1; @@ -555,6 +580,11 @@ rtwn_pci_attach_methods(struct rtwn_soft sc->sc_get_qmap = rtwn_pci_get_qmap; sc->sc_set_desc_addr = rtwn_pci_set_desc_addr; sc->sc_drop_incorrect_tx = rtwn_nop_softc; + sc->sc_beacon_update_begin = rtwn_pci_beacon_update_begin; + sc->sc_beacon_update_end = rtwn_pci_beacon_update_end; + sc->sc_beacon_unload = rtwn_pci_reset_beacon_ring; + + sc->bcn_check_interval = 25000; } static int Modified: head/sys/dev/rtwn/pci/rtwn_pci_tx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_tx.c Sun Nov 6 21:41:26 2016 (r308388) +++ head/sys/dev/rtwn/pci/rtwn_pci_tx.c Sun Nov 6 23:13:13 2016 (r308389) @@ -59,8 +59,8 @@ __FBSDID("$FreeBSD$"); static int -rtwn_pci_tx_start_common(struct rtwn_softc *sc, struct ieee80211_node *ni, - struct mbuf *m, uint8_t *tx_desc, uint8_t type, int id) +rtwn_pci_tx_start_frame(struct rtwn_softc *sc, struct ieee80211_node *ni, + struct mbuf *m, uint8_t *tx_desc, uint8_t type) { struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); struct rtwn_tx_ring *ring; @@ -75,16 +75,13 @@ rtwn_pci_tx_start_common(struct rtwn_sof switch (type) { case IEEE80211_FC0_TYPE_CTL: case IEEE80211_FC0_TYPE_MGT: - qid = RTWN_PCI_VO_QUEUE; + qid = RTWN_PCI_MGNT_QUEUE; break; default: qid = M_WME_GETAC(m); break; } - if (ni == NULL) /* beacon frame */ - qid = RTWN_PCI_BEACON_QUEUE; - ring = &pc->tx_ring[qid]; data = &ring->tx_data[ring->cur]; if (data->m != NULL) { @@ -151,19 +148,16 @@ rtwn_pci_tx_start_common(struct rtwn_sof data->m = m; data->ni = ni; - data->id = id; ring->cur = (ring->cur + 1) % RTWN_PCI_TX_LIST_COUNT; - if (qid != RTWN_PCI_BEACON_QUEUE) { - ring->queued++; - if (ring->queued >= (RTWN_PCI_TX_LIST_COUNT - 1)) - sc->qfullmsk |= (1 << qid); + ring->queued++; + if (ring->queued >= (RTWN_PCI_TX_LIST_COUNT - 1)) + sc->qfullmsk |= (1 << qid); #ifndef D4054 - sc->sc_tx_timer = 5; + sc->sc_tx_timer = 5; #endif - } /* Kick TX. */ rtwn_write_2(sc, R92C_PCIE_CTRL_REG, (1 << qid)); @@ -171,25 +165,77 @@ rtwn_pci_tx_start_common(struct rtwn_sof return (0); } +static int +rtwn_pci_tx_start_beacon(struct rtwn_softc *sc, struct mbuf *m, + uint8_t *tx_desc, int id) +{ + struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); + struct rtwn_tx_ring *ring; + struct rtwn_tx_data *data; + struct rtwn_tx_desc_common *txd; + bus_dma_segment_t segs[1]; + int nsegs, error, own; + + RTWN_ASSERT_LOCKED(sc); + + KASSERT(id == 0 || id == 1, ("bogus vap id %d\n", id)); + + ring = &pc->tx_ring[RTWN_PCI_BEACON_QUEUE]; + data = &ring->tx_data[id]; + txd = (struct rtwn_tx_desc_common *) + ((uint8_t *)ring->desc + id * sc->txdesc_len); + + bus_dmamap_sync(ring->desc_dmat, ring->desc_map, + BUS_DMASYNC_POSTREAD); + own = !!(txd->flags0 & RTWN_FLAGS0_OWN); + error = 0; + if (!own || txd->pktlen != htole16(m->m_pkthdr.len)) { + if (!own) { + /* Copy Tx descriptor. */ + rtwn_pci_copy_tx_desc(pc, txd, tx_desc); + txd->offset = sc->txdesc_len; + } else { + /* Reload mbuf. */ + bus_dmamap_unload(ring->data_dmat, data->map); + } + + error = bus_dmamap_load_mbuf_sg(ring->data_dmat, + data->map, m, segs, &nsegs, BUS_DMA_NOWAIT); + if (error != 0) { + device_printf(sc->sc_dev, + "can't map beacon (error %d)\n", error); + txd->flags0 &= ~RTWN_FLAGS0_OWN; + goto end; + } + + txd->pktlen = htole16(m->m_pkthdr.len); + rtwn_pci_tx_postsetup(pc, txd, segs); + txd->flags0 |= RTWN_FLAGS0_OWN; +end: + bus_dmamap_sync(ring->desc_dmat, ring->desc_map, + BUS_DMASYNC_PREWRITE); + } + + /* Dump Tx descriptor. */ + rtwn_dump_tx_desc(sc, txd); + + bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_PREWRITE); + + return (0); +} + int rtwn_pci_tx_start(struct rtwn_softc *sc, struct ieee80211_node *ni, struct mbuf *m, uint8_t *tx_desc, uint8_t type, int id) { int error = 0; - if (ni == NULL) { /* beacon frame */ - m = m_dup(m, M_NOWAIT); - if (__predict_false(m == NULL)) { - device_printf(sc->sc_dev, - "%s: could not copy beacon frame\n", __func__); - return (ENOMEM); - } + RTWN_ASSERT_LOCKED(sc); - error = rtwn_pci_tx_start_common(sc, ni, m, tx_desc, type, id); - if (error != 0) - m_freem(m); - } else - error = rtwn_pci_tx_start_common(sc, ni, m, tx_desc, type, id); + if (ni == NULL) /* beacon frame */ + error = rtwn_pci_tx_start_beacon(sc, m, tx_desc, id); + else + error = rtwn_pci_tx_start_frame(sc, ni, m, tx_desc, type); return (error); } Modified: head/sys/dev/rtwn/pci/rtwn_pci_var.h ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_var.h Sun Nov 6 21:41:26 2016 (r308388) +++ head/sys/dev/rtwn/pci/rtwn_pci_var.h Sun Nov 6 23:13:13 2016 (r308389) @@ -50,7 +50,6 @@ struct rtwn_tx_data { bus_dmamap_t map; struct mbuf *m; struct ieee80211_node *ni; - uint8_t id; }; struct rtwn_tx_ring { Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Sun Nov 6 21:41:26 2016 (r308388) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Sun Nov 6 23:13:13 2016 (r308389) @@ -141,9 +141,7 @@ r92ce_adj_devcaps(struct rtwn_softc *sc) /* XXX TODO: test everything that removed here before enabling. */ /* XX do NOT enable PMGT until RSVD_PAGE command will not be fixed. */ ic->ic_caps &= ~( - IEEE80211_C_IBSS /* check beaconing / tsf */ - | IEEE80211_C_HOSTAP /* the same */ - | IEEE80211_C_PMGT /* check null frame / device usability */ + IEEE80211_C_PMGT /* check null frame / device usability */ | IEEE80211_C_SWAMSDUTX | IEEE80211_C_FF ); @@ -256,6 +254,12 @@ r92ce_attach(struct rtwn_pci_softc *pc) sc->temp_delta = R92C_CALIB_THRESHOLD; sc->bcn_status_reg[0] = R92C_TDECTRL; + /* + * TODO: some additional setup is required + * to maintain few beacons at the same time. + * + * XXX BCNQ1 mechanism is not needed here; move it to the USB module. + */ sc->bcn_status_reg[1] = R92C_TDECTRL; sc->rcr = 0; Modified: head/sys/dev/rtwn/rtl8192c/r92c_beacon.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_beacon.c Sun Nov 6 21:41:26 2016 (r308388) +++ head/sys/dev/rtwn/rtl8192c/r92c_beacon.c Sun Nov 6 23:13:13 2016 (r308389) @@ -68,6 +68,7 @@ r92c_beacon_init(struct rtwn_softc *sc, rtwn_r92c_tx_setup_macid(sc, buf, id); txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); txd->txdw4 |= htole32(SM(R92C_TXDW4_SEQ_SEL, id)); + txd->txdw4 |= htole32(SM(R92C_TXDW4_PORT_ID, id)); txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, RTWN_RIDX_CCK1)); } Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.c Sun Nov 6 21:41:26 2016 (r308388) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.c Sun Nov 6 23:13:13 2016 (r308389) @@ -81,6 +81,7 @@ static void rtwn_usb_start_xfers(struct static void rtwn_usb_abort_xfers(struct rtwn_softc *); static int rtwn_usb_fw_write_block(struct rtwn_softc *, const uint8_t *, uint16_t, int); +static void rtwn_usb_drop_incorrect_tx(struct rtwn_softc *); static void rtwn_usb_attach_methods(struct rtwn_softc *); #define RTWN_CONFIG_INDEX 0 @@ -318,6 +319,11 @@ rtwn_usb_attach_methods(struct rtwn_soft sc->sc_get_qmap = rtwn_usb_get_qmap; sc->sc_set_desc_addr = rtwn_nop_softc; sc->sc_drop_incorrect_tx = rtwn_usb_drop_incorrect_tx; + sc->sc_beacon_update_begin = rtwn_nop_softc_vap; + sc->sc_beacon_update_end = rtwn_nop_softc_vap; + sc->sc_beacon_unload = rtwn_nop_softc_int; + + sc->bcn_check_interval = 100; } static int From owner-svn-src-head@freebsd.org Mon Nov 7 00:45:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E3E1C335DB for ; Mon, 7 Nov 2016 00:45:23 +0000 (UTC) (envelope-from areilly@bigpond.net.au) Received: from nsstlmta31p.bpe.bigpond.com (nsstlmta31p.bpe.bigpond.com [203.38.21.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "", Issuer "Openwave Messaging Inc." (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 57E75AA2; Mon, 7 Nov 2016 00:45:21 +0000 (UTC) (envelope-from areilly@bigpond.net.au) Received: from smtp.telstra.com ([10.10.24.4]) by nsstlfep19p-svc.bpe.nexus.telstra.com.au with ESMTP id <20161106235424.FDVJ6029.nsstlfep19p-svc.bpe.nexus.telstra.com.au@smtp.telstra.com>; Mon, 7 Nov 2016 10:54:24 +1100 X-RG-Spam: Unknown X-Junkmail-Premium-Raw: score=8/50, refid=2.7.2:2016.11.6.223917:17:8.707, ip=, rules=__CT, __CT_TEXT_PLAIN, __MIME_VERSION, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __HAS_FROM, __FRAUD_WEBMAIL_FROM, __IN_REP_TO, __HAS_CC_HDR, __MULTIPLE_RCPTS_CC_X2, __CC_NAME, __CC_NAME_DIFF_FROM_ACC, __CTE, __HAS_MSGID, __SANE_MSGID, __MSGID_APPLEMAIL, __REFERENCES, __TO_MALFORMED_2, __TO_NAME, __TO_NAME_DIFF_FROM_ACC, __HAS_X_MAILER, __X_MAILER_APPLEMAIL, __UNUSABLE_MSGID, MIME_LOWER_CASE, __ANY_URI, __HTTPS_URI, __URI_WITH_PATH, URI_ENDS_IN_HTML, __FRAUD_BODY_WEBMAIL, __URI_NO_WWW, __CP_URI_IN_BODY, __SUBJ_ALPHA_NEGATE, SUPERLONG_LINE, __URI_IN_BODY, __FORWARDED_MSG, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_2000_2999, __MIME_TEXT_P1, __MIME_TEXT_ONLY, __URI_NS, HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, __FRAUD_WEBMAIL, __USER_AGENT_APPLEMAIL, __SINGLE_URI_TEXT, SINGLE_URI_IN_BODY, MULTIPLE_RCPTS, __PHISH_SPEAR_STRUCTURE_1, IN_REP_TO, __MIME_TEXT_P, REFERENCES, BODY_SIZE_7000_LESS, MSG_THREAD, __TO_REAL_NAMES, __CC_REAL_NAMES, LEGITIMATE_SIGNS, LEGITIMATE_NEGATE X-RG-Spam: Unknown X-RG-Spam: Unknown X-Authentication-Info: Submitted using ID areilly@bigpond.net.au Received: from apr-pro.dolby.net (203.110.132.93) by smtp.telstra.com (9.0.018.03.01) (authenticated as areilly@bigpond.net.au) id 57966FEE040C4118; Mon, 7 Nov 2016 10:54:24 +1100 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r307227 - in head: include lib/libc/stdlib lib/libc/tests/stdlib From: Andrew Reilly In-Reply-To: Date: Mon, 7 Nov 2016 10:54:23 +1100 Cc: svn-src-head@freebsd.org, "ed@FreeBSD.org" Content-Transfer-Encoding: quoted-printable Message-Id: <4F77ED5A-6B71-4AA5-BEC9-752A8BA349CE@bigpond.net.au> References: To: Ed Schouten X-Mailer: Apple Mail (2.3251) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 00:45:23 -0000 Hi Ed, Thanks for pointing me back to src.conf. I added this when I was an = =E2=80=9Cearly adopter=E2=80=9D of clang, and it was necessary. I = suspect that now that we are all-clang all the time, this is redundant. = Would this have overridden the system build process? my /etc/src.conf: CC=3Dclang CXX=3Dclang++ CPP=3Dclang-cpp WITH_LIBCPLUSPLUS=3Dyes The upgrade from 10.x was uneventful, which was great. It was only = after that, in my weekly builds of updates along stable/11 that I = noticed the build system commenting that the system compiler and the src = tree compiler seemed to be the same, so it would not bother building it. = (Sorry, I don=E2=80=99t have a recorded trace to copy in the exact = phrasing.) Now that my system is happy again, I probably won=E2=80=99t be able to = reproduce the problem. For the record, I usually do delete /usr/obj/* before doing a build, at = least for the first one of the month, as this was. My weekly build script starts: cd /usr/src make -s buildworld kernel and it clearly didn=E2=80=99t get as far as kernel, on this occasion. I=E2=80=99ll see how we go without src.conf, for the next one. Being = more =E2=80=9Cstandard=E2=80=9D is a good recipe for tripping over fewer = edge cases, in my experience. Cheers, =E2=80=94=20 Andrew > On 6 Nov. 2016, at 20:13, Ed Schouten wrote: >=20 > Hi Andrew, >=20 > 2016-11-06 1:30 GMT+01:00 Andrew Reilly : >> Hi there, >>=20 >> Re: = https://lists.freebsd.org/pipermail/svn-src-head/2016-October/092694.html >>=20 >> In a rebuild of stable/11 today (and yesterday), the build stops in = lib/libc/tests/stdlib: >>=20 >> /usr/src/lib/libc/tests/stdlib/tsearch_test.c:37:20: error: unknown = type name 'posix_tnode' >=20 > I just checked out the latest copy of stable/11 and things seem to > build all right, even on a 10.x system. Do you have anything special > in src.conf? How did you invoke 'make buildworld' exactly? What > happens if you delete /usr/obj prior to starting the build? >=20 > Best regards, > --=20 > Ed Schouten > Nuxi, 's-Hertogenbosch, the Netherlands > KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Mon Nov 7 05:34:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68208C34AA4; Mon, 7 Nov 2016 05:34:45 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03812DC3; Mon, 7 Nov 2016 05:34:44 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA75Yi2d061349; Mon, 7 Nov 2016 05:34:44 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA75Yil1061348; Mon, 7 Nov 2016 05:34:44 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201611070534.uA75Yil1061348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 7 Nov 2016 05:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308390 - head/sys/arm/nvidia/tegra124 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 05:34:45 -0000 Author: mmel Date: Mon Nov 7 05:34:44 2016 New Revision: 308390 URL: https://svnweb.freebsd.org/changeset/base/308390 Log: Rework NVIDIA Tegra124 XUSBPAD driver. - Adapt it for new, incompatible, DT bindings introduced by r306197. - Add support for USB super speed pads/ports. MFC after: 3 weeks Modified: head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Modified: head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Sun Nov 6 23:13:13 2016 (r308389) +++ head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Mon Nov 7 05:34:44 2016 (r308390) @@ -39,26 +39,57 @@ #include #include +#include #include #include #include #include #include +#include + #include #include "phy_if.h" +/* FUSE calibration data. */ +#define FUSE_XUSB_CALIB 0x0F0 +#define FUSE_XUSB_CALIB_HS_CURR_LEVEL_123(x) (((x) >> 15) & 0x3F); +#define FUSE_XUSB_CALIB_HS_IREF_CAP(x) (((x) >> 13) & 0x03); +#define FUSE_XUSB_CALIB_HS_SQUELCH_LEVEL(x) (((x) >> 11) & 0x03); +#define FUSE_XUSB_CALIB_HS_TERM_RANGE_ADJ(x) (((x) >> 7) & 0x0F); +#define FUSE_XUSB_CALIB_HS_CURR_LEVEL_0(x) (((x) >> 0) & 0x3F); + + +/* Registers. */ #define XUSB_PADCTL_USB2_PAD_MUX 0x004 +#define XUSB_PADCTL_USB2_PORT_CAP 0x008 +#define USB2_PORT_CAP_ULPI_PORT_INTERNAL (1 << 25) +#define USB2_PORT_CAP_ULPI_PORT_CAP (1 << 24) +#define USB2_PORT_CAP_PORT_REVERSE_ID(p) (1 << (3 + (p) * 4)) +#define USB2_PORT_CAP_PORT_INTERNAL(p) (1 << (2 + (p) * 4)) +#define USB2_PORT_CAP_PORT_CAP(p, x) (((x) & 3) << ((p) * 4)) +#define USB2_PORT_CAP_PORT_CAP_OTG 0x3 +#define USB2_PORT_CAP_PORT_CAP_DEVICE 0x2 +#define USB2_PORT_CAP_PORT_CAP_HOST 0x1 +#define USB2_PORT_CAP_PORT_CAP_DISABLED 0x0 + +#define XUSB_PADCTL_SS_PORT_MAP 0x014 +#define SS_PORT_MAP_PORT_INTERNAL(p) (1 << (3 + (p) * 4)) +#define SS_PORT_MAP_PORT_MAP(p, x) (((x) & 7) << ((p) * 4)) + #define XUSB_PADCTL_ELPG_PROGRAM 0x01C #define ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN (1 << 26) #define ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN_EARLY (1 << 25) #define ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN (1 << 24) +#define ELPG_PROGRAM_SSP_ELPG_VCORE_DOWN(x) (1 << (18 + (x) * 4)) +#define ELPG_PROGRAM_SSP_ELPG_CLAMP_EN_EARLY(x) (1 << (17 + (x) * 4)) +#define ELPG_PROGRAM_SSP_ELPG_CLAMP_EN(x) (1 << (16 + (x) * 4)) #define XUSB_PADCTL_IOPHY_PLL_P0_CTL1 0x040 #define IOPHY_PLL_P0_CTL1_PLL0_LOCKDET (1 << 19) -#define IOPHY_PLL_P0_CTL1_REFCLK_SEL_MASK (0xf<< 12) +#define IOPHY_PLL_P0_CTL1_REFCLK_SEL(x) (((x) & 0xF) << 12) #define IOPHY_PLL_P0_CTL1_PLL_RST (1 << 1) #define XUSB_PADCTL_IOPHY_PLL_P0_CTL2 0x044 @@ -66,8 +97,59 @@ #define IOPHY_PLL_P0_CTL2_TXCLKREF_EN (1 << 5) #define IOPHY_PLL_P0_CTL2_TXCLKREF_SEL (1 << 4) +#define XUSB_PADCTL_IOPHY_USB3_PAD_CTL2(x) (0x058 + (x) * 4) +#define IOPHY_USB3_PAD_CTL2_CDR_CNTL(x) (((x) & 0x00FF) << 4) +#define IOPHY_USB3_PAD_CTL2_RX_EQ(x) (((x) & 0xFFFF) << 8) +#define IOPHY_USB3_PAD_CTL2_RX_WANDER(x) (((x) & 0x000F) << 4) +#define IOPHY_USB3_PAD_CTL2_RX_TERM_CNTL(x) (((x) & 0x0003) << 2) +#define IOPHY_USB3_PAD_CTL2_TX_TERM_CNTL(x) (((x) & 0x0003) << 0) + + +#define XUSB_PADCTL_IOPHY_USB3_PAD_CTL4(x) (0x068 + (x) * 4) + +#define XUSB_PADCTL_USB2_OTG_PAD_CTL0(x) (0x0A0 + (x) * 4) +#define USB2_OTG_PAD_CTL0_LSBIAS_SEL (1 << 23) +#define USB2_OTG_PAD_CTL0_DISCON_DETECT_METHOD (1 << 22) +#define USB2_OTG_PAD_CTL0_PD_ZI (1 << 21) +#define USB2_OTG_PAD_CTL0_PD2 (1 << 20) +#define USB2_OTG_PAD_CTL0_PD (1 << 19) +#define USB2_OTG_PAD_CTL0_TERM_EN (1 << 18) +#define USB2_OTG_PAD_CTL0_LS_LS_FSLEW(x) (((x) & 0x03) << 16) +#define USB2_OTG_PAD_CTL0_LS_RSLEW(x) (((x) & 0x03) << 14) +#define USB2_OTG_PAD_CTL0_FS_SLEW(x) (((x) & 0x03) << 12) +#define USB2_OTG_PAD_CTL0_HS_SLEW(x) (((x) & 0x3F) << 6) +#define USB2_OTG_PAD_CTL0_HS_CURR_LEVEL(x) (((x) & 0x3F) << 0) + +#define XUSB_PADCTL_USB2_OTG_PAD_CTL1(x) (0x0AC + (x) * 4) +#define USB2_OTG_PAD_CTL1_RPU_RANGE_ADJ(x) (((x) & 0x3) << 11) +#define USB2_OTG_PAD_CTL1_HS_IREF_CAP(x) (((x) & 0x3) << 9) +#define USB2_OTG_PAD_CTL1_SPARE(x) (((x) & 0x3) << 7) +#define USB2_OTG_PAD_CTL1_TERM_RANGE_ADJ(x) (((x) & 0xF) << 3) +#define USB2_OTG_PAD_CTL1_PD_DR (1 << 2) +#define USB2_OTG_PAD_CTL1_PD_DISC_FORCE_POWERUP (1 << 1) +#define USB2_OTG_PAD_CTL1_PD_CHRP_FORCE_POWERUP (1 << 0) + +#define XUSB_PADCTL_USB2_BIAS_PAD_CTL0 0x0B8 +#define USB2_BIAS_PAD_CTL0_ADJRPU(x) (((x) & 0x7) << 14) +#define USB2_BIAS_PAD_CTL0_PD_TRK (1 << 13) +#define USB2_BIAS_PAD_CTL0_PD (1 << 12) +#define USB2_BIAS_PAD_CTL0_TERM_OFFSETL(x) (((x) & 0x3) << 9) +#define USB2_BIAS_PAD_CTL0_VBUS_LEVEL(x) (((x) & 0x3) << 7) +#define USB2_BIAS_PAD_CTL0_HS_CHIRP_LEVEL(x) (((x) & 0x3) << 5) +#define USB2_BIAS_PAD_CTL0_HS_DISCON_LEVEL(x) (((x) & 0x7) << 2) +#define USB2_BIAS_PAD_CTL0_HS_SQUELCH_LEVEL(x) (((x) & 0x3) << 0) + +#define XUSB_PADCTL_HSIC_PAD0_CTL0 0x0C8 +#define HSIC_PAD0_CTL0_HSIC_OPT(x) (((x) & 0xF) << 16) +#define HSIC_PAD0_CTL0_TX_SLEWN(x) (((x) & 0xF) << 12) +#define HSIC_PAD0_CTL0_TX_SLEWP(x) (((x) & 0xF) << 8) +#define HSIC_PAD0_CTL0_TX_RTUNEN(x) (((x) & 0xF) << 4) +#define HSIC_PAD0_CTL0_TX_RTUNEP(x) (((x) & 0xF) << 0) #define XUSB_PADCTL_USB3_PAD_MUX 0x134 +#define USB3_PAD_MUX_PCIE_IDDQ_DISABLE(x) (1 << (1 + (x))) +#define USB3_PAD_MUX_SATA_IDDQ_DISABLE (1 << 6) + #define XUSB_PADCTL_IOPHY_PLL_S0_CTL1 0x138 #define IOPHY_PLL_S0_CTL1_PLL1_LOCKDET (1 << 27) @@ -90,17 +172,25 @@ #define XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL5 0x158 #define XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL6 0x15C -struct lane_cfg { - char *function; - char **lanes; - int iddq; -}; -struct xusbpadctl_softc { +#define WR4(_sc, _r, _v) bus_write_4((_sc)->mem_res, (_r), (_v)) +#define RD4(_sc, _r) bus_read_4((_sc)->mem_res, (_r)) + + +struct padctl_softc { device_t dev; struct resource *mem_res; - hwreset_t rst; + hwreset_t rst; int phy_ena_cnt; + + /* Fuses calibration data */ + uint32_t hs_curr_level_0; + uint32_t hs_curr_level_123; + uint32_t hs_iref_cap; + uint32_t hs_term_range_adj; + uint32_t hs_squelch_level; + + uint32_t hs_curr_level_offset; }; static struct ofw_compat_data compat_data[] = { @@ -108,274 +198,295 @@ static struct ofw_compat_data compat_dat {NULL, 0}, }; -struct padctl_lane { - const char *name; - bus_size_t reg; - uint32_t shift; - uint32_t mask; - int iddq; - char **mux; - int nmux; +/* Ports. */ +enum padctl_port_type { + PADCTL_PORT_USB2, + PADCTL_PORT_ULPI, + PADCTL_PORT_HSIC, + PADCTL_PORT_USB3, }; -static char *otg_mux[] = {"snps", "xusb", "uart", "rsvd"}; -static char *usb_mux[] = {"snps", "xusb"}; -static char *pci_mux[] = {"pcie", "usb3", "sata", "rsvd"}; - -#define LANE(n, r, s, m, i, mx) \ -{ \ - .name = n, \ - .reg = r, \ - .shift = s, \ - .mask = m, \ - .iddq = i, \ - .mux = mx, \ - .nmux = nitems(mx), \ -} - -static const struct padctl_lane lanes_tbl[] = { - LANE("otg-0", XUSB_PADCTL_USB2_PAD_MUX, 0, 0x3, -1, otg_mux), - LANE("otg-1", XUSB_PADCTL_USB2_PAD_MUX, 2, 0x3, -1, otg_mux), - LANE("otg-2", XUSB_PADCTL_USB2_PAD_MUX, 4, 0x3, -1, otg_mux), - LANE("ulpi-0", XUSB_PADCTL_USB2_PAD_MUX, 12, 0x1, -1, usb_mux), - LANE("hsic-0", XUSB_PADCTL_USB2_PAD_MUX, 14, 0x1, -1, usb_mux), - LANE("hsic-1", XUSB_PADCTL_USB2_PAD_MUX, 15, 0x1, -1, usb_mux), - LANE("pcie-0", XUSB_PADCTL_USB3_PAD_MUX, 16, 0x3, 1, pci_mux), - LANE("pcie-1", XUSB_PADCTL_USB3_PAD_MUX, 18, 0x3, 2, pci_mux), - LANE("pcie-2", XUSB_PADCTL_USB3_PAD_MUX, 20, 0x3, 3, pci_mux), - LANE("pcie-3", XUSB_PADCTL_USB3_PAD_MUX, 22, 0x3, 4, pci_mux), - LANE("pcie-4", XUSB_PADCTL_USB3_PAD_MUX, 24, 0x3, 5, pci_mux), - LANE("sata-0", XUSB_PADCTL_USB3_PAD_MUX, 26, 0x3, 6, pci_mux), +struct padctl_lane; +struct padctl_port { + enum padctl_port_type type; + const char *name; + const char *base_name; + int idx; + int (*init)(struct padctl_softc *sc, + struct padctl_port *port); + + /* Runtime data. */ + phandle_t xref; + bool enabled; + regulator_t supply_vbus; /* USB2, USB3 */ + bool internal; /* ULPI, USB2, USB3 */ + uint32_t companion; /* USB3 */ + struct padctl_lane *lane; }; -static int -xusbpadctl_mux_function(const struct padctl_lane *lane, char *fnc_name) -{ - int i; - - for (i = 0; i < lane->nmux; i++) { - if (strcmp(fnc_name, lane->mux[i]) == 0) - return (i); - } +static int usb3_port_init(struct padctl_softc *sc, struct padctl_port *port); - return (-1); +#define PORT(t, n, p, i) { \ + .type = t, \ + .name = n "-" #p, \ + .base_name = n, \ + .idx = p, \ + .init = i, \ } +static struct padctl_port ports_tbl[] = { + PORT(PADCTL_PORT_USB2, "usb2", 0, NULL), + PORT(PADCTL_PORT_USB2, "usb2", 1, NULL), + PORT(PADCTL_PORT_USB2, "usb2", 2, NULL), + PORT(PADCTL_PORT_ULPI, "ulpi", 0, NULL), + PORT(PADCTL_PORT_HSIC, "hsic", 0, NULL), + PORT(PADCTL_PORT_HSIC, "hsic", 1, NULL), + PORT(PADCTL_PORT_USB3, "usb3", 0, usb3_port_init), + PORT(PADCTL_PORT_USB3, "usb3", 1, usb3_port_init), +}; -static int -xusbpadctl_config_lane(struct xusbpadctl_softc *sc, char *lane_name, - const struct padctl_lane *lane, struct lane_cfg *cfg) -{ - - int tmp; - uint32_t reg; +/* Pads - a group of lannes. */ +enum padctl_pad_type { + PADCTL_PAD_USB2, + PADCTL_PAD_ULPI, + PADCTL_PAD_HSIC, + PADCTL_PAD_PCIE, + PADCTL_PAD_SATA, +}; - reg = bus_read_4(sc->mem_res, lane->reg); - if (cfg->function != NULL) { - tmp = xusbpadctl_mux_function(lane, cfg->function); - if (tmp == -1) { - device_printf(sc->dev, - "Unknown function %s for lane %s\n", cfg->function, - lane_name); - return (EINVAL); - } - reg &= ~(lane->mask << lane->shift); - reg |= (tmp & lane->mask) << lane->shift; - } - if (cfg->iddq != -1) { - if (lane->iddq == -1) { - device_printf(sc->dev, "Invalid IDDQ for lane %s\n", - lane_name); - return (EINVAL); - } - if (cfg->iddq != 0) - reg &= ~(1 << lane->iddq); - else - reg |= 1 << lane->iddq; - } +struct padctl_lane; +struct padctl_pad { + const char *name; + enum padctl_pad_type type; + int (*powerup)(struct padctl_softc *sc, + struct padctl_lane *lane); + int (*powerdown)(struct padctl_softc *sc, + struct padctl_lane *lane); + /* Runtime data. */ + bool enabled; + struct padctl_lane *lanes[8]; /* Safe maximum value. */ + int nlanes; +}; - bus_write_4(sc->mem_res, lane->reg, reg); - return (0); +static int usb2_powerup(struct padctl_softc *sc, struct padctl_lane *lane); +static int usb2_powerdown(struct padctl_softc *sc, struct padctl_lane *lane); +static int pcie_powerup(struct padctl_softc *sc, struct padctl_lane *lane); +static int pcie_powerdown(struct padctl_softc *sc, struct padctl_lane *lane); +static int sata_powerup(struct padctl_softc *sc, struct padctl_lane *lane); +static int sata_powerdown(struct padctl_softc *sc, struct padctl_lane *lane); + +#define PAD(n, t, u, d) { \ + .name = n, \ + .type = t, \ + .powerup = u, \ + .powerdown = d, \ } +static struct padctl_pad pads_tbl[] = { + PAD("usb2", PADCTL_PAD_USB2, usb2_powerup, usb2_powerdown), + PAD("ulpi", PADCTL_PAD_ULPI, NULL, NULL), + PAD("hsic", PADCTL_PAD_HSIC, NULL, NULL), + PAD("pcie", PADCTL_PAD_PCIE, pcie_powerup, pcie_powerdown), + PAD("sata", PADCTL_PAD_SATA, sata_powerup, sata_powerdown), +}; -static const struct padctl_lane * -xusbpadctl_search_lane(char *lane_name) -{ - int i; - - for (i = 0; i < nitems(lanes_tbl); i++) { - if (strcmp(lane_name, lanes_tbl[i].name) == 0) - return (&lanes_tbl[i]); - } +/* Lanes. */ +static char *otg_mux[] = {"snps", "xusb", "uart", "rsvd"}; +static char *usb_mux[] = {"snps", "xusb"}; +static char *pci_mux[] = {"pcie", "usb3-ss", "sata", "rsvd"}; - return (NULL); -} +struct padctl_lane { + const char *name; + int idx; + bus_size_t reg; + uint32_t shift; + uint32_t mask; + char **mux; + int nmux; + /* Runtime data. */ + bool enabled; + phandle_t xref; + struct padctl_pad *pad; + struct padctl_port *port; + int mux_idx; -static int -xusbpadctl_config_node(struct xusbpadctl_softc *sc, char *lane_name, - struct lane_cfg *cfg) -{ - const struct padctl_lane *lane; - int rv; +}; - lane = xusbpadctl_search_lane(lane_name); - if (lane == NULL) { - device_printf(sc->dev, "Unknown lane: %s\n", lane_name); - return (ENXIO); - } - rv = xusbpadctl_config_lane(sc, lane_name, lane, cfg); - return (rv); +#define LANE(n, p, r, s, m, mx) { \ + .name = n "-" #p, \ + .idx = p, \ + .reg = r, \ + .shift = s, \ + .mask = m, \ + .mux = mx, \ + .nmux = nitems(mx), \ } +static struct padctl_lane lanes_tbl[] = { + LANE("usb2", 0, XUSB_PADCTL_USB2_PAD_MUX, 0, 0x3, otg_mux), + LANE("usb2", 1, XUSB_PADCTL_USB2_PAD_MUX, 2, 0x3, otg_mux), + LANE("usb2", 2, XUSB_PADCTL_USB2_PAD_MUX, 4, 0x3, otg_mux), + LANE("ulpi", 0, XUSB_PADCTL_USB2_PAD_MUX, 12, 0x1, usb_mux), + LANE("hsic", 0, XUSB_PADCTL_USB2_PAD_MUX, 14, 0x1, usb_mux), + LANE("hsic", 1, XUSB_PADCTL_USB2_PAD_MUX, 15, 0x1, usb_mux), + LANE("pcie", 0, XUSB_PADCTL_USB3_PAD_MUX, 16, 0x3, pci_mux), + LANE("pcie", 1, XUSB_PADCTL_USB3_PAD_MUX, 18, 0x3, pci_mux), + LANE("pcie", 2, XUSB_PADCTL_USB3_PAD_MUX, 20, 0x3, pci_mux), + LANE("pcie", 3, XUSB_PADCTL_USB3_PAD_MUX, 22, 0x3, pci_mux), + LANE("pcie", 4, XUSB_PADCTL_USB3_PAD_MUX, 24, 0x3, pci_mux), + LANE("sata", 0, XUSB_PADCTL_USB3_PAD_MUX, 26, 0x3, pci_mux), +}; -static int -xusbpadctl_read_node(struct xusbpadctl_softc *sc, phandle_t node, - struct lane_cfg *cfg, char **lanes, int *llanes) -{ - int rv; - - *llanes = OF_getprop_alloc(node, "nvidia,lanes", 1, (void **)lanes); - if (*llanes <= 0) - return (ENOENT); +/* Define all possible mappings for USB3 port lanes */ +struct padctl_lane_map { + int port_idx; + enum padctl_pad_type pad_type; + int lane_idx; +}; - /* Read function (mux) settings. */ - rv = OF_getprop_alloc(node, "nvidia,function", 1, - (void **)&cfg->function); - if (rv <= 0) - cfg->function = NULL; - /* Read numeric properties. */ - rv = OF_getencprop(node, "nvidia,iddq", &cfg->iddq, - sizeof(cfg->iddq)); - if (rv <= 0) - cfg->iddq = -1; - return (0); +#define LANE_MAP(pi, pt, li) { \ + .port_idx = pi, \ + .pad_type = pt, \ + .lane_idx = li, \ } +static struct padctl_lane_map lane_map_tbl[] = { + LANE_MAP(0, PADCTL_PAD_PCIE, 0), /* port USB3-0 -> lane PCIE-0 */ + LANE_MAP(1, PADCTL_PAD_PCIE, 1), /* port USB3-1 -> lane PCIE-1 */ + /* -- or -- */ + LANE_MAP(1, PADCTL_PAD_SATA, 0), /* port USB3-1 -> lane SATA-0 */ +}; +static struct padctl_port *search_lane_port(struct padctl_softc *sc, + struct padctl_lane *lane); +/* ------------------------------------------------------------------------- + * + * PHY functions + */ static int -xusbpadctl_process_node(struct xusbpadctl_softc *sc, phandle_t node) +usb3_port_init(struct padctl_softc *sc, struct padctl_port *port) { - struct lane_cfg cfg; - char *lanes, *lname; - int i, len, llanes, rv; - - rv = xusbpadctl_read_node(sc, node, &cfg, &lanes, &llanes); - if (rv != 0) - return (rv); - - len = 0; - lname = lanes; - do { - i = strlen(lname) + 1; - rv = xusbpadctl_config_node(sc, lname, &cfg); - if (rv != 0) - device_printf(sc->dev, - "Cannot configure lane: %s: %d\n", lname, rv); - - len += i; - lname += i; - } while (len < llanes); - - if (lanes != NULL) - OF_prop_free(lanes); - if (cfg.function != NULL) - OF_prop_free(cfg.function); - return (rv); -} - + uint32_t reg; -static int -xusbpadctl_pinctrl_cfg(device_t dev, phandle_t cfgxref) -{ - struct xusbpadctl_softc *sc; - phandle_t node, cfgnode; - int rv; + reg = RD4(sc, XUSB_PADCTL_SS_PORT_MAP); + if (port->internal) + reg &= ~SS_PORT_MAP_PORT_INTERNAL(port->idx); + else + reg |= SS_PORT_MAP_PORT_INTERNAL(port->idx); + reg &= ~SS_PORT_MAP_PORT_MAP(port->idx, ~0); + reg |= SS_PORT_MAP_PORT_MAP(port->idx, port->companion); + WR4(sc, XUSB_PADCTL_SS_PORT_MAP, reg); + + reg = RD4(sc, XUSB_PADCTL_IOPHY_USB3_PAD_CTL2(port->idx)); + reg &= ~IOPHY_USB3_PAD_CTL2_CDR_CNTL(~0); + reg &= ~IOPHY_USB3_PAD_CTL2_RX_EQ(~0); + reg &= ~IOPHY_USB3_PAD_CTL2_RX_WANDER(~0); + reg |= IOPHY_USB3_PAD_CTL2_CDR_CNTL(0x24); + reg |= IOPHY_USB3_PAD_CTL2_RX_EQ(0xF070); + reg |= IOPHY_USB3_PAD_CTL2_RX_WANDER(0xF); + WR4(sc, XUSB_PADCTL_IOPHY_USB3_PAD_CTL2(port->idx), reg); + + WR4(sc, XUSB_PADCTL_IOPHY_USB3_PAD_CTL4(port->idx), + 0x002008EE); + + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); + reg &= ~ELPG_PROGRAM_SSP_ELPG_VCORE_DOWN(port->idx); + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); + DELAY(100); - sc = device_get_softc(dev); - cfgnode = OF_node_from_xref(cfgxref); + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); + reg &= ~ELPG_PROGRAM_SSP_ELPG_CLAMP_EN_EARLY(port->idx); + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); + DELAY(100); - rv = 0; - for (node = OF_child(cfgnode); node != 0; node = OF_peer(node)) { - if (!fdt_is_enabled(node)) - continue; - rv = xusbpadctl_process_node(sc, node); - if (rv != 0) - return (rv); - } + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); + reg &= ~ELPG_PROGRAM_SSP_ELPG_CLAMP_EN(port->idx); + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); + DELAY(100); - return (rv); + return (0); } static int -xusbpadctl_phy_pcie_powerup(struct xusbpadctl_softc *sc) +pcie_powerup(struct padctl_softc *sc, struct padctl_lane *lane) { uint32_t reg; int i; - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); - reg &= ~IOPHY_PLL_P0_CTL1_REFCLK_SEL_MASK; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1, reg); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); + reg &= ~IOPHY_PLL_P0_CTL1_REFCLK_SEL(~0); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL2); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL2); reg |= IOPHY_PLL_P0_CTL2_REFCLKBUF_EN; reg |= IOPHY_PLL_P0_CTL2_TXCLKREF_EN; reg |= IOPHY_PLL_P0_CTL2_TXCLKREF_SEL; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL2, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL2, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); reg |= IOPHY_PLL_P0_CTL1_PLL_RST; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1, reg); DELAY(100); - for (i = 0; i < 100; i++) { - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); + for (i = 100; i > 0; i--) { + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); if (reg & IOPHY_PLL_P0_CTL1_PLL0_LOCKDET) - return (0); + break; DELAY(10); } + if (i <= 0) { + device_printf(sc->dev, "Failed to power up PCIe phy\n"); + return (ETIMEDOUT); + } + reg = RD4(sc, XUSB_PADCTL_USB3_PAD_MUX); + reg |= USB3_PAD_MUX_PCIE_IDDQ_DISABLE(lane->idx); + WR4(sc, XUSB_PADCTL_USB3_PAD_MUX, reg); - return (ETIMEDOUT); + return (0); } - static int -xusbpadctl_phy_pcie_powerdown(struct xusbpadctl_softc *sc) +pcie_powerdown(struct padctl_softc *sc, struct padctl_lane *lane) { uint32_t reg; - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); + reg = RD4(sc, XUSB_PADCTL_USB3_PAD_MUX); + reg &= ~USB3_PAD_MUX_PCIE_IDDQ_DISABLE(lane->idx); + WR4(sc, XUSB_PADCTL_USB3_PAD_MUX, reg); + + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); reg &= ~IOPHY_PLL_P0_CTL1_PLL_RST; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1, reg); DELAY(100); + return (0); } static int -xusbpadctl_phy_sata_powerup(struct xusbpadctl_softc *sc) +sata_powerup(struct padctl_softc *sc, struct padctl_lane *lane) { uint32_t reg; int i; - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1); reg &= ~IOPHY_MISC_PAD_S0_CTL1_IDDQ_OVRD; reg &= ~IOPHY_MISC_PAD_S0_CTL1_IDDQ; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1, reg); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); reg &= ~IOPHY_PLL_S0_CTL1_PLL_PWR_OVRD; reg &= ~IOPHY_PLL_S0_CTL1_PLL_IDDQ; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); reg |= IOPHY_PLL_S0_CTL1_PLL1_MODE; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); reg |= IOPHY_PLL_S0_CTL1_PLL_RST_L; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); for (i = 100; i >= 0; i--) { - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); if (reg & IOPHY_PLL_S0_CTL1_PLL1_LOCKDET) break; DELAY(100); @@ -384,81 +495,188 @@ xusbpadctl_phy_sata_powerup(struct xusbp device_printf(sc->dev, "Failed to power up SATA phy\n"); return (ETIMEDOUT); } + reg = RD4(sc, XUSB_PADCTL_USB3_PAD_MUX); + reg |= IOPHY_PLL_S0_CTL1_PLL_RST_L; + WR4(sc, XUSB_PADCTL_USB3_PAD_MUX, reg); + + reg = RD4(sc, XUSB_PADCTL_USB3_PAD_MUX); + reg |= USB3_PAD_MUX_SATA_IDDQ_DISABLE; + WR4(sc, XUSB_PADCTL_USB3_PAD_MUX, reg); return (0); } static int -xusbpadctl_phy_sata_powerdown(struct xusbpadctl_softc *sc) +sata_powerdown(struct padctl_softc *sc, struct padctl_lane *lane) { uint32_t reg; - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_USB3_PAD_MUX); + reg &= ~USB3_PAD_MUX_SATA_IDDQ_DISABLE; + WR4(sc, XUSB_PADCTL_USB3_PAD_MUX, reg); + + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); reg &= ~IOPHY_PLL_S0_CTL1_PLL_RST_L; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); reg &= ~IOPHY_PLL_S0_CTL1_PLL1_MODE; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); reg |= IOPHY_PLL_S0_CTL1_PLL_PWR_OVRD; reg |= IOPHY_PLL_S0_CTL1_PLL_IDDQ; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1); reg |= IOPHY_MISC_PAD_S0_CTL1_IDDQ_OVRD; reg |= IOPHY_MISC_PAD_S0_CTL1_IDDQ; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1, reg); DELAY(100); return (0); } static int -xusbpadctl_phy_powerup(struct xusbpadctl_softc *sc) +usb2_powerup(struct padctl_softc *sc, struct padctl_lane *lane) { uint32_t reg; + struct padctl_port *port; + int rv; - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM); - reg &= ~ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN; - bus_write_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM, reg); + port = search_lane_port(sc, lane); + if (port == NULL) { + device_printf(sc->dev, "Cannot find port for lane: %s\n", + lane->name); + } + reg = RD4(sc, XUSB_PADCTL_USB2_BIAS_PAD_CTL0); + reg &= ~USB2_BIAS_PAD_CTL0_HS_SQUELCH_LEVEL(~0); + reg &= ~USB2_BIAS_PAD_CTL0_HS_DISCON_LEVEL(~0); + reg |= USB2_BIAS_PAD_CTL0_HS_SQUELCH_LEVEL(sc->hs_squelch_level); + reg |= USB2_BIAS_PAD_CTL0_HS_DISCON_LEVEL(5); + WR4(sc, XUSB_PADCTL_USB2_BIAS_PAD_CTL0, reg); + + reg = RD4(sc, XUSB_PADCTL_USB2_PORT_CAP); + reg &= ~USB2_PORT_CAP_PORT_CAP(lane->idx, ~0); + reg |= USB2_PORT_CAP_PORT_CAP(lane->idx, USB2_PORT_CAP_PORT_CAP_HOST); + WR4(sc, XUSB_PADCTL_USB2_PORT_CAP, reg); + + reg = RD4(sc, XUSB_PADCTL_USB2_OTG_PAD_CTL0(lane->idx)); + reg &= ~USB2_OTG_PAD_CTL0_HS_CURR_LEVEL(~0); + reg &= ~USB2_OTG_PAD_CTL0_HS_SLEW(~0); + reg &= ~USB2_OTG_PAD_CTL0_LS_RSLEW(~0); + reg &= ~USB2_OTG_PAD_CTL0_PD; + reg &= ~USB2_OTG_PAD_CTL0_PD2; + reg &= ~USB2_OTG_PAD_CTL0_PD_ZI; + + reg |= USB2_OTG_PAD_CTL0_HS_SLEW(14); + if (lane->idx == 0) { + reg |= USB2_OTG_PAD_CTL0_HS_CURR_LEVEL(sc->hs_curr_level_0); + reg |= USB2_OTG_PAD_CTL0_LS_RSLEW(3); + } else { + reg |= USB2_OTG_PAD_CTL0_HS_CURR_LEVEL(sc->hs_curr_level_123); + reg |= USB2_OTG_PAD_CTL0_LS_RSLEW(0); + } + WR4(sc, XUSB_PADCTL_USB2_OTG_PAD_CTL0(lane->idx), reg); + + reg = RD4(sc, XUSB_PADCTL_USB2_OTG_PAD_CTL1(lane->idx)); + reg &= ~USB2_OTG_PAD_CTL1_TERM_RANGE_ADJ(~0); + reg &= ~USB2_OTG_PAD_CTL1_HS_IREF_CAP(~0); + reg &= ~USB2_OTG_PAD_CTL1_PD_DR; + reg &= ~USB2_OTG_PAD_CTL1_PD_DISC_FORCE_POWERUP; + reg &= ~USB2_OTG_PAD_CTL1_PD_CHRP_FORCE_POWERUP; + + reg |= USB2_OTG_PAD_CTL1_TERM_RANGE_ADJ(sc->hs_term_range_adj); + reg |= USB2_OTG_PAD_CTL1_HS_IREF_CAP(sc->hs_iref_cap); + WR4(sc, XUSB_PADCTL_USB2_OTG_PAD_CTL1(lane->idx), reg); + + if (port != NULL && port->supply_vbus != NULL) { + rv = regulator_enable(port->supply_vbus); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable vbus regulator\n"); + return (rv); + } + } + reg = RD4(sc, XUSB_PADCTL_USB2_BIAS_PAD_CTL0); + reg &= ~USB2_BIAS_PAD_CTL0_PD; + WR4(sc, XUSB_PADCTL_USB2_BIAS_PAD_CTL0, reg); + + return (0); +} + +static int +usb2_powerdown(struct padctl_softc *sc, struct padctl_lane *lane) +{ + uint32_t reg; + struct padctl_port *port; + int rv; + + port = search_lane_port(sc, lane); + if (port == NULL) { + device_printf(sc->dev, "Cannot find port for lane: %s\n", + lane->name); + } + reg = RD4(sc, XUSB_PADCTL_USB2_BIAS_PAD_CTL0); + reg |= USB2_BIAS_PAD_CTL0_PD; + WR4(sc, XUSB_PADCTL_USB2_BIAS_PAD_CTL0, reg); + + if (port != NULL && port->supply_vbus != NULL) { + rv = regulator_enable(port->supply_vbus); + if (rv != 0) { + device_printf(sc->dev, + "Cannot disable vbus regulator\n"); + return (rv); + } + } + return (0); +} + + +static int +phy_powerup(struct padctl_softc *sc) +{ + uint32_t reg; + + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); + reg &= ~ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN; + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM); - reg &= ~ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN_EARLY; - bus_write_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM, reg); + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); + reg &= ~ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN; + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM); - reg &= ~ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN; - bus_write_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM, reg); + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); + reg &= ~ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN_EARLY; + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); DELAY(100); return (0); } static int -xusbpadctl_phy_powerdown(struct xusbpadctl_softc *sc) +phy_powerdown(struct padctl_softc *sc) { uint32_t reg; - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM); - reg |= ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN; - bus_write_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM, reg); - DELAY(100); - - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM); + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); reg |= ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN_EARLY; - bus_write_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM, reg); + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM); + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); reg |= ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN; - bus_write_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM, reg); + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); + DELAY(100); + + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); + reg |= ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN; + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); DELAY(100); return (0); @@ -467,45 +685,43 @@ xusbpadctl_phy_powerdown(struct xusbpadc static int xusbpadctl_phy_enable(device_t dev, intptr_t id, bool enable) { - struct xusbpadctl_softc *sc; + struct padctl_softc *sc; + struct padctl_lane *lane; + struct padctl_pad *pad; int rv; sc = device_get_softc(dev); - if ((id != TEGRA_XUSB_PADCTL_PCIE) && - (id != TEGRA_XUSB_PADCTL_SATA)) { + if (id < 0 || id >= nitems(lanes_tbl)) { device_printf(dev, "Unknown phy: %d\n", id); return (ENXIO); } - - rv = 0; + lane = lanes_tbl + id; + if (!lane->enabled) { + device_printf(dev, "Lane is not enabled/configured: %s\n", + lane->name); + return (ENXIO); + } + pad = lane->pad; if (enable) { if (sc->phy_ena_cnt == 0) { - rv = xusbpadctl_phy_powerup(sc); + rv = phy_powerup(sc); if (rv != 0) return (rv); } sc->phy_ena_cnt++; } - if (id == TEGRA_XUSB_PADCTL_PCIE) { - if (enable) - rv = xusbpadctl_phy_pcie_powerup(sc); - else - rv = xusbpadctl_phy_pcie_powerdown(sc); - if (rv != 0) - return (rv); - } else if (id == TEGRA_XUSB_PADCTL_SATA) { - if (enable) - rv = xusbpadctl_phy_sata_powerup(sc); - else - rv = xusbpadctl_phy_sata_powerdown(sc); - if (rv != 0) - return (rv); - } + if (enable) + rv = pad->powerup(sc, lane); + else + rv = pad->powerdown(sc, lane); + if (rv != 0) + return (rv); + if (!enable) { if (sc->phy_ena_cnt == 1) { - rv = xusbpadctl_phy_powerdown(sc); + rv = phy_powerdown(sc); if (rv != 0) return (rv); } @@ -516,6 +732,387 @@ xusbpadctl_phy_enable(device_t dev, intp } static int +xusbpadctl_phy_map(device_t provider, phandle_t xref, int ncells, + pcell_t *cells, intptr_t *id) +{ + int i; + + if (ncells != 0) + return (ERANGE); + + for (i = 0; i < nitems(lanes_tbl); i++) { + if (lanes_tbl[i].xref == xref) { + *id = i; + return (0); + } + } + return (ENXIO); +} + +/* ------------------------------------------------------------------------- + * + * FDT processing + */ +static struct padctl_port * +search_port(struct padctl_softc *sc, char *port_name) +{ + int i; + + for (i = 0; i < nitems(ports_tbl); i++) { + if (strcmp(port_name, ports_tbl[i].name) == 0) + return (&ports_tbl[i]); + } + return (NULL); +} + +static struct padctl_port * +search_lane_port(struct padctl_softc *sc, struct padctl_lane *lane) +{ + int i; + + for (i = 0; i < nitems(ports_tbl); i++) { + if (!ports_tbl[i].enabled) + continue; + if (ports_tbl[i].lane == lane) + return (ports_tbl + i); + } + return (NULL); +} + +static struct padctl_lane * +search_lane(struct padctl_softc *sc, char *lane_name) +{ + int i; + + for (i = 0; i < nitems(lanes_tbl); i++) { + if (strcmp(lane_name, lanes_tbl[i].name) == 0) + return (lanes_tbl + i); + } + return (NULL); +} + +static struct padctl_lane * +search_pad_lane(struct padctl_softc *sc, enum padctl_pad_type type, int idx) +{ + int i; + + for (i = 0; i < nitems(lanes_tbl); i++) { + if (!lanes_tbl[i].enabled) + continue; + if (type == lanes_tbl[i].pad->type && idx == lanes_tbl[i].idx) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Nov 7 05:37:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F14C34B1C; Mon, 7 Nov 2016 05:37:12 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11F05F37; Mon, 7 Nov 2016 05:37:11 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA75bBQI061540; Mon, 7 Nov 2016 05:37:11 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA75bBRZ061536; Mon, 7 Nov 2016 05:37:11 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201611070537.uA75bBRZ061536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 7 Nov 2016 05:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308391 - in head/sys: arm/conf arm/nvidia arm/nvidia/tegra124 boot/fdt/dts/arm contrib/dev/nvidia X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 05:37:12 -0000 Author: mmel Date: Mon Nov 7 05:37:10 2016 New Revision: 308391 URL: https://svnweb.freebsd.org/changeset/base/308391 Log: Add NVIDIA Tegra XHCI driver and coresponding firmware blob. MFC after: 3 weeks Approved by: core@ (NVIDIA license) Added: head/sys/arm/nvidia/tegra_xhci.c (contents, props changed) head/sys/contrib/dev/nvidia/ head/sys/contrib/dev/nvidia/LICENCE.nvidia head/sys/contrib/dev/nvidia/tegra124_xusb.bin.uu Modified: head/sys/arm/conf/TEGRA124 head/sys/arm/nvidia/tegra124/files.tegra124 head/sys/boot/fdt/dts/arm/tegra124-jetson-tk1-fbsd.dts Modified: head/sys/arm/conf/TEGRA124 ============================================================================== --- head/sys/arm/conf/TEGRA124 Mon Nov 7 05:34:44 2016 (r308390) +++ head/sys/arm/conf/TEGRA124 Mon Nov 7 05:37:10 2016 (r308391) @@ -50,7 +50,7 @@ device vlan # 802.1Q VLAN support #device tun # Packet tunnel. device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling -#device firmware # firmware assist module +device firmware # firmware assist module device ether # Ethernet support device miibus # Required for ethernet device bpf # Berkeley packet filter (required for DHCP) @@ -86,6 +86,8 @@ device pass # Passthrough device (dir # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device ehci # EHCI USB interface +device xhci # XHCI USB interface +device tegra124_xusb_fw # Tegra XUSB firmware device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da device uhid # "Human Interface Devices" Modified: head/sys/arm/nvidia/tegra124/files.tegra124 ============================================================================== --- head/sys/arm/nvidia/tegra124/files.tegra124 Mon Nov 7 05:34:44 2016 (r308390) +++ head/sys/arm/nvidia/tegra124/files.tegra124 Mon Nov 7 05:37:10 2016 (r308391) @@ -24,6 +24,7 @@ arm/nvidia/tegra_uart.c optional uart arm/nvidia/tegra_sdhci.c optional sdhci arm/nvidia/tegra_gpio.c optional gpio arm/nvidia/tegra_ehci.c optional ehci +arm/nvidia/tegra_xhci.c optional xhci arm/nvidia/tegra_ahci.c optional ahci arm/nvidia/tegra_pcie.c optional pci arm/nvidia/tegra_i2c.c optional iic @@ -45,11 +46,25 @@ arm/nvidia/tegra_mc.c standard #arm/nvidia/drm2/tegra_fb.c optional drm2 #arm/nvidia/drm2/tegra_bo.c optional drm2 # -# Optional devices. +# Firmware # - +tegra124_xusb_fw.c optional tegra124_xusb_fw \ + dependency "$S/arm/nvidia/tegra124/files.tegra124" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk tegra124_xusb.fw:tegra124_xusb_fw -mtegra124_xusb_fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "tegra124_xusb_fw.c" +tegra124_xusb.fwo optional tegra124_xusb_fw \ + dependency "tegra124_xusb.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "tegra124_xusb.fwo" +tegra124_xusb.fw optional tegra124_xusb_fw \ + dependency "$S/contrib/dev/nvidia/tegra124_xusb.bin.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "tegra124_xusb.fw" # -# Temporary/ to be moved stuff +# Temporary/to be moved stuff # arm/nvidia/as3722.c optional iic arm/nvidia/as3722_regulators.c optional iic Added: head/sys/arm/nvidia/tegra_xhci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/nvidia/tegra_xhci.c Mon Nov 7 05:37:10 2016 (r308391) @@ -0,0 +1,1160 @@ +/*- + * Copyright (c) 2016 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * XHCI driver for Tegra SoCs. + */ +#include "opt_bus.h" +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "usbdevs.h" + +/* FPCI address space */ +#define T_XUSB_CFG_0 0x000 +#define T_XUSB_CFG_1 0x004 +#define CFG_1_BUS_MASTER (1 << 2) +#define CFG_1_MEMORY_SPACE (1 << 1) +#define CFG_1_IO_SPACE (1 << 0) + +#define T_XUSB_CFG_2 0x008 +#define T_XUSB_CFG_3 0x00C +#define T_XUSB_CFG_4 0x010 +#define CFG_4_BASE_ADDRESS(x) (((x) & 0x1FFFF) << 15) + +#define T_XUSB_CFG_5 0x014 +#define T_XUSB_CFG_ARU_MAILBOX_CMD 0x0E4 +#define ARU_MAILBOX_CMD_INT_EN (1U << 31) +#define ARU_MAILBOX_CMD_DEST_XHCI (1 << 30) +#define ARU_MAILBOX_CMD_DEST_SMI (1 << 29) +#define ARU_MAILBOX_CMD_DEST_PME (1 << 28) +#define ARU_MAILBOX_CMD_DEST_FALC (1 << 27) + +#define T_XUSB_CFG_ARU_MAILBOX_DATA_IN 0x0E8 +#define ARU_MAILBOX_DATA_IN_DATA(x) (((x) & 0xFFFFFF) << 0) +#define ARU_MAILBOX_DATA_IN_TYPE(x) (((x) & 0x0000FF) << 24) + +#define T_XUSB_CFG_ARU_MAILBOX_DATA_OUT 0x0EC +#define ARU_MAILBOX_DATA_OUT_DATA(x) (((x) >> 0) & 0xFFFFFF) +#define ARU_MAILBOX_DATA_OUT_TYPE(x) (((x) >> 24) & 0x0000FF) + +#define T_XUSB_CFG_ARU_MAILBOX_OWNER 0x0F0 +#define ARU_MAILBOX_OWNER_SW 2 +#define ARU_MAILBOX_OWNER_FW 1 +#define ARU_MAILBOX_OWNER_NONE 0 + +#define XUSB_CFG_ARU_C11_CSBRANGE 0x41C /* ! UNDOCUMENTED ! */ +#define ARU_C11_CSBRANGE_PAGE(x) ((x) >> 9) +#define ARU_C11_CSBRANGE_ADDR(x) (0x800 + ((x) & 0x1FF)) +#define XUSB_CFG_ARU_SMI_INTR 0x428 /* ! UNDOCUMENTED ! */ +#define ARU_SMI_INTR_EN (1 << 3) +#define ARU_SMI_INTR_FW_HANG (1 << 1) +#define XUSB_CFG_ARU_RST 0x42C /* ! UNDOCUMENTED ! */ +#define ARU_RST_RESET (1 << 0) + +#define XUSB_HOST_CONFIGURATION 0x180 +#define CONFIGURATION_CLKEN_OVERRIDE (1U<< 31) +#define CONFIGURATION_PW_NO_DEVSEL_ERR_CYA (1 << 19) +#define CONFIGURATION_INITIATOR_READ_IDLE (1 << 18) +#define CONFIGURATION_INITIATOR_WRITE_IDLE (1 << 17) +#define CONFIGURATION_WDATA_LEAD_CYA (1 << 15) +#define CONFIGURATION_WR_INTRLV_CYA (1 << 14) +#define CONFIGURATION_TARGET_READ_IDLE (1 << 11) +#define CONFIGURATION_TARGET_WRITE_IDLE (1 << 10) +#define CONFIGURATION_MSI_VEC_EMPTY (1 << 9) +#define CONFIGURATION_UFPCI_MSIAW (1 << 7) +#define CONFIGURATION_UFPCI_PWPASSPW (1 << 6) +#define CONFIGURATION_UFPCI_PASSPW (1 << 5) +#define CONFIGURATION_UFPCI_PWPASSNPW (1 << 4) +#define CONFIGURATION_DFPCI_PWPASSNPW (1 << 3) +#define CONFIGURATION_DFPCI_RSPPASSPW (1 << 2) +#define CONFIGURATION_DFPCI_PASSPW (1 << 1) +#define CONFIGURATION_EN_FPCI (1 << 0) + +/* IPFS address space */ +#define XUSB_HOST_FPCI_ERROR_MASKS 0x184 +#define FPCI_ERROR_MASTER_ABORT (1 << 2) +#define FPCI_ERRORI_DATA_ERROR (1 << 1) +#define FPCI_ERROR_TARGET_ABORT (1 << 0) + +#define XUSB_HOST_INTR_MASK 0x188 +#define INTR_IP_INT_MASK (1 << 16) +#define INTR_MSI_MASK (1 << 8) +#define INTR_INT_MASK (1 << 0) + +#define XUSB_HOST_CLKGATE_HYSTERESIS 0x1BC + + /* CSB Falcon CPU */ +#define XUSB_FALCON_CPUCTL 0x100 +#define CPUCTL_STOPPED (1 << 5) +#define CPUCTL_HALTED (1 << 4) +#define CPUCTL_HRESET (1 << 3) +#define CPUCTL_SRESET (1 << 2) +#define CPUCTL_STARTCPU (1 << 1) +#define CPUCTL_IINVAL (1 << 0) + +#define XUSB_FALCON_BOOTVEC 0x104 +#define XUSB_FALCON_DMACTL 0x10C +#define XUSB_FALCON_IMFILLRNG1 0x154 +#define IMFILLRNG1_TAG_HI(x) (((x) & 0xFFF) << 16) +#define IMFILLRNG1_TAG_LO(x) (((x) & 0xFFF) << 0) +#define XUSB_FALCON_IMFILLCTL 0x158 + +/* CSB mempool */ +#define XUSB_CSB_MEMPOOL_APMAP 0x10181C +#define APMAP_BOOTPATH (1U << 31) + +#define XUSB_CSB_MEMPOOL_ILOAD_ATTR 0x101A00 +#define XUSB_CSB_MEMPOOL_ILOAD_BASE_LO 0x101A04 +#define XUSB_CSB_MEMPOOL_ILOAD_BASE_HI 0x101A08 +#define XUSB_CSB_MEMPOOL_L2IMEMOP_SIZE 0x101A10 +#define L2IMEMOP_SIZE_OFFSET(x) (((x) & 0x3FF) << 8) +#define L2IMEMOP_SIZE_SIZE(x) (((x) & 0x0FF) << 24) + +#define XUSB_CSB_MEMPOOL_L2IMEMOP_TRIG 0x101A14 +#define L2IMEMOP_INVALIDATE_ALL (0x40 << 24) +#define L2IMEMOP_LOAD_LOCKED_RESULT (0x11 << 24) + +#define XUSB_CSB_MEMPOOL_L2IMEMOP_RESULT 0x101A18 +#define L2IMEMOP_RESULT_VLD (1U << 31) + +#define XUSB_CSB_IMEM_BLOCK_SIZE 256 + +#define TEGRA_XHCI_SS_HIGH_SPEED 120000000 +#define TEGRA_XHCI_SS_LOW_SPEED 12000000 + +/* MBOX commands. */ +#define MBOX_CMD_MSG_ENABLED 1 +#define MBOX_CMD_INC_FALC_CLOCK 2 +#define MBOX_CMD_DEC_FALC_CLOCK 3 +#define MBOX_CMD_INC_SSPI_CLOCK 4 +#define MBOX_CMD_DEC_SSPI_CLOCK 5 +#define MBOX_CMD_SET_BW 6 +#define MBOX_CMD_SET_SS_PWR_GATING 7 +#define MBOX_CMD_SET_SS_PWR_UNGATING 8 +#define MBOX_CMD_SAVE_DFE_CTLE_CTX 9 +#define MBOX_CMD_AIRPLANE_MODE_ENABLED 10 +#define MBOX_CMD_AIRPLANE_MODE_DISABLED 11 +#define MBOX_CMD_START_HSIC_IDLE 12 +#define MBOX_CMD_STOP_HSIC_IDLE 13 +#define MBOX_CMD_DBC_WAKE_STACK 14 +#define MBOX_CMD_HSIC_PRETEND_CONNECT 15 +#define MBOX_CMD_RESET_SSPI 16 +#define MBOX_CMD_DISABLE_SS_LFPS_DETECTION 17 +#define MBOX_CMD_ENABLE_SS_LFPS_DETECTION 18 + +/* MBOX responses. */ +#define MBOX_CMD_ACK (0x80 + 0) +#define MBOX_CMD_NAK (0x80 + 1) + + +#define IPFS_WR4(_sc, _r, _v) bus_write_4((_sc)->mem_res_ipfs, (_r), (_v)) +#define IPFS_RD4(_sc, _r) bus_read_4((_sc)->mem_res_ipfs, (_r)) +#define FPCI_WR4(_sc, _r, _v) bus_write_4((_sc)->mem_res_fpci, (_r), (_v)) +#define FPCI_RD4(_sc, _r) bus_read_4((_sc)->mem_res_fpci, (_r)) + +#define LOCK(_sc) mtx_lock(&(_sc)->mtx) +#define UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) +#define SLEEP(_sc, timeout) \ + mtx_sleep(sc, &sc->mtx, 0, "tegra_xhci", timeout); +#define LOCK_INIT(_sc) \ + mtx_init(&_sc->mtx, device_get_nameunit(_sc->dev), "tegra_xhci", MTX_DEF) +#define LOCK_DESTROY(_sc) mtx_destroy(&_sc->mtx) +#define ASSERT_LOCKED(_sc) mtx_assert(&_sc->mtx, MA_OWNED) +#define ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->mtx, MA_NOTOWNED) + +struct tegra_xusb_fw_hdr { + uint32_t boot_loadaddr_in_imem; + uint32_t boot_codedfi_offset; + uint32_t boot_codetag; + uint32_t boot_codesize; + + uint32_t phys_memaddr; + uint16_t reqphys_memsize; + uint16_t alloc_phys_memsize; + + uint32_t rodata_img_offset; + uint32_t rodata_section_start; + uint32_t rodata_section_end; + uint32_t main_fnaddr; + + uint32_t fwimg_cksum; + uint32_t fwimg_created_time; + + uint32_t imem_resident_start; + uint32_t imem_resident_end; + uint32_t idirect_start; + uint32_t idirect_end; + uint32_t l2_imem_start; + uint32_t l2_imem_end; + uint32_t version_id; + uint8_t init_ddirect; + uint8_t reserved[3]; + uint32_t phys_addr_log_buffer; + uint32_t total_log_entries; + uint32_t dequeue_ptr; + uint32_t dummy[2]; + uint32_t fwimg_len; + uint8_t magic[8]; + uint32_t ss_low_power_entry_timeout; + uint8_t num_hsic_port; + uint8_t ss_portmap; + uint8_t build; + uint8_t padding[137]; /* Pad to 256 bytes */ +}; + +/* Compatible devices. */ +static struct ofw_compat_data compat_data[] = { + {"nvidia,tegra124-xusb", 1}, + {NULL, 0} +}; + +struct tegra_xhci_softc { + struct xhci_softc xhci_softc; + device_t dev; + struct mtx mtx; + struct resource *mem_res_fpci; + struct resource *mem_res_ipfs; + struct resource *irq_res_mbox; + void *irq_hdl_mbox; + + clk_t clk_xusb_host; + clk_t clk_xusb_gate; + clk_t clk_xusb_falcon_src; + clk_t clk_xusb_ss; + clk_t clk_xusb_hs_src; + clk_t clk_xusb_fs_src; + hwreset_t hwreset_xusb_host; + hwreset_t hwreset_xusb_ss; + regulator_t supply_avddio_pex; + regulator_t supply_dvddio_pex; + regulator_t supply_avdd_usb; + regulator_t supply_avdd_pll_utmip; + regulator_t supply_avdd_pll_erefe; + regulator_t supply_avdd_usb_ss_pll; + regulator_t supply_hvdd_usb_ss; + regulator_t supply_hvdd_usb_ss_pll_e; + phy_t phy_usb2_0; + phy_t phy_usb2_1; + phy_t phy_usb2_2; + phy_t phy_usb3_0; + + struct intr_config_hook irq_hook; + bool xhci_inited; + char *fw_name; + vm_offset_t fw_vaddr; + vm_size_t fw_size; +}; + +static uint32_t +CSB_RD4(struct tegra_xhci_softc *sc, uint32_t addr) +{ + + FPCI_WR4(sc, XUSB_CFG_ARU_C11_CSBRANGE, ARU_C11_CSBRANGE_PAGE(addr)); + return (FPCI_RD4(sc, ARU_C11_CSBRANGE_ADDR(addr))); +} + +static void +CSB_WR4(struct tegra_xhci_softc *sc, uint32_t addr, uint32_t val) +{ + + FPCI_WR4(sc, XUSB_CFG_ARU_C11_CSBRANGE, ARU_C11_CSBRANGE_PAGE(addr)); + FPCI_WR4(sc, ARU_C11_CSBRANGE_ADDR(addr), val); +} + +static int +get_fdt_resources(struct tegra_xhci_softc *sc, phandle_t node) +{ + int rv; + + rv = regulator_get_by_ofw_property(sc->dev, 0, "avddio-pex-supply", + &sc->supply_avddio_pex); + if (rv != 0) { + device_printf(sc->dev, + "Cannot get 'avddio-pex' regulator\n"); + return (ENXIO); + } + rv = regulator_get_by_ofw_property(sc->dev, 0, "dvddio-pex-supply", + &sc->supply_dvddio_pex); + if (rv != 0) { + device_printf(sc->dev, + "Cannot get 'dvddio-pex' regulator\n"); + return (ENXIO); + } + rv = regulator_get_by_ofw_property(sc->dev, 0, "avdd-usb-supply", + &sc->supply_avdd_usb); + if (rv != 0) { + device_printf(sc->dev, + "Cannot get 'avdd-usb' regulator\n"); + return (ENXIO); + } + rv = regulator_get_by_ofw_property(sc->dev, 0, "avdd-pll-utmip-supply", + &sc->supply_avdd_pll_utmip); + if (rv != 0) { + device_printf(sc->dev, + "Cannot get 'avdd-pll-utmip' regulator\n"); + return (ENXIO); + } + rv = regulator_get_by_ofw_property(sc->dev, 0, "avdd-pll-erefe-supply", + &sc->supply_avdd_pll_erefe); + if (rv != 0) { + device_printf(sc->dev, + "Cannot get 'avdd-pll-erefe' regulator\n"); + return (ENXIO); + } + rv = regulator_get_by_ofw_property(sc->dev, 0, "avdd-usb-ss-pll-supply", + &sc->supply_avdd_usb_ss_pll); + if (rv != 0) { + device_printf(sc->dev, + "Cannot get 'avdd-usb-ss-pll' regulator\n"); + return (ENXIO); + } + rv = regulator_get_by_ofw_property(sc->dev, 0, "hvdd-usb-ss-supply", + &sc->supply_hvdd_usb_ss); + if (rv != 0) { + device_printf(sc->dev, + "Cannot get 'hvdd-usb-ss' regulator\n"); + return (ENXIO); + } + rv = regulator_get_by_ofw_property(sc->dev, 0, + "hvdd-usb-ss-pll-e-supply", &sc->supply_hvdd_usb_ss_pll_e); + if (rv != 0) { + device_printf(sc->dev, + "Cannot get 'hvdd-usb-ss-pll-e' regulator\n"); + return (ENXIO); + } + + rv = hwreset_get_by_ofw_name(sc->dev, 0, "xusb_host", + &sc->hwreset_xusb_host); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'xusb_host' reset\n"); + return (ENXIO); + } + rv = hwreset_get_by_ofw_name(sc->dev, 0, "xusb_ss", + &sc->hwreset_xusb_ss); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'xusb_ss' reset\n"); + return (ENXIO); + } + + rv = phy_get_by_ofw_name(sc->dev, 0, "usb2-0", &sc->phy_usb2_0); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'usb2-0' phy\n"); + return (ENXIO); + } + rv = phy_get_by_ofw_name(sc->dev, 0, "usb2-1", &sc->phy_usb2_1); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'usb2-1' phy\n"); + return (ENXIO); + } + rv = phy_get_by_ofw_name(sc->dev, 0, "usb2-2", &sc->phy_usb2_2); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'usb2-2' phy\n"); + return (ENXIO); + } + rv = phy_get_by_ofw_name(sc->dev, 0, "usb3-0", &sc->phy_usb3_0); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'usb3-0' phy\n"); + return (ENXIO); + } + + rv = clk_get_by_ofw_name(sc->dev, 0, "xusb_host", + &sc->clk_xusb_host); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'xusb_host' clock\n"); + return (ENXIO); + } + rv = clk_get_by_ofw_name(sc->dev, 0, "xusb_falcon_src", + &sc->clk_xusb_falcon_src); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'xusb_falcon_src' clock\n"); + return (ENXIO); + } + rv = clk_get_by_ofw_name(sc->dev, 0, "xusb_ss", + &sc->clk_xusb_ss); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'xusb_ss' clock\n"); + return (ENXIO); + } + rv = clk_get_by_ofw_name(sc->dev, 0, "xusb_hs_src", + &sc->clk_xusb_hs_src); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'xusb_hs_src' clock\n"); + return (ENXIO); + } + rv = clk_get_by_ofw_name(sc->dev, 0, "xusb_fs_src", + &sc->clk_xusb_fs_src); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'xusb_fs_src' clock\n"); + return (ENXIO); + } + rv = clk_get_by_ofw_index_prop(sc->dev, 0, "freebsd,clock-xusb-gate", 0, + &sc->clk_xusb_gate); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'xusb_gate' clock\n"); + return (ENXIO); + } + return (0); +} + +static int +enable_fdt_resources(struct tegra_xhci_softc *sc) +{ + int rv; + + rv = hwreset_assert(sc->hwreset_xusb_host); + if (rv != 0) { + device_printf(sc->dev, "Cannot reset 'xusb_host' reset\n"); + return (rv); + } + rv = hwreset_assert(sc->hwreset_xusb_ss); + if (rv != 0) { + device_printf(sc->dev, "Cannot reset 'xusb_ss' reset\n"); + return (rv); + } + + rv = regulator_enable(sc->supply_avddio_pex); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'avddio_pex' regulator\n"); + return (rv); + } + rv = regulator_enable(sc->supply_dvddio_pex); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'dvddio_pex' regulator\n"); + return (rv); + } + rv = regulator_enable(sc->supply_avdd_usb); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'avdd_usb' regulator\n"); + return (rv); + } + rv = regulator_enable(sc->supply_avdd_pll_utmip); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'avdd_pll_utmip-5v' regulator\n"); + return (rv); + } + rv = regulator_enable(sc->supply_avdd_pll_erefe); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'avdd_pll_erefe' regulator\n"); + return (rv); + } + rv = regulator_enable(sc->supply_avdd_usb_ss_pll); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'avdd_usb_ss_pll' regulator\n"); + return (rv); + } + rv = regulator_enable(sc->supply_hvdd_usb_ss); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'hvdd_usb_ss' regulator\n"); + return (rv); + } + rv = regulator_enable(sc->supply_hvdd_usb_ss_pll_e); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'hvdd_usb_ss_pll_e' regulator\n"); + return (rv); + } + + /* Power off XUSB host and XUSB SS domains. */ + rv = tegra_powergate_power_off(TEGRA_POWERGATE_XUSBA); + if (rv != 0) { + device_printf(sc->dev, "Cannot powerdown 'xusba' domain\n"); + return (rv); + } + rv = tegra_powergate_power_off(TEGRA_POWERGATE_XUSBC); + if (rv != 0) { + device_printf(sc->dev, "Cannot powerdown 'xusbc' domain\n"); + return (rv); + } + + /* Setup XUSB ss_src clock first */ + clk_set_freq(sc->clk_xusb_ss, TEGRA_XHCI_SS_HIGH_SPEED, 0); + if (rv != 0) + return (rv); + + /* The XUSB gate clock must be enabled before XUSBA can be powered. */ + rv = clk_enable(sc->clk_xusb_gate); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'xusb_gate' clock\n"); + return (rv); + } + + /* Power on XUSB host and XUSB SS domains. */ + rv = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_XUSBC, + sc->clk_xusb_host, sc->hwreset_xusb_host); + if (rv != 0) { + device_printf(sc->dev, "Cannot powerup 'xusbc' domain\n"); + return (rv); + } + rv = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_XUSBA, + sc->clk_xusb_ss, sc->hwreset_xusb_ss); + if (rv != 0) { + device_printf(sc->dev, "Cannot powerup 'xusba' domain\n"); + return (rv); + } + + /* Enable rest of clocks */ + rv = clk_enable(sc->clk_xusb_falcon_src); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'xusb_falcon_src' clock\n"); + return (rv); + } + rv = clk_enable(sc->clk_xusb_fs_src); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'xusb_fs_src' clock\n"); + return (rv); + } + rv = clk_enable(sc->clk_xusb_hs_src); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'xusb_hs_src' clock\n"); + return (rv); + } + + rv = phy_enable(sc->dev, sc->phy_usb2_0); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable USB2_0 phy\n"); + return (rv); + } + rv = phy_enable(sc->dev, sc->phy_usb2_1); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable USB2_1 phy\n"); + return (rv); + } + rv = phy_enable(sc->dev, sc->phy_usb2_2); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable USB2_2 phy\n"); + return (rv); + } + rv = phy_enable(sc->dev, sc->phy_usb3_0); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable USB3_0 phy\n"); + return (rv); + } + + return (0); +} + +/* Respond by ACK/NAK back to FW */ +static void +mbox_send_ack(struct tegra_xhci_softc *sc, uint32_t cmd, uint32_t data) +{ + uint32_t reg; + + reg = ARU_MAILBOX_DATA_IN_TYPE(cmd) | ARU_MAILBOX_DATA_IN_DATA(data); + FPCI_WR4(sc, T_XUSB_CFG_ARU_MAILBOX_DATA_IN, reg); + + reg = FPCI_RD4(sc, T_XUSB_CFG_ARU_MAILBOX_CMD); + reg |= ARU_MAILBOX_CMD_DEST_FALC | ARU_MAILBOX_CMD_INT_EN; + FPCI_WR4(sc, T_XUSB_CFG_ARU_MAILBOX_CMD, reg); +} + +/* Sent command to FW */ +static int +mbox_send_cmd(struct tegra_xhci_softc *sc, uint32_t cmd, uint32_t data) +{ + uint32_t reg; + int i; + + reg = FPCI_RD4(sc, T_XUSB_CFG_ARU_MAILBOX_OWNER); + if (reg != ARU_MAILBOX_OWNER_NONE) { + device_printf(sc->dev, + "CPU mailbox is busy: 0x%08X\n", reg); + return (EBUSY); + } + /* XXX Is this right? Retry loop? Wait before send? */ + FPCI_WR4(sc, T_XUSB_CFG_ARU_MAILBOX_OWNER, ARU_MAILBOX_OWNER_SW); + reg = FPCI_RD4(sc, T_XUSB_CFG_ARU_MAILBOX_OWNER); + if (reg != ARU_MAILBOX_OWNER_SW) { + device_printf(sc->dev, + "Cannot acquire CPU mailbox: 0x%08X\n", reg); + return (EBUSY); + } + reg = ARU_MAILBOX_DATA_IN_TYPE(cmd) | ARU_MAILBOX_DATA_IN_DATA(data); + FPCI_WR4(sc, T_XUSB_CFG_ARU_MAILBOX_DATA_IN, reg); + + reg = FPCI_RD4(sc, T_XUSB_CFG_ARU_MAILBOX_CMD); + reg |= ARU_MAILBOX_CMD_DEST_FALC | ARU_MAILBOX_CMD_INT_EN; + FPCI_WR4(sc, T_XUSB_CFG_ARU_MAILBOX_CMD, reg); + + for (i = 250; i > 0; i--) { + reg = FPCI_RD4(sc, T_XUSB_CFG_ARU_MAILBOX_OWNER); + if (reg == ARU_MAILBOX_OWNER_NONE) + break; + DELAY(100); + } + if (i <= 0) { + device_printf(sc->dev, + "Command response timeout: 0x%08X\n", reg); + return (ETIMEDOUT); + } + + return(0); +} + +static void +process_msg(struct tegra_xhci_softc *sc, uint32_t req_cmd, uint32_t req_data, + uint32_t *resp_cmd, uint32_t *resp_data) +{ + uint64_t freq; + int rv; + + /* In most cases, data are echoed back. */ + *resp_data = req_data; + switch (req_cmd) { + case MBOX_CMD_INC_FALC_CLOCK: + case MBOX_CMD_DEC_FALC_CLOCK: + rv = clk_set_freq(sc->clk_xusb_falcon_src, req_data * 1000ULL, + 0); + if (rv == 0) { + rv = clk_get_freq(sc->clk_xusb_falcon_src, &freq); + *resp_data = (uint32_t)(freq / 1000); + } + *resp_cmd = rv == 0 ? MBOX_CMD_ACK: MBOX_CMD_NAK; + break; + + case MBOX_CMD_INC_SSPI_CLOCK: + case MBOX_CMD_DEC_SSPI_CLOCK: + rv = clk_set_freq(sc->clk_xusb_ss, req_data * 1000ULL, + 0); + if (rv == 0) { + rv = clk_get_freq(sc->clk_xusb_ss, &freq); + *resp_data = (uint32_t)(freq / 1000); + } + *resp_cmd = rv == 0 ? MBOX_CMD_ACK: MBOX_CMD_NAK; + break; + + case MBOX_CMD_SET_BW: + /* No respense is expected. */ + *resp_cmd = 0; + break; + + case MBOX_CMD_SET_SS_PWR_GATING: + case MBOX_CMD_SET_SS_PWR_UNGATING: + *resp_cmd = MBOX_CMD_NAK; + break; + + case MBOX_CMD_SAVE_DFE_CTLE_CTX: + /* Not implemented yet. */ + *resp_cmd = MBOX_CMD_ACK; + break; + + + case MBOX_CMD_START_HSIC_IDLE: + case MBOX_CMD_STOP_HSIC_IDLE: + /* Not implemented yet. */ + *resp_cmd = MBOX_CMD_NAK; + break; + + case MBOX_CMD_DISABLE_SS_LFPS_DETECTION: + case MBOX_CMD_ENABLE_SS_LFPS_DETECTION: + /* Not implemented yet. */ + *resp_cmd = MBOX_CMD_NAK; + break; + + case MBOX_CMD_AIRPLANE_MODE_ENABLED: + case MBOX_CMD_AIRPLANE_MODE_DISABLED: + case MBOX_CMD_DBC_WAKE_STACK: + case MBOX_CMD_HSIC_PRETEND_CONNECT: + case MBOX_CMD_RESET_SSPI: + device_printf(sc->dev, + "Received unused/unexpected command: %u\n", req_cmd); + *resp_cmd = 0; + break; + + default: + device_printf(sc->dev, + "Received unknown command: %u\n", req_cmd); + } +} + +static void +intr_mbox(void *arg) +{ + struct tegra_xhci_softc *sc; + uint32_t reg, msg, resp_cmd, resp_data; + + sc = (struct tegra_xhci_softc *)arg; + + /* Clear interrupt first */ + reg = FPCI_RD4(sc, XUSB_CFG_ARU_SMI_INTR); + FPCI_WR4(sc, XUSB_CFG_ARU_SMI_INTR, reg); + if (reg & ARU_SMI_INTR_FW_HANG) { + device_printf(sc->dev, + "XUSB CPU firmware hang!!! CPUCTL: 0x%08X\n", + CSB_RD4(sc, XUSB_FALCON_CPUCTL)); + } + + msg = FPCI_RD4(sc, T_XUSB_CFG_ARU_MAILBOX_DATA_OUT); + resp_cmd = 0; + process_msg(sc, ARU_MAILBOX_DATA_OUT_TYPE(msg), + ARU_MAILBOX_DATA_OUT_DATA(msg), &resp_cmd, &resp_data); + if (resp_cmd != 0) + mbox_send_ack(sc, resp_cmd, resp_data); + else + FPCI_WR4(sc, T_XUSB_CFG_ARU_MAILBOX_OWNER, + ARU_MAILBOX_OWNER_NONE); + + reg = FPCI_RD4(sc, T_XUSB_CFG_ARU_MAILBOX_CMD); + reg &= ~ARU_MAILBOX_CMD_DEST_SMI; + FPCI_WR4(sc, T_XUSB_CFG_ARU_MAILBOX_CMD, reg); + +} + +static int +load_fw(struct tegra_xhci_softc *sc) +{ + const struct firmware *fw; + const struct tegra_xusb_fw_hdr *fw_hdr; + vm_paddr_t fw_paddr, fw_base; + vm_offset_t fw_vaddr; + vm_size_t fw_size; + uint32_t code_tags, code_size; + struct clocktime fw_clock; + struct timespec fw_timespec; + int i; + + /* Reset ARU */ + FPCI_WR4(sc, XUSB_CFG_ARU_RST, ARU_RST_RESET); + DELAY(3000); + + /* Check if FALCON already runs */ + if (CSB_RD4(sc, XUSB_CSB_MEMPOOL_ILOAD_BASE_LO) != 0) { + device_printf(sc->dev, + "XUSB CPU is already loaded, CPUCTL: 0x%08X\n", + CSB_RD4(sc, XUSB_FALCON_CPUCTL)); + return (0); + } + + fw = firmware_get(sc->fw_name); + if (fw == NULL) { + device_printf(sc->dev, "Cannot read xusb firmware\n"); + return (ENOENT); + } + + /* Allocate uncached memory and copy firmware into. */ + fw_hdr = (const struct tegra_xusb_fw_hdr *)fw->data; + fw_size = fw_hdr->fwimg_len; + + fw_vaddr = kmem_alloc_contig(kernel_arena, fw_size, + M_WAITOK, 0, -1UL, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); + fw_paddr = vtophys(fw_vaddr); + fw_hdr = (const struct tegra_xusb_fw_hdr *)fw_vaddr; + memcpy((void *)fw_vaddr, fw->data, fw_size); + + firmware_put(fw, FIRMWARE_UNLOAD); + sc->fw_vaddr = fw_vaddr; + sc->fw_size = fw_size; + + /* Setup firmware physical address and size. */ + fw_base = fw_paddr + sizeof(*fw_hdr); + CSB_WR4(sc, XUSB_CSB_MEMPOOL_ILOAD_ATTR, fw_size); + CSB_WR4(sc, XUSB_CSB_MEMPOOL_ILOAD_BASE_LO, fw_base & 0xFFFFFFFF); + CSB_WR4(sc, XUSB_CSB_MEMPOOL_ILOAD_BASE_HI, (uint64_t)fw_base >> 32); + CSB_WR4(sc, XUSB_CSB_MEMPOOL_APMAP, APMAP_BOOTPATH); + + /* Invalidate full L2IMEM context. */ + CSB_WR4(sc, XUSB_CSB_MEMPOOL_L2IMEMOP_TRIG, + L2IMEMOP_INVALIDATE_ALL); + + /* Program load of L2IMEM by boot code. */ + code_tags = howmany(fw_hdr->boot_codetag, XUSB_CSB_IMEM_BLOCK_SIZE); + code_size = howmany(fw_hdr->boot_codesize, XUSB_CSB_IMEM_BLOCK_SIZE); + CSB_WR4(sc, XUSB_CSB_MEMPOOL_L2IMEMOP_SIZE, + L2IMEMOP_SIZE_OFFSET(code_tags) | + L2IMEMOP_SIZE_SIZE(code_size)); + + /* Execute L2IMEM boot code fetch. */ + CSB_WR4(sc, XUSB_CSB_MEMPOOL_L2IMEMOP_TRIG, + L2IMEMOP_LOAD_LOCKED_RESULT); + + /* Program FALCON auto-fill range and block count */ + CSB_WR4(sc, XUSB_FALCON_IMFILLCTL, code_size); + CSB_WR4(sc, XUSB_FALCON_IMFILLRNG1, + IMFILLRNG1_TAG_LO(code_tags) | + IMFILLRNG1_TAG_HI(code_tags + code_size)); + + CSB_WR4(sc, XUSB_FALCON_DMACTL, 0); + /* Wait for CPU */ + for (i = 500; i > 0; i--) { + if (CSB_RD4(sc, XUSB_CSB_MEMPOOL_L2IMEMOP_RESULT) & + L2IMEMOP_RESULT_VLD) + break; + DELAY(100); + } + if (i <= 0) { + device_printf(sc->dev, "Timedout while wating for DMA, " + "state: 0x%08X\n", + CSB_RD4(sc, XUSB_CSB_MEMPOOL_L2IMEMOP_RESULT)); + return (ETIMEDOUT); + } + + /* Boot FALCON cpu */ + CSB_WR4(sc, XUSB_FALCON_BOOTVEC, fw_hdr->boot_codetag); + CSB_WR4(sc, XUSB_FALCON_CPUCTL, CPUCTL_STARTCPU); + + /* Wait for CPU */ + for (i = 50; i > 0; i--) { + if (CSB_RD4(sc, XUSB_FALCON_CPUCTL) == CPUCTL_STOPPED) + break; + DELAY(100); + } + if (i <= 0) { + device_printf(sc->dev, "Timedout while wating for FALCON cpu, " + "state: 0x%08X\n", CSB_RD4(sc, XUSB_FALCON_CPUCTL)); + return (ETIMEDOUT); + } + + fw_timespec.tv_sec = fw_hdr->fwimg_created_time; + fw_timespec.tv_nsec = 0; + clock_ts_to_ct(&fw_timespec, &fw_clock); + device_printf(sc->dev, + " Falcon firmware version: %02X.%02X.%04X," + " (%d/%d/%d %d:%02d:%02d UTC)\n", + (fw_hdr->version_id >> 24) & 0xFF,(fw_hdr->version_id >> 15) & 0xFF, + fw_hdr->version_id & 0xFFFF, + fw_clock.day, fw_clock.mon, fw_clock.year, + fw_clock.hour, fw_clock.min, fw_clock.sec); + + return (0); +} + +static int +init_hw(struct tegra_xhci_softc *sc) +{ + int rv; + uint32_t reg; + rman_res_t base_addr; + + base_addr = rman_get_start(sc->xhci_softc.sc_io_res); + + /* Enable FPCI access */ + reg = IPFS_RD4(sc, XUSB_HOST_CONFIGURATION); + reg |= CONFIGURATION_EN_FPCI; + IPFS_WR4(sc, XUSB_HOST_CONFIGURATION, reg); + IPFS_RD4(sc, XUSB_HOST_CONFIGURATION); + + + /* Program bar for XHCI base address */ + reg = FPCI_RD4(sc, T_XUSB_CFG_4); + reg &= ~CFG_4_BASE_ADDRESS(~0); + reg |= CFG_4_BASE_ADDRESS((uint32_t)base_addr >> 15); + FPCI_WR4(sc, T_XUSB_CFG_4, reg); + FPCI_WR4(sc, T_XUSB_CFG_5, (uint32_t)((uint64_t)(base_addr) >> 32)); + + /* Enable bus master */ + reg = FPCI_RD4(sc, T_XUSB_CFG_1); + reg |= CFG_1_IO_SPACE; + reg |= CFG_1_MEMORY_SPACE; + reg |= CFG_1_BUS_MASTER; + FPCI_WR4(sc, T_XUSB_CFG_1, reg); + + /* Enable Interrupts */ + reg = IPFS_RD4(sc, XUSB_HOST_INTR_MASK); + reg |= INTR_IP_INT_MASK; + IPFS_WR4(sc, XUSB_HOST_INTR_MASK, reg); + + /* Set hysteresis */ + IPFS_WR4(sc, XUSB_HOST_CLKGATE_HYSTERESIS, 128); + + rv = load_fw(sc); + if (rv != 0) + return rv; + return (0); +} + +static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Nov 7 06:07:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D28BC34FB6 for ; Mon, 7 Nov 2016 06:07:24 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x233.google.com (mail-yw0-x233.google.com [IPv6:2607:f8b0:4002:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B323C00 for ; Mon, 7 Nov 2016 06:07:24 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x233.google.com with SMTP id t125so125924300ywc.1 for ; Sun, 06 Nov 2016 22:07:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=9ocaSwvPJhirSvoUoDwF96cUWYrX78SgRXEdJzvkj7o=; b=l/Ml5RAwV6xYcC8ji9NXqUGvHJyz2hMsrqsOkP0/Nz1Y2qlM45oIIx/bJbhnBKdm5c rTU7EcgykHyUIBEljl+sZt63cSeoHVec9ssBWm58hEyi3GyCiqmxmeWvwxMP5p92pXoN EYH+PffhbwuXOSlL5RwpxbEwkvWfqD8Na04BLM74J7uKtoVjzz+qdyNyPEC6eCuOdyGA CV93Tli0ZJmHpaCg9puqwQPBZx1Efg8A9N2kKPsGlc8q0u6xIJ5vv/pJMqByNAtRpk8U w+iCn7hkX3yURwI1+VNhbaLDWB284wrIQTMaEzuRV1PQ8ok5Mwumqpl4lcyKxzTENhce 6+bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=9ocaSwvPJhirSvoUoDwF96cUWYrX78SgRXEdJzvkj7o=; b=ZGxZfwbljw2itkcFc9m9xtkhP0jdpC6aDT/Fry4uOZvAh2zqEedK7nVtHMIJPUYY+6 lz12+V8j05pj85x5GhuJAvyZXo5uR/D28XkX3KqRV+YSRZvY+MFQbJ/WsHWeinrap0yo fsoZdxq+uON/H77PiP2TJULMQ3O2UF9TA3t38gGny4oEKvjTG8bNhkEXKhHgIJvvGpwk 3yfhHOmzTfoLytlczPmjzWnEM8vdHj/XI6Zs7hM2rWuXfsTxk+DmU1KvpUjAzVL9b/W1 Vo8sudVbKjvA0nTqwvpS2vxSQOBAalOEEhI0+RyDSl+lePNfAhwuSafsrF7CLKsKF5wG S0jw== X-Gm-Message-State: ABUngvcVaxrPg+zRv8hOGe2M7MEfy0fSxl9aagIE2mpHl8jEKFCZX5UmSxobrQixx7PEflaJQk5n+NkRkkvZXA== X-Received: by 10.13.196.67 with SMTP id g64mr4065555ywd.138.1478498843291; Sun, 06 Nov 2016 22:07:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.31.213 with HTTP; Sun, 6 Nov 2016 22:06:52 -0800 (PST) In-Reply-To: <4F77ED5A-6B71-4AA5-BEC9-752A8BA349CE@bigpond.net.au> References: <4F77ED5A-6B71-4AA5-BEC9-752A8BA349CE@bigpond.net.au> From: Ed Schouten Date: Mon, 7 Nov 2016 07:06:52 +0100 Message-ID: Subject: Re: svn commit: r307227 - in head: include lib/libc/stdlib lib/libc/tests/stdlib To: Andrew Reilly Cc: svn-src-head@freebsd.org, "ed@FreeBSD.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 06:07:24 -0000 Hi Andrew, 2016-11-07 0:54 GMT+01:00 Andrew Reilly : > Thanks for pointing me back to src.conf. I added this when I was an =E2= =80=9Cearly adopter=E2=80=9D of clang, and it was necessary. I suspect tha= t now that we are all-clang all the time, this is redundant. Would this ha= ve overridden the system build process? > > my /etc/src.conf: > CC=3Dclang > CXX=3Dclang++ > CPP=3Dclang-cpp > WITH_LIBCPLUSPLUS=3Dyes That may very likely be the culprit, as it probably means you used the compiler binary of the host installation that uses /usr/include as its include path. Thanks for confirming! --=20 Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Mon Nov 7 06:22:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54EEEC332E5; Mon, 7 Nov 2016 06:22:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E1E227E; Mon, 7 Nov 2016 06:22:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id D4E7310A718; Mon, 7 Nov 2016 01:22:18 -0500 (EST) From: John Baldwin To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308345 - head/sys/dev/e1000 Date: Sat, 05 Nov 2016 16:16:58 -0700 Message-ID: <15572642.JMvQo5TC3D@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201611051630.uA5GUhtk073581@repo.freebsd.org> References: <201611051630.uA5GUhtk073581@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 07 Nov 2016 01:22:18 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 06:22:28 -0000 On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote: > Author: sbruno > Date: Sat Nov 5 16:30:42 2016 > New Revision: 308345 > URL: https://svnweb.freebsd.org/changeset/base/308345 > > Log: > r295133 attempted to deactivate TSO in the 100Mbit link case with this > adapter to work around bugs in TSO handling at this speed. > > em_init_locked is called during first boot of the adapter and will > see that link_speed is unitialized, effectively turning off tso for > all cards at all speeds, which I believe was *not* the intent. > > Move the handling of TSO deactivation to the link handler where we can > more effectively make the decision about what to do. In addition, > completely purge the TSO capabilities instead of disabling just CSUM_TSO. > > Thanks to jhb for explanation of the hw capabilites api. > > Thanks to royger and cognet for testing the 100Mbit failure case to > ensure that their adapters do indeed still work. > > MFC after: 1 week > Sponsored by: Limelight Networks > > Modified: > head/sys/dev/e1000/if_em.c > > Modified: head/sys/dev/e1000/if_em.c > ============================================================================== > --- head/sys/dev/e1000/if_em.c Sat Nov 5 16:23:33 2016 (r308344) > +++ head/sys/dev/e1000/if_em.c Sat Nov 5 16:30:42 2016 (r308345) > @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1); > #define MAX_INTS_PER_SEC 8000 > #define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) > > -/* Allow common code without TSO */ > -#ifndef CSUM_TSO > -#define CSUM_TSO 0 > -#endif > - > #define TSO_WORKAROUND 4 > > static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver parameters"); > @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter) > if_clearhwassist(ifp); > if (if_getcapenable(ifp) & IFCAP_TXCSUM) > if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0); > - /* > - ** There have proven to be problems with TSO when not > - ** at full gigabit speed, so disable the assist automatically > - ** when at lower speeds. -jfv > - */ > - if (if_getcapenable(ifp) & IFCAP_TSO4) { > - if (adapter->link_speed == SPEED_1000) > - if_sethwassistbits(ifp, CSUM_TSO, 0); > - } > + > + if (if_getcapenable(ifp) & IFCAP_TSO4) > + if_sethwassistbits(ifp, CSUM_TSO, 0); Does this always disable TSO? Should this part be removed entirely? (That is, it seems like this would disable TSO even on Gigabit links). > /* Configure for OS presence */ > em_init_manageability(adapter); > @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad > if (link_check && (adapter->link_active == 0)) { > e1000_get_speed_and_duplex(hw, &adapter->link_speed, > &adapter->link_duplex); > + /* > + ** There have proven to be problems with TSO when not > + ** at full gigabit speed, so disable the assist automatically > + ** when at lower speeds. -jfv > + */ > + if (adapter->link_speed != SPEED_1000) { > + if_sethwassistbits(ifp, 0, CSUM_TSO); > + if_setcapenablebit(ifp, 0, IFCAP_TSO4); > + if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4); > + > + } Even though I suggested it, I wonder if it wouldn't be better to only modify if_capenable and not if_capabilities, that way the admin can decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving an adapter from 100 to 1G). -- John Baldwin From owner-svn-src-head@freebsd.org Mon Nov 7 06:37:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99221C337CB; Mon, 7 Nov 2016 06:37:45 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x22e.google.com (mail-ua0-x22e.google.com [IPv6:2607:f8b0:400c:c08::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E87EBB1; Mon, 7 Nov 2016 06:37:45 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x22e.google.com with SMTP id 20so111960323uak.0; Sun, 06 Nov 2016 22:37:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sFPcs9wAlicYRZ5Wj75V2abdBy28rH+nOQlcyk/2y8A=; b=h4q+atGpXcSrM0OXjNGX195fLc2TDyP+Fm8ITeqf+fhODOjyzZ+FxdEbJNZPuK7dBr s+WsnCIocEMNZ/VdPnv76gIJuBncM/gS3Jsw9Zbs7h4ufqxRQT5I1aPRddk7CQV3PgYN 1x422FNJCz2zrMR9xzdiYXy2PmDaA7Q8uMKZO7+Xi6A6BgPbFLMSg7l2UvrtTG5KAmS/ zAHT8EZTOg2xUo8DegE17a3fYyGIpYDeacLX75YifgvsxdMf5C958Nqx6c0PoK45IM1G IebXk4tcEpQ3ZIXtL14tEEIWDMeHpYkAv47Ck+Qx25tU0TuQGzQ+DneXqhyoS5lfyJcw 5WFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sFPcs9wAlicYRZ5Wj75V2abdBy28rH+nOQlcyk/2y8A=; b=TyoqYfFFjUxhVEfmnTKLqGeHABsxV97PFoWyDY0eAjXHdE9zrayxbEzmqOPLOgynBK un1UgHiP3porogQ2dMuQQ8H5QrQNolmJB0cOOKe4oM2jM2XDwmS7l6jx2kiGcdLqRTHW Xhc/lsSc3+g972Njt4UeOVgq+GbfkGD8sMBJCQNHZqWCxoz3pW9cQVGl/KwJdzVII+So B5giARDFN+Cd+6AhJHUMDk2lWkVAPebWuE/7nwWfGAT7oahkpNV5yoxi83y3C2/7DzLF ZH5exsq5AGOdjgTBlxDQJkFkXi6jB92HFMgVRrpfoLFn8nqdLxSFI3S5TS4FprMTXyA4 Kr3Q== X-Gm-Message-State: ABUngvdt7jUC+81apvnNhg8934kfutQQHLeWssEZU+L9bOQIhCv6vx4YlGN2O6GCxfywdZXZR03kC/q56nzLXA== X-Received: by 10.176.68.103 with SMTP id m94mr2925531uam.75.1478500664140; Sun, 06 Nov 2016 22:37:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.36.247 with HTTP; Sun, 6 Nov 2016 22:37:43 -0800 (PST) In-Reply-To: <15572642.JMvQo5TC3D@ralph.baldwin.cx> References: <201611051630.uA5GUhtk073581@repo.freebsd.org> <15572642.JMvQo5TC3D@ralph.baldwin.cx> From: Sepherosa Ziehau Date: Mon, 7 Nov 2016 14:37:43 +0800 Message-ID: Subject: Re: svn commit: r308345 - head/sys/dev/e1000 To: John Baldwin Cc: Sean Bruno , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 06:37:45 -0000 On Sun, Nov 6, 2016 at 7:16 AM, John Baldwin wrote: > On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote: >> Author: sbruno >> Date: Sat Nov 5 16:30:42 2016 >> New Revision: 308345 >> URL: https://svnweb.freebsd.org/changeset/base/308345 >> >> Log: >> r295133 attempted to deactivate TSO in the 100Mbit link case with this >> adapter to work around bugs in TSO handling at this speed. >> >> em_init_locked is called during first boot of the adapter and will >> see that link_speed is unitialized, effectively turning off tso for >> all cards at all speeds, which I believe was *not* the intent. >> >> Move the handling of TSO deactivation to the link handler where we can >> more effectively make the decision about what to do. In addition, >> completely purge the TSO capabilities instead of disabling just CSUM_TSO. >> >> Thanks to jhb for explanation of the hw capabilites api. >> >> Thanks to royger and cognet for testing the 100Mbit failure case to >> ensure that their adapters do indeed still work. >> >> MFC after: 1 week >> Sponsored by: Limelight Networks >> >> Modified: >> head/sys/dev/e1000/if_em.c >> >> Modified: head/sys/dev/e1000/if_em.c >> ============================================================================== >> --- head/sys/dev/e1000/if_em.c Sat Nov 5 16:23:33 2016 (r308344) >> +++ head/sys/dev/e1000/if_em.c Sat Nov 5 16:30:42 2016 (r308345) >> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1); >> #define MAX_INTS_PER_SEC 8000 >> #define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) >> >> -/* Allow common code without TSO */ >> -#ifndef CSUM_TSO >> -#define CSUM_TSO 0 >> -#endif >> - >> #define TSO_WORKAROUND 4 >> >> static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver parameters"); >> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter) >> if_clearhwassist(ifp); >> if (if_getcapenable(ifp) & IFCAP_TXCSUM) >> if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0); >> - /* >> - ** There have proven to be problems with TSO when not >> - ** at full gigabit speed, so disable the assist automatically >> - ** when at lower speeds. -jfv >> - */ >> - if (if_getcapenable(ifp) & IFCAP_TSO4) { >> - if (adapter->link_speed == SPEED_1000) >> - if_sethwassistbits(ifp, CSUM_TSO, 0); >> - } >> + >> + if (if_getcapenable(ifp) & IFCAP_TSO4) >> + if_sethwassistbits(ifp, CSUM_TSO, 0); > > Does this always disable TSO? Should this part be removed entirely? > (That is, it seems like this would disable TSO even on Gigabit links). > >> /* Configure for OS presence */ >> em_init_manageability(adapter); >> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad >> if (link_check && (adapter->link_active == 0)) { >> e1000_get_speed_and_duplex(hw, &adapter->link_speed, >> &adapter->link_duplex); >> + /* >> + ** There have proven to be problems with TSO when not >> + ** at full gigabit speed, so disable the assist automatically >> + ** when at lower speeds. -jfv >> + */ >> + if (adapter->link_speed != SPEED_1000) { >> + if_sethwassistbits(ifp, 0, CSUM_TSO); >> + if_setcapenablebit(ifp, 0, IFCAP_TSO4); >> + if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4); >> + >> + } > > Even though I suggested it, I wonder if it wouldn't be better to only > modify if_capenable and not if_capabilities, that way the admin can > decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving > an adapter from 100 to 1G). I believe simply clearing CSUM_TSO should work for the TCP stack; messing administrative like capenable and hwcaps does not sound correct to me. As for this patch, do you need to re-enable TSO once link speed becomes 1000Mbps? BTW, since the link status check/update is async w/ the TX path, does this really work, if there are TSO packets pending on the TX rings (let alone inflight TSO packets from the TCP stack) when the link speed changed to 100Mbps? Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Mon Nov 7 10:26:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2907C33114; Mon, 7 Nov 2016 10:26:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2D3BDFF; Mon, 7 Nov 2016 10:26:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7AQiAh075151; Mon, 7 Nov 2016 10:26:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7AQitq075149; Mon, 7 Nov 2016 10:26:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611071026.uA7AQitq075149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 7 Nov 2016 10:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308405 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 10:26:46 -0000 Author: andrew Date: Mon Nov 7 10:26:44 2016 New Revision: 308405 URL: https://svnweb.freebsd.org/changeset/base/308405 Log: Start to deorbit the kernel configs in GENERIC by marking them with NO_UNIVERSE. This stops them from being built with the universe, tinderbox, and related targets. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/conf/ALLWINNER head/sys/arm/conf/RPI2 Modified: head/sys/arm/conf/ALLWINNER ============================================================================== --- head/sys/arm/conf/ALLWINNER Mon Nov 7 09:27:05 2016 (r308404) +++ head/sys/arm/conf/ALLWINNER Mon Nov 7 10:26:44 2016 (r308405) @@ -18,6 +18,8 @@ # in NOTES. # # $FreeBSD$ +# +#NO_UNIVERSE ident ALLWINNER Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Mon Nov 7 09:27:05 2016 (r308404) +++ head/sys/arm/conf/RPI2 Mon Nov 7 10:26:44 2016 (r308405) @@ -17,6 +17,8 @@ # in NOTES. # # $FreeBSD$ +# +#NO_UNIVERSE ident RPI2 From owner-svn-src-head@freebsd.org Mon Nov 7 10:54:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB455C33A42; Mon, 7 Nov 2016 10:54:57 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA56FFA2; Mon, 7 Nov 2016 10:54:57 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7AsuZb086623; Mon, 7 Nov 2016 10:54:56 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7Asu3V086622; Mon, 7 Nov 2016 10:54:56 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201611071054.uA7Asu3V086622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Mon, 7 Nov 2016 10:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308406 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 10:54:58 -0000 Author: sgalabov Date: Mon Nov 7 10:54:56 2016 New Revision: 308406 URL: https://svnweb.freebsd.org/changeset/base/308406 Log: Only include sys/boot.h if LINUX_BOOT_ABI is defined Only include sys/boot.h if LINUX_BOOT_ABI is defined in sys/arm/arm/machdep.c Not doing this prevents kernels that do not define LINUX_BOOT_ABI from being build with gcc (at least 4.2.1). Reviewed by: mmel Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D8459 Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon Nov 7 10:26:44 2016 (r308405) +++ head/sys/arm/arm/machdep.c Mon Nov 7 10:54:56 2016 (r308406) @@ -76,7 +76,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#if defined(LINUX_BOOT_ABI) #include +#endif #include #include #include From owner-svn-src-head@freebsd.org Mon Nov 7 10:55:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A707C33ABC; Mon, 7 Nov 2016 10:55:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6EFC19F; Mon, 7 Nov 2016 10:55:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7AtvvU086722; Mon, 7 Nov 2016 10:55:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7AtvCD086721; Mon, 7 Nov 2016 10:55:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201611071055.uA7AtvCD086721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Nov 2016 10:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308407 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 10:55:58 -0000 Author: kib Date: Mon Nov 7 10:55:56 2016 New Revision: 308407 URL: https://svnweb.freebsd.org/changeset/base/308407 Log: vn_fullpath1() checked VV_ROOT and then unreferenced vp->v_mount->mnt_vnodecovered unlocked. This allowed unmount to race. Lock vnode after we noticed the VV_ROOT flag. See comments for explanation why unlocked check for the flag is considered safe. Reported and tested by: avg Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Nov 7 10:54:56 2016 (r308406) +++ head/sys/kern/vfs_cache.c Mon Nov 7 10:55:56 2016 (r308407) @@ -2245,17 +2245,35 @@ vn_fullpath1(struct thread *td, struct v slash_prefixed = 1; } while (vp != rdir && vp != rootvnode) { - if (vp->v_vflag & VV_ROOT) { - if (vp->v_iflag & VI_DOOMED) { /* forced unmount */ - vrele(vp); + /* + * The vp vnode must be already fully constructed, + * since it is either found in namecache or obtained + * from VOP_VPTOCNP(). We may test for VV_ROOT safely + * without obtaining the vnode lock. + */ + if ((vp->v_vflag & VV_ROOT) != 0) { + vn_lock(vp, LK_RETRY | LK_SHARED); + + /* + * With the vnode locked, check for races with + * unmount, forced or not. Note that we + * already verified that vp is not equal to + * the root vnode, which means that + * mnt_vnodecovered can be NULL only for the + * case of unmount. + */ + if ((vp->v_iflag & VI_DOOMED) != 0 || + (vp1 = vp->v_mount->mnt_vnodecovered) == NULL || + vp1->v_mountedhere != vp->v_mount) { + vput(vp); error = ENOENT; SDT_PROBE3(vfs, namecache, fullpath, return, error, vp, NULL); break; } - vp1 = vp->v_mount->mnt_vnodecovered; + vref(vp1); - vrele(vp); + vput(vp); vp = vp1; continue; } From owner-svn-src-head@freebsd.org Mon Nov 7 11:01:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7370AC33D73; Mon, 7 Nov 2016 11:01:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B9627B3; Mon, 7 Nov 2016 11:01:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7B1A1L089196; Mon, 7 Nov 2016 11:01:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7B19js089174; Mon, 7 Nov 2016 11:01:09 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611071101.uA7B19js089174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 7 Nov 2016 11:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308408 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 11:01:11 -0000 Author: andrew Date: Mon Nov 7 11:01:09 2016 New Revision: 308408 URL: https://svnweb.freebsd.org/changeset/base/308408 Log: Include machine/armreg.h after machine/asm.h to ensure __ARM_ARCH is defined. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/cpufunc_asm_sheeva.S head/sys/arm/arm/cpufunc_asm_xscale.S head/sys/arm/arm/cpufunc_asm_xscale_c3.S head/sys/arm/arm/fiq_subr.S head/sys/arm/arm/setstack.s Modified: head/sys/arm/arm/cpufunc_asm_sheeva.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_sheeva.S Mon Nov 7 10:55:56 2016 (r308407) +++ head/sys/arm/arm/cpufunc_asm_sheeva.S Mon Nov 7 11:01:09 2016 (r308408) @@ -29,10 +29,10 @@ * SUCH DAMAGE. */ -#include #include __FBSDID("$FreeBSD$"); +#include #include .Lsheeva_cache_line_size: Modified: head/sys/arm/arm/cpufunc_asm_xscale.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_xscale.S Mon Nov 7 10:55:56 2016 (r308407) +++ head/sys/arm/arm/cpufunc_asm_xscale.S Mon Nov 7 11:01:09 2016 (r308408) @@ -71,10 +71,11 @@ * * XScale assembly functions for CPU / MMU / TLB specific operations */ -#include #include __FBSDID("$FreeBSD$"); +#include + /* * Size of the XScale core D-cache. */ Modified: head/sys/arm/arm/cpufunc_asm_xscale_c3.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_xscale_c3.S Mon Nov 7 10:55:56 2016 (r308407) +++ head/sys/arm/arm/cpufunc_asm_xscale_c3.S Mon Nov 7 11:01:09 2016 (r308408) @@ -73,10 +73,11 @@ * XScale core 3 assembly functions for CPU / MMU / TLB specific operations */ -#include #include __FBSDID("$FreeBSD$"); +#include + /* * Size of the XScale core D-cache. */ Modified: head/sys/arm/arm/fiq_subr.S ============================================================================== --- head/sys/arm/arm/fiq_subr.S Mon Nov 7 10:55:56 2016 (r308407) +++ head/sys/arm/arm/fiq_subr.S Mon Nov 7 11:01:09 2016 (r308408) @@ -37,10 +37,11 @@ */ -#include #include __FBSDID("$FreeBSD$"); +#include + /* * MODE_CHANGE_NOP should be inserted between a mode change and a * banked register (R8--R15) access. Modified: head/sys/arm/arm/setstack.s ============================================================================== --- head/sys/arm/arm/setstack.s Mon Nov 7 10:55:56 2016 (r308407) +++ head/sys/arm/arm/setstack.s Mon Nov 7 11:01:09 2016 (r308408) @@ -48,10 +48,11 @@ * */ -#include #include __FBSDID("$FreeBSD$"); +#include + /* To set the stack pointer for a particular mode we must switch * to that mode update the banked r13 and then switch back. * This routine provides an easy way of doing this for any mode From owner-svn-src-head@freebsd.org Mon Nov 7 11:15:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC714C34452; Mon, 7 Nov 2016 11:15:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE10116E; Mon, 7 Nov 2016 11:15:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7BFetV095037; Mon, 7 Nov 2016 11:15:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7BFe9O095036; Mon, 7 Nov 2016 11:15:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611071115.uA7BFe9O095036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Nov 2016 11:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308409 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 11:15:42 -0000 Author: hselasky Date: Mon Nov 7 11:15:40 2016 New Revision: 308409 URL: https://svnweb.freebsd.org/changeset/base/308409 Log: When a firmware command times out do not free the command structure to avoid use after free. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Nov 7 11:01:09 2016 (r308408) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Mon Nov 7 11:15:40 2016 (r308409) @@ -1245,8 +1245,11 @@ static int cmd_exec_helper(struct mlx5_c err = mlx5_cmd_invoke(dev, inb, outb, out, out_size, callback, context, pages_queue, &status); - if (err) + if (err) { + if (err == -ETIMEDOUT) + return err; goto out_out; + } mlx5_core_dbg(dev, "err %d, status %d\n", err, status); if (status) { From owner-svn-src-head@freebsd.org Mon Nov 7 11:20:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA7F6C3461D; Mon, 7 Nov 2016 11:20:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6BB6760; Mon, 7 Nov 2016 11:20:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7BKDLH095288; Mon, 7 Nov 2016 11:20:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7BKD7n095287; Mon, 7 Nov 2016 11:20:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611071120.uA7BKD7n095287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Nov 2016 11:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308411 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 11:20:15 -0000 Author: hselasky Date: Mon Nov 7 11:20:13 2016 New Revision: 308411 URL: https://svnweb.freebsd.org/changeset/base/308411 Log: Ensure the firmware is notified of any host memory allocation failures. Else firmware commands may time out waiting for host memory. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Nov 7 11:16:23 2016 (r308410) +++ head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Mon Nov 7 11:20:13 2016 (r308411) @@ -246,13 +246,14 @@ static int give_pages(struct mlx5_core_d int inlen; u64 addr; int err; - int i; + int i = 0; inlen = sizeof(*in) + npages * sizeof(in->pas[0]); in = mlx5_vzalloc(inlen); if (!in) { mlx5_core_warn(dev, "vzalloc failed %d\n", inlen); - return -ENOMEM; + err = -ENOMEM; + goto out_alloc; } memset(&out, 0, sizeof(out)); @@ -263,7 +264,7 @@ retry: if (err == -ENOMEM) err = alloc_system_page(dev, func_id); if (err) - goto out_4k; + goto out_alloc; goto retry; } @@ -301,12 +302,11 @@ out_alloc: memset(&out, 0, sizeof(out)); nin->hdr.opcode = cpu_to_be16(MLX5_CMD_OP_MANAGE_PAGES); nin->hdr.opmod = cpu_to_be16(MLX5_PAGES_CANT_GIVE); + nin->func_id = cpu_to_be16(func_id); if (mlx5_cmd_exec(dev, nin, sizeof(*nin), &out, sizeof(out))) mlx5_core_warn(dev, "page notify failed\n"); kfree(nin); } - -out_4k: for (i--; i >= 0; i--) free_4k(dev, be64_to_cpu(in->pas[i])); out_free: From owner-svn-src-head@freebsd.org Mon Nov 7 11:22:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0D73C347E6; Mon, 7 Nov 2016 11:22:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFE02B37; Mon, 7 Nov 2016 11:22:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7BMoLD098755; Mon, 7 Nov 2016 11:22:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7BMote098754; Mon, 7 Nov 2016 11:22:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611071122.uA7BMote098754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Nov 2016 11:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308412 - head/sys/dev/mlx5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 11:22:52 -0000 Author: hselasky Date: Mon Nov 7 11:22:50 2016 New Revision: 308412 URL: https://svnweb.freebsd.org/changeset/base/308412 Log: Correct checksum fields in the "mlx5_mini_cqe8" structure. The fields in question are currently not used. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/device.h Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Mon Nov 7 11:20:13 2016 (r308411) +++ head/sys/dev/mlx5/device.h Mon Nov 7 11:22:50 2016 (r308412) @@ -1348,15 +1348,16 @@ struct mlx5_ifc_mcia_reg_bits { struct mlx5_mini_cqe8 { union { - u32 rx_hash_result; - u32 checksum; + __be32 rx_hash_result; + __be16 checksum; + __be16 rsvd; struct { - u16 wqe_counter; + __be16 wqe_counter; u8 s_wqe_opcode; u8 reserved; } s_wqe_info; }; - u32 byte_cnt; + __be32 byte_cnt; }; enum { From owner-svn-src-head@freebsd.org Mon Nov 7 11:26:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18F3CC3494E; Mon, 7 Nov 2016 11:26:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEDAFEC7; Mon, 7 Nov 2016 11:26:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7BQQwl099207; Mon, 7 Nov 2016 11:26:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7BQQBC099206; Mon, 7 Nov 2016 11:26:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611071126.uA7BQQBC099206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Nov 2016 11:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308413 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 11:26:27 -0000 Author: hselasky Date: Mon Nov 7 11:26:25 2016 New Revision: 308413 URL: https://svnweb.freebsd.org/changeset/base/308413 Log: Query flow table capabilities according to the correct capability bit for infiniband. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Mon Nov 7 11:22:50 2016 (r308412) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Mon Nov 7 11:26:25 2016 (r308413) @@ -167,7 +167,11 @@ int mlx5_query_hca_caps(struct mlx5_core return err; } - if (MLX5_CAP_GEN(dev, nic_flow_table)) { + if ((MLX5_CAP_GEN(dev, port_type) == + MLX5_CMD_HCA_CAP_PORT_TYPE_ETHERNET && + MLX5_CAP_GEN(dev, nic_flow_table)) || + (MLX5_CAP_GEN(dev, port_type) == MLX5_CMD_HCA_CAP_PORT_TYPE_IB && + MLX5_CAP_GEN(dev, ipoib_enhanced_offloads))) { err = mlx5_core_get_caps(dev, MLX5_CAP_FLOW_TABLE, HCA_CAP_OPMOD_GET_CUR); if (err) From owner-svn-src-head@freebsd.org Mon Nov 7 11:28:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C05CC349D2; Mon, 7 Nov 2016 11:28:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D562AD; Mon, 7 Nov 2016 11:28:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7BSpMM099333; Mon, 7 Nov 2016 11:28:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7BSpi1099328; Mon, 7 Nov 2016 11:28:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611071128.uA7BSpi1099328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Nov 2016 11:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308414 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 11:28:52 -0000 Author: hselasky Date: Mon Nov 7 11:28:50 2016 New Revision: 308414 URL: https://svnweb.freebsd.org/changeset/base/308414 Log: Add more firmware related structures and update existing ones in the MLX5 core module. Update the set and query diagnostics counter API. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_port.c head/sys/dev/mlx5/mlx5_ifc.h head/sys/dev/mlx5/qp.h Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Mon Nov 7 11:26:25 2016 (r308413) +++ head/sys/dev/mlx5/device.h Mon Nov 7 11:28:50 2016 (r308414) @@ -1271,9 +1271,11 @@ enum { MLX5_RFC_2819_COUNTERS_GROUP = 0x2, MLX5_RFC_3635_COUNTERS_GROUP = 0x3, MLX5_ETHERNET_EXTENDED_COUNTERS_GROUP = 0x5, + MLX5_ETHERNET_DISCARD_COUNTERS_GROUP = 0x6, MLX5_PER_PRIORITY_COUNTERS_GROUP = 0x10, MLX5_PER_TRAFFIC_CLASS_COUNTERS_GROUP = 0x11, MLX5_PHYSICAL_LAYER_COUNTERS_GROUP = 0x12, + MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20, }; enum { Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Mon Nov 7 11:26:25 2016 (r308413) +++ head/sys/dev/mlx5/driver.h Mon Nov 7 11:28:50 2016 (r308414) @@ -120,6 +120,7 @@ enum { MLX5_REG_QETCR = 0x4005, MLX5_REG_QPDP = 0x4007, MLX5_REG_QTCT = 0x400A, + MLX5_REG_QHLL = 0x4016, MLX5_REG_DCBX_PARAM = 0x4020, MLX5_REG_DCBX_APP = 0x4021, MLX5_REG_PCAP = 0x5001, @@ -954,9 +955,11 @@ int mlx5_modify_port_cong_params(struct void *in, int in_size); int mlx5_query_port_cong_statistics(struct mlx5_core_dev *mdev, int clear, void *out, int out_size); -int mlx5_set_diagnostics(struct mlx5_core_dev *mdev, void *in, int in_size); -int mlx5_query_diagnostics(struct mlx5_core_dev *mdev, u8 num_of_samples, - u16 sample_index, void *out, int out_size); +int mlx5_set_diagnostic_params(struct mlx5_core_dev *mdev, void *in, + int in_size); +int mlx5_query_diagnostic_counters(struct mlx5_core_dev *mdev, + u8 num_of_samples, u16 sample_index, + void *out, int out_size); static inline u32 mlx5_mkey_to_idx(u32 mkey) { return mkey >> 8; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Nov 7 11:26:25 2016 (r308413) +++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Nov 7 11:28:50 2016 (r308414) @@ -831,28 +831,32 @@ int mlx5_query_port_cong_statistics(stru out, out_size); } -int mlx5_set_diagnostics(struct mlx5_core_dev *mdev, void *in, int in_size) +int mlx5_set_diagnostic_params(struct mlx5_core_dev *mdev, void *in, + int in_size) { - u32 out[MLX5_ST_SZ_DW(set_diagnostics_out)]; + u32 out[MLX5_ST_SZ_DW(set_diagnostic_params_out)]; memset(out, 0, sizeof(out)); - MLX5_SET(set_diagnostics_in, in, opcode, MLX5_CMD_OP_SET_DIAGNOSTICS); + MLX5_SET(set_diagnostic_params_in, in, opcode, + MLX5_CMD_OP_SET_DIAGNOSTICS); return mlx5_cmd_exec_check_status(mdev, in, in_size, out, sizeof(out)); } -int mlx5_query_diagnostics(struct mlx5_core_dev *mdev, u8 num_of_samples, - u16 sample_index, void *out, int out_size) +int mlx5_query_diagnostic_counters(struct mlx5_core_dev *mdev, + u8 num_of_samples, u16 sample_index, + void *out, int out_size) { - u32 in[MLX5_ST_SZ_DW(query_diagnostics_in)]; + u32 in[MLX5_ST_SZ_DW(query_diagnostic_counters_in)]; memset(in, 0, sizeof(in)); - MLX5_SET(query_diagnostics_in, in, opcode, + MLX5_SET(query_diagnostic_counters_in, in, opcode, MLX5_CMD_OP_QUERY_DIAGNOSTICS); - MLX5_SET(query_diagnostics_in, in, num_of_samples, num_of_samples); - MLX5_SET(query_diagnostics_in, in, sample_index, sample_index); + MLX5_SET(query_diagnostic_counters_in, in, num_of_samples, + num_of_samples); + MLX5_SET(query_diagnostic_counters_in, in, sample_index, sample_index); return mlx5_cmd_exec_check_status(mdev, in, sizeof(in), out, out_size); } Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Mon Nov 7 11:26:25 2016 (r308413) +++ head/sys/dev/mlx5/mlx5_ifc.h Mon Nov 7 11:28:50 2016 (r308414) @@ -149,6 +149,12 @@ enum { MLX5_CMD_OP_QUERY_Q_COUNTER = 0x773, MLX5_CMD_OP_SET_RATE_LIMIT = 0x780, MLX5_CMD_OP_QUERY_RATE_LIMIT = 0x781, + MLX5_CMD_OP_CREATE_SCHEDULING_ELEMENT = 0x782, + MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT = 0x783, + MLX5_CMD_OP_QUERY_SCHEDULING_ELEMENT = 0x784, + MLX5_CMD_OP_MODIFY_SCHEDULING_ELEMENT = 0x785, + MLX5_CMD_OP_CREATE_QOS_PARA_VPORT = 0x786, + MLX5_CMD_OP_DESTROY_QOS_PARA_VPORT = 0x787, MLX5_CMD_OP_ALLOC_PD = 0x800, MLX5_CMD_OP_DEALLOC_PD = 0x801, MLX5_CMD_OP_ALLOC_UAR = 0x802, @@ -299,6 +305,59 @@ struct mlx5_ifc_flow_table_fields_suppor u8 reserved_7[0x20]; }; +struct mlx5_ifc_eth_discard_cntrs_grp_bits { + u8 ingress_general_high[0x20]; + + u8 ingress_general_low[0x20]; + + u8 ingress_policy_engine_high[0x20]; + + u8 ingress_policy_engine_low[0x20]; + + u8 ingress_vlan_membership_high[0x20]; + + u8 ingress_vlan_membership_low[0x20]; + + u8 ingress_tag_frame_type_high[0x20]; + + u8 ingress_tag_frame_type_low[0x20]; + + u8 egress_vlan_membership_high[0x20]; + + u8 egress_vlan_membership_low[0x20]; + + u8 loopback_filter_high[0x20]; + + u8 loopback_filter_low[0x20]; + + u8 egress_general_high[0x20]; + + u8 egress_general_low[0x20]; + + u8 reserved_at_1c0[0x40]; + + u8 egress_hoq_high[0x20]; + + u8 egress_hoq_low[0x20]; + + u8 port_isolation_high[0x20]; + + u8 port_isolation_low[0x20]; + + u8 egress_policy_engine_high[0x20]; + + u8 egress_policy_engine_low[0x20]; + + u8 ingress_tx_link_down_high[0x20]; + + u8 ingress_tx_link_down_low[0x20]; + + u8 egress_stp_filter_high[0x20]; + + u8 egress_stp_filter_low[0x20]; + + u8 reserved_at_340[0x480]; +}; struct mlx5_ifc_flow_table_prop_layout_bits { u8 ft_support[0x1]; u8 flow_tag[0x1]; @@ -421,7 +480,9 @@ struct mlx5_ifc_fte_match_set_misc_bits u8 vxlan_vni[0x18]; u8 reserved_3[0x8]; - u8 reserved_4[0x20]; + u8 geneve_vni[0x18]; + u8 reserved4[0x7]; + u8 geneve_oam[0x1]; u8 reserved_5[0xc]; u8 outer_ipv6_flow_label[0x14]; @@ -429,7 +490,9 @@ struct mlx5_ifc_fte_match_set_misc_bits u8 reserved_6[0xc]; u8 inner_ipv6_flow_label[0x14]; - u8 reserved_7[0xe0]; + u8 reserved7[0x10]; + u8 geneve_protocol_type[0x10]; + u8 reserved8[0xc0]; }; struct mlx5_ifc_cmd_pas_bits { @@ -535,6 +598,35 @@ struct mlx5_ifc_debug_cap_bits { struct mlx5_ifc_diagnostic_counter_cap_bits diagnostic_counter[0x1f0]; }; +struct mlx5_ifc_qos_cap_bits { + u8 packet_pacing[0x1]; + u8 esw_scheduling[0x1]; + u8 esw_bw_share[0x1]; + u8 esw_rate_limit[0x1]; + u8 hll[0x1]; + u8 packet_pacing_burst_bound[0x1]; + u8 reserved_at_6[0x1a]; + + u8 reserved_at_20[0x20]; + + u8 packet_pacing_max_rate[0x20]; + + u8 packet_pacing_min_rate[0x20]; + + u8 reserved_at_80[0x10]; + u8 packet_pacing_rate_table_size[0x10]; + + u8 esw_element_type[0x10]; + u8 esw_tsar_type[0x10]; + + u8 reserved_at_c0[0x10]; + u8 max_qos_para_vport[0x10]; + + u8 max_tsar_bw_share[0x20]; + + u8 reserved_at_100[0x700]; +}; + struct mlx5_ifc_snapshot_cap_bits { u8 reserved_0[0x1d]; u8 suspend_qp_uc[0x1]; @@ -599,17 +691,6 @@ struct mlx5_ifc_flow_table_nic_cap_bits u8 reserved_1[0x7200]; }; -struct mlx5_ifc_qos_cap_bits { - u8 packet_pacing[0x1]; - u8 reserved_0[0x1f]; - u8 reserved_1[0x20]; - u8 packet_pacing_max_rate[0x20]; - u8 packet_pacing_min_rate[0x20]; - u8 reserved_2[0x10]; - u8 packet_pacing_rate_table_size[0x10]; - u8 reserved_3[0x760]; -}; - struct mlx5_ifc_per_protocol_networking_offload_caps_bits { u8 csum_cap[0x1]; u8 vlan_cap[0x1]; @@ -631,7 +712,11 @@ struct mlx5_ifc_per_protocol_networking_ u8 tunnel_statless_gre[0x1]; u8 tunnel_stateless_vxlan[0x1]; - u8 reserved_2[0x20]; + u8 swp[0x1]; + u8 swp_csum[0x1]; + u8 swp_lso[0x1]; + u8 reserved_2[0x1c]; + u8 tunnel_stateless_geneve_rx[0x1]; u8 reserved_3[0x10]; u8 lro_min_mss_size[0x10]; @@ -1350,6 +1435,19 @@ struct mlx5_ifc_dcbx_param_reg_bits { u8 reserved_11[0x160]; }; +struct mlx5_ifc_qhll_bits { + u8 reserved_at_0[0x8]; + u8 local_port[0x8]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x1b]; + u8 hll_time[0x5]; + + u8 stall_en[0x1]; + u8 reserved_at_41[0x1c]; + u8 stall_cnt[0x3]; +}; + struct mlx5_ifc_qetcr_reg_bits { u8 operation_type[0x2]; u8 cap_local_admin[0x1]; @@ -2031,14 +2129,16 @@ enum { }; struct mlx5_ifc_sqc_bits { - u8 rlky[0x1]; + u8 rlkey[0x1]; u8 cd_master[0x1]; u8 fre[0x1]; u8 flush_in_error_en[0x1]; u8 allow_multi_pkt_send_wqe[0x1]; u8 min_wqe_inline_mode[0x3]; u8 state[0x4]; - u8 reserved_0[0x14]; + u8 reg_umr[0x1]; + u8 allow_swp[0x1]; + u8 reserved_0[0x12]; u8 reserved_1[0x8]; u8 user_index[0x18]; @@ -2046,7 +2146,9 @@ struct mlx5_ifc_sqc_bits { u8 reserved_2[0x8]; u8 cqn[0x18]; - u8 reserved_3[0x90]; + u8 reserved_3[0x80]; + + u8 qos_para_vport_number[0x10]; u8 packet_pacing_rate_limit_index[0x10]; u8 tis_lst_sz[0x10]; @@ -2060,6 +2162,58 @@ struct mlx5_ifc_sqc_bits { struct mlx5_ifc_wq_bits wq; }; +enum { + MLX5_TSAR_TYPE_DWRR = 0, + MLX5_TSAR_TYPE_ROUND_ROUBIN = 1, + MLX5_TSAR_TYPE_ETS = 2 +}; + +struct mlx5_ifc_tsar_element_attributes_bits { + u8 reserved_0[0x8]; + u8 tsar_type[0x8]; + u8 reserved_1[0x10]; +}; + +struct mlx5_ifc_vport_element_attributes_bits { + u8 reserved_0[0x10]; + u8 vport_number[0x10]; +}; + +struct mlx5_ifc_vport_tc_element_attributes_bits { + u8 traffic_class[0x10]; + u8 vport_number[0x10]; +}; + +struct mlx5_ifc_para_vport_tc_element_attributes_bits { + u8 reserved_0[0x0C]; + u8 traffic_class[0x04]; + u8 qos_para_vport_number[0x10]; +}; + +enum { + MLX5_SCHEDULING_CONTEXT_ELEMENT_TYPE_TSAR = 0x0, + MLX5_SCHEDULING_CONTEXT_ELEMENT_TYPE_VPORT = 0x1, + MLX5_SCHEDULING_CONTEXT_ELEMENT_TYPE_VPORT_TC = 0x2, + MLX5_SCHEDULING_CONTEXT_ELEMENT_TYPE_PARA_VPORT_TC = 0x3, +}; + +struct mlx5_ifc_scheduling_context_bits { + u8 element_type[0x8]; + u8 reserved_at_8[0x18]; + + u8 element_attributes[0x20]; + + u8 parent_element_id[0x20]; + + u8 reserved_at_60[0x40]; + + u8 bw_share[0x20]; + + u8 max_average_bw[0x20]; + + u8 reserved_at_e0[0x120]; +}; + struct mlx5_ifc_rqtc_bits { u8 reserved_0[0xa0]; @@ -3709,6 +3863,38 @@ struct mlx5_ifc_query_special_contexts_i u8 reserved_2[0x40]; }; +struct mlx5_ifc_query_scheduling_element_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0xc0]; + + struct mlx5_ifc_scheduling_context_bits scheduling_context; + + u8 reserved_at_300[0x100]; +}; + +enum { + MLX5_SCHEDULING_ELEMENT_IN_HIERARCHY_E_SWITCH = 0x2, +}; + +struct mlx5_ifc_query_scheduling_element_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 scheduling_hierarchy[0x8]; + u8 reserved_at_48[0x18]; + + u8 scheduling_element_id[0x20]; + + u8 reserved_at_80[0x180]; +}; + struct mlx5_ifc_query_rqt_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -4687,6 +4873,12 @@ struct mlx5_ifc_qp_2err_in_bits { u8 reserved_3[0x20]; }; +struct mlx5_ifc_para_vport_element_bits { + u8 reserved_at_0[0xc]; + u8 traffic_class[0x4]; + u8 qos_para_vport_number[0x10]; +}; + struct mlx5_ifc_page_fault_resume_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -4806,6 +4998,12 @@ struct mlx5_ifc_modify_tir_out_bits { u8 reserved_1[0x40]; }; +enum +{ + MLX5_MODIFY_SQ_BITMASK_PACKET_PACING_RATE_LIMIT_INDEX = 0x1 << 0, + MLX5_MODIFY_SQ_BITMASK_QOS_PARA_VPORT_NUMBER = 0x1 << 1 +}; + struct mlx5_ifc_modify_tir_in_bits { u8 opcode[0x10]; u8 reserved_0[0x10]; @@ -4854,6 +5052,47 @@ struct mlx5_ifc_modify_sq_in_bits { struct mlx5_ifc_sqc_bits ctx; }; +struct mlx5_ifc_modify_scheduling_element_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x1c0]; +}; + +enum { + MLX5_MODIFY_SCHEDULING_ELEMENT_IN_SCHEDULING_HIERARCHY_E_SWITCH = 0x2, +}; + +enum { + MLX5_MODIFY_SCHEDULING_ELEMENT_BITMASK_BW_SHARE = 0x1, + MLX5_MODIFY_SCHEDULING_ELEMENT_BITMASK_MAX_AVERAGE_BW = 0x2, +}; + +struct mlx5_ifc_modify_scheduling_element_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 scheduling_hierarchy[0x8]; + u8 reserved_at_48[0x18]; + + u8 scheduling_element_id[0x20]; + + u8 reserved_at_80[0x20]; + + u8 modify_bitmask[0x20]; + + u8 reserved_at_c0[0x40]; + + struct mlx5_ifc_scheduling_context_bits scheduling_context; + + u8 reserved_at_300[0x100]; +}; + struct mlx5_ifc_modify_rqt_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -5568,6 +5807,34 @@ struct mlx5_ifc_destroy_sq_in_bits { u8 reserved_3[0x20]; }; +struct mlx5_ifc_destroy_scheduling_element_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x1c0]; +}; + +enum { + MLX5_DESTROY_SCHEDULING_ELEMENT_IN_SCHEDULING_HIERARCHY_E_SWITCH = 0x2, +}; + +struct mlx5_ifc_destroy_scheduling_element_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 scheduling_hierarchy[0x8]; + u8 reserved_at_48[0x18]; + + u8 scheduling_element_id[0x20]; + + u8 reserved_at_80[0x180]; +}; + struct mlx5_ifc_destroy_rqt_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -5656,6 +5923,30 @@ struct mlx5_ifc_destroy_qp_in_bits { u8 reserved_3[0x20]; }; +struct mlx5_ifc_destroy_qos_para_vport_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x1c0]; +}; + +struct mlx5_ifc_destroy_qos_para_vport_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x10]; + u8 qos_para_vport_number[0x10]; + + u8 reserved_at_80[0x180]; +}; + struct mlx5_ifc_destroy_psv_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -5991,13 +6282,7 @@ struct mlx5_ifc_counter_id_bits { u8 counter_id[0x10]; }; -struct mlx5_ifc_set_diagnostics_in_bits { - u8 opcode[0x10]; - u8 reserved_0[0x10]; - - u8 reserved_1[0x10]; - u8 op_mod[0x10]; - +struct mlx5_ifc_diagnostic_params_context_bits { u8 num_of_counters[0x10]; u8 reserved_2[0x8]; u8 log_num_of_samples[0x8]; @@ -6016,7 +6301,17 @@ struct mlx5_ifc_set_diagnostics_in_bits struct mlx5_ifc_counter_id_bits counter_id[0]; }; -struct mlx5_ifc_set_diagnostics_out_bits { +struct mlx5_ifc_set_diagnostic_params_in_bits { + u8 opcode[0x10]; + u8 reserved_0[0x10]; + + u8 reserved_1[0x10]; + u8 op_mod[0x10]; + + struct mlx5_ifc_diagnostic_params_context_bits diagnostic_params_ctx; +}; + +struct mlx5_ifc_set_diagnostic_params_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -6025,7 +6320,7 @@ struct mlx5_ifc_set_diagnostics_out_bits u8 reserved_1[0x40]; }; -struct mlx5_ifc_query_diagnostics_in_bits { +struct mlx5_ifc_query_diagnostic_counters_in_bits { u8 opcode[0x10]; u8 reserved_0[0x10]; @@ -6049,7 +6344,7 @@ struct mlx5_ifc_diagnostic_counter_bits u8 counter_value_l[0x20]; }; -struct mlx5_ifc_query_diagnostics_out_bits { +struct mlx5_ifc_query_diagnostic_counters_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -6266,6 +6561,40 @@ struct mlx5_ifc_create_sq_in_bits { struct mlx5_ifc_sqc_bits ctx; }; +struct mlx5_ifc_create_scheduling_element_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; + + u8 scheduling_element_id[0x20]; + + u8 reserved_at_a0[0x160]; +}; + +enum { + MLX5_CREATE_SCHEDULING_ELEMENT_IN_SCHEDULING_HIERARCHY_E_SWITCH = 0x2, +}; + +struct mlx5_ifc_create_scheduling_element_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 scheduling_hierarchy[0x8]; + u8 reserved_at_48[0x18]; + + u8 reserved_at_60[0xa0]; + + struct mlx5_ifc_scheduling_context_bits scheduling_context; + + u8 reserved_at_300[0x100]; +}; + struct mlx5_ifc_create_rqt_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -6373,6 +6702,30 @@ struct mlx5_ifc_create_qp_in_bits { u8 pas[0][0x40]; }; +struct mlx5_ifc_create_qos_para_vport_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x10]; + u8 qos_para_vport_number[0x10]; + + u8 reserved_at_80[0x180]; +}; + +struct mlx5_ifc_create_qos_para_vport_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x1c0]; +}; + struct mlx5_ifc_create_psv_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -6951,6 +7304,7 @@ struct mlx5_ifc_set_rate_limit_in_bits { u8 reserved_at_60[0x20]; u8 rate_limit[0x20]; + u8 burst_upper_bound[0x20]; }; struct mlx5_ifc_access_register_out_bits { @@ -7604,6 +7958,39 @@ struct mlx5_ifc_phys_layer_cntrs_bits { u8 reserved_0[0x180]; }; +struct mlx5_ifc_infiniband_port_cntrs_bits { + u8 symbol_error_counter[0x10]; + u8 link_error_recovery_counter[0x8]; + u8 link_downed_counter[0x8]; + + u8 port_rcv_errors[0x10]; + u8 port_rcv_remote_physical_errors[0x10]; + + u8 port_rcv_switch_relay_errors[0x10]; + u8 port_xmit_discards[0x10]; + + u8 port_xmit_constraint_errors[0x8]; + u8 port_rcv_constraint_errors[0x8]; + u8 reserved_0[0x8]; + u8 local_link_integrity_errors[0x4]; + u8 excessive_buffer_overrun_errors[0x4]; + + u8 reserved_1[0x10]; + u8 vl_15_dropped[0x10]; + + u8 port_xmit_data[0x20]; + + u8 port_rcv_data[0x20]; + + u8 port_xmit_pkts[0x20]; + + u8 port_rcv_pkts[0x20]; + + u8 port_xmit_wait[0x20]; + + u8 reserved_2[0x680]; +}; + struct mlx5_ifc_phrr_reg_bits { u8 clr[0x1]; u8 reserved_0[0x7]; @@ -7692,7 +8079,10 @@ struct mlx5_ifc_pfcc_reg_bits { u8 reserved_7[0x8]; u8 cbfrx[0x8]; - u8 reserved_8[0x80]; + u8 device_stall_minor_watermark[0x10]; + u8 device_stall_critical_watermark[0x10]; + + u8 reserved_8[0x60]; }; struct mlx5_ifc_pelc_reg_bits { @@ -7885,7 +8275,19 @@ struct mlx5_ifc_eth_per_prio_grp_data_la u8 rx_pause_transition_low[0x20]; - u8 reserved_2[0x400]; + u8 rx_discards_high[0x20]; + + u8 rx_discards_low[0x20]; + + u8 device_stall_minor_watermark_cnt_high[0x20]; + + u8 device_stall_minor_watermark_cnt_low[0x20]; + + u8 device_stall_critical_watermark_cnt_high[0x20]; + + u8 device_stall_critical_watermark_cnt_low[0x20]; + + u8 reserved_2[0x340]; }; struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits { @@ -8782,8 +9184,10 @@ union mlx5_ifc_eth_cntrs_grp_data_layout struct mlx5_ifc_eth_2819_cntrs_grp_data_layout_bits eth_2819_cntrs_grp_data_layout; struct mlx5_ifc_eth_3635_cntrs_grp_data_layout_bits eth_3635_cntrs_grp_data_layout; struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits eth_extended_cntrs_grp_data_layout; + struct mlx5_ifc_eth_discard_cntrs_grp_bits eth_discard_cntrs_grp; struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout; struct mlx5_ifc_phys_layer_cntrs_bits phys_layer_cntrs; + struct mlx5_ifc_infiniband_port_cntrs_bits infiniband_port_cntrs; u8 reserved_0[0x7c0]; }; @@ -8941,6 +9345,7 @@ union mlx5_ifc_ports_control_registers_d struct mlx5_ifc_eth_2863_cntrs_grp_data_layout_bits eth_2863_cntrs_grp_data_layout; struct mlx5_ifc_eth_3635_cntrs_grp_data_layout_bits eth_3635_cntrs_grp_data_layout; struct mlx5_ifc_eth_802_3_cntrs_grp_data_layout_bits eth_802_3_cntrs_grp_data_layout; + struct mlx5_ifc_eth_discard_cntrs_grp_bits eth_discard_cntrs_grp; struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits eth_extended_cntrs_grp_data_layout; struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout; struct mlx5_ifc_eth_per_traffic_class_cong_layout_bits eth_per_traffic_class_cong_layout; Modified: head/sys/dev/mlx5/qp.h ============================================================================== --- head/sys/dev/mlx5/qp.h Mon Nov 7 11:26:25 2016 (r308413) +++ head/sys/dev/mlx5/qp.h Mon Nov 7 11:28:50 2016 (r308414) @@ -220,10 +220,20 @@ enum { MLX5_ETH_WQE_L4_CSUM = 1 << 7, }; +enum { + MLX5_ETH_WQE_SWP_OUTER_L3_TYPE = 1 << 0, + MLX5_ETH_WQE_SWP_OUTER_L4_TYPE = 1 << 1, + MLX5_ETH_WQE_SWP_INNER_L3_TYPE = 1 << 4, + MLX5_ETH_WQE_SWP_INNER_L4_TYPE = 1 << 5, +}; + struct mlx5_wqe_eth_seg { - u8 rsvd0[4]; + u8 swp_outer_l4_offset; + u8 swp_outer_l3_offset; + u8 swp_inner_l4_offset; + u8 swp_inner_l3_offset; u8 cs_flags; - u8 rsvd1; + u8 swp_flags; __be16 mss; __be32 rsvd2; __be16 inline_hdr_sz; From owner-svn-src-head@freebsd.org Mon Nov 7 11:35:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDC20C34C9C; Mon, 7 Nov 2016 11:35:15 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C6A18F3; Mon, 7 Nov 2016 11:35:15 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7BZEnO003373; Mon, 7 Nov 2016 11:35:14 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7BZEoD003372; Mon, 7 Nov 2016 11:35:14 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201611071135.uA7BZEoD003372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Mon, 7 Nov 2016 11:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308415 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 11:35:15 -0000 Author: sgalabov Date: Mon Nov 7 11:35:14 2016 New Revision: 308415 URL: https://svnweb.freebsd.org/changeset/base/308415 Log: Generate an error if machine/armreg.h is included without sys/cdefs.h machine/armreg.h requires access to the __ARM_ARCH macro, which is not always properly defined (especially by gcc 4.2.1). We should include sys/cdefs.h in order to get the definitions in machine/acle-compat.h, which would properly define the __ARM_ARCH macro in these cases. So, in cases where machine/armreg.h is included without _SYS_CDEFS_H_ being defined - generate an #error. Reviewed by: andrew Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D8460 Modified: head/sys/arm/include/armreg.h Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Mon Nov 7 11:28:50 2016 (r308414) +++ head/sys/arm/include/armreg.h Mon Nov 7 11:35:14 2016 (r308415) @@ -41,6 +41,10 @@ #ifndef MACHINE_ARMREG_H #define MACHINE_ARMREG_H +#ifndef _SYS_CDEFS_H_ +#error Please include sys/cdefs.h before including machine/armreg.h +#endif + #define INSN_SIZE 4 #define INSN_COND_MASK 0xf0000000 /* Condition mask */ #define PSR_MODE 0x0000001f /* mode mask */ From owner-svn-src-head@freebsd.org Mon Nov 7 11:39:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A857AC34D5C; Mon, 7 Nov 2016 11:39:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50B5BAFA; Mon, 7 Nov 2016 11:39:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7BdjY2003587; Mon, 7 Nov 2016 11:39:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7BdjlP003584; Mon, 7 Nov 2016 11:39:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611071139.uA7BdjlP003584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Nov 2016 11:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308416 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 11:39:46 -0000 Author: hselasky Date: Mon Nov 7 11:39:45 2016 New Revision: 308416 URL: https://svnweb.freebsd.org/changeset/base/308416 Log: Add timer to watch the RQ when we are out of mbufs. The firmware/hardware does not generate additional completion events unless we post new buffers. Use a timer to try to post more buffers in case we are temporarily out of mbufs. Else the receive schedule completely stops. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Mon Nov 7 11:35:14 2016 (r308415) +++ head/sys/dev/mlx5/mlx5_en/en.h Mon Nov 7 11:39:45 2016 (r308416) @@ -478,6 +478,7 @@ struct mlx5e_rq { struct mlx5_wq_ctrl wq_ctrl; u32 rqn; struct mlx5e_channel *channel; + struct callout watchdog; } __aligned(MLX5E_CACHELINE_SIZE); struct mlx5e_sq_mbuf { Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Nov 7 11:35:14 2016 (r308415) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Nov 7 11:39:45 2016 (r308416) @@ -855,7 +855,13 @@ err_destroy_rq: static void mlx5e_close_rq(struct mlx5e_rq *rq) { + mtx_lock(&rq->mtx); rq->enabled = 0; + callout_stop(&rq->watchdog); + mtx_unlock(&rq->mtx); + + callout_drain(&rq->watchdog); + mlx5e_modify_rq(rq, MLX5_RQC_STATE_RDY, MLX5_RQC_STATE_ERR); } @@ -1439,6 +1445,8 @@ mlx5e_chan_mtx_init(struct mlx5e_channel mtx_init(&c->rq.mtx, "mlx5rx", MTX_NETWORK_LOCK, MTX_DEF); + callout_init_mtx(&c->rq.watchdog, &c->rq.mtx, 0); + for (tc = 0; tc < c->num_tc; tc++) { struct mlx5e_sq *sq = c->sq + tc; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Nov 7 11:35:14 2016 (r308415) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Nov 7 11:39:45 2016 (r308416) @@ -82,9 +82,10 @@ mlx5e_post_rx_wqes(struct mlx5e_rq *rq) while (!mlx5_wq_ll_is_full(&rq->wq)) { struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(&rq->wq, rq->wq.head); - if (unlikely(mlx5e_alloc_rx_wqe(rq, wqe, rq->wq.head))) + if (unlikely(mlx5e_alloc_rx_wqe(rq, wqe, rq->wq.head))) { + callout_reset_curcpu(&rq->watchdog, 1, (void *)&mlx5e_post_rx_wqes, rq); break; - + } mlx5_wq_ll_push(&rq->wq, be16_to_cpu(wqe->next.next_wqe_index)); } From owner-svn-src-head@freebsd.org Mon Nov 7 11:56:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 697CBC3428F; Mon, 7 Nov 2016 11:56:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 354EB3E3; Mon, 7 Nov 2016 11:56:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7BuIbC011185; Mon, 7 Nov 2016 11:56:18 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7BuIAM011184; Mon, 7 Nov 2016 11:56:18 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611071156.uA7BuIAM011184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 7 Nov 2016 11:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308417 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 11:56:19 -0000 Author: andrew Date: Mon Nov 7 11:56:18 2016 New Revision: 308417 URL: https://svnweb.freebsd.org/changeset/base/308417 Log: Fix the order of includes so machine/asm.h is first. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/ti/ti_smc.S Modified: head/sys/arm/ti/ti_smc.S ============================================================================== --- head/sys/arm/ti/ti_smc.S Mon Nov 7 11:39:45 2016 (r308416) +++ head/sys/arm/ti/ti_smc.S Mon Nov 7 11:56:18 2016 (r308417) @@ -22,10 +22,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include __FBSDID("$FreeBSD$"); +#include + .cpu cortex-a8 .arch_extension sec From owner-svn-src-head@freebsd.org Mon Nov 7 14:02:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53575C33287; Mon, 7 Nov 2016 14:02:29 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3012422D; Mon, 7 Nov 2016 14:02:28 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (67-0-232-116.albq.qwest.net [67.0.232.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 4A5751928BA; Mon, 7 Nov 2016 14:02:26 +0000 (UTC) Subject: Re: svn commit: r308345 - head/sys/dev/e1000 To: John Baldwin References: <201611051630.uA5GUhtk073581@repo.freebsd.org> <15572642.JMvQo5TC3D@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Sean Bruno Message-ID: <28ef0f40-f2a3-92ea-fac6-a586c81810b0@freebsd.org> Date: Mon, 7 Nov 2016 07:02:23 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <15572642.JMvQo5TC3D@ralph.baldwin.cx> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lotim6AVPElTpsBaFLPlfNhgHjGJmm4L8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 14:02:29 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lotim6AVPElTpsBaFLPlfNhgHjGJmm4L8 Content-Type: multipart/mixed; boundary="ncFn9WmclKOCqEXh9Dl8KoIvLJ9KdTJse"; protected-headers="v1" From: Sean Bruno To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <28ef0f40-f2a3-92ea-fac6-a586c81810b0@freebsd.org> Subject: Re: svn commit: r308345 - head/sys/dev/e1000 References: <201611051630.uA5GUhtk073581@repo.freebsd.org> <15572642.JMvQo5TC3D@ralph.baldwin.cx> In-Reply-To: <15572642.JMvQo5TC3D@ralph.baldwin.cx> --ncFn9WmclKOCqEXh9Dl8KoIvLJ9KdTJse Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 11/05/16 17:16, John Baldwin wrote: > On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote: >> Author: sbruno >> Date: Sat Nov 5 16:30:42 2016 >> New Revision: 308345 >> URL: https://svnweb.freebsd.org/changeset/base/308345 >> >> Log: >> r295133 attempted to deactivate TSO in the 100Mbit link case with th= is >> adapter to work around bugs in TSO handling at this speed. >> =20 >> em_init_locked is called during first boot of the adapter and will >> see that link_speed is unitialized, effectively turning off tso for >> all cards at all speeds, which I believe was *not* the intent. >> =20 >> Move the handling of TSO deactivation to the link handler where we c= an >> more effectively make the decision about what to do. In addition, >> completely purge the TSO capabilities instead of disabling just CSUM= _TSO. >> =20 >> Thanks to jhb for explanation of the hw capabilites api. >> =20 >> Thanks to royger and cognet for testing the 100Mbit failure case to >> ensure that their adapters do indeed still work. >> =20 >> MFC after: 1 week >> Sponsored by: Limelight Networks >> >> Modified: >> head/sys/dev/e1000/if_em.c >> >> Modified: head/sys/dev/e1000/if_em.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/dev/e1000/if_em.c Sat Nov 5 16:23:33 2016 (r308344) >> +++ head/sys/dev/e1000/if_em.c Sat Nov 5 16:30:42 2016 (r308345) >> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1); >> #define MAX_INTS_PER_SEC 8000 >> #define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) >> =20 >> -/* Allow common code without TSO */ >> -#ifndef CSUM_TSO >> -#define CSUM_TSO 0 >> -#endif >> - >> #define TSO_WORKAROUND 4 >> =20 >> static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver param= eters"); >> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter) >> if_clearhwassist(ifp); >> if (if_getcapenable(ifp) & IFCAP_TXCSUM) >> if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0); >> - /*=20 >> - ** There have proven to be problems with TSO when not >> - ** at full gigabit speed, so disable the assist automatically >> - ** when at lower speeds. -jfv >> - */ >> - if (if_getcapenable(ifp) & IFCAP_TSO4) { >> - if (adapter->link_speed =3D=3D SPEED_1000) >> - if_sethwassistbits(ifp, CSUM_TSO, 0); >> - } >> + >> + if (if_getcapenable(ifp) & IFCAP_TSO4) >> + if_sethwassistbits(ifp, CSUM_TSO, 0); >=20 > Does this always disable TSO? Should this part be removed entirely? > (That is, it seems like this would disable TSO even on Gigabit links). >=20 I was confused by this question. The old code *always* disabled TSO because link_speed was always 0 here on boot. My intention is to ensure that CSUM_TSO is set if IFCAP_TSO4 is set. >> /* Configure for OS presence */ >> em_init_manageability(adapter); >> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad >> if (link_check && (adapter->link_active =3D=3D 0)) { >> e1000_get_speed_and_duplex(hw, &adapter->link_speed, >> &adapter->link_duplex); >> + /*=20 >> + ** There have proven to be problems with TSO when not >> + ** at full gigabit speed, so disable the assist automatically >> + ** when at lower speeds. -jfv >> + */ >> + if (adapter->link_speed !=3D SPEED_1000) { >> + if_sethwassistbits(ifp, 0, CSUM_TSO); >> + if_setcapenablebit(ifp, 0, IFCAP_TSO4); >> + if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4); >> + >> + } >=20 > Even though I suggested it, I wonder if it wouldn't be better to only > modify if_capenable and not if_capabilities, that way the admin can > decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving > an adapter from 100 to 1G). >=20 I spent several hours trying to come up with logic that would allow me to allow the user to do this. I am open to suggestions here, but it would require quite a bit more finesse than my "big hammer" approach. sean --ncFn9WmclKOCqEXh9Dl8KoIvLJ9KdTJse-- --lotim6AVPElTpsBaFLPlfNhgHjGJmm4L8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQF8BAEBCgBmBQJYIIlvXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kTMoIAMtFj9sd1xxQxC1oxtaRSbnc NZ1qG1saA5s4olwt39U2d+kcWNsGvWWx/Mdeg5O7Zkbidu6dijdUyCVCYodiw/JF wHUXyLU+vruyIgR8gD0MEWzBiEfkjVo/Jj7bPSPF8nMNqrzUxCMpFvVHd/SdwZSR fEmKvvfFS7th50UtnxE8lCWBBbizvhvpjoTsH74bjEpzcrWgXwmXsS5WamQo5kNs tHATmjfd1QivAgtUWIUHnEYVh97pJeINsmu06Tim9PFlSY+aW0U9mFqvtj5U913J UtI6VhLsgKCeo8B8HIHYDuypiVAx4lSYs80qkTE62U0+wW5KP0yWI2VZ3D0ejcU= =cBbf -----END PGP SIGNATURE----- --lotim6AVPElTpsBaFLPlfNhgHjGJmm4L8-- From owner-svn-src-head@freebsd.org Mon Nov 7 14:06:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4519C3337C; Mon, 7 Nov 2016 14:06:01 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A437865B; Mon, 7 Nov 2016 14:06:01 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (67-0-232-116.albq.qwest.net [67.0.232.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 4053F1928BA; Mon, 7 Nov 2016 14:06:00 +0000 (UTC) Subject: Re: svn commit: r308345 - head/sys/dev/e1000 To: Sepherosa Ziehau , John Baldwin References: <201611051630.uA5GUhtk073581@repo.freebsd.org> <15572642.JMvQo5TC3D@ralph.baldwin.cx> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Sean Bruno Message-ID: <075f36ce-53c8-ce58-672f-6086d8decc41@freebsd.org> Date: Mon, 7 Nov 2016 07:05:59 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7j8ti3piQR8DUwJAq8fPrfVnOOm8dSErp" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 14:06:01 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7j8ti3piQR8DUwJAq8fPrfVnOOm8dSErp Content-Type: multipart/mixed; boundary="R9PVhDFbhknGeFBWBGSRNGBvjj516oHeu"; protected-headers="v1" From: Sean Bruno To: Sepherosa Ziehau , John Baldwin Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: <075f36ce-53c8-ce58-672f-6086d8decc41@freebsd.org> Subject: Re: svn commit: r308345 - head/sys/dev/e1000 References: <201611051630.uA5GUhtk073581@repo.freebsd.org> <15572642.JMvQo5TC3D@ralph.baldwin.cx> In-Reply-To: --R9PVhDFbhknGeFBWBGSRNGBvjj516oHeu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/06/16 23:37, Sepherosa Ziehau wrote: > On Sun, Nov 6, 2016 at 7:16 AM, John Baldwin wrote: >> On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote: >>> Author: sbruno >>> Date: Sat Nov 5 16:30:42 2016 >>> New Revision: 308345 >>> URL: https://svnweb.freebsd.org/changeset/base/308345 >>> >>> Log: >>> r295133 attempted to deactivate TSO in the 100Mbit link case with t= his >>> adapter to work around bugs in TSO handling at this speed. >>> >>> em_init_locked is called during first boot of the adapter and will >>> see that link_speed is unitialized, effectively turning off tso for= >>> all cards at all speeds, which I believe was *not* the intent. >>> >>> Move the handling of TSO deactivation to the link handler where we = can >>> more effectively make the decision about what to do. In addition, >>> completely purge the TSO capabilities instead of disabling just CSU= M_TSO. >>> >>> Thanks to jhb for explanation of the hw capabilites api. >>> >>> Thanks to royger and cognet for testing the 100Mbit failure case to= >>> ensure that their adapters do indeed still work. >>> >>> MFC after: 1 week >>> Sponsored by: Limelight Networks >>> >>> Modified: >>> head/sys/dev/e1000/if_em.c >>> >>> Modified: head/sys/dev/e1000/if_em.c >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/dev/e1000/if_em.c Sat Nov 5 16:23:33 2016 = (r308344) >>> +++ head/sys/dev/e1000/if_em.c Sat Nov 5 16:30:42 2016 = (r308345) >>> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1); >>> #define MAX_INTS_PER_SEC 8000 >>> #define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) >>> >>> -/* Allow common code without TSO */ >>> -#ifndef CSUM_TSO >>> -#define CSUM_TSO 0 >>> -#endif >>> - >>> #define TSO_WORKAROUND 4 >>> >>> static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver para= meters"); >>> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter) >>> if_clearhwassist(ifp); >>> if (if_getcapenable(ifp) & IFCAP_TXCSUM) >>> if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0); >>> - /* >>> - ** There have proven to be problems with TSO when not >>> - ** at full gigabit speed, so disable the assist automatically >>> - ** when at lower speeds. -jfv >>> - */ >>> - if (if_getcapenable(ifp) & IFCAP_TSO4) { >>> - if (adapter->link_speed =3D=3D SPEED_1000) >>> - if_sethwassistbits(ifp, CSUM_TSO, 0); >>> - } >>> + >>> + if (if_getcapenable(ifp) & IFCAP_TSO4) >>> + if_sethwassistbits(ifp, CSUM_TSO, 0); >> >> Does this always disable TSO? Should this part be removed entirely? >> (That is, it seems like this would disable TSO even on Gigabit links).= >> >>> /* Configure for OS presence */ >>> em_init_manageability(adapter); >>> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad >>> if (link_check && (adapter->link_active =3D=3D 0)) { >>> e1000_get_speed_and_duplex(hw, &adapter->link_speed, >>> &adapter->link_duplex); >>> + /* >>> + ** There have proven to be problems with TSO when not >>> + ** at full gigabit speed, so disable the assist automat= ically >>> + ** when at lower speeds. -jfv >>> + */ >>> + if (adapter->link_speed !=3D SPEED_1000) { >>> + if_sethwassistbits(ifp, 0, CSUM_TSO); >>> + if_setcapenablebit(ifp, 0, IFCAP_TSO4); >>> + if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4); >>> + >>> + } >> >> Even though I suggested it, I wonder if it wouldn't be better to only >> modify if_capenable and not if_capabilities, that way the admin can >> decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving >> an adapter from 100 to 1G). >=20 > I believe simply clearing CSUM_TSO should work for the TCP stack; > messing administrative like capenable and hwcaps does not sound > correct to me. >=20 I don't disagree, but I also don't have an opinion. What I didn't want, was a continuation of the half disabled/half enabled TSO code path that we had prior to this change. > As for this patch, do you need to re-enable TSO once link speed > becomes 1000Mbps? Probably? There wasn't a clear way to flip this back on that I could find that would catch the case of "link speed was 100 and is now 1000". BTW, since the link status check/update is async w/ > the TX path, does this really work, if there are TSO packets pending > on the TX rings (let alone inflight TSO packets from the TCP stack) > when the link speed changed to 100Mbps? TSO packets that are "pending" will continue out their path, AFAIK. I don't believe that a link speed change from 1000 to 100 is a very common occurrence, but I'm willing to change the code to something more "graceful" if you have an idea of how to do it. sean --R9PVhDFbhknGeFBWBGSRNGBvjj516oHeu-- --7j8ti3piQR8DUwJAq8fPrfVnOOm8dSErp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQF8BAEBCgBmBQJYIIpHXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kNgkH/jm1x6D4T1mAXZ0Eqrkkui2z fCzr1RMnSYM1vfIhjUR18VPn4c9Dze4X81gnrPv99YUHk9zecs3HtDbUTN3TRLAp ILs9jOo6PKwvLCI2f0rnzn4OguPqy+nTCMRi5/pT0MTBIVXeoBaLy5OfblctFG8x srhrZydr6O2swttCNz/HErUFyLOHs1yFVtQFQiNrAAikpniEb3fD1o1NPDYp3OX2 WJTDeElXhL+rITwrkd4DQSzbAISS3VGGrJF9NJRMSrNb4RXQDpzVFMoKm4Pp0kiC tMWwfNOAO+YblwUJ4oiUljwk67zlfpc1J9ADYkI+V176c4emO4Lh2bevVxkEtMM= =+Jfz -----END PGP SIGNATURE----- --7j8ti3piQR8DUwJAq8fPrfVnOOm8dSErp-- From owner-svn-src-head@freebsd.org Mon Nov 7 14:07:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FF21C3345B; Mon, 7 Nov 2016 14:07:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3573854; Mon, 7 Nov 2016 14:07:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7E7Cqq062421; Mon, 7 Nov 2016 14:07:12 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7E7CpU062420; Mon, 7 Nov 2016 14:07:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611071407.uA7E7CpU062420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 7 Nov 2016 14:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308419 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 14:07:13 -0000 Author: andrew Date: Mon Nov 7 14:07:11 2016 New Revision: 308419 URL: https://svnweb.freebsd.org/changeset/base/308419 Log: Use the armv6 GENERIC in the qemu nanobsd image. Sponsored by: ABT Systems Ltd Modified: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg Modified: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-armv7.cfg Mon Nov 7 12:10:17 2016 (r308418) +++ head/tools/tools/nanobsd/embedded/qemu-armv7.cfg Mon Nov 7 14:07:11 2016 (r308419) @@ -29,7 +29,7 @@ NANO_ARCH=armv6 NANO_DRIVE=vtbd0 -NANO_KERNEL=VIRT +NANO_KERNEL=GENERIC NANO_NAME=qemu-armv7 NANO_LAYOUT=std-uefi-bios NANO_CPUTYPE=cortexa From owner-svn-src-head@freebsd.org Mon Nov 7 15:05:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 524C1C34DE4; Mon, 7 Nov 2016 15:05:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 303BA1C9; Mon, 7 Nov 2016 15:05:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 62C4510A727; Mon, 7 Nov 2016 10:05:10 -0500 (EST) From: John Baldwin To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308345 - head/sys/dev/e1000 Date: Mon, 07 Nov 2016 07:04:36 -0800 Message-ID: <7525024.AEWygEoTEf@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <28ef0f40-f2a3-92ea-fac6-a586c81810b0@freebsd.org> References: <201611051630.uA5GUhtk073581@repo.freebsd.org> <15572642.JMvQo5TC3D@ralph.baldwin.cx> <28ef0f40-f2a3-92ea-fac6-a586c81810b0@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 07 Nov 2016 10:05:10 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 15:05:13 -0000 On Monday, November 07, 2016 07:02:23 AM Sean Bruno wrote: > > On 11/05/16 17:16, John Baldwin wrote: > > On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote: > >> Author: sbruno > >> Date: Sat Nov 5 16:30:42 2016 > >> New Revision: 308345 > >> URL: https://svnweb.freebsd.org/changeset/base/308345 > >> > >> Log: > >> r295133 attempted to deactivate TSO in the 100Mbit link case with this > >> adapter to work around bugs in TSO handling at this speed. > >> > >> em_init_locked is called during first boot of the adapter and will > >> see that link_speed is unitialized, effectively turning off tso for > >> all cards at all speeds, which I believe was *not* the intent. > >> > >> Move the handling of TSO deactivation to the link handler where we can > >> more effectively make the decision about what to do. In addition, > >> completely purge the TSO capabilities instead of disabling just CSUM_TSO. > >> > >> Thanks to jhb for explanation of the hw capabilites api. > >> > >> Thanks to royger and cognet for testing the 100Mbit failure case to > >> ensure that their adapters do indeed still work. > >> > >> MFC after: 1 week > >> Sponsored by: Limelight Networks > >> > >> Modified: > >> head/sys/dev/e1000/if_em.c > >> > >> Modified: head/sys/dev/e1000/if_em.c > >> ============================================================================== > >> --- head/sys/dev/e1000/if_em.c Sat Nov 5 16:23:33 2016 (r308344) > >> +++ head/sys/dev/e1000/if_em.c Sat Nov 5 16:30:42 2016 (r308345) > >> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1); > >> #define MAX_INTS_PER_SEC 8000 > >> #define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) > >> > >> -/* Allow common code without TSO */ > >> -#ifndef CSUM_TSO > >> -#define CSUM_TSO 0 > >> -#endif > >> - > >> #define TSO_WORKAROUND 4 > >> > >> static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver parameters"); > >> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter) > >> if_clearhwassist(ifp); > >> if (if_getcapenable(ifp) & IFCAP_TXCSUM) > >> if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0); > >> - /* > >> - ** There have proven to be problems with TSO when not > >> - ** at full gigabit speed, so disable the assist automatically > >> - ** when at lower speeds. -jfv > >> - */ > >> - if (if_getcapenable(ifp) & IFCAP_TSO4) { > >> - if (adapter->link_speed == SPEED_1000) > >> - if_sethwassistbits(ifp, CSUM_TSO, 0); > >> - } > >> + > >> + if (if_getcapenable(ifp) & IFCAP_TSO4) > >> + if_sethwassistbits(ifp, CSUM_TSO, 0); > > > > Does this always disable TSO? Should this part be removed entirely? > > (That is, it seems like this would disable TSO even on Gigabit links). > > > > I was confused by this question. The old code *always* disabled TSO > because link_speed was always 0 here on boot. My intention is to ensure > that CSUM_TSO is set if IFCAP_TSO4 is set. Oh, I misread the code. It is setting CSUM_TSO and clearing 0. I think you probably don't need this as the flag can only be set in capenable by an ioctl handler that sets the flag to true (and the calling ioctl code should update hwassist for you). Oh, the driver does 'if_clearhwassist()' above this. How... unfortunate. I think that since you are now handling this in 'update_link_status' that you can instead remove this whole block starting with 'if_clearhwassist()' and ending with the 'if_sethwassist' for CSUM_TSO. That is, you can now leave if_hwasssist alone in em_init_locked() and not change it. > >> /* Configure for OS presence */ > >> em_init_manageability(adapter); > >> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad > >> if (link_check && (adapter->link_active == 0)) { > >> e1000_get_speed_and_duplex(hw, &adapter->link_speed, > >> &adapter->link_duplex); > >> + /* > >> + ** There have proven to be problems with TSO when not > >> + ** at full gigabit speed, so disable the assist automatically > >> + ** when at lower speeds. -jfv > >> + */ > >> + if (adapter->link_speed != SPEED_1000) { > >> + if_sethwassistbits(ifp, 0, CSUM_TSO); > >> + if_setcapenablebit(ifp, 0, IFCAP_TSO4); > >> + if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4); > >> + > >> + } > > > > Even though I suggested it, I wonder if it wouldn't be better to only > > modify if_capenable and not if_capabilities, that way the admin can > > decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving > > an adapter from 100 to 1G). > > > > I spent several hours trying to come up with logic that would allow me > to allow the user to do this. I am open to suggestions here, but it > would require quite a bit more finesse than my "big hammer" approach. I think you just need to remove 'if_setcapabilities' here and leave the rest of the logic as-is. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Nov 7 15:54:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CB23C354A9; Mon, 7 Nov 2016 15:54:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30F89AB7; Mon, 7 Nov 2016 15:54:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7FsmlQ007035; Mon, 7 Nov 2016 15:54:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7FsmI1007030; Mon, 7 Nov 2016 15:54:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611071554.uA7FsmI1007030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 7 Nov 2016 15:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308420 - in head: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src lib/libmagic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 15:54:49 -0000 Author: delphij Date: Mon Nov 7 15:54:47 2016 New Revision: 308420 URL: https://svnweb.freebsd.org/changeset/base/308420 Log: MFV r308392: file 5.29. MFC after: 2 weeks Added: head/contrib/file/magic/Magdir/algol68 - copied unchanged from r308392, vendor/file/dist/magic/Magdir/algol68 head/contrib/file/magic/Magdir/application - copied unchanged from r308392, vendor/file/dist/magic/Magdir/application head/contrib/file/magic/Magdir/apt - copied unchanged from r308392, vendor/file/dist/magic/Magdir/apt head/contrib/file/magic/Magdir/psl - copied unchanged from r308392, vendor/file/dist/magic/Magdir/psl Modified: head/contrib/file/ChangeLog head/contrib/file/TODO head/contrib/file/config.guess head/contrib/file/config.sub head/contrib/file/configure head/contrib/file/configure.ac head/contrib/file/doc/file.man head/contrib/file/doc/magic.man head/contrib/file/ltmain.sh head/contrib/file/magic/Magdir/animation head/contrib/file/magic/Magdir/apple head/contrib/file/magic/Magdir/bioinformatics head/contrib/file/magic/Magdir/c-lang head/contrib/file/magic/Magdir/claris head/contrib/file/magic/Magdir/commands head/contrib/file/magic/Magdir/compress head/contrib/file/magic/Magdir/cups head/contrib/file/magic/Magdir/editors head/contrib/file/magic/Magdir/filesystems head/contrib/file/magic/Magdir/fonts head/contrib/file/magic/Magdir/gcc head/contrib/file/magic/Magdir/gnu head/contrib/file/magic/Magdir/images head/contrib/file/magic/Magdir/jpeg head/contrib/file/magic/Magdir/msdos head/contrib/file/magic/Magdir/pgp head/contrib/file/magic/Magdir/python head/contrib/file/magic/Magdir/ruby head/contrib/file/magic/Magdir/sgml head/contrib/file/magic/Magdir/sql head/contrib/file/magic/Makefile.am head/contrib/file/magic/Makefile.in head/contrib/file/python/magic.py head/contrib/file/src/apprentice.c head/contrib/file/src/ascmagic.c head/contrib/file/src/cdf.c head/contrib/file/src/cdf.h head/contrib/file/src/compress.c head/contrib/file/src/der.c head/contrib/file/src/file.c head/contrib/file/src/file.h head/contrib/file/src/funcs.c head/contrib/file/src/magic.c head/contrib/file/src/readcdf.c head/contrib/file/src/readelf.c head/contrib/file/src/softmagic.c head/lib/libmagic/config.h Directory Properties: head/contrib/file/ (props changed) Modified: head/contrib/file/ChangeLog ============================================================================== --- head/contrib/file/ChangeLog Mon Nov 7 14:07:11 2016 (r308419) +++ head/contrib/file/ChangeLog Mon Nov 7 15:54:47 2016 (r308420) @@ -1,3 +1,32 @@ +2016-10-25 10:40 Christos Zoulas + + * release 5.28 + +2016-10-24 11:20 Christos Zoulas + + * der getlength overflow (Jonas Wagner) + * multiple magic file load failure (Christoph Biedl) + +2016-10-17 11:26 Christos Zoulas + + * CDF parsing improvements (Guy Helmer) + +2016-07-20 7:26 Christos Zoulas + + * Add support for signed indirect offsets + +2016-07-18 7:41 Christos Zoulas + + * cat /dev/null | file - should print empty (Christoph Biedl) + +2016-07-05 15:20 Christos Zoulas + + * Bump string size from 64 to 96. + +2016-06-13 20:20 Christos Zoulas + + * PR/556: Fix separators on annotations. + 2016-06-13 19:40 Christos Zoulas * release 5.28 Modified: head/contrib/file/TODO ============================================================================== --- head/contrib/file/TODO Mon Nov 7 14:07:11 2016 (r308419) +++ head/contrib/file/TODO Mon Nov 7 15:54:47 2016 (r308420) @@ -6,7 +6,6 @@ file, not here. More speculative materia listed in the BUGS section of the man page had been fixed!) --- - It would be nice to simplify file considerably. For example, reimplement the apprentice and non-pattern magic methods in Python, and compile the magic patterns to a giant regex (or something similar; @@ -15,8 +14,23 @@ small amount of C is needed (because fas required for soft magic, not the more detailed information given by hard-wired routines). In this regard, note that hplip, which is BSD-licensed, has a magic reimplementation in Python. - +--- Read the kerberos magic entry for more ideas. - +--- Write a string merger to make magic entry sizes dynamic. Strings will be converted to offsets from the string table. +--- +Programming language support, we can introduce the concept of a group +of rules where n rules need to match before the rule is positive. This +could require structural changes to the matching code :-( + +0 group 2 # require 2 matches +# rule 1 +>0 .... +... +# rule 2 +>0 .... +... + +christos + Modified: head/contrib/file/config.guess ============================================================================== --- head/contrib/file/config.guess Mon Nov 7 14:07:11 2016 (r308419) +++ head/contrib/file/config.guess Mon Nov 7 15:54:47 2016 (r308420) @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2015-03-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -22,19 +20,17 @@ timestamp='2012-02-10' # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches to . + me=`echo "$0" | sed -e 's,.*/,,'` @@ -54,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -153,20 +168,27 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -182,6 +204,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -198,7 +227,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "${machine}-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` @@ -302,7 +335,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -560,8 +593,9 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -801,10 +835,13 @@ EOF i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -852,21 +889,21 @@ EOF exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,59 +916,57 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -950,54 +985,63 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1201,6 +1245,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1227,19 +1274,31 @@ EOF exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1256,7 +1315,7 @@ EOF NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1330,157 +1389,6 @@ EOF exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <. @@ -26,11 +20,12 @@ timestamp='2012-04-18' # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -73,9 +68,7 @@ Report bugs and patches to Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2D37C35250; Mon, 7 Nov 2016 17:34:20 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AFCB1C57; Mon, 7 Nov 2016 17:34:20 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7HYJcI045752; Mon, 7 Nov 2016 17:34:19 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7HYJL1045751; Mon, 7 Nov 2016 17:34:19 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201611071734.uA7HYJL1045751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 7 Nov 2016 17:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308423 - head/sys/dev/mpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 17:34:20 -0000 Author: scottl Date: Mon Nov 7 17:34:19 2016 New Revision: 308423 URL: https://svnweb.freebsd.org/changeset/base/308423 Log: Fix the fallout from r308268 (mpt driver causes endless witness warnings in VMWare and elsewhere) with the precision of a dull, rusty butter knife. Reported by: tuexen Obtained from: Netflix Modified: head/sys/dev/mpt/mpt.c Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Mon Nov 7 17:17:46 2016 (r308422) +++ head/sys/dev/mpt/mpt.c Mon Nov 7 17:34:19 2016 (r308423) @@ -2695,7 +2695,11 @@ mpt_configure_ioc(struct mpt_softc *mpt, */ mpt->max_cam_seg_cnt = min(mpt->max_seg_cnt, (MAXPHYS / PAGE_SIZE) + 1); + /* XXX Lame Locking! */ + MPT_UNLOCK(mpt); error = mpt_dma_buf_alloc(mpt); + MPT_LOCK(mpt); + if (error != 0) { mpt_prt(mpt, "mpt_dma_buf_alloc() failed!\n"); return (EIO); @@ -2745,6 +2749,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, * retrieved, we are responsible for re-downloading * the firmware after any hard-reset. */ + MPT_UNLOCK(mpt); mpt->fw_image_size = mpt->ioc_facts.FWImageSize; error = mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, @@ -2752,6 +2757,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, &mpt->fw_dmat); if (error != 0) { mpt_prt(mpt, "cannot create firmware dma tag\n"); + MPT_LOCK(mpt); return (ENOMEM); } error = bus_dmamem_alloc(mpt->fw_dmat, @@ -2760,6 +2766,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, if (error != 0) { mpt_prt(mpt, "cannot allocate firmware memory\n"); bus_dma_tag_destroy(mpt->fw_dmat); + MPT_LOCK(mpt); return (ENOMEM); } mi.mpt = mpt; @@ -2768,6 +2775,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, mpt->fw_image, mpt->fw_image_size, mpt_map_rquest, &mi, 0); mpt->fw_phys = mi.phys; + MPT_LOCK(mpt); error = mpt_upload_fw(mpt); if (error != 0) { mpt_prt(mpt, "firmware upload failed.\n"); From owner-svn-src-head@freebsd.org Mon Nov 7 17:38:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0804DC353AF; Mon, 7 Nov 2016 17:38:41 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D93A81F09; Mon, 7 Nov 2016 17:38:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7Hce59045945; Mon, 7 Nov 2016 17:38:40 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7HceYu045944; Mon, 7 Nov 2016 17:38:40 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201611071738.uA7HceYu045944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 7 Nov 2016 17:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308424 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 17:38:41 -0000 Author: gonzo Date: Mon Nov 7 17:38:39 2016 New Revision: 308424 URL: https://svnweb.freebsd.org/changeset/base/308424 Log: Fix locking in bcm2835_audio driver - Move all VCHI activity to worker thread: channel methods are called with non-sleepable lock held and VCHI uses sleepable lock. - In worker thread use sx(9) lock instead of mutex(9) for the same reason. PR: 213801, 205979 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Mon Nov 7 17:34:19 2016 (r308423) +++ head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Mon Nov 7 17:38:39 2016 (r308424) @@ -104,14 +104,17 @@ struct bcm2835_audio_info { struct intr_config_hook intr_hook; /* VCHI data */ - struct mtx vchi_lock; + struct sx vchi_lock; VCHI_INSTANCE_T vchi_instance; VCHI_CONNECTION_T *vchi_connection; VCHI_SERVICE_HANDLE_T vchi_handle; - struct mtx data_lock; - struct cv data_cv; + struct sx worker_lock; + struct cv worker_cv; + + bool parameters_update_pending; + bool controls_update_pending; /* Unloadign module */ int unloading; @@ -121,8 +124,8 @@ struct bcm2835_audio_info { #define bcm2835_audio_unlock(_ess) snd_mtxunlock((_ess)->lock) #define bcm2835_audio_lock_assert(_ess) snd_mtxassert((_ess)->lock) -#define VCHIQ_VCHI_LOCK(sc) mtx_lock(&(sc)->vchi_lock) -#define VCHIQ_VCHI_UNLOCK(sc) mtx_unlock(&(sc)->vchi_lock) +#define VCHIQ_VCHI_LOCK(sc) sx_xlock(&(sc)->vchi_lock) +#define VCHIQ_VCHI_UNLOCK(sc) sx_xunlock(&(sc)->vchi_lock) static const char * dest_description(uint32_t dest) @@ -175,7 +178,7 @@ bcm2835_audio_callback(void *param, cons chn_intr(sc->pch.channel); if (perr || ch->free_buffer >= VCHIQ_AUDIO_PACKET_SIZE) - cv_signal(&sc->data_cv); + cv_signal(&sc->worker_cv); } else printf("%s: unknown m.type: %d\n", __func__, m.type); } @@ -261,8 +264,6 @@ bcm2835_audio_start(struct bcm2835_audio if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { vchi_service_use(sc->vchi_handle); - bcm2835_audio_reset_channel(ch); - m.type = VC_AUDIO_MSG_TYPE_START; ret = vchi_msg_queue(sc->vchi_handle, &m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); @@ -324,7 +325,7 @@ bcm2835_audio_open(struct bcm2835_audio_ } static void -bcm2835_audio_update_controls(struct bcm2835_audio_info *sc) +bcm2835_audio_update_controls(struct bcm2835_audio_info *sc, uint32_t volume, uint32_t dest) { VC_AUDIO_MSG_T m; int ret, db; @@ -334,10 +335,10 @@ bcm2835_audio_update_controls(struct bcm vchi_service_use(sc->vchi_handle); m.type = VC_AUDIO_MSG_TYPE_CONTROL; - m.u.control.dest = sc->dest; - if (sc->volume > 99) - sc->volume = 99; - db = db_levels[sc->volume/5]; + m.u.control.dest = dest; + if (volume > 99) + volume = 99; + db = db_levels[volume/5]; m.u.control.volume = VCHIQ_AUDIO_VOLUME(db); ret = vchi_msg_queue(sc->vchi_handle, @@ -352,7 +353,7 @@ bcm2835_audio_update_controls(struct bcm } static void -bcm2835_audio_update_params(struct bcm2835_audio_info *sc, struct bcm2835_audio_chinfo *ch) +bcm2835_audio_update_params(struct bcm2835_audio_info *sc, uint32_t fmt, uint32_t speed) { VC_AUDIO_MSG_T m; int ret; @@ -362,9 +363,9 @@ bcm2835_audio_update_params(struct bcm28 vchi_service_use(sc->vchi_handle); m.type = VC_AUDIO_MSG_TYPE_CONFIG; - m.u.config.channels = AFMT_CHANNEL(ch->fmt); - m.u.config.samplerate = ch->spd; - m.u.config.bps = AFMT_BIT(ch->fmt); + m.u.config.channels = AFMT_CHANNEL(fmt); + m.u.config.samplerate = speed; + m.u.config.bps = AFMT_BIT(fmt); ret = vchi_msg_queue(sc->vchi_handle, &m, sizeof m, VCHI_FLAGS_BLOCK_UNTIL_QUEUED, NULL); @@ -474,29 +475,61 @@ bcm2835_audio_worker(void *data) { struct bcm2835_audio_info *sc = (struct bcm2835_audio_info *)data; struct bcm2835_audio_chinfo *ch = &sc->pch; - mtx_lock(&sc->data_lock); + uint32_t speed, format; + uint32_t volume, dest; + bool parameters_changed, controls_changed; + + sx_slock(&sc->worker_lock); while(1) { if (sc->unloading) break; + parameters_changed = false; + controls_changed = false; + bcm2835_audio_lock(sc); + if (sc->parameters_update_pending) { + /* TODO: update parameters */ + speed = ch->spd; + format = ch->fmt; + sc->parameters_update_pending = false; + parameters_changed = true; + } + + if (sc->controls_update_pending) { + volume = sc->volume; + dest = sc->dest; + sc->controls_update_pending = false; + controls_changed = true; + } + + bcm2835_audio_unlock(sc); + + if (parameters_changed) { + bcm2835_audio_update_params(sc, format, speed); + } + + if (controls_changed) { + bcm2835_audio_update_controls(sc, volume, dest); + } + if (ch->playback_state == PLAYBACK_IDLE) { - cv_wait_sig(&sc->data_cv, &sc->data_lock); + cv_wait_sig(&sc->worker_cv, &sc->worker_lock); continue; } if (ch->playback_state == PLAYBACK_STOPPING) { + bcm2835_audio_stop(ch); bcm2835_audio_reset_channel(&sc->pch); ch->playback_state = PLAYBACK_IDLE; continue; } if (ch->free_buffer < vchiq_unbuffered_bytes(ch)) { - cv_timedwait_sig(&sc->data_cv, &sc->data_lock, 10); + cv_timedwait_sig(&sc->worker_cv, &sc->worker_lock, 10); continue; } - bcm2835_audio_write_samples(ch); if (ch->playback_state == PLAYBACK_STARTING) { @@ -507,7 +540,7 @@ bcm2835_audio_worker(void *data) } } } - mtx_unlock(&sc->data_lock); + sx_sunlock(&sc->worker_lock); kproc_exit(0); } @@ -547,11 +580,13 @@ bcmchan_init(kobj_t obj, void *devinfo, buffer = malloc(sc->bufsz, M_DEVBUF, M_WAITOK | M_ZERO); if (sndbuf_setup(ch->buffer, buffer, sc->bufsz) != 0) { + device_printf(sc->dev, "sndbuf_setup failed\n"); free(buffer, M_DEVBUF); return NULL; } - bcm2835_audio_update_params(sc, ch); + sc->parameters_update_pending = true; + cv_signal(&sc->worker_cv); return ch; } @@ -576,12 +611,12 @@ bcmchan_setformat(kobj_t obj, void *data struct bcm2835_audio_info *sc = ch->parent; bcm2835_audio_lock(sc); - ch->fmt = format; - bcm2835_audio_update_params(sc, ch); - + sc->parameters_update_pending = true; bcm2835_audio_unlock(sc); + cv_signal(&sc->worker_cv); + return 0; } @@ -592,12 +627,12 @@ bcmchan_setspeed(kobj_t obj, void *data, struct bcm2835_audio_info *sc = ch->parent; bcm2835_audio_lock(sc); - ch->spd = speed; - bcm2835_audio_update_params(sc, ch); - + sc->parameters_update_pending = true; bcm2835_audio_unlock(sc); + cv_signal(&sc->worker_cv); + return ch->spd; } @@ -618,26 +653,30 @@ bcmchan_trigger(kobj_t obj, void *data, if (!PCMTRIG_COMMON(go)) return (0); - bcm2835_audio_lock(sc); switch (go) { case PCMTRIG_START: + bcm2835_audio_lock(sc); + bcm2835_audio_reset_channel(ch); ch->playback_state = PLAYBACK_STARTING; + bcm2835_audio_unlock(sc); + /* kickstart data flow */ + chn_intr(sc->pch.channel); /* wakeup worker thread */ - cv_signal(&sc->data_cv); + cv_signal(&sc->worker_cv); break; case PCMTRIG_STOP: case PCMTRIG_ABORT: + bcm2835_audio_lock(sc); ch->playback_state = PLAYBACK_STOPPING; - bcm2835_audio_stop(ch); + bcm2835_audio_unlock(sc); + cv_signal(&sc->worker_cv); break; default: break; } - - bcm2835_audio_unlock(sc); return 0; } @@ -695,8 +734,11 @@ bcmmix_set(struct snd_mixer *m, unsigned switch (dev) { case SOUND_MIXER_VOLUME: + bcm2835_audio_lock(sc); sc->volume = left; - bcm2835_audio_update_controls(sc); + sc->controls_update_pending = true; + bcm2835_audio_unlock(sc); + cv_signal(&sc->worker_cv); break; default: @@ -729,9 +771,13 @@ sysctl_bcm2835_audio_dest(SYSCTL_HANDLER if ((val < 0) || (val > 2)) return (EINVAL); + bcm2835_audio_lock(sc); sc->dest = val; + sc->controls_update_pending = true; + bcm2835_audio_unlock(sc); + + cv_signal(&sc->worker_cv); device_printf(sc->dev, "destination set to %s\n", dest_description(val)); - bcm2835_audio_update_controls(sc); return (0); } @@ -821,9 +867,9 @@ bcm2835_audio_attach(device_t dev) sc->lock = snd_mtxcreate(device_get_nameunit(dev), "bcm2835_audio softc"); - mtx_init(&sc->vchi_lock, "bcm2835_audio", "vchi_lock", MTX_DEF); - mtx_init(&sc->data_lock, "data_mtx", "data_mtx", MTX_DEF); - cv_init(&sc->data_cv, "data_cv"); + sx_init(&sc->vchi_lock, device_get_nameunit(dev)); + sx_init(&sc->worker_lock, "bcm_audio_worker_lock"); + cv_init(&sc->worker_cv, "worker_cv"); sc->vchi_handle = VCHIQ_SERVICE_HANDLE_INVALID; /* @@ -850,16 +896,18 @@ bcm2835_audio_detach(device_t dev) sc = pcm_getdevinfo(dev); /* Stop worker thread */ + sx_xlock(&sc->worker_lock); sc->unloading = 1; - cv_signal(&sc->data_cv); + sx_xunlock(&sc->worker_lock); + cv_signal(&sc->worker_cv); r = pcm_unregister(dev); if (r) return r; - mtx_destroy(&sc->vchi_lock); - mtx_destroy(&sc->data_lock); - cv_destroy(&sc->data_cv); + sx_destroy(&sc->vchi_lock); + sx_destroy(&sc->worker_lock); + cv_destroy(&sc->worker_cv); bcm2835_audio_release(sc); From owner-svn-src-head@freebsd.org Mon Nov 7 18:21:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3503C35EFF; Mon, 7 Nov 2016 18:21:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 682CDB0B; Mon, 7 Nov 2016 18:21:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7ILr6q063284; Mon, 7 Nov 2016 18:21:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7ILrPu063282; Mon, 7 Nov 2016 18:21:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611071821.uA7ILrPu063282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 7 Nov 2016 18:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308425 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 18:21:54 -0000 Author: mav Date: Mon Nov 7 18:21:53 2016 New Revision: 308425 URL: https://svnweb.freebsd.org/changeset/base/308425 Log: Add support for EIIOE flag in Additional Element Status. It was added in SES-3 spec, and its support required to properly link the Additional Element Status page data to the original elements. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/scsi/scsi_enc_ses.c head/sys/cam/scsi/scsi_ses.h Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Mon Nov 7 17:38:39 2016 (r308424) +++ head/sys/cam/scsi/scsi_enc_ses.c Mon Nov 7 18:21:53 2016 (r308425) @@ -1758,14 +1758,20 @@ ses_process_elm_addlstatus(enc_softc_t * eip = ses_elm_addlstatus_eip(elm_hdr); if (eip && !ignore_index) { struct ses_elm_addlstatus_eip_hdr *eip_hdr; - int expected_index; + int expected_index, index; + ses_elem_index_type_t index_type; eip_hdr = (struct ses_elm_addlstatus_eip_hdr *)elm_hdr; - expected_index = iter.individual_element_index; + if (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) { + index_type = SES_ELEM_INDEX_GLOBAL; + expected_index = iter.global_element_index; + } else { + index_type = SES_ELEM_INDEX_INDIVIDUAL; + expected_index = iter.individual_element_index; + } titer = iter; telement = ses_iter_seek_to(&titer, - eip_hdr->element_index, - SES_ELEM_INDEX_INDIVIDUAL); + eip_hdr->element_index, index_type); if (telement != NULL && (ses_typehasaddlstatus(enc, titer.type_index) != TYPE_ADDLSTATUS_NONE || @@ -1775,13 +1781,18 @@ ses_process_elm_addlstatus(enc_softc_t * } else ignore_index = 1; - if (iter.individual_element_index > expected_index + if (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) + index = iter.global_element_index; + else + index = iter.individual_element_index; + if (index > expected_index && status_type == TYPE_ADDLSTATUS_MANDATORY) { - ENC_VLOG(enc, "%s: provided element " + ENC_VLOG(enc, "%s: provided %s element" "index %d skips mandatory status " " element at index %d\n", - __func__, eip_hdr->element_index, - expected_index); + __func__, (eip_hdr->byte2 & + SES_ADDL_EIP_EIIOE) ? "global " : "", + index, expected_index); } } elmpriv = element->elm_private; Modified: head/sys/cam/scsi/scsi_ses.h ============================================================================== --- head/sys/cam/scsi/scsi_ses.h Mon Nov 7 17:38:39 2016 (r308424) +++ head/sys/cam/scsi/scsi_ses.h Mon Nov 7 18:21:53 2016 (r308425) @@ -2413,7 +2413,8 @@ int ses_elm_addlstatus_invalid(struct se struct ses_elm_addlstatus_eip_hdr { struct ses_elm_addlstatus_base_hdr base; - uint8_t reserved; + uint8_t byte2; +#define SES_ADDL_EIP_EIIOE 1 uint8_t element_index; /* NB: This define (currently) applies to all eip=1 headers */ #define SES_EIP_HDR_EXTRA_LEN 2 From owner-svn-src-head@freebsd.org Mon Nov 7 18:22:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E795C35F62; Mon, 7 Nov 2016 18:22:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF859CE2; Mon, 7 Nov 2016 18:22:19 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D23961FE022; Mon, 7 Nov 2016 19:22:17 +0100 (CET) Subject: Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835 To: Oleksandr Tymoshenko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201611071738.uA7HceYu045944@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Mon, 7 Nov 2016 19:27:28 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201611071738.uA7HceYu045944@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 18:22:20 -0000 On 11/07/16 18:38, Oleksandr Tymoshenko wrote: > + bcm2835_audio_unlock(sc); > + cv_signal(&sc->worker_cv); Shouldn't cv_signal() be done locked, so that you don't loose any transactions? CV's only wakeup the treads that are sleeping right there and then. --HPS From owner-svn-src-head@freebsd.org Mon Nov 7 19:24:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E34BAC3508B; Mon, 7 Nov 2016 19:24:12 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9801D53; Mon, 7 Nov 2016 19:24:12 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from [208.184.220.60] (helo=[10.112.202.233]) by id.bluezbox.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87 (FreeBSD)) (envelope-from ) id 1c3pWX-000MiN-7D; Mon, 07 Nov 2016 11:24:05 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835 From: Oleksandr Tymoshenko In-Reply-To: Date: Mon, 7 Nov 2016 11:23:36 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <680D84F2-65BF-48DD-8D11-311B1F65A634@freebsd.org> References: <201611071738.uA7HceYu045944@repo.freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3251) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: > On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky wrote: > > On 11/07/16 18:38, Oleksandr Tymoshenko wrote: >> + bcm2835_audio_unlock(sc); >> + cv_signal(&sc->worker_cv); > > > Shouldn't cv_signal() be done locked, so that you don't loose any transactions? CV's only wakeup the treads that are sleeping right there and then. [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 19:24:13 -0000 > On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky = wrote: >=20 > On 11/07/16 18:38, Oleksandr Tymoshenko wrote: >> + bcm2835_audio_unlock(sc); >> + cv_signal(&sc->worker_cv); >=20 >=20 > Shouldn't cv_signal() be done locked, so that you don't loose any = transactions? CV's only wakeup the treads that are sleeping right there = and then. Hi Hans,=20 In this case it doesn=E2=80=99t matter. bcm2835_audio_xxx lock functions = are used to keep channel state consistent. The actual audio hw = reprogramming happens in worker thread which only picks up latest state = of the virtual channel, there is no need to run every transaction in = sequence.=20 From owner-svn-src-head@freebsd.org Mon Nov 7 19:27:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEF8CC350FE; Mon, 7 Nov 2016 19:27:15 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7395DF20; Mon, 7 Nov 2016 19:27:14 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D04D21FE022; Mon, 7 Nov 2016 20:27:06 +0100 (CET) Subject: Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835 To: Oleksandr Tymoshenko References: <201611071738.uA7HceYu045944@repo.freebsd.org> <680D84F2-65BF-48DD-8D11-311B1F65A634@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Mon, 7 Nov 2016 20:32:17 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <680D84F2-65BF-48DD-8D11-311B1F65A634@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 19:27:15 -0000 On 11/07/16 20:23, Oleksandr Tymoshenko wrote: > >> On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky wrote: >> >> On 11/07/16 18:38, Oleksandr Tymoshenko wrote: >>> + bcm2835_audio_unlock(sc); >>> + cv_signal(&sc->worker_cv); >> >> >> Shouldn't cv_signal() be done locked, so that you don't loose any transactions? CV's only wakeup the treads that are sleeping right there and then. > > Hi Hans, > > In this case it doesn’t matter. bcm2835_audio_xxx lock functions are used to keep channel state consistent. The actual audio hw reprogramming happens in worker thread which only picks up latest state of the virtual channel, there is no need to run every transaction in sequence. > Hi, It is not about running in sequence, but that if the worker thread is not sleeping, but on the way to sleep, it will never get woken up unless you use proper locks here! --HPS From owner-svn-src-head@freebsd.org Mon Nov 7 19:46:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 547EAC354D9; Mon, 7 Nov 2016 19:46:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3ACAB7B; Mon, 7 Nov 2016 19:46:30 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 105DB1FE022; Mon, 7 Nov 2016 20:46:29 +0100 (CET) Subject: Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835 To: Oleksandr Tymoshenko References: <201611071738.uA7HceYu045944@repo.freebsd.org> <680D84F2-65BF-48DD-8D11-311B1F65A634@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <2b03afc6-9bfa-1124-7b70-2532751bfed9@selasky.org> Date: Mon, 7 Nov 2016 20:51:39 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------470FDF2C15B0D23E906DFD84" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 19:46:31 -0000 This is a multi-part message in MIME format. --------------470FDF2C15B0D23E906DFD84 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 11/07/16 20:32, Hans Petter Selasky wrote: > On 11/07/16 20:23, Oleksandr Tymoshenko wrote: >> >>> On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky >>> wrote: >>> >>> On 11/07/16 18:38, Oleksandr Tymoshenko wrote: >>>> + bcm2835_audio_unlock(sc); >>>> + cv_signal(&sc->worker_cv); >>> >>> >>> Shouldn't cv_signal() be done locked, so that you don't loose any >>> transactions? CV's only wakeup the treads that are sleeping right >>> there and then. >> >> Hi Hans, >> >> In this case it doesn’t matter. bcm2835_audio_xxx lock functions are >> used to keep channel state consistent. The actual audio hw >> reprogramming happens in worker thread which only picks up latest >> state of the virtual channel, there is no need to run every >> transaction in sequence. >> > > Hi, > > It is not about running in sequence, but that if the worker thread is > not sleeping, but on the way to sleep, it will never get woken up unless > you use proper locks here! > > --HPS Hi, Also the teardown sequence for the worker thread looks a bit broken, that it doesn't wait for the thread to exit. I've made a patch, attached which I think is the right way to do it. Try opening and closing /dev/dsp in a loop with some DSP ioctls and see what happens. --HPS --------------470FDF2C15B0D23E906DFD84 Content-Type: text/x-patch; name="bcm2835_audio.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bcm2835_audio.diff" Index: sys/arm/broadcom/bcm2835/bcm2835_audio.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_audio.c (revision 308426) +++ sys/arm/broadcom/bcm2835/bcm2835_audio.c (working copy) @@ -149,6 +149,14 @@ } static void +bcm2835_wakeup_worker(struct bcm2835_audio_info *sc) +{ + sx_xlock(&sc->worker_lock); + cv_signal(&sc->worker_cv); + sx_xunlock(&sc->worker_lock); +} + +static void bcm2835_audio_callback(void *param, const VCHI_CALLBACK_REASON_T reason, void *msg_handle) { struct bcm2835_audio_info *sc = (struct bcm2835_audio_info *)param; @@ -540,6 +548,8 @@ } } } + sc->unloading = 2; + cv_signal(&sc->worker_cv); sx_sunlock(&sc->worker_lock); kproc_exit(0); @@ -586,8 +596,9 @@ } sc->parameters_update_pending = true; - cv_signal(&sc->worker_cv); + bcm2835_wakeup_worker(sc); + return ch; } @@ -615,7 +626,7 @@ sc->parameters_update_pending = true; bcm2835_audio_unlock(sc); - cv_signal(&sc->worker_cv); + bcm2835_wakeup_worker(sc); return 0; } @@ -631,7 +642,7 @@ sc->parameters_update_pending = true; bcm2835_audio_unlock(sc); - cv_signal(&sc->worker_cv); + bcm2835_wakeup_worker(sc); return ch->spd; } @@ -662,8 +673,7 @@ bcm2835_audio_unlock(sc); /* kickstart data flow */ chn_intr(sc->pch.channel); - /* wakeup worker thread */ - cv_signal(&sc->worker_cv); + bcm2835_wakeup_worker(sc); break; case PCMTRIG_STOP: @@ -671,7 +681,7 @@ bcm2835_audio_lock(sc); ch->playback_state = PLAYBACK_STOPPING; bcm2835_audio_unlock(sc); - cv_signal(&sc->worker_cv); + bcm2835_wakeup_worker(sc); break; default: @@ -738,7 +748,8 @@ sc->volume = left; sc->controls_update_pending = true; bcm2835_audio_unlock(sc); - cv_signal(&sc->worker_cv); + + bcm2835_wakeup_worker(sc); break; default: @@ -776,7 +787,7 @@ sc->controls_update_pending = true; bcm2835_audio_unlock(sc); - cv_signal(&sc->worker_cv); + bcm2835_wakeup_worker(sc); device_printf(sc->dev, "destination set to %s\n", dest_description(val)); return (0); @@ -898,8 +909,11 @@ /* Stop worker thread */ sx_xlock(&sc->worker_lock); sc->unloading = 1; + cv_signal(&sc->worker_cv); + /* Wait for thread to exit */ + while (sc->unloading != 2) + cv_wait_sig(&sc->worker_cv, &sc->worker_lock); sx_xunlock(&sc->worker_lock); - cv_signal(&sc->worker_cv); r = pcm_unregister(dev); if (r) --------------470FDF2C15B0D23E906DFD84-- From owner-svn-src-head@freebsd.org Mon Nov 7 20:02:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85D71C35973; Mon, 7 Nov 2016 20:02:19 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 509168CF; Mon, 7 Nov 2016 20:02:19 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7K2IC1003508; Mon, 7 Nov 2016 20:02:18 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7K2IxD003507; Mon, 7 Nov 2016 20:02:18 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201611072002.uA7K2IxD003507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 7 Nov 2016 20:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308427 - head/sys/cddl/dev/dtrace/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 20:02:19 -0000 Author: gonzo Date: Mon Nov 7 20:02:18 2016 New Revision: 308427 URL: https://svnweb.freebsd.org/changeset/base/308427 Log: Fix include order as required post r308415 Modified: head/sys/cddl/dev/dtrace/arm/dtrace_asm.S Modified: head/sys/cddl/dev/dtrace/arm/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_asm.S Mon Nov 7 18:29:21 2016 (r308426) +++ head/sys/cddl/dev/dtrace/arm/dtrace_asm.S Mon Nov 7 20:02:18 2016 (r308427) @@ -32,8 +32,8 @@ #include #include -#include #include +#include #include "assym.s" From owner-svn-src-head@freebsd.org Mon Nov 7 20:17:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2BCAC35CFC; Mon, 7 Nov 2016 20:17:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x233.google.com (mail-qt0-x233.google.com [IPv6:2607:f8b0:400d:c0d::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F369FBA; Mon, 7 Nov 2016 20:17:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x233.google.com with SMTP id p16so94661896qta.0; Mon, 07 Nov 2016 12:17:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oL1CYgVpngErDgXYqZe9aeOmIUn+lxOR1A+Mboc+xi4=; b=R8qFywVO9S/YSj9nAOQms5xd0T4ov/zuy5WFMopxG9M1v9uehtHYXhXBcoAj5yrTSE h3NNb7Iuf93F7sYJqVfsENfSiguP9YC7tAqqK1u6dD6uhJa+VbQo49b2VX3d7/L17rgu rCQDasP7NyrytjXgCdk8PYaCsQNb4S/pItnvM1E76CdDLbjKjzqSJkGB4TU8uBpsJG/p 2Femi9rz32ixCLcKVkUWNoh6r8Jk00yR+oZseOd1g2+9NzdzWupNF6Hhf43ofJe1USDA +jedwNw6KoKuw25RAdJmjqQcgyoKF5Gq2OayTPRCINRAgp0od1I8+Cgitl++xB8tKeA5 Iyig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oL1CYgVpngErDgXYqZe9aeOmIUn+lxOR1A+Mboc+xi4=; b=l72rr9uxhdlZ7uBTRN9yjeIDwsyU+cugdI0Fx589Xg+Li5h0IGq7dJUZ12qEZopp2q Xecya6kvFonaJb5LmXmlnQyGR2YNkVD4Fw9p47nIyQ0gq9dyQS7XWIS+CM1INelYbeBW rzYy6W3NUkR8WbqHb4Q7v20SOb5KY8lMuDeKpuYiok6KN/NGqhmQ+lDNtt/JKpkAn57B gNFsyvAOJtmigwSBIKw3ZBz0n+Q0H5JJT2Gyj13qQ4PZVRCufM32OlVs+0uMPlwTCOlL yKrruuVKPkZjwly4hSOd7762FFyKrp5v/5u42aq2cX9Y8edzPVQRhQUPd0ceASmQG2kZ 3yow== X-Gm-Message-State: ABUngvdvfZi/EAYocerJSZspbCcuTPmbGXwQM8sH/wV9A3MBFCgajsQr1OX8Dn6aVrUDyvm9xVrw+pFwSDGopA== X-Received: by 10.237.57.137 with SMTP id m9mr8087246qte.35.1478549848256; Mon, 07 Nov 2016 12:17:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.29.66 with HTTP; Mon, 7 Nov 2016 12:17:27 -0800 (PST) In-Reply-To: <201611022318.uA2NIGla049356@repo.freebsd.org> References: <201611022318.uA2NIGla049356@repo.freebsd.org> From: Ngie Cooper Date: Mon, 7 Nov 2016 12:17:27 -0800 Message-ID: Subject: Re: svn commit: r308230 - head/sys/dev/ioat To: "Conrad E. Meyer" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 20:17:29 -0000 On Wed, Nov 2, 2016 at 4:18 PM, Conrad E. Meyer wrote: > Author: cem > Date: Wed Nov 2 23:18:16 2016 > New Revision: 308230 > URL: https://svnweb.freebsd.org/changeset/base/308230 > > Log: > ioat(4): Read CHANSTS register for suspended/halted checks > > The device doesn't accurately update the CHANCMP address with the device state > when the device is suspended or halted. So, read the CHANSTS register to check > for those states. > > We still need to read the CHANCMP address for the last completed descriptor. > > Sponsored by: Dell EMC Isilon Did anyone review this change, either external or internal to Isilon? Thanks, -Ngie From owner-svn-src-head@freebsd.org Mon Nov 7 20:31:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF862C35357; Mon, 7 Nov 2016 20:31:07 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B999AF4B; Mon, 7 Nov 2016 20:31:07 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from [208.184.220.60] (helo=[10.112.202.233]) by id.bluezbox.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87 (FreeBSD)) (envelope-from ) id 1c3qZN-000Mta-Pf; Mon, 07 Nov 2016 12:31:06 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835 From: Oleksandr Tymoshenko In-Reply-To: <2b03afc6-9bfa-1124-7b70-2532751bfed9@selasky.org> Date: Mon, 7 Nov 2016 12:30:35 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201611071738.uA7HceYu045944@repo.freebsd.org> <680D84F2-65BF-48DD-8D11-311B1F65A634@freebsd.org> <2b03afc6-9bfa-1124-7b70-2532751bfed9@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3251) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: > On Nov 7, 2016, at 11:51 AM, Hans Petter Selasky wrote: > > On 11/07/16 20:32, Hans Petter Selasky wrote: >> On 11/07/16 20:23, Oleksandr Tymoshenko wrote: >>> >>>> On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky >>>> wrote: >>>> >>>> On 11/07/16 18:38, Oleksandr Tymoshenko wrote: >>>>> + bcm2835_audio_unlock(sc); >>>>> + cv_signal(&sc->worker_cv); >>>> >>>> >>>> Shouldn't cv_signal() be done locked, so that you don't loose any >>>> transactions? CV's only wakeup the treads that are sleeping right >>>> there and then. >>> >>> Hi Hans, >>> >>> In this case it doesn’t matter. bcm2835_audio_xxx lock functions are >>> used to keep channel state consistent. The actual audio hw >>> reprogramming happens in worker thread which only picks up latest >>> state of the virtual channel, there is no need to run every >>> transaction in sequence. >>> >> >> Hi, >> >> It is not about running in sequence, but that if the worker thread is >> not sleeping, but on the way to sleep, it will never get woken up unless >> you use proper locks here! >> >> --HPS > > Hi, > > Also the teardown sequence for the worker thread looks a bit broken, that it doesn't wait for the thread to exit. > > I've made a patch, attached which I think is the right way to do it. > > Try opening and closing /dev/dsp in a loop with some DSP ioctls and see what happens. [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 20:31:08 -0000 > On Nov 7, 2016, at 11:51 AM, Hans Petter Selasky = wrote: >=20 > On 11/07/16 20:32, Hans Petter Selasky wrote: >> On 11/07/16 20:23, Oleksandr Tymoshenko wrote: >>>=20 >>>> On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky >>>> wrote: >>>>=20 >>>> On 11/07/16 18:38, Oleksandr Tymoshenko wrote: >>>>> + bcm2835_audio_unlock(sc); >>>>> + cv_signal(&sc->worker_cv); >>>>=20 >>>>=20 >>>> Shouldn't cv_signal() be done locked, so that you don't loose any >>>> transactions? CV's only wakeup the treads that are sleeping right >>>> there and then. >>>=20 >>> Hi Hans, >>>=20 >>> In this case it doesn=E2=80=99t matter. bcm2835_audio_xxx lock = functions are >>> used to keep channel state consistent. The actual audio hw >>> reprogramming happens in worker thread which only picks up latest >>> state of the virtual channel, there is no need to run every >>> transaction in sequence. >>>=20 >>=20 >> Hi, >>=20 >> It is not about running in sequence, but that if the worker thread is >> not sleeping, but on the way to sleep, it will never get woken up = unless >> you use proper locks here! >>=20 >> --HPS >=20 > Hi, >=20 > Also the teardown sequence for the worker thread looks a bit broken, = that it doesn't wait for the thread to exit. >=20 > I've made a patch, attached which I think is the right way to do it. >=20 > Try opening and closing /dev/dsp in a loop with some DSP ioctls and = see what happens. Thanks for patch Hans. Looks good to me. I=E2=80=99ll test and commit = it.=20= From owner-svn-src-head@freebsd.org Mon Nov 7 21:15:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34EC3C342E7; Mon, 7 Nov 2016 21:15:41 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1007C8C; Mon, 7 Nov 2016 21:15:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7LFeWQ032039; Mon, 7 Nov 2016 21:15:40 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7LFdwM032034; Mon, 7 Nov 2016 21:15:39 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201611072115.uA7LFdwM032034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 7 Nov 2016 21:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308428 - in head/sys: conf dev/gpio modules/gpio/gpioled X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 21:15:41 -0000 Author: gonzo Date: Mon Nov 7 21:15:39 2016 New Revision: 308428 URL: https://svnweb.freebsd.org/changeset/base/308428 Log: Refactor FDT part of gpioled driver - Split driver in two parts: FDT and non-FDT - Instead of reattach gpioled nodes to GPIO bus use gpio_pin_get_by_ofw_idx and add ofwbus and simplebus as parrent buses Reviewed by: loos Differential Revision: https://reviews.freebsd.org/D8233 Added: head/sys/dev/gpio/gpioled_fdt.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/gpio/gpioled.c head/sys/modules/gpio/gpioled/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Nov 7 20:02:18 2016 (r308427) +++ head/sys/conf/files Mon Nov 7 21:15:39 2016 (r308428) @@ -1612,7 +1612,8 @@ dev/gpio/gpiobus.c optional gpio \ dev/gpio/gpioc.c optional gpio \ dependency "gpio_if.h" dev/gpio/gpioiic.c optional gpioiic -dev/gpio/gpioled.c optional gpioled +dev/gpio/gpioled.c optional gpioled !fdt +dev/gpio/gpioled_fdt.c optional gpioled fdt dev/gpio/gpioregulator.c optional gpioregulator fdt ext_resources dev/gpio/gpiospi.c optional gpiospi dev/gpio/gpio_if.m optional gpio Modified: head/sys/dev/gpio/gpioled.c ============================================================================== --- head/sys/dev/gpio/gpioled.c Mon Nov 7 20:02:18 2016 (r308427) +++ head/sys/dev/gpio/gpioled.c Mon Nov 7 21:15:39 2016 (r308428) @@ -39,11 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef FDT -#include -#include -#endif - #include #include @@ -91,66 +86,9 @@ gpioled_control(void *priv, int onoff) GPIOLED_UNLOCK(sc); } -#ifdef FDT -static void -gpioled_identify(driver_t *driver, device_t bus) -{ - phandle_t child, leds, root; - - root = OF_finddevice("/"); - if (root == 0) - return; - for (leds = OF_child(root); leds != 0; leds = OF_peer(leds)) { - if (!fdt_is_compatible_strict(leds, "gpio-leds")) - continue; - /* Traverse the 'gpio-leds' node and add its children. */ - for (child = OF_child(leds); child != 0; child = OF_peer(child)) { - if (!OF_hasprop(child, "gpios")) - continue; - if (ofw_gpiobus_add_fdt_child(bus, driver->name, child) == NULL) - continue; - } - } -} -#endif - static int gpioled_probe(device_t dev) { -#ifdef FDT - int match; - phandle_t node; - char *compat; - - /* - * We can match against our own node compatible string and also against - * our parent node compatible string. The first is normally used to - * describe leds on a gpiobus and the later when there is a common node - * compatible with 'gpio-leds' which is used to concentrate all the - * leds nodes on the dts. - */ - match = 0; - if (ofw_bus_is_compatible(dev, "gpioled")) - match = 1; - - if (match == 0) { - if ((node = ofw_bus_get_node(dev)) == -1) - return (ENXIO); - if ((node = OF_parent(node)) == -1) - return (ENXIO); - if (OF_getprop_alloc(node, "compatible", 1, - (void **)&compat) == -1) - return (ENXIO); - - if (strcasecmp(compat, "gpio-leds") == 0) - match = 1; - - OF_prop_free(compat); - } - - if (match == 0) - return (ENXIO); -#endif device_set_desc(dev, "GPIO led"); return (BUS_PROBE_DEFAULT); @@ -161,13 +99,7 @@ gpioled_attach(device_t dev) { struct gpioled_softc *sc; int state; -#ifdef FDT - phandle_t node; - char *default_state; - char *name; -#else const char *name; -#endif sc = device_get_softc(dev); sc->sc_dev = dev; @@ -176,42 +108,14 @@ gpioled_attach(device_t dev) state = 0; -#ifdef FDT - if ((node = ofw_bus_get_node(dev)) == -1) - return (ENXIO); - - if (OF_getprop_alloc(node, "default-state", - sizeof(char), (void **)&default_state) != -1) { - if (strcasecmp(default_state, "on") == 0) - state = 1; - else if (strcasecmp(default_state, "off") == 0) - state = 0; - else if (strcasecmp(default_state, "keep") == 0) - state = -1; - else { - device_printf(dev, - "unknown value for default-state in FDT\n"); - } - OF_prop_free(default_state); - } - - name = NULL; - if (OF_getprop_alloc(node, "label", 1, (void **)&name) == -1) - OF_getprop_alloc(node, "name", 1, (void **)&name); -#else if (resource_string_value(device_get_name(dev), device_get_unit(dev), "name", &name)) name = NULL; resource_int_value(device_get_name(dev), device_get_unit(dev), "invert", &sc->sc_invert); -#endif sc->sc_leddev = led_create_state(gpioled_control, sc, name ? name : device_get_nameunit(dev), state); -#ifdef FDT - if (name != NULL) - OF_prop_free(name); -#endif return (0); } @@ -234,9 +138,6 @@ static devclass_t gpioled_devclass; static device_method_t gpioled_methods[] = { /* Device interface */ -#ifdef FDT - DEVMETHOD(device_identify, gpioled_identify), -#endif DEVMETHOD(device_probe, gpioled_probe), DEVMETHOD(device_attach, gpioled_attach), DEVMETHOD(device_detach, gpioled_detach), Added: head/sys/dev/gpio/gpioled_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gpio/gpioled_fdt.c Mon Nov 7 21:15:39 2016 (r308428) @@ -0,0 +1,230 @@ +/*- + * Copyright (c) 2009 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "gpiobus_if.h" + +struct gpioled +{ + struct gpioleds_softc *parent_sc; + gpio_pin_t pin; + struct cdev *leddev; +}; + +struct gpioleds_softc +{ + device_t sc_dev; + device_t sc_busdev; + struct gpioled *sc_leds; + int sc_total_leds; +}; + +static void gpioled_control(void *, int); +static int gpioled_probe(device_t); +static int gpioled_attach(device_t); +static int gpioled_detach(device_t); + +static void +gpioled_control(void *priv, int onoff) +{ + struct gpioled *led; + + led = (struct gpioled *)priv; + if (led->pin) + gpio_pin_set_active(led->pin, onoff); +} + +static void +gpioleds_attach_led(struct gpioleds_softc *sc, phandle_t node, + struct gpioled *led) +{ + char *name; + int state, err; + char *default_state; + + led->parent_sc = sc; + + state = 0; + if (OF_getprop_alloc(node, "default-state", + sizeof(char), (void **)&default_state) != -1) { + if (strcasecmp(default_state, "on") == 0) + state = 1; + else if (strcasecmp(default_state, "off") == 0) + state = 0; + else if (strcasecmp(default_state, "keep") == 0) + state = -1; + else { + state = -1; + device_printf(sc->sc_dev, + "unknown value for default-state in FDT\n"); + } + OF_prop_free(default_state); + } + + name = NULL; + if (OF_getprop_alloc(node, "label", 1, (void **)&name) == -1) + OF_getprop_alloc(node, "name", 1, (void **)&name); + + if (name == NULL) { + device_printf(sc->sc_dev, + "no name provided for gpio LED, skipping\n"); + return; + } + + err = gpio_pin_get_by_ofw_idx(sc->sc_dev, node, 0, &led->pin); + if (err) { + device_printf(sc->sc_dev, "<%s> failed to map pin\n", name); + if (name) + OF_prop_free(name); + return; + } + gpio_pin_setflags(led->pin, GPIO_PIN_OUTPUT); + + led->leddev = led_create_state(gpioled_control, led, name, + state); + + if (name != NULL) + OF_prop_free(name); +} + +static void +gpioleds_detach_led(struct gpioled *led) +{ + + if (led->leddev != NULL) + led_destroy(led->leddev); + + if (led->pin) + gpio_pin_release(led->pin); +} + +static int +gpioled_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "gpio-leds")) + return (ENXIO); + + device_set_desc(dev, "GPIO LEDs"); + + return (BUS_PROBE_DEFAULT); +} + +static int +gpioled_attach(device_t dev) +{ + struct gpioleds_softc *sc; + phandle_t child, leds; + int total_leds; + + if ((leds = ofw_bus_get_node(dev)) == -1) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_busdev = device_get_parent(dev); + + /* Traverse the 'gpio-leds' node and count leds */ + total_leds = 0; + for (child = OF_child(leds); child != 0; child = OF_peer(child)) { + if (!OF_hasprop(child, "gpios")) + continue; + total_leds++; + } + + if (total_leds) { + sc->sc_leds = malloc(sizeof(struct gpioled) * total_leds, + M_DEVBUF, M_WAITOK | M_ZERO); + + sc->sc_total_leds = 0; + /* Traverse the 'gpio-leds' node and count leds */ + for (child = OF_child(leds); child != 0; child = OF_peer(child)) { + if (!OF_hasprop(child, "gpios")) + continue; + gpioleds_attach_led(sc, child, &sc->sc_leds[sc->sc_total_leds]); + sc->sc_total_leds++; + } + } + + return (0); +} + +static int +gpioled_detach(device_t dev) +{ + struct gpioleds_softc *sc; + int i; + + sc = device_get_softc(dev); + + for (i = 0; i < sc->sc_total_leds; i++) + gpioleds_detach_led(&sc->sc_leds[i]); + + if (sc->sc_leds) + free(sc->sc_leds, M_DEVBUF); + + return (0); +} + +static devclass_t gpioled_devclass; + +static device_method_t gpioled_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, gpioled_probe), + DEVMETHOD(device_attach, gpioled_attach), + DEVMETHOD(device_detach, gpioled_detach), + + DEVMETHOD_END +}; + +static driver_t gpioled_driver = { + "gpioled", + gpioled_methods, + sizeof(struct gpioleds_softc), +}; + +DRIVER_MODULE(gpioled, ofwbus, gpioled_driver, gpioled_devclass, 0, 0); +DRIVER_MODULE(gpioled, simplebus, gpioled_driver, gpioled_devclass, 0, 0); +MODULE_DEPEND(gpioled, gpiobus, 1, 1, 1); Modified: head/sys/modules/gpio/gpioled/Makefile ============================================================================== --- head/sys/modules/gpio/gpioled/Makefile Mon Nov 7 20:02:18 2016 (r308427) +++ head/sys/modules/gpio/gpioled/Makefile Mon Nov 7 21:15:39 2016 (r308428) @@ -32,7 +32,11 @@ .PATH: ${.CURDIR}/../../../dev/gpio/ KMOD= gpioled +.if !empty(OPT_FDT) +SRCS= gpioled_fdt.c +.else SRCS= gpioled.c +.endif SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h ofw_bus_if.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ From owner-svn-src-head@freebsd.org Mon Nov 7 22:24:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2686C35817; Mon, 7 Nov 2016 22:24:38 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7817A36; Mon, 7 Nov 2016 22:24:38 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7MObCj058914; Mon, 7 Nov 2016 22:24:37 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7MOb9Y058913; Mon, 7 Nov 2016 22:24:37 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201611072224.uA7MOb9Y058913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 7 Nov 2016 22:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308429 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 22:24:39 -0000 Author: sbruno Date: Mon Nov 7 22:24:37 2016 New Revision: 308429 URL: https://svnweb.freebsd.org/changeset/base/308429 Log: The igb driver currently requires a VF interface to have a non-zero MAC address, but the associated PF is giving the VF an all zeros MAC address when one is not administratively assigned. The driver should check for this case and generate a random address, similar to how the linux igbvf driver does. Submitted by: skoumjian@juniper.net (Scott Koumjian) MFH: 2 weeks Differential Revision: https://reviews.freebsd.org/D8399 Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Mon Nov 7 21:15:39 2016 (r308428) +++ head/sys/dev/e1000/if_igb.c Mon Nov 7 22:24:37 2016 (r308429) @@ -590,11 +590,20 @@ igb_attach(device_t dev) error = EIO; goto err_late; } - /* Check its sanity */ - if (!igb_is_valid_ether_addr(adapter->hw.mac.addr)) { - device_printf(dev, "Invalid MAC address\n"); - error = EIO; - goto err_late; + + /* Check its sanity */ + if (!igb_is_valid_ether_addr(adapter->hw.mac.addr)) { + if (adapter->vf_ifp) { + u8 addr[ETHER_ADDR_LEN]; + arc4rand(&addr, sizeof(addr), 0); + addr[0] &= 0xFE; + addr[0] |= 0x02; + bcopy(addr, adapter->hw.mac.addr, sizeof(addr)); + } else { + device_printf(dev, "Invalid MAC address\n"); + error = EIO; + goto err_late; + } } /* Setup OS specific network interface */ From owner-svn-src-head@freebsd.org Mon Nov 7 22:41:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2535DC35AAF; Mon, 7 Nov 2016 22:41:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0D2919A; Mon, 7 Nov 2016 22:41:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA7Mfr4g065931; Mon, 7 Nov 2016 22:41:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA7MfqgC065929; Mon, 7 Nov 2016 22:41:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611072241.uA7MfqgC065929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 7 Nov 2016 22:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308430 - head/contrib/elftoolchain/libelftc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 22:41:54 -0000 Author: emaste Date: Mon Nov 7 22:41:52 2016 New Revision: 308430 URL: https://svnweb.freebsd.org/changeset/base/308430 Log: libelftc: add elf{32,64}-tradbigmips target emulation names Reported by: theraven Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Mon Nov 7 22:24:37 2016 (r308429) +++ head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Mon Nov 7 22:41:52 2016 (r308430) @@ -82,6 +82,7 @@ Known descriptor names and their propert .It Li elf32-shbig-linux Ta ELF Ta MSB Ta 32 .It Li elf32-shl-linux Ta ELF Ta LSB Ta 32 .It Li elf32-sparc Ta ELF Ta MSB Ta 32 +.It Li elf32-tradbigmips Ta ELF Ta MSB Ta 32 .It Li elf64-alpha Ta ELF Ta LSB Ta 64 .It Li elf64-alpha-freebsd Ta ELF Ta LSB Ta 64 .It Li elf64-big Ta ELF Ta MSB Ta 64 @@ -101,6 +102,7 @@ Known descriptor names and their propert .It Li elf64-sh64-linux Ta ELF Ta LSB Ta 64 .It Li elf64-sparc Ta ELF Ta MSB Ta 64 .It Li elf64-sparc-freebsd Ta ELF Ta MSB Ta 64 +.It Li elf64-tradbigmips Ta ELF Ta MSB Ta 64 .It Li elf64-x86-64 Ta ELF Ta LSB Ta 64 .It Li elf64-x86-64-freebsd Ta ELF Ta LSB Ta 64 .It Li ihex Ta IHEX Ta - Ta - Modified: head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon Nov 7 22:24:37 2016 (r308429) +++ head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon Nov 7 22:41:52 2016 (r308430) @@ -195,6 +195,14 @@ struct _Elftc_Bfd_Target _libelftc_targe }, { + .bt_name = "elf32-tradbigmips", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2MSB, + .bt_elfclass = ELFCLASS32, + .bt_machine = EM_MIPS, + }, + + { .bt_name = "elf64-alpha", .bt_type = ETF_ELF, .bt_byteorder = ELFDATA2LSB, @@ -351,6 +359,14 @@ struct _Elftc_Bfd_Target _libelftc_targe }, { + .bt_name = "elf64-tradbigmips", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2MSB, + .bt_elfclass = ELFCLASS64, + .bt_machine = EM_MIPS, + }, + + { .bt_name = "elf64-x86-64", .bt_type = ETF_ELF, .bt_byteorder = ELFDATA2LSB, From owner-svn-src-head@freebsd.org Tue Nov 8 00:05:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A215C3527D; Tue, 8 Nov 2016 00:05:22 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com [209.85.214.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BF0FDF0; Tue, 8 Nov 2016 00:05:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f42.google.com with SMTP id u205so165822015itc.0; Mon, 07 Nov 2016 16:05:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=YMmr+lylwwVw2fotgDXGzn0QwwH92wOzO7Crrqiqs/I=; b=L1jK7cTofZeAwbK+s/Q7ZQaBUfAj7T0v56YtXNxpK6zvwLBkwCYpHwM9X/PGj00SNl 34U2pfDgEFPZ73jhQInjy4j0mbWolVDySdf/zSwqp+5u5Lkzf8/Wh2iSDAqJ4CJ5tnXB rTZSTTjApeANElMLv2oaNPZU2RrFgPnBZuEGDoVt9fGmntzyJggQ5wFFUIGJLDIbVKC2 Sj/Aw/yiSRxmlGi/HgXKu6nc7C7pZUyS3REoiDKXuVx6E++K8JWevfEUhjmd6WJWX6UE AEd2kNI7pq+ViB7YzSfWseXMr70WibMZQRf98L1uG0G95syV2hkMTRWzHB1VIn5xcdh/ rFIw== X-Gm-Message-State: ABUngveFiteGE7vY+Sf8z0sSUrAYuA4PohBBk1JTIzGF5JgwSprPPbHtH29kzD8wcnwJjA== X-Received: by 10.36.69.155 with SMTP id c27mr7920427itd.1.1478553617896; Mon, 07 Nov 2016 13:20:17 -0800 (PST) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com. [209.85.214.48]) by smtp.gmail.com with ESMTPSA id 145sm4865569itg.7.2016.11.07.13.20.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 13:20:17 -0800 (PST) Received: by mail-it0-f48.google.com with SMTP id e187so115617163itc.0; Mon, 07 Nov 2016 13:20:17 -0800 (PST) X-Received: by 10.107.140.65 with SMTP id o62mr9660386iod.17.1478553613721; Mon, 07 Nov 2016 13:20:13 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.199 with HTTP; Mon, 7 Nov 2016 13:20:13 -0800 (PST) In-Reply-To: References: <201611022318.uA2NIGla049356@repo.freebsd.org> From: Conrad Meyer Date: Mon, 7 Nov 2016 13:20:13 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r308230 - head/sys/dev/ioat To: Ngie Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 00:05:22 -0000 Nope. On Mon, Nov 7, 2016 at 12:17 PM, Ngie Cooper wrote: > On Wed, Nov 2, 2016 at 4:18 PM, Conrad E. Meyer wrote: >> Author: cem >> Date: Wed Nov 2 23:18:16 2016 >> New Revision: 308230 >> URL: https://svnweb.freebsd.org/changeset/base/308230 >> >> Log: >> ioat(4): Read CHANSTS register for suspended/halted checks >> >> The device doesn't accurately update the CHANCMP address with the device state >> when the device is suspended or halted. So, read the CHANSTS register to check >> for those states. >> >> We still need to read the CHANCMP address for the last completed descriptor. >> >> Sponsored by: Dell EMC Isilon > > Did anyone review this change, either external or internal to Isilon? > Thanks, > -Ngie From owner-svn-src-head@freebsd.org Tue Nov 8 00:24:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B1CEC357F6; Tue, 8 Nov 2016 00:24:50 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E551A89; Tue, 8 Nov 2016 00:24:50 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA80OndQ005630; Tue, 8 Nov 2016 00:24:49 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA80OnZu005627; Tue, 8 Nov 2016 00:24:49 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201611080024.uA80OnZu005627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 8 Nov 2016 00:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308431 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 00:24:50 -0000 Author: scottl Date: Tue Nov 8 00:24:49 2016 New Revision: 308431 URL: https://svnweb.freebsd.org/changeset/base/308431 Log: Convert the Q-Pair and PRP list memory allocations to use BUSDMA. Add a bunch of safery belts and error handling in related codepaths. Reviewed by: jimharris Obtained from: Netflix Differential Revision: D8453 Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Mon Nov 7 22:41:52 2016 (r308430) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Nov 8 00:24:49 2016 (r308431) @@ -80,11 +80,12 @@ nvme_ctrlr_allocate_bar(struct nvme_cont return (0); } -static void +static int nvme_ctrlr_construct_admin_qpair(struct nvme_controller *ctrlr) { struct nvme_qpair *qpair; uint32_t num_entries; + int error; qpair = &ctrlr->adminq; @@ -105,12 +106,13 @@ nvme_ctrlr_construct_admin_qpair(struct * The admin queue's max xfer size is treated differently than the * max I/O xfer size. 16KB is sufficient here - maybe even less? */ - nvme_qpair_construct(qpair, - 0, /* qpair ID */ - 0, /* vector */ - num_entries, - NVME_ADMIN_TRACKERS, - ctrlr); + error = nvme_qpair_construct(qpair, + 0, /* qpair ID */ + 0, /* vector */ + num_entries, + NVME_ADMIN_TRACKERS, + ctrlr); + return (error); } static int @@ -118,7 +120,7 @@ nvme_ctrlr_construct_io_qpairs(struct nv { struct nvme_qpair *qpair; union cap_lo_register cap_lo; - int i, num_entries, num_trackers; + int i, error, num_entries, num_trackers; num_entries = NVME_IO_ENTRIES; TUNABLE_INT_FETCH("hw.nvme.io_entries", &num_entries); @@ -163,12 +165,14 @@ nvme_ctrlr_construct_io_qpairs(struct nv * For I/O queues, use the controller-wide max_xfer_size * calculated in nvme_attach(). */ - nvme_qpair_construct(qpair, + error = nvme_qpair_construct(qpair, i+1, /* qpair ID */ ctrlr->msix_enabled ? i+1 : 0, /* vector */ num_entries, num_trackers, ctrlr); + if (error) + return (error); /* * Do not bother binding interrupts if we only have one I/O @@ -1098,7 +1102,8 @@ nvme_ctrlr_construct(struct nvme_control nvme_ctrlr_setup_interrupts(ctrlr); ctrlr->max_xfer_size = NVME_MAX_XFER_SIZE; - nvme_ctrlr_construct_admin_qpair(ctrlr); + if (nvme_ctrlr_construct_admin_qpair(ctrlr) != 0) + return (ENXIO); ctrlr->cdev = make_dev(&nvme_ctrlr_cdevsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "nvme%d", device_get_unit(dev)); Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Mon Nov 7 22:41:52 2016 (r308430) +++ head/sys/dev/nvme/nvme_private.h Tue Nov 8 00:24:49 2016 (r308431) @@ -172,9 +172,8 @@ struct nvme_tracker { bus_dmamap_t payload_dma_map; uint16_t cid; - uint64_t prp[NVME_MAX_PRP_LIST_ENTRIES]; + uint64_t *prp; bus_addr_t prp_bus_addr; - bus_dmamap_t prp_dma_map; }; struct nvme_qpair { @@ -206,10 +205,8 @@ struct nvme_qpair { bus_dma_tag_t dma_tag; bus_dma_tag_t dma_tag_payload; - bus_dmamap_t cmd_dma_map; + bus_dmamap_t queuemem_map; uint64_t cmd_bus_addr; - - bus_dmamap_t cpl_dma_map; uint64_t cpl_bus_addr; TAILQ_HEAD(, nvme_tracker) free_tr; @@ -417,7 +414,7 @@ void nvme_ctrlr_submit_io_request(struct void nvme_ctrlr_post_failed_request(struct nvme_controller *ctrlr, struct nvme_request *req); -void nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, +int nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, uint16_t vector, uint32_t num_entries, uint32_t num_trackers, struct nvme_controller *ctrlr); Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Mon Nov 7 22:41:52 2016 (r308430) +++ head/sys/dev/nvme/nvme_qpair.c Tue Nov 8 00:24:49 2016 (r308431) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); static void _nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req); +static void nvme_qpair_destroy(struct nvme_qpair *qpair); struct nvme_opcode_string { @@ -290,22 +291,6 @@ nvme_completion_is_retry(const struct nv } static void -nvme_qpair_construct_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr, - uint16_t cid) -{ - - bus_dmamap_create(qpair->dma_tag_payload, 0, &tr->payload_dma_map); - bus_dmamap_create(qpair->dma_tag, 0, &tr->prp_dma_map); - - bus_dmamap_load(qpair->dma_tag, tr->prp_dma_map, tr->prp, - sizeof(tr->prp), nvme_single_map, &tr->prp_bus_addr, 0); - - callout_init(&tr->timer, 1); - tr->cid = cid; - tr->qpair = qpair; -} - -static void nvme_qpair_complete_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr, struct nvme_completion *cpl, boolean_t print_on_error) { @@ -457,14 +442,16 @@ nvme_qpair_msix_handler(void *arg) nvme_qpair_process_completions(qpair); } -void +int nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, uint16_t vector, uint32_t num_entries, uint32_t num_trackers, struct nvme_controller *ctrlr) { struct nvme_tracker *tr; - uint32_t i; - int err; + size_t cmdsz, cplsz, prpsz, allocsz, prpmemsz; + uint64_t queuemem_phys, prpmem_phys, list_phys; + uint8_t *queuemem, *prpmem, *prp_list; + int i, err; qpair->id = id; qpair->vector = vector; @@ -495,40 +482,51 @@ nvme_qpair_construct(struct nvme_qpair * BUS_SPACE_MAXADDR, NULL, NULL, NVME_MAX_XFER_SIZE, (NVME_MAX_XFER_SIZE/PAGE_SIZE)+1, PAGE_SIZE, 0, NULL, NULL, &qpair->dma_tag_payload); - if (err != 0) + if (err != 0) { nvme_printf(ctrlr, "payload tag create failed %d\n", err); + goto out; + } + + /* + * Each component must be page aligned, and individual PRP lists + * cannot cross a page boundary. + */ + cmdsz = qpair->num_entries * sizeof(struct nvme_command); + cmdsz = roundup2(cmdsz, PAGE_SIZE); + cplsz = qpair->num_entries * sizeof(struct nvme_completion); + cplsz = roundup2(cplsz, PAGE_SIZE); + prpsz = sizeof(uint64_t) * NVME_MAX_PRP_LIST_ENTRIES;; + prpmemsz = qpair->num_trackers * prpsz; + allocsz = cmdsz + cplsz + prpmemsz; err = bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev), - 4, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - BUS_SPACE_MAXSIZE, 1, BUS_SPACE_MAXSIZE, 0, - NULL, NULL, &qpair->dma_tag); - if (err != 0) + PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + allocsz, 1, allocsz, 0, NULL, NULL, &qpair->dma_tag); + if (err != 0) { nvme_printf(ctrlr, "tag create failed %d\n", err); + goto out; + } + + if (bus_dmamem_alloc(qpair->dma_tag, (void **)&queuemem, + BUS_DMA_NOWAIT, &qpair->queuemem_map)) { + nvme_printf(ctrlr, "failed to alloc qpair memory\n"); + goto out; + } + + if (bus_dmamap_load(qpair->dma_tag, qpair->queuemem_map, + queuemem, allocsz, nvme_single_map, &queuemem_phys, 0) != 0) { + nvme_printf(ctrlr, "failed to load qpair memory\n"); + goto out; + } qpair->num_cmds = 0; qpair->num_intr_handler_calls = 0; - - qpair->cmd = contigmalloc(qpair->num_entries * - sizeof(struct nvme_command), M_NVME, M_ZERO, - 0, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); - qpair->cpl = contigmalloc(qpair->num_entries * - sizeof(struct nvme_completion), M_NVME, M_ZERO, - 0, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); - - err = bus_dmamap_create(qpair->dma_tag, 0, &qpair->cmd_dma_map); - if (err != 0) - nvme_printf(ctrlr, "cmd_dma_map create failed %d\n", err); - - err = bus_dmamap_create(qpair->dma_tag, 0, &qpair->cpl_dma_map); - if (err != 0) - nvme_printf(ctrlr, "cpl_dma_map create failed %d\n", err); - - bus_dmamap_load(qpair->dma_tag, qpair->cmd_dma_map, - qpair->cmd, qpair->num_entries * sizeof(struct nvme_command), - nvme_single_map, &qpair->cmd_bus_addr, 0); - bus_dmamap_load(qpair->dma_tag, qpair->cpl_dma_map, - qpair->cpl, qpair->num_entries * sizeof(struct nvme_completion), - nvme_single_map, &qpair->cpl_bus_addr, 0); + qpair->cmd = (struct nvme_command *)queuemem; + qpair->cpl = (struct nvme_completion *)(queuemem + cmdsz); + prpmem = (uint8_t *)(queuemem + cmdsz + cplsz); + qpair->cmd_bus_addr = queuemem_phys; + qpair->cpl_bus_addr = queuemem_phys + cmdsz; + prpmem_phys = queuemem_phys + cmdsz + cplsz; qpair->sq_tdbl_off = nvme_mmio_offsetof(doorbell[id].sq_tdbl); qpair->cq_hdbl_off = nvme_mmio_offsetof(doorbell[id].cq_hdbl); @@ -537,14 +535,51 @@ nvme_qpair_construct(struct nvme_qpair * TAILQ_INIT(&qpair->outstanding_tr); STAILQ_INIT(&qpair->queued_req); + list_phys = prpmem_phys; + prp_list = prpmem; for (i = 0; i < qpair->num_trackers; i++) { + + if (list_phys + prpsz > prpmem_phys + prpmemsz) { + qpair->num_trackers = i; + break; + } + + /* + * Make sure that the PRP list for this tracker doesn't + * overflow to another page. + */ + if (trunc_page(list_phys) != + trunc_page(list_phys + prpsz - 1)) { + list_phys = roundup2(list_phys, PAGE_SIZE); + prp_list = + (uint8_t *)roundup2((uintptr_t)prp_list, PAGE_SIZE); + } + tr = malloc(sizeof(*tr), M_NVME, M_ZERO | M_WAITOK); - nvme_qpair_construct_tracker(qpair, tr, i); + bus_dmamap_create(qpair->dma_tag_payload, 0, + &tr->payload_dma_map); + callout_init(&tr->timer, 1); + tr->cid = i; + tr->qpair = qpair; + tr->prp = (uint64_t *)prp_list; + tr->prp_bus_addr = list_phys; TAILQ_INSERT_HEAD(&qpair->free_tr, tr, tailq); + list_phys += prpsz; + prp_list += prpsz; + } + + if (qpair->num_trackers == 0) { + nvme_printf(ctrlr, "failed to allocate enough trackers\n"); + goto out; } - qpair->act_tr = malloc(sizeof(struct nvme_tracker *) * qpair->num_entries, - M_NVME, M_ZERO | M_WAITOK); + qpair->act_tr = malloc(sizeof(struct nvme_tracker *) * + qpair->num_entries, M_NVME, M_ZERO | M_WAITOK); + return (0); + +out: + nvme_qpair_destroy(qpair); + return (ENOMEM); } static void @@ -555,23 +590,17 @@ nvme_qpair_destroy(struct nvme_qpair *qp if (qpair->tag) bus_teardown_intr(qpair->ctrlr->dev, qpair->res, qpair->tag); + if (mtx_initialized(&qpair->lock)) + mtx_destroy(&qpair->lock); + if (qpair->res) bus_release_resource(qpair->ctrlr->dev, SYS_RES_IRQ, rman_get_rid(qpair->res), qpair->res); - if (qpair->cmd) { - bus_dmamap_unload(qpair->dma_tag, qpair->cmd_dma_map); - bus_dmamap_destroy(qpair->dma_tag, qpair->cmd_dma_map); - contigfree(qpair->cmd, - qpair->num_entries * sizeof(struct nvme_command), M_NVME); - } - - if (qpair->cpl) { - bus_dmamap_unload(qpair->dma_tag, qpair->cpl_dma_map); - bus_dmamap_destroy(qpair->dma_tag, qpair->cpl_dma_map); - contigfree(qpair->cpl, - qpair->num_entries * sizeof(struct nvme_completion), - M_NVME); + if (qpair->cmd != NULL) { + bus_dmamap_unload(qpair->dma_tag, qpair->queuemem_map); + bus_dmamem_free(qpair->dma_tag, qpair->cmd, + qpair->queuemem_map); } if (qpair->dma_tag) @@ -587,7 +616,6 @@ nvme_qpair_destroy(struct nvme_qpair *qp tr = TAILQ_FIRST(&qpair->free_tr); TAILQ_REMOVE(&qpair->free_tr, tr, tailq); bus_dmamap_destroy(qpair->dma_tag, tr->payload_dma_map); - bus_dmamap_destroy(qpair->dma_tag, tr->prp_dma_map); free(tr, M_NVME); } } From owner-svn-src-head@freebsd.org Tue Nov 8 05:31:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B259C34591; Tue, 8 Nov 2016 05:31:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15748C3E; Tue, 8 Nov 2016 05:31:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA85V3g1025396; Tue, 8 Nov 2016 05:31:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA85V2DL025382; Tue, 8 Nov 2016 05:31:02 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201611080531.uA85V2DL025382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 8 Nov 2016 05:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308432 - in head: bin/echo bin/sleep usr.bin/basename usr.bin/dc usr.bin/dirname usr.bin/fold usr.bin/getopt usr.bin/locate/bigram usr.bin/logname usr.bin/printenv usr.bin/yes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 05:31:04 -0000 Author: cem Date: Tue Nov 8 05:31:01 2016 New Revision: 308432 URL: https://svnweb.freebsd.org/changeset/base/308432 Log: Capsicumize some trivial stdio programs Trivially capsicumize some simple programs that just interact with stdio. This list of programs uses 'pledge("stdio")' in OpenBSD. No objection from: allanjude, emaste, oshogbo Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8307 Modified: head/bin/echo/echo.c head/bin/sleep/sleep.c head/usr.bin/basename/basename.c head/usr.bin/dc/dc.c head/usr.bin/dirname/dirname.c head/usr.bin/fold/fold.c head/usr.bin/getopt/getopt.c head/usr.bin/locate/bigram/locate.bigram.c head/usr.bin/logname/logname.c head/usr.bin/printenv/printenv.c head/usr.bin/yes/yes.c Modified: head/bin/echo/echo.c ============================================================================== --- head/bin/echo/echo.c Tue Nov 8 00:24:49 2016 (r308431) +++ head/bin/echo/echo.c Tue Nov 8 05:31:01 2016 (r308432) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -78,6 +80,9 @@ main(int argc, char *argv[]) char newline[] = "\n"; char *progname = argv[0]; + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + /* This utility may NOT do getopt(3) option parsing. */ if (*++argv && !strcmp(*argv, "-n")) { ++argv; Modified: head/bin/sleep/sleep.c ============================================================================== --- head/bin/sleep/sleep.c Tue Nov 8 00:24:49 2016 (r308431) +++ head/bin/sleep/sleep.c Tue Nov 8 05:31:01 2016 (r308432) @@ -41,6 +41,7 @@ static char sccsid[] = "@(#)sleep.c 8.3 #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -69,6 +70,9 @@ main(int argc, char *argv[]) time_t original; char buf[2]; + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + if (argc != 2) usage(); Modified: head/usr.bin/basename/basename.c ============================================================================== --- head/usr.bin/basename/basename.c Tue Nov 8 00:24:49 2016 (r308431) +++ head/usr.bin/basename/basename.c Tue Nov 8 05:31:01 2016 (r308432) @@ -42,6 +42,7 @@ static char sccsid[] = "@(#)basename.c 8 #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -64,6 +65,9 @@ main(int argc, char **argv) setlocale(LC_ALL, ""); + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + aflag = 0; suffix = NULL; suffixlen = 0; Modified: head/usr.bin/dc/dc.c ============================================================================== --- head/usr.bin/dc/dc.c Tue Nov 8 00:24:49 2016 (r308431) +++ head/usr.bin/dc/dc.c Tue Nov 8 05:31:01 2016 (r308432) @@ -22,9 +22,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include +#include #include #include #include @@ -58,11 +60,11 @@ usage(void) } static void -procfile(char *fname) { +procfd(int fd, char *fname) { struct stat st; FILE *file; - file = fopen(fname, "r"); + file = fdopen(fd, "r"); if (file == NULL) err(1, "cannot open file %s", fname); if (fstat(fileno(file), &st) == -1) @@ -80,7 +82,7 @@ procfile(char *fname) { int main(int argc, char *argv[]) { - int ch; + int ch, fd; bool extended_regs = false, preproc_done = false; /* accept and ignore a single dash to be 4.4BSD dc(1) compatible */ @@ -97,7 +99,10 @@ main(int argc, char *argv[]) case 'f': if (!preproc_done) init_bmachine(extended_regs); - procfile(optarg); + fd = open(optarg, O_RDONLY); + if (fd < 0) + err(1, "cannot open file %s", optarg); + procfd(fd, optarg); preproc_done = true; break; case 'x': @@ -126,12 +131,23 @@ main(int argc, char *argv[]) if (argc > 1) usage(); if (argc == 1) { - procfile(argv[0]); + fd = open(argv[0], O_RDONLY); + if (fd < 0) + err(1, "cannot open file %s", argv[0]); + + if (caph_limit_stream(fd, CAPH_READ) < 0 || + caph_limit_stdio() < 0 || + (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + + procfd(fd, argv[0]); preproc_done = true; } if (preproc_done) return (0); + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); src_setstream(&src, stdin); reset_bmachine(&src); eval(); Modified: head/usr.bin/dirname/dirname.c ============================================================================== --- head/usr.bin/dirname/dirname.c Tue Nov 8 00:24:49 2016 (r308431) +++ head/usr.bin/dirname/dirname.c Tue Nov 8 05:31:01 2016 (r308432) @@ -39,6 +39,7 @@ static const char sccsid[] = "@(#)dirnam #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -53,6 +54,9 @@ main(int argc, char **argv) char *p; int ch; + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + while ((ch = getopt(argc, argv, "")) != -1) switch(ch) { case '?': Modified: head/usr.bin/fold/fold.c ============================================================================== --- head/usr.bin/fold/fold.c Tue Nov 8 00:24:49 2016 (r308431) +++ head/usr.bin/fold/fold.c Tue Nov 8 05:31:01 2016 (r308432) @@ -45,6 +45,7 @@ static char sccsid[] = "@(#)fold.c 8.1 ( #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -72,6 +73,9 @@ main(int argc, char **argv) (void) setlocale(LC_CTYPE, ""); + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + width = -1; previous_ch = 0; while ((ch = getopt(argc, argv, "0123456789bsw:")) != -1) { Modified: head/usr.bin/getopt/getopt.c ============================================================================== --- head/usr.bin/getopt/getopt.c Tue Nov 8 00:24:49 2016 (r308431) +++ head/usr.bin/getopt/getopt.c Tue Nov 8 05:31:01 2016 (r308432) @@ -6,6 +6,9 @@ __FBSDID("$FreeBSD$"); * into the public domain and is thus not subject to any copyright. */ +#include +#include +#include #include #include #include @@ -16,6 +19,9 @@ main(int argc, char *argv[]) int c; int status = 0; + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + optind = 2; /* Past the program name and the option letters. */ while ((c = getopt(argc, argv, argv[1])) != -1) switch (c) { Modified: head/usr.bin/locate/bigram/locate.bigram.c ============================================================================== --- head/usr.bin/locate/bigram/locate.bigram.c Tue Nov 8 00:24:49 2016 (r308431) +++ head/usr.bin/locate/bigram/locate.bigram.c Tue Nov 8 05:31:01 2016 (r308432) @@ -57,6 +57,9 @@ static char sccsid[] = "@(#)locate.bigra * Use 'code' to encode a file using this output. */ +#include +#include +#include #include #include #include /* for MAXPATHLEN */ @@ -73,6 +76,9 @@ main(void) u_char *oldpath = buf1, *path = buf2; u_int i, j; + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + while (fgets(path, sizeof(buf2), stdin) != NULL) { /* Modified: head/usr.bin/logname/logname.c ============================================================================== --- head/usr.bin/logname/logname.c Tue Nov 8 00:24:49 2016 (r308431) +++ head/usr.bin/logname/logname.c Tue Nov 8 05:31:01 2016 (r308432) @@ -39,6 +39,7 @@ static const char sccsid[] = "@(#)lognam #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -51,6 +52,9 @@ main(int argc, char *argv[] __unused) { char *p; + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + if (argc != 1) usage(); if ((p = getlogin()) == NULL) Modified: head/usr.bin/printenv/printenv.c ============================================================================== --- head/usr.bin/printenv/printenv.c Tue Nov 8 00:24:49 2016 (r308431) +++ head/usr.bin/printenv/printenv.c Tue Nov 8 05:31:01 2016 (r308432) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include @@ -65,6 +67,9 @@ main(int argc, char *argv[]) size_t len; int ch; + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + while ((ch = getopt(argc, argv, "")) != -1) switch(ch) { case '?': Modified: head/usr.bin/yes/yes.c ============================================================================== --- head/usr.bin/yes/yes.c Tue Nov 8 00:24:49 2016 (r308431) +++ head/usr.bin/yes/yes.c Tue Nov 8 05:31:01 2016 (r308432) @@ -41,12 +41,17 @@ static const char rcsid[] = "$FreeBSD$"; #endif #endif /* not lint */ +#include #include #include int main(int argc, char **argv) { + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + if (argc > 1) while (puts(argv[1]) != EOF) ; From owner-svn-src-head@freebsd.org Tue Nov 8 06:50:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04589C366B7; Tue, 8 Nov 2016 06:50:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C07D8BCE; Tue, 8 Nov 2016 06:50:22 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA86oMVj056053; Tue, 8 Nov 2016 06:50:22 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA86oJ7W056026; Tue, 8 Nov 2016 06:50:19 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201611080650.uA86oJ7W056026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 8 Nov 2016 06:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308434 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libofw sys... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 06:50:23 -0000 Author: tsoome Date: Tue Nov 8 06:50:18 2016 New Revision: 308434 URL: https://svnweb.freebsd.org/changeset/base/308434 Log: Loader paged/pageable data is not always paged. This change does modify devsw dv_print() to return the int value, enabling walkers to interrupt the walk on non zero value from dv_print(). This will allow the pager_print actually to stop displaying data on user input, and additionally pager is used in various *dev_print callbacks, where it was missing. For test, lsdev [-v] command should display data by screenfuls and should stop when the key 'q' is pressed on pager prompt. Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D5461 Modified: head/lib/libstand/stand.h head/sys/boot/common/dev_net.c head/sys/boot/common/module.c head/sys/boot/common/part.c head/sys/boot/common/util.c head/sys/boot/common/util.h head/sys/boot/efi/libefi/efinet.c head/sys/boot/efi/libefi/efipart.c head/sys/boot/efi/loader/main.c head/sys/boot/i386/libfirewire/firewire.c head/sys/boot/i386/libi386/bioscd.c head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/i386/libi386/pxe.c head/sys/boot/mips/beri/loader/beri_disk_cfi.c head/sys/boot/mips/beri/loader/beri_disk_sdcard.c head/sys/boot/ofw/libofw/ofw_disk.c head/sys/boot/pc98/libpc98/bioscd.c head/sys/boot/pc98/libpc98/biosdisk.c head/sys/boot/powerpc/kboot/hostdisk.c head/sys/boot/powerpc/ps3/ps3cdrom.c head/sys/boot/powerpc/ps3/ps3disk.c head/sys/boot/uboot/lib/disk.c head/sys/boot/usb/storage/umass_loader.c head/sys/boot/userboot/userboot/host.c head/sys/boot/userboot/userboot/userboot_disk.c head/sys/boot/zfs/zfs.c head/sys/boot/zfs/zfsimpl.c Modified: head/lib/libstand/stand.h ============================================================================== --- head/lib/libstand/stand.h Tue Nov 8 06:13:22 2016 (r308433) +++ head/lib/libstand/stand.h Tue Nov 8 06:50:18 2016 (r308434) @@ -143,7 +143,7 @@ struct devsw { int (*dv_open)(struct open_file *f, ...); int (*dv_close)(struct open_file *f); int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data); - void (*dv_print)(int verbose); /* print device information */ + int (*dv_print)(int verbose); /* print device information */ void (*dv_cleanup)(void); }; Modified: head/sys/boot/common/dev_net.c ============================================================================== --- head/sys/boot/common/dev_net.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/common/dev_net.c Tue Nov 8 06:50:18 2016 (r308434) @@ -80,7 +80,7 @@ static int net_open(struct open_file *, static int net_close(struct open_file *); static void net_cleanup(void); static int net_strategy(); -static void net_print(int); +static int net_print(int); static int net_getparams(int sock); @@ -325,23 +325,27 @@ exit: return (0); } -static void +static int net_print(int verbose) { struct netif_driver *drv; int i, d, cnt; + int ret = 0; cnt = 0; for (d = 0; netif_drivers[d]; d++) { drv = netif_drivers[d]; for (i = 0; i < drv->netif_nifs; i++) { printf("\t%s%d:", "net", cnt++); - if (verbose) + if (verbose) { printf(" (%s%d)", drv->netif_bname, drv->netif_ifs[i].dif_unit); + } + if ((ret = pager_output("\n")) != 0) + return (ret); } } - printf("\n"); + return (ret); } /* Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/common/module.c Tue Nov 8 06:50:18 2016 (r308434) @@ -254,7 +254,7 @@ command_lsmod(int argc, char *argv[]) struct kernel_module *mp; struct file_metadata *md; char lbuf[80]; - int ch, verbose; + int ch, verbose, ret = 0; verbose = 0; optind = 1; @@ -273,11 +273,13 @@ command_lsmod(int argc, char *argv[]) pager_open(); for (fp = preloaded_files; fp; fp = fp->f_next) { - sprintf(lbuf, " %p: ", (void *) fp->f_addr); + snprintf(lbuf, sizeof(lbuf), " %p: ", (void *) fp->f_addr); pager_output(lbuf); pager_output(fp->f_name); - sprintf(lbuf, " (%s, 0x%lx)\n", fp->f_type, (long)fp->f_size); - pager_output(lbuf); + snprintf(lbuf, sizeof(lbuf), " (%s, 0x%lx)\n", fp->f_type, + (long)fp->f_size); + if (pager_output(lbuf)) + break; if (fp->f_args != NULL) { pager_output(" args: "); pager_output(fp->f_args); @@ -287,7 +289,8 @@ command_lsmod(int argc, char *argv[]) if (fp->f_modules) { pager_output(" modules: "); for (mp = fp->f_modules; mp; mp = mp->m_next) { - sprintf(lbuf, "%s.%d ", mp->m_name, mp->m_version); + snprintf(lbuf, sizeof(lbuf), "%s.%d ", mp->m_name, + mp->m_version); pager_output(lbuf); } if (pager_output("\n")) @@ -296,11 +299,14 @@ command_lsmod(int argc, char *argv[]) if (verbose) { /* XXX could add some formatting smarts here to display some better */ for (md = fp->f_metadata; md != NULL; md = md->md_next) { - sprintf(lbuf, " 0x%04x, 0x%lx\n", md->md_type, (long) md->md_size); + snprintf(lbuf, sizeof(lbuf), " 0x%04x, 0x%lx\n", + md->md_type, (long) md->md_size); if (pager_output(lbuf)) break; } } + if (ret) + break; } pager_close(); return(CMD_OK); Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/common/part.c Tue Nov 8 06:50:18 2016 (r308434) @@ -834,6 +834,7 @@ ptable_iterate(const struct ptable *tabl { struct pentry *entry; char name[32]; + int ret = 0; name[0] = '\0'; STAILQ_FOREACH(entry, &table->entries, entry) { @@ -856,9 +857,8 @@ ptable_iterate(const struct ptable *tabl if (table->type == PTABLE_BSD) sprintf(name, "%c", (u_char) 'a' + entry->part.index); - if (iter(arg, name, &entry->part)) - return 1; + if ((ret = iter(arg, name, &entry->part)) != 0) + return (ret); } - return 0; + return (ret); } - Modified: head/sys/boot/common/util.c ============================================================================== --- head/sys/boot/common/util.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/common/util.c Tue Nov 8 06:50:18 2016 (r308434) @@ -114,7 +114,7 @@ strlen(const char *s) return (len); } -void +int printf(const char *fmt, ...) { va_list ap; @@ -178,4 +178,5 @@ nextfmt: } } va_end(ap); + return (0); } Modified: head/sys/boot/common/util.h ============================================================================== --- head/sys/boot/common/util.h Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/common/util.h Tue Nov 8 06:50:18 2016 (r308434) @@ -48,6 +48,6 @@ void strcat(char *dst, const char *src); char *strchr(const char *s, char ch); size_t strlen(const char *s); -void printf(const char *fmt, ...); +int printf(const char *fmt, ...); #endif /* !_UTIL_H_ */ Modified: head/sys/boot/efi/libefi/efinet.c ============================================================================== --- head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:50:18 2016 (r308434) @@ -252,7 +252,7 @@ efinet_end(struct netif *nif) } static int efinet_dev_init(void); -static void efinet_dev_print(int); +static int efinet_dev_print(int); struct devsw efinet_dev = { .dv_name = "net", @@ -346,14 +346,13 @@ efinet_dev_init() return (0); } -static void +static int efinet_dev_print(int verbose) { CHAR16 *text; EFI_HANDLE h; - int unit; + int unit, ret = 0; - pager_open(); for (unit = 0, h = efi_find_handle(&efinet_dev, 0); h != NULL; h = efi_find_handle(&efinet_dev, ++unit)) { printf(" %s%d:", efinet_dev.dv_name, unit); @@ -364,8 +363,8 @@ efinet_dev_print(int verbose) efi_free_devpath_name(text); } } - if (pager_output("\n")) + if ((ret = pager_output("\n")) != 0) break; } - pager_close(); + return (ret); } Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:50:18 2016 (r308434) @@ -47,7 +47,7 @@ static int efipart_realstrategy(void *, size_t *); static int efipart_open(struct open_file *, ...); static int efipart_close(struct open_file *); -static void efipart_print(int); +static int efipart_print(int); struct devsw efipart_dev = { .dv_name = "part", @@ -162,7 +162,7 @@ efipart_init(void) return (err); } -static void +static int efipart_print(int verbose) { char line[80]; @@ -170,28 +170,29 @@ efipart_print(int verbose) EFI_HANDLE h; EFI_STATUS status; u_int unit; + int ret = 0; - pager_open(); for (unit = 0, h = efi_find_handle(&efipart_dev, 0); h != NULL; h = efi_find_handle(&efipart_dev, ++unit)) { - sprintf(line, " %s%d:", efipart_dev.dv_name, unit); - if (pager_output(line)) + snprintf(line, sizeof(line), " %s%d:", + efipart_dev.dv_name, unit); + if ((ret = pager_output(line)) != 0) break; status = BS->HandleProtocol(h, &blkio_guid, (void **)&blkio); if (!EFI_ERROR(status)) { - sprintf(line, " %llu blocks", + snprintf(line, sizeof(line), " %llu blocks", (unsigned long long)(blkio->Media->LastBlock + 1)); - if (pager_output(line)) + if ((ret = pager_output(line)) != 0) break; if (blkio->Media->RemovableMedia) - if (pager_output(" (removable)")) + if ((ret = pager_output(" (removable)")) != 0) break; } - if (pager_output("\n")) + if ((ret = pager_output("\n")) != 0) break; } - pager_close(); + return (ret); } static int Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/efi/loader/main.c Tue Nov 8 06:50:18 2016 (r308434) @@ -533,6 +533,7 @@ command_memmap(int argc, char *argv[]) UINT32 dver; EFI_STATUS status; int i, ndesc; + char line[80]; static char *types[] = { "Reserved", "LoaderCode", @@ -564,14 +565,19 @@ command_memmap(int argc, char *argv[]) } ndesc = sz / dsz; - printf("%23s %12s %12s %8s %4s\n", + snprintf(line, sizeof(line), "%23s %12s %12s %8s %4s\n", "Type", "Physical", "Virtual", "#Pages", "Attr"); + pager_open(); + if (pager_output(line)) { + pager_close(); + return (CMD_OK); + } for (i = 0, p = map; i < ndesc; i++, p = NextMemoryDescriptor(p, dsz)) { printf("%23s %012jx %012jx %08jx ", types[p->Type], - (uintmax_t)p->PhysicalStart, (uintmax_t)p->VirtualStart, - (uintmax_t)p->NumberOfPages); + (uintmax_t)p->PhysicalStart, (uintmax_t)p->VirtualStart, + (uintmax_t)p->NumberOfPages); if (p->Attribute & EFI_MEMORY_UC) printf("UC "); if (p->Attribute & EFI_MEMORY_WC) @@ -588,9 +594,11 @@ command_memmap(int argc, char *argv[]) printf("RP "); if (p->Attribute & EFI_MEMORY_XP) printf("XP "); - printf("\n"); + if (pager_output("\n")) + break; } + pager_close(); return (CMD_OK); } @@ -612,10 +620,17 @@ guid_to_string(EFI_GUID *guid) static int command_configuration(int argc, char *argv[]) { + char line[80]; UINTN i; - printf("NumberOfTableEntries=%lu\n", + snprintf(line, sizeof(line), "NumberOfTableEntries=%lu\n", (unsigned long)ST->NumberOfTableEntries); + pager_open(); + if (pager_output(line)) { + pager_close(); + return (CMD_OK); + } + for (i = 0; i < ST->NumberOfTableEntries; i++) { EFI_GUID *guid; @@ -642,9 +657,13 @@ command_configuration(int argc, char *ar printf("FDT Table"); else printf("Unknown Table (%s)", guid_to_string(guid)); - printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); + snprintf(line, sizeof(line), " at %p\n", + ST->ConfigurationTable[i].VendorTable); + if (pager_output(line)) + break; } + pager_close(); return (CMD_OK); } Modified: head/sys/boot/i386/libfirewire/firewire.c ============================================================================== --- head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:50:18 2016 (r308434) @@ -69,7 +69,7 @@ static int fw_strategy(void *devdata, in size_t offset, size_t size, char *buf, size_t *rsize); static int fw_open(struct open_file *f, ...); static int fw_close(struct open_file *f); -static void fw_print(int verbose); +static int fw_print(int verbose); static void fw_cleanup(void); void fw_enable(void); @@ -148,21 +148,26 @@ fw_init(void) /* * Print information about OHCI chips */ -static void +static int fw_print(int verbose) { - int i; + char line[80]; + int i, ret = 0; struct fwohci_softc *sc; for (i = 0; i < MAX_OHCI; i ++) { sc = &fwinfo[i]; if (sc->state == FWOHCI_STATE_DEAD) break; - printf("%d: locator=0x%04x devid=0x%08x" + snprintf(line, sizeof(line), "%d: locator=0x%04x devid=0x%08x" " base_addr=0x%08x handle=0x%08x bus_id=0x%08x\n", i, sc->locator, sc->devid, sc->base_addr, sc->handle, sc->bus_id); + ret = pager_output(line); + if (ret != 0) + break; } + return (ret); } static int Modified: head/sys/boot/i386/libi386/bioscd.c ============================================================================== --- head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:50:18 2016 (r308434) @@ -100,7 +100,7 @@ static int bc_realstrategy(void *devdata size_t offset, size_t size, char *buf, size_t *rsize); static int bc_open(struct open_file *f, ...); static int bc_close(struct open_file *f); -static void bc_print(int verbose); +static int bc_print(int verbose); struct devsw bioscd = { "cd", @@ -177,20 +177,19 @@ bc_add(int biosdev) /* * Print information about disks */ -static void +static int bc_print(int verbose) { char line[80]; - int i; + int i, ret = 0; - pager_open(); for (i = 0; i < nbcinfo; i++) { - sprintf(line, " cd%d: Device 0x%x\n", i, + snprintf(line, sizeof(line), " cd%d: Device 0x%x\n", i, bcinfo[i].bc_sp.sp_devicespec); - if (pager_output(line)) + if ((ret = pager_output(line)) != 0) break; } - pager_close(); + return (ret); } /* Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:50:18 2016 (r308434) @@ -135,7 +135,7 @@ static int bd_realstrategy(void *devdata static int bd_open(struct open_file *f, ...); static int bd_close(struct open_file *f); static int bd_ioctl(struct open_file *f, u_long cmd, void *data); -static void bd_print(int verbose); +static int bd_print(int verbose); static void bd_cleanup(void); #ifdef LOADER_GELI_SUPPORT @@ -321,21 +321,21 @@ bd_int13probe(struct bdinfo *bd) /* * Print information about disks */ -static void +static int bd_print(int verbose) { static char line[80]; struct disk_devdesc dev; - int i; + int i, ret = 0; - pager_open(); for (i = 0; i < nbdinfo; i++) { - sprintf(line, " disk%d: BIOS drive %c (%ju X %u):\n", i, + snprintf(line, sizeof(line), + " disk%d: BIOS drive %c (%ju X %u):\n", i, (bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit): ('C' + bdinfo[i].bd_unit - 0x80), (uintmax_t)bdinfo[i].bd_sectors, bdinfo[i].bd_sectorsize); - if (pager_output(line)) + if ((ret = pager_output(line)) != 0) break; dev.d_dev = &biosdisk; dev.d_unit = i; @@ -346,12 +346,14 @@ bd_print(int verbose) bdinfo[i].bd_sectorsize, (bdinfo[i].bd_flags & BD_FLOPPY) ? DISK_F_NOCACHE: 0) == 0) { - sprintf(line, " disk%d", i); - disk_print(&dev, line, verbose); + snprintf(line, sizeof(line), " disk%d", i); + ret = disk_print(&dev, line, verbose); disk_close(&dev); + if (ret != 0) + return (ret); } } - pager_close(); + return (ret); } /* Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:50:18 2016 (r308434) @@ -75,7 +75,7 @@ static int pxe_strategy(void *devdata, i size_t offset, size_t size, char *buf, size_t *rsize); static int pxe_open(struct open_file *f, ...); static int pxe_close(struct open_file *f); -static void pxe_print(int verbose); +static int pxe_print(int verbose); static void pxe_cleanup(void); static void pxe_setnfshandle(char *rootpath); @@ -381,14 +381,20 @@ pxe_close(struct open_file *f) return (0); } -static void +static int pxe_print(int verbose) { - + char line[255]; if (pxe_call == NULL) - return; + return (0); - printf(" pxe0: %s:%s\n", inet_ntoa(rootip), rootpath); + if (verbose) { + snprintf(line, sizeof(line), " pxe0: %s:%s\n", + inet_ntoa(rootip), rootpath); + } else { + snprintf(line, sizeof(line), " pxe0:\n"); + } + return (pager_output(line)); } static void Modified: head/sys/boot/mips/beri/loader/beri_disk_cfi.c ============================================================================== --- head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 06:50:18 2016 (r308434) @@ -47,7 +47,7 @@ static int beri_cfi_disk_close(struct op static void beri_cfi_disk_cleanup(void); static int beri_cfi_disk_strategy(void *, int, daddr_t, size_t, size_t, char *, size_t *); -static void beri_cfi_disk_print(int); +static int beri_cfi_disk_print(int); struct devsw beri_cfi_disk = { .dv_name = "cfi", @@ -112,25 +112,29 @@ beri_cfi_disk_close(struct open_file *f) return (disk_close(dev)); } -static void +static int beri_cfi_disk_print(int verbose) { struct disk_devdesc dev; char line[80]; + int ret; - sprintf(line, " cfi%d CFI flash device\n", 0); - pager_output(line); + snprintf(line, sizeof(line), " cfi%d CFI flash device\n", 0); + ret = pager_output(line); + if (ret != 0) + return (ret); dev.d_dev = &beri_cfi_disk; dev.d_unit = 0; dev.d_slice = -1; dev.d_partition = -1; if (disk_open(&dev, cfi_get_mediasize(), cfi_get_sectorsize(), 0) == 0) { - sprintf(line, " cfi%d", 0); - disk_print(&dev, line, verbose); + snprintf(line, sizeof(line), " cfi%d", 0); + ret = disk_print(&dev, line, verbose); disk_close(&dev); } + return (ret); } static void Modified: head/sys/boot/mips/beri/loader/beri_disk_sdcard.c ============================================================================== --- head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 06:50:18 2016 (r308434) @@ -47,7 +47,7 @@ static int beri_sdcard_disk_close(struct static void beri_sdcard_disk_cleanup(void); static int beri_sdcard_disk_strategy(void *, int, daddr_t, size_t, size_t, char *, size_t *); -static void beri_sdcard_disk_print(int); +static int beri_sdcard_disk_print(int); struct devsw beri_sdcard_disk = { .dv_name = "sdcard", @@ -123,19 +123,23 @@ beri_sdcard_disk_print(int verbose) { struct disk_devdesc dev; char line[80]; + int ret; - sprintf(line, " sdcard%d Altera SD card drive\n", 0); - pager_output(line); + snprintf(line, sizeof(line), " sdcard%d Altera SD card drive\n", 0); + ret = pager_output(line); + if (ret != 0) + return (ret); dev.d_dev = &beri_sdcard_disk; dev.d_unit = 0; dev.d_slice = -1; dev.d_partition = -1; if (disk_open(&dev, altera_sdcard_get_mediasize(), altera_sdcard_get_sectorsize(), 0) == 0) { - sprintf(line, " sdcard%d", 0); - disk_print(&dev, line, verbose); + snprintf(line, sizeof(line), " sdcard%d", 0); + ret = disk_print(&dev, line, verbose); disk_close(&dev); } + return (ret); } static void Modified: head/sys/boot/ofw/libofw/ofw_disk.c ============================================================================== --- head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:50:18 2016 (r308434) @@ -47,7 +47,7 @@ static int ofwd_strategy(void *devdata, static int ofwd_open(struct open_file *f, ...); static int ofwd_close(struct open_file *f); static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data); -static void ofwd_print(int verbose); +static int ofwd_print(int verbose); struct devsw ofwdisk = { "block", @@ -161,8 +161,8 @@ ofwd_ioctl(struct open_file *f __unused, return (EINVAL); } -static void +static int ofwd_print(int verbose __unused) { - + return (0); } Modified: head/sys/boot/pc98/libpc98/bioscd.c ============================================================================== --- head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:50:18 2016 (r308434) @@ -99,7 +99,7 @@ static int bc_realstrategy(void *devdata size_t offset, size_t size, char *buf, size_t *rsize); static int bc_open(struct open_file *f, ...); static int bc_close(struct open_file *f); -static void bc_print(int verbose); +static int bc_print(int verbose); struct devsw bioscd = { "cd", @@ -173,20 +173,19 @@ bc_add(int biosdev) /* * Print information about disks */ -static void +static int bc_print(int verbose) { char line[80]; - int i; + int i, ret = 0; - pager_open(); for (i = 0; i < nbcinfo; i++) { sprintf(line, " cd%d: Device 0x%x\n", i, bcinfo[i].bc_sp.sp_devicespec); - if (pager_output(line)) + if ((ret = pager_output(line)) != 0) break; } - pager_close(); + return (ret); } /* Modified: head/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:50:18 2016 (r308434) @@ -123,7 +123,7 @@ static int bd_realstrategy(void *devdata size_t offset, size_t size, char *buf, size_t *rsize); static int bd_open(struct open_file *f, ...); static int bd_close(struct open_file *f); -static void bd_print(int verbose); +static int bd_print(int verbose); struct devsw biosdisk = { "disk", @@ -249,21 +249,20 @@ bd_int13probe(struct bdinfo *bd) /* * Print information about disks */ -static void +static int bd_print(int verbose) { - int i, j, done; + int i, j, ret = 0; char line[80]; struct i386_devdesc dev; struct open_disk *od; struct pc98_partition *dptr; - pager_open(); - done = 0; - for (i = 0; i < nbdinfo && !done; i++) { - sprintf(line, " disk%d: BIOS drive %c:\n", i, 'A' + i); - if (pager_output(line)) - break; + for (i = 0; i < nbdinfo; i++) { + snprintf(line, sizeof(line), " disk%d: BIOS drive %c:\n", + i, 'A' + i); + if ((ret = pager_output(line)) != 0) + break; /* try to open the whole disk */ dev.d_unit = i; @@ -278,17 +277,17 @@ bd_print(int verbose) /* Check for a "dedicated" disk */ for (j = 0; j < od->od_nslices; j++) { - sprintf(line, " disk%ds%d", i, j + 1); - if (bd_printslice(od, &dptr[j], line, verbose)) { - done = 1; - break; - } + snprintf(line, sizeof(line), " disk%ds%d", i, j + 1); + if ((ret = bd_printslice(od, &dptr[j], line, verbose)) != 0) + break; } } bd_closedisk(od); + if (ret != 0) + break; } } - pager_close(); + return (ret); } /* Given a size in 512 byte sectors, convert it to a human-readable number. */ Modified: head/sys/boot/powerpc/kboot/hostdisk.c ============================================================================== --- head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:50:18 2016 (r308434) @@ -37,7 +37,7 @@ static int hostdisk_strategy(void *devda static int hostdisk_open(struct open_file *f, ...); static int hostdisk_close(struct open_file *f); static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data); -static void hostdisk_print(int verbose); +static int hostdisk_print(int verbose); struct devsw hostdisk = { "/dev", @@ -117,9 +117,9 @@ hostdisk_ioctl(struct open_file *f, u_lo return (EINVAL); } -static void +static int hostdisk_print(int verbose) { - + return (0); } Modified: head/sys/boot/powerpc/ps3/ps3cdrom.c ============================================================================== --- head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:50:18 2016 (r308434) @@ -49,7 +49,7 @@ static int ps3cdrom_strategy(void *devda size_t offset, size_t size, char *buf, size_t *rsize); static int ps3cdrom_open(struct open_file *f, ...); static int ps3cdrom_close(struct open_file *f); -static void ps3cdrom_print(int verbose); +static int ps3cdrom_print(int verbose); struct devsw ps3cdrom = { "cd", @@ -149,6 +149,7 @@ static int ps3cdrom_close(struct open_fi return 0; } -static void ps3cdrom_print(int verbose) +static int ps3cdrom_print(int verbose) { + return (0); } Modified: head/sys/boot/powerpc/ps3/ps3disk.c ============================================================================== --- head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:50:18 2016 (r308434) @@ -61,7 +61,7 @@ static int ps3disk_strategy(void *devdat size_t offset, size_t size, char *buf, size_t *rsize); static int ps3disk_open(struct open_file *f, ...); static int ps3disk_close(struct open_file *f); -static void ps3disk_print(int verbose); +static int ps3disk_print(int verbose); struct devsw ps3disk = { "disk", @@ -186,8 +186,9 @@ static int ps3disk_close(struct open_fil return 0; } -static void ps3disk_print(int verbose) +static int ps3disk_print(int verbose) { + return (0); } static int ps3disk_open_gpt(struct ps3_devdesc *dev, struct open_dev *od) Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:50:18 2016 (r308434) @@ -78,7 +78,7 @@ static int stor_strategy(void *, int, da static int stor_open(struct open_file *, ...); static int stor_close(struct open_file *); static int stor_ioctl(struct open_file *f, u_long cmd, void *data); -static void stor_print(int); +static int stor_print(int); static void stor_cleanup(void); struct devsw uboot_storage = { @@ -238,30 +238,31 @@ stor_readdev(struct disk_devdesc *dev, d return (err); } -static void +static int stor_print(int verbose) { struct disk_devdesc dev; static char line[80]; - int i; + int i, ret = 0; - pager_open(); for (i = 0; i < stor_info_no; i++) { dev.d_dev = &uboot_storage; dev.d_unit = i; dev.d_slice = -1; dev.d_partition = -1; - sprintf(line, "\tdisk%d (%s)\n", i, + snprintf(line, sizeof(line), "\tdisk%d (%s)\n", i, ub_stor_type(SI(&dev).type)); - if (pager_output(line)) + if ((ret = pager_output(line)) != 0) break; if (stor_opendev(&dev) == 0) { sprintf(line, "\tdisk%d", i); - disk_print(&dev, line, verbose); + ret = disk_print(&dev, line, verbose); disk_close(&dev); + if (ret != 0) + break; } } - pager_close(); + return (ret); } static int Modified: head/sys/boot/usb/storage/umass_loader.c ============================================================================== --- head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:50:18 2016 (r308434) @@ -50,7 +50,7 @@ static void umass_disk_cleanup(void); static int umass_disk_ioctl(struct open_file *, u_long, void *); static int umass_disk_strategy(void *, int, daddr_t, size_t, size_t, char *, size_t *); -static void umass_disk_print(int); +static int umass_disk_print(int); struct devsw umass_disk = { .dv_name = "umass", @@ -170,23 +170,26 @@ umass_disk_close(struct open_file *f) return (disk_close(dev)); } -static void +static int umass_disk_print(int verbose) { struct disk_devdesc dev; memset(&dev, 0, sizeof(dev)); - pager_output(" umass0 UMASS device\n"); + ret = pager_output(" umass0 UMASS device\n"); + if (ret != 0) + return (ret); dev.d_dev = &umass_disk; dev.d_unit = 0; dev.d_slice = -1; dev.d_partition = -1; if (umass_disk_open_sub(&dev) == 0) { - disk_print(&dev, " umass0", verbose); + ret = disk_print(&dev, " umass0", verbose); disk_close(&dev); } + return (ret); } static void Modified: head/sys/boot/userboot/userboot/host.c ============================================================================== --- head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:50:18 2016 (r308434) @@ -134,13 +134,13 @@ host_dev_init(void) return (0); } -static void +static int host_dev_print(int verbose) { char line[80]; - sprintf(line, " host%d: Host filesystem\n", 0); - pager_output(line); + snprintf(line, sizeof(line), " host%d: Host filesystem\n", 0); + return (pager_output(line)); } /* Modified: head/sys/boot/userboot/userboot/userboot_disk.c ============================================================================== --- head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 06:50:18 2016 (r308434) @@ -60,7 +60,7 @@ static int userdisk_realstrategy(void *d static int userdisk_open(struct open_file *f, ...); static int userdisk_close(struct open_file *f); static int userdisk_ioctl(struct open_file *f, u_long cmd, void *data); -static void userdisk_print(int verbose); +static int userdisk_print(int verbose); struct devsw userboot_disk = { "disk", @@ -116,27 +116,33 @@ userdisk_cleanup(void) /* * Print information about disks */ -static void +static int userdisk_print(int verbose) { struct disk_devdesc dev; char line[80]; - int i; + int i, ret = 0; for (i = 0; i < userdisk_maxunit; i++) { - sprintf(line, " disk%d: Guest drive image\n", i); - pager_output(line); + snprintf(line, sizeof(line), + " disk%d: Guest drive image\n", i); + ret = pager_output(line); + if (ret != 0) + break; dev.d_dev = &userboot_disk; dev.d_unit = i; dev.d_slice = -1; dev.d_partition = -1; if (disk_open(&dev, ud_info[i].mediasize, ud_info[i].sectorsize, 0) == 0) { - sprintf(line, " disk%d", i); - disk_print(&dev, line, verbose); + snprintf(line, sizeof(line), " disk%d", i); + ret = disk_print(&dev, line, verbose); disk_close(&dev); + if (ret != 0) + break; } } + return (ret); } /* Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/zfs/zfs.c Tue Nov 8 06:50:18 2016 (r308434) @@ -514,20 +514,23 @@ zfs_probe_dev(const char *devname, uint6 /* * Print information about ZFS pools */ -static void +static int zfs_dev_print(int verbose) { spa_t *spa; char line[80]; + int ret = 0; if (verbose) { - spa_all_status(); - return; + return (spa_all_status()); } STAILQ_FOREACH(spa, &zfs_pools, spa_link) { - sprintf(line, " zfs:%s\n", spa->spa_name); - pager_output(line); + snprintf(line, sizeof(line), " zfs:%s\n", spa->spa_name); + ret = pager_output(line); + if (ret != 0) + break; } + return (ret); } /* Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:13:22 2016 (r308433) +++ head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:50:18 2016 (r308434) @@ -780,7 +780,7 @@ state_name(vdev_state_t state) #else -static void +static int pager_printf(const char *fmt, ...) { char line[80]; @@ -789,14 +789,14 @@ pager_printf(const char *fmt, ...) va_start(args, fmt); vsprintf(line, fmt, args); va_end(args); - pager_output(line); + return (pager_output(line)); } #endif #define STATUS_FORMAT " %s %s\n" -static void +static int print_state(int indent, const char *name, vdev_state_t state) { int i; @@ -806,40 +806,56 @@ print_state(int indent, const char *name for (i = 0; i < indent; i++) strcat(buf, " "); strcat(buf, name); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Nov 8 08:09:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24909C33AE1; Tue, 8 Nov 2016 08:09:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA636E99; Tue, 8 Nov 2016 08:09:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA889nLC088843; Tue, 8 Nov 2016 08:09:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA889nVl088842; Tue, 8 Nov 2016 08:09:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611080809.uA889nVl088842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 8 Nov 2016 08:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308437 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 08:09:50 -0000 Author: hselasky Date: Tue Nov 8 08:09:48 2016 New Revision: 308437 URL: https://svnweb.freebsd.org/changeset/base/308437 Log: Range check the jitter values to avoid bogus sample rate adjustments. The expected deviation should not be more than 1Hz per second. The USB v2.0 specification also mandates this requirement. Refer to chapter 5.12.4.2 about feedback. PR: 208791 MFC after: 3 days Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Tue Nov 8 07:18:39 2016 (r308436) +++ head/sys/dev/sound/usb/uaudio.c Tue Nov 8 08:09:48 2016 (r308437) @@ -2078,9 +2078,22 @@ uaudio_chan_play_sync_callback(struct us * Use feedback value as fallback when there is no * recording channel: */ - if (ch->priv_sc->sc_rec_chan.num_alt == 0) - ch->jitter_curr = temp - sample_rate; - + if (ch->priv_sc->sc_rec_chan.num_alt == 0) { + /* + * Range check the jitter values to avoid + * bogus sample rate adjustments. The expected + * deviation should not be more than 1Hz per + * second. The USB v2.0 specification also + * mandates this requirement. Refer to chapter + * 5.12.4.2 about feedback. + */ + if (temp > sample_rate) + ch->jitter_curr = 1; + else if (temp < sample_rate) + ch->jitter_curr = -1; + else + ch->jitter_curr = 0; + } ch->feedback_rate = temp; break; From owner-svn-src-head@freebsd.org Tue Nov 8 08:32:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD120C3668E; Tue, 8 Nov 2016 08:32:23 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x22c.google.com (mail-vk0-x22c.google.com [IPv6:2607:f8b0:400c:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87B6B34E; Tue, 8 Nov 2016 08:32:23 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x22c.google.com with SMTP id p9so142770500vkd.3; Tue, 08 Nov 2016 00:32:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=KHEpvPhJ3fCL519L2TKFZpf1I3P0e9FP/d/I5kn6kHg=; b=OfSh1etH/ZJplN5VAYTT8GNoi3yr1LUHQPPYu61qtWXpKeX82wV0XT4SsHrTQroyYS gsuqSWYwC9zh4/LhEprbU2Ol7s2U+CKOTELg+9QxQZO3/a9R/yiSkfNuGjYkaJvwcjbv FlRa2/hGQHry+PvAR96vpQ4Rae4PTEs9ZmKRsBKf7pY/dlEN3+puYi6UKx8tB+mofmCF kEPvA8QdiuinrXoBFlLd6nsI88rXaqZJ4SSvzr1qFXQrCvlWWWg/2N8OVAuzMm15yzd8 3AIXA3NYnxdy0Z/g5mju7sckwyAAQPpkn4UjpUGRYSHRwq8fFruWrnRTmKRAqq+INObq WoOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KHEpvPhJ3fCL519L2TKFZpf1I3P0e9FP/d/I5kn6kHg=; b=Tv6VmTLtby18AC6MceoO7MpYGBS4/zlY5Wf2Eak4PBgdEy0O0wja4lGm5cIOONmiAL Y0tvp5r7PEMpce4SUjhvh8VImGlyN/w1IH4JRLQiSdf7jdmrexLpmT/qxj6KTmR6IPCg iN0JdVBkO8SLEJNxfwI1IJA1hve9PkK8atbbsN4WQUOtdVIB4sOF09HAOcwZf30y5RrZ aLbiUIg96P10rKDpz9FpkOawULrx5SSnyYq7sZG+IFdK+67LPv3QyQUx3QdKPSybA5aI m19BrmRlBCKoHbUW3fKJQgu9VDfLTyxMjuUUJZIdU6zafxjWGg50IlDZ5YBjj7AIu8HO RS3A== X-Gm-Message-State: ABUngvcYlz/VxsDfgnolxslFD8Kk7L48Chai19LW94qaXEC04HmMnR/dqWn1gC/E6r2ywvTNBJPMfifTu2vP7A== X-Received: by 10.31.155.208 with SMTP id d199mr7336396vke.55.1478593942326; Tue, 08 Nov 2016 00:32:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.36.247 with HTTP; Tue, 8 Nov 2016 00:32:21 -0800 (PST) In-Reply-To: <075f36ce-53c8-ce58-672f-6086d8decc41@freebsd.org> References: <201611051630.uA5GUhtk073581@repo.freebsd.org> <15572642.JMvQo5TC3D@ralph.baldwin.cx> <075f36ce-53c8-ce58-672f-6086d8decc41@freebsd.org> From: Sepherosa Ziehau Date: Tue, 8 Nov 2016 16:32:21 +0800 Message-ID: Subject: Re: svn commit: r308345 - head/sys/dev/e1000 To: Sean Bruno Cc: John Baldwin , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 08:32:23 -0000 On Mon, Nov 7, 2016 at 10:05 PM, Sean Bruno wrote: > > > On 11/06/16 23:37, Sepherosa Ziehau wrote: >> On Sun, Nov 6, 2016 at 7:16 AM, John Baldwin wrote: >>> On Saturday, November 05, 2016 04:30:43 PM Sean Bruno wrote: >>>> Author: sbruno >>>> Date: Sat Nov 5 16:30:42 2016 >>>> New Revision: 308345 >>>> URL: https://svnweb.freebsd.org/changeset/base/308345 >>>> >>>> Log: >>>> r295133 attempted to deactivate TSO in the 100Mbit link case with this >>>> adapter to work around bugs in TSO handling at this speed. >>>> >>>> em_init_locked is called during first boot of the adapter and will >>>> see that link_speed is unitialized, effectively turning off tso for >>>> all cards at all speeds, which I believe was *not* the intent. >>>> >>>> Move the handling of TSO deactivation to the link handler where we can >>>> more effectively make the decision about what to do. In addition, >>>> completely purge the TSO capabilities instead of disabling just CSUM_TSO. >>>> >>>> Thanks to jhb for explanation of the hw capabilites api. >>>> >>>> Thanks to royger and cognet for testing the 100Mbit failure case to >>>> ensure that their adapters do indeed still work. >>>> >>>> MFC after: 1 week >>>> Sponsored by: Limelight Networks >>>> >>>> Modified: >>>> head/sys/dev/e1000/if_em.c >>>> >>>> Modified: head/sys/dev/e1000/if_em.c >>>> ============================================================================== >>>> --- head/sys/dev/e1000/if_em.c Sat Nov 5 16:23:33 2016 (r308344) >>>> +++ head/sys/dev/e1000/if_em.c Sat Nov 5 16:30:42 2016 (r308345) >>>> @@ -369,11 +369,6 @@ MODULE_DEPEND(em, netmap, 1, 1, 1); >>>> #define MAX_INTS_PER_SEC 8000 >>>> #define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) >>>> >>>> -/* Allow common code without TSO */ >>>> -#ifndef CSUM_TSO >>>> -#define CSUM_TSO 0 >>>> -#endif >>>> - >>>> #define TSO_WORKAROUND 4 >>>> >>>> static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver parameters"); >>>> @@ -1396,15 +1391,9 @@ em_init_locked(struct adapter *adapter) >>>> if_clearhwassist(ifp); >>>> if (if_getcapenable(ifp) & IFCAP_TXCSUM) >>>> if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0); >>>> - /* >>>> - ** There have proven to be problems with TSO when not >>>> - ** at full gigabit speed, so disable the assist automatically >>>> - ** when at lower speeds. -jfv >>>> - */ >>>> - if (if_getcapenable(ifp) & IFCAP_TSO4) { >>>> - if (adapter->link_speed == SPEED_1000) >>>> - if_sethwassistbits(ifp, CSUM_TSO, 0); >>>> - } >>>> + >>>> + if (if_getcapenable(ifp) & IFCAP_TSO4) >>>> + if_sethwassistbits(ifp, CSUM_TSO, 0); >>> >>> Does this always disable TSO? Should this part be removed entirely? >>> (That is, it seems like this would disable TSO even on Gigabit links). >>> >>>> /* Configure for OS presence */ >>>> em_init_manageability(adapter); >>>> @@ -2412,6 +2401,18 @@ em_update_link_status(struct adapter *ad >>>> if (link_check && (adapter->link_active == 0)) { >>>> e1000_get_speed_and_duplex(hw, &adapter->link_speed, >>>> &adapter->link_duplex); >>>> + /* >>>> + ** There have proven to be problems with TSO when not >>>> + ** at full gigabit speed, so disable the assist automatically >>>> + ** when at lower speeds. -jfv >>>> + */ >>>> + if (adapter->link_speed != SPEED_1000) { >>>> + if_sethwassistbits(ifp, 0, CSUM_TSO); >>>> + if_setcapenablebit(ifp, 0, IFCAP_TSO4); >>>> + if_setcapabilitiesbit(ifp, 0, IFCAP_TSO4); >>>> + >>>> + } >>> >>> Even though I suggested it, I wonder if it wouldn't be better to only >>> modify if_capenable and not if_capabilities, that way the admin can >>> decide to use 'ifconfig em0 tso' to force it back on (e.g. if moving >>> an adapter from 100 to 1G). >> >> I believe simply clearing CSUM_TSO should work for the TCP stack; >> messing administrative like capenable and hwcaps does not sound >> correct to me. >> > > I don't disagree, but I also don't have an opinion. What I didn't want, > was a continuation of the half disabled/half enabled TSO code path that > we had prior to this change. > >> As for this patch, do you need to re-enable TSO once link speed >> becomes 1000Mbps? > > Probably? There wasn't a clear way to flip this back on that I could > find that would catch the case of "link speed was 100 and is now 1000". > > > BTW, since the link status check/update is async w/ >> the TX path, does this really work, if there are TSO packets pending >> on the TX rings (let alone inflight TSO packets from the TCP stack) >> when the link speed changed to 100Mbps? > > TSO packets that are "pending" will continue out their path, AFAIK. I > don't believe that a link speed change from 1000 to 100 is a very common > occurrence, but I'm willing to change the code to something more > "graceful" if you have an idea of how to do it. https://people.freebsd.org/~sephe/em1.diff Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Tue Nov 8 10:05:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A0D3C36A70; Tue, 8 Nov 2016 10:05:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDF9815; Tue, 8 Nov 2016 10:05:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA8A5B3X038634; Tue, 8 Nov 2016 10:05:11 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA8A5Bso038633; Tue, 8 Nov 2016 10:05:11 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201611081005.uA8A5Bso038633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 8 Nov 2016 10:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308440 - head/sys/dev/extres/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 10:05:12 -0000 Author: manu Date: Tue Nov 8 10:05:11 2016 New Revision: 308440 URL: https://svnweb.freebsd.org/changeset/base/308440 Log: Do not warn if the 'assigned-clock-parents' property does not exists. MFC after: 2 weeks Modified: head/sys/dev/extres/clk/clk.c Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Tue Nov 8 09:54:11 2016 (r308439) +++ head/sys/dev/extres/clk/clk.c Tue Nov 8 10:05:11 2016 (r308440) @@ -1205,7 +1205,9 @@ clk_set_assigned(device_t dev, phandle_t "assigned-clock-parents", "#clock-cells", &nclocks); if (error != 0) { - device_printf(dev, "cannot parse assigned-clock-parents property\n"); + if (error != ENOENT) + device_printf(dev, + "cannot parse assigned-clock-parents property\n"); return (error); } From owner-svn-src-head@freebsd.org Tue Nov 8 10:06:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FAADC36AD7; Tue, 8 Nov 2016 10:06:44 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FEE299A; Tue, 8 Nov 2016 10:06:44 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA8A6hQs038741; Tue, 8 Nov 2016 10:06:43 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA8A6hgP038740; Tue, 8 Nov 2016 10:06:43 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201611081006.uA8A6hgP038740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 8 Nov 2016 10:06:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308441 - head/sys/arm/allwinner/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 10:06:44 -0000 Author: manu Date: Tue Nov 8 10:06:43 2016 New Revision: 308441 URL: https://svnweb.freebsd.org/changeset/base/308441 Log: Do not fail to attach the clock if we cannot set the assigned parents as this property isn't mandatory. MFC after: 2 weeks Modified: head/sys/arm/allwinner/clk/aw_ahbclk.c Modified: head/sys/arm/allwinner/clk/aw_ahbclk.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_ahbclk.c Tue Nov 8 10:05:11 2016 (r308440) +++ head/sys/arm/allwinner/clk/aw_ahbclk.c Tue Nov 8 10:06:43 2016 (r308441) @@ -351,7 +351,7 @@ aw_ahbclk_attach(device_t dev) } error = clk_set_assigned(dev, node); - if (error != 0) { + if (error != 0 && error != ENOENT) { device_printf(dev, "cannot set assigned parents: %d\n", error); goto fail; } From owner-svn-src-head@freebsd.org Tue Nov 8 10:10:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44997C36C5C; Tue, 8 Nov 2016 10:10:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 150C3CDE; Tue, 8 Nov 2016 10:10:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA8AAtDB041396; Tue, 8 Nov 2016 10:10:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA8AAtqD041363; Tue, 8 Nov 2016 10:10:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201611081010.uA8AAtqD041363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 8 Nov 2016 10:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308442 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 10:10:56 -0000 Author: kib Date: Tue Nov 8 10:10:55 2016 New Revision: 308442 URL: https://svnweb.freebsd.org/changeset/base/308442 Log: Tweaks for the buffer pager. Pass current thread credentials instead of NOCRED. Only allow unmapped buffers for filesystem which proclaimed the support. For all filesystems which currently use buffer pager (UFS, msdosfs and cd9660), the changes are effectively nop. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue Nov 8 10:06:43 2016 (r308441) +++ head/sys/kern/vfs_bio.c Tue Nov 8 10:10:55 2016 (r308442) @@ -4686,13 +4686,15 @@ vfs_bio_getpages(struct vnode *vp, vm_pa vm_page_t m; vm_object_t object; struct buf *bp; + struct mount *mp; daddr_t lbn, lbnp; vm_ooffset_t la, lb, poff, poffe; long bsize; - int bo_bs, error, i; + int bo_bs, br_flags, error, i; bool redo, lpart; object = vp->v_object; + mp = vp->v_mount; la = IDX_TO_OFF(ma[count - 1]->pindex); if (la >= object->un_pager.vnp.vnp_size) return (VM_PAGER_BAD); @@ -4709,6 +4711,8 @@ vfs_bio_getpages(struct vnode *vp, vm_pa vnp.vnp_size, PAGE_SIZE) - la); } } + br_flags = (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMAPPED_BUFS) + != 0) ? GB_UNMAPPED : 0; VM_OBJECT_WLOCK(object); again: for (i = 0; i < count; i++) @@ -4741,8 +4745,8 @@ again: lbnp = lbn; bsize = get_blksize(vp, lbn); - error = bread_gb(vp, lbn, bsize, NOCRED, GB_UNMAPPED, - &bp); + error = bread_gb(vp, lbn, bsize, curthread->td_ucred, + br_flags, &bp); if (error != 0) goto end_pages; if (LIST_EMPTY(&bp->b_dep)) { From owner-svn-src-head@freebsd.org Tue Nov 8 11:36:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87FB1C37C68; Tue, 8 Nov 2016 11:36:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 411D3232; Tue, 8 Nov 2016 11:36:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA8BaXYR073939; Tue, 8 Nov 2016 11:36:33 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA8BaXrs073937; Tue, 8 Nov 2016 11:36:33 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201611081136.uA8BaXrs073937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 8 Nov 2016 11:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308443 - head/bin/hostname X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 11:36:34 -0000 Author: araujo Date: Tue Nov 8 11:36:33 2016 New Revision: 308443 URL: https://svnweb.freebsd.org/changeset/base/308443 Log: Add -d flag that prints domain only. PR: 212875 Submitted by: Ben RUBSON Reviewed by: pi Modified: head/bin/hostname/hostname.1 head/bin/hostname/hostname.c Modified: head/bin/hostname/hostname.1 ============================================================================== --- head/bin/hostname/hostname.1 Tue Nov 8 10:10:55 2016 (r308442) +++ head/bin/hostname/hostname.1 Tue Nov 8 11:36:33 2016 (r308443) @@ -29,7 +29,7 @@ .\" @(#)hostname.1 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd December 7, 2006 +.Dd November 9, 2016 .Dt HOSTNAME 1 .Os .Sh NAME @@ -37,7 +37,8 @@ .Nd set or print name of current host system .Sh SYNOPSIS .Nm -.Op Fl fs +.Op Fl f +.Op Fl s|d .Op Ar name-of-host .Sh DESCRIPTION The @@ -62,6 +63,8 @@ This is the default behavior. .It Fl s Trim off any domain information from the printed name. +.It Fl d +Only print domain information. .El .Sh SEE ALSO .Xr gethostname 3 , Modified: head/bin/hostname/hostname.c ============================================================================== --- head/bin/hostname/hostname.c Tue Nov 8 10:10:55 2016 (r308442) +++ head/bin/hostname/hostname.c Tue Nov 8 11:36:33 2016 (r308443) @@ -54,11 +54,12 @@ static void usage(void) __dead2; int main(int argc, char *argv[]) { - int ch, sflag; + int ch, sflag, dflag; char *p, hostname[MAXHOSTNAMELEN]; sflag = 0; - while ((ch = getopt(argc, argv, "fs")) != -1) + dflag = 0; + while ((ch = getopt(argc, argv, "fsd")) != -1) switch (ch) { case 'f': /* @@ -70,6 +71,9 @@ main(int argc, char *argv[]) case 's': sflag = 1; break; + case 'd': + dflag = 1; + break; case '?': default: usage(); @@ -77,7 +81,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (argc > 1) + if (argc > 1 || (sflag && dflag)) usage(); if (*argv) { @@ -90,6 +94,10 @@ main(int argc, char *argv[]) p = strchr(hostname, '.'); if (p != NULL) *p = '\0'; + } else if (dflag) { + p = strchr(hostname, '.'); + if (p != NULL) + strcpy(hostname, ++p); } (void)printf("%s\n", hostname); } @@ -100,6 +108,6 @@ static void usage(void) { - (void)fprintf(stderr, "usage: hostname [-fs] [name-of-host]\n"); + (void)fprintf(stderr, "usage: hostname [-f] [s|d] [name-of-host]\n"); exit(1); } From owner-svn-src-head@freebsd.org Tue Nov 8 12:15:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 002F0C3527F; Tue, 8 Nov 2016 12:15:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4F85CEA; Tue, 8 Nov 2016 12:15:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA8CFw6D089649; Tue, 8 Nov 2016 12:15:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA8CFvNc089640; Tue, 8 Nov 2016 12:15:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611081215.uA8CFvNc089640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 8 Nov 2016 12:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308444 - in head/sys/arm: allwinner allwinner/a10 broadcom/bcm2835 qemu ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 12:15:59 -0000 Author: andrew Date: Tue Nov 8 12:15:57 2016 New Revision: 308444 URL: https://svnweb.freebsd.org/changeset/base/308444 Log: Start to remove the old pre-INTRNG code from the arm platforms. These have all moved to use INTRNG. Reviewed by: manu, mmel Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D8469 Deleted: head/sys/arm/allwinner/a10_common.c head/sys/arm/broadcom/bcm2835/bcm2835_common.c head/sys/arm/broadcom/bcm2835/bcm2836.h head/sys/arm/qemu/virt_common.c head/sys/arm/ti/ti_common.c Modified: head/sys/arm/allwinner/a10/a10_intc.c head/sys/arm/allwinner/files.allwinner head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/broadcom/bcm2835/bcm2835_intr.c head/sys/arm/broadcom/bcm2835/bcm2836.c head/sys/arm/broadcom/bcm2835/bcm2836_mp.c head/sys/arm/broadcom/bcm2835/files.bcm283x head/sys/arm/qemu/files.qemu head/sys/arm/ti/aintc.c head/sys/arm/ti/files.ti head/sys/arm/ti/ti_gpio.c head/sys/arm/ti/ti_gpio.h Modified: head/sys/arm/allwinner/a10/a10_intc.c ============================================================================== --- head/sys/arm/allwinner/a10/a10_intc.c Tue Nov 8 11:36:33 2016 (r308443) +++ head/sys/arm/allwinner/a10/a10_intc.c Tue Nov 8 12:15:57 2016 (r308444) @@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef INTRNG #include -#endif #include #include @@ -54,9 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef INTRNG #include "pic_if.h" -#endif /** * Interrupt controller registers @@ -97,12 +93,10 @@ __FBSDID("$FreeBSD$"); #define SW_INT_ENABLE_REG(_b) (0x40 + ((_b) * 4)) #define SW_INT_MASK_REG(_b) (0x50 + ((_b) * 4)) -#ifdef INTRNG struct a10_intr_irqsrc { struct intr_irqsrc isrc; u_int irq; }; -#endif struct a10_aintc_softc { device_t sc_dev; @@ -110,9 +104,7 @@ struct a10_aintc_softc { bus_space_tag_t aintc_bst; bus_space_handle_t aintc_bsh; struct mtx mtx; -#ifdef INTRNG struct a10_intr_irqsrc isrcs[A10_INTR_MAX_NIRQS]; -#endif }; #define aintc_read_4(sc, reg) \ @@ -189,31 +181,6 @@ a10_pending_irq(struct a10_aintc_softc * return (-1); } -#ifndef INTRNG - -static struct a10_aintc_softc *a10_aintc_sc = NULL; - -int -arm_get_next_irq(int last_irq) -{ - return (a10_pending_irq(a10_aintc_sc)); -} - -void -arm_mask_irq(uintptr_t irq) -{ - a10_intr_mask(a10_aintc_sc, irq); -} - -void -arm_unmask_irq(uintptr_t irq) -{ - a10_intr_unmask(a10_aintc_sc, irq); - a10_intr_eoi(a10_aintc_sc, irq); -} - -#else /* INTRNG */ - static int a10_intr(void *arg) { @@ -340,8 +307,6 @@ a10_intr_post_filter(device_t dev, struc a10_intr_eoi(sc, irq); } -#endif /* INTRNG */ - static int a10_aintc_probe(device_t dev) { @@ -363,13 +328,6 @@ a10_aintc_attach(device_t dev) int i; sc->sc_dev = dev; -#ifndef INTRNG - if (a10_aintc_sc) - goto error; - - a10_aintc_sc = sc; -#endif - sc->aintc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (!sc->aintc_res) { @@ -393,12 +351,10 @@ a10_aintc_attach(device_t dev) /* config the external interrupt source type*/ aintc_write_4(sc, SW_INT_NMI_CTRL_REG, 0x00); -#ifdef INTRNG if (a10_intr_pic_attach(sc) != 0) { device_printf(dev, "could not attach PIC\n"); return (ENXIO); } -#endif return (0); @@ -411,7 +367,7 @@ error: static device_method_t a10_aintc_methods[] = { DEVMETHOD(device_probe, a10_aintc_probe), DEVMETHOD(device_attach, a10_aintc_attach), -#ifdef INTRNG + /* Interrupt controller interface */ DEVMETHOD(pic_disable_intr, a10_intr_disable_intr), DEVMETHOD(pic_enable_intr, a10_intr_enable_intr), @@ -419,7 +375,7 @@ static device_method_t a10_aintc_methods DEVMETHOD(pic_post_filter, a10_intr_post_filter), DEVMETHOD(pic_post_ithread, a10_intr_post_ithread), DEVMETHOD(pic_pre_ithread, a10_intr_pre_ithread), -#endif + { 0, 0 } }; Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Tue Nov 8 11:36:33 2016 (r308443) +++ head/sys/arm/allwinner/files.allwinner Tue Nov 8 12:15:57 2016 (r308444) @@ -3,7 +3,6 @@ kern/kern_clocksource.c standard arm/allwinner/a10_ahci.c optional ahci arm/allwinner/a10_codec.c optional sound -arm/allwinner/a10_common.c standard arm/allwinner/a10_dmac.c standard arm/allwinner/a31_dmac.c standard arm/allwinner/a10_ehci.c optional ehci Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Tue Nov 8 11:36:33 2016 (r308443) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Tue Nov 8 12:15:57 2016 (r308444) @@ -53,9 +53,7 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" -#ifdef INTRNG #include "pic_if.h" -#endif #ifdef DEBUG #define dprintf(fmt, args...) do { printf("%s(): ", __func__); \ @@ -68,15 +66,10 @@ __FBSDID("$FreeBSD$"); #define BCM_GPIO_PINS 54 #define BCM_GPIO_PINS_PER_BANK 32 -#ifdef INTRNG #define BCM_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN | GPIO_INTR_LEVEL_LOW | \ GPIO_INTR_LEVEL_HIGH | GPIO_INTR_EDGE_RISING | \ GPIO_INTR_EDGE_FALLING | GPIO_INTR_EDGE_BOTH) -#else -#define BCM_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ - GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) -#endif static struct resource_spec bcm_gpio_res_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -90,14 +83,12 @@ struct bcm_gpio_sysctl { uint32_t pin; }; -#ifdef INTRNG struct bcm_gpio_irqsrc { struct intr_irqsrc bgi_isrc; uint32_t bgi_irq; uint32_t bgi_mode; uint32_t bgi_mask; }; -#endif struct bcm_gpio_softc { device_t sc_dev; @@ -111,16 +102,8 @@ struct bcm_gpio_softc { int sc_ro_npins; int sc_ro_pins[BCM_GPIO_PINS]; struct gpio_pin sc_gpio_pins[BCM_GPIO_PINS]; -#ifndef INTRNG - struct intr_event * sc_events[BCM_GPIO_PINS]; -#endif struct bcm_gpio_sysctl sc_sysctl[BCM_GPIO_PINS]; -#ifdef INTRNG struct bcm_gpio_irqsrc sc_isrcs[BCM_GPIO_PINS]; -#else - enum intr_trigger sc_irq_trigger[BCM_GPIO_PINS]; - enum intr_polarity sc_irq_polarity[BCM_GPIO_PINS]; -#endif }; enum bcm_gpio_pud { @@ -165,12 +148,10 @@ static struct ofw_compat_data compat_dat static struct bcm_gpio_softc *bcm_gpio_sc = NULL; -#ifdef INTRNG static int bcm_gpio_intr_bank0(void *arg); static int bcm_gpio_intr_bank1(void *arg); static int bcm_gpio_pic_attach(struct bcm_gpio_softc *sc); static int bcm_gpio_pic_detach(struct bcm_gpio_softc *sc); -#endif static int bcm_gpio_pin_is_ro(struct bcm_gpio_softc *sc, int pin) @@ -703,42 +684,6 @@ bcm_gpio_get_reserved_pins(struct bcm_gp return (0); } -#ifndef INTRNG -static int -bcm_gpio_intr(void *arg) -{ - int bank_last, irq; - struct bcm_gpio_softc *sc; - struct intr_event *event; - uint32_t bank, mask, reg; - - sc = (struct bcm_gpio_softc *)arg; - reg = 0; - bank_last = -1; - for (irq = 0; irq < BCM_GPIO_PINS; irq++) { - bank = BCM_GPIO_BANK(irq); - mask = BCM_GPIO_MASK(irq); - if (bank != bank_last) { - reg = BCM_GPIO_READ(sc, BCM_GPIO_GPEDS(bank)); - bank_last = bank; - } - if (reg & mask) { - event = sc->sc_events[irq]; - if (event != NULL && !TAILQ_EMPTY(&event->ie_handlers)) - intr_event_handle(event, NULL); - else { - device_printf(sc->sc_dev, "Stray IRQ %d\n", - irq); - } - /* Clear the Status bit by writing '1' to it. */ - BCM_GPIO_WRITE(sc, BCM_GPIO_GPEDS(bank), mask); - } - } - - return (FILTER_HANDLED); -} -#endif - static int bcm_gpio_probe(device_t dev) { @@ -753,7 +698,6 @@ bcm_gpio_probe(device_t dev) return (BUS_PROBE_DEFAULT); } -#ifdef INTRNG static int bcm_gpio_intr_attach(device_t dev) { @@ -795,41 +739,6 @@ bcm_gpio_intr_detach(device_t dev) bcm_gpio_pic_detach(sc); } -#else -static int -bcm_gpio_intr_attach(device_t dev) -{ - struct bcm_gpio_softc *sc; - int i; - - sc = device_get_softc(dev); - for (i = 0; i < BCM_GPIO_IRQS; i++) { - if (bus_setup_intr(dev, sc->sc_res[i + 1], - INTR_TYPE_MISC | INTR_MPSAFE, bcm_gpio_intr, - NULL, sc, &sc->sc_intrhand[i]) != 0) { - return (-1); - } - } - - return (0); -} - -static void -bcm_gpio_intr_detach(device_t dev) -{ - struct bcm_gpio_softc *sc; - int i; - - sc = device_get_softc(dev); - for (i = 0; i < BCM_GPIO_IRQS; i++) { - if (sc->sc_intrhand[i]) { - bus_teardown_intr(dev, sc->sc_res[i + 1], - sc->sc_intrhand[i]); - } - } -} -#endif - static int bcm_gpio_attach(device_t dev) { @@ -874,11 +783,6 @@ bcm_gpio_attach(device_t dev) sc->sc_gpio_pins[i].gp_pin = j; sc->sc_gpio_pins[i].gp_caps = BCM_GPIO_DEFAULT_CAPS; sc->sc_gpio_pins[i].gp_flags = bcm_gpio_func_flag(func); -#ifndef INTRNG - /* The default is active-low interrupts. */ - sc->sc_irq_trigger[i] = INTR_TRIGGER_LEVEL; - sc->sc_irq_polarity[i] = INTR_POLARITY_LOW; -#endif i++; } sc->sc_gpio_npins = i; @@ -904,7 +808,6 @@ bcm_gpio_detach(device_t dev) return (EBUSY); } -#ifdef INTRNG static inline void bcm_gpio_modify(struct bcm_gpio_softc *sc, uint32_t reg, uint32_t mask, bool set_bits) @@ -1275,179 +1178,6 @@ bcm_gpio_pic_teardown_intr(device_t dev, return (0); } -#else -static uint32_t -bcm_gpio_intr_reg(struct bcm_gpio_softc *sc, unsigned int irq, uint32_t bank) -{ - - if (irq > BCM_GPIO_PINS) - return (0); - if (sc->sc_irq_trigger[irq] == INTR_TRIGGER_LEVEL) { - if (sc->sc_irq_polarity[irq] == INTR_POLARITY_LOW) - return (BCM_GPIO_GPLEN(bank)); - else if (sc->sc_irq_polarity[irq] == INTR_POLARITY_HIGH) - return (BCM_GPIO_GPHEN(bank)); - } else if (sc->sc_irq_trigger[irq] == INTR_TRIGGER_EDGE) { - if (sc->sc_irq_polarity[irq] == INTR_POLARITY_LOW) - return (BCM_GPIO_GPFEN(bank)); - else if (sc->sc_irq_polarity[irq] == INTR_POLARITY_HIGH) - return (BCM_GPIO_GPREN(bank)); - } - - return (0); -} - -static void -bcm_gpio_mask_irq(void *source) -{ - uint32_t bank, mask, reg; - unsigned int irq; - - irq = (unsigned int)source; - if (irq > BCM_GPIO_PINS) - return; - if (bcm_gpio_pin_is_ro(bcm_gpio_sc, irq)) - return; - bank = BCM_GPIO_BANK(irq); - mask = BCM_GPIO_MASK(irq); - BCM_GPIO_LOCK(bcm_gpio_sc); - reg = bcm_gpio_intr_reg(bcm_gpio_sc, irq, bank); - if (reg != 0) - BCM_GPIO_CLEAR_BITS(bcm_gpio_sc, reg, mask); - BCM_GPIO_UNLOCK(bcm_gpio_sc); -} - -static void -bcm_gpio_unmask_irq(void *source) -{ - uint32_t bank, mask, reg; - unsigned int irq; - - irq = (unsigned int)source; - if (irq > BCM_GPIO_PINS) - return; - if (bcm_gpio_pin_is_ro(bcm_gpio_sc, irq)) - return; - bank = BCM_GPIO_BANK(irq); - mask = BCM_GPIO_MASK(irq); - BCM_GPIO_LOCK(bcm_gpio_sc); - reg = bcm_gpio_intr_reg(bcm_gpio_sc, irq, bank); - if (reg != 0) - BCM_GPIO_SET_BITS(bcm_gpio_sc, reg, mask); - BCM_GPIO_UNLOCK(bcm_gpio_sc); -} - -static int -bcm_gpio_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) -{ - int pin; - - if (type != SYS_RES_IRQ) - return (ENXIO); - /* Unmask the interrupt. */ - pin = rman_get_start(res); - bcm_gpio_unmask_irq((void *)pin); - - return (0); -} - -static int -bcm_gpio_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) -{ - int pin; - - if (type != SYS_RES_IRQ) - return (ENXIO); - /* Mask the interrupt. */ - pin = rman_get_start(res); - bcm_gpio_mask_irq((void *)pin); - - return (0); -} - -static int -bcm_gpio_config_intr(device_t dev, int irq, enum intr_trigger trig, - enum intr_polarity pol) -{ - int bank; - struct bcm_gpio_softc *sc; - uint32_t mask, oldreg, reg; - - if (irq > BCM_GPIO_PINS) - return (EINVAL); - /* There is no standard trigger or polarity. */ - if (trig == INTR_TRIGGER_CONFORM || pol == INTR_POLARITY_CONFORM) - return (EINVAL); - sc = device_get_softc(dev); - if (bcm_gpio_pin_is_ro(sc, irq)) - return (EINVAL); - bank = BCM_GPIO_BANK(irq); - mask = BCM_GPIO_MASK(irq); - BCM_GPIO_LOCK(sc); - oldreg = bcm_gpio_intr_reg(sc, irq, bank); - sc->sc_irq_trigger[irq] = trig; - sc->sc_irq_polarity[irq] = pol; - reg = bcm_gpio_intr_reg(sc, irq, bank); - if (reg != 0) - BCM_GPIO_SET_BITS(sc, reg, mask); - if (reg != oldreg && oldreg != 0) - BCM_GPIO_CLEAR_BITS(sc, oldreg, mask); - BCM_GPIO_UNLOCK(sc); - - return (0); -} - -static int -bcm_gpio_setup_intr(device_t bus, device_t child, struct resource *ires, - int flags, driver_filter_t *filt, driver_intr_t *handler, - void *arg, void **cookiep) -{ - struct bcm_gpio_softc *sc; - struct intr_event *event; - int pin, error; - - sc = device_get_softc(bus); - pin = rman_get_start(ires); - if (pin > BCM_GPIO_PINS) - panic("%s: bad pin %d", __func__, pin); - event = sc->sc_events[pin]; - if (event == NULL) { - error = intr_event_create(&event, (void *)pin, 0, pin, - bcm_gpio_mask_irq, bcm_gpio_unmask_irq, NULL, NULL, - "gpio%d pin%d:", device_get_unit(bus), pin); - if (error != 0) - return (error); - sc->sc_events[pin] = event; - } - intr_event_add_handler(event, device_get_nameunit(child), filt, - handler, arg, intr_priority(flags), flags, cookiep); - - return (0); -} - -static int -bcm_gpio_teardown_intr(device_t dev, device_t child, struct resource *ires, - void *cookie) -{ - struct bcm_gpio_softc *sc; - int pin, err; - - sc = device_get_softc(dev); - pin = rman_get_start(ires); - if (pin > BCM_GPIO_PINS) - panic("%s: bad pin %d", __func__, pin); - if (sc->sc_events[pin] == NULL) - panic("Trying to teardown unoccupied IRQ"); - err = intr_event_remove_handler(cookie); - if (!err) - sc->sc_events[pin] = NULL; - - return (err); -} -#endif - static phandle_t bcm_gpio_get_node(device_t bus, device_t dev) { @@ -1473,7 +1203,6 @@ static device_method_t bcm_gpio_methods[ DEVMETHOD(gpio_pin_set, bcm_gpio_pin_set), DEVMETHOD(gpio_pin_toggle, bcm_gpio_pin_toggle), -#ifdef INTRNG /* Interrupt controller interface */ DEVMETHOD(pic_disable_intr, bcm_gpio_pic_disable_intr), DEVMETHOD(pic_enable_intr, bcm_gpio_pic_enable_intr), @@ -1483,14 +1212,7 @@ static device_method_t bcm_gpio_methods[ DEVMETHOD(pic_pre_ithread, bcm_gpio_pic_pre_ithread), DEVMETHOD(pic_setup_intr, bcm_gpio_pic_setup_intr), DEVMETHOD(pic_teardown_intr, bcm_gpio_pic_teardown_intr), -#else - /* Bus interface */ - DEVMETHOD(bus_activate_resource, bcm_gpio_activate_resource), - DEVMETHOD(bus_deactivate_resource, bcm_gpio_deactivate_resource), - DEVMETHOD(bus_config_intr, bcm_gpio_config_intr), - DEVMETHOD(bus_setup_intr, bcm_gpio_setup_intr), - DEVMETHOD(bus_teardown_intr, bcm_gpio_teardown_intr), -#endif + /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, bcm_gpio_get_node), Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Tue Nov 8 11:36:33 2016 (r308443) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Tue Nov 8 12:15:57 2016 (r308444) @@ -48,13 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef SOC_BCM2836 -#include -#endif - -#ifdef INTRNG #include "pic_if.h" -#endif #define INTC_PENDING_BASIC 0x00 #define INTC_PENDING_BANK1 0x04 @@ -105,17 +99,10 @@ __FBSDID("$FreeBSD$"); #define BANK1_END (BANK1_START + 32 - 1) #define BANK2_START (BANK1_START + 32) #define BANK2_END (BANK2_START + 32 - 1) -#ifndef INTRNG -#define BANK3_START (BANK2_START + 32) -#define BANK3_END (BANK3_START + 32 - 1) -#endif #define IS_IRQ_BASIC(n) (((n) >= 0) && ((n) < BANK1_START)) #define IS_IRQ_BANK1(n) (((n) >= BANK1_START) && ((n) <= BANK1_END)) #define IS_IRQ_BANK2(n) (((n) >= BANK2_START) && ((n) <= BANK2_END)) -#ifndef INTRNG -#define ID_IRQ_BCM2836(n) (((n) >= BANK3_START) && ((n) <= BANK3_END)) -#endif #define IRQ_BANK1(n) ((n) - BANK1_START) #define IRQ_BANK2(n) ((n) - BANK2_START) @@ -125,7 +112,6 @@ __FBSDID("$FreeBSD$"); #define dprintf(fmt, args...) #endif -#ifdef INTRNG #define BCM_INTC_NIRQS 72 /* 8 + 32 + 32 */ struct bcm_intc_irqsrc { @@ -135,18 +121,15 @@ struct bcm_intc_irqsrc { uint16_t bii_enable_reg; uint32_t bii_mask; }; -#endif struct bcm_intc_softc { device_t sc_dev; struct resource * intc_res; bus_space_tag_t intc_bst; bus_space_handle_t intc_bsh; -#ifdef INTRNG struct resource * intc_irq_res; void * intc_irq_hdl; struct bcm_intc_irqsrc intc_isrcs[BCM_INTC_NIRQS]; -#endif }; static struct bcm_intc_softc *bcm_intc_sc = NULL; @@ -156,7 +139,6 @@ static struct bcm_intc_softc *bcm_intc_s #define intc_write_4(_sc, reg, val) \ bus_space_write_4((_sc)->intc_bst, (_sc)->intc_bsh, (reg), (val)) -#ifdef INTRNG static inline void bcm_intc_isrc_mask(struct bcm_intc_softc *sc, struct bcm_intc_irqsrc *bii) { @@ -375,7 +357,6 @@ bcm_intc_pic_register(struct bcm_intc_so return (0); } -#endif static int bcm_intc_probe(device_t dev) @@ -396,9 +377,7 @@ bcm_intc_attach(device_t dev) { struct bcm_intc_softc *sc = device_get_softc(dev); int rid = 0; -#ifdef INTRNG intptr_t xref; -#endif sc->sc_dev = dev; if (bcm_intc_sc) @@ -410,7 +389,6 @@ bcm_intc_attach(device_t dev) return (ENXIO); } -#ifdef INTRNG xref = OF_xref_from_node(ofw_bus_get_node(dev)); if (bcm_intc_pic_register(sc, xref) != 0) { bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->intc_res); @@ -435,7 +413,6 @@ bcm_intc_attach(device_t dev) return (ENXIO); } } -#endif sc->intc_bst = rman_get_bustag(sc->intc_res); sc->intc_bsh = rman_get_bushandle(sc->intc_res); @@ -448,14 +425,12 @@ static device_method_t bcm_intc_methods[ DEVMETHOD(device_probe, bcm_intc_probe), DEVMETHOD(device_attach, bcm_intc_attach), -#ifdef INTRNG DEVMETHOD(pic_disable_intr, bcm_intc_disable_intr), DEVMETHOD(pic_enable_intr, bcm_intc_enable_intr), DEVMETHOD(pic_map_intr, bcm_intc_map_intr), DEVMETHOD(pic_post_filter, bcm_intc_post_filter), DEVMETHOD(pic_post_ithread, bcm_intc_post_ithread), DEVMETHOD(pic_pre_ithread, bcm_intc_pre_ithread), -#endif { 0, 0 } }; @@ -470,105 +445,3 @@ static devclass_t bcm_intc_devclass; EARLY_DRIVER_MODULE(intc, simplebus, bcm_intc_driver, bcm_intc_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); - -#ifndef INTRNG -int -arm_get_next_irq(int last_irq) -{ - struct bcm_intc_softc *sc = bcm_intc_sc; - uint32_t pending; - int32_t irq = last_irq + 1; -#ifdef SOC_BCM2836 - int ret; -#endif - - /* Sanity check */ - if (irq < 0) - irq = 0; - -#ifdef SOC_BCM2836 - if ((ret = bcm2836_get_next_irq(irq)) < 0) - return (-1); - if (ret != BCM2836_GPU_IRQ) - return (ret + BANK3_START); -#endif - - /* TODO: should we mask last_irq? */ - if (irq < BANK1_START) { - pending = intc_read_4(sc, INTC_PENDING_BASIC); - if ((pending & 0xFF) == 0) { - irq = BANK1_START; /* skip to next bank */ - } else do { - if (pending & (1 << irq)) - return irq; - irq++; - } while (irq < BANK1_START); - } - if (irq < BANK2_START) { - pending = intc_read_4(sc, INTC_PENDING_BANK1); - if (pending == 0) { - irq = BANK2_START; /* skip to next bank */ - } else do { - if (pending & (1 << IRQ_BANK1(irq))) - return irq; - irq++; - } while (irq < BANK2_START); - } - if (irq < BANK3_START) { - pending = intc_read_4(sc, INTC_PENDING_BANK2); - if (pending != 0) do { - if (pending & (1 << IRQ_BANK2(irq))) - return irq; - irq++; - } while (irq < BANK3_START); - } - return (-1); -} - -void -arm_mask_irq(uintptr_t nb) -{ - struct bcm_intc_softc *sc = bcm_intc_sc; - dprintf("%s: %d\n", __func__, nb); - - if (IS_IRQ_BASIC(nb)) - intc_write_4(sc, INTC_DISABLE_BASIC, (1 << nb)); - else if (IS_IRQ_BANK1(nb)) - intc_write_4(sc, INTC_DISABLE_BANK1, (1 << IRQ_BANK1(nb))); - else if (IS_IRQ_BANK2(nb)) - intc_write_4(sc, INTC_DISABLE_BANK2, (1 << IRQ_BANK2(nb))); -#ifdef SOC_BCM2836 - else if (ID_IRQ_BCM2836(nb)) - bcm2836_mask_irq(nb - BANK3_START); -#endif - else - printf("arm_mask_irq: Invalid IRQ number: %d\n", nb); -} - -void -arm_unmask_irq(uintptr_t nb) -{ - struct bcm_intc_softc *sc = bcm_intc_sc; - dprintf("%s: %d\n", __func__, nb); - - if (IS_IRQ_BASIC(nb)) - intc_write_4(sc, INTC_ENABLE_BASIC, (1 << nb)); - else if (IS_IRQ_BANK1(nb)) - intc_write_4(sc, INTC_ENABLE_BANK1, (1 << IRQ_BANK1(nb))); - else if (IS_IRQ_BANK2(nb)) - intc_write_4(sc, INTC_ENABLE_BANK2, (1 << IRQ_BANK2(nb))); -#ifdef SOC_BCM2836 - else if (ID_IRQ_BCM2836(nb)) - bcm2836_unmask_irq(nb - BANK3_START); -#endif - else - printf("arm_mask_irq: Invalid IRQ number: %d\n", nb); -} - -#ifdef SMP -void -intr_pic_init_secondary(void) -{ -} -#endif -#endif Modified: head/sys/arm/broadcom/bcm2835/bcm2836.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2836.c Tue Nov 8 11:36:33 2016 (r308443) +++ head/sys/arm/broadcom/bcm2835/bcm2836.c Tue Nov 8 12:15:57 2016 (r308444) @@ -53,26 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef INTRNG #include "pic_if.h" -#else -#include - -#define ARM_LOCAL_BASE 0x40000000 -#define ARM_LOCAL_SIZE 0x00001000 -#define ARM_LOCAL_CONTROL 0x00 -#define ARM_LOCAL_PRESCALER 0x08 -#define PRESCALER_19_2 0x80000000 /* 19.2 MHz */ -#define ARM_LOCAL_INT_TIMER(n) (0x40 + (n) * 4) -#define ARM_LOCAL_INT_MAILBOX(n) (0x50 + (n) * 4) -#define ARM_LOCAL_INT_PENDING(n) (0x60 + (n) * 4) -#define INT_PENDING_MASK 0x011f -#define MAILBOX0_IRQ 4 -#define MAILBOX0_IRQEN (1 << 0) -#endif - -#ifdef INTRNG #define BCM_LINTC_CONTROL_REG 0x00 #define BCM_LINTC_PRESCALER_REG 0x08 #define BCM_LINTC_GPU_ROUTING_REG 0x0c @@ -751,163 +733,3 @@ static devclass_t bcm_lintc_devclass; EARLY_DRIVER_MODULE(local_intc, simplebus, bcm_lintc_driver, bcm_lintc_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); -#else -/* - * A driver for features of the bcm2836. - */ - -struct bcm2836_softc { - device_t sc_dev; - struct resource *sc_mem; -}; - -static device_identify_t bcm2836_identify; -static device_probe_t bcm2836_probe; -static device_attach_t bcm2836_attach; - -struct bcm2836_softc *softc; - -static void -bcm2836_identify(driver_t *driver, device_t parent) -{ - - if (BUS_ADD_CHILD(parent, 0, "bcm2836", -1) == NULL) - device_printf(parent, "add child failed\n"); -} - -static int -bcm2836_probe(device_t dev) -{ - - if (softc != NULL) - return (ENXIO); - - device_set_desc(dev, "Broadcom bcm2836"); - - return (BUS_PROBE_DEFAULT); -} - -static int -bcm2836_attach(device_t dev) -{ - int i, rid; - - softc = device_get_softc(dev); - softc->sc_dev = dev; - - rid = 0; - softc->sc_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - ARM_LOCAL_BASE, ARM_LOCAL_BASE + ARM_LOCAL_SIZE, ARM_LOCAL_SIZE, - RF_ACTIVE); - if (softc->sc_mem == NULL) { - device_printf(dev, "could not allocate memory resource\n"); - return (ENXIO); - } - - bus_write_4(softc->sc_mem, ARM_LOCAL_CONTROL, 0); - bus_write_4(softc->sc_mem, ARM_LOCAL_PRESCALER, PRESCALER_19_2); - - for (i = 0; i < 4; i++) - bus_write_4(softc->sc_mem, ARM_LOCAL_INT_TIMER(i), 0); - - for (i = 0; i < 4; i++) - bus_write_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(i), 1); - - return (0); -} - -int -bcm2836_get_next_irq(int last_irq) -{ - uint32_t reg; - int cpu; - int irq; - - cpu = PCPU_GET(cpuid); - - reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_PENDING(cpu)); - reg &= INT_PENDING_MASK; - if (reg == 0) - return (-1); - - irq = ffs(reg) - 1; - - return (irq); -} - -void -bcm2836_mask_irq(uintptr_t irq) -{ - uint32_t reg; -#ifdef SMP - int cpu; -#endif - int i; - - if (irq < MAILBOX0_IRQ) { - for (i = 0; i < 4; i++) { - reg = bus_read_4(softc->sc_mem, - ARM_LOCAL_INT_TIMER(i)); - reg &= ~(1 << irq); - bus_write_4(softc->sc_mem, - ARM_LOCAL_INT_TIMER(i), reg); - } -#ifdef SMP - } else if (irq == MAILBOX0_IRQ) { - /* Mailbox 0 for IPI */ - cpu = PCPU_GET(cpuid); - reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(cpu)); - reg &= ~MAILBOX0_IRQEN; - bus_write_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(cpu), reg); -#endif - } -} - -void -bcm2836_unmask_irq(uintptr_t irq) -{ - uint32_t reg; -#ifdef SMP - int cpu; -#endif - int i; - - if (irq < MAILBOX0_IRQ) { - for (i = 0; i < 4; i++) { - reg = bus_read_4(softc->sc_mem, - ARM_LOCAL_INT_TIMER(i)); - reg |= (1 << irq); - bus_write_4(softc->sc_mem, - ARM_LOCAL_INT_TIMER(i), reg); - } -#ifdef SMP - } else if (irq == MAILBOX0_IRQ) { - /* Mailbox 0 for IPI */ - cpu = PCPU_GET(cpuid); - reg = bus_read_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(cpu)); - reg |= MAILBOX0_IRQEN; - bus_write_4(softc->sc_mem, ARM_LOCAL_INT_MAILBOX(cpu), reg); -#endif - } -} - -static device_method_t bcm2836_methods[] = { - /* Device interface */ - DEVMETHOD(device_identify, bcm2836_identify), - DEVMETHOD(device_probe, bcm2836_probe), - DEVMETHOD(device_attach, bcm2836_attach), - - DEVMETHOD_END -}; - -static devclass_t bcm2836_devclass; - -static driver_t bcm2836_driver = { - "bcm2836", - bcm2836_methods, - sizeof(struct bcm2836_softc), -}; - -EARLY_DRIVER_MODULE(bcm2836, nexus, bcm2836_driver, bcm2836_devclass, 0, 0, - BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); -#endif Modified: head/sys/arm/broadcom/bcm2835/bcm2836_mp.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2836_mp.c Tue Nov 8 11:36:33 2016 (r308443) +++ head/sys/arm/broadcom/bcm2835/bcm2836_mp.c Tue Nov 8 12:15:57 2016 (r308444) @@ -142,43 +142,3 @@ bcm2836_mp_start_ap(platform_t plat) CPU_SET(i, &all_cpus); } } - -#ifndef INTRNG -void -pic_ipi_send(cpuset_t cpus, u_int ipi) -{ - int i; - - dsb(); - for (i = 0; i < mp_ncpus; i++) { - if (CPU_ISSET(i, &cpus)) - BSWR4(MBOX0SET_CORE(i), 1 << ipi); - } - wmb(); -} - -int -pic_ipi_read(int i) -{ - uint32_t val; - int cpu, ipi; - - cpu = PCPU_GET(cpuid); - dsb(); - if (i != -1) { - val = BSRD4(MBOX0CLR_CORE(cpu)); - if (val == 0) - return (0); - ipi = ffs(val) - 1; - BSWR4(MBOX0CLR_CORE(cpu), 1 << ipi); - dsb(); - return (ipi); - } - return (0x3ff); -} - -void -pic_ipi_clear(int ipi) -{ -} -#endif Modified: head/sys/arm/broadcom/bcm2835/files.bcm283x ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm283x Tue Nov 8 11:36:33 2016 (r308443) +++ head/sys/arm/broadcom/bcm2835/files.bcm283x Tue Nov 8 12:15:57 2016 (r308444) @@ -1,7 +1,6 @@ # $FreeBSD$ arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Nov 8 17:02:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BBEFC36128; Tue, 8 Nov 2016 17:02:38 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f65.google.com (mail-it0-f65.google.com [209.85.214.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8BE5168; Tue, 8 Nov 2016 17:02:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f65.google.com with SMTP id q124so17647364itd.1; Tue, 08 Nov 2016 09:02:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=1h6CyAP0NZAbZxKbamt51kO99EwBgSACHhFh82A9t2c=; b=Da53ZpSGqlbNTF+tvLCS1CRT7iI9zCOvtPx/HvAAvca+geQCQVfanipaZmyGuRAW1F ftztNozNlhTHFDx/TZOZ2ItBlWssjRVXzdXwJfNYmepnrKcKnjS+S6c8B2JRmsBujCeN nbVtyD8lSqmgcr+pW6+P2RbcVFh0FBc6D4BwaN6tqMy4UOL5IR4EilPra4YNb7lA2GYC xBEfdYrdC6Tf2NOeaOD/PjdIAGN8U8dlrVuFsxI0N+I9wvZeTxz7fSkdbSsjGYxbcUXC xdtSGVZtM1uCdrrfGVaD1puVh2aspj4+7I48Xn/53qwLV7u1+5+YE5r8hix106qtXc/u ITXw== X-Gm-Message-State: ABUngvd1F0+1fC8Orr767dxU+Smt/A4XFTisglhThd8IKwsOb0uR4R4jmjLb0qD94wW2Zg== X-Received: by 10.36.53.138 with SMTP id k132mr11501418ita.28.1478623859941; Tue, 08 Nov 2016 08:50:59 -0800 (PST) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com. [209.85.214.48]) by smtp.gmail.com with ESMTPSA id c101sm12360077ioj.25.2016.11.08.08.50.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 08:50:59 -0800 (PST) Received: by mail-it0-f48.google.com with SMTP id q124so109984669itd.1; Tue, 08 Nov 2016 08:50:59 -0800 (PST) X-Received: by 10.107.16.170 with SMTP id 42mr13158183ioq.93.1478623856804; Tue, 08 Nov 2016 08:50:56 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.199 with HTTP; Tue, 8 Nov 2016 08:50:56 -0800 (PST) In-Reply-To: <201611010141.uA11fOPS086073@repo.freebsd.org> References: <201611010141.uA11fOPS086073@repo.freebsd.org> From: Conrad Meyer Date: Tue, 8 Nov 2016 08:50:56 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r308160 - in head: etc etc/mtree usr.sbin/syslogd To: Baptiste Daroussin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 17:02:38 -0000 On Mon, Oct 31, 2016 at 6:41 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Tue Nov 1 01:41:24 2016 > New Revision: 308160 > URL: https://svnweb.freebsd.org/changeset/base/308160 > > Log: > syslogd(8): add an 'include' keyword > > All the '.conf' files not beginning with a '.' contained int he directory > following the keyword will be included. > > This keyword can only be used in the first level configuration files. > > Modify the default syslogd.conf to 'include' /etc/syslog.d and > /usr/local/etc/syslog.d > > It simplify a lot handling of syslog from automation tools. This breaks some paths in init(), as pointed out by Coverity (CID 1365665). See inline below. >... > Modified: head/usr.sbin/syslogd/syslogd.c > ============================================================================== > --- head/usr.sbin/syslogd/syslogd.c Tue Nov 1 01:19:48 2016 (r308159) > +++ head/usr.sbin/syslogd/syslogd.c Tue Nov 1 01:41:24 2016 (r308160) > ... > @@ -1601,6 +1604,157 @@ die(int signo) > ... > /* > * INIT -- Initialize syslogd from configuration table > */ > @@ -1611,9 +1765,6 @@ init(int signo) > FILE *cf; > struct filed *f, *next, **nextp; > char *p; > - char cline[LINE_MAX]; > - char prog[LINE_MAX]; > - char host[MAXHOSTNAMELEN]; > char oldLocalHostName[MAXHOSTNAMELEN]; > char hostMsg[2*MAXHOSTNAMELEN+40]; > char bootfileMsg[LINE_MAX]; > @@ -1684,7 +1835,6 @@ init(int signo) > free((char *)f); > } > Files = NULL; > - nextp = &Files; This line leaves nextp uninitialized in init(). > > /* open the configuration file */ > if ((cf = fopen(ConfFile, "r")) == NULL) { Nextp is used in init() between these two hunks: 1838 1839 /* open the configuration file */ 1840 if ((cf = fopen(ConfFile, "r")) == NULL) { 1841 dprintf("cannot open %s\n", ConfFile); 1842 *nextp = (struct filed *)calloc(1, sizeof(*f)); <<<< now bogus 1843 if (*nextp == NULL) { 1844 logerror("calloc"); 1845 exit(1); 1846 } 1847 cfline("*.ERR\t/dev/console", *nextp, "*", "*"); 1848 (*nextp)->f_next = (struct filed *)calloc(1, sizeof(*f)); 1849 if ((*nextp)->f_next == NULL) { 1850 logerror("calloc"); 1851 exit(1); 1852 } 1853 cfline("*.PANIC\t*", (*nextp)->f_next, "*", "*"); 1854 Initialized = 1; 1855 return; 1856 } > @@ -1705,83 +1855,7 @@ init(int signo) > ... Thanks, Conrad From owner-svn-src-head@freebsd.org Tue Nov 8 17:36:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64DE3C36D89; Tue, 8 Nov 2016 17:36:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A1CCAB1; Tue, 8 Nov 2016 17:36:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA8HaJEI016857; Tue, 8 Nov 2016 17:36:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA8HaJew016856; Tue, 8 Nov 2016 17:36:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611081736.uA8HaJew016856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 8 Nov 2016 17:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308445 - head/lib/libgcc_s X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 17:36:20 -0000 Author: emaste Date: Tue Nov 8 17:36:19 2016 New Revision: 308445 URL: https://svnweb.freebsd.org/changeset/base/308445 Log: add missing i386 symbols libgcc_s symbol version map After r308294 they were missing on i386 (and previously were exported only accidentally). Reported by: antoine Modified: head/lib/libgcc_s/Version.map Modified: head/lib/libgcc_s/Version.map ============================================================================== --- head/lib/libgcc_s/Version.map Tue Nov 8 12:15:57 2016 (r308444) +++ head/lib/libgcc_s/Version.map Tue Nov 8 17:36:19 2016 (r308445) @@ -8,9 +8,12 @@ global: __absvsi2; __addvdi3; __addvsi3; + __ashldi3; __ashlti3; + __ashrdi3; __ashrti3; __clear_cache; + __cmpdi2; __cmpti2; __deregister_frame; __deregister_frame_info; @@ -19,23 +22,36 @@ global: __divti3; __ffsdi2; __ffsti2; + __fixdfdi; __fixdfti; + __fixsfdi; __fixsfti; __fixunsdfdi; + __fixunsdfsi; __fixunsdfti; __fixunssfdi; + __fixunssfsi; __fixunssfti; __fixunsxfdi; + __fixunsxfsi; __fixunsxfti; + __fixxfdi; __fixxfti; + __floatdidf; + __floatdisf; + __floatdixf; __floattidf; __floattisf; __floattixf; + __lshrdi3; __lshrti3; + __moddi3; __modti3; + __muldi3; __mulvdi3; __mulvsi3; __multi3; + __negdi2; __negti2; __negvdi2; __negvsi2; @@ -47,10 +63,13 @@ global: __register_frame_table; __subvdi3; __subvsi3; + __ucmpdi2; __ucmpti2; __udivdi3; + __udivmoddi4; __udivmodti4; __udivti3; + __umoddi3; __umodti3; _Unwind_DeleteException; _Unwind_Find_FDE; @@ -82,12 +101,16 @@ GCC_3.3.1 { GCC_3.4 { __clzdi2; + __clzsi2; __clzti2; __ctzdi2; + __ctzsi2; __ctzti2; __paritydi2; + __paritysi2; __parityti2; __popcountdi2; + __popcountsi2; __popcountti2; } GCC_3.3.1; @@ -116,6 +139,9 @@ GCC_4.0.0 { } GCC_3.4.4; GCC_4.2.0 { + __floatundidf; + __floatundisf; + __floatundixf; __floatuntidf; __floatuntisf; __floatuntixf; From owner-svn-src-head@freebsd.org Tue Nov 8 19:33:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BEEAC3635A; Tue, 8 Nov 2016 19:33:25 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4362DA6E; Tue, 8 Nov 2016 19:33:25 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk0-x22f.google.com with SMTP id q130so230096250qke.1; Tue, 08 Nov 2016 11:33:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=dP1BWtCruhfhS6yJpD514SR02rGWj6DKNg1QvgGfg4g=; b=EBavpZ1InN82X29MnZf7qvCKhSpZUpy9AUuVoLRRi6fqgEeGUOW9uqpfSxSMLmzzj/ 9MaN65cP7qQX3ZxKqG8VRswGlUZSES6rbAMLM+lSraekSuTMFl0W4hK9Bjbmgmx2OWkL dSeHKU8RyOqsRUZzA4KBF1yiH1XaLyVwSBEvLuzLxg5cnOFEhw+qxsJVtI5iynkyOEOv pWFGEW958BA/SPxLKCXcY7LhdL9e2nEVmn3o3gR80WfLYwLP6B2fjKKNchiayutG9Xqt 843/dXjmVayWMBpNAMRvUVdMf1YOJUy+/L9B3KoLqpdreFoIAy49/hbS34en5w2Ka42k CUXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=dP1BWtCruhfhS6yJpD514SR02rGWj6DKNg1QvgGfg4g=; b=FR8Hkmxd8ml1j4xP7i/NLIehrR2B/b18bh+yFLPGGbkKSb1JmLGHvi957mlgrrhNqj wANkJju2Jg3Y0OK9OMDMw7wCOIRdQXkUlb2YlPYGWzSNFSA1cfkdlYZUfJtWG3uBVwze cG2rMOK8j3kzFq7GuvErl/h3vycd93RPMndIHt65MZljS6BtfjyhSNyrQZEZN50WHZO4 tetAUWwG1GjR2oaTjOn/1BANJGte8TUc5AoLj3aYpWpK9gWFIxiLtfNVj4+vU6mLRHPP k8gTRE1vPhU+riwH1Dadd86jDCNPFNg2JbnoXbwwTMH/SScvFtCBk9APLajuvO7tf7B1 nlug== X-Gm-Message-State: ABUngvem659M82UwfiUgJrBCjJJFtifqcsUkMXztFVEEfme2ylDOnzKlageIZtuR/rq7dg== X-Received: by 10.55.104.20 with SMTP id d20mr16068404qkc.126.1478633604307; Tue, 08 Nov 2016 11:33:24 -0800 (PST) Received: from mbp-eth.home ([200.236.233.160]) by smtp.gmail.com with ESMTPSA id n67sm2824763qkf.28.2016.11.08.11.33.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 11:33:23 -0800 (PST) Sender: Renato Botelho From: Renato Botelho Message-Id: Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r308443 - head/bin/hostname Date: Tue, 8 Nov 2016 17:33:19 -0200 In-Reply-To: <201611081136.uA8BaXrs073937@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Marcelo Araujo References: <201611081136.uA8BaXrs073937@repo.freebsd.org> X-Mailer: Apple Mail (2.3251) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 19:33:25 -0000 > On 8 Nov 2016, at 09:36, Marcelo Araujo wrote: >=20 > Author: araujo > Date: Tue Nov 8 11:36:33 2016 > New Revision: 308443 > URL: https://svnweb.freebsd.org/changeset/base/308443 >=20 > Log: > Add -d flag that prints domain only. >=20 > PR: 212875 > Submitted by: Ben RUBSON > Reviewed by: pi >=20 > Modified: > head/bin/hostname/hostname.1 > head/bin/hostname/hostname.c >=20 > Modified: head/bin/hostname/hostname.1 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/bin/hostname/hostname.1 Tue Nov 8 10:10:55 2016 = (r308442) > +++ head/bin/hostname/hostname.1 Tue Nov 8 11:36:33 2016 = (r308443) > @@ -29,7 +29,7 @@ > .\" @(#)hostname.1 8.2 (Berkeley) 4/28/95 > .\" $FreeBSD$ > .\" > -.Dd December 7, 2006 > +.Dd November 9, 2016 > .Dt HOSTNAME 1 > .Os > .Sh NAME > @@ -37,7 +37,8 @@ > .Nd set or print name of current host system > .Sh SYNOPSIS > .Nm > -.Op Fl fs > +.Op Fl f > +.Op Fl s|d > .Op Ar name-of-host > .Sh DESCRIPTION > The > @@ -62,6 +63,8 @@ This is the default behavior. > .It Fl s > Trim off any domain information from the printed > name. > +.It Fl d > +Only print domain information. > .El > .Sh SEE ALSO > .Xr gethostname 3 , >=20 > Modified: head/bin/hostname/hostname.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/bin/hostname/hostname.c Tue Nov 8 10:10:55 2016 = (r308442) > +++ head/bin/hostname/hostname.c Tue Nov 8 11:36:33 2016 = (r308443) > @@ -54,11 +54,12 @@ static void usage(void) __dead2; > int > main(int argc, char *argv[]) > { > - int ch, sflag; > + int ch, sflag, dflag; > char *p, hostname[MAXHOSTNAMELEN]; >=20 > sflag =3D 0; > - while ((ch =3D getopt(argc, argv, "fs")) !=3D -1) > + dflag =3D 0; > + while ((ch =3D getopt(argc, argv, "fsd")) !=3D -1) > switch (ch) { > case 'f': > /* > @@ -70,6 +71,9 @@ main(int argc, char *argv[]) > case 's': > sflag =3D 1; > break; > + case 'd': > + dflag =3D 1; > + break; > case '?': > default: > usage(); > @@ -77,7 +81,7 @@ main(int argc, char *argv[]) > argc -=3D optind; > argv +=3D optind; >=20 > - if (argc > 1) > + if (argc > 1 || (sflag && dflag)) > usage(); >=20 > if (*argv) { > @@ -90,6 +94,10 @@ main(int argc, char *argv[]) > p =3D strchr(hostname, '.'); > if (p !=3D NULL) > *p =3D '\0'; > + } else if (dflag) { > + p =3D strchr(hostname, '.'); > + if (p !=3D NULL) > + strcpy(hostname, ++p); > } > (void)printf("%s\n", hostname); > } > @@ -100,6 +108,6 @@ static void > usage(void) > { >=20 > - (void)fprintf(stderr, "usage: hostname [-fs] [name-of-host]\n"); > + (void)fprintf(stderr, "usage: hostname [-f] [s|d] = [name-of-host]\n"); It=E2=80=99s missing =E2=80=98-=E2=80=98 sign on [s|d] block, what makes = message a bit confused IMO. Maybe [-s|-d] would be more clear. -- Renato Botelho From owner-svn-src-head@freebsd.org Tue Nov 8 21:17:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79119C37481; Tue, 8 Nov 2016 21:17:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BFD71DDE; Tue, 8 Nov 2016 21:17:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA8LHPOu004064; Tue, 8 Nov 2016 21:17:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA8LHPju004062; Tue, 8 Nov 2016 21:17:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201611082117.uA8LHPju004062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 8 Nov 2016 21:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308451 - in head/sys/cam: . scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 21:17:26 -0000 Author: cem Date: Tue Nov 8 21:17:24 2016 New Revision: 308451 URL: https://svnweb.freebsd.org/changeset/base/308451 Log: cam: Zero bio pointer in user-supplied SCSI CCBs The BUF_TRACKING bio pointer only makes sense for kernel consumers of CCBs. PR: 214250 Reported by: trasz@ Reviewed by: imp@, markj@ Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8477 Modified: head/sys/cam/cam_xpt.c head/sys/cam/scsi/scsi_pass.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Nov 8 21:15:50 2016 (r308450) +++ head/sys/cam/cam_xpt.c Tue Nov 8 21:17:24 2016 (r308451) @@ -414,6 +414,10 @@ xptdoioctl(struct cdev *dev, u_long cmd, struct cam_eb *bus; inccb = (union ccb *)addr; +#if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING) + if (inccb->ccb_h.func_code == XPT_SCSI_IO) + inccb->csio.bio = NULL; +#endif bus = xpt_find_bus(inccb->ccb_h.path_id); if (bus == NULL) @@ -593,6 +597,10 @@ xptdoioctl(struct cdev *dev, u_long cmd, unit = ccb->cgdl.unit_number; name = ccb->cgdl.periph_name; base_periph_found = 0; +#if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING) + if (ccb->ccb_h.func_code == XPT_SCSI_IO) + ccb->csio.bio = NULL; +#endif /* * Sanity check -- make sure we don't get a null peripheral Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Tue Nov 8 21:15:50 2016 (r308450) +++ head/sys/cam/scsi/scsi_pass.c Tue Nov 8 21:17:24 2016 (r308451) @@ -1777,6 +1777,10 @@ passdoioctl(struct cdev *dev, u_long cmd int ccb_malloced; inccb = (union ccb *)addr; +#if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING) + if (inccb->ccb_h.func_code == XPT_SCSI_IO) + inccb->csio.bio = NULL; +#endif /* * Some CCB types, like scan bus and scan lun can only go @@ -1875,6 +1879,10 @@ passdoioctl(struct cdev *dev, u_long cmd cam_periph_lock(periph); break; } +#if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING) + if (ccb->ccb_h.func_code == XPT_SCSI_IO) + ccb->csio.bio = NULL; +#endif if (ccb->ccb_h.flags & CAM_CDB_POINTER) { if (ccb->csio.cdb_len > IOCDBLEN) { From owner-svn-src-head@freebsd.org Tue Nov 8 22:41:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 540B4C37961; Tue, 8 Nov 2016 22:41:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A64DAA; Tue, 8 Nov 2016 22:41:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA8MfC1Q036144; Tue, 8 Nov 2016 22:41:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA8MfCJN036142; Tue, 8 Nov 2016 22:41:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201611082241.uA8MfCJN036142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Nov 2016 22:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308456 - in head/libexec/rtld-elf: . sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 22:41:13 -0000 Author: jhb Date: Tue Nov 8 22:41:11 2016 New Revision: 308456 URL: https://svnweb.freebsd.org/changeset/base/308456 Log: Pass the correct flag to find_symdef() from _rtld_bind(). When symbol versioning was added to rtld, the boolean 'in_plt' argument to find_symdef() was converted to a bitmask of flags. The first flag added was 'SYMLOOK_IN_PLT' which replaced the 'in_plt' bool. This happened to still work by accident as SYMLOOK_IN_PLT had the value of 1 which is the same as 'true', so there should be no functional change. Tested on: amd64 Reviewed by: kan MFC after: 2 weeks Sponsored by: DARPA / AFRL Modified: head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/sparc64/reloc.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Nov 8 21:57:49 2016 (r308455) +++ head/libexec/rtld-elf/rtld.c Tue Nov 8 22:41:11 2016 (r308456) @@ -713,8 +713,8 @@ _rtld_bind(Obj_Entry *obj, Elf_Size relo rel = (const Elf_Rel *) ((caddr_t) obj->pltrela + reloff); where = (Elf_Addr *) (obj->relocbase + rel->r_offset); - def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, true, NULL, - &lockstate); + def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, SYMLOOK_IN_PLT, + NULL, &lockstate); if (def == NULL) rtld_die(); if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) Modified: head/libexec/rtld-elf/sparc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/sparc64/reloc.c Tue Nov 8 21:57:49 2016 (r308455) +++ head/libexec/rtld-elf/sparc64/reloc.c Tue Nov 8 22:41:11 2016 (r308456) @@ -503,7 +503,7 @@ reloc_plt(Obj_Entry *obj) assert(ELF64_R_TYPE_ID(rela->r_info) == R_SPARC_JMP_SLOT); where = (Elf_Addr *)(obj->relocbase + rela->r_offset); def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - true, NULL, lockstate); + SYMLOOK_IN_PLT, NULL, lockstate); value = (Elf_Addr)(defobj->relocbase + def->st_value); *where = value; } From owner-svn-src-head@freebsd.org Tue Nov 8 23:59:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5485BC37CDB; Tue, 8 Nov 2016 23:59:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CEFB882; Tue, 8 Nov 2016 23:59:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA8NxkdH067821; Tue, 8 Nov 2016 23:59:46 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA8NxfRG067778; Tue, 8 Nov 2016 23:59:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201611082359.uA8NxfRG067778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 8 Nov 2016 23:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308457 - in head: sbin/pfctl sys/amd64/vmm/io sys/arm/include sys/arm/ti/omap4 sys/arm64/arm64 sys/cam sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/dev/dtrace/aarch64 sys/cd... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 23:59:47 -0000 Author: bdrewery Date: Tue Nov 8 23:59:41 2016 New Revision: 308457 URL: https://svnweb.freebsd.org/changeset/base/308457 Log: Fix improper use of "its". Sponsored by: Dell EMC Isilon Modified: head/sbin/pfctl/pfctl_optimize.c head/sys/amd64/vmm/io/vlapic.c head/sys/arm/include/profile.h head/sys/arm/ti/omap4/omap4_prcm_clks.c head/sys/arm64/arm64/identcpu.c head/sys/cam/cam.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c head/sys/cddl/dev/dtrace/arm/dtrace_subr.c head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c head/sys/dev/aic7xxx/aic7xxx.seq head/sys/dev/ath/if_ath_tdma.c head/sys/dev/isci/scil/sati_design.h head/sys/dev/isci/scil/sci_base_controller.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sound/pci/hda/hdaa.c head/sys/dev/sound/pci/hda/hdac.c head/sys/fs/nullfs/null_vnops.c head/sys/geom/raid/md_ddf.c head/sys/geom/raid/md_intel.c head/sys/geom/raid/md_jmicron.c head/sys/geom/raid/md_nvidia.c head/sys/geom/raid/md_promise.c head/sys/geom/raid/md_sii.c head/sys/i386/include/cserial.h head/sys/kern/init_main.c head/sys/kern/kern_ctf.c head/sys/kern/subr_firmware.c head/sys/kern/uipc_mbuf.c head/sys/net80211/ieee80211_node.h head/sys/netgraph/ng_base.c head/sys/powerpc/powerpc/mmu_if.m head/sys/security/mac/mac_inet.c head/sys/vm/vm_pageout.c head/sys/x86/xen/xen_intr.c head/usr.bin/du/du.c head/usr.bin/xlint/lint2/read.c head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt head/usr.sbin/newsyslog/newsyslog.c Modified: head/sbin/pfctl/pfctl_optimize.c ============================================================================== --- head/sbin/pfctl/pfctl_optimize.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sbin/pfctl/pfctl_optimize.c Tue Nov 8 23:59:41 2016 (r308457) @@ -84,7 +84,7 @@ TAILQ_HEAD(superblocks, superblock); * Description of the PF rule structure. */ enum { - BARRIER, /* the presence of the field puts the rule in it's own block */ + BARRIER, /* the presence of the field puts the rule in its own block */ BREAK, /* the field may not differ between rules in a superblock */ NOMERGE, /* the field may not differ between rules when combined */ COMBINED, /* the field may itself be combined with other rules */ @@ -104,7 +104,7 @@ static struct pf_rule_field { /* - * The presence of these fields in a rule put the rule in it's own + * The presence of these fields in a rule put the rule in its own * superblock. Thus it will not be optimized. It also prevents the * rule from being re-ordered at all. */ Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/amd64/vmm/io/vlapic.c Tue Nov 8 23:59:41 2016 (r308457) @@ -859,7 +859,7 @@ vlapic_calcdest(struct vm *vm, cpuset_t /* * Logical mode: match each APIC that has a bit set - * in it's LDR that matches a bit in the ldest. + * in its LDR that matches a bit in the ldest. */ CPU_ZERO(dmask); amask = vm_active_cpus(vm); Modified: head/sys/arm/include/profile.h ============================================================================== --- head/sys/arm/include/profile.h Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/arm/include/profile.h Tue Nov 8 23:59:41 2016 (r308457) @@ -89,7 +89,7 @@ typedef u_long fptrdiff_t; __asm__("ldmfd sp!, {r0-r3, lr}"); \ /* \ * Return to the caller. Loading lr and pc in one instruction \ - * is deprecated on ARMv7 so we need this on it's own. \ + * is deprecated on ARMv7 so we need this on its own. \ */ \ __asm__("ldmfd sp!, {pc}"); void bintr(void); Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Tue Nov 8 23:59:41 2016 (r308457) @@ -1033,7 +1033,7 @@ omap4_clk_get_arm_fclk_freq(struct ti_cl * The USB clocking setup seems to be a bit more tricky than the other modules, * to start with the clocking diagram for the HS host module shows 13 different * clocks. So to try and make it easier to follow the clocking activation - * and deactivation is handled in it's own set of callbacks. + * and deactivation is handled in its own set of callbacks. * * LOCKING: * Inherits the locks from the omap_prcm driver, no internal locking. Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/arm64/arm64/identcpu.c Tue Nov 8 23:59:41 2016 (r308457) @@ -205,7 +205,7 @@ print_cpu_features(u_int cpu) * https://lkml.org/lkml/2016/8/4/722 */ /* - * XXX: CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1 on it's own also + * XXX: CPU_MATCH_ERRATA_CAVIUM_THUNDER_1_1 on its own also * triggers on pass 2.0+. */ if (cpu == 0 && CPU_VAR(PCPU_GET(midr)) == 0 && Modified: head/sys/cam/cam.h ============================================================================== --- head/sys/cam/cam.h Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/cam/cam.h Tue Nov 8 23:59:41 2016 (r308457) @@ -290,7 +290,7 @@ typedef enum { /* SIM ready to take more commands */ CAM_RELEASE_SIMQ = 0x100, - /* SIM has this command in it's queue */ + /* SIM has this command in its queue */ CAM_SIM_QUEUED = 0x200, /* Quality of service data is valid */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Nov 8 23:59:41 2016 (r308457) @@ -3104,7 +3104,7 @@ arc_buf_size(arc_buf_t *buf) /* * Evict the arc_buf_hdr that is provided as a parameter. The resultant - * state of the header is dependent on it's state prior to entering this + * state of the header is dependent on its state prior to entering this * function. The following transitions are possible: * * - arc_mru -> arc_mru_ghost Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Tue Nov 8 23:59:41 2016 (r308457) @@ -186,7 +186,7 @@ dtrace_trap(struct trapframe *frame, u_i /* * A trap can occur while DTrace executes a probe. Before * executing the probe, DTrace blocks re-scheduling and sets - * a flag in it's per-cpu flags to indicate that it doesn't + * a flag in its per-cpu flags to indicate that it doesn't * want to fault. On returning from the probe, the no-fault * flag is cleared and finally re-scheduling is enabled. * Modified: head/sys/cddl/dev/dtrace/arm/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Tue Nov 8 23:59:41 2016 (r308457) @@ -186,7 +186,7 @@ dtrace_trap(struct trapframe *frame, u_i /* * A trap can occur while DTrace executes a probe. Before * executing the probe, DTrace blocks re-scheduling and sets - * a flag in it's per-cpu flags to indicate that it doesn't + * a flag in its per-cpu flags to indicate that it doesn't * want to fault. On returning from the probe, the no-fault * flag is cleared and finally re-scheduling is enabled. * Modified: head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Tue Nov 8 23:59:41 2016 (r308457) @@ -189,7 +189,7 @@ dtrace_trap(struct trapframe *frame, u_i /* * A trap can occur while DTrace executes a probe. Before * executing the probe, DTrace blocks re-scheduling and sets - * a flag in it's per-cpu flags to indicate that it doesn't + * a flag in its per-cpu flags to indicate that it doesn't * want to fault. On returning from the probe, the no-fault * flag is cleared and finally re-scheduling is enabled. * Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Tue Nov 8 23:59:41 2016 (r308457) @@ -4397,7 +4397,7 @@ ar9300_eeprom_restore(struct ath_hal *ah #endif /* * At this point, mptr points to the eeprom data structure - * in it's "default" state. If this is big endian, swap the + * in its "default" state. If this is big endian, swap the * data structures back to "little endian" form. */ if (ar9300_eeprom_restore_internal(ah, mptr, mdata_size) >= 0) { Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c Tue Nov 8 23:59:41 2016 (r308457) @@ -1806,7 +1806,7 @@ vchiq_arm_init_state(VCHIQ_STATE_T *stat ** suspend completion and reset the resume state machine. ** ** VC_RESUME_IDLE - Initialise the resume completion at the same time. The -** resume completion is in it's 'done' state whenever +** resume completion is in its 'done' state whenever ** videcore is running. Therfore, the VC_RESUME_IDLE state ** implies that videocore is suspended. ** Hence, any thread which needs to wait until videocore is Modified: head/sys/dev/aic7xxx/aic7xxx.seq ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx.seq Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/dev/aic7xxx/aic7xxx.seq Tue Nov 8 23:59:41 2016 (r308457) @@ -1446,7 +1446,7 @@ p_command_xfer: test SSTAT0, SDONE jnz . + 2; test SSTAT1, PHASEMIS jz . - 1; /* - * Wait for our ACK to go-away on it's own + * Wait for our ACK to go-away on its own * instead of being killed by SCSIEN getting cleared. */ test SCSISIGI, ACKI jnz .; Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/dev/ath/if_ath_tdma.c Tue Nov 8 23:59:41 2016 (r308457) @@ -270,7 +270,7 @@ ath_tdma_config(struct ath_softc *sc, st * fixed/lowest transmit rate. Note that the interface * mtu does not include the 802.11 overhead so we must * tack that on (ath_hal_computetxtime includes the - * preamble and plcp in it's calculation). + * preamble and plcp in its calculation). */ tdma = vap->iv_tdma; if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) Modified: head/sys/dev/isci/scil/sati_design.h ============================================================================== --- head/sys/dev/isci/scil/sati_design.h Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/dev/isci/scil/sati_design.h Tue Nov 8 23:59:41 2016 (r308457) @@ -130,7 +130,7 @@ block devices (e.g. disks). @image html Use_Case_Diagram__SATI__SATI_-_SBC.jpg "SCSI Block Command Translation Use Cases" -The SCSI-to-ATA Translation (SAT) specification defines a few of it's own +The SCSI-to-ATA Translation (SAT) specification defines a few of its own commands, parameter data, and log pages. This use case diagram, however, only captures the SAT specific commands being translated. Modified: head/sys/dev/isci/scil/sci_base_controller.h ============================================================================== --- head/sys/dev/isci/scil/sci_base_controller.h Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/dev/isci/scil/sci_base_controller.h Tue Nov 8 23:59:41 2016 (r308457) @@ -90,7 +90,7 @@ typedef enum _SCI_BASE_CONTROLLER_STATES /** * This state indicates that the controller is reset. The memory for - * the controller is in it's initial state, but the controller requires + * the controller is in its initial state, but the controller requires * initialization. * This state is entered from the INITIAL state. * This state is entered from the RESETTING state. Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue Nov 8 23:59:41 2016 (r308457) @@ -1092,7 +1092,7 @@ efx_mcdi_read_assertion( /* * Before we attempt to chat to the MC, we should verify that the MC - * isn't in it's assertion handler, either due to a previous reboot, + * isn't in its assertion handler, either due to a previous reboot, * or because we're reinitializing due to an eec_exception(). * * Use GET_ASSERTS to read any assertion state that may be present. Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/dev/sound/pci/hda/hdaa.c Tue Nov 8 23:59:41 2016 (r308457) @@ -2382,7 +2382,7 @@ hdaa_audio_ctl_source_volume(struct hdaa } /* If widget has own ossdev - not traverse it. - It will be traversed on it's own. */ + It will be traversed on its own. */ if (w->ossdev >= 0 && depth > 0) return; @@ -4550,7 +4550,7 @@ hdaa_audio_ctl_source_amp(struct hdaa_de } /* If widget has own ossdev - not traverse it. - It will be traversed on it's own. */ + It will be traversed on its own. */ if (w->ossdev >= 0 && depth > 0) return (found); Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/dev/sound/pci/hda/hdac.c Tue Nov 8 23:59:41 2016 (r308457) @@ -426,7 +426,7 @@ hdac_reset(struct hdac_softc *sc, int wa /* * Wait for codecs to finish their own reset sequence. The delay here - * should be of 250us but for some reasons, on it's not enough on my + * should be of 250us but for some reasons, it's not enough on my * computer. Let's use twice as much as necessary to make sure that * it's reset properly. */ Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/fs/nullfs/null_vnops.c Tue Nov 8 23:59:41 2016 (r308457) @@ -649,7 +649,7 @@ null_lock(struct vop_lock1_args *ap) nn = VTONULL(vp); /* * If we're still active we must ask the lower layer to - * lock as ffs has special lock considerations in it's + * lock as ffs has special lock considerations in its * vop lock. */ if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { @@ -662,7 +662,7 @@ null_lock(struct vop_lock1_args *ap) * the lowervp's vop_lock routine. When we vgone we will * drop our last ref to the lowervp, which would allow it * to be reclaimed. The lowervp could then be recycled, - * in which case it is not legal to be sleeping in it's VOP. + * in which case it is not legal to be sleeping in its VOP. * We prevent it from being recycled by holding the vnode * here. */ Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/geom/raid/md_ddf.c Tue Nov 8 23:59:41 2016 (r308457) @@ -1626,7 +1626,7 @@ g_raid_md_ddf_start_disk(struct g_raid_d vmeta = &pv->pv_meta; gmeta = &mdi->mdio_meta; - /* Find disk position in metadata by it's reference. */ + /* Find disk position in metadata by its reference. */ disk_pos = ddf_meta_find_disk(vmeta, reference, &md_disk_bvd, &md_disk_pos); md_pde_pos = ddf_meta_find_pd(gmeta, NULL, reference); Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/geom/raid/md_intel.c Tue Nov 8 23:59:41 2016 (r308457) @@ -923,7 +923,7 @@ g_raid_md_intel_start_disk(struct g_raid pd = (struct g_raid_md_intel_perdisk *)disk->d_md_data; olddisk = NULL; - /* Find disk position in metadata by it's serial. */ + /* Find disk position in metadata by its serial. */ disk_pos = intel_meta_find_disk(meta, pd->pd_disk_meta.serial); if (disk_pos < 0) { G_RAID_DEBUG1(1, sc, "Unknown, probably new or stale disk"); Modified: head/sys/geom/raid/md_jmicron.c ============================================================================== --- head/sys/geom/raid/md_jmicron.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/geom/raid/md_jmicron.c Tue Nov 8 23:59:41 2016 (r308457) @@ -434,7 +434,7 @@ g_raid_md_jmicron_start_disk(struct g_ra pd = (struct g_raid_md_jmicron_perdisk *)disk->d_md_data; olddisk = NULL; - /* Find disk position in metadata by it's serial. */ + /* Find disk position in metadata by its serial. */ if (pd->pd_meta != NULL) disk_pos = jmicron_meta_find_disk(meta, pd->pd_disk_id); else Modified: head/sys/geom/raid/md_nvidia.c ============================================================================== --- head/sys/geom/raid/md_nvidia.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/geom/raid/md_nvidia.c Tue Nov 8 23:59:41 2016 (r308457) @@ -441,7 +441,7 @@ g_raid_md_nvidia_start_disk(struct g_rai pd = (struct g_raid_md_nvidia_perdisk *)disk->d_md_data; olddisk = NULL; - /* Find disk position in metadata by it's serial. */ + /* Find disk position in metadata by its serial. */ if (pd->pd_meta != NULL) { disk_pos = pd->pd_meta->disk_number; if (disk_pos >= meta->total_disks || mdi->mdio_started) Modified: head/sys/geom/raid/md_promise.c ============================================================================== --- head/sys/geom/raid/md_promise.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/geom/raid/md_promise.c Tue Nov 8 23:59:41 2016 (r308457) @@ -673,7 +673,7 @@ g_raid_md_promise_start_disk(struct g_ra meta = pv->pv_meta; if (sdn >= 0) { - /* Find disk position in metadata by it's serial. */ + /* Find disk position in metadata by its serial. */ md_disk_pos = promise_meta_find_disk(meta, pd->pd_meta[sdn]->disk.id); /* For RAID0+1 we need to translate order. */ disk_pos = promise_meta_translate_disk(vol, md_disk_pos); Modified: head/sys/geom/raid/md_sii.c ============================================================================== --- head/sys/geom/raid/md_sii.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/geom/raid/md_sii.c Tue Nov 8 23:59:41 2016 (r308457) @@ -489,7 +489,7 @@ g_raid_md_sii_start_disk(struct g_raid_d pd = (struct g_raid_md_sii_perdisk *)disk->d_md_data; olddisk = NULL; - /* Find disk position in metadata by it's serial. */ + /* Find disk position in metadata by its serial. */ if (pd->pd_meta != NULL) disk_pos = sii_meta_disk_pos(meta, pd->pd_meta); else Modified: head/sys/i386/include/cserial.h ============================================================================== --- head/sys/i386/include/cserial.h Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/i386/include/cserial.h Tue Nov 8 23:59:41 2016 (r308457) @@ -117,7 +117,7 @@ struct e3_statistics { /* * Attach/detach the protocol to the channel. - * The protocol is given by it's name, char[8]. + * The protocol is given by its name, char[8]. * For example "async", "hdlc", "cisco", "fr", "ppp". */ #define SERIAL_GETPROTO _IOR ('x', 1, char [8]) Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/kern/init_main.c Tue Nov 8 23:59:41 2016 (r308457) @@ -793,7 +793,7 @@ start_init(void *dummy) } /* - * Like kproc_create(), but runs in it's own address space. + * Like kproc_create(), but runs in its own address space. * We do this early to reserve pid 1. * * Note special case - do not make it runnable yet. Other work Modified: head/sys/kern/kern_ctf.c ============================================================================== --- head/sys/kern/kern_ctf.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/kern/kern_ctf.c Tue Nov 8 23:59:41 2016 (r308457) @@ -236,7 +236,7 @@ link_elf_ctf_get(linker_file_t lf, linke } /* - * Allocate memory to buffer the CTF data in it's decompressed + * Allocate memory to buffer the CTF data in its decompressed * form. */ ctftab = malloc(sz, M_LINKER, M_WAITOK); Modified: head/sys/kern/subr_firmware.c ============================================================================== --- head/sys/kern/subr_firmware.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/kern/subr_firmware.c Tue Nov 8 23:59:41 2016 (r308457) @@ -229,7 +229,7 @@ firmware_unregister(const char *imagenam /* * It is ok for the lookup to fail; this can happen * when a module is unloaded on last reference and the - * module unload handler unregister's each of it's + * module unload handler unregister's each of its * firmware images. */ err = 0; Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/kern/uipc_mbuf.c Tue Nov 8 23:59:41 2016 (r308457) @@ -1336,7 +1336,7 @@ nospace: /* * Defragment an mbuf chain, returning at most maxfrags separate * mbufs+clusters. If this is not possible NULL is returned and - * the original mbuf chain is left in it's present (potentially + * the original mbuf chain is left in its present (potentially * modified) state. We use two techniques: collapsing consecutive * mbufs and replacing consecutive mbufs by a cluster. * Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/net80211/ieee80211_node.h Tue Nov 8 23:59:41 2016 (r308457) @@ -36,7 +36,7 @@ * IEEE80211_INACT_WAIT seconds to handle "inactivity processing". * This is used to do node inactivity processing when operating * as an AP, adhoc or mesh mode. For inactivity processing each node - * has a timeout set in it's ni_inact field that is decremented + * has a timeout set in its ni_inact field that is decremented * on each timeout and the node is reclaimed when the counter goes * to zero. We use different inactivity timeout values depending * on whether the node is associated and authorized (either by Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/netgraph/ng_base.c Tue Nov 8 23:59:41 2016 (r308457) @@ -1179,7 +1179,7 @@ ng_destroy_hook(hook_p hook) /* * Set the peer to point to ng_deadhook * from this moment on we are effectively independent it. - * send it an rmhook message of it's own. + * send it an rmhook message of its own. */ peer->hk_peer = &ng_deadhook; /* They no longer know us */ hook->hk_peer = &ng_deadhook; /* Nor us, them */ @@ -3005,7 +3005,7 @@ void ng_free_item(item_p item) { /* - * The item may hold resources on it's own. We need to free + * The item may hold resources on its own. We need to free * these before we can free the item. What they are depends upon * what kind of item it is. it is important that nodes zero * out pointers to resources that they remove from the item @@ -3577,7 +3577,7 @@ ng_address_hook(node_p here, item_p item ITEM_DEBUG_CHECKS; /* * Quick sanity check.. - * Since a hook holds a reference on it's node, once we know + * Since a hook holds a reference on its node, once we know * that the peer is still connected (even if invalid,) we know * that the peer node is present, though maybe invalid. */ Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/powerpc/powerpc/mmu_if.m Tue Nov 8 23:59:41 2016 (r308457) @@ -725,7 +725,7 @@ METHOD void align_superpage { /** * @brief Bootstrap the VM system. At the completion of this routine, the - * kernel will be running in it's own address space with full control over + * kernel will be running in its own address space with full control over * paging. * * @param _start start of reserved memory (obsolete ???) Modified: head/sys/security/mac/mac_inet.c ============================================================================== --- head/sys/security/mac/mac_inet.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/security/mac/mac_inet.c Tue Nov 8 23:59:41 2016 (r308457) @@ -435,7 +435,7 @@ mac_netinet_firewall_send(struct mbuf *m /* * These functions really should be referencing the syncache structure * instead of the label. However, due to some of the complexities associated - * with exposing this syncache structure we operate directly on it's label + * with exposing this syncache structure we operate directly on its label * pointer. This should be OK since we aren't making any access control * decisions within this code directly, we are merely allocating and copying * label storage so we can properly initialize mbuf labels for any packets Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/vm/vm_pageout.c Tue Nov 8 23:59:41 2016 (r308457) @@ -1410,7 +1410,7 @@ vm_pageout_oom(int shortage) /* * We keep the process bigproc locked once we find it to keep anyone * from messing with it; however, there is a possibility of - * deadlock if process B is bigproc and one of it's child processes + * deadlock if process B is bigproc and one of its child processes * attempts to propagate a signal to B while we are waiting for A's * lock while walking this list. To avoid this, we don't block on * the process lock but just skip a process if it is already locked. Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/sys/x86/xen/xen_intr.c Tue Nov 8 23:59:41 2016 (r308457) @@ -940,7 +940,7 @@ xen_intr_disable_source(struct intsrc *b /* * NB: checking if the event channel is already masked is * needed because the event channel user-space device - * masks event channels on it's filter as part of it's + * masks event channels on its filter as part of its * normal operation, and those shouldn't be automatically * unmasked by the generic interrupt code. The event channel * device will unmask them when needed. Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/usr.bin/du/du.c Tue Nov 8 23:59:41 2016 (r308457) @@ -421,7 +421,7 @@ linkchk(FTSENT *p) if (le->dev == st->st_dev && le->ino == st->st_ino) { /* * Save memory by releasing an entry when we've seen - * all of it's links. + * all of its links. */ if (--le->links <= 0) { if (le->previous != NULL) Modified: head/usr.bin/xlint/lint2/read.c ============================================================================== --- head/usr.bin/xlint/lint2/read.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/usr.bin/xlint/lint2/read.c Tue Nov 8 23:59:41 2016 (r308457) @@ -909,7 +909,7 @@ gettlen(const char *cp, const char **epp } /* - * Search a type by it's type string. + * Search a type by its type string. */ static u_short findtype(const char *cp, size_t len, int h) Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/usr.sbin/bhyve/bhyverun.c Tue Nov 8 23:59:41 2016 (r308457) @@ -908,7 +908,7 @@ main(int argc, char *argv[]) sci_init(ctx); /* - * Exit if a device emulation finds an error in it's initilization + * Exit if a device emulation finds an error in its initilization */ if (init_pci(ctx) != 0) exit(1); Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt Tue Nov 8 22:41:11 2016 (r308456) +++ head/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt Tue Nov 8 23:59:41 2016 (r308457) @@ -875,7 +875,7 @@ begemotBridgeTpMaxAddresses OBJECT-TYPE STATUS current DESCRIPTION "The maximum number of entires that this bridge can - learn in it's Forwarding Address Table and use for + learn in its Forwarding Address Table and use for making forwarding decisions." ::= { begemotBridgeTpEntry 3 } Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Tue Nov 8 22:41:11 2016 (r308456) +++ head/usr.sbin/newsyslog/newsyslog.c Tue Nov 8 23:59:41 2016 (r308457) @@ -2062,7 +2062,7 @@ do_zipwork(struct zipwork_entry *zwork) * Save information on any process we need to signal. Any single * process may need to be sent different signal-values for different * log files, but usually a single signal-value will cause the process - * to close and re-open all of it's log files. + * to close and re-open all of its log files. */ static struct sigwork_entry * save_sigwork(const struct conf_entry *ent) From owner-svn-src-head@freebsd.org Wed Nov 9 01:58:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91638C37CF0; Wed, 9 Nov 2016 01:58:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 34400EB4; Wed, 9 Nov 2016 01:58:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-100-78.carlnfd1.nsw.optusnet.com.au [110.21.100.78]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 93566425D5F; Wed, 9 Nov 2016 12:39:06 +1100 (AEDT) Date: Wed, 9 Nov 2016 12:39:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Renato Botelho cc: Marcelo Araujo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308443 - head/bin/hostname In-Reply-To: Message-ID: <20161109115729.F924@besplex.bde.org> References: <201611081136.uA8BaXrs073937@repo.freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=uGjuzT6u7JdBDS7kH8taPg==:117 a=uGjuzT6u7JdBDS7kH8taPg==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=p9n8UFVK5ax8Qv8xNh8A:9 a=45ClL6m2LaAA:10 a=IjZwj45LgO3ly-622nXo:22 a=6kGIvZw6iX1k4Y-7sg4_:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 01:58:49 -0000 On Tue, 8 Nov 2016, Renato Botelho wrote: >> On 8 Nov 2016, at 09:36, Marcelo Araujo wrote: >> >> Log: >> Add -d flag that prints domain only. >> >> PR:=09=09212875 >> Submitted by:=09Ben RUBSON >> Reviewed by:=09pi This has many style bugs. >> Modified: >> head/bin/hostname/hostname.1 >> head/bin/hostname/hostname.c >> >> Modified: head/bin/hostname/hostname.1 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/bin/hostname/hostname.1=09Tue Nov 8 10:10:55 2016=09(r308442) >> +++ head/bin/hostname/hostname.1=09Tue Nov 8 11:36:33 2016=09(r308443) >> @@ -29,7 +29,7 @@ >> .\"=09@(#)hostname.1=098.2 (Berkeley) 4/28/95 >> .\" $FreeBSD$ >> .\" >> -.Dd December 7, 2006 >> +.Dd November 9, 2016 >> .Dt HOSTNAME 1 >> .Os >> .Sh NAME >> @@ -37,7 +37,8 @@ >> .Nd set or print name of current host system >> .Sh SYNOPSIS >> .Nm >> -.Op Fl fs >> +.Op Fl f >> +.Op Fl s|d >> .Op Ar name-of-host >> .Sh DESCRIPTION >> The >> @@ -62,6 +63,8 @@ This is the default behavior. >> .It Fl s >> Trim off any domain information from the printed >> name. >> +.It Fl d >> +Only print domain information. >> .El >> .Sh SEE ALSO >> .Xr gethostname 3 , >> >> Modified: head/bin/hostname/hostname.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/bin/hostname/hostname.c=09Tue Nov 8 10:10:55 2016=09(r308442) >> +++ head/bin/hostname/hostname.c=09Tue Nov 8 11:36:33 2016=09(r308443) >> @@ -54,11 +54,12 @@ static void usage(void) __dead2; >> int >> main(int argc, char *argv[]) >> { >> -=09int ch, sflag; >> +=09int ch, sflag, dflag; >> =09char *p, hostname[MAXHOSTNAMELEN]; >> >> =09sflag =3D 0; >> -=09while ((ch =3D getopt(argc, argv, "fs")) !=3D -1) >> +=09dflag =3D 0; >> +=09while ((ch =3D getopt(argc, argv, "fsd")) !=3D -1) >> =09=09switch (ch) { >> =09=09case 'f': >> =09=09=09/* >> @@ -70,6 +71,9 @@ main(int argc, char *argv[]) >> =09=09case 's': >> =09=09=09sflag =3D 1; >> =09=09=09break; >> +=09=09case 'd': >> +=09=09=09dflag =3D 1; >> +=09=09=09break; >> =09=09case '?': >> =09=09default: >> =09=09=09usage(); >> @@ -77,7 +81,7 @@ main(int argc, char *argv[]) >> =09argc -=3D optind; >> =09argv +=3D optind; >> >> -=09if (argc > 1) >> +=09if (argc > 1 || (sflag && dflag)) >> =09=09usage(); >> >> =09if (*argv) { >> @@ -90,6 +94,10 @@ main(int argc, char *argv[]) >> =09=09=09p =3D strchr(hostname, '.'); >> =09=09=09if (p !=3D NULL) >> =09=09=09=09*p =3D '\0'; >> +=09=09} else if (dflag) { >> +=09=09=09p =3D strchr(hostname, '.'); >> +=09=09=09if (p !=3D NULL) >> +=09=09=09=09strcpy(hostname, ++p); >> =09=09} >> =09=09(void)printf("%s\n", hostname); >> =09} >> @@ -100,6 +108,6 @@ static void >> usage(void) >> { >> >> -=09(void)fprintf(stderr, "usage: hostname [-fs] [name-of-host]\n"); >> +=09(void)fprintf(stderr, "usage: hostname [-f] [s|d] [name-of-host]\n")= ; > > > It=E2=80=99s missing =E2=80=98-=E2=80=98 sign on [s|d] block, what makes = message a bit confused IMO. Maybe [-s|-d] would be more clear. Both are wrong. This is also broken in the man page, where the '|' is literal and misformatted. Normal markup would give '[-d | -s]' in the man page, and this should be copied to the usage message. Hard-coding the '|' using 's|d' gives the different syntax error of a hyphen before the 's'but no hyphen before the 's' ('[-s|d]'). The hard-coding has 2 other bugs: - missing spaces around '|' - d and s are unsorted d and s are unsorted consistently in about 8 instances in the patch. The correct order for sorting -f and [-d | -s] in the synopsis and usage message is unclear. It would be best to put -f after -d and keep -s attached to -d, but with longer options list this takes too much space by splitting up the single-letter options. Bruce From owner-svn-src-head@freebsd.org Wed Nov 9 04:07:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC838C35645; Wed, 9 Nov 2016 04:07:16 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A3025E0; Wed, 9 Nov 2016 04:07:16 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA947F47065310; Wed, 9 Nov 2016 04:07:15 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA947Fnu065307; Wed, 9 Nov 2016 04:07:15 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201611090407.uA947Fnu065307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 9 Nov 2016 04:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308458 - in head/sys: boot/fdt/dts/arm modules/dtb/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 04:07:16 -0000 Author: loos Date: Wed Nov 9 04:07:15 2016 New Revision: 308458 URL: https://svnweb.freebsd.org/changeset/base/308458 Log: Add the DTS for the Netgate SG-1000 (micro-Firewall). The SG-1000 boots with GENERIC ARM kernel on -head. Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate) Added: head/sys/boot/fdt/dts/arm/ubmc.dtsi (contents, props changed) head/sys/boot/fdt/dts/arm/ufw.dts (contents, props changed) Modified: head/sys/modules/dtb/am335x/Makefile Added: head/sys/boot/fdt/dts/arm/ubmc.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/ubmc.dtsi Wed Nov 9 04:07:15 2016 (r308458) @@ -0,0 +1,315 @@ +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * $FreeBSD$ + */ + +/ { + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; /* 256 MB */ + }; + + vmmcsd_fixed: fixedregulator@0 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; +}; + +&am33xx_pinmux { + pinctrl-names = "default"; + pinctrl-0 = <&clkout2_pin>; + + i2c0_pins: pinmux_i2c0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_sda.i2c0_sda */ + AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_scl.i2c0_scl */ + >; + }; + + i2c1_pins: pinmux_i2c1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE3) /* uart0_ctsn.i2c1_sda */ + AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE3) /* uart0_rtsn.i2c1_scl */ + >; + }; + + spi0_pins: pinmux_spi0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x950, PIN_INPUT_PULLDOWN | MUX_MODE0) /* spi0_sclk.spi0_sclk */ + AM33XX_IOPAD(0x954, PIN_INPUT_PULLDOWN | MUX_MODE0) /* spi0_d0.spi0_miso */ + AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_d1.spi0_mosi */ + AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_cs0.spi0_cs0 */ + >; + }; + + spi1_pins: pinmux_spi1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x908, PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_col.spi1_sclk */ + AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_crs.spi1_miso */ + AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rx_er.spi1_mosi */ + AM33XX_IOPAD(0x944, PIN_INPUT_PULLUP | MUX_MODE2) /* rmii1_ref_clk.spi1_cs0 */ + >; + }; + + uart0_pins: pinmux_uart0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ + AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ + >; + }; + + clkout2_pin: pinmux_clkout2_pin { + pinctrl-single,pins = < + AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */ + >; + }; + + cpsw_default: cpsw_default { + pinctrl-single,pins = < + /* Slave 1 */ + AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txen.rgmii_1_txen */ + AM33XX_IOPAD(0x918, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxdv.rgmii_1_rxdv */ + AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd3.rgmii_1_txd3 */ + AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd2.rgmii_1_txd2 */ + AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd1.rgmii_1_txd1 */ + AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd0.rgmii_1_txd0 */ + AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txclk.rgmii_1_txclk */ + AM33XX_IOPAD(0x930, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxclk.rgmii_1_rxclk */ + AM33XX_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd3.rgmii_1_rxd3 */ + AM33XX_IOPAD(0x938, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd2.rgmii_1_rxd2 */ + AM33XX_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd1.rgmii_1_rxd1 */ + AM33XX_IOPAD(0x940, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd0.rgmii_1_rxd0 */ + + /* Slave 2 */ + AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gmpc_a0.rgmii_2_txen */ + AM33XX_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE2) /* gmpc_a1.rgmii_2_rxdv */ + AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gmpc_a2.rgmii_2_txd3 */ + AM33XX_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gmpc_a3.rgmii_2_txd2 */ + AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gmpc_a4.rgmii_2_txd1 */ + AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gmpc_a5.rgmii_2_txd0 */ + AM33XX_IOPAD(0x858, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gmpc_a6.rgmii_2_txclk */ + AM33XX_IOPAD(0x85c, PIN_INPUT_PULLUP | MUX_MODE2) /* gmpc_a7.rgmii_2_rxclk */ + AM33XX_IOPAD(0x860, PIN_INPUT_PULLUP | MUX_MODE2) /* gmpc_a8.rgmii_2_rxd3 */ + AM33XX_IOPAD(0x864, PIN_INPUT_PULLUP | MUX_MODE2) /* gmpc_a9.rgmii_2_rxd2 */ + AM33XX_IOPAD(0x868, PIN_INPUT_PULLUP | MUX_MODE2) /* gmpc_a10.rgmii_2_rxd1 */ + AM33XX_IOPAD(0x86c, PIN_INPUT_PULLUP | MUX_MODE2) /* gmpc_a11.rgmii_2_rxd0 */ + >; + }; + + cpsw_sleep: cpsw_sleep { + pinctrl-single,pins = < + /* Slave 1 reset value */ + AM33XX_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x91c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x920, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x92c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7) + + /* Slave 2 reset value */ + AM33XX_IOPAD(0x840, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x848, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x84c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x850, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x854, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x858, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE7) + >; + }; + + davinci_mdio_default: davinci_mdio_default { + pinctrl-single,pins = < + /* MDIO */ + AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ + AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ + >; + }; + + davinci_mdio_sleep: davinci_mdio_sleep { + pinctrl-single,pins = < + /* MDIO reset value */ + AM33XX_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7) + >; + }; + + mmc1_pins: pinmux_mmc1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3.mmc0_dat3 */ + AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat2.mmc0_dat2 */ + AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat1.mmc0_dat1 */ + AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat0.mmc0_dat0 */ + AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk.mmc0_clk */ + AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd.mmc0_cmd */ + AM33XX_IOPAD(0x960, PIN_INPUT_PULLUP | MUX_MODE5) /* spi0_cs1.mmc0_cd */ + >; + }; + + emmc_pins: pinmux_emmc_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x994, PIN_INPUT_PULLUP | MUX_MODE4) /* mcasp0_fsx.mmc1_cd */ + AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */ + AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */ + AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */ + AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */ + AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */ + AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */ + AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4 */ + AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5 */ + AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6 */ + AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */ + >; + }; + + ecap0_pins: pinmux_ecap0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x964, PIN_INPUT | MUX_MODE0) /* ecap0_in_pwm0_out.ecap0_in_pwm0_out */ + >; + }; + + ecap1_pins: pinmux_ecap1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE2) /* spi0_cs1.ecap1_in_pwm1_out */ + >; + }; + + ehrpwm1_pins: pinmux_ehrpwm1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8c8, PIN_OUTPUT | MUX_MODE2) /* lcd_data10.ehrpwm1a */ + >; + }; + + ecap2_pins: pinmux_ecap2_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x99c, PIN_INPUT | MUX_MODE4) /* mcasp0_ahclkr.ecap2_in_pwm2_out */ + >; + }; + + ehrpwm2_pins: pinmux_ehrpwm2_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE3) /* lcd_data0.ehrpwm2a */ + >; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + + status = "okay"; +}; + +&usb { + status = "okay"; +}; + +&usb_ctrl_mod { + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb1_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +}; + +&usb1 { + status = "okay"; + dr_mode = "host"; +}; + +&cppi41dma { + status = "okay"; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + + status = "okay"; + clock-frequency = <400000>; + + baseboard_eeprom: baseboard_eeprom@50 { + compatible = "atmel,24c02"; + reg = <0x50>; + + #address-cells = <1>; + #size-cells = <1>; + baseboard_data: baseboard_data@0 { + reg = <0 0x100>; + }; + }; +}; + +&cpsw_emac0 { + phy_id = <&davinci_mdio>, <1>; + phy-mode = "rgmii"; + dual_emac_res_vlan = <1>; +}; + +&cpsw_emac1 { + phy_id = <&davinci_mdio>, <2>; + phy-mode = "rgmii"; + dual_emac_res_vlan = <2>; +}; + +&mac { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&cpsw_default>; + pinctrl-1 = <&cpsw_sleep>; + active_slave = <1>; + status = "okay"; + dual_emac; + txen-skew-ps = <0>; + rxdv-skew-ps = <1400>; + rxd0-skew-ps = <1400>; + rxd1-skew-ps = <1400>; + rxd2-skew-ps = <1400>; + rxd3-skew-ps = <1400>; + txd0-skew-ps = <0>; + txd1-skew-ps = <0>; + txd2-skew-ps = <0>; + txd3-skew-ps = <0>; + rxc-skew-ps = <4400>; + txc-skew-ps = <6200>; +}; + +&davinci_mdio { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&davinci_mdio_default>; + pinctrl-1 = <&davinci_mdio_sleep>; + status = "okay"; +}; + +&aes { + status = "okay"; +}; + +&sham { + status = "okay"; +}; Added: head/sys/boot/fdt/dts/arm/ufw.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/ufw.dts Wed Nov 9 04:07:15 2016 (r308458) @@ -0,0 +1,70 @@ +/*- + * Copyright (c) 2016 Rubicon Communications, LLC (Netgate) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +#include "am33xx.dtsi" +#include "ubmc.dtsi" + +/ { + model = "AM335x uFW"; + compatible = "ti,am335x-ufw", "ti,am335x-ubmc", "ti,am33xx"; +}; + +&mmc1 { + vmmc-supply = <&vmmcsd_fixed>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + bus-width = <4>; + non-removable; + status = "okay"; +}; + +&mmc2 { + vmmc-supply = <&vmmcsd_fixed>; + pinctrl-names = "default"; + pinctrl-0 = <&emmc_pins>; + bus-width = <8>; + ti,dual-volt; + non-removable; + status = "okay"; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + + status = "okay"; +}; Modified: head/sys/modules/dtb/am335x/Makefile ============================================================================== --- head/sys/modules/dtb/am335x/Makefile Tue Nov 8 23:59:41 2016 (r308457) +++ head/sys/modules/dtb/am335x/Makefile Wed Nov 9 04:07:15 2016 (r308458) @@ -2,6 +2,7 @@ # All the dts files for am335x systems we support. DTS= \ beaglebone.dts \ - beaglebone-black.dts + beaglebone-black.dts \ + ufw.dts .include From owner-svn-src-head@freebsd.org Wed Nov 9 04:31:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D42A0C35EFD; Wed, 9 Nov 2016 04:31:56 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EA61823E; Wed, 9 Nov 2016 04:31:55 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 0885ac72; Wed, 9 Nov 2016 05:26:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=MVGPoLG9qUDP/cxRew0tkd86/5c=; b=j1OGgYmMOVAUSjCACvlKla3Ngsrs oLjok1AT+hiFRmx90EUF59IcEQAe5XuuJp1EQ75sh3uIqYG4nNJmkGEo/Sx19XxJ PZtEM/jJf1usBHgeoAj3d2WtgxF+L9wVxEF+m5ip+cFeKnBC3P114qkRWLusyrMm XmBwjakYklVNsVM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=WSktQoPGn0z4ONDwU9pfwLWRqYyIZ6XOU5M/HHweBTzkhnpgWslS/RzH QrT7wZNby+Zbx8uhGNiLEhjm7PTkYOueYWk0B6meevjxA7m11i5fwCrx+EH7MWMg fHhBt88b95tbCqPs2FLg3htxucJMyo2tHXV4dAB/aFixWG6079Q= Received: from knuckles.blih.net (ip-54.net-82-216-203.roubaix.rev.numericable.fr [82.216.203.54]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 3277d5ef TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Wed, 9 Nov 2016 05:26:59 +0100 (CET) Date: Wed, 9 Nov 2016 05:26:56 +0100 From: Emmanuel Vadot To: Luiz Otavio O Souza Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308458 - in head/sys: boot/fdt/dts/arm modules/dtb/am335x Message-Id: <20161109052656.76911ada273bb14048bb999b@bidouilliste.com> In-Reply-To: <201611090407.uA947Fnu065307@repo.freebsd.org> References: <201611090407.uA947Fnu065307@repo.freebsd.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 04:31:56 -0000 On Wed, 9 Nov 2016 04:07:15 +0000 (UTC) Luiz Otavio O Souza wrote: > Author: loos > Date: Wed Nov 9 04:07:15 2016 > New Revision: 308458 > URL: https://svnweb.freebsd.org/changeset/base/308458 > > Log: > Add the DTS for the Netgate SG-1000 (micro-Firewall). > > The SG-1000 boots with GENERIC ARM kernel on -head. > > Obtained from: pfSense > Sponsored by: Rubicon Communications, LLC (Netgate) > > Added: > head/sys/boot/fdt/dts/arm/ubmc.dtsi (contents, props changed) > head/sys/boot/fdt/dts/arm/ufw.dts (contents, props changed) > Modified: > head/sys/modules/dtb/am335x/Makefile Hello Luiz, Two things: - If ubmc.dtsi is gnu licenced it shouldn't go in sys/boot/fdt/dts. It shouldn't go to sys/gnu/dts too as it's not from upstream. - I don't understand why you didn't use the am33xx.dtsi from upstream, it is the way to go for dts. The correct way to add support for this board would be : 1) Create a ubmc.dtsi that uses upstream am33xx.dtsi and submit it upstream (i.e. linux-arm), MIT/GPL dual licence 2) Create a ufw.dts and also submit it upstream (also MIT/GPL) 3) Since those are also MIT you could add them to sys/boot/fdt 4) When we will update the dts from upstream you can then remove them from sys/boot/fdt But there would still be a problem since the am33xx.dtsi is not MIT/GPL licenced. So I guess you don't have any other solution than dealing with DTS somewhere in the pfsense repository (maybe with package or something). The DTS world is already a mess with it's licence and the fact that linux is the "official" place, so please do not add more :) > Added: head/sys/boot/fdt/dts/arm/ubmc.dtsi > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/boot/fdt/dts/arm/ubmc.dtsi Wed Nov 9 04:07:15 2016 (r308458) > @@ -0,0 +1,315 @@ > +/* > + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * $FreeBSD$ > + */ > + > +/ { > + memory { > + device_type = "memory"; > + reg = <0x80000000 0x10000000>; /* 256 MB */ > + }; > + > + vmmcsd_fixed: fixedregulator@0 { > + compatible = "regulator-fixed"; > + regulator-name = "vmmcsd_fixed"; > + regulator-min-microvolt = <3300000>; > + regulator-max-microvolt = <3300000>; > + }; > +}; > + > +&am33xx_pinmux { > + pinctrl-names = "default"; > + pinctrl-0 = <&clkout2_pin>; > + > + i2c0_pins: pinmux_i2c0_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_sda.i2c0_sda */ > + AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_scl.i2c0_scl */ > + >; > + }; > + > + i2c1_pins: pinmux_i2c1_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE3) /* uart0_ctsn.i2c1_sda */ > + AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE3) /* uart0_rtsn.i2c1_scl */ > + >; > + }; > + > + spi0_pins: pinmux_spi0_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x950, PIN_INPUT_PULLDOWN | MUX_MODE0) /* spi0_sclk.spi0_sclk */ > + AM33XX_IOPAD(0x954, PIN_INPUT_PULLDOWN | MUX_MODE0) /* spi0_d0.spi0_miso */ > + AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_d1.spi0_mosi */ > + AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_cs0.spi0_cs0 */ > + >; > + }; > + > + spi1_pins: pinmux_spi1_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x908, PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_col.spi1_sclk */ > + AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_crs.spi1_miso */ > + AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rx_er.spi1_mosi */ > + AM33XX_IOPAD(0x944, PIN_INPUT_PULLUP | MUX_MODE2) /* rmii1_ref_clk.spi1_cs0 */ > + >; > + }; > + > + uart0_pins: pinmux_uart0_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ > + AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ > + >; > + }; > + > + clkout2_pin: pinmux_clkout2_pin { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */ > + >; > + }; > + > + cpsw_default: cpsw_default { > + pinctrl-single,pins = < > + /* Slave 1 */ > + AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txen.rgmii_1_txen */ > + AM33XX_IOPAD(0x918, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxdv.rgmii_1_rxdv */ > + AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd3.rgmii_1_txd3 */ > + AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd2.rgmii_1_txd2 */ > + AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd1.rgmii_1_txd1 */ > + AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd0.rgmii_1_txd0 */ > + AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txclk.rgmii_1_txclk */ > + AM33XX_IOPAD(0x930, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxclk.rgmii_1_rxclk */ > + AM33XX_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd3.rgmii_1_rxd3 */ > + AM33XX_IOPAD(0x938, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd2.rgmii_1_rxd2 */ > + AM33XX_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd1.rgmii_1_rxd1 */ > + AM33XX_IOPAD(0x940, PIN_INPUT_PULLUP | MUX_MODE2) /* mii1_rxd0.rgmii_1_rxd0 */ > + > + /* Slave 2 */ > + AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gmpc_a0.rgmii_2_txen */ > + AM33XX_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE2) /* gmpc_a1.rgmii_2_rxdv */ > + AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gmpc_a2.rgmii_2_txd3 */ > + AM33XX_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gmpc_a3.rgmii_2_txd2 */ > + AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gmpc_a4.rgmii_2_txd1 */ > + AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gmpc_a5.rgmii_2_txd0 */ > + AM33XX_IOPAD(0x858, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gmpc_a6.rgmii_2_txclk */ > + AM33XX_IOPAD(0x85c, PIN_INPUT_PULLUP | MUX_MODE2) /* gmpc_a7.rgmii_2_rxclk */ > + AM33XX_IOPAD(0x860, PIN_INPUT_PULLUP | MUX_MODE2) /* gmpc_a8.rgmii_2_rxd3 */ > + AM33XX_IOPAD(0x864, PIN_INPUT_PULLUP | MUX_MODE2) /* gmpc_a9.rgmii_2_rxd2 */ > + AM33XX_IOPAD(0x868, PIN_INPUT_PULLUP | MUX_MODE2) /* gmpc_a10.rgmii_2_rxd1 */ > + AM33XX_IOPAD(0x86c, PIN_INPUT_PULLUP | MUX_MODE2) /* gmpc_a11.rgmii_2_rxd0 */ > + >; > + }; > + > + cpsw_sleep: cpsw_sleep { > + pinctrl-single,pins = < > + /* Slave 1 reset value */ > + AM33XX_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x91c, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x920, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x92c, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7) > + > + /* Slave 2 reset value */ > + AM33XX_IOPAD(0x840, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x848, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x84c, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x850, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x854, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x858, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE7) > + >; > + }; > + > + davinci_mdio_default: davinci_mdio_default { > + pinctrl-single,pins = < > + /* MDIO */ > + AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ > + AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ > + >; > + }; > + > + davinci_mdio_sleep: davinci_mdio_sleep { > + pinctrl-single,pins = < > + /* MDIO reset value */ > + AM33XX_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7) > + AM33XX_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7) > + >; > + }; > + > + mmc1_pins: pinmux_mmc1_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3.mmc0_dat3 */ > + AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat2.mmc0_dat2 */ > + AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat1.mmc0_dat1 */ > + AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat0.mmc0_dat0 */ > + AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk.mmc0_clk */ > + AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd.mmc0_cmd */ > + AM33XX_IOPAD(0x960, PIN_INPUT_PULLUP | MUX_MODE5) /* spi0_cs1.mmc0_cd */ > + >; > + }; > + > + emmc_pins: pinmux_emmc_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x994, PIN_INPUT_PULLUP | MUX_MODE4) /* mcasp0_fsx.mmc1_cd */ > + AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */ > + AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */ > + AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */ > + AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */ > + AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */ > + AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */ > + AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4 */ > + AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5 */ > + AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6 */ > + AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */ > + >; > + }; > + > + ecap0_pins: pinmux_ecap0_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x964, PIN_INPUT | MUX_MODE0) /* ecap0_in_pwm0_out.ecap0_in_pwm0_out */ > + >; > + }; > + > + ecap1_pins: pinmux_ecap1_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE2) /* spi0_cs1.ecap1_in_pwm1_out */ > + >; > + }; > + > + ehrpwm1_pins: pinmux_ehrpwm1_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x8c8, PIN_OUTPUT | MUX_MODE2) /* lcd_data10.ehrpwm1a */ > + >; > + }; > + > + ecap2_pins: pinmux_ecap2_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x99c, PIN_INPUT | MUX_MODE4) /* mcasp0_ahclkr.ecap2_in_pwm2_out */ > + >; > + }; > + > + ehrpwm2_pins: pinmux_ehrpwm2_pins { > + pinctrl-single,pins = < > + AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE3) /* lcd_data0.ehrpwm2a */ > + >; > + }; > +}; > + > +&uart0 { > + pinctrl-names = "default"; > + pinctrl-0 = <&uart0_pins>; > + > + status = "okay"; > +}; > + > +&usb { > + status = "okay"; > +}; > + > +&usb_ctrl_mod { > + status = "okay"; > +}; > + > +&usb0_phy { > + status = "okay"; > +}; > + > +&usb1_phy { > + status = "okay"; > +}; > + > +&usb0 { > + status = "okay"; > + dr_mode = "host"; > +}; > + > +&usb1 { > + status = "okay"; > + dr_mode = "host"; > +}; > + > +&cppi41dma { > + status = "okay"; > +}; > + > +&i2c0 { > + pinctrl-names = "default"; > + pinctrl-0 = <&i2c0_pins>; > + > + status = "okay"; > + clock-frequency = <400000>; > + > + baseboard_eeprom: baseboard_eeprom@50 { > + compatible = "atmel,24c02"; > + reg = <0x50>; > + > + #address-cells = <1>; > + #size-cells = <1>; > + baseboard_data: baseboard_data@0 { > + reg = <0 0x100>; > + }; > + }; > +}; > + > +&cpsw_emac0 { > + phy_id = <&davinci_mdio>, <1>; > + phy-mode = "rgmii"; > + dual_emac_res_vlan = <1>; > +}; > + > +&cpsw_emac1 { > + phy_id = <&davinci_mdio>, <2>; > + phy-mode = "rgmii"; > + dual_emac_res_vlan = <2>; > +}; > + > +&mac { > + pinctrl-names = "default", "sleep"; > + pinctrl-0 = <&cpsw_default>; > + pinctrl-1 = <&cpsw_sleep>; > + active_slave = <1>; > + status = "okay"; > + dual_emac; > + txen-skew-ps = <0>; > + rxdv-skew-ps = <1400>; > + rxd0-skew-ps = <1400>; > + rxd1-skew-ps = <1400>; > + rxd2-skew-ps = <1400>; > + rxd3-skew-ps = <1400>; > + txd0-skew-ps = <0>; > + txd1-skew-ps = <0>; > + txd2-skew-ps = <0>; > + txd3-skew-ps = <0>; > + rxc-skew-ps = <4400>; > + txc-skew-ps = <6200>; > +}; > + > +&davinci_mdio { > + pinctrl-names = "default", "sleep"; > + pinctrl-0 = <&davinci_mdio_default>; > + pinctrl-1 = <&davinci_mdio_sleep>; > + status = "okay"; > +}; > + > +&aes { > + status = "okay"; > +}; > + > +&sham { > + status = "okay"; > +}; > > Added: head/sys/boot/fdt/dts/arm/ufw.dts > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/boot/fdt/dts/arm/ufw.dts Wed Nov 9 04:07:15 2016 (r308458) > @@ -0,0 +1,70 @@ > +/*- > + * Copyright (c) 2016 Rubicon Communications, LLC (Netgate) > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +/dts-v1/; > + > +#include "am33xx.dtsi" > +#include "ubmc.dtsi" > + > +/ { > + model = "AM335x uFW"; > + compatible = "ti,am335x-ufw", "ti,am335x-ubmc", "ti,am33xx"; > +}; > + > +&mmc1 { > + vmmc-supply = <&vmmcsd_fixed>; > + pinctrl-names = "default"; > + pinctrl-0 = <&mmc1_pins>; > + bus-width = <4>; > + non-removable; > + status = "okay"; > +}; > + > +&mmc2 { > + vmmc-supply = <&vmmcsd_fixed>; > + pinctrl-names = "default"; > + pinctrl-0 = <&emmc_pins>; > + bus-width = <8>; > + ti,dual-volt; > + non-removable; > + status = "okay"; > +}; > + > +&i2c0 { > + pinctrl-names = "default"; > + pinctrl-0 = <&i2c0_pins>; > + > + status = "okay"; > +}; > + > +&i2c1 { > + pinctrl-names = "default"; > + pinctrl-0 = <&i2c1_pins>; > + > + status = "okay"; > +}; > > Modified: head/sys/modules/dtb/am335x/Makefile > ============================================================================== > --- head/sys/modules/dtb/am335x/Makefile Tue Nov 8 23:59:41 2016 (r308457) > +++ head/sys/modules/dtb/am335x/Makefile Wed Nov 9 04:07:15 2016 (r308458) > @@ -2,6 +2,7 @@ > # All the dts files for am335x systems we support. > DTS= \ > beaglebone.dts \ > - beaglebone-black.dts > + beaglebone-black.dts \ > + ufw.dts > > .include -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Wed Nov 9 04:42:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44E4EC3731C; Wed, 9 Nov 2016 04:42:11 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 140EE9BA; Wed, 9 Nov 2016 04:42:11 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA94gAFF079822; Wed, 9 Nov 2016 04:42:10 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA94gAKS079820; Wed, 9 Nov 2016 04:42:10 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201611090442.uA94gAKS079820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 9 Nov 2016 04:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308459 - head/bin/hostname X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 04:42:11 -0000 Author: araujo Date: Wed Nov 9 04:42:09 2016 New Revision: 308459 URL: https://svnweb.freebsd.org/changeset/base/308459 Log: Fix missing '-' for the flags -s and -d on both manpage and usage. Reported by: garga, bde Modified: head/bin/hostname/hostname.1 head/bin/hostname/hostname.c Modified: head/bin/hostname/hostname.1 ============================================================================== --- head/bin/hostname/hostname.1 Wed Nov 9 04:07:15 2016 (r308458) +++ head/bin/hostname/hostname.1 Wed Nov 9 04:42:09 2016 (r308459) @@ -29,7 +29,7 @@ .\" @(#)hostname.1 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd November 9, 2016 +.Dd November 10, 2016 .Dt HOSTNAME 1 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh SYNOPSIS .Nm .Op Fl f -.Op Fl s|d +.Op Fl s | d .Op Ar name-of-host .Sh DESCRIPTION The Modified: head/bin/hostname/hostname.c ============================================================================== --- head/bin/hostname/hostname.c Wed Nov 9 04:07:15 2016 (r308458) +++ head/bin/hostname/hostname.c Wed Nov 9 04:42:09 2016 (r308459) @@ -108,6 +108,6 @@ static void usage(void) { - (void)fprintf(stderr, "usage: hostname [-f] [s|d] [name-of-host]\n"); + (void)fprintf(stderr, "usage: hostname [-f] [-s | -d] [name-of-host]\n"); exit(1); } From owner-svn-src-head@freebsd.org Wed Nov 9 04:42:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E013FC3732E; Wed, 9 Nov 2016 04:42:19 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yw0-x22f.google.com (mail-yw0-x22f.google.com [IPv6:2607:f8b0:4002:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5B2FAD5; Wed, 9 Nov 2016 04:42:19 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yw0-x22f.google.com with SMTP id r204so201884483ywb.0; Tue, 08 Nov 2016 20:42:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=uFsDqUeYAEGd89Nsx0VN9cW6wwpauG5xp8WQuzq2KN4=; b=xeWKwyU6dsuEpEf9Drfbq6GW/5q9yuwo/ZZVHpNlg4KSoeT8R+4nu8dFrqmNyXT4ED l5j5g5AfOyC/IAszuHsJ9uc/f2aGUdwj01NB8sUgJ/0FCrGjrVPhAYMj6nbZ+pdZYBoO Y/JzJeAD0KR5EhbAFPsL0TbbWT5r82t0r77DhV48XTz4ft/u9yx1K0NJ7HlsjesKGdcF tehYCBLl65GZlwW7+JRxV8jFBg4ay0I3kzc+XLEK0e2LrERZnfLseCUHWwm4w45zYFRo Ktv9MbpGq88Mm8+xW9sL2XlTQRVg6ev+OR8s8zci9VfqoRy2hq39/2f8sVYfWfz5D/o8 7GEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=uFsDqUeYAEGd89Nsx0VN9cW6wwpauG5xp8WQuzq2KN4=; b=mG5d9GxIpprw8gDr6MHY16zoK8aaYTyXD6/po8pF3GSVu1BfFmZijkqyOH6za4MBne 1ccuyIly4dCxOTAWNK0xkY2xfxIMJ1yAvOFLiZ3WuZEebMZI+L03Dv3tsXDsusrZ8OOg NV1sWoLOw+N6ClgMRHwk3ttYNio7tta+PKCOebj2XZ285BrAyOWlPhx8uGNO37eLHyHt iaN26hYyMKrvZVWSur43CNJVE1sdQzNi/KximJGKHMxzC6+P5FgQ4Okx3nILaTi5UtcF NZbVEED6WIi7C9bCFjARQIFHIBr9n+1BFxEMWtAnnGv8qiUbEwD0enUD+L5dCfIF2DyH 89Fw== X-Gm-Message-State: ABUngvdKL12vfmmXYagbw3v7VFpFlBCTTg5QBrOlgTAz6EqYZfMUJsrypTKVyp5P8A8EVI9Y2QuNqki7RT0vEA== X-Received: by 10.129.98.65 with SMTP id w62mr15145520ywb.38.1478666538477; Tue, 08 Nov 2016 20:42:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.133.131 with HTTP; Tue, 8 Nov 2016 20:42:18 -0800 (PST) Reply-To: araujo@freebsd.org In-Reply-To: <20161109115729.F924@besplex.bde.org> References: <201611081136.uA8BaXrs073937@repo.freebsd.org> <20161109115729.F924@besplex.bde.org> From: Marcelo Araujo Date: Wed, 9 Nov 2016 12:42:18 +0800 Message-ID: Subject: Re: svn commit: r308443 - head/bin/hostname To: Bruce Evans Cc: Renato Botelho , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 04:42:20 -0000 Fixed, thanks! 2016-11-09 9:39 GMT+08:00 Bruce Evans : > On Tue, 8 Nov 2016, Renato Botelho wrote: > > On 8 Nov 2016, at 09:36, Marcelo Araujo wrote: >>> >>> Log: >>> Add -d flag that prints domain only. >>> >>> PR: 212875 >>> Submitted by: Ben RUBSON >>> Reviewed by: pi >>> >> > This has many style bugs. > > > Modified: >>> head/bin/hostname/hostname.1 >>> head/bin/hostname/hostname.c >>> >>> Modified: head/bin/hostname/hostname.1 >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- head/bin/hostname/hostname.1 Tue Nov 8 10:10:55 2016 >>> (r308442) >>> +++ head/bin/hostname/hostname.1 Tue Nov 8 11:36:33 2016 >>> (r308443) >>> @@ -29,7 +29,7 @@ >>> .\" @(#)hostname.1 8.2 (Berkeley) 4/28/95 >>> .\" $FreeBSD$ >>> .\" >>> -.Dd December 7, 2006 >>> +.Dd November 9, 2016 >>> .Dt HOSTNAME 1 >>> .Os >>> .Sh NAME >>> @@ -37,7 +37,8 @@ >>> .Nd set or print name of current host system >>> .Sh SYNOPSIS >>> .Nm >>> -.Op Fl fs >>> +.Op Fl f >>> +.Op Fl s|d >>> .Op Ar name-of-host >>> .Sh DESCRIPTION >>> The >>> @@ -62,6 +63,8 @@ This is the default behavior. >>> .It Fl s >>> Trim off any domain information from the printed >>> name. >>> +.It Fl d >>> +Only print domain information. >>> .El >>> .Sh SEE ALSO >>> .Xr gethostname 3 , >>> >>> Modified: head/bin/hostname/hostname.c >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- head/bin/hostname/hostname.c Tue Nov 8 10:10:55 2016 >>> (r308442) >>> +++ head/bin/hostname/hostname.c Tue Nov 8 11:36:33 2016 >>> (r308443) >>> @@ -54,11 +54,12 @@ static void usage(void) __dead2; >>> int >>> main(int argc, char *argv[]) >>> { >>> - int ch, sflag; >>> + int ch, sflag, dflag; >>> char *p, hostname[MAXHOSTNAMELEN]; >>> >>> sflag =3D 0; >>> - while ((ch =3D getopt(argc, argv, "fs")) !=3D -1) >>> + dflag =3D 0; >>> + while ((ch =3D getopt(argc, argv, "fsd")) !=3D -1) >>> switch (ch) { >>> case 'f': >>> /* >>> @@ -70,6 +71,9 @@ main(int argc, char *argv[]) >>> case 's': >>> sflag =3D 1; >>> break; >>> + case 'd': >>> + dflag =3D 1; >>> + break; >>> case '?': >>> default: >>> usage(); >>> @@ -77,7 +81,7 @@ main(int argc, char *argv[]) >>> argc -=3D optind; >>> argv +=3D optind; >>> >>> - if (argc > 1) >>> + if (argc > 1 || (sflag && dflag)) >>> usage(); >>> >>> if (*argv) { >>> @@ -90,6 +94,10 @@ main(int argc, char *argv[]) >>> p =3D strchr(hostname, '.'); >>> if (p !=3D NULL) >>> *p =3D '\0'; >>> + } else if (dflag) { >>> + p =3D strchr(hostname, '.'); >>> + if (p !=3D NULL) >>> + strcpy(hostname, ++p); >>> } >>> (void)printf("%s\n", hostname); >>> } >>> @@ -100,6 +108,6 @@ static void >>> usage(void) >>> { >>> >>> - (void)fprintf(stderr, "usage: hostname [-fs] [name-of-host]\n")= ; >>> + (void)fprintf(stderr, "usage: hostname [-f] [s|d] >>> [name-of-host]\n"); >>> >> >> >> It=E2=80=99s missing =E2=80=98-=E2=80=98 sign on [s|d] block, what makes= message a bit confused >> IMO. Maybe [-s|-d] would be more clear. >> > > Both are wrong. > > This is also broken in the man page, where the '|' is literal and > misformatted. Normal markup would give '[-d | -s]' in the man page, and > this should be copied to the usage message. Hard-coding the '|' using > 's|d' gives the different syntax error of a hyphen before the 's'but no > hyphen before the 's' ('[-s|d]'). > > The hard-coding has 2 other bugs: > - missing spaces around '|' > - d and s are unsorted > > d and s are unsorted consistently in about 8 instances in the patch. > > The correct order for sorting -f and [-d | -s] in the synopsis and > usage message is unclear. It would be best to put -f after -d and keep > -s attached to -d, but with longer options list this takes too much > space by splitting up the single-letter options. > > Bruce --=20 --=20 Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Wed Nov 9 05:27:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62230C37018; Wed, 9 Nov 2016 05:27:56 +0000 (UTC) (envelope-from lists.br@gmail.com) Received: from mail-yb0-x22b.google.com (mail-yb0-x22b.google.com [IPv6:2607:f8b0:4002:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33A0DED7; Wed, 9 Nov 2016 05:27:56 +0000 (UTC) (envelope-from lists.br@gmail.com) Received: by mail-yb0-x22b.google.com with SMTP id v78so75030982ybe.3; Tue, 08 Nov 2016 21:27:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Od0XO94SDrHTOH7iSXiphpSMQH8QVG/S7njPOFaFPtM=; b=0/l8nztiLJGNbWMubjNl2ahG9EnFUoDKwj1jkMxGyWmEl4eaKs6UzkfwFg4AFR2nUt 65oLXQQuvA19w9ckqgReIDUkYhIkvnCCr2Vl6AQBDunGjMashkV51ZUeaErU6VV+YzGK /qjr8WjWHcJiPBP8pnR9MU/w6eE1j32ZXd7kMDOD3OyPf4JvXcy+Q4mt5l70LUWBbAFD QijJMXwVJQM9ONNjAAR/kY23fTLil9aUCG/5QdU1wYj0/0UQTiJXXTaC3SkOCvNJRVpU zbP9eL+6/yqfS9J9XtNREM4WOWABhlb/1wz7JluBTsx1BTcB0eEH8Nu6TPcE0A57oK1F Ni/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Od0XO94SDrHTOH7iSXiphpSMQH8QVG/S7njPOFaFPtM=; b=eszmnAZn1hE+Io6hmF3sZbuLDo+Cex1Mz/Rg15mHaCFryVf8Qhxy1viQkg/THZYNUH uqkITG5cNSyOa6PMwWgY5h5cTJOLS3AvhMhGy3vEg3f5Bql5G/yGsEV0Z+1xh3s25NSO DIQoxpZI3izCxHGPvY8S1K0sw1XYVAM+xJCxiI1F/fbiJhOVL+t61WYfdtnLXAn4Zb94 RTS5Q1CAOgHyZiBWBztpPGUe+73SgrTG5v+ZoNOJMSwJCEoLQ8Sxt3MA0kdHZs1uX+G7 PWZ0Q1pEERjvAH0xhomqgjIwTceMtsJFVHpVi8zhiDBtNdToY/WwI33Yvotfi5TL+h3V jGyA== X-Gm-Message-State: ABUngvewDPJidprVnUpb/KENTDQ3bLWgwK9pL/YgTyYHFGZJGuw2PMvam8FX+Xu3E1NzZPhZ3PK5inlvklcELw== X-Received: by 10.37.0.137 with SMTP id 131mr16038742yba.87.1478669275260; Tue, 08 Nov 2016 21:27:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.162.88 with HTTP; Tue, 8 Nov 2016 21:27:54 -0800 (PST) In-Reply-To: <20161109052656.76911ada273bb14048bb999b@bidouilliste.com> References: <201611090407.uA947Fnu065307@repo.freebsd.org> <20161109052656.76911ada273bb14048bb999b@bidouilliste.com> From: Luiz Otavio O Souza Date: Wed, 9 Nov 2016 03:27:54 -0200 Message-ID: Subject: Re: svn commit: r308458 - in head/sys: boot/fdt/dts/arm modules/dtb/am335x To: Emmanuel Vadot Cc: Luiz Otavio O Souza , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 05:27:56 -0000 On 9 November 2016 at 02:26, Emmanuel Vadot wrote: > On Wed, 9 Nov 2016 04:07:15 +0000 (UTC) > Luiz Otavio O Souza wrote: > >> Author: loos >> Date: Wed Nov 9 04:07:15 2016 >> New Revision: 308458 >> URL: https://svnweb.freebsd.org/changeset/base/308458 >> >> Log: >> Add the DTS for the Netgate SG-1000 (micro-Firewall). >> >> The SG-1000 boots with GENERIC ARM kernel on -head. >> >> Obtained from: pfSense >> Sponsored by: Rubicon Communications, LLC (Netgate) >> >> Added: >> head/sys/boot/fdt/dts/arm/ubmc.dtsi (contents, props changed) >> head/sys/boot/fdt/dts/arm/ufw.dts (contents, props changed) >> Modified: >> head/sys/modules/dtb/am335x/Makefile > > Hello Luiz, > > Two things: > > - If ubmc.dtsi is gnu licenced it shouldn't go in sys/boot/fdt/dts. > It shouldn't go to sys/gnu/dts too as it's not from upstream. > - I don't understand why you didn't use the am33xx.dtsi from > upstream, it is the way to go for dts. > > The correct way to add support for this board would be : > > 1) Create a ubmc.dtsi that uses upstream am33xx.dtsi and submit it > upstream (i.e. linux-arm), MIT/GPL dual licence > 2) Create a ufw.dts and also submit it upstream (also MIT/GPL) > 3) Since those are also MIT you could add them to sys/boot/fdt > 4) When we will update the dts from upstream you can then remove them > from sys/boot/fdt > > But there would still be a problem since the am33xx.dtsi is not MIT/GPL > licenced. > So I guess you don't have any other solution than dealing with DTS > somewhere in the pfsense repository (maybe with package or something). > > The DTS world is already a mess with it's licence and the fact that > linux is the "official" place, so please do not add more :) Hi Emmanuel, Yes, you're right. I forgot about the licence in this file. This is not an issue for us in pfSense (we do not depend on this change in FreeBSD), we want to provide support for the people that is going to use/test FreeBSD on uFW. As this is all our work, I'll redo the files and include our changes in a single file. FreeBSD is the upstream here, it is the first officially supported OS for uFW. Thanks, Luiz From owner-svn-src-head@freebsd.org Wed Nov 9 06:47:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91323C371E9; Wed, 9 Nov 2016 06:47:30 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50DF8EA5; Wed, 9 Nov 2016 06:47:30 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA96lTnH027829; Wed, 9 Nov 2016 06:47:29 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA96lTUs027828; Wed, 9 Nov 2016 06:47:29 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201611090647.uA96lTUs027828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 9 Nov 2016 06:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308460 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 06:47:30 -0000 Author: kevlo Date: Wed Nov 9 06:47:29 2016 New Revision: 308460 URL: https://svnweb.freebsd.org/changeset/base/308460 Log: Sort DLINK section and add USB device ID of D-Link DWA-131 rev E1. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Nov 9 04:42:09 2016 (r308459) +++ head/sys/dev/usb/usbdevs Wed Nov 9 06:47:29 2016 (r308460) @@ -1621,12 +1621,18 @@ product DLINK DUBE100 0x1a00 10/100 Eth product DLINK DUBE100C1 0x1a02 DUB-E100 rev C1 product DLINK DSB650TX4 0x200c 10/100 Ethernet product DLINK DWL120E 0x3200 DWL-120 rev E +product DLINK RTL8192CU_1 0x3307 RTL8192CU +product DLINK RTL8188CU 0x3308 RTL8188CU +product DLINK RTL8192CU_2 0x3309 RTL8192CU +product DLINK RTL8192CU_3 0x330a RTL8192CU +product DLINK DWA131B 0x330d DWA-131 rev B product DLINK DWA125D1 0x330f DWA-125 rev D1 product DLINK DWA123D1 0x3310 DWA-123 rev D1 product DLINK DWA171A1 0x3314 DWA-171 rev A1 product DLINK DWA182C1 0x3315 DWA-182 rev C1 product DLINK DWA180A1 0x3316 DWA-180 rev A1 product DLINK DWA172A1 0x3318 DWA-172 rev A1 +product DLINK DWA131E1 0x3319 DWA-131 rev E1 product DLINK DWL122 0x3700 DWL-122 product DLINK DWLG120 0x3701 DWL-G120 product DLINK DWL120F 0x3702 DWL-120 rev F @@ -1652,17 +1658,12 @@ product DLINK DSB650TX_PNA 0x4003 1/10/1 product DLINK DSB650TX3 0x400b 10/100 Ethernet product DLINK DSB650TX2 0x4102 10/100 Ethernet product DLINK DUB1312 0x4a00 10/100/1000 Ethernet -product DLINK DSB650 0xabc1 10/100 Ethernet -product DLINK DUBH7 0xf103 DUB-H7 USB 2.0 7-Port Hub -product DLINK DWR510_CD 0xa805 DWR-510 CD-ROM Mode -product DLINK DWR510 0x7e12 DWR-510 product DLINK DWM157 0x7d02 DWM-157 +product DLINK DWR510 0x7e12 DWR-510 product DLINK DWM157_CD 0xa707 DWM-157 CD-ROM Mode -product DLINK RTL8188CU 0x3308 RTL8188CU -product DLINK RTL8192CU_1 0x3307 RTL8192CU -product DLINK RTL8192CU_2 0x3309 RTL8192CU -product DLINK RTL8192CU_3 0x330a RTL8192CU -product DLINK DWA131B 0x330d DWA-131 rev B +product DLINK DWR510_CD 0xa805 DWR-510 CD-ROM Mode +product DLINK DSB650 0xabc1 10/100 Ethernet +product DLINK DUBH7 0xf103 DUB-H7 USB 2.0 7-Port Hub product DLINK2 RTL8192SU_1 0x3300 RTL8192SU product DLINK2 RTL8192SU_2 0x3302 RTL8192SU product DLINK2 DWA131A1 0x3303 DWA-131 A1 @@ -1673,8 +1674,8 @@ product DLINK2 DWA130D1 0x3a0f DWA-130 product DLINK2 DWLG122C1 0x3c03 DWL-G122 c1 product DLINK2 WUA1340 0x3c04 WUA-1340 product DLINK2 DWA111 0x3c06 DWA-111 -product DLINK2 RT2870_1 0x3c09 RT2870 product DLINK2 DWA110 0x3c07 DWA-110 +product DLINK2 RT2870_1 0x3c09 RT2870 product DLINK2 RT3072 0x3c0a RT3072 product DLINK2 RT3072_1 0x3c0b RT3072 product DLINK2 RT3070_1 0x3c0d RT3070 @@ -4477,6 +4478,7 @@ product TOSHIBA TRANSMEMORY 0x6545 USB T /* TP-Link products */ product TPLINK T4U 0x0101 Archer T4U +product TPLINK WN823NV2 0x0109 TL-WN823N v2 /* Trek Technology products */ product TREK THUMBDRIVE 0x1111 ThumbDrive From owner-svn-src-head@freebsd.org Wed Nov 9 07:09:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77FD7C3797C; Wed, 9 Nov 2016 07:09:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49AECCBB; Wed, 9 Nov 2016 07:09:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA979RGf035473; Wed, 9 Nov 2016 07:09:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA979RAZ035472; Wed, 9 Nov 2016 07:09:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611090709.uA979RAZ035472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 9 Nov 2016 07:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308461 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 07:09:28 -0000 Author: hselasky Date: Wed Nov 9 07:09:27 2016 New Revision: 308461 URL: https://svnweb.freebsd.org/changeset/base/308461 Log: Allow higher sample rates to have more jitter than lower ones. PR: 208791 MFC after: 3 days Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Wed Nov 9 06:47:29 2016 (r308460) +++ head/sys/dev/sound/usb/uaudio.c Wed Nov 9 07:09:27 2016 (r308461) @@ -2079,6 +2079,8 @@ uaudio_chan_play_sync_callback(struct us * recording channel: */ if (ch->priv_sc->sc_rec_chan.num_alt == 0) { + int32_t jitter_max = howmany(sample_rate, 16000); + /* * Range check the jitter values to avoid * bogus sample rate adjustments. The expected @@ -2087,12 +2089,11 @@ uaudio_chan_play_sync_callback(struct us * mandates this requirement. Refer to chapter * 5.12.4.2 about feedback. */ - if (temp > sample_rate) - ch->jitter_curr = 1; - else if (temp < sample_rate) - ch->jitter_curr = -1; - else - ch->jitter_curr = 0; + ch->jitter_curr = temp - sample_rate; + if (ch->jitter_curr > jitter_max) + ch->jitter_curr = jitter_max; + else if (ch->jitter_curr < -jitter_max) + ch->jitter_curr = -jitter_max; } ch->feedback_rate = temp; break; From owner-svn-src-head@freebsd.org Wed Nov 9 07:31:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97689C37F6C; Wed, 9 Nov 2016 07:31:40 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C17B7EA; Wed, 9 Nov 2016 07:31:40 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA97VdJT044288; Wed, 9 Nov 2016 07:31:39 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA97Vd0h044286; Wed, 9 Nov 2016 07:31:39 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201611090731.uA97Vd0h044286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 9 Nov 2016 07:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308462 - head/usr.sbin/gstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 07:31:40 -0000 Author: araujo Date: Wed Nov 9 07:31:39 2016 New Revision: 308462 URL: https://svnweb.freebsd.org/changeset/base/308462 Log: Add flag -B which does the same like batch mode but without exiting after print. Also add a new flag -s that add blocks size to statistics. PR: 198347, 212726 Submitted by: Ben RUBSON Tested by: pi MFC After: 2 weeks. Modified: head/usr.sbin/gstat/gstat.8 head/usr.sbin/gstat/gstat.c Modified: head/usr.sbin/gstat/gstat.8 ============================================================================== --- head/usr.sbin/gstat/gstat.8 Wed Nov 9 07:09:27 2016 (r308461) +++ head/usr.sbin/gstat/gstat.8 Wed Nov 9 07:31:39 2016 (r308462) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2014 +.Dd November 10, 2016 .Dt GSTAT 8 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd print statistics about GEOM disks .Sh SYNOPSIS .Nm -.Op Fl abcdop +.Op Fl abBcdops .Op Fl f Ar filter .Op Fl I Ar interval .Sh DESCRIPTION @@ -50,6 +50,10 @@ Only display providers that are at least Batch mode. Collect numbers, print and exit. Default if stdout is not a tty. +.It Fl B +Endless batch mode. +Same as batch mode, but does not exit after collecting +the first set of data. .It Fl c Enable display of .Xr geom 4 @@ -72,6 +76,8 @@ The format of the regular expression is .It Fl o Enable display of statistics for other operations .Pq Dv BIO_FLUSH . +.It Fl s +Enable blocks' size statistics. .It Fl I Ar interval Refresh the .Nm Modified: head/usr.sbin/gstat/gstat.c ============================================================================== --- head/usr.sbin/gstat/gstat.c Wed Nov 9 07:09:27 2016 (r308461) +++ head/usr.sbin/gstat/gstat.c Wed Nov 9 07:31:39 2016 (r308462) @@ -51,11 +51,11 @@ #include #include -static int flag_a, flag_b, flag_c, flag_d, flag_o, flag_p; +static int flag_a, flag_b, flag_B, flag_c, flag_d, flag_o, flag_p, flag_s; static int flag_I = 1000000; #define PRINTMSG(...) do { \ - if (flag_b && !loop) \ + if ((flag_b && !loop) || (flag_B)) \ printf(__VA_ARGS__); \ else if (!flag_b) \ printw(__VA_ARGS__); \ @@ -88,7 +88,7 @@ main(int argc, char **argv) char *p; char f_s[100], pf_s[100], tmp_f_s[100]; const char *line; - long double ld[13]; + long double ld[16]; uint64_t u64; EditLine *el; History *hist; @@ -104,7 +104,7 @@ main(int argc, char **argv) flag_b = 1; f_s[0] = '\0'; - while ((i = getopt(argc, argv, "abdcf:I:op")) != -1) { + while ((i = getopt(argc, argv, "abBdcf:I:ops")) != -1) { switch (i) { case 'a': flag_a = 1; @@ -112,6 +112,10 @@ main(int argc, char **argv) case 'b': flag_b = 1; break; + case 'B': + flag_B = 1; + flag_b = 1; + break; case 'c': flag_c = 1; break; @@ -146,6 +150,9 @@ main(int argc, char **argv) case 'p': flag_p = 1; break; + case 's': + flag_s = 1; + break; case '?': default: usage(); @@ -208,7 +215,8 @@ main(int argc, char **argv) geom_stats_snapshot_reset(sp); geom_stats_snapshot_reset(sq); - move(0,0); + if (!flag_b) + move(0,0); PRINTMSG("dT: %5.3fs w: %.3fs", dt, (float)flag_I / 1000000); if (f_s[0] != '\0') { PRINTMSG(" filter: "); @@ -231,10 +239,20 @@ main(int argc, char **argv) } PRINTMSG("\n"); PRINTMSG(" L(q) ops/s "); - PRINTMSG(" r/s kBps ms/r "); - PRINTMSG(" w/s kBps ms/w "); - if (flag_d) - PRINTMSG(" d/s kBps ms/d "); + if (flag_s) { + PRINTMSG(" r/s kB kBps ms/r "); + PRINTMSG(" w/s kB kBps ms/w "); + } + else { + PRINTMSG(" r/s kBps ms/r "); + PRINTMSG(" w/s kBps ms/w "); + } + if (flag_d) { + if (flag_s) + PRINTMSG(" d/s kB kBps ms/d "); + else + PRINTMSG(" d/s kBps ms/d "); + } if (flag_o) PRINTMSG(" o/s ms/o "); PRINTMSG("%%busy Name\n"); @@ -298,6 +316,10 @@ main(int argc, char **argv) DSM_TRANSFERS_PER_SECOND_OTHER, &ld[11], DSM_MS_PER_TRANSACTION_OTHER, &ld[12], + DSM_KB_PER_TRANSFER_READ, &ld[13], + DSM_KB_PER_TRANSFER_WRITE, &ld[14], + DSM_KB_PER_TRANSFER_FREE, &ld[15], + DSM_NONE); if (flag_a && ld[7] < 0.1) { @@ -308,12 +330,16 @@ main(int argc, char **argv) PRINTMSG(" %4ju", (uintmax_t)u64); PRINTMSG(" %6.0f", (double)ld[0]); PRINTMSG(" %6.0f", (double)ld[1]); + if (flag_s) + PRINTMSG(" %6.0f", (double)ld[13]); PRINTMSG(" %6.0f", (double)ld[2] * 1024); if (ld[3] > 1e3) PRINTMSG(" %6.0f", (double)ld[3]); else PRINTMSG(" %6.1f", (double)ld[3]); PRINTMSG(" %6.0f", (double)ld[4]); + if (flag_s) + PRINTMSG(" %6.0f", (double)ld[14]); PRINTMSG(" %6.0f", (double)ld[5] * 1024); if (ld[6] > 1e3) PRINTMSG(" %6.0f", (double)ld[6]); @@ -322,6 +348,8 @@ main(int argc, char **argv) if (flag_d) { PRINTMSG(" %6.0f", (double)ld[8]); + if (flag_s) + PRINTMSG(" %6.0f", (double)ld[15]); PRINTMSG(" %6.0f", (double)ld[9] * 1024); if (ld[10] > 1e3) PRINTMSG(" %6.0f", (double)ld[10]); @@ -373,7 +401,10 @@ main(int argc, char **argv) /* We loop extra to make sure we get the information. */ if (!loop) break; - loop = 0; + if (!flag_B) + loop = 0; + else + fflush(stdout); usleep(flag_I); continue; } @@ -452,7 +483,7 @@ main(int argc, char **argv) static void usage(void) { - fprintf(stderr, "usage: gstat [-abcdp] [-f filter] [-I interval]\n"); + fprintf(stderr, "usage: gstat [-abBcdps] [-f filter] [-I interval]\n"); exit(EX_USAGE); /* NOTREACHED */ } From owner-svn-src-head@freebsd.org Wed Nov 9 08:58:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67DA8C35A8A; Wed, 9 Nov 2016 08:58:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 203175E3; Wed, 9 Nov 2016 08:58:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA98w0fW078814; Wed, 9 Nov 2016 08:58:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA98vxUV078805; Wed, 9 Nov 2016 08:57:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611090857.uA98vxUV078805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 9 Nov 2016 08:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308464 - in head/sys/dev: ichsmb sound/pci/hda usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 08:58:01 -0000 Author: mav Date: Wed Nov 9 08:57:59 2016 New Revision: 308464 URL: https://svnweb.freebsd.org/changeset/base/308464 Log: Add some device IDs found in my new laptop. Modified: head/sys/dev/ichsmb/ichsmb_pci.c head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h head/sys/dev/sound/pci/hda/hdacc.c head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Wed Nov 9 08:08:02 2016 (r308463) +++ head/sys/dev/ichsmb/ichsmb_pci.c Wed Nov 9 08:57:59 2016 (r308464) @@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$"); #define ID_WCPTLP 0x9ca28086 #define ID_WELLSBURG 0x8d228086 #define ID_SRPT 0xa1238086 +#define ID_SRPTLP 0x9d238086 #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 @@ -220,6 +221,9 @@ ichsmb_pci_probe(device_t dev) case ID_SRPT: device_set_desc(dev, "Intel Sunrise Point-H SMBus controller"); break; + case ID_SRPTLP: + device_set_desc(dev, "Intel Sunrise Point-LP SMBus controller"); + break; default: return (ENXIO); } Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed Nov 9 08:08:02 2016 (r308463) +++ head/sys/dev/sound/pci/hda/hdac.c Wed Nov 9 08:57:59 2016 (r308464) @@ -94,7 +94,9 @@ static const struct { { HDA_INTEL_LPTLP1, "Intel Lynx Point-LP", 0, 0 }, { HDA_INTEL_LPTLP2, "Intel Lynx Point-LP", 0, 0 }, { HDA_INTEL_SRPTLP, "Intel Sunrise Point-LP", 0, 0 }, + { HDA_INTEL_KBLKLP, "Intel Kabylake-LP", 0, 0 }, { HDA_INTEL_SRPT, "Intel Sunrise Point", 0, 0 }, + { HDA_INTEL_KBLK, "Intel Kabylake", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0, 0 }, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Wed Nov 9 08:08:02 2016 (r308463) +++ head/sys/dev/sound/pci/hda/hdac.h Wed Nov 9 08:57:59 2016 (r308464) @@ -70,7 +70,9 @@ #define HDA_INTEL_LPTLP2 HDA_MODEL_CONSTRUCT(INTEL, 0x9c21) #define HDA_INTEL_BDW2 HDA_MODEL_CONSTRUCT(INTEL, 0x9ca0) #define HDA_INTEL_SRPTLP HDA_MODEL_CONSTRUCT(INTEL, 0x9d70) +#define HDA_INTEL_KBLKLP HDA_MODEL_CONSTRUCT(INTEL, 0x9d71) #define HDA_INTEL_SRPT HDA_MODEL_CONSTRUCT(INTEL, 0xa170) +#define HDA_INTEL_KBLK HDA_MODEL_CONSTRUCT(INTEL, 0xa171) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) /* Nvidia */ @@ -348,6 +350,7 @@ #define HDA_CODEC_ALC275 HDA_CODEC_CONSTRUCT(REALTEK, 0x0275) #define HDA_CODEC_ALC276 HDA_CODEC_CONSTRUCT(REALTEK, 0x0276) #define HDA_CODEC_ALC292 HDA_CODEC_CONSTRUCT(REALTEK, 0x0292) +#define HDA_CODEC_ALC295 HDA_CODEC_CONSTRUCT(REALTEK, 0x0295) #define HDA_CODEC_ALC660 HDA_CODEC_CONSTRUCT(REALTEK, 0x0660) #define HDA_CODEC_ALC662 HDA_CODEC_CONSTRUCT(REALTEK, 0x0662) #define HDA_CODEC_ALC663 HDA_CODEC_CONSTRUCT(REALTEK, 0x0663) @@ -633,6 +636,8 @@ #define HDA_CODEC_INTELPPT HDA_CODEC_CONSTRUCT(INTEL, 0x2806) #define HDA_CODEC_INTELHSW HDA_CODEC_CONSTRUCT(INTEL, 0x2807) #define HDA_CODEC_INTELBDW HDA_CODEC_CONSTRUCT(INTEL, 0x2808) +#define HDA_CODEC_INTELSKLK HDA_CODEC_CONSTRUCT(INTEL, 0x2809) +#define HDA_CODEC_INTELKBLK HDA_CODEC_CONSTRUCT(INTEL, 0x280b) #define HDA_CODEC_INTELCL HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Wed Nov 9 08:08:02 2016 (r308463) +++ head/sys/dev/sound/pci/hda/hdacc.c Wed Nov 9 08:57:59 2016 (r308464) @@ -88,6 +88,7 @@ static const struct { { HDA_CODEC_ALC275, 0, "Realtek ALC275" }, { HDA_CODEC_ALC276, 0, "Realtek ALC276" }, { HDA_CODEC_ALC292, 0, "Realtek ALC292" }, + { HDA_CODEC_ALC295, 0, "Realtek ALC295" }, { HDA_CODEC_ALC660, 0, "Realtek ALC660-VD" }, { HDA_CODEC_ALC662, 0x0002, "Realtek ALC662 rev2" }, { HDA_CODEC_ALC662, 0, "Realtek ALC662" }, @@ -321,6 +322,8 @@ static const struct { { HDA_CODEC_INTELPPT, 0, "Intel Panther Point" }, { HDA_CODEC_INTELHSW, 0, "Intel Haswell" }, { HDA_CODEC_INTELBDW, 0, "Intel Broadwell" }, + { HDA_CODEC_INTELSKLK, 0, "Intel Kabylake" }, + { HDA_CODEC_INTELKBLK, 0, "Intel Kabylake" }, { HDA_CODEC_INTELCL, 0, "Intel Crestline" }, { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, { HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" }, Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Wed Nov 9 08:08:02 2016 (r308463) +++ head/sys/dev/usb/controller/xhci_pci.c Wed Nov 9 08:57:59 2016 (r308464) @@ -122,6 +122,8 @@ xhci_pci_match(device_t self) return ("Intel Wellsburg USB 3.0 controller"); case 0x9cb18086: return ("Broadwell Integrated PCH-LP chipset USB 3.0 controller"); + case 0x9d2f8086: + return ("Intel Sunrise Point-LP USB 3.0 controller"); case 0xa12f8086: return ("Intel Sunrise Point USB 3.0 controller"); From owner-svn-src-head@freebsd.org Wed Nov 9 14:50:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75557C383EC; Wed, 9 Nov 2016 14:50:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55AC3A84; Wed, 9 Nov 2016 14:50:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 79BCC10A728; Wed, 9 Nov 2016 09:50:47 -0500 (EST) From: John Baldwin To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, kan@freebsd.org Subject: Re: svn commit: r308430 - head/contrib/elftoolchain/libelftc Date: Tue, 08 Nov 2016 15:37:47 -0800 Message-ID: <2183706.KJxf8SBB7q@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201611072241.uA7MfqgC065929@repo.freebsd.org> References: <201611072241.uA7MfqgC065929@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 09 Nov 2016 09:50:47 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 14:50:49 -0000 On Monday, November 07, 2016 10:41:52 PM Ed Maste wrote: > Author: emaste > Date: Mon Nov 7 22:41:52 2016 > New Revision: 308430 > URL: https://svnweb.freebsd.org/changeset/base/308430 > > Log: > libelftc: add elf{32,64}-tradbigmips target emulation names Should elfXX-tradlittlemips be added as well? -- John Baldwin From owner-svn-src-head@freebsd.org Wed Nov 9 15:04:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66B28C3871F; Wed, 9 Nov 2016 15:04:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 360352E9; Wed, 9 Nov 2016 15:04:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA9F4Tkj024144; Wed, 9 Nov 2016 15:04:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA9F4Tl7024143; Wed, 9 Nov 2016 15:04:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611091504.uA9F4Tl7024143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 9 Nov 2016 15:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308465 - head/contrib/elftoolchain/cxxfilt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 15:04:30 -0000 Author: emaste Date: Wed Nov 9 15:04:29 2016 New Revision: 308465 URL: https://svnweb.freebsd.org/changeset/base/308465 Log: c++filt: flush output after newline Some tools spawn c++filt and pass it a single line at a time for demangling. This is akin to r276689 for addr2line. Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/cxxfilt/cxxfilt.c Modified: head/contrib/elftoolchain/cxxfilt/cxxfilt.c ============================================================================== --- head/contrib/elftoolchain/cxxfilt/cxxfilt.c Wed Nov 9 08:57:59 2016 (r308464) +++ head/contrib/elftoolchain/cxxfilt/cxxfilt.c Wed Nov 9 15:04:29 2016 (r308465) @@ -188,6 +188,8 @@ main(int argc, char **argv) if (c == EOF) break; putchar(c); + if (c == '\n') + fflush(stdout); } else { if ((size_t) p >= sizeof(buf) - 1) warnx("buffer overflowed"); From owner-svn-src-head@freebsd.org Wed Nov 9 15:09:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 008DAC387AC; Wed, 9 Nov 2016 15:09:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0B98769; Wed, 9 Nov 2016 15:09:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 6C11910A722; Wed, 9 Nov 2016 10:09:22 -0500 (EST) From: John Baldwin To: Hans Petter Selasky Cc: Oleksandr Tymoshenko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835 Date: Wed, 09 Nov 2016 07:02:36 -0800 Message-ID: <3214848.geWV8qu7rM@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201611071738.uA7HceYu045944@repo.freebsd.org> <680D84F2-65BF-48DD-8D11-311B1F65A634@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 09 Nov 2016 10:09:22 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 15:09:25 -0000 On Monday, November 07, 2016 08:32:17 PM Hans Petter Selasky wrote: > On 11/07/16 20:23, Oleksandr Tymoshenko wrote: > > > >> On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky = wrote: > >> > >> On 11/07/16 18:38, Oleksandr Tymoshenko wrote: > >>> +=09=09bcm2835_audio_unlock(sc); > >>> +=09=09cv_signal(&sc->worker_cv); > >> > >> > >> Shouldn't cv_signal() be done locked, so that you don't loose any = transactions? CV's only wakeup the treads that are sleeping right there= and then. > > > > Hi Hans, > > > > In this case it doesn=E2=80=99t matter. bcm2835_audio_xxx lock func= tions are used to keep channel state consistent. The actual audio hw re= programming happens in worker thread which only picks up latest state o= f the virtual channel, there is no need to run every transaction in seq= uence. > > >=20 > Hi, >=20 > It is not about running in sequence, but that if the worker thread is= =20 > not sleeping, but on the way to sleep, it will never get woken up unl= ess=20 > you use proper locks here! You do not have to hold locks across cv_signal/broadcast or wakeup. Yo= u do have to hold them across the check determining whether you should sleep= . Take this simple example: =09lock(&m); =09while (should_sleep) =09=09cv_wait(&cv, &m); =09unlock(&m); =09... =09lock(&m); =09should_sleep =3D true; =09unlock(&m); =09cv_signal(&cv); A thread that locks 'm' after the 'unlock' but before the cv_signal wil= l see 'should_sleep' as false and will not call cv_wait(). The cv_signal of = course might then wakeup a second thread prematurely, but that's why you shoul= d always use a while loop with cv wait operations (same is true with pthr= ead condvars btw). On the other hand, doing the wakeup outside of the lock= avoids preempting during the wakeup only to immediately block on the lo= ck and switch back to the thread that did the wakeup. --=20 John Baldwin From owner-svn-src-head@freebsd.org Wed Nov 9 16:05:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0927CC378F9; Wed, 9 Nov 2016 16:05:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5AD192E; Wed, 9 Nov 2016 16:05:00 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1E8871FE022; Wed, 9 Nov 2016 17:04:58 +0100 (CET) Subject: Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835 To: John Baldwin References: <201611071738.uA7HceYu045944@repo.freebsd.org> <680D84F2-65BF-48DD-8D11-311B1F65A634@freebsd.org> <3214848.geWV8qu7rM@ralph.baldwin.cx> Cc: Oleksandr Tymoshenko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <5c170b6b-1189-4712-ffdd-653cc6b8c59e@selasky.org> Date: Wed, 9 Nov 2016 17:10:09 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <3214848.geWV8qu7rM@ralph.baldwin.cx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 16:05:02 -0000 Hi, On 11/09/16 16:02, John Baldwin wrote: > On the other hand, doing the wakeup outside of the lock > avoids preempting during the wakeup only to immediately block on the lock and > switch back to the thread that did the wakeup. This can be predicted and avoided by the turnstiles iff cv_signal() is used under a lock. Else not. Won't doing the wakeup outside the lock cause double preemtion? First at mtx_unlock() and then inside cv_signal()/cv_broadcast(). --HPS From owner-svn-src-head@freebsd.org Wed Nov 9 16:06:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BECEC379B4; Wed, 9 Nov 2016 16:06:55 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from mail.samsco.org (suzi.samsco.org [96.84.242.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EA71ADD; Wed, 9 Nov 2016 16:06:54 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from localhost (localhost [192.168.254.3]) by mail.samsco.org (Postfix) with ESMTP id D4A9215C1867E; Wed, 9 Nov 2016 16:06:47 +0000 (UTC) Received: from mail.samsco.org ([192.168.254.3]) by localhost (mail.samsco.org [192.168.254.3]) (maiad, port 10024) with ESMTP id 82995-09; Wed, 9 Nov 2016 16:06:47 +0000 (UTC) Received: from [172.19.248.94] (unknown [104.153.224.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: scottl@samsco.org) by mail.samsco.org (Postfix) with ESMTPSA id 172DD15C1867C; Wed, 9 Nov 2016 16:06:41 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r308217 - in head/sys/dev: mpr mps From: Scott Long In-Reply-To: <581C5249.2060104@omnilan.de> Date: Wed, 9 Nov 2016 09:06:29 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <161EBBC5-F642-4A05-9361-179B74CDA50A@samsco.org> References: <201611021513.uA2FDPk6062463@repo.freebsd.org> <581C5249.2060104@omnilan.de> To: Harry Schmalzbauer X-Mailer: Apple Mail (2.3251) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 16:06:55 -0000 > On Nov 4, 2016, at 3:18 AM, Harry Schmalzbauer = wrote: >=20 > Bez=C3=BCglich Scott Long's Nachricht vom 02.11.2016 16:13 = (localtime): >> Author: scottl >> Date: Wed Nov 2 15:13:25 2016 >> New Revision: 308217 >> URL: https://svnweb.freebsd.org/changeset/base/308217 >>=20 >> Log: >> Add a fallback to the device mapper logic. We've seen systems in = the field >> that are apparently misconfigured by the manufacturer and cause the = mapping >> logic to fail. The fallback allows drive numbers to be assigned = based on the >> PHY number that they're attached to. Add sysctls and tunables to = overrid >> this new behavior, but they should be considered only necessary for = debugging. >=20 > Thanks a lot, this is welcome not only for debugging! >=20 > I had a hard time finding out how to get rid of static > driveserial-targetID assigning. > And more surprising, this affects only IT-fw. When using the same > controller in IR-mode, mapping is done (correctly) slot-based. > In IT-mode, every drive got a consecutive target ID which was static, > and even persistent over firmware updates. There's only one = possibility > with LSIUtil(1.71) to erase /"persitent non-manufacturing config = pages/". > But I guess this hard drive-targetID assigning is triggered by the > driver, namely the mps(4) in FreeBSD. > I did quick tests on windows and IT-mode, where I think I saw slot (or > Phy?) based assigning. >=20 > If it's really mps(4) who decides to store driveserial-targetID > numbering in the /"persitent non-manufacturing config pages/" of the > controller, mpsutil(8) should be able to reset. Otherwise replacing > failed drives, or - even mor confusing - rearranging drive/zpool = layouts > is very unsatisfying. >=20 > Maybe "-1" should be mentioned with sysctl decription, otherwise this = is > another very hard to find/influence behaviour. >=20 >=20 Thanks for the feedback. For the record, this problem happens on a Supermicro X10SDV-7TP4F motherboard. It appears that the support logic around the LSI controller is mis-configured to show the SAS ports being part of an enclosure with 0 slots, instead of 8. This confuses the device mapper logic in the driver that activates if the controller = NVRAM doesn=E2=80=99t specify a pre-existing mapping. Typically this is not = the default, the NVRAM persistent mappings are the default and are used by the = driver, so I considered this problem to be unique to our deployment. Maybe = it=E2=80=99s more of a problem than I estimated? Anyways, sounds like this new functionality should be properly documented in the driver. Scott From owner-svn-src-head@freebsd.org Wed Nov 9 17:05:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2622FC38B48; Wed, 9 Nov 2016 17:05:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0505EE16; Wed, 9 Nov 2016 17:05:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id DD7F610A727; Wed, 9 Nov 2016 12:05:28 -0500 (EST) From: John Baldwin To: Hans Petter Selasky Cc: Oleksandr Tymoshenko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835 Date: Wed, 09 Nov 2016 08:32:25 -0800 Message-ID: <2064206.nvhhXHc9vW@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <5c170b6b-1189-4712-ffdd-653cc6b8c59e@selasky.org> References: <201611071738.uA7HceYu045944@repo.freebsd.org> <3214848.geWV8qu7rM@ralph.baldwin.cx> <5c170b6b-1189-4712-ffdd-653cc6b8c59e@selasky.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 09 Nov 2016 12:05:28 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 17:05:31 -0000 On Wednesday, November 09, 2016 05:10:09 PM Hans Petter Selasky wrote: > Hi, > > On 11/09/16 16:02, John Baldwin wrote: > > On the other hand, doing the wakeup outside of the lock > > avoids preempting during the wakeup only to immediately block on the lock and > > switch back to the thread that did the wakeup. > > This can be predicted and avoided by the turnstiles iff cv_signal() is > used under a lock. Else not. It isn't predicted and avoided by turnstiles. In particular, the cv_signal has no idea what lock is associated, so it can't try to do something "smart" and move the thread from the sleepq to the lockq. You will pay the double context switch. > Won't doing the wakeup outside the lock cause double preemtion? First at > mtx_unlock() and then inside cv_signal()/cv_broadcast(). No. The other thread can't be blocked on both the mutex and cv. If the thread is blocked on the mutex and you preempt to it, then it won't ever bother sleeping on the cv anyway (and the cv_signal will be a nop once the awakening thread resumes). -- John Baldwin From owner-svn-src-head@freebsd.org Wed Nov 9 17:57:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2276C3888B; Wed, 9 Nov 2016 17:57:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 716A7146; Wed, 9 Nov 2016 17:57:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA9Hvt5e091333; Wed, 9 Nov 2016 17:57:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA9HvtHD091332; Wed, 9 Nov 2016 17:57:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611091757.uA9HvtHD091332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 9 Nov 2016 17:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308471 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 17:57:56 -0000 Author: mav Date: Wed Nov 9 17:57:55 2016 New Revision: 308471 URL: https://svnweb.freebsd.org/changeset/base/308471 Log: Fix copy/paste bug in r308464. MFC after: 1 week Modified: head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Wed Nov 9 17:19:50 2016 (r308470) +++ head/sys/dev/sound/pci/hda/hdacc.c Wed Nov 9 17:57:55 2016 (r308471) @@ -322,7 +322,7 @@ static const struct { { HDA_CODEC_INTELPPT, 0, "Intel Panther Point" }, { HDA_CODEC_INTELHSW, 0, "Intel Haswell" }, { HDA_CODEC_INTELBDW, 0, "Intel Broadwell" }, - { HDA_CODEC_INTELSKLK, 0, "Intel Kabylake" }, + { HDA_CODEC_INTELSKLK, 0, "Intel Skylake" }, { HDA_CODEC_INTELKBLK, 0, "Intel Kabylake" }, { HDA_CODEC_INTELCL, 0, "Intel Crestline" }, { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, From owner-svn-src-head@freebsd.org Wed Nov 9 18:42:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7D6FC3775C; Wed, 9 Nov 2016 18:42:31 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92D1E131; Wed, 9 Nov 2016 18:42:31 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA9IgUfY012603; Wed, 9 Nov 2016 18:42:30 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA9IgUet012596; Wed, 9 Nov 2016 18:42:30 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201611091842.uA9IgUet012596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Wed, 9 Nov 2016 18:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308473 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 18:42:31 -0000 Author: jasone Date: Wed Nov 9 18:42:30 2016 New Revision: 308473 URL: https://svnweb.freebsd.org/changeset/base/308473 Log: Update jemalloc to 4.3.1. Added: head/contrib/jemalloc/include/jemalloc/internal/spin.h (contents, props changed) head/contrib/jemalloc/src/spin.c (contents, props changed) Modified: head/contrib/jemalloc/ChangeLog head/contrib/jemalloc/FREEBSD-Xlist head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/VERSION head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/arena.h head/contrib/jemalloc/include/jemalloc/internal/chunk.h head/contrib/jemalloc/include/jemalloc/internal/chunk_dss.h head/contrib/jemalloc/include/jemalloc/internal/ckh.h head/contrib/jemalloc/include/jemalloc/internal/huge.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h head/contrib/jemalloc/include/jemalloc/internal/mb.h head/contrib/jemalloc/include/jemalloc/internal/mutex.h head/contrib/jemalloc/include/jemalloc/internal/nstime.h head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h head/contrib/jemalloc/include/jemalloc/internal/prng.h head/contrib/jemalloc/include/jemalloc/internal/prof.h head/contrib/jemalloc/include/jemalloc/internal/size_classes.h head/contrib/jemalloc/include/jemalloc/internal/tcache.h head/contrib/jemalloc/include/jemalloc/internal/tsd.h head/contrib/jemalloc/include/jemalloc/internal/util.h head/contrib/jemalloc/include/jemalloc/internal/witness.h head/contrib/jemalloc/include/jemalloc/jemalloc.h head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/chunk.c head/contrib/jemalloc/src/chunk_dss.c head/contrib/jemalloc/src/ckh.c head/contrib/jemalloc/src/ctl.c head/contrib/jemalloc/src/huge.c head/contrib/jemalloc/src/jemalloc.c head/contrib/jemalloc/src/mutex.c head/contrib/jemalloc/src/nstime.c head/contrib/jemalloc/src/pages.c head/contrib/jemalloc/src/prof.c head/contrib/jemalloc/src/rtree.c head/contrib/jemalloc/src/stats.c head/contrib/jemalloc/src/tcache.c head/contrib/jemalloc/src/tsd.c head/contrib/jemalloc/src/util.c head/lib/libc/stdlib/jemalloc/Makefile.inc Modified: head/contrib/jemalloc/ChangeLog ============================================================================== --- head/contrib/jemalloc/ChangeLog Wed Nov 9 18:00:50 2016 (r308472) +++ head/contrib/jemalloc/ChangeLog Wed Nov 9 18:42:30 2016 (r308473) @@ -4,6 +4,59 @@ brevity. Much more detail can be found https://github.com/jemalloc/jemalloc +* 4.3.1 (November 7, 2016) + + Bug fixes: + - Fix a severe virtual memory leak. This regression was first released in + 4.3.0. (@interwq, @jasone) + - Refactor atomic and prng APIs to restore support for 32-bit platforms that + use pre-C11 toolchains, e.g. FreeBSD's mips. (@jasone) + +* 4.3.0 (November 4, 2016) + + This is the first release that passes the test suite for multiple Windows + configurations, thanks in large part to @glandium setting up continuous + integration via AppVeyor (and Travis CI for Linux and OS X). + + New features: + - Add "J" (JSON) support to malloc_stats_print(). (@jasone) + - Add Cray compiler support. (@ronawho) + + Optimizations: + - Add/use adaptive spinning for bootstrapping and radix tree node + initialization. (@jasone) + + Bug fixes: + - Fix large allocation to search starting in the optimal size class heap, + which can substantially reduce virtual memory churn and fragmentation. This + regression was first released in 4.0.0. (@mjp41, @jasone) + - Fix stats.arenas..nthreads accounting. (@interwq) + - Fix and simplify decay-based purging. (@jasone) + - Make DSS (sbrk(2)-related) operations lockless, which resolves potential + deadlocks during thread exit. (@jasone) + - Fix over-sized allocation of radix tree leaf nodes. (@mjp41, @ogaun, + @jasone) + - Fix over-sized allocation of arena_t (plus associated stats) data + structures. (@jasone, @interwq) + - Fix EXTRA_CFLAGS to not affect configuration. (@jasone) + - Fix a Valgrind integration bug. (@ronawho) + - Disallow 0x5a junk filling when running in Valgrind. (@jasone) + - Fix a file descriptor leak on Linux. This regression was first released in + 4.2.0. (@vsarunas, @jasone) + - Fix static linking of jemalloc with glibc. (@djwatson) + - Use syscall(2) rather than {open,read,close}(2) during boot on Linux. This + works around other libraries' system call wrappers performing reentrant + allocation. (@kspinka, @Whissi, @jasone) + - Fix OS X default zone replacement to work with OS X 10.12. (@glandium, + @jasone) + - Fix cached memory management to avoid needless commit/decommit operations + during purging, which resolves permanent virtual memory map fragmentation + issues on Windows. (@mjp41, @jasone) + - Fix TSD fetches to avoid (recursive) allocation. This is relevant to + non-TLS and Windows configurations. (@jasone) + - Fix malloc_conf overriding to work on Windows. (@jasone) + - Forcibly disable lazy-lock on Windows (was forcibly *enabled*). (@jasone) + * 4.2.1 (June 8, 2016) Bug fixes: Modified: head/contrib/jemalloc/FREEBSD-Xlist ============================================================================== --- head/contrib/jemalloc/FREEBSD-Xlist Wed Nov 9 18:00:50 2016 (r308472) +++ head/contrib/jemalloc/FREEBSD-Xlist Wed Nov 9 18:42:30 2016 (r308473) @@ -1,6 +1,8 @@ $FreeBSD$ +.appveyor.yml .autom4te.cfg .git* +.travis.yml FREEBSD-* INSTALL Makefile* Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Wed Nov 9 18:00:50 2016 (r308472) +++ head/contrib/jemalloc/FREEBSD-diffs Wed Nov 9 18:42:30 2016 (r308473) @@ -1,11 +1,11 @@ diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in -index c4a44e3..4626e9b 100644 +index 3d2e721..b361db2 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in @@ -53,11 +53,23 @@ This manual describes jemalloc @jemalloc_version@. More information can be found at the jemalloc website. + url="http://jemalloc.net/">jemalloc website. + + The following configuration options are enabled in libc's built-in + jemalloc: , @@ -27,30 +27,30 @@ index c4a44e3..4626e9b 100644 Standard API -@@ -2961,4 +2973,18 @@ malloc_conf = "lg_chunk:24";]]> - The posix_memalign function conforms - to IEEE Std 1003.1-2001 (“POSIX.1”). +@@ -2963,4 +2975,18 @@ malloc_conf = "lg_chunk:24";]]> + The posix_memalign() function conforms + to IEEE Std 1003.1-2001 (POSIX.1). + + HISTORY -+ The malloc_usable_size and -+ posix_memalign functions first appeared in -+ FreeBSD 7.0. -+ -+ The aligned_alloc, -+ malloc_stats_print, and -+ mallctl* functions first appeared in -+ FreeBSD 10.0. ++ The malloc_usable_size() and ++ posix_memalign() functions first appeared in FreeBSD ++ 7.0. ++ ++ The aligned_alloc(), ++ malloc_stats_print(), and ++ mallctl*() functions first appeared in FreeBSD ++ 10.0. + -+ The *allocx functions first appeared -+ in FreeBSD 11.0. ++ The *allocx() functions first appeared in FreeBSD ++ 11.0. + diff --git a/include/jemalloc/internal/arena.h b/include/jemalloc/internal/arena.h -index b1de2b6..da6b6d2 100644 +index f39ce54..a3ba55d 100644 --- a/include/jemalloc/internal/arena.h +++ b/include/jemalloc/internal/arena.h -@@ -718,8 +718,13 @@ arena_miscelm_get_mutable(arena_chunk_t *chunk, size_t pageind) +@@ -719,8 +719,13 @@ arena_miscelm_get_mutable(arena_chunk_t *chunk, size_t pageind) JEMALLOC_ALWAYS_INLINE const arena_chunk_map_misc_t * arena_miscelm_get_const(const arena_chunk_t *chunk, size_t pageind) { @@ -64,7 +64,7 @@ index b1de2b6..da6b6d2 100644 } JEMALLOC_ALWAYS_INLINE size_t -@@ -778,8 +783,13 @@ arena_mapbitsp_get_mutable(arena_chunk_t *chunk, size_t pageind) +@@ -779,8 +784,13 @@ arena_mapbitsp_get_mutable(arena_chunk_t *chunk, size_t pageind) JEMALLOC_ALWAYS_INLINE const size_t * arena_mapbitsp_get_const(const arena_chunk_t *chunk, size_t pageind) { @@ -79,7 +79,7 @@ index b1de2b6..da6b6d2 100644 JEMALLOC_ALWAYS_INLINE size_t diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in -index 8f82edd..78e2df2 100644 +index fdc8fef..56a35a4 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -8,6 +8,9 @@ @@ -108,7 +108,7 @@ index 8f82edd..78e2df2 100644 static const bool config_prof = #ifdef JEMALLOC_PROF diff --git a/include/jemalloc/internal/jemalloc_internal_decls.h b/include/jemalloc/internal/jemalloc_internal_decls.h -index 2b8ca5d..42d97f2 100644 +index c907d91..4626632 100644 --- a/include/jemalloc/internal/jemalloc_internal_decls.h +++ b/include/jemalloc/internal/jemalloc_internal_decls.h @@ -1,6 +1,9 @@ @@ -122,10 +122,10 @@ index 2b8ca5d..42d97f2 100644 #ifdef _WIN32 # include diff --git a/include/jemalloc/internal/mutex.h b/include/jemalloc/internal/mutex.h -index 5221799..60ab041 100644 +index b442d2d..76518db 100644 --- a/include/jemalloc/internal/mutex.h +++ b/include/jemalloc/internal/mutex.h -@@ -52,9 +52,6 @@ struct malloc_mutex_s { +@@ -57,9 +57,6 @@ struct malloc_mutex_s { #ifdef JEMALLOC_LAZY_LOCK extern bool isthreaded; @@ -135,7 +135,7 @@ index 5221799..60ab041 100644 #endif bool malloc_mutex_init(malloc_mutex_t *mutex, const char *name, -@@ -62,6 +59,7 @@ bool malloc_mutex_init(malloc_mutex_t *mutex, const char *name, +@@ -67,6 +64,7 @@ bool malloc_mutex_init(malloc_mutex_t *mutex, const char *name, void malloc_mutex_prefork(tsdn_t *tsdn, malloc_mutex_t *mutex); void malloc_mutex_postfork_parent(tsdn_t *tsdn, malloc_mutex_t *mutex); void malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex); @@ -144,10 +144,10 @@ index 5221799..60ab041 100644 #endif /* JEMALLOC_H_EXTERNS */ diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt -index f2b6a55..69369c9 100644 +index 87c8c9b..df576f6 100644 --- a/include/jemalloc/internal/private_symbols.txt +++ b/include/jemalloc/internal/private_symbols.txt -@@ -311,7 +311,6 @@ iralloct_realign +@@ -307,7 +307,6 @@ iralloct_realign isalloc isdalloct isqalloc @@ -335,7 +335,7 @@ index f943891..47d032c 100755 +#include "jemalloc_FreeBSD.h" EOF diff --git a/src/jemalloc.c b/src/jemalloc.c -index 5d1f493..46dd1d1 100644 +index 38650ff..f659b55 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -4,6 +4,10 @@ @@ -347,9 +347,9 @@ index 5d1f493..46dd1d1 100644 +__sym_compat(_malloc_options, __malloc_options_1_0, FBSD_1.0); + /* Runtime configuration options. */ - const char *je_malloc_conf JEMALLOC_ATTR(weak); - bool opt_abort = -@@ -2673,6 +2677,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr) + const char *je_malloc_conf + #ifndef _WIN32 +@@ -2756,6 +2760,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr) */ /******************************************************************************/ /* @@ -457,7 +457,7 @@ index 5d1f493..46dd1d1 100644 * The following functions are used by threading libraries for protection of * malloc during fork(). */ -@@ -2814,4 +2919,11 @@ jemalloc_postfork_child(void) +@@ -2894,4 +2999,11 @@ jemalloc_postfork_child(void) ctl_postfork_child(tsd_tsdn(tsd)); } @@ -470,7 +470,7 @@ index 5d1f493..46dd1d1 100644 + /******************************************************************************/ diff --git a/src/mutex.c b/src/mutex.c -index a1fac34..a24e420 100644 +index 6333e73..13f8d79 100644 --- a/src/mutex.c +++ b/src/mutex.c @@ -66,6 +66,17 @@ pthread_create(pthread_t *__restrict thread, @@ -491,7 +491,7 @@ index a1fac34..a24e420 100644 #endif bool -@@ -140,7 +151,7 @@ malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex) +@@ -142,7 +153,7 @@ malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex) } bool @@ -500,7 +500,7 @@ index a1fac34..a24e420 100644 { #ifdef JEMALLOC_MUTEX_INIT_CB -@@ -154,3 +165,14 @@ malloc_mutex_boot(void) +@@ -156,3 +167,14 @@ malloc_mutex_boot(void) #endif return (false); } @@ -516,7 +516,7 @@ index a1fac34..a24e420 100644 +#endif +} diff --git a/src/util.c b/src/util.c -index a1c4a2a..04f9153 100644 +index 7905267..bee1c77 100644 --- a/src/util.c +++ b/src/util.c @@ -67,6 +67,22 @@ wrtmessage(void *cbopaque, const char *s) Modified: head/contrib/jemalloc/VERSION ============================================================================== --- head/contrib/jemalloc/VERSION Wed Nov 9 18:00:50 2016 (r308472) +++ head/contrib/jemalloc/VERSION Wed Nov 9 18:42:30 2016 (r308473) @@ -1 +1 @@ -4.2.1-0-g3de035335255d553bdb344c32ffdb603816195d8 +4.3.1-0-g0110fa8451af905affd77c3bea0d545fee2251b2 Modified: head/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- head/contrib/jemalloc/doc/jemalloc.3 Wed Nov 9 18:00:50 2016 (r308472) +++ head/contrib/jemalloc/doc/jemalloc.3 Wed Nov 9 18:42:30 2016 (r308473) @@ -2,12 +2,12 @@ .\" Title: JEMALLOC .\" Author: Jason Evans .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 06/08/2016 +.\" Date: 11/08/2016 .\" Manual: User Manual -.\" Source: jemalloc 4.2.1-0-g3de035335255d553bdb344c32ffdb603816195d8 +.\" Source: jemalloc 4.3.1-0-g0110fa8451af905affd77c3bea0d545fee2251b2 .\" Language: English .\" -.TH "JEMALLOC" "3" "06/08/2016" "jemalloc 4.2.1-0-g3de035335255" "User Manual" +.TH "JEMALLOC" "3" "11/08/2016" "jemalloc 4.3.1-0-g0110fa8451af" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,7 +31,7 @@ jemalloc \- general purpose memory allocation functions .SH "LIBRARY" .PP -This manual describes jemalloc 4\&.2\&.1\-0\-g3de035335255d553bdb344c32ffdb603816195d8\&. More information can be found at the +This manual describes jemalloc 4\&.3\&.1\-0\-g0110fa8451af905affd77c3bea0d545fee2251b2\&. More information can be found at the \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&. .PP The following configuration options are enabled in libc\*(Aqs built\-in jemalloc: @@ -101,26 +101,26 @@ const char *\fImalloc_conf\fR; .SS "Standard API" .PP The -\fBmalloc\fR\fB\fR +malloc() function allocates \fIsize\fR bytes of uninitialized memory\&. The allocated space is suitably aligned (after possible pointer coercion) for storage of any type of object\&. .PP The -\fBcalloc\fR\fB\fR +calloc() function allocates space for \fInumber\fR objects, each \fIsize\fR bytes in length\&. The result is identical to calling -\fBmalloc\fR\fB\fR +malloc() with an argument of \fInumber\fR * \fIsize\fR, with the exception that the allocated memory is explicitly initialized to zero bytes\&. .PP The -\fBposix_memalign\fR\fB\fR +posix_memalign() function allocates \fIsize\fR bytes of memory such that the allocation\*(Aqs base address is a multiple of @@ -131,7 +131,7 @@ must be a power of 2 at least as large a sizeof(\fBvoid *\fR)\&. .PP The -\fBaligned_alloc\fR\fB\fR +aligned_alloc() function allocates \fIsize\fR bytes of memory such that the allocation\*(Aqs base address is a multiple of @@ -143,7 +143,7 @@ is not an integral multiple of \fIalignment\fR\&. .PP The -\fBrealloc\fR\fB\fR +realloc() function changes the size of the previously allocated memory referenced by \fIptr\fR to @@ -151,19 +151,19 @@ to bytes\&. The contents of the memory are unchanged up to the lesser of the new and old sizes\&. If the new size is larger, the contents of the newly allocated portion of the memory are undefined\&. Upon success, the memory referenced by \fIptr\fR is freed and a pointer to the newly allocated memory is returned\&. Note that -\fBrealloc\fR\fB\fR +realloc() may move the memory allocation, resulting in a different return value than \fIptr\fR\&. If \fIptr\fR is \fBNULL\fR, the -\fBrealloc\fR\fB\fR +realloc() function behaves identically to -\fBmalloc\fR\fB\fR +malloc() for the specified size\&. .PP The -\fBfree\fR\fB\fR +free() function causes the allocated memory referenced by \fIptr\fR to be made available for future allocations\&. If @@ -173,13 +173,13 @@ is .SS "Non\-standard API" .PP The -\fBmallocx\fR\fB\fR, -\fBrallocx\fR\fB\fR, -\fBxallocx\fR\fB\fR, -\fBsallocx\fR\fB\fR, -\fBdallocx\fR\fB\fR, -\fBsdallocx\fR\fB\fR, and -\fBnallocx\fR\fB\fR +mallocx(), +rallocx(), +xallocx(), +sallocx(), +dallocx(), +sdallocx(), and +nallocx() functions all have a \fIflags\fR argument that can be used to specify options\&. The functions only check the options that are contextually relevant\&. Use bitwise or (|) operations to specify one or more of the following: @@ -211,7 +211,7 @@ Initialize newly allocated memory to con .RS 4 Use the thread\-specific cache (tcache) specified by the identifier \fItc\fR, which must have been acquired via the -"tcache\&.create" +tcache\&.create mallctl\&. This macro does not validate that \fItc\fR specifies a valid identifier\&. @@ -238,7 +238,7 @@ specifies an arena index in the valid ra .RE .PP The -\fBmallocx\fR\fB\fR +mallocx() function allocates at least \fIsize\fR bytes of memory, and returns a pointer to the base address of the allocation\&. Behavior is undefined if @@ -247,7 +247,7 @@ is \fB0\fR\&. .PP The -\fBrallocx\fR\fB\fR +rallocx() function resizes the allocation at \fIptr\fR to be at least @@ -258,7 +258,7 @@ is \fB0\fR\&. .PP The -\fBxallocx\fR\fB\fR +xallocx() function resizes the allocation at \fIptr\fR in place to be at least @@ -274,33 +274,33 @@ is (\fIsize\fR + \fIextra\fR > \fBSIZE_T_MAX\fR)\&. .PP The -\fBsallocx\fR\fB\fR +sallocx() function returns the real size of the allocation at \fIptr\fR\&. .PP The -\fBdallocx\fR\fB\fR +dallocx() function causes the memory referenced by \fIptr\fR to be made available for future allocations\&. .PP The -\fBsdallocx\fR\fB\fR +sdallocx() function is an extension of -\fBdallocx\fR\fB\fR +dallocx() with a \fIsize\fR parameter to allow the caller to pass in the allocation size as an optimization\&. The minimum valid input size is the original requested size of the allocation, and the maximum valid input size is the corresponding value returned by -\fBnallocx\fR\fB\fR +nallocx() or -\fBsallocx\fR\fB\fR\&. +sallocx()\&. .PP The -\fBnallocx\fR\fB\fR +nallocx() function allocates no memory, but it performs the same size computation as the -\fBmallocx\fR\fB\fR +mallocx() function, and returns the real size of the allocation that would result from the equivalent -\fBmallocx\fR\fB\fR +mallocx() function call, or \fB0\fR if the inputs exceed the maximum supported size class and/or alignment\&. Behavior is undefined if @@ -309,7 +309,7 @@ is \fB0\fR\&. .PP The -\fBmallctl\fR\fB\fR +mallctl() function provides a general interface for introspecting the memory allocator, as well as setting modifiable parameters and triggering actions\&. The period\-separated \fIname\fR argument specifies a location in a tree\-structured namespace; see the @@ -328,10 +328,12 @@ and \fB0\fR\&. .PP The -\fBmallctlnametomib\fR\fB\fR -function provides a way to avoid repeated name lookups for applications that repeatedly query the same portion of the namespace, by translating a name to a \(lqManagement Information Base\(rq (MIB) that can be passed repeatedly to -\fBmallctlbymib\fR\fB\fR\&. Upon successful return from -\fBmallctlnametomib\fR\fB\fR, +mallctlnametomib() +function provides a way to avoid repeated name lookups for applications that repeatedly query the same portion of the namespace, by translating a name to a +\(lqManagement Information Base\(rq +(MIB) that can be passed repeatedly to +mallctlbymib()\&. Upon successful return from +mallctlnametomib(), \fImibp\fR contains an array of \fI*miblenp\fR @@ -343,7 +345,7 @@ and the input value of \fI*miblenp\fR\&. Thus it is possible to pass a \fI*miblenp\fR that is smaller than the number of period\-separated name components, which results in a partial MIB that can be used as the basis for constructing a complete MIB\&. For name components that are integers (e\&.g\&. the 2 in -"arenas\&.bin\&.2\&.size"), the corresponding MIB component will always be that integer\&. Therefore, it is legitimate to construct code like the following: +arenas\&.bin\&.2\&.size), the corresponding MIB component will always be that integer\&. Therefore, it is legitimate to construct code like the following: .sp .if n \{\ .RS 4 @@ -372,35 +374,50 @@ for (i = 0; i < nbins; i++) { .\} .PP The -\fBmalloc_stats_print\fR\fB\fR -function writes human\-readable summary statistics via the +malloc_stats_print() +function writes summary statistics via the \fIwrite_cb\fR callback function pointer and \fIcbopaque\fR data passed to \fIwrite_cb\fR, or -\fBmalloc_message\fR\fB\fR +malloc_message() if \fIwrite_cb\fR is -\fBNULL\fR\&. This function can be called repeatedly\&. General information that never changes during execution can be omitted by specifying "g" as a character within the +\fBNULL\fR\&. The statistics are presented in human\-readable form unless +\(lqJ\(rq +is specified as a character within the +\fIopts\fR +string, in which case the statistics are presented in +\m[blue]\fBJSON format\fR\m[]\&\s-2\u[2]\d\s+2\&. This function can be called repeatedly\&. General information that never changes during execution can be omitted by specifying +\(lqg\(rq +as a character within the \fIopts\fR string\&. Note that -\fBmalloc_message\fR\fB\fR +malloc_message() uses the -\fBmallctl*\fR\fB\fR +mallctl*() functions internally, so inconsistent statistics can be reported if multiple threads use these functions simultaneously\&. If \fB\-\-enable\-stats\fR -is specified during configuration, \(lqm\(rq and \(lqa\(rq can be specified to omit merged arena and per arena statistics, respectively; \(lqb\(rq, \(lql\(rq, and \(lqh\(rq can be specified to omit per size class statistics for bins, large objects, and huge objects, respectively\&. Unrecognized characters are silently ignored\&. Note that thread caching may prevent some statistics from being completely up to date, since extra locking would be required to merge counters that track thread cache operations\&. +is specified during configuration, +\(lqm\(rq +and +\(lqa\(rq +can be specified to omit merged arena and per arena statistics, respectively; +\(lqb\(rq, +\(lql\(rq, and +\(lqh\(rq +can be specified to omit per size class statistics for bins, large objects, and huge objects, respectively\&. Unrecognized characters are silently ignored\&. Note that thread caching may prevent some statistics from being completely up to date, since extra locking would be required to merge counters that track thread cache operations\&. .PP The -\fBmalloc_usable_size\fR\fB\fR +malloc_usable_size() function returns the usable size of the allocation pointed to by \fIptr\fR\&. The return value may be larger than the size that was requested during allocation\&. The -\fBmalloc_usable_size\fR\fB\fR +malloc_usable_size() function is not a mechanism for in\-place -\fBrealloc\fR\fB\fR; rather it is provided solely as a tool for introspection purposes\&. Any discrepancy between the requested allocation size and the size reported by -\fBmalloc_usable_size\fR\fB\fR +realloc(); rather it is provided solely as a tool for introspection purposes\&. Any discrepancy between the requested allocation size and the size reported by +malloc_usable_size() should not be depended on, since such behavior is entirely implementation\-dependent\&. .SH "TUNING" .PP @@ -408,12 +425,14 @@ Once, when the first call is made to one .PP The string specified via \fB\-\-with\-malloc\-conf\fR, the string pointed to by the global variable -\fImalloc_conf\fR, the \(lqname\(rq of the file referenced by the symbolic link named +\fImalloc_conf\fR, the +\(lqname\(rq +of the file referenced by the symbolic link named /etc/malloc\&.conf, and the value of the environment variable \fBMALLOC_CONF\fR, will be interpreted, in that order, from left to right as options\&. Note that \fImalloc_conf\fR may be read before -\fBmain\fR\fB\fR +main() is entered, so the declaration of \fImalloc_conf\fR should specify an initializer that contains the final value to be read by jemalloc\&. @@ -427,15 +446,15 @@ and can be safely set any time prior to program invocation\&. .PP An options string is a comma\-separated list of option:value pairs\&. There is one key corresponding to each -"opt\&.*" +opt\&.* mallctl (see the MALLCTL NAMESPACE section for options documentation)\&. For example, abort:true,narenas:1 sets the -"opt\&.abort" +opt\&.abort and -"opt\&.narenas" +opt\&.narenas options\&. Some options have boolean values (true/false), others have integer values (base 8, 10, or 16, depending on prefix), and yet others have raw string values\&. .SH "IMPLEMENTATION NOTES" .PP @@ -460,22 +479,22 @@ Memory is conceptually broken into equal .PP Small objects are managed in groups by page runs\&. Each run maintains a bitmap to track which regions are in use\&. Allocation requests that are no more than half the quantum (8 or 16, depending on architecture) are rounded up to the nearest power of two that is at least sizeof(\fBdouble\fR)\&. All other object size classes are multiples of the quantum, spaced such that there are four size classes for each doubling in size, which limits internal fragmentation to approximately 20% for all but the smallest size classes\&. Small size classes are smaller than four times the page size, large size classes are smaller than the chunk size (see the -"opt\&.lg_chunk" +opt\&.lg_chunk option), and huge size classes extend from the chunk size up to the largest size class that does not exceed \fBPTRDIFF_MAX\fR\&. .PP Allocations are packed tightly together, which can be an issue for multi\-threaded applications\&. If you need to assure that allocations do not suffer from cacheline sharing, round your allocation requests up to the nearest multiple of the cacheline size, or specify cacheline alignment when allocating\&. .PP The -\fBrealloc\fR\fB\fR, -\fBrallocx\fR\fB\fR, and -\fBxallocx\fR\fB\fR +realloc(), +rallocx(), and +xallocx() functions may resize allocations without moving them under limited circumstances\&. Unlike the -\fB*allocx\fR\fB\fR +*allocx() API, the standard API does not officially round up the usable size of an allocation to the nearest size class, so technically it is necessary to call -\fBrealloc\fR\fB\fR +realloc() to grow e\&.g\&. a 9\-byte allocation to 16 bytes, or shrink a 16\-byte allocation to 9 bytes\&. Growth and shrinkage trivially succeeds in place as long as the pre\-size and post\-size both round up to the same size class\&. No other API guarantees are made regarding in\-place resizing, but the current implementation also tries to resize large and huge allocations in place, as long as the pre\-size and post\-size are both large or both huge\&. In such cases shrinkage always succeeds for large size classes, but for huge size classes the chunk allocator must support splitting (see -"arena\&.\&.chunk_hooks")\&. Growth only succeeds if the trailing memory is currently available, and additionally for huge size classes the chunk allocator must support merging\&. +arena\&.\&.chunk_hooks)\&. Growth only succeeds if the trailing memory is currently available, and additionally for huge size classes the chunk allocator must support merging\&. .PP Assuming 2 MiB chunks, 4 KiB pages, and a 16\-byte quantum on a 64\-bit system, the size classes in each category are as shown in Table 1\&. @@ -663,7 +682,7 @@ T} .SH "MALLCTL NAMESPACE" .PP The following names are defined in the namespace accessible via the -\fBmallctl*\fR\fB\fR +mallctl*() functions\&. Value types are specified in parentheses, their readable/writable statuses are encoded as rw, r\-, @@ -673,118 +692,118 @@ r\-, or indicates an integer component, where the integer varies from 0 to some upper value that must be determined via introspection\&. In the case of -"stats\&.arenas\&.\&.*", +stats\&.arenas\&.\&.*, equal to -"arenas\&.narenas" +arenas\&.narenas can be used to access the summation of statistics from all arenas\&. Take special note of the -"epoch" +epoch mallctl, which controls refreshing of cached dynamic statistics\&. .PP -"version" (\fBconst char *\fR) r\- +version (\fBconst char *\fR) r\- .RS 4 Return the jemalloc version string\&. .RE .PP -"epoch" (\fBuint64_t\fR) rw +epoch (\fBuint64_t\fR) rw .RS 4 If a value is passed in, refresh the data from which the -\fBmallctl*\fR\fB\fR +mallctl*() functions report values, and increment the epoch\&. Return the current epoch\&. This is useful for detecting whether another thread caused a refresh\&. .RE .PP -"config\&.cache_oblivious" (\fBbool\fR) r\- +config\&.cache_oblivious (\fBbool\fR) r\- .RS 4 \fB\-\-enable\-cache\-oblivious\fR was specified during build configuration\&. .RE .PP -"config\&.debug" (\fBbool\fR) r\- +config\&.debug (\fBbool\fR) r\- .RS 4 \fB\-\-enable\-debug\fR was specified during build configuration\&. .RE .PP -"config\&.fill" (\fBbool\fR) r\- +config\&.fill (\fBbool\fR) r\- .RS 4 \fB\-\-enable\-fill\fR was specified during build configuration\&. .RE .PP -"config\&.lazy_lock" (\fBbool\fR) r\- +config\&.lazy_lock (\fBbool\fR) r\- .RS 4 \fB\-\-enable\-lazy\-lock\fR was specified during build configuration\&. .RE .PP -"config\&.malloc_conf" (\fBconst char *\fR) r\- +config\&.malloc_conf (\fBconst char *\fR) r\- .RS 4 Embedded configure\-time\-specified run\-time options string, empty unless \fB\-\-with\-malloc\-conf\fR was specified during build configuration\&. .RE .PP -"config\&.munmap" (\fBbool\fR) r\- +config\&.munmap (\fBbool\fR) r\- .RS 4 \fB\-\-enable\-munmap\fR was specified during build configuration\&. .RE .PP -"config\&.prof" (\fBbool\fR) r\- +config\&.prof (\fBbool\fR) r\- .RS 4 \fB\-\-enable\-prof\fR was specified during build configuration\&. .RE .PP -"config\&.prof_libgcc" (\fBbool\fR) r\- +config\&.prof_libgcc (\fBbool\fR) r\- .RS 4 \fB\-\-disable\-prof\-libgcc\fR was not specified during build configuration\&. .RE .PP -"config\&.prof_libunwind" (\fBbool\fR) r\- +config\&.prof_libunwind (\fBbool\fR) r\- .RS 4 \fB\-\-enable\-prof\-libunwind\fR was specified during build configuration\&. .RE .PP -"config\&.stats" (\fBbool\fR) r\- +config\&.stats (\fBbool\fR) r\- .RS 4 \fB\-\-enable\-stats\fR was specified during build configuration\&. .RE .PP -"config\&.tcache" (\fBbool\fR) r\- +config\&.tcache (\fBbool\fR) r\- .RS 4 \fB\-\-disable\-tcache\fR was not specified during build configuration\&. .RE .PP -"config\&.tls" (\fBbool\fR) r\- +config\&.tls (\fBbool\fR) r\- .RS 4 \fB\-\-disable\-tls\fR was not specified during build configuration\&. .RE .PP -"config\&.utrace" (\fBbool\fR) r\- +config\&.utrace (\fBbool\fR) r\- .RS 4 \fB\-\-enable\-utrace\fR was specified during build configuration\&. .RE .PP -"config\&.valgrind" (\fBbool\fR) r\- +config\&.valgrind (\fBbool\fR) r\- .RS 4 \fB\-\-enable\-valgrind\fR was specified during build configuration\&. .RE .PP -"config\&.xmalloc" (\fBbool\fR) r\- +config\&.xmalloc (\fBbool\fR) r\- .RS 4 \fB\-\-enable\-xmalloc\fR was specified during build configuration\&. .RE .PP -"opt\&.abort" (\fBbool\fR) r\- +opt\&.abort (\fBbool\fR) r\- .RS 4 Abort\-on\-warning enabled/disabled\&. If true, most warnings are fatal\&. The process will call \fBabort\fR(3) @@ -793,115 +812,132 @@ in these cases\&. This option is disable is specified during configuration, in which case it is enabled by default\&. .RE .PP -"opt\&.dss" (\fBconst char *\fR) r\- +opt\&.dss (\fBconst char *\fR) r\- .RS 4 dss (\fBsbrk\fR(2)) allocation precedence as related to \fBmmap\fR(2) allocation\&. The following settings are supported if \fBsbrk\fR(2) -is supported by the operating system: \(lqdisabled\(rq, \(lqprimary\(rq, and \(lqsecondary\(rq; otherwise only \(lqdisabled\(rq is supported\&. The default is \(lqsecondary\(rq if +is supported by the operating system: +\(lqdisabled\(rq, +\(lqprimary\(rq, and +\(lqsecondary\(rq; otherwise only +\(lqdisabled\(rq +is supported\&. The default is +\(lqsecondary\(rq +if \fBsbrk\fR(2) -is supported by the operating system; \(lqdisabled\(rq otherwise\&. +is supported by the operating system; +\(lqdisabled\(rq +otherwise\&. .RE .PP -"opt\&.lg_chunk" (\fBsize_t\fR) r\- +opt\&.lg_chunk (\fBsize_t\fR) r\- .RS 4 Virtual memory chunk size (log base 2)\&. If a chunk size outside the supported size range is specified, the size is silently clipped to the minimum/maximum supported size\&. The default chunk size is 2 MiB (2^21)\&. .RE .PP -"opt\&.narenas" (\fBunsigned\fR) r\- +opt\&.narenas (\fBunsigned\fR) r\- .RS 4 Maximum number of arenas to use for automatic multiplexing of threads and arenas\&. The default is four times the number of CPUs, or one if there is a single CPU\&. .RE .PP -"opt\&.purge" (\fBconst char *\fR) r\- +opt\&.purge (\fBconst char *\fR) r\- .RS 4 Purge mode is \(lqratio\(rq (default) or \(lqdecay\(rq\&. See -"opt\&.lg_dirty_mult" +opt\&.lg_dirty_mult for details of the ratio mode\&. See -"opt\&.decay_time" +opt\&.decay_time for details of the decay mode\&. .RE .PP -"opt\&.lg_dirty_mult" (\fBssize_t\fR) r\- +opt\&.lg_dirty_mult (\fBssize_t\fR) r\- .RS 4 Per\-arena minimum ratio (log base 2) of active to dirty pages\&. Some dirty unused pages may be allowed to accumulate, within the limit set by the ratio (or one chunk worth of dirty pages, whichever is greater), before informing the kernel about some of those pages via \fBmadvise\fR(2) or a similar system call\&. This provides the kernel with sufficient information to recycle dirty pages if physical memory becomes scarce and the pages remain unused\&. The default minimum ratio is 8:1 (2^3:1); an option value of \-1 will disable dirty page purging\&. See -"arenas\&.lg_dirty_mult" +arenas\&.lg_dirty_mult and -"arena\&.\&.lg_dirty_mult" +arena\&.\&.lg_dirty_mult for related dynamic control options\&. .RE .PP -"opt\&.decay_time" (\fBssize_t\fR) r\- +opt\&.decay_time (\fBssize_t\fR) r\- .RS 4 Approximate time in seconds from the creation of a set of unused dirty pages until an equivalent set of unused dirty pages is purged and/or reused\&. The pages are incrementally purged according to a sigmoidal decay curve that starts and ends with zero purge rate\&. A decay time of 0 causes all unused dirty pages to be purged immediately upon creation\&. A decay time of \-1 disables purging\&. The default decay time is 10 seconds\&. See -"arenas\&.decay_time" +arenas\&.decay_time and -"arena\&.\&.decay_time" +arena\&.\&.decay_time for related dynamic control options\&. .RE .PP -"opt\&.stats_print" (\fBbool\fR) r\- +opt\&.stats_print (\fBbool\fR) r\- .RS 4 Enable/disable statistics printing at exit\&. If enabled, the -\fBmalloc_stats_print\fR\fB\fR +malloc_stats_print() function is called at program exit via an \fBatexit\fR(3) function\&. If \fB\-\-enable\-stats\fR is specified during configuration, this has the potential to cause deadlock for a multi\-threaded process that exits while one or more threads are executing in the memory allocation functions\&. Furthermore, -\fBatexit\fR\fB\fR +atexit() may allocate memory during application initialization and then deadlock internally when jemalloc in turn calls -\fBatexit\fR\fB\fR, so this option is not universally usable (though the application can register its own -\fBatexit\fR\fB\fR +atexit(), so this option is not universally usable (though the application can register its own +atexit() function with equivalent functionality)\&. Therefore, this option should only be used with care; it is primarily intended as a performance tuning aid during application development\&. This option is disabled by default\&. .RE .PP -"opt\&.junk" (\fBconst char *\fR) r\- [\fB\-\-enable\-fill\fR] +opt\&.junk (\fBconst char *\fR) r\- [\fB\-\-enable\-fill\fR] .RS 4 -Junk filling\&. If set to "alloc", each byte of uninitialized allocated memory will be initialized to -0xa5\&. If set to "free", all deallocated memory will be initialized to -0x5a\&. If set to "true", both allocated and deallocated memory will be initialized, and if set to "false", junk filling be disabled entirely\&. This is intended for debugging and will impact performance negatively\&. This option is "false" by default unless +Junk filling\&. If set to +\(lqalloc\(rq, each byte of uninitialized allocated memory will be initialized to +0xa5\&. If set to +\(lqfree\(rq, all deallocated memory will be initialized to +0x5a\&. If set to +\(lqtrue\(rq, both allocated and deallocated memory will be initialized, and if set to +\(lqfalse\(rq, junk filling be disabled entirely\&. This is intended for debugging and will impact performance negatively\&. This option is +\(lqfalse\(rq +by default unless \fB\-\-enable\-debug\fR -is specified during configuration, in which case it is "true" by default unless running inside -\m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2\&. +is specified during configuration, in which case it is +\(lqtrue\(rq +by default unless running inside +\m[blue]\fBValgrind\fR\m[]\&\s-2\u[3]\d\s+2\&. .RE .PP -"opt\&.quarantine" (\fBsize_t\fR) r\- [\fB\-\-enable\-fill\fR] +opt\&.quarantine (\fBsize_t\fR) r\- [\fB\-\-enable\-fill\fR] .RS 4 Per thread quarantine size in bytes\&. If non\-zero, each thread maintains a FIFO object quarantine that stores up to the specified number of bytes of memory\&. The quarantined memory is not freed until it is released from quarantine, though it is immediately junk\-filled if the -"opt\&.junk" +opt\&.junk option is enabled\&. This feature is of particular use in combination with -\m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2, which can detect attempts to access quarantined objects\&. This is intended for debugging and will impact performance negatively\&. The default quarantine size is 0 unless running inside Valgrind, in which case the default is 16 MiB\&. +\m[blue]\fBValgrind\fR\m[]\&\s-2\u[3]\d\s+2, which can detect attempts to access quarantined objects\&. This is intended for debugging and will impact performance negatively\&. The default quarantine size is 0 unless running inside Valgrind, in which case the default is 16 MiB\&. .RE .PP -"opt\&.redzone" (\fBbool\fR) r\- [\fB\-\-enable\-fill\fR] +opt\&.redzone (\fBbool\fR) r\- [\fB\-\-enable\-fill\fR] .RS 4 Redzones enabled/disabled\&. If enabled, small allocations have redzones before and after them\&. Furthermore, if the -"opt\&.junk" +opt\&.junk option is enabled, the redzones are checked for corruption during deallocation\&. However, the primary intended purpose of this feature is to be used in combination with -\m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2, which needs redzones in order to do effective buffer overflow/underflow detection\&. This option is intended for debugging and will impact performance negatively\&. This option is disabled by default unless running inside Valgrind\&. +\m[blue]\fBValgrind\fR\m[]\&\s-2\u[3]\d\s+2, which needs redzones in order to do effective buffer overflow/underflow detection\&. This option is intended for debugging and will impact performance negatively\&. This option is disabled by default unless running inside Valgrind\&. .RE .PP -"opt\&.zero" (\fBbool\fR) r\- [\fB\-\-enable\-fill\fR] +opt\&.zero (\fBbool\fR) r\- [\fB\-\-enable\-fill\fR] .RS 4 Zero filling enabled/disabled\&. If enabled, each byte of uninitialized allocated memory will be initialized to 0\&. Note that this initialization only happens once for each byte, so -\fBrealloc\fR\fB\fR +realloc() and -\fBrallocx\fR\fB\fR +rallocx() calls do not zero memory that was previously allocated\&. This is intended for debugging and will impact performance negatively\&. This option is disabled by default\&. .RE .PP -"opt\&.utrace" (\fBbool\fR) r\- [\fB\-\-enable\-utrace\fR] +opt\&.utrace (\fBbool\fR) r\- [\fB\-\-enable\-utrace\fR] .RS 4 Allocation tracing based on \fButrace\fR(2) enabled/disabled\&. This option is disabled by default\&. .RE .PP -"opt\&.xmalloc" (\fBbool\fR) r\- [\fB\-\-enable\-xmalloc\fR] +opt\&.xmalloc (\fBbool\fR) r\- [\fB\-\-enable\-xmalloc\fR] .RS 4 Abort\-on\-out\-of\-memory enabled/disabled\&. If enabled, rather than returning failure for any allocation function, display a diagnostic message on \fBSTDERR_FILENO\fR @@ -921,94 +957,94 @@ malloc_conf = "xmalloc:true"; This option is disabled by default\&. .RE .PP -"opt\&.tcache" (\fBbool\fR) r\- [\fB\-\-enable\-tcache\fR] +opt\&.tcache (\fBbool\fR) r\- [\fB\-\-enable\-tcache\fR] .RS 4 Thread\-specific caching (tcache) enabled/disabled\&. When there are multiple threads, each thread uses a tcache for objects up to a certain size\&. Thread\-specific caching allows many allocations to be satisfied without performing any thread synchronization, at the cost of increased memory use\&. See the -"opt\&.lg_tcache_max" +opt\&.lg_tcache_max option for related tuning information\&. This option is enabled by default unless running inside -\m[blue]\fBValgrind\fR\m[]\&\s-2\u[2]\d\s+2, in which case it is forcefully disabled\&. +\m[blue]\fBValgrind\fR\m[]\&\s-2\u[3]\d\s+2, in which case it is forcefully disabled\&. .RE .PP -"opt\&.lg_tcache_max" (\fBsize_t\fR) r\- [\fB\-\-enable\-tcache\fR] +opt\&.lg_tcache_max (\fBsize_t\fR) r\- [\fB\-\-enable\-tcache\fR] .RS 4 Maximum size class (log base 2) to cache in the thread\-specific cache (tcache)\&. At a minimum, all small size classes are cached, and at a maximum all large size classes are cached\&. The default maximum is 32 KiB (2^15)\&. .RE .PP -"opt\&.prof" (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR] +opt\&.prof (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR] .RS 4 Memory profiling enabled/disabled\&. If enabled, profile memory allocation activity\&. See the -"opt\&.prof_active" +opt\&.prof_active option for on\-the\-fly activation/deactivation\&. See the -"opt\&.lg_prof_sample" +opt\&.lg_prof_sample option for probabilistic sampling control\&. See the -"opt\&.prof_accum" +opt\&.prof_accum option for control of cumulative sample reporting\&. See the -"opt\&.lg_prof_interval" +opt\&.lg_prof_interval option for information on interval\-triggered profile dumping, the -"opt\&.prof_gdump" +opt\&.prof_gdump option for information on high\-water\-triggered profile dumping, and the -"opt\&.prof_final" +opt\&.prof_final option for final profile dumping\&. Profile output is compatible with the \fBjeprof\fR command, which is based on the \fBpprof\fR that is developed as part of the -\m[blue]\fBgperftools package\fR\m[]\&\s-2\u[3]\d\s+2\&. See +\m[blue]\fBgperftools package\fR\m[]\&\s-2\u[4]\d\s+2\&. See *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Nov 9 18:48:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DEF0C37813; Wed, 9 Nov 2016 18:48:39 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3975E37F; Wed, 9 Nov 2016 18:48:39 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA9ImcdT013841; Wed, 9 Nov 2016 18:48:38 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA9ImbLT013831; Wed, 9 Nov 2016 18:48:37 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201611091848.uA9ImbLT013831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 9 Nov 2016 18:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308474 - in head/sys: sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 18:48:39 -0000 Author: alc Date: Wed Nov 9 18:48:37 2016 New Revision: 308474 URL: https://svnweb.freebsd.org/changeset/base/308474 Log: Introduce a new page queue, PQ_LAUNDRY, for storing unreferenced, dirty pages, specificially, dirty pages that have passed once through the inactive queue. A new, dedicated thread is responsible for both deciding when to launder pages and actually laundering them. The new policy uses the relative sizes of the inactive and laundry queues to determine whether to launder pages at a given point in time. In general, this leads to more intelligent swapping behavior, since the laundry thread will avoid pageouts when the marginal benefit of doing so is low. Previously, without a dedicated queue for dirty pages, the page daemon didn't have the information to determine whether pageout provides any benefit to the system. Thus, the previous policy often resulted in small but steadily increasing amounts of swap usage when the system is under memory pressure, even when the inactive queue consisted mostly of clean pages. This change addresses that issue, and also paves the way for some future virtual memory system improvements by removing the last source of object-cached clean pages, i.e., PG_CACHE pages. The new laundry thread sleeps while waiting for a request from the page daemon thread(s). A request is raised by setting the variable vm_laundry_request and waking the laundry thread. We request launderings for two reasons: to try and balance the inactive and laundry queue sizes ("background laundering"), and to quickly make up for a shortage of free pages and clean inactive pages ("shortfall laundering"). When background laundering is requested, the laundry thread computes the number of page daemon wakeups that have taken place since the last laundering. If this number is large enough relative to the ratio of the laundry and (global) inactive queue sizes, we will launder vm_background_launder_target pages at vm_background_launder_rate KB/s. Otherwise, the laundry thread goes back to sleep without doing any work. When scanning the laundry queue during background laundering, reactivated pages are counted towards the laundry thread's target. In contrast, shortfall laundering is requested when an inactive queue scan fails to meet its target. In this case, the laundry thread attempts to launder enough pages to meet v_free_target within 0.5s, which is the inactive queue scan period. A laundry request can be latched while another is currently being serviced. In particular, a shortfall request will immediately preempt a background laundering. This change also redefines the meaning of vm_cnt.v_reactivated and removes the functions vm_page_cache() and vm_page_try_to_cache(). The new meaning of vm_cnt.v_reactivated now better reflects its name. It represents the number of inactive or laundry pages that are returned to the active queue on account of a reference. In collaboration with: markj Reviewed by: kib Tested by: pho Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8302 Modified: head/sys/sys/vmmeter.h head/sys/vm/swap_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_meter.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Wed Nov 9 18:42:30 2016 (r308473) +++ head/sys/sys/vmmeter.h Wed Nov 9 18:48:37 2016 (r308474) @@ -75,9 +75,10 @@ struct vmmeter { u_int v_vnodepgsin; /* (p) vnode_pager pages paged in */ u_int v_vnodepgsout; /* (p) vnode pager pages paged out */ u_int v_intrans; /* (p) intransit blocking page faults */ - u_int v_reactivated; /* (f) pages reactivated from free list */ + u_int v_reactivated; /* (p) pages reactivated by the pagedaemon */ u_int v_pdwakeups; /* (p) times daemon has awaken from sleep */ u_int v_pdpages; /* (p) pages analyzed by daemon */ + u_int v_pdshortfalls; /* (p) page reclamation shortfalls */ u_int v_tcached; /* (p) total pages cached */ u_int v_dfree; /* (p) pages freed by daemon */ @@ -96,6 +97,7 @@ struct vmmeter { u_int v_active_count; /* (q) pages active */ u_int v_inactive_target; /* (c) pages desired inactive */ u_int v_inactive_count; /* (q) pages inactive */ + u_int v_laundry_count; /* (q) pages eligible for laundering */ u_int v_cache_count; /* (f) pages on cache queue */ u_int v_pageout_free_min; /* (c) min pages reserved for kernel */ u_int v_interrupt_free_min; /* (c) reserved pages for int code */ @@ -111,7 +113,6 @@ struct vmmeter { u_int v_vforkpages; /* (p) VM pages affected by vfork() */ u_int v_rforkpages; /* (p) VM pages affected by rfork() */ u_int v_kthreadpages; /* (p) VM pages affected by fork() by kernel */ - u_int v_spare[2]; }; #ifdef _KERNEL @@ -184,6 +185,25 @@ vm_paging_needed(void) vm_pageout_wakeup_thresh); } +/* + * Return the number of pages we need to launder. + * A positive number indicates that we have a shortfall of clean pages. + */ +static inline int +vm_laundry_target(void) +{ + + return (vm_paging_target()); +} + +/* + * Obtain the value of a per-CPU counter. + */ +#define VM_METER_PCPU_CNT(member) \ + vm_meter_cnt(__offsetof(struct vmmeter, member)) + +u_int vm_meter_cnt(size_t); + #endif /* systemwide totals computed every five seconds */ Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Nov 9 18:42:30 2016 (r308473) +++ head/sys/vm/swap_pager.c Wed Nov 9 18:48:37 2016 (r308474) @@ -1549,17 +1549,18 @@ swp_pager_async_iodone(struct buf *bp) * For write success, clear the dirty * status, then finish the I/O ( which decrements the * busy count and possibly wakes waiter's up ). + * A page is only written to swap after a period of + * inactivity. Therefore, we do not expect it to be + * reused. */ KASSERT(!pmap_page_is_write_mapped(m), ("swp_pager_async_iodone: page %p is not write" " protected", m)); vm_page_undirty(m); + vm_page_lock(m); + vm_page_deactivate_noreuse(m); + vm_page_unlock(m); vm_page_sunbusy(m); - if (vm_page_count_severe()) { - vm_page_lock(m); - vm_page_try_to_cache(m); - vm_page_unlock(m); - } } } @@ -1635,12 +1636,15 @@ swap_pager_isswapped(vm_object_t object, /* * SWP_PAGER_FORCE_PAGEIN() - force a swap block to be paged in * - * This routine dissociates the page at the given index within a - * swap block from its backing store, paging it in if necessary. - * If the page is paged in, it is placed in the inactive queue, - * since it had its backing store ripped out from under it. - * We also attempt to swap in all other pages in the swap block, - * we only guarantee that the one at the specified index is + * This routine dissociates the page at the given index within an object + * from its backing store, paging it in if it does not reside in memory. + * If the page is paged in, it is marked dirty and placed in the laundry + * queue. The page is marked dirty because it no longer has backing + * store. It is placed in the laundry queue because it has not been + * accessed recently. Otherwise, it would already reside in memory. + * + * We also attempt to swap in all other pages in the swap block. + * However, we only guarantee that the one at the specified index is * paged in. * * XXX - The code to page the whole block in doesn't work, so we @@ -1669,7 +1673,7 @@ swp_pager_force_pagein(vm_object_t objec vm_object_pip_wakeup(object); vm_page_dirty(m); vm_page_lock(m); - vm_page_deactivate(m); + vm_page_launder(m); vm_page_unlock(m); vm_page_xunbusy(m); vm_pager_page_unswapped(m); Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Nov 9 18:42:30 2016 (r308473) +++ head/sys/vm/vm_fault.c Wed Nov 9 18:48:37 2016 (r308474) @@ -290,12 +290,13 @@ int vm_fault_hold(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, int fault_flags, vm_page_t *m_hold) { - vm_prot_t prot; - vm_object_t next_object; struct faultstate fs; struct vnode *vp; + vm_object_t next_object, retry_object; vm_offset_t e_end, e_start; vm_page_t m; + vm_pindex_t retry_pindex; + vm_prot_t prot, retry_prot; int ahead, alloc_req, behind, cluster_offset, error, era, faultcount; int locked, map_generation, nera, result, rv; u_char behavior; @@ -946,10 +947,6 @@ readrest: * lookup. */ if (!fs.lookup_still_valid) { - vm_object_t retry_object; - vm_pindex_t retry_pindex; - vm_prot_t retry_prot; - if (!vm_map_trylock_read(fs.map)) { release_page(&fs); unlock_and_deallocate(&fs); Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Wed Nov 9 18:42:30 2016 (r308473) +++ head/sys/vm/vm_meter.c Wed Nov 9 18:48:37 2016 (r308474) @@ -216,29 +216,37 @@ vmtotal(SYSCTL_HANDLER_ARGS) } /* - * vcnt() - accumulate statistics from all cpus and the global cnt - * structure. + * vm_meter_cnt() - accumulate statistics from all cpus and the global cnt + * structure. * * The vmmeter structure is now per-cpu as well as global. Those * statistics which can be kept on a per-cpu basis (to avoid cache * stalls between cpus) can be moved to the per-cpu vmmeter. Remaining * statistics, such as v_free_reserved, are left in the global * structure. - * - * (sysctl_oid *oidp, void *arg1, int arg2, struct sysctl_req *req) */ -static int -vcnt(SYSCTL_HANDLER_ARGS) +u_int +vm_meter_cnt(size_t offset) { - int count = *(int *)arg1; - int offset = (char *)arg1 - (char *)&vm_cnt; + struct pcpu *pcpu; + u_int count; int i; + count = *(u_int *)((char *)&vm_cnt + offset); CPU_FOREACH(i) { - struct pcpu *pcpu = pcpu_find(i); - count += *(int *)((char *)&pcpu->pc_cnt + offset); + pcpu = pcpu_find(i); + count += *(u_int *)((char *)&pcpu->pc_cnt + offset); } - return (SYSCTL_OUT(req, &count, sizeof(int))); + return (count); +} + +static int +cnt_sysctl(SYSCTL_HANDLER_ARGS) +{ + u_int count; + + count = vm_meter_cnt((char *)arg1 - (char *)&vm_cnt); + return (SYSCTL_OUT(req, &count, sizeof(count))); } SYSCTL_PROC(_vm, VM_TOTAL, vmtotal, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_MPSAFE, @@ -253,8 +261,8 @@ SYSCTL_NODE(_vm_stats, OID_AUTO, misc, C #define VM_STATS(parent, var, descr) \ SYSCTL_PROC(parent, OID_AUTO, var, \ - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, &vm_cnt.var, 0, vcnt, \ - "IU", descr) + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, &vm_cnt.var, 0, \ + cnt_sysctl, "IU", descr) #define VM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) #define VM_STATS_SYS(var, descr) VM_STATS(_vm_stats_sys, var, descr) @@ -278,9 +286,10 @@ VM_STATS_VM(v_vnodeout, "Vnode pager pag VM_STATS_VM(v_vnodepgsin, "Vnode pages paged in"); VM_STATS_VM(v_vnodepgsout, "Vnode pages paged out"); VM_STATS_VM(v_intrans, "In transit page faults"); -VM_STATS_VM(v_reactivated, "Pages reactivated from free list"); +VM_STATS_VM(v_reactivated, "Pages reactivated by pagedaemon"); VM_STATS_VM(v_pdwakeups, "Pagedaemon wakeups"); VM_STATS_VM(v_pdpages, "Pages analyzed by pagedaemon"); +VM_STATS_VM(v_pdshortfalls, "Page reclamation shortfalls"); VM_STATS_VM(v_tcached, "Total pages cached"); VM_STATS_VM(v_dfree, "Pages freed by pagedaemon"); VM_STATS_VM(v_pfree, "Pages freed by exiting processes"); @@ -295,6 +304,7 @@ VM_STATS_VM(v_wire_count, "Wired pages") VM_STATS_VM(v_active_count, "Active pages"); VM_STATS_VM(v_inactive_target, "Desired inactive pages"); VM_STATS_VM(v_inactive_count, "Inactive pages"); +VM_STATS_VM(v_laundry_count, "Pages eligible for laundering"); VM_STATS_VM(v_cache_count, "Pages on cache queue"); VM_STATS_VM(v_pageout_free_min, "Min pages reserved for kernel"); VM_STATS_VM(v_interrupt_free_min, "Reserved pages for interrupt code"); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Nov 9 18:42:30 2016 (r308473) +++ head/sys/vm/vm_object.c Wed Nov 9 18:48:37 2016 (r308474) @@ -2329,9 +2329,9 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARG * sysctl is only meant to give an * approximation of the system anyway. */ - if (m->queue == PQ_ACTIVE) + if (vm_page_active(m)) kvo.kvo_active++; - else if (m->queue == PQ_INACTIVE) + else if (vm_page_inactive(m)) kvo.kvo_inactive++; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Nov 9 18:42:30 2016 (r308473) +++ head/sys/vm/vm_page.c Wed Nov 9 18:48:37 2016 (r308474) @@ -390,6 +390,10 @@ vm_page_domain_init(struct vm_domain *vm "vm active pagequeue"; *__DECONST(u_int **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_vcnt) = &vm_cnt.v_active_count; + *__DECONST(char **, &vmd->vmd_pagequeues[PQ_LAUNDRY].pq_name) = + "vm laundry pagequeue"; + *__DECONST(int **, &vmd->vmd_pagequeues[PQ_LAUNDRY].pq_vcnt) = + &vm_cnt.v_laundry_count; vmd->vmd_page_count = 0; vmd->vmd_free_count = 0; vmd->vmd_segs = 0; @@ -1730,9 +1734,7 @@ vm_page_alloc(vm_object_t object, vm_pin ("vm_page_alloc: cached page %p is PG_ZERO", m)); KASSERT(m->valid != 0, ("vm_page_alloc: cached page %p is invalid", m)); - if (m->object == object && m->pindex == pindex) - vm_cnt.v_reactivated++; - else + if (m->object != object || m->pindex != pindex) m->valid = 0; m_object = m->object; vm_page_cache_remove(m); @@ -2254,7 +2256,7 @@ retry: } KASSERT((m->flags & PG_UNHOLDFREE) == 0, ("page %p is PG_UNHOLDFREE", m)); - /* Don't care: PG_NODUMP, PG_WINATCFLS, PG_ZERO. */ + /* Don't care: PG_NODUMP, PG_ZERO. */ if (object->type != OBJT_DEFAULT && object->type != OBJT_SWAP && object->type != OBJT_VNODE) @@ -2450,7 +2452,7 @@ retry: } KASSERT((m->flags & PG_UNHOLDFREE) == 0, ("page %p is PG_UNHOLDFREE", m)); - /* Don't care: PG_NODUMP, PG_WINATCFLS, PG_ZERO. */ + /* Don't care: PG_NODUMP, PG_ZERO. */ if (object->type != OBJT_DEFAULT && object->type != OBJT_SWAP && object->type != OBJT_VNODE) @@ -2778,7 +2780,10 @@ struct vm_pagequeue * vm_page_pagequeue(vm_page_t m) { - return (&vm_phys_domain(m)->vmd_pagequeues[m->queue]); + if (vm_page_in_laundry(m)) + return (&vm_dom[0].vmd_pagequeues[m->queue]); + else + return (&vm_phys_domain(m)->vmd_pagequeues[m->queue]); } /* @@ -2840,7 +2845,10 @@ vm_page_enqueue(uint8_t queue, vm_page_t KASSERT(queue < PQ_COUNT, ("vm_page_enqueue: invalid queue %u request for page %p", queue, m)); - pq = &vm_phys_domain(m)->vmd_pagequeues[queue]; + if (queue == PQ_LAUNDRY) + pq = &vm_dom[0].vmd_pagequeues[queue]; + else + pq = &vm_phys_domain(m)->vmd_pagequeues[queue]; vm_pagequeue_lock(pq); m->queue = queue; TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); @@ -3124,11 +3132,8 @@ vm_page_unwire(vm_page_t m, uint8_t queu if (m->wire_count == 0) { atomic_subtract_int(&vm_cnt.v_wire_count, 1); if ((m->oflags & VPO_UNMANAGED) == 0 && - m->object != NULL && queue != PQ_NONE) { - if (queue == PQ_INACTIVE) - m->flags &= ~PG_WINATCFLS; + m->object != NULL && queue != PQ_NONE) vm_page_enqueue(queue, m); - } return (TRUE); } else return (FALSE); @@ -3181,7 +3186,6 @@ _vm_page_deactivate(vm_page_t m, boolean } else { if (queue != PQ_NONE) vm_page_dequeue(m); - m->flags &= ~PG_WINATCFLS; vm_pagequeue_lock(pq); } m->queue = PQ_INACTIVE; @@ -3221,24 +3225,25 @@ vm_page_deactivate_noreuse(vm_page_t m) } /* - * vm_page_try_to_cache: + * vm_page_launder * - * Returns 0 on failure, 1 on success + * Put a page in the laundry. */ -int -vm_page_try_to_cache(vm_page_t m) +void +vm_page_launder(vm_page_t m) { + int queue; - vm_page_lock_assert(m, MA_OWNED); - VM_OBJECT_ASSERT_WLOCKED(m->object); - if (m->dirty || m->hold_count || m->wire_count || - (m->oflags & VPO_UNMANAGED) != 0 || vm_page_busied(m)) - return (0); - pmap_remove_all(m); - if (m->dirty) - return (0); - vm_page_cache(m); - return (1); + vm_page_assert_locked(m); + if ((queue = m->queue) != PQ_LAUNDRY) { + if (m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0) { + if (queue != PQ_NONE) + vm_page_dequeue(m); + vm_page_enqueue(PQ_LAUNDRY, m); + } else + KASSERT(queue == PQ_NONE, + ("wired page %p is queued", m)); + } } /* @@ -3265,112 +3270,6 @@ vm_page_try_to_free(vm_page_t m) } /* - * vm_page_cache - * - * Put the specified page onto the page cache queue (if appropriate). - * - * The object and page must be locked. - */ -void -vm_page_cache(vm_page_t m) -{ - vm_object_t object; - boolean_t cache_was_empty; - - vm_page_lock_assert(m, MA_OWNED); - object = m->object; - VM_OBJECT_ASSERT_WLOCKED(object); - if (vm_page_busied(m) || (m->oflags & VPO_UNMANAGED) || - m->hold_count || m->wire_count) - panic("vm_page_cache: attempting to cache busy page"); - KASSERT(!pmap_page_is_mapped(m), - ("vm_page_cache: page %p is mapped", m)); - KASSERT(m->dirty == 0, ("vm_page_cache: page %p is dirty", m)); - if (m->valid == 0 || object->type == OBJT_DEFAULT || - (object->type == OBJT_SWAP && - !vm_pager_has_page(object, m->pindex, NULL, NULL))) { - /* - * Hypothesis: A cache-eligible page belonging to a - * default object or swap object but without a backing - * store must be zero filled. - */ - vm_page_free(m); - return; - } - KASSERT((m->flags & PG_CACHED) == 0, - ("vm_page_cache: page %p is already cached", m)); - - /* - * Remove the page from the paging queues. - */ - vm_page_remque(m); - - /* - * Remove the page from the object's collection of resident - * pages. - */ - vm_radix_remove(&object->rtree, m->pindex); - TAILQ_REMOVE(&object->memq, m, listq); - object->resident_page_count--; - - /* - * Restore the default memory attribute to the page. - */ - if (pmap_page_get_memattr(m) != VM_MEMATTR_DEFAULT) - pmap_page_set_memattr(m, VM_MEMATTR_DEFAULT); - - /* - * Insert the page into the object's collection of cached pages - * and the physical memory allocator's cache/free page queues. - */ - m->flags &= ~PG_ZERO; - mtx_lock(&vm_page_queue_free_mtx); - cache_was_empty = vm_radix_is_empty(&object->cache); - if (vm_radix_insert(&object->cache, m)) { - mtx_unlock(&vm_page_queue_free_mtx); - if (object->type == OBJT_VNODE && - object->resident_page_count == 0) - vdrop(object->handle); - m->object = NULL; - vm_page_free(m); - return; - } - - /* - * The above call to vm_radix_insert() could reclaim the one pre- - * existing cached page from this object, resulting in a call to - * vdrop(). - */ - if (!cache_was_empty) - cache_was_empty = vm_radix_is_singleton(&object->cache); - - m->flags |= PG_CACHED; - vm_cnt.v_cache_count++; - PCPU_INC(cnt.v_tcached); -#if VM_NRESERVLEVEL > 0 - if (!vm_reserv_free_page(m)) { -#else - if (TRUE) { -#endif - vm_phys_free_pages(m, 0); - } - vm_page_free_wakeup(); - mtx_unlock(&vm_page_queue_free_mtx); - - /* - * Increment the vnode's hold count if this is the object's only - * cached page. Decrement the vnode's hold count if this was - * the object's only resident page. - */ - if (object->type == OBJT_VNODE) { - if (cache_was_empty && object->resident_page_count != 0) - vhold(object->handle); - else if (!cache_was_empty && object->resident_page_count == 0) - vdrop(object->handle); - } -} - -/* * vm_page_advise * * Deactivate or do nothing, as appropriate. @@ -3413,11 +3312,13 @@ vm_page_advise(vm_page_t m, int advice) /* * Place clean pages near the head of the inactive queue rather than * the tail, thus defeating the queue's LRU operation and ensuring that - * the page will be reused quickly. Dirty pages are given a chance to - * cycle once through the inactive queue before becoming eligible for - * laundering. + * the page will be reused quickly. Dirty pages not already in the + * laundry are moved there. */ - _vm_page_deactivate(m, m->dirty == 0); + if (m->dirty == 0) + vm_page_deactivate_noreuse(m); + else + vm_page_launder(m); } /* @@ -3926,6 +3827,7 @@ DB_SHOW_COMMAND(page, vm_page_print_page db_printf("vm_cnt.v_cache_count: %d\n", vm_cnt.v_cache_count); db_printf("vm_cnt.v_inactive_count: %d\n", vm_cnt.v_inactive_count); db_printf("vm_cnt.v_active_count: %d\n", vm_cnt.v_active_count); + db_printf("vm_cnt.v_laundry_count: %d\n", vm_cnt.v_laundry_count); db_printf("vm_cnt.v_wire_count: %d\n", vm_cnt.v_wire_count); db_printf("vm_cnt.v_free_reserved: %d\n", vm_cnt.v_free_reserved); db_printf("vm_cnt.v_free_min: %d\n", vm_cnt.v_free_min); @@ -3940,12 +3842,14 @@ DB_SHOW_COMMAND(pageq, vm_page_print_pag db_printf("pq_free %d pq_cache %d\n", vm_cnt.v_free_count, vm_cnt.v_cache_count); for (dom = 0; dom < vm_ndomains; dom++) { - db_printf("dom %d page_cnt %d free %d pq_act %d pq_inact %d\n", + db_printf( + "dom %d page_cnt %d free %d pq_act %d pq_inact %d pq_laund %d\n", dom, vm_dom[dom].vmd_page_count, vm_dom[dom].vmd_free_count, vm_dom[dom].vmd_pagequeues[PQ_ACTIVE].pq_cnt, - vm_dom[dom].vmd_pagequeues[PQ_INACTIVE].pq_cnt); + vm_dom[dom].vmd_pagequeues[PQ_INACTIVE].pq_cnt, + vm_dom[dom].vmd_pagequeues[PQ_LAUNDRY].pq_cnt); } } Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Nov 9 18:42:30 2016 (r308473) +++ head/sys/vm/vm_page.h Wed Nov 9 18:48:37 2016 (r308474) @@ -206,7 +206,8 @@ struct vm_page { #define PQ_NONE 255 #define PQ_INACTIVE 0 #define PQ_ACTIVE 1 -#define PQ_COUNT 2 +#define PQ_LAUNDRY 2 +#define PQ_COUNT 3 TAILQ_HEAD(pglist, vm_page); SLIST_HEAD(spglist, vm_page); @@ -228,6 +229,7 @@ struct vm_domain { boolean_t vmd_oom; int vmd_oom_seq; int vmd_last_active_scan; + struct vm_page vmd_laundry_marker; struct vm_page vmd_marker; /* marker for pagedaemon private use */ struct vm_page vmd_inacthead; /* marker for LRU-defeating insertions */ }; @@ -236,6 +238,7 @@ extern struct vm_domain vm_dom[MAXMEMDOM #define vm_pagequeue_assert_locked(pq) mtx_assert(&(pq)->pq_mutex, MA_OWNED) #define vm_pagequeue_lock(pq) mtx_lock(&(pq)->pq_mutex) +#define vm_pagequeue_lockptr(pq) (&(pq)->pq_mutex) #define vm_pagequeue_unlock(pq) mtx_unlock(&(pq)->pq_mutex) #ifdef _KERNEL @@ -327,7 +330,6 @@ extern struct mtx_padalign pa_lock[]; #define PG_FICTITIOUS 0x0004 /* physical page doesn't exist */ #define PG_ZERO 0x0008 /* page is zeroed */ #define PG_MARKER 0x0010 /* special queue marker page */ -#define PG_WINATCFLS 0x0040 /* flush dirty page on inactive q */ #define PG_NODUMP 0x0080 /* don't include this page in a dump */ #define PG_UNHOLDFREE 0x0100 /* delayed free of a held page */ @@ -451,10 +453,8 @@ vm_page_t vm_page_alloc_contig(vm_object vm_paddr_t boundary, vm_memattr_t memattr); vm_page_t vm_page_alloc_freelist(int, int); vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); -void vm_page_cache(vm_page_t); void vm_page_cache_free(vm_object_t, vm_pindex_t, vm_pindex_t); void vm_page_cache_transfer(vm_object_t, vm_pindex_t, vm_object_t); -int vm_page_try_to_cache (vm_page_t); int vm_page_try_to_free (vm_page_t); void vm_page_deactivate (vm_page_t); void vm_page_deactivate_noreuse(vm_page_t); @@ -465,6 +465,7 @@ vm_page_t vm_page_getfake(vm_paddr_t pad void vm_page_initfake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr); int vm_page_insert (vm_page_t, vm_object_t, vm_pindex_t); boolean_t vm_page_is_cached(vm_object_t object, vm_pindex_t pindex); +void vm_page_launder(vm_page_t m); vm_page_t vm_page_lookup (vm_object_t, vm_pindex_t); vm_page_t vm_page_next(vm_page_t m); int vm_page_pa_tryrelock(pmap_t, vm_paddr_t, vm_paddr_t *); @@ -697,5 +698,26 @@ vm_page_replace_checked(vm_page_t mnew, (void)mret; } +static inline bool +vm_page_active(vm_page_t m) +{ + + return (m->queue == PQ_ACTIVE); +} + +static inline bool +vm_page_inactive(vm_page_t m) +{ + + return (m->queue == PQ_INACTIVE); +} + +static inline bool +vm_page_in_laundry(vm_page_t m) +{ + + return (m->queue == PQ_LAUNDRY); +} + #endif /* _KERNEL */ #endif /* !_VM_PAGE_ */ Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Nov 9 18:42:30 2016 (r308473) +++ head/sys/vm/vm_pageout.c Wed Nov 9 18:48:37 2016 (r308474) @@ -119,7 +119,7 @@ __FBSDID("$FreeBSD$"); /* the kernel process "vm_pageout"*/ static void vm_pageout(void); static void vm_pageout_init(void); -static int vm_pageout_clean(vm_page_t m); +static int vm_pageout_clean(vm_page_t m, int *numpagedout); static int vm_pageout_cluster(vm_page_t m); static bool vm_pageout_scan(struct vm_domain *vmd, int pass); static void vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage, @@ -154,6 +154,9 @@ static struct kproc_desc vm_kp = { SYSINIT(vmdaemon, SI_SUB_KTHREAD_VM, SI_ORDER_FIRST, kproc_start, &vm_kp); #endif +/* Pagedaemon activity rates, in subdivisions of one second. */ +#define VM_LAUNDER_RATE 10 +#define VM_INACT_SCAN_RATE 2 int vm_pageout_deficit; /* Estimated number of pages deficit */ u_int vm_pageout_wakeup_thresh; @@ -161,6 +164,13 @@ static int vm_pageout_oom_seq = 12; bool vm_pageout_wanted; /* Event on which pageout daemon sleeps */ bool vm_pages_needed; /* Are threads waiting for free pages? */ +/* Pending request for dirty page laundering. */ +static enum { + VM_LAUNDRY_IDLE, + VM_LAUNDRY_BACKGROUND, + VM_LAUNDRY_SHORTFALL +} vm_laundry_request = VM_LAUNDRY_IDLE; + #if !defined(NO_SWAPPING) static int vm_pageout_req_swapout; /* XXX */ static int vm_daemon_needed; @@ -168,9 +178,7 @@ static struct mtx vm_daemon_mtx; /* Allow for use by vm_pageout before vm_daemon is initialized. */ MTX_SYSINIT(vm_daemon, &vm_daemon_mtx, "vm daemon", MTX_DEF); #endif -static int vm_max_launder = 32; static int vm_pageout_update_period; -static int defer_swap_pageouts; static int disable_swap_pageouts; static int lowmem_period = 10; static time_t lowmem_uptime; @@ -193,9 +201,6 @@ SYSCTL_INT(_vm, OID_AUTO, pageout_wakeup CTLFLAG_RW, &vm_pageout_wakeup_thresh, 0, "free page threshold for waking up the pageout daemon"); -SYSCTL_INT(_vm, OID_AUTO, max_launder, - CTLFLAG_RW, &vm_max_launder, 0, "Limit dirty flushes in pageout"); - SYSCTL_INT(_vm, OID_AUTO, pageout_update_period, CTLFLAG_RW, &vm_pageout_update_period, 0, "Maximum active LRU update period"); @@ -215,9 +220,6 @@ SYSCTL_INT(_vm, OID_AUTO, swap_idle_enab CTLFLAG_RW, &vm_swap_idle_enabled, 0, "Allow swapout on idle criteria"); #endif -SYSCTL_INT(_vm, OID_AUTO, defer_swapspace_pageouts, - CTLFLAG_RW, &defer_swap_pageouts, 0, "Give preference to dirty pages in mem"); - SYSCTL_INT(_vm, OID_AUTO, disable_swapspace_pageouts, CTLFLAG_RW, &disable_swap_pageouts, 0, "Disallow swapout of dirty pages"); @@ -229,6 +231,25 @@ SYSCTL_INT(_vm, OID_AUTO, pageout_oom_se CTLFLAG_RW, &vm_pageout_oom_seq, 0, "back-to-back calls to oom detector to start OOM"); +static int act_scan_laundry_weight = 3; +SYSCTL_INT(_vm, OID_AUTO, act_scan_laundry_weight, CTLFLAG_RW, + &act_scan_laundry_weight, 0, + "weight given to clean vs. dirty pages in active queue scans"); + +static u_int vm_background_launder_target; +SYSCTL_UINT(_vm, OID_AUTO, background_launder_target, CTLFLAG_RW, + &vm_background_launder_target, 0, + "background laundering target, in pages"); + +static u_int vm_background_launder_rate = 4096; +SYSCTL_UINT(_vm, OID_AUTO, background_launder_rate, CTLFLAG_RW, + &vm_background_launder_rate, 0, + "background laundering rate, in kilobytes per second"); + +static u_int vm_background_launder_max = 20 * 1024; +SYSCTL_UINT(_vm, OID_AUTO, background_launder_max, CTLFLAG_RW, + &vm_background_launder_max, 0, "background laundering cap, in kilobytes"); + #define VM_PAGEOUT_PAGE_COUNT 16 int vm_pageout_page_count = VM_PAGEOUT_PAGE_COUNT; @@ -236,7 +257,11 @@ int vm_page_max_wired; /* XXX max # of SYSCTL_INT(_vm, OID_AUTO, max_wired, CTLFLAG_RW, &vm_page_max_wired, 0, "System-wide limit to wired page count"); +static u_int isqrt(u_int num); static boolean_t vm_pageout_fallback_object_lock(vm_page_t, vm_page_t *); +static int vm_pageout_launder(struct vm_domain *vmd, int launder, + bool in_shortfall); +static void vm_pageout_laundry_worker(void *arg); #if !defined(NO_SWAPPING) static void vm_pageout_map_deactivate_pages(vm_map_t, long); static void vm_pageout_object_deactivate_pages(pmap_t, vm_object_t, long); @@ -387,7 +412,7 @@ vm_pageout_cluster(vm_page_t m) /* * We can cluster only if the page is not clean, busy, or held, and - * the page is inactive. + * the page is in the laundry queue. * * During heavy mmap/modification loads the pageout * daemon can really fragment the underlying file @@ -413,7 +438,7 @@ more: break; } vm_page_lock(p); - if (p->queue != PQ_INACTIVE || + if (!vm_page_in_laundry(p) || p->hold_count != 0) { /* may be undergoing I/O */ vm_page_unlock(p); ib = 0; @@ -439,7 +464,7 @@ more: if (p->dirty == 0) break; vm_page_lock(p); - if (p->queue != PQ_INACTIVE || + if (!vm_page_in_laundry(p) || p->hold_count != 0) { /* may be undergoing I/O */ vm_page_unlock(p); break; @@ -519,23 +544,33 @@ vm_pageout_flush(vm_page_t *mc, int coun ("vm_pageout_flush: page %p is not write protected", mt)); switch (pageout_status[i]) { case VM_PAGER_OK: + vm_page_lock(mt); + if (vm_page_in_laundry(mt)) + vm_page_deactivate_noreuse(mt); + vm_page_unlock(mt); + /* FALLTHROUGH */ case VM_PAGER_PEND: numpagedout++; break; case VM_PAGER_BAD: /* - * Page outside of range of object. Right now we - * essentially lose the changes by pretending it - * worked. + * The page is outside the object's range. We pretend + * that the page out worked and clean the page, so the + * changes will be lost if the page is reclaimed by + * the page daemon. */ vm_page_undirty(mt); + vm_page_lock(mt); + if (vm_page_in_laundry(mt)) + vm_page_deactivate_noreuse(mt); + vm_page_unlock(mt); break; case VM_PAGER_ERROR: case VM_PAGER_FAIL: /* - * If page couldn't be paged out, then reactivate the - * page so it doesn't clog the inactive list. (We - * will try paging out it again later). + * If the page couldn't be paged out, then reactivate + * it so that it doesn't clog the laundry and inactive + * queues. (We will try paging it out again later). */ vm_page_lock(mt); vm_page_activate(mt); @@ -617,10 +652,10 @@ vm_pageout_object_deactivate_pages(pmap_ act_delta = 1; vm_page_aflag_clear(p, PGA_REFERENCED); } - if (p->queue != PQ_ACTIVE && act_delta != 0) { + if (!vm_page_active(p) && act_delta != 0) { vm_page_activate(p); p->act_count += act_delta; - } else if (p->queue == PQ_ACTIVE) { + } else if (vm_page_active(p)) { if (act_delta == 0) { p->act_count -= min(p->act_count, ACT_DECLINE); @@ -636,7 +671,7 @@ vm_pageout_object_deactivate_pages(pmap_ p->act_count += ACT_ADVANCE; vm_page_requeue(p); } - } else if (p->queue == PQ_INACTIVE) + } else if (vm_page_inactive(p)) pmap_remove_all(p); vm_page_unlock(p); } @@ -739,7 +774,7 @@ vm_pageout_map_deactivate_pages(map, des * Returns 0 on success and an errno otherwise. */ static int -vm_pageout_clean(vm_page_t m) +vm_pageout_clean(vm_page_t m, int *numpagedout) { struct vnode *vp; struct mount *mp; @@ -797,7 +832,7 @@ vm_pageout_clean(vm_page_t m) * (3) reallocated to a different offset, or * (4) cleaned. */ - if (m->queue != PQ_INACTIVE || m->object != object || + if (!vm_page_in_laundry(m) || m->object != object || m->pindex != pindex || m->dirty == 0) { vm_page_unlock(m); error = ENXIO; @@ -821,7 +856,7 @@ vm_pageout_clean(vm_page_t m) * laundry. If it is still in the laundry, then we * start the cleaning operation. */ - if (vm_pageout_cluster(m) == 0) + if ((*numpagedout = vm_pageout_cluster(m)) == 0) error = EIO; unlock_all: @@ -840,11 +875,390 @@ unlock_mp: } /* + * Attempt to launder the specified number of pages. + * + * Returns the number of pages successfully laundered. + */ +static int +vm_pageout_launder(struct vm_domain *vmd, int launder, bool in_shortfall) +{ + struct vm_pagequeue *pq; + vm_object_t object; + vm_page_t m, next; + int act_delta, error, maxscan, numpagedout, starting_target; + int vnodes_skipped; + bool pageout_ok, queue_locked; + + starting_target = launder; + vnodes_skipped = 0; + + /* + * Scan the laundry queue for pages eligible to be laundered. We stop + * once the target number of dirty pages have been laundered, or once + * we've reached the end of the queue. A single iteration of this loop + * may cause more than one page to be laundered because of clustering. + * + * maxscan ensures that we don't re-examine requeued pages. Any + * additional pages written as part of a cluster are subtracted from + * maxscan since they must be taken from the laundry queue. + */ + pq = &vmd->vmd_pagequeues[PQ_LAUNDRY]; + maxscan = pq->pq_cnt; + + vm_pagequeue_lock(pq); + queue_locked = true; + for (m = TAILQ_FIRST(&pq->pq_pl); + m != NULL && maxscan-- > 0 && launder > 0; + m = next) { + vm_pagequeue_assert_locked(pq); + KASSERT(queue_locked, ("unlocked laundry queue")); + KASSERT(vm_page_in_laundry(m), + ("page %p has an inconsistent queue", m)); + next = TAILQ_NEXT(m, plinks.q); + if ((m->flags & PG_MARKER) != 0) + continue; + KASSERT((m->flags & PG_FICTITIOUS) == 0, + ("PG_FICTITIOUS page %p cannot be in laundry queue", m)); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, + ("VPO_UNMANAGED page %p cannot be in laundry queue", m)); + if (!vm_pageout_page_lock(m, &next) || m->hold_count != 0) { + vm_page_unlock(m); + continue; + } + object = m->object; + if ((!VM_OBJECT_TRYWLOCK(object) && + (!vm_pageout_fallback_object_lock(m, &next) || + m->hold_count != 0)) || vm_page_busied(m)) { + VM_OBJECT_WUNLOCK(object); + vm_page_unlock(m); + continue; + } + + /* + * Unlock the laundry queue, invalidating the 'next' pointer. + * Use a marker to remember our place in the laundry queue. + */ + TAILQ_INSERT_AFTER(&pq->pq_pl, m, &vmd->vmd_laundry_marker, + plinks.q); + vm_pagequeue_unlock(pq); + queue_locked = false; + + /* + * Invalid pages can be easily freed. They cannot be + * mapped; vm_page_free() asserts this. + */ + if (m->valid == 0) + goto free_page; + + /* + * If the page has been referenced and the object is not dead, + * reactivate or requeue the page depending on whether the + * object is mapped. + */ + if ((m->aflags & PGA_REFERENCED) != 0) { + vm_page_aflag_clear(m, PGA_REFERENCED); + act_delta = 1; + } else + act_delta = 0; + if (object->ref_count != 0) + act_delta += pmap_ts_referenced(m); + else { + KASSERT(!pmap_page_is_mapped(m), + ("page %p is mapped", m)); + } + if (act_delta != 0) { + if (object->ref_count != 0) { + PCPU_INC(cnt.v_reactivated); + vm_page_activate(m); + + /* + * Increase the activation count if the page + * was referenced while in the laundry queue. + * This makes it less likely that the page will + * be returned prematurely to the inactive + * queue. + */ + m->act_count += act_delta + ACT_ADVANCE; + + /* + * If this was a background laundering, count + * activated pages towards our target. The + * purpose of background laundering is to ensure + * that pages are eventually cycled through the + * laundry queue, and an activation is a valid + * way out. + */ + if (!in_shortfall) + launder--; + goto drop_page; + } else if ((object->flags & OBJ_DEAD) == 0) + goto requeue_page; + } + + /* + * If the page appears to be clean at the machine-independent + * layer, then remove all of its mappings from the pmap in + * anticipation of freeing it. If, however, any of the page's + * mappings allow write access, then the page may still be + * modified until the last of those mappings are removed. + */ + if (object->ref_count != 0) { + vm_page_test_dirty(m); + if (m->dirty == 0) + pmap_remove_all(m); + } + + /* + * Clean pages are freed, and dirty pages are paged out unless + * they belong to a dead object. Requeueing dirty pages from + * dead objects is pointless, as they are being paged out and + * freed by the thread that destroyed the object. + */ + if (m->dirty == 0) { +free_page: + vm_page_free(m); + PCPU_INC(cnt.v_dfree); + } else if ((object->flags & OBJ_DEAD) == 0) { + if (object->type != OBJT_SWAP && + object->type != OBJT_DEFAULT) + pageout_ok = true; + else if (disable_swap_pageouts) + pageout_ok = false; + else + pageout_ok = true; + if (!pageout_ok) { +requeue_page: + vm_pagequeue_lock(pq); + queue_locked = true; + vm_page_requeue_locked(m); + goto drop_page; + } + + /* + * Form a cluster with adjacent, dirty pages from the + * same object, and page out that entire cluster. + * + * The adjacent, dirty pages must also be in the + * laundry. However, their mappings are not checked + * for new references. Consequently, a recently + * referenced page may be paged out. However, that + * page will not be prematurely reclaimed. After page + * out, the page will be placed in the inactive queue, + * where any new references will be detected and the + * page reactivated. + */ + error = vm_pageout_clean(m, &numpagedout); + if (error == 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Nov 9 21:28:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1379BC382D9; Wed, 9 Nov 2016 21:28:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D96F7EC9; Wed, 9 Nov 2016 21:28:47 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA9LSlk8079819; Wed, 9 Nov 2016 21:28:47 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA9LSlDo079818; Wed, 9 Nov 2016 21:28:47 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201611092128.uA9LSlDo079818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 9 Nov 2016 21:28:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308476 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 21:28:48 -0000 Author: tsoome Date: Wed Nov 9 21:28:46 2016 New Revision: 308476 URL: https://svnweb.freebsd.org/changeset/base/308476 Log: boot/forth spelling issue in forth word Reviewed by: dteske, imp Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D8484 Modified: head/sys/boot/forth/support.4th Modified: head/sys/boot/forth/support.4th ============================================================================== --- head/sys/boot/forth/support.4th Wed Nov 9 19:08:39 2016 (r308475) +++ head/sys/boot/forth/support.4th Wed Nov 9 21:28:46 2016 (r308476) @@ -1115,7 +1115,7 @@ string current_file_name_ref \ used to p : load_error_message verbose? if ." failed!" cr then ; -: load_succesful_message verbose? if ." ok" cr then ; +: load_successful_message verbose? if ." ok" cr then ; : load_module load_parameters load @@ -1133,7 +1133,7 @@ string current_file_name_ref \ used to p then else after_load - load_succesful_message true \ Successful, do not retry + load_successful_message true \ Successful, do not retry then until ; From owner-svn-src-head@freebsd.org Wed Nov 9 21:51:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 712B0C3894B; Wed, 9 Nov 2016 21:51:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 424C31D26; Wed, 9 Nov 2016 21:51:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uA9LpmJc091651; Wed, 9 Nov 2016 21:51:48 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uA9LpmM6091650; Wed, 9 Nov 2016 21:51:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201611092151.uA9LpmM6091650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 9 Nov 2016 21:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308477 - head/sys/boot/i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 21:51:49 -0000 Author: bapt Date: Wed Nov 9 21:51:48 2016 New Revision: 308477 URL: https://svnweb.freebsd.org/changeset/base/308477 Log: make pxeboot consistent with common/dev_net.c Always define boot.netif.server in kenv in pxeboot Add "boot.tftproot.server" to kenv when pxeboot uses tftpfs Change the code order when setting env for TFTP or NFS to be the same as common/dev_net.c Reported by: tsoome Modified: head/sys/boot/i386/libi386/pxe.c Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Wed Nov 9 21:28:46 2016 (r308476) +++ head/sys/boot/i386/libi386/pxe.c Wed Nov 9 21:51:48 2016 (r308477) @@ -311,6 +311,7 @@ pxe_open(struct open_file *f, ...) setenv("boot.netif.ip", inet_ntoa(myip), 1); setenv("boot.netif.netmask", intoa(netmask), 1); setenv("boot.netif.gateway", inet_ntoa(gateip), 1); + setenv("boot.netif.server", inet_ntoa(rootip), 1); if (bootplayer.Hardware == ETHER_TYPE) { sprintf(temp, "%6D", bootplayer.CAddr, ":"); setenv("boot.netif.hwaddr", temp, 1); @@ -324,12 +325,12 @@ pxe_open(struct open_file *f, ...) printf("pxe_open: server path: %s\n", rootpath); printf("pxe_open: gateway ip: %s\n", inet_ntoa(gateip)); - if (netproto == NET_NFS) { + if (netproto == NET_TFTP) { + setenv("boot.tftproot.server", inet_ntoa(rootip), 1); + setenv("boot.tftproot.path", rootpath, 1); + } else if (netproto == NET_NFS) { setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); setenv("boot.nfsroot.path", rootpath, 1); - } else if (netproto == NET_TFTP) { - setenv("boot.netif.server", inet_ntoa(rootip), 1); - setenv("boot.tftproot.path", rootpath, 1); } setenv("dhcp.host-name", hostname, 1); From owner-svn-src-head@freebsd.org Wed Nov 9 23:31:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29794C37B2E; Wed, 9 Nov 2016 23:31:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F296AA54; Wed, 9 Nov 2016 23:31:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id uA9NV9cl099629 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 9 Nov 2016 15:31:09 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id uA9NV9Kk099628; Wed, 9 Nov 2016 15:31:09 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 9 Nov 2016 15:31:09 -0800 From: Gleb Smirnoff To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308026 - in head/sys: kern sys ufs/ffs Message-ID: <20161109233109.GY27748@FreeBSD.org> References: <201610281143.u9SBhxrN008547@repo.freebsd.org> <20161101000246.GQ27748@FreeBSD.org> <20161101125310.GD54029@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161101125310.GD54029@kib.kiev.ua> User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 23:31:11 -0000 Konstantin, On Tue, Nov 01, 2016 at 02:53:10PM +0200, Konstantin Belousov wrote: K> > K> +static int buf_pager_relbuf; K> > K> +SYSCTL_INT(_vfs, OID_AUTO, buf_pager_relbuf, CTLFLAG_RWTUN, K> > K> + &buf_pager_relbuf, 0, K> > K> + "Make buffer pager release buffers after reading"); K> > K> + K> > K> +/* K> > K> + * The buffer pager. It uses buffer reads to validate pages. K> > K> + * K> > K> + * In contrast to the generic local pager from vm/vnode_pager.c, this K> > K> + * pager correctly and easily handles volumes where the underlying K> > K> + * device block size is greater than the machine page size. The K> > K> + * buffer cache transparently extends the requested page run to be K> > K> + * aligned at the block boundary, and does the necessary bogus page K> > K> + * replacements in the addends to avoid obliterating already valid K> > K> + * pages. K> > K> + * K> > K> + * The only non-trivial issue is that the exclusive busy state for K> > K> + * pages, which is assumed by the vm_pager_getpages() interface, is K> > K> + * incompatible with the VMIO buffer cache's desire to share-busy the K> > K> + * pages. This function performs a trivial downgrade of the pages' K> > K> + * state before reading buffers, and a less trivial upgrade from the K> > K> + * shared-busy to excl-busy state after the read. K> > K> > IMHO, should be noted that the pager ignores requested rbehind and rahead K> > values, and does the rbehind and rahead sizes that he prefers. K> Pager interface considers the ahead/behind pages' page-in as unsignificant, K> in particular because the pages can be recycled or invalidated during the K> pager operation, when pager drops the object lock. K> K> More important, this pager de-facto uses the optimal filesystem-depended K> aligned io size due to its structure, comparing with the bmap pager. K> For this reason, I consider additional attempts to follow optional K> upper-level hints not very useful. Measurements show no difference in K> the real workload times, and marginal improvements for microbenchmarks K> (5% scale). The buildworld isn't the only true workload. If we do readbehind or readahead we allocate pages for that, which means that some other pages need to be purged. There are cases, when the pager has absolutely no idea about what is optimal. So, not following hints from the upper layers is a bug. Note, that I don't ask you to fix it. I'm just asking to document that behaviour. K> I might do something more aggressive when upper-level specified rahead is K> (significantly) above the natural block size limit, like using breadn() K> instead of bread(). Practice suggests that this would not help or even K> be a pessimisation due to higher buf cache trashing. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu Nov 10 07:05:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94809C390C7; Thu, 10 Nov 2016 07:05:42 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65D3ABB4; Thu, 10 Nov 2016 07:05:42 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAA75fnQ011253; Thu, 10 Nov 2016 07:05:41 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAA75ffM011252; Thu, 10 Nov 2016 07:05:41 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201611100705.uAA75ffM011252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 10 Nov 2016 07:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308478 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 07:05:42 -0000 Author: araujo Date: Thu Nov 10 07:05:41 2016 New Revision: 308478 URL: https://svnweb.freebsd.org/changeset/base/308478 Log: We can't use protect(1) inside a jail(8)! To avoid have warning for services that are using oomprotect, oomprotect will only be applied on services that won't run inside jails. Reported by: allanjude MFC after: 2 weeks. Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Wed Nov 9 21:51:48 2016 (r308477) +++ head/etc/rc.subr Thu Nov 10 07:05:41 2016 (r308478) @@ -1205,6 +1205,11 @@ $command $rc_flags $command_args" # Apply protect(1) to the PID if ${name}_oomprotect is set. case "$rc_arg" in start) + # We cannot use protect(1) inside jails. + jailed="$(sysctl -n security.jail.jailed)" + if [ ${jailed} -eq 1 ]; then + return $_return + fi if [ -n "$_oomprotect" ]; then if [ -f "${PROTECT}" ]; then pid=$(check_process $command) From owner-svn-src-head@freebsd.org Thu Nov 10 07:47:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 477E2C39FC8; Thu, 10 Nov 2016 07:47:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F160E7A2; Thu, 10 Nov 2016 07:47:01 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 384141FE022; Thu, 10 Nov 2016 08:46:56 +0100 (CET) Subject: Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835 To: John Baldwin References: <201611071738.uA7HceYu045944@repo.freebsd.org> <3214848.geWV8qu7rM@ralph.baldwin.cx> <5c170b6b-1189-4712-ffdd-653cc6b8c59e@selasky.org> <2064206.nvhhXHc9vW@ralph.baldwin.cx> Cc: Oleksandr Tymoshenko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Marshall Kirk McKusick From: Hans Petter Selasky Message-ID: <6bce6a4b-d782-77af-8515-7243eab38cf3@selasky.org> Date: Thu, 10 Nov 2016 08:52:07 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <2064206.nvhhXHc9vW@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 07:47:02 -0000 Hi, On 11/09/16 17:32, John Baldwin wrote: > It isn't predicted and avoided by turnstiles. In particular, the cv_signal has > no idea what lock is associated, so it can't try to do something "smart" and > move the thread from the sleepq to the lockq. You will pay the double context > switch. Maybe this is an idea for a turnstile optimisation? In another embedded OS based on FreeBSD I did exactly this. If someone is sleeping through cv_wait() the lock it is sleeping on, if different from NULL, is stored in the sleepqueue. When cv_signal() is invoked we simply check if the saved lock is owned by the caller and then don't do the pre-emption, because we predict it will be locked by cv_wait() before returning. --HPS From owner-svn-src-head@freebsd.org Thu Nov 10 07:54:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B6F1C39450; Thu, 10 Nov 2016 07:54:56 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B0C4E51; Thu, 10 Nov 2016 07:54:55 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [IPv6:2a00:e10:2800::a135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id uAA7smNu002920; Thu, 10 Nov 2016 08:54:48 +0100 (CET) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (titan.inop.mo1.omnilan.net [IPv6:2001:a60:f0bb:1::3:1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 55CB1125; Thu, 10 Nov 2016 08:54:48 +0100 (CET) Message-ID: <582427C7.5020007@omnilan.de> Date: Thu, 10 Nov 2016 08:54:47 +0100 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Scott Long CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308217 - in head/sys/dev: mpr mps References: <201611021513.uA2FDPk6062463@repo.freebsd.org> <581C5249.2060104@omnilan.de> <161EBBC5-F642-4A05-9361-179B74CDA50A@samsco.org> In-Reply-To: <161EBBC5-F642-4A05-9361-179B74CDA50A@samsco.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]); Thu, 10 Nov 2016 08:54:52 +0100 (CET) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: ; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 07:54:56 -0000 Bezüglich Scott Long's Nachricht vom 09.11.2016 17:06 (localtime): > >> On Nov 4, 2016, at 3:18 AM, Harry Schmalzbauer wrote: … >> If it's really mps(4) who decides to store driveserial-targetID >> numbering in the /"persitent non-manufacturing config pages/" of the >> controller, mpsutil(8) should be able to reset. Otherwise replacing >> failed drives, or - even mor confusing - rearranging drive/zpool layouts >> is very unsatisfying. >> >> Maybe "-1" should be mentioned with sysctl decription, otherwise this is >> another very hard to find/influence behaviour. >> >> > > Thanks for the feedback. For the record, this problem happens on a > Supermicro X10SDV-7TP4F motherboard. It appears that the support > logic around the LSI controller is mis-configured to show the SAS ports > being part of an enclosure with 0 slots, instead of 8. This confuses > the device mapper logic in the driver that activates if the controller NVRAM > doesn’t specify a pre-existing mapping. Typically this is not the default, > the NVRAM persistent mappings are the default and are used by the driver, > so I considered this problem to be unique to our deployment. Maybe it’s > more of a problem than I estimated? Anyways, sounds like this new I haven't had too much diversity regarding Fusion-MPT and this mapping problem has never hit me yet, so I can't help estimating the severity of that specific problem. But I think I haven't described clearly that I'm having da(4)-numbering problems which are not directly enclosure-mapping related (at least not related to the nvram mapping page), but which hopefully could be worked arround the same way: I frequently had problems replacing drives due to the eternal targetID assigning (every drive with a new/unknown serial gets a consecutive targetID regardless of the enclosure-slot or the number of attached drives). I guess this is stored in a completely different NVRAM page than the enclosure-mapping page. Your patch is intended to solve problems with invalid/absent enclosure-mapping page, but I guess I'll sooner or later need to try the "hw.mpr.use_phy_num=-1" sysctl to hopefully overwrite the targetID++ assigning, which causes "wholes" every time a drive gets replaced. In that case it's just a cosmetic problem, but when rearranging old and new drives on the same controller, it can cause severe confusion for the admins – leading to fatal mistakes. And migrating disks to new controller/chassis is even more problematic if the host had hard wired da(4) assignins via device.hints. I couldn't search the driver to find out if the "save eternal targetID in nvram page N" is really present and not firmware-only induced, but since I saw a different behaviour on windows, I guess it is. I could circumvent the problem by simply using IR firmware since it is only active when mps(4) runs IT firmware. But having a way to disable "save eternal targetID in nvram page N" for mps(4)-IT (via sysctl, and possibly for mpr/mpt also) would be very welcome. Top on my wishlist was extending mpsutil(8) to be able to list and selectively delete single serial-targetID mappings, but I haven't even found a way to do that with any vendor provided tool, not even with LSIUtil – where I can at least erase _all_ mappings. > functionality should be properly documented in the driver. Thanks for your continuous supprt/help/improvements! -Harry From owner-svn-src-head@freebsd.org Thu Nov 10 08:06:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4556BC39C28 for ; Thu, 10 Nov 2016 08:06:34 +0000 (UTC) (envelope-from 3iSokWA4JDDYhjgkWUmlWXfnknYeSad.Ugeknf-kjU-ZWSVXjWWTkV.gjY@trix.bounces.google.com) Received: from mail-it0-x248.google.com (mail-it0-x248.google.com [IPv6:2607:f8b0:4001:c0b::248]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21231BA0 for ; Thu, 10 Nov 2016 08:06:34 +0000 (UTC) (envelope-from 3iSokWA4JDDYhjgkWUmlWXfnknYeSad.Ugeknf-kjU-ZWSVXjWWTkV.gjY@trix.bounces.google.com) Received: by mail-it0-x248.google.com with SMTP id w132so11147423ita.1 for ; Thu, 10 Nov 2016 00:06:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:message-id:date:subject:from:to; bh=fPH+8nu8jRGclxCznf6hLflCjRDuxYXbljc8bn4AVrc=; b=R9KpdvA+esIiDzZNIhBvSz7h7Nl+UEyWsDSGqpoH/5g7pdBUcWxlgDi19IEqqOpzxL LAx/vnTIT5OZ5DwvCOFVNgTJInV2jcd0+f3MINjK9mNIgayB7ocIfqwGLsG/az8wCZrg fcj+nhNH4F8qzzJhfK47pq3uaBdO5Nd64Iq3fhEbPvdM/Yp1rxyU/1r1Y5pgyq5L8yqO /csO4AU7Om5INo7VwWHWCzxRnlqL6wVUnB920FH1PaCJQDBC5U8YY1sw8hXumba0V6kl kRyqrCZw4HvYLKk/tNkBmg2DBd74TSVQcUAhK0HRV6eRBP4hNiMcYgOtWnfPpcwSAc51 OOwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:message-id:date:subject :from:to; bh=fPH+8nu8jRGclxCznf6hLflCjRDuxYXbljc8bn4AVrc=; b=bUJNPOl1iHWQhfRhMYrHfZcWe0EaAXWA84x/ZDwUCEBHA22voBRpd8u3nLgRlJ54OR 55txs6q8Kz3CDjduNrluA0QpnVCDtQpkAlILNsAfWSYICyD1qNnxpY+WL7V6IDa5QWGs +SVk5C2hG3B/m6dFQ9cJMbMvzdJKsqboEzBYGgVHg6/1wpXneycqApg21Cri8a9emeWg AVwyhpZvZHQdhHJ9ffmrsO0k0bJ7w8mvbgXWPL30e5Uu0KPKT1Mk+mrVP9g/sK1imH5L sprIqutW09ceeR8oCUf1xe4GmvHGRKgHwwf4q73ar3Oljfj3BVIhSaYcEhEOX22EANcM gmXg== X-Gm-Message-State: ABUngvfggHPgYbuRsGFJOiHiKRF7iUUg/BS3L0V4W57zv2my/3llquMeX9HL24WHOljiw1IdEnA9Un80Rz0lP+w= MIME-Version: 1.0 X-Received: by 10.157.35.50 with SMTP id j47mt747711otb.4.1478765193368; Thu, 10 Nov 2016 00:06:33 -0800 (PST) Reply-To: prosecutefnvsv@gmail.com X-No-Auto-Attachment: 1 Message-ID: <001a113d0acc0eab500540eddabf@google.com> Date: Thu, 10 Nov 2016 08:06:33 +0000 Subject: =?UTF-8?B?IOS4gOWkqTQ55Liq5LiA5a+55LiA5Zue5aSN77yM5oq15b6X6L+H5LiA5Liq5pyI55qE?= =?UTF-8?B?5a+755uY6YeP?= From: prosecutefnvsv@gmail.com To: svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 08:06:34 -0000 5oiR5bey6YKA6K+35oKo5aGr5YaZ5Lul5LiL6KGo5Y2V77yaDQrmnKrlkb3lkI3nmoTooajljZUN Cg0K6KaB5aGr5YaZ5q2k6KGo5Y2V77yM6K+36K6/6Zeu77yaDQpodHRwczovL2RvY3MuZ29vZ2xl LmNvbS9mb3Jtcy9kL2UvMUZBSXBRTFNmLXFsSUdVR3BVMldtcjMweXRYU3A1a1ZiWXFZekw1Z2s1 bk5jVXlQejZFb2pST1Evdmlld2Zvcm0/Yz0wJmFtcDt3PTEmYW1wO3VzcD1tYWlsX2Zvcm1fbGlu aw0KDQrkuLvliqjmib7lrqLmiLfnmoTml7bku6MNCjEu6K6p5YWo55CD5r2c5Zyo5a6i5oi36YO9 6K6w5L2P5L2gIO+8iOWvueWFqOeQg+ebruagh+WuouaIt+WRqOacn+S4u+WKqOW7uueri+iBlOe7 nO+8jOeyvuWHhuaOqOW5v+aViOaenO+8iQ0KMi7orqnlm6LpmJ/mm7TliqDnqLPlrprvvIgg5Lia 5Yqh5ZGY5Li75Yqo5Yib6YCg5py65Lya77yM5q+P5aSp5pyJ5LqL5YGa77yJDQozLuWuouaIt+i1 hOaWme+8jOadpeW+gOmCruS7tu+8jOi9u+advueuoeeQhu+8iOWuouaIt+i1hOaWmembhuS4re+8 jOW+gOadpemCruS7tuiHquWKqOW9ouaIkOiBlOezu+iusOW9le+8jOacieaViCANCui+heWvvOS4 muWKoeWboumYn++8iQ0KNC7ovbvmnb7lkK/liqjlpJbotLjkuJrliqHvvIgg5pyA5a655piT5om+ 5Yiw5bel5L2c5YWl5Y+j77yMTm8g5bGV5Lya77yMTm/lubPlj7DvvIxOMOaJi+W3peaQnOe0ouWu ouaIt++8iQ0KDQogIOWSqOivolEgUTogMjUzNTU4ODMwOA0KICAgIOeUtSDor53vvJoxMzY3MDIw MDYxNQ0KDQoNCkdvb2dsZeihqOWNle+8muWIm+W7uuiwg+afpemXruWNt+W5tuWIhuaekOiwg+af pee7k+aenOOAgg0K From owner-svn-src-head@freebsd.org Thu Nov 10 10:45:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5426C392C2; Thu, 10 Nov 2016 10:45:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D515987; Thu, 10 Nov 2016 10:45:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAAAjC5v098417; Thu, 10 Nov 2016 10:45:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAAAjCvp098416; Thu, 10 Nov 2016 10:45:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611101045.uAAAjCvp098416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 10 Nov 2016 10:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308479 - head/usr.sbin/watchdogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 10:45:13 -0000 Author: avg Date: Thu Nov 10 10:45:12 2016 New Revision: 308479 URL: https://svnweb.freebsd.org/changeset/base/308479 Log: fix a watchdogd regression introduced in r308040 The code assumed that 'timeout' and 'timeout_sec' are in sync which they weren't if no '-t' option was passed to watchdogd. Reported by: Olivier Smedts , Alex Deiter Tested by: Olivier Smedts , Alex Deiter MFC after: 5 days X-MFC with: r308040 Modified: head/usr.sbin/watchdogd/watchdogd.c Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Thu Nov 10 07:05:41 2016 (r308478) +++ head/usr.sbin/watchdogd/watchdogd.c Thu Nov 10 10:45:12 2016 (r308479) @@ -685,10 +685,15 @@ seconds_to_pow2ns(int seconds) static void parseargs(int argc, char *argv[]) { + struct timespec ts; int longindex; int c; const char *lopt; + /* Get the default value of timeout_sec from the default timeout. */ + pow2ns_to_ts(timeout, &ts); + timeout_sec = ts.tv_sec; + /* * if we end with a 'd' aka 'watchdogd' then we are the daemon program, * otherwise run as a command line utility. @@ -731,9 +736,9 @@ parseargs(int argc, char *argv[]) case 't': timeout_sec = atoi(optarg); timeout = parse_timeout_to_pow2ns(c, NULL, optarg); - if (debugging) - printf("Timeout is 2^%d nanoseconds\n", - timeout); + if (debugging) + printf("Timeout is 2^%d nanoseconds\n", + timeout); break; case 'T': carp_thresh_seconds = @@ -782,10 +787,7 @@ parseargs(int argc, char *argv[]) if (is_daemon && timeout < WD_TO_1SEC) errx(EX_USAGE, "-t argument is less than one second."); if (pretimeout_set) { - struct timespec ts; - - pow2ns_to_ts(timeout, &ts); - if (pretimeout >= (uintmax_t)ts.tv_sec) { + if (pretimeout >= timeout_sec) { errx(EX_USAGE, "pretimeout (%d) >= timeout (%d -> %ld)\n" "see manual section TIMEOUT RESOLUTION", From owner-svn-src-head@freebsd.org Thu Nov 10 11:12:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D176C39F2A; Thu, 10 Nov 2016 11:12:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A0AAB6A; Thu, 10 Nov 2016 11:12:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAABCjn4010278; Thu, 10 Nov 2016 11:12:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAABCjJt010277; Thu, 10 Nov 2016 11:12:45 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611101112.uAABCjJt010277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 10 Nov 2016 11:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308480 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 11:12:46 -0000 Author: avg Date: Thu Nov 10 11:12:45 2016 New Revision: 308480 URL: https://svnweb.freebsd.org/changeset/base/308480 Log: pmc_process_csw_out: ignore deleted counters I see the fllowing panic on AMD when exiting pmcstat: panic: [pmc,1473] pp_pmcval outside of expected range cpu=2 ri=17 pp_pmcval=fffffffffa529f5b pm_reloadcount=10000 It seems that at least on AMD a performance counter keeps counting after overflowing. When pmcstat exits it sets counters that it used to PMC_STATE_DELETED and waits until their use count goes to zero. amd_intr() wouldn't reload a counter in that state and, thus, a counter would be allowed to overflow. That means that the counter's value would be allowed to go outside the expected range. MFC after: 2 weeks Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Thu Nov 10 10:45:12 2016 (r308479) +++ head/sys/dev/hwpmc/hwpmc_mod.c Thu Nov 10 11:12:45 2016 (r308480) @@ -1431,8 +1431,8 @@ pmc_process_csw_out(struct thread *td) * save the reading. */ - if (pp != NULL && pp->pp_pmcs[ri].pp_pmc != NULL) { - + if (pm->pm_state != PMC_STATE_DELETED && pp != NULL && + pp->pp_pmcs[ri].pp_pmc != NULL) { KASSERT(pm == pp->pp_pmcs[ri].pp_pmc, ("[pmc,%d] pm %p != pp_pmcs[%d] %p", __LINE__, pm, ri, pp->pp_pmcs[ri].pp_pmc)); From owner-svn-src-head@freebsd.org Thu Nov 10 12:54:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C5F8C38D52; Thu, 10 Nov 2016 12:54:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05BBE194; Thu, 10 Nov 2016 12:54:33 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAACsXvG049742; Thu, 10 Nov 2016 12:54:33 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAACsXEu049741; Thu, 10 Nov 2016 12:54:33 GMT (envelope-from br@FreeBSD.org) Message-Id: <201611101254.uAACsXEu049741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 10 Nov 2016 12:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308483 - head/contrib/llvm/projects/libunwind/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 12:54:34 -0000 Author: br Date: Thu Nov 10 12:54:33 2016 New Revision: 308483 URL: https://svnweb.freebsd.org/changeset/base/308483 Log: Implement riscv jumpto() so world can be compiled. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S ============================================================================== --- head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Thu Nov 10 11:14:51 2016 (r308482) +++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Thu Nov 10 12:54:33 2016 (r308483) @@ -480,6 +480,50 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9li #elif defined(__riscv__) -/* RISCVTODO */ +// +// void libunwind::Registers_riscv::jumpto() +// +// On entry: +// thread_state pointer is in a0 +// + .p2align 2 +DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind15Registers_riscv6jumptoEv) + // x0 is zero + ld x1, (8 * 1)(a0) + ld x2, (8 * 2)(a0) + ld x3, (8 * 3)(a0) + ld x4, (8 * 4)(a0) + ld x5, (8 * 5)(a0) + ld x6, (8 * 6)(a0) + ld x7, (8 * 7)(a0) + ld x8, (8 * 8)(a0) + ld x9, (8 * 9)(a0) + // skip a0 for now + ld x11, (8 * 11)(a0) + ld x12, (8 * 12)(a0) + ld x13, (8 * 13)(a0) + ld x14, (8 * 14)(a0) + ld x15, (8 * 15)(a0) + ld x16, (8 * 16)(a0) + ld x17, (8 * 17)(a0) + ld x18, (8 * 18)(a0) + ld x19, (8 * 19)(a0) + ld x20, (8 * 20)(a0) + ld x21, (8 * 21)(a0) + ld x22, (8 * 22)(a0) + ld x23, (8 * 23)(a0) + ld x24, (8 * 24)(a0) + ld x25, (8 * 25)(a0) + ld x26, (8 * 26)(a0) + ld x27, (8 * 27)(a0) + ld x28, (8 * 28)(a0) + ld x29, (8 * 29)(a0) + ld x30, (8 * 30)(a0) + ld x31, (8 * 31)(a0) + ld x10, (8 * 10)(a0) // restore a0 + + /* RISCVTODO: restore FPU registers */ + + ret // jump to ra #endif From owner-svn-src-head@freebsd.org Thu Nov 10 16:27:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3795EC3A517; Thu, 10 Nov 2016 16:27:35 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09B08328; Thu, 10 Nov 2016 16:27:34 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAAGRYfv031917; Thu, 10 Nov 2016 16:27:34 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAAGRYZo031916; Thu, 10 Nov 2016 16:27:34 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201611101627.uAAGRYZo031916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Thu, 10 Nov 2016 16:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308484 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 16:27:35 -0000 Author: antoine Date: Thu Nov 10 16:27:34 2016 New Revision: 308484 URL: https://svnweb.freebsd.org/changeset/base/308484 Log: Add limits(1) to native-xtools so that it can be used in qemu user-mode jails Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Nov 10 12:54:33 2016 (r308483) +++ head/Makefile.inc1 Thu Nov 10 16:27:34 2016 (r308484) @@ -1954,6 +1954,7 @@ native-xtools: .PHONY usr.bin/gzip \ usr.bin/id \ usr.bin/lex \ + usr.bin/limits \ usr.bin/lorder \ usr.bin/mktemp \ usr.bin/mt \ From owner-svn-src-head@freebsd.org Thu Nov 10 18:36:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1513C3842C; Thu, 10 Nov 2016 18:36:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 770DA382; Thu, 10 Nov 2016 18:36:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAAIaeWn082293; Thu, 10 Nov 2016 18:36:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAAIaeUE082291; Thu, 10 Nov 2016 18:36:40 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611101836.uAAIaeUE082291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 10 Nov 2016 18:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308485 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 18:36:41 -0000 Author: adrian Date: Thu Nov 10 18:36:40 2016 New Revision: 308485 URL: https://svnweb.freebsd.org/changeset/base/308485 Log: [net80211] implement "first RX defines the BAW" hack. Unfortunately (sigh) some firmware doesn't provide the RX BA starting point, so we need to cope and set a "close enough" sequence number so we (hopefully!) don't discard frames as duplicates. Tested: * QCA9880v2, athp driver (under development), STA mode Modified: head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_ht.h Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Thu Nov 10 16:27:34 2016 (r308484) +++ head/sys/net80211/ieee80211_ht.c Thu Nov 10 18:36:40 2016 (r308485) @@ -582,7 +582,13 @@ ieee80211_ampdu_rx_start_ext(struct ieee memset(rap, 0, sizeof(*rap)); rap->rxa_wnd = (baw== 0) ? IEEE80211_AGGR_BAWMAX : min(baw, IEEE80211_AGGR_BAWMAX); - rap->rxa_start = seq; + if (seq == -1) { + /* Wait for the first RX frame, use that as BAW */ + rap->rxa_start = 0; + rap->rxa_flags |= IEEE80211_AGGR_WAITRX; + } else { + rap->rxa_start = seq; + } rap->rxa_flags |= IEEE80211_AGGR_RUNNING | IEEE80211_AGGR_XCHGPEND; IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, @@ -617,7 +623,9 @@ ampdu_rx_stop(struct ieee80211_node *ni, { ampdu_rx_purge(rap); - rap->rxa_flags &= ~(IEEE80211_AGGR_RUNNING | IEEE80211_AGGR_XCHGPEND); + rap->rxa_flags &= ~(IEEE80211_AGGR_RUNNING + | IEEE80211_AGGR_XCHGPEND + | IEEE80211_AGGR_WAITRX); } /* @@ -842,6 +850,16 @@ ieee80211_ampdu_reorder(struct ieee80211 } rxseq >>= IEEE80211_SEQ_SEQ_SHIFT; rap->rxa_nframes++; + + /* + * Handle waiting for the first frame to define the BAW. + * Some firmware doesn't provide the RX of the starting point + * of the BAW and we have to cope. + */ + if (rap->rxa_flags & IEEE80211_AGGR_WAITRX) { + rap->rxa_flags &= ~IEEE80211_AGGR_WAITRX; + rap->rxa_start = rxseq; + } again: if (rxseq == rap->rxa_start) { /* Modified: head/sys/net80211/ieee80211_ht.h ============================================================================== --- head/sys/net80211/ieee80211_ht.h Thu Nov 10 16:27:34 2016 (r308484) +++ head/sys/net80211/ieee80211_ht.h Thu Nov 10 18:36:40 2016 (r308485) @@ -44,6 +44,7 @@ struct ieee80211_tx_ampdu { #define IEEE80211_AGGR_SETUP 0x0008 /* deferred state setup */ #define IEEE80211_AGGR_NAK 0x0010 /* peer NAK'd ADDBA request */ #define IEEE80211_AGGR_BARPEND 0x0020 /* BAR response pending */ +#define IEEE80211_AGGR_WAITRX 0x0040 /* Wait for first RX frame to define BAW */ uint8_t txa_tid; uint8_t txa_token; /* dialog token */ int txa_lastsample; /* ticks @ last traffic sample */ From owner-svn-src-head@freebsd.org Thu Nov 10 18:41:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03DB9C38804; Thu, 10 Nov 2016 18:41:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4E13BF2; Thu, 10 Nov 2016 18:41:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAAIfhGu082648; Thu, 10 Nov 2016 18:41:43 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAAIfhDv082647; Thu, 10 Nov 2016 18:41:43 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201611101841.uAAIfhDv082647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 10 Nov 2016 18:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308486 - head/sbin/pfctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 18:41:45 -0000 Author: kp Date: Thu Nov 10 18:41:43 2016 New Revision: 308486 URL: https://svnweb.freebsd.org/changeset/base/308486 Log: pfctl: fix nested inline anchors Import the OpenBSD fix for nested inline anchors. PR: 196314 Submitted by: krichy@cflinux.hu Obtained from: OpenBSD Modified: head/sbin/pfctl/pfctl.c Modified: head/sbin/pfctl/pfctl.c ============================================================================== --- head/sbin/pfctl/pfctl.c Thu Nov 10 18:36:40 2016 (r308485) +++ head/sbin/pfctl/pfctl.c Thu Nov 10 18:41:43 2016 (r308486) @@ -1339,7 +1339,7 @@ pfctl_load_rule(struct pfctl *pf, char * else snprintf(&path[len], MAXPATHLEN - len, "%s", r->anchor->name); - name = path; + name = r->anchor->name; } else name = r->anchor->path; } else From owner-svn-src-head@freebsd.org Thu Nov 10 19:40:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32647C3ABDA; Thu, 10 Nov 2016 19:40:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE629DF1; Thu, 10 Nov 2016 19:40:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAAJeFl4006572; Thu, 10 Nov 2016 19:40:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAAJeF4m006571; Thu, 10 Nov 2016 19:40:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201611101940.uAAJeF4m006571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 10 Nov 2016 19:40:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308487 - head/contrib/llvm/lib/Target/AArch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 19:40:16 -0000 Author: dim Date: Thu Nov 10 19:40:14 2016 New Revision: 308487 URL: https://svnweb.freebsd.org/changeset/base/308487 Log: Pull in r263301 from upstream llvm trunk (by Ahmed Bougacha): [AArch64] Don't blindly lower f16/f128 FCCMPs. Instead, extend f16 (like we do when lowering a standalone SETCC), and let f128 be legalized to the RT calls. Fixes PR26803. This fixes a fatal "Cannot select" backend error when building the net/freerdp port for AArch64. PR: 214380 MFC after: 3 days Modified: head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Modified: head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Thu Nov 10 18:41:43 2016 (r308486) +++ head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Thu Nov 10 19:40:14 2016 (r308487) @@ -1177,8 +1177,14 @@ static SDValue emitComparison(SDValue LH SDLoc dl, SelectionDAG &DAG) { EVT VT = LHS.getValueType(); - if (VT.isFloatingPoint()) + if (VT.isFloatingPoint()) { + assert(VT != MVT::f128); + if (VT == MVT::f16) { + LHS = DAG.getNode(ISD::FP_EXTEND, dl, MVT::f32, LHS); + RHS = DAG.getNode(ISD::FP_EXTEND, dl, MVT::f32, RHS); + } return DAG.getNode(AArch64ISD::FCMP, dl, VT, LHS, RHS); + } // The CMP instruction is just an alias for SUBS, and representing it as // SUBS means that it's possible to get CSE with subtract operations. @@ -1261,9 +1267,14 @@ static SDValue emitConditionalComparison SDValue Condition, unsigned NZCV, SDLoc DL, SelectionDAG &DAG) { unsigned Opcode = 0; - if (LHS.getValueType().isFloatingPoint()) + if (LHS.getValueType().isFloatingPoint()) { + assert(LHS.getValueType() != MVT::f128); + if (LHS.getValueType() == MVT::f16) { + LHS = DAG.getNode(ISD::FP_EXTEND, DL, MVT::f32, LHS); + RHS = DAG.getNode(ISD::FP_EXTEND, DL, MVT::f32, RHS); + } Opcode = AArch64ISD::FCCMP; - else if (RHS.getOpcode() == ISD::SUB) { + } else if (RHS.getOpcode() == ISD::SUB) { SDValue SubOp0 = RHS.getOperand(0); if (isNullConstant(SubOp0) && (CC == ISD::SETEQ || CC == ISD::SETNE)) { // See emitComparison() on why we can only do this for SETEQ and SETNE. @@ -1290,6 +1301,8 @@ static bool isConjunctionDisjunctionTree return false; unsigned Opcode = Val->getOpcode(); if (Opcode == ISD::SETCC) { + if (Val->getOperand(0).getValueType() == MVT::f128) + return false; CanPushNegate = true; return true; } From owner-svn-src-head@freebsd.org Thu Nov 10 19:55:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD6F3C3A13E; Thu, 10 Nov 2016 19:55:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 793E6C19; Thu, 10 Nov 2016 19:55:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAAJtjnp014003; Thu, 10 Nov 2016 19:55:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAAJtjEM013998; Thu, 10 Nov 2016 19:55:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201611101955.uAAJtjEM013998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 10 Nov 2016 19:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308489 - in head/usr.bin: systat top vmstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 19:55:46 -0000 Author: markj Date: Thu Nov 10 19:55:45 2016 New Revision: 308489 URL: https://svnweb.freebsd.org/changeset/base/308489 Log: Add the laundry page count to the displays of systat, top, and vmstat. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D8467 Modified: head/usr.bin/systat/systat.1 head/usr.bin/systat/vmstat.c head/usr.bin/top/machine.c head/usr.bin/top/top.local.1 head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/systat/systat.1 ============================================================================== --- head/usr.bin/systat/systat.1 Thu Nov 10 19:50:19 2016 (r308488) +++ head/usr.bin/systat/systat.1 Thu Nov 10 19:55:45 2016 (r308489) @@ -28,7 +28,7 @@ .\" @(#)systat.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd October 24, 2015 +.Dd November 10, 2016 .Dt SYSTAT 1 .Os .Sh NAME @@ -411,7 +411,7 @@ as amounts of memory in kilobytes, pages wired down (`wire'), active pages (`act'), inactive pages (`inact'), -pages on the cache queue (`cache'), +dirty pages queued for laundering (`laund'), and free pages (`free'). Note that the values displayed are the current transient ones; Modified: head/usr.bin/systat/vmstat.c ============================================================================== --- head/usr.bin/systat/vmstat.c Thu Nov 10 19:50:19 2016 (r308488) +++ head/usr.bin/systat/vmstat.c Thu Nov 10 19:55:45 2016 (r308489) @@ -92,7 +92,7 @@ static struct Info { u_int v_vnodepgsin; /* vnode_pager pages paged in */ u_int v_vnodepgsout; /* vnode pager pages paged out */ u_int v_intrans; /* intransit blocking page faults */ - u_int v_reactivated; /* number of pages reactivated from free list */ + u_int v_reactivated; /* number of pages reactivated by pagedaemon */ u_int v_pdwakeups; /* number of times daemon has awaken from sleep */ u_int v_pdpages; /* number of pages analyzed by daemon */ @@ -107,7 +107,7 @@ static struct Info { u_int v_wire_count; /* number of pages wired down */ u_int v_active_count; /* number of pages active */ u_int v_inactive_count; /* number of pages inactive */ - u_int v_cache_count; /* number of pages on buffer cache queue */ + u_int v_laundry_count; /* number of pages in laundry queue */ u_long v_kmem_map_size; /* Current kmem allocation size */ struct vmtotal Total; struct nchstats nchstats; @@ -343,7 +343,7 @@ labelkre(void) mvprintw(VMSTATROW + 12, VMSTATCOL + 9, "wire"); mvprintw(VMSTATROW + 13, VMSTATCOL + 9, "act"); mvprintw(VMSTATROW + 14, VMSTATCOL + 9, "inact"); - mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "cache"); + mvprintw(VMSTATROW + 15, VMSTATCOL + 9, "laund"); mvprintw(VMSTATROW + 16, VMSTATCOL + 9, "free"); if (LINES - 1 > VMSTATROW + 17) mvprintw(VMSTATROW + 17, VMSTATCOL + 9, "buf"); @@ -519,7 +519,7 @@ showkre(void) putint(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); putint(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); putint(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); - putint(pgtokb(s.v_cache_count), VMSTATROW + 15, VMSTATCOL, 8); + putint(pgtokb(s.v_laundry_count), VMSTATROW + 15, VMSTATCOL, 8); putint(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); if (LINES - 1 > VMSTATROW + 17) putint(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); @@ -794,7 +794,7 @@ getinfo(struct Info *ls) GETSYSCTL("vm.stats.vm.v_wire_count", ls->v_wire_count); GETSYSCTL("vm.stats.vm.v_active_count", ls->v_active_count); GETSYSCTL("vm.stats.vm.v_inactive_count", ls->v_inactive_count); - GETSYSCTL("vm.stats.vm.v_cache_count", ls->v_cache_count); + GETSYSCTL("vm.stats.vm.v_laundry_count", ls->v_laundry_count); GETSYSCTL("vfs.bufspace", ls->bufspace); GETSYSCTL("kern.maxvnodes", ls->desiredvnodes); GETSYSCTL("vfs.numvnodes", ls->numvnodes); Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Thu Nov 10 19:50:19 2016 (r308488) +++ head/usr.bin/top/machine.c Thu Nov 10 19:55:45 2016 (r308489) @@ -178,7 +178,7 @@ char *cpustatenames[] = { int memory_stats[7]; char *memorynames[] = { - "K Active, ", "K Inact, ", "K Wired, ", "K Cache, ", "K Buf, ", + "K Active, ", "K Inact, ", "K Laundry, ", "K Wired, ", "K Buf, ", "K Free", NULL }; @@ -503,8 +503,8 @@ get_system_info(struct system_info *si) GETSYSCTL("vfs.bufspace", bufspace); GETSYSCTL("vm.stats.vm.v_active_count", memory_stats[0]); GETSYSCTL("vm.stats.vm.v_inactive_count", memory_stats[1]); - GETSYSCTL("vm.stats.vm.v_wire_count", memory_stats[2]); - GETSYSCTL("vm.stats.vm.v_cache_count", memory_stats[3]); + GETSYSCTL("vm.stats.vm.v_laundry_count", memory_stats[2]); + GETSYSCTL("vm.stats.vm.v_wire_count", memory_stats[3]); GETSYSCTL("vm.stats.vm.v_free_count", memory_stats[5]); GETSYSCTL("vm.stats.vm.v_swappgsin", nspgsin); GETSYSCTL("vm.stats.vm.v_swappgsout", nspgsout); Modified: head/usr.bin/top/top.local.1 ============================================================================== --- head/usr.bin/top/top.local.1 Thu Nov 10 19:50:19 2016 (r308488) +++ head/usr.bin/top/top.local.1 Thu Nov 10 19:55:45 2016 (r308489) @@ -2,8 +2,8 @@ .SH "FreeBSD NOTES" .SH DESCRIPTION OF MEMORY -Mem: 9220K Active, 1M Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free -ARC: 2048K Total, 342K MRU, 760K MFU, 272K Anon, 232K Header, 442K Other +Mem: 9220K Active, 1M Inact, 1M Laundry, 3284K Wired, 2M Buf, 932K Free +ARC: 2048K Total, 342K MRU, 760K MFU, 272K Anon, 96K Header, 442K Other Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out .TP .B K: @@ -23,15 +23,14 @@ Gigabyte number of bytes active .TP .B Inact: -number of bytes inactive +number of clean bytes inactive +.TP +.B Laundry: +number of dirty bytes queued for laundering .TP .B Wired: number of bytes wired down, including BIO-level cached file data pages .TP -.B Cache: -number of clean bytes caching data that are available for -immediate reallocation -.TP .B Buf: number of bytes used for BIO-level disk caching .TP Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Thu Nov 10 19:50:19 2016 (r308488) +++ head/usr.bin/vmstat/vmstat.c Thu Nov 10 19:55:45 2016 (r308489) @@ -567,7 +567,7 @@ fill_vmmeter(struct vmmeter *vmmp) GET_VM_STATS(vm, v_reactivated); GET_VM_STATS(vm, v_pdwakeups); GET_VM_STATS(vm, v_pdpages); - GET_VM_STATS(vm, v_tcached); + GET_VM_STATS(vm, v_pdshortfalls); GET_VM_STATS(vm, v_dfree); GET_VM_STATS(vm, v_pfree); GET_VM_STATS(vm, v_tfree); @@ -581,7 +581,7 @@ fill_vmmeter(struct vmmeter *vmmp) GET_VM_STATS(vm, v_active_count); GET_VM_STATS(vm, v_inactive_target); GET_VM_STATS(vm, v_inactive_count); - GET_VM_STATS(vm, v_cache_count); + GET_VM_STATS(vm, v_laundry_count); GET_VM_STATS(vm, v_pageout_free_min); GET_VM_STATS(vm, v_interrupt_free_min); /*GET_VM_STATS(vm, v_free_severe);*/ @@ -1059,7 +1059,9 @@ dosum(void) sum.v_pdwakeups); xo_emit("{:page-daemon-pages/%9u} {N:pages examined by the page daemon}\n", sum.v_pdpages); - xo_emit("{:reactivated/%9u} {N:pages reactivated}\n", + xo_emit("{:page-reclamation-shortfalls/%9u} {N:clean page reclamation shortfalls}\n", + sum.v_pdshortfalls); + xo_emit("{:reactivated/%9u} {N:pages reactivated by the page daemon}\n", sum.v_reactivated); xo_emit("{:copy-on-write-faults/%9u} {N:copy-on-write faults}\n", sum.v_cow_faults); @@ -1095,8 +1097,8 @@ dosum(void) sum.v_active_count); xo_emit("{:inactive-pages/%9u} {N:pages inactive}\n", sum.v_inactive_count); - xo_emit("{:vm-cache/%9u} {N:pages in VM cache}\n", - sum.v_cache_count); + xo_emit("{:laundry-pages/%9u} {N:pages in the laundry queue}\n", + sum.v_laundry_count); xo_emit("{:wired-pages/%9u} {N:pages wired down}\n", sum.v_wire_count); xo_emit("{:free-pages/%9u} {N:pages free}\n", From owner-svn-src-head@freebsd.org Thu Nov 10 20:49:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CAF4C3AF25; Thu, 10 Nov 2016 20:49:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A64B6B6; Thu, 10 Nov 2016 20:49:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x230.google.com with SMTP id q124so262405071itd.1; Thu, 10 Nov 2016 12:49:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IidboQCDgNj40ZkeIDcw5vLm9lsg9AEBxPZiNx2k/Os=; b=h1EPxfgpX349vIbUqURukWKUNVIVHrqQeNb796scBUTrQW9+ZqaDaZDux31j21z0LI y7O4JRSxVbl84pi9vM7deeGAoTp5eZHZ+CGOT0yAiqakHNS416oF0xjssfhtZKzqIY4A Ui5b/DfstDPaa/f5xNeU9vl6w3GteBcTQ10SGLn1l/iTPqwHj5fTUNxo3MweKb1xRBOJ 1ngHMeOrk9H7GPE6fWqOD+s/fXZC/eUJMIJ0+wp/kSHo41aD2Rae2/JxHSmpnL403ijm N70Dg2Iwwnc7nwWXrEL78hF27kE7nKYL380ZFlMwuBq/szQL5KLr3W31GBJw3+Qco6DE fb7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IidboQCDgNj40ZkeIDcw5vLm9lsg9AEBxPZiNx2k/Os=; b=UQDrIlt+sN4ChAYhzT9YXBZJXBR3wnmDJC9fAzMgkvyJBcr2xsIrgtkeitw6riPYzy BtitWsqbTbsKO1E0N/cKinNWx17MzyHb7vpiynMn7vbzvMuFSYHa9/2B+GqOPelhb4jn TaJFY3xFWQdSwurIdRwYO+r0eVmoosiWyoRKUbLKP17qdPvY7M5HGzJ1/G4AICyKKqDf uNx+PSlzGTbGZimnbIad50Q0FfRRClxDHmF23bKyx0anUnZ4bR7KJOpbhNlqGsXcvWvx EkfjVAsU+/1zCsxVvyk9k17mb2pOCnVXPhHVvhLAgxO4LT30sR/63lVBmZirlZVWgVeV nR3w== X-Gm-Message-State: ABUngvcQQbZgYqrBqGBh03xNThN7oC92z360AaNuNdW9xMEn0JRHCwfRR1U/y6TQ1l1FQ527kUmqwGNlbqxehA== X-Received: by 10.36.65.216 with SMTP id b85mr18818283itd.39.1478810990583; Thu, 10 Nov 2016 12:49:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Thu, 10 Nov 2016 12:49:49 -0800 (PST) In-Reply-To: <20161103201059.GA2104@bsdpad.com> References: <201610311533.u9VFXw2x053156@repo.freebsd.org> <128f2edc-eced-dc8b-72b4-267e1d26bd48@FreeBSD.org> <20161103201059.GA2104@bsdpad.com> From: Adrian Chadd Date: Thu, 10 Nov 2016 12:49:49 -0800 Message-ID: Subject: Re: svn commit: r308130 - in head: . gnu/lib/libgcc gnu/usr.bin/binutils gnu/usr.bin/binutils/ld gnu/usr.bin/binutils/libbfd gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb lib/libc lib/libc/mips... To: Ruslan Bukin Cc: Bryan Drewery , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 20:49:52 -0000 hi, This fails to boot on actual mips24k hardware, no hardfloat: COP1_UNUSABLE: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 ra 0x404224d4 Trapframe Register Dump: zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: 0xffffffffffffffff .. lots of that the moment we boot userland. -adrian On 3 November 2016 at 13:10, Ruslan Bukin wrote: > On Thu, Nov 03, 2016 at 12:39:48PM -0700, Bryan Drewery wrote: >> On 10/31/16 8:33 AM, Ruslan Bukin wrote: >> > Modified: head/share/mk/bsd.cpu.mk >> > ============================================================================== >> > --- head/share/mk/bsd.cpu.mk Mon Oct 31 15:11:55 2016 (r308129) >> > +++ head/share/mk/bsd.cpu.mk Mon Oct 31 15:33:58 2016 (r308130) >> > @@ -303,6 +303,9 @@ MACHINE_CPU = v9 ultrasparc ultrasparc3 >> > >> > .if ${MACHINE_CPUARCH} == "mips" >> > CFLAGS += -G0 >> > +.if ${TARGET_ARCH:Mmips*hf} >> >> TARGET_ARCH is not valid here. This broke building ports. Fixed in >> r308262. >> > > Thank you! > > Ruslan > From owner-svn-src-head@freebsd.org Thu Nov 10 20:51:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C461FC3A0CE; Thu, 10 Nov 2016 20:51:27 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 900EDA39; Thu, 10 Nov 2016 20:51:27 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAAKpQMo033921; Thu, 10 Nov 2016 20:51:26 GMT (envelope-from syrinx@FreeBSD.org) Received: (from syrinx@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAAKpQjT033920; Thu, 10 Nov 2016 20:51:26 GMT (envelope-from syrinx@FreeBSD.org) Message-Id: <201611102051.uAAKpQjT033920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: syrinx set sender to syrinx@FreeBSD.org using -f From: Shteryana Shopova Date: Thu, 10 Nov 2016 20:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308490 - head/contrib/bsnmp/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 20:51:27 -0000 Author: syrinx Date: Thu Nov 10 20:51:26 2016 New Revision: 308490 URL: https://svnweb.freebsd.org/changeset/base/308490 Log: Reply to a snmpEngineID discovery PDU with a Report PDU as per the requirements of RFC 3414 section 4. PR: 174974 Submitted by: pguyot@kallisys.net Reported by: several people Reviewed by: bz@ Modified: head/contrib/bsnmp/lib/snmpagent.c Modified: head/contrib/bsnmp/lib/snmpagent.c ============================================================================== --- head/contrib/bsnmp/lib/snmpagent.c Thu Nov 10 19:55:45 2016 (r308489) +++ head/contrib/bsnmp/lib/snmpagent.c Thu Nov 10 20:51:26 2016 (r308490) @@ -171,7 +171,10 @@ snmp_pdu_create_response(const struct sn memset(resp, 0, sizeof(*resp)); strcpy(resp->community, pdu->community); resp->version = pdu->version; - resp->type = SNMP_PDU_RESPONSE; + if (pdu->flags & SNMP_MSG_AUTODISCOVER) + resp->type = SNMP_PDU_REPORT; /* RFC 3414.4 */ + else + resp->type = SNMP_PDU_RESPONSE; resp->request_id = pdu->request_id; resp->version = pdu->version; From owner-svn-src-head@freebsd.org Thu Nov 10 21:09:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C455C3A735; Thu, 10 Nov 2016 21:09:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 224D66C8; Thu, 10 Nov 2016 21:09:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x233.google.com with SMTP id q124so263606267itd.1; Thu, 10 Nov 2016 13:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=A7aAYWs4jtvsOwJKRQUC6uDZyl/TVMDUnFTmCWDrcDU=; b=NeuDRlDqZ1umwjmoGZJqqgj27J/2ZYyy+f0mrIutI3/xr84kuVjbuhA4k9ImXXtfMm 5QVP3+RTmss+bwk6OPR/tgawjOesiIc98G2IK9azEjk2heTsCh6awjgP3veMbESnMmTz 9c+gtZgXPcDEH9o8d7amx7qC9oJQE59SV/7ND4g+MA9qZYADANvCEVPUwT2Zf3c2R4Qc lf37qvxxN3hle52ULkAxr7Fo4TNA8kX8bSzSO+aHY+ZW9CcuVeCfEv3RrkvEtwkhn2wk KWIXTTTdJnIo+DW+3z7ZTi+mSALaRl3BfFPtJHLhRkpBvH0NbVQEJfDa/qwwG642WSKM fGOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=A7aAYWs4jtvsOwJKRQUC6uDZyl/TVMDUnFTmCWDrcDU=; b=Nxnea5l4b1z3/0OLIEK8MWD1FJYOK1u1BMa6jNi/mo8S0L9iuPuz8YAb5t/w6hRt2R m94H/f4ZwVLKJPsDVk3EYdjs0re8I2owcOj6YVjECxomcPEvLLoEFEqESrxYDg3e/Xle yh8xAHnLfiBpIWtBybVUvDCorv1XAXdI+8P1oIKr72lR2PQCZjQ0H5KqLqw6imZSVHES k+jjl90P//4DQ0IzbN02L6Bh29ajsfD7yn8P+qoD2HfscZ/FSQT+RVEz7jgZVRnPX5nq JgzdRfJo7gvMDM3QiVqFrAASVdu8MhFf8ahqXd1+ujtCaMkMZfCOlBeosjZXr951krU+ 3OwA== X-Gm-Message-State: ABUngve90SHNbReM+MoGsY69NnitTRLad7WfWN9M4LGHFFsmv6GZCqKCWU9/X5vGWjDMgNCjXD3Hah4ewuqqlw== X-Received: by 10.107.192.194 with SMTP id q185mr8237460iof.129.1478812161422; Thu, 10 Nov 2016 13:09:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Thu, 10 Nov 2016 13:09:20 -0800 (PST) In-Reply-To: References: <201610311533.u9VFXw2x053156@repo.freebsd.org> <128f2edc-eced-dc8b-72b4-267e1d26bd48@FreeBSD.org> <20161103201059.GA2104@bsdpad.com> From: Adrian Chadd Date: Thu, 10 Nov 2016 13:09:20 -0800 Message-ID: Subject: Re: svn commit: r308130 - in head: . gnu/lib/libgcc gnu/usr.bin/binutils gnu/usr.bin/binutils/ld gnu/usr.bin/binutils/libbfd gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb lib/libc lib/libc/mips... To: Ruslan Bukin , "freebsd-mips@freebsd.org" Cc: Bryan Drewery , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 21:09:22 -0000 ok, so there are two problems with mips now. * COP1_UNUSABLE - which is now being logged, and we were likely triggering it before. The problem: we always turned it on. If I comment out flipping on the COP1 bits in the .S files, those exceptions go away. * Page faults, but that may be me with an older userland: BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 got a read fault (type 0x2) at 0x8 Trapframe Register Dump: zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: 0xffffffffffffffff a0: 0x404471b8 a1: 0x7ffeea50 a2: 0x16c a3: 0 t0: 0 t1: 0 t2: 0 t3: 0x70000011 t4: 0x11 t5: 0x70000013 t6: 0x3 t7: 0 t8: 0 t9: 0x4041c940 s0: 0 s1: 0x40417000 s2: 0x7fffeee0 s3: 0xffffffffffffffff s4: 0xc s5: 0x40427000 s6: 0x7fffeecc s7: 0x7ffeea50 k0: 0 k1: 0 gp: 0x4044e630 sp: 0x7ffee838 s8: 0x2 ra: 0x404224d4 sr: 0xfc13 mullo: 0 mulhi: 0 badvaddr: 0x8 cause: 0x8 pc: 0x404237c0 Page table info for pc address 0x404237c0: pde = 0x809aa000, pte = 0xa001ba9a Dumping 4 words starting at pc address 0x404237c0: 8e100008 1600fff1 8f828070 100000a3 -adrian On 10 November 2016 at 12:49, Adrian Chadd wrote: > hi, > > This fails to boot on actual mips24k hardware, no hardfloat: > > COP1_UNUSABLE: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 ra 0x404224d4 > Trapframe Register Dump: > zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: > 0xffffffffffffffff > > .. lots of that the moment we boot userland. > > > > -adrian > > > On 3 November 2016 at 13:10, Ruslan Bukin wrote: >> On Thu, Nov 03, 2016 at 12:39:48PM -0700, Bryan Drewery wrote: >>> On 10/31/16 8:33 AM, Ruslan Bukin wrote: >>> > Modified: head/share/mk/bsd.cpu.mk >>> > ============================================================================== >>> > --- head/share/mk/bsd.cpu.mk Mon Oct 31 15:11:55 2016 (r308129) >>> > +++ head/share/mk/bsd.cpu.mk Mon Oct 31 15:33:58 2016 (r308130) >>> > @@ -303,6 +303,9 @@ MACHINE_CPU = v9 ultrasparc ultrasparc3 >>> > >>> > .if ${MACHINE_CPUARCH} == "mips" >>> > CFLAGS += -G0 >>> > +.if ${TARGET_ARCH:Mmips*hf} >>> >>> TARGET_ARCH is not valid here. This broke building ports. Fixed in >>> r308262. >>> >> >> Thank you! >> >> Ruslan >> From owner-svn-src-head@freebsd.org Thu Nov 10 21:25:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 885D5C3ADD4; Thu, 10 Nov 2016 21:25:21 +0000 (UTC) (envelope-from rionda@gmail.com) Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41C8A24B; Thu, 10 Nov 2016 21:25:21 +0000 (UTC) (envelope-from rionda@gmail.com) Received: by mail-qk0-x22f.google.com with SMTP id n204so302956670qke.2; Thu, 10 Nov 2016 13:25:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=O+JzQDc/2o65igbCvQsUdwEz5AGfyWOtRliDE3nKB9U=; b=MmN/dAGivUZ83Y8ed44Vh31nTFSz0IPIqGKtftOlE3/OyNvdNBmhs8ZJ5HvgUh7dt1 NBVHSDE81rmCRI4mYYNgfKNX1nMTXcGgIN+I2ompo4aOESNgnykI93b80UMrBnSy5laQ ubkizEEL+uS+G0C/A/mDwDtRG5o6c9Baxn+UfaPpBNO0zUoRDzyTnr9vJB2cPoAaIrK2 DQsSGSXDwTBuvS6sNarfwntm3DaWmlPxvTM+uFpBTI3eTK8N9wled3z9cn2R++VIdiKu P466dnYR2qXu48mm7BlpiGUbKdqopOmzw9rbM5z0w0W/W4GvpZ83fH8NjXtq9jc1QFP/ P0wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=O+JzQDc/2o65igbCvQsUdwEz5AGfyWOtRliDE3nKB9U=; b=Gg7kkZQDtPRUaobu2Ikhw7D4M5iKon7K334i3g3vKQidBHb3PHjorJZI0sPzd8Z6BO Gy2dbvVhfXOKXDcvH+t1BhGoVYcgkbWwZFFyy+EoUQGZt5OmiZqA5ZmxOzWmH1ZAcVhB Hc8D+Vx0uoP408C/RqFUxdSfCPi2z9DCVBng+IQ4fykwzU2f+lBNIN0tQK27P7ZC9NmR hegesm1gmYnCWXqgXJiEsa3HGyUeX/dk9Gz1YRWpnTZTqRIDyeU+nkxNc1GkboYi5evB 8edaWG1P8mC/V3qNbPpc7YsCUUDlp7akBc7DEqyc6vPCp3Lnb5jDRe6A7YbUQ4vxczwF uRpA== X-Gm-Message-State: ABUngvcST37nrKcYowGNnAT3b2XmECKATN5waA853I+AchyX+pVWvgE++fxMS+Z2yi7UIw== X-Received: by 10.55.140.194 with SMTP id o185mr7720970qkd.243.1478813120190; Thu, 10 Nov 2016 13:25:20 -0800 (PST) Received: from [172.31.26.254] (gzac12-mdf2-1.aoa.twosigma.com. [208.77.215.155]) by smtp.gmail.com with ESMTPSA id v127sm3579880qkb.29.2016.11.10.13.25.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Nov 2016 13:25:19 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r308175 - head/libexec/ftpd From: Matteo Riondato In-Reply-To: <201611011818.uA1II9oe069262@repo.freebsd.org> Date: Thu, 10 Nov 2016 16:25:18 -0500 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201611011818.uA1II9oe069262@repo.freebsd.org> To: Kurt Lidl X-Mailer: Apple Mail (2.3251) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 21:25:21 -0000 > On Nov 1, 2016, at 2:18 PM, Kurt Lidl wrote: >=20 > Author: lidl > Date: Tue Nov 1 18:18:09 2016 > New Revision: 308175 > URL: https://svnweb.freebsd.org/changeset/base/308175 >=20 > Log: > Revisit blacklistd support in ftpd This commit is breaking buildworld for me with WITHOUT_BLACKLIST=3Dy in = src.conf : --- ftpd.o --- /usr/src/libexec/ftpd/ftpd.c:656:2: warning: implicit declaration of = function 'BLACKLIST_INIT' is invalid in C99 = [-Wimplicit-function-declaration] BLACKLIST_INIT(); ^ /usr/src/libexec/ftpd/ftpd.c:1432:4: warning: implicit declaration of = function 'BLACKLIST_NOTIFY' is invalid in C99 = [-Wimplicit-function-declaration] BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, = STDIN_FILENO, "Login incorrect"); ^ /usr/src/libexec/ftpd/ftpd.c:1432:21: error: use of undeclared = identifier 'BLACKLIST_AUTH_FAIL'; did you mean 'BLACKLIST_NOTIFY'? BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, = STDIN_FILENO, "Login incorrect"); ^~~~~~~~~~~~~~~~~~~ BLACKLIST_NOTIFY /usr/src/libexec/ftpd/ftpd.c:1432:4: note: 'BLACKLIST_NOTIFY' declared = here BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, = STDIN_FILENO, "Login incorrect"); ^ /usr/src/libexec/ftpd/ftpd.c:1450:21: error: use of undeclared = identifier 'BLACKLIST_AUTH_OK'; did you mean 'BLACKLIST_NOTIFY'? BLACKLIST_NOTIFY(BLACKLIST_AUTH_OK, = STDIN_FILENO, "Login successful"); ^~~~~~~~~~~~~~~~~ BLACKLIST_NOTIFY /usr/src/libexec/ftpd/ftpd.c:1432:4: note: 'BLACKLIST_NOTIFY' declared = here BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, = STDIN_FILENO, "Login incorrect"); ^ 2 warnings and 2 errors generated. *** [ftpd.o] Error code 1 Matteo From owner-svn-src-head@freebsd.org Thu Nov 10 21:34:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E38AC3AFD7; Thu, 10 Nov 2016 21:34:57 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-30.csi.cam.ac.uk (ppsw-30.csi.cam.ac.uk [131.111.8.130]) by mx1.freebsd.org (Postfix) with ESMTP id 5BF499F4; Thu, 10 Nov 2016 21:34:56 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from sc1.bsdpad.com ([163.172.212.18]:37801) by ppsw-30.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1c4wzo-000bhA-d4 (Exim 4.86_36-e07b163) (return-path ); Thu, 10 Nov 2016 21:34:56 +0000 Date: Thu, 10 Nov 2016 21:34:12 +0000 From: Ruslan Bukin To: Adrian Chadd Cc: "freebsd-mips@freebsd.org" , Bryan Drewery , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r308130 - in head: . gnu/lib/libgcc gnu/usr.bin/binutils gnu/usr.bin/binutils/ld gnu/usr.bin/binutils/libbfd gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb lib/libc lib/libc/mips... Message-ID: <20161110213412.GA21672@bsdpad.com> References: <201610311533.u9VFXw2x053156@repo.freebsd.org> <128f2edc-eced-dc8b-72b4-267e1d26bd48@FreeBSD.org> <20161103201059.GA2104@bsdpad.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 21:34:57 -0000 Hi, Adrian, thanks, but I have lack of ideas yet. I just tested this on Ingenic X1000 (mips.mipsel) and it works fine, as well as mips.mipselhf (this hardware has FPU). I have no hardware without FPU. What exactly COP_1 bits you have commented to get rid of COP1_UNUSABLE? Ruslan On Thu, Nov 10, 2016 at 01:09:20PM -0800, Adrian Chadd wrote: > ok, so there are two problems with mips now. > > * COP1_UNUSABLE - which is now being logged, and we were likely > triggering it before. The problem: we always turned it on. If I > comment out flipping on the COP1 bits in the .S files, those > exceptions go away. > > * Page faults, but that may be me with an older userland: > > BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 got a > read fault (type 0x2) at 0x8 > Trapframe Register Dump: > zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: > 0xffffffffffffffff > a0: 0x404471b8 a1: 0x7ffeea50 a2: 0x16c a3: 0 > t0: 0 t1: 0 t2: 0 t3: 0x70000011 > t4: 0x11 t5: 0x70000013 t6: 0x3 t7: 0 > t8: 0 t9: 0x4041c940 s0: 0 s1: 0x40417000 > s2: 0x7fffeee0 s3: 0xffffffffffffffff s4: 0xc s5: 0x40427000 > s6: 0x7fffeecc s7: 0x7ffeea50 k0: 0 k1: 0 > gp: 0x4044e630 sp: 0x7ffee838 s8: 0x2 ra: 0x404224d4 > sr: 0xfc13 mullo: 0 mulhi: 0 badvaddr: 0x8 > cause: 0x8 pc: 0x404237c0 > Page table info for pc address 0x404237c0: pde = 0x809aa000, pte = 0xa001ba9a > Dumping 4 words starting at pc address 0x404237c0: > 8e100008 1600fff1 8f828070 100000a3 > > > > -adrian > > > On 10 November 2016 at 12:49, Adrian Chadd wrote: > > hi, > > > > This fails to boot on actual mips24k hardware, no hardfloat: > > > > COP1_UNUSABLE: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 ra 0x404224d4 > > Trapframe Register Dump: > > zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: > > 0xffffffffffffffff > > > > .. lots of that the moment we boot userland. > > > > > > > > -adrian > > > > > > On 3 November 2016 at 13:10, Ruslan Bukin wrote: > >> On Thu, Nov 03, 2016 at 12:39:48PM -0700, Bryan Drewery wrote: > >>> On 10/31/16 8:33 AM, Ruslan Bukin wrote: > >>> > Modified: head/share/mk/bsd.cpu.mk > >>> > ============================================================================== > >>> > --- head/share/mk/bsd.cpu.mk Mon Oct 31 15:11:55 2016 (r308129) > >>> > +++ head/share/mk/bsd.cpu.mk Mon Oct 31 15:33:58 2016 (r308130) > >>> > @@ -303,6 +303,9 @@ MACHINE_CPU = v9 ultrasparc ultrasparc3 > >>> > > >>> > .if ${MACHINE_CPUARCH} == "mips" > >>> > CFLAGS += -G0 > >>> > +.if ${TARGET_ARCH:Mmips*hf} > >>> > >>> TARGET_ARCH is not valid here. This broke building ports. Fixed in > >>> r308262. > >>> > >> > >> Thank you! > >> > >> Ruslan > >> From owner-svn-src-head@freebsd.org Thu Nov 10 22:21:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70D4AC3B700; Thu, 10 Nov 2016 22:21:49 +0000 (UTC) (envelope-from kczekirda@gmail.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A27A3A63; Thu, 10 Nov 2016 22:21:48 +0000 (UTC) (envelope-from kczekirda@gmail.com) Received: by mail-wm0-x232.google.com with SMTP id t79so59903215wmt.0; Thu, 10 Nov 2016 14:21:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vAwjOTZfabfCtM79bnuysLyBrtdB2jKdXzY1cnn+a44=; b=iuSg7/wRHbsWmy996SNJJ71Prp/UT+JPmxcXv51wKitHRFfapfS6xM2E3F5zM35lE5 vYEiwvmpJ0yiBFRj1EuPV0BZKG/QWizZD5hmikEi8erYOPkDj6dgL2JX9jBrpCegE/jU WH1o34jkK/8udAk5TZsT0X0EwMI0dS0xeCnqVxbR9Nc9A8ttYR4+7k4y2mjkvSvJee8O zuvAiTAC2YnKBJA1foVLT+EfIYx0CJc99IuZ4zoBKHLVqj5b+ogfsMmrTxlRyZbLDdKM 5788RAco4hSCj/k3uyxtowhjCQflSXNgVtwqh5E118hLgdam5erbhGPYzti8LD52g5US LhFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vAwjOTZfabfCtM79bnuysLyBrtdB2jKdXzY1cnn+a44=; b=LpevMsV6Sp73aNNAPtuHC3OCkt9cfJ7GWsjzM6s3LhDRCsUkIGdNGQWDhwRdyK/LEf zTci54RNg0vH80624Z6AD5RnBlun/D7Ef4W6rl9yzN7FSvUJkRMRsgm/9T6szxEYpzw6 1ih8wA0MR2rE7nqAKZM5bYuHDkRFjyWbrjW/JYjsaunGbSkwEWz4zlDswUEYgAV0l84U nLh0FwRfm81y9dPDpUEGVXlWAAE6nzUUo/tKyVn16FYR+EyXtNibhJGqQuCL3js62dDF 6r73358l5RDJ94XJDKdRRulrMSw0OQcnixPRmAws4+mbZ+IlYvthZ4ch5Gjx7c+pVpqR C1Fg== X-Gm-Message-State: ABUngvfd8S7Kd2Hy9nudPtsJMs6SR69dewda5pUk6RiowSJN+w8k6xxMgxS5zsi9jiIPB6A79/KxhZRR+Zjd0Q== X-Received: by 10.194.236.72 with SMTP id us8mr6482570wjc.211.1478816506152; Thu, 10 Nov 2016 14:21:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.49.137 with HTTP; Thu, 10 Nov 2016 14:21:15 -0800 (PST) In-Reply-To: <201611080650.uA86oJ7W056026@repo.freebsd.org> References: <201611080650.uA86oJ7W056026@repo.freebsd.org> From: Kamil Czekirda Date: Thu, 10 Nov 2016 23:21:15 +0100 Message-ID: Subject: Re: svn commit: r308434 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libofw sys... To: Toomas Soome Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 22:21:49 -0000 Hi, I got the following: root@current:/usr/src # svnlite up -r r308434 Updating '.': U lib/libstand/stand.h U sys/boot/common/dev_net.c U sys/boot/common/module.c U sys/boot/common/part.c U sys/boot/common/util.c U sys/boot/common/util.h U sys/boot/efi/libefi/efinet.c U sys/boot/efi/libefi/efipart.c U sys/boot/efi/loader/main.c U sys/boot/i386/libfirewire/firewire.c U sys/boot/i386/libi386/bioscd.c U sys/boot/i386/libi386/biosdisk.c U sys/boot/mips/beri/loader/beri_disk_cfi.c U sys/boot/mips/beri/loader/beri_disk_sdcard.c U sys/boot/ofw/libofw/ofw_disk.c U sys/boot/pc98/libpc98/bioscd.c U sys/boot/pc98/libpc98/biosdisk.c U sys/boot/powerpc/kboot/hostdisk.c U sys/boot/powerpc/ps3/ps3cdrom.c U sys/boot/powerpc/ps3/ps3disk.c U sys/boot/uboot/lib/disk.c U sys/boot/usb/storage/umass_loader.c U sys/boot/userboot/userboot/host.c U sys/boot/userboot/userboot/userboot_disk.c U sys/boot/zfs/zfs.c U sys/boot/zfs/zfsimpl.c U sys/boot/i386/libi386/pxe.c Updated to revision 308434. root@current:/usr/src # cd sys/boot/ root@current:/usr/src/sys/boot # make clean (...) root@current:/usr/src/sys/boot # make obj (...) root@current:/usr/src/sys/boot # make (...) cc -O2 -pipe -DSKEIN_LOOP=111 -fPIC -I/usr/src/sys/boot/efi/loader -I/usr/src/sys/boot/efi/loader/arch/amd64 -I/usr/src/sys/boot/efi/loader/../include -I/usr/src/sys/boot/efi/loader/../include/amd64 -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include -I/usr/src/sys/boot/efi/loader/../../.. -I/usr/src/sys/boot/efi/loader/../../i386/libi386 -I/usr/src/sys/boot/efi/loader/../../zfs -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT -DNO_PCI -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH -I/usr/src/sys/boot/efi/loader/../../ficl -I/usr/src/sys/boot/efi/loader/../../ficl/amd64 -DLOADER_DISK_SUPPORT -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC -I/usr/src/sys/boot/ficl -I/usr/src/sys/boot/ficl/amd64 -I/usr/src/sys/boot/ficl/../common -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat -msoft-float -mno-mmx -mno-sse -mno-avx -fshort-wchar -mno-red-zone -mno-aes -g -MD -MF.depend.vers.o -MTvers.o -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Qunused-arguments -c vers.c -o vers.o cc -O2 -pipe -DSKEIN_LOOP=111 -fPIC -I/usr/src/sys/boot/efi/loader -I/usr/src/sys/boot/efi/loader/arch/amd64 -I/usr/src/sys/boot/efi/loader/../include -I/usr/src/sys/boot/efi/loader/../include/amd64 -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include -I/usr/src/sys/boot/efi/loader/../../.. -I/usr/src/sys/boot/efi/loader/../../i386/libi386 -I/usr/src/sys/boot/efi/loader/../../zfs -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT -DNO_PCI -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH -I/usr/src/sys/boot/efi/loader/../../ficl -I/usr/src/sys/boot/efi/loader/../../ficl/amd64 -DLOADER_DISK_SUPPORT -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC -I/usr/src/sys/boot/ficl -I/usr/src/sys/boot/ficl/amd64 -I/usr/src/sys/boot/ficl/../common -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat -msoft-float -mno-mmx -mno-sse -mno-avx -fshort-wchar -mno-red-zone -mno-aes -g -MD -MF.depend.zfs.o -MTzfs.o -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-sign-compare -Wno-array-bounds -Wno-missing-prototypes -Qunused-arguments -c /usr/src/sys/boot/efi/loader/../../zfs/zfs.c -o zfs.o /usr/src/sys/boot/efi/loader/../../zfs/zfs.c:599:14: error: incompatible pointer types initializing 'void (*)(int)' with an expression of type 'int (int)' [-Werror,-Wincompatible-pointer-types] .dv_print = zfs_dev_print, ^~~~~~~~~~~~~ 1 error generated. *** Error code 1 Stop. make[2]: stopped in /usr/src/sys/boot/efi/loader *** Error code 1 Stop. make[1]: stopped in /usr/src/sys/boot/efi *** Error code 1 Stop. make: stopped in /usr/src/sys/boot Kamil 2016-11-08 7:50 GMT+01:00 Toomas Soome : > Author: tsoome > Date: Tue Nov 8 06:50:18 2016 > New Revision: 308434 > URL: https://svnweb.freebsd.org/changeset/base/308434 > > Log: > Loader paged/pageable data is not always paged. > > This change does modify devsw dv_print() to return the int value, > enabling walkers to interrupt the walk on non zero value from dv_print(). > > This will allow the pager_print actually to stop displaying data on > user input, and additionally pager is used in various *dev_print > callbacks, > where it was missing. > > For test, lsdev [-v] command should display data by screenfuls and should > stop when the key 'q' is pressed on pager prompt. > > Reviewed by: allanjude > Approved by: allanjude (mentor) > Differential Revision: https://reviews.freebsd.org/D5461 > > Modified: > head/lib/libstand/stand.h > head/sys/boot/common/dev_net.c > head/sys/boot/common/module.c > head/sys/boot/common/part.c > head/sys/boot/common/util.c > head/sys/boot/common/util.h > head/sys/boot/efi/libefi/efinet.c > head/sys/boot/efi/libefi/efipart.c > head/sys/boot/efi/loader/main.c > head/sys/boot/i386/libfirewire/firewire.c > head/sys/boot/i386/libi386/bioscd.c > head/sys/boot/i386/libi386/biosdisk.c > head/sys/boot/i386/libi386/pxe.c > head/sys/boot/mips/beri/loader/beri_disk_cfi.c > head/sys/boot/mips/beri/loader/beri_disk_sdcard.c > head/sys/boot/ofw/libofw/ofw_disk.c > head/sys/boot/pc98/libpc98/bioscd.c > head/sys/boot/pc98/libpc98/biosdisk.c > head/sys/boot/powerpc/kboot/hostdisk.c > head/sys/boot/powerpc/ps3/ps3cdrom.c > head/sys/boot/powerpc/ps3/ps3disk.c > head/sys/boot/uboot/lib/disk.c > head/sys/boot/usb/storage/umass_loader.c > head/sys/boot/userboot/userboot/host.c > head/sys/boot/userboot/userboot/userboot_disk.c > head/sys/boot/zfs/zfs.c > head/sys/boot/zfs/zfsimpl.c > > Modified: head/lib/libstand/stand.h > ============================================================ > ================== > --- head/lib/libstand/stand.h Tue Nov 8 06:13:22 2016 (r308433) > +++ head/lib/libstand/stand.h Tue Nov 8 06:50:18 2016 (r308434) > @@ -143,7 +143,7 @@ struct devsw { > int (*dv_open)(struct open_file *f, ...); > int (*dv_close)(struct open_file *f); > int (*dv_ioctl)(struct open_file *f, u_long cmd, void > *data); > - void (*dv_print)(int verbose); /* print device > information */ > + int (*dv_print)(int verbose); /* print device > information */ > void (*dv_cleanup)(void); > }; > > > Modified: head/sys/boot/common/dev_net.c > ============================================================ > ================== > --- head/sys/boot/common/dev_net.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/common/dev_net.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -80,7 +80,7 @@ static int net_open(struct open_file *, > static int net_close(struct open_file *); > static void net_cleanup(void); > static int net_strategy(); > -static void net_print(int); > +static int net_print(int); > > static int net_getparams(int sock); > > @@ -325,23 +325,27 @@ exit: > return (0); > } > > -static void > +static int > net_print(int verbose) > { > struct netif_driver *drv; > int i, d, cnt; > + int ret = 0; > > cnt = 0; > for (d = 0; netif_drivers[d]; d++) { > drv = netif_drivers[d]; > for (i = 0; i < drv->netif_nifs; i++) { > printf("\t%s%d:", "net", cnt++); > - if (verbose) > + if (verbose) { > printf(" (%s%d)", drv->netif_bname, > drv->netif_ifs[i].dif_unit); > + } > + if ((ret = pager_output("\n")) != 0) > + return (ret); > } > } > - printf("\n"); > + return (ret); > } > > /* > > Modified: head/sys/boot/common/module.c > ============================================================ > ================== > --- head/sys/boot/common/module.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/common/module.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -254,7 +254,7 @@ command_lsmod(int argc, char *argv[]) > struct kernel_module *mp; > struct file_metadata *md; > char lbuf[80]; > - int ch, verbose; > + int ch, verbose, ret = 0; > > verbose = 0; > optind = 1; > @@ -273,11 +273,13 @@ command_lsmod(int argc, char *argv[]) > > pager_open(); > for (fp = preloaded_files; fp; fp = fp->f_next) { > - sprintf(lbuf, " %p: ", (void *) fp->f_addr); > + snprintf(lbuf, sizeof(lbuf), " %p: ", (void *) fp->f_addr); > pager_output(lbuf); > pager_output(fp->f_name); > - sprintf(lbuf, " (%s, 0x%lx)\n", fp->f_type, (long)fp->f_size); > - pager_output(lbuf); > + snprintf(lbuf, sizeof(lbuf), " (%s, 0x%lx)\n", fp->f_type, > + (long)fp->f_size); > + if (pager_output(lbuf)) > + break; > if (fp->f_args != NULL) { > pager_output(" args: "); > pager_output(fp->f_args); > @@ -287,7 +289,8 @@ command_lsmod(int argc, char *argv[]) > if (fp->f_modules) { > pager_output(" modules: "); > for (mp = fp->f_modules; mp; mp = mp->m_next) { > - sprintf(lbuf, "%s.%d ", mp->m_name, mp->m_version); > + snprintf(lbuf, sizeof(lbuf), "%s.%d ", mp->m_name, > + mp->m_version); > pager_output(lbuf); > } > if (pager_output("\n")) > @@ -296,11 +299,14 @@ command_lsmod(int argc, char *argv[]) > if (verbose) { > /* XXX could add some formatting smarts here to display some > better */ > for (md = fp->f_metadata; md != NULL; md = md->md_next) { > - sprintf(lbuf, " 0x%04x, 0x%lx\n", md->md_type, (long) > md->md_size); > + snprintf(lbuf, sizeof(lbuf), " 0x%04x, 0x%lx\n", > + md->md_type, (long) md->md_size); > if (pager_output(lbuf)) > break; > } > } > + if (ret) > + break; > } > pager_close(); > return(CMD_OK); > > Modified: head/sys/boot/common/part.c > ============================================================ > ================== > --- head/sys/boot/common/part.c Tue Nov 8 06:13:22 2016 (r308433) > +++ head/sys/boot/common/part.c Tue Nov 8 06:50:18 2016 (r308434) > @@ -834,6 +834,7 @@ ptable_iterate(const struct ptable *tabl > { > struct pentry *entry; > char name[32]; > + int ret = 0; > > name[0] = '\0'; > STAILQ_FOREACH(entry, &table->entries, entry) { > @@ -856,9 +857,8 @@ ptable_iterate(const struct ptable *tabl > if (table->type == PTABLE_BSD) > sprintf(name, "%c", (u_char) 'a' + > entry->part.index); > - if (iter(arg, name, &entry->part)) > - return 1; > + if ((ret = iter(arg, name, &entry->part)) != 0) > + return (ret); > } > - return 0; > + return (ret); > } > - > > Modified: head/sys/boot/common/util.c > ============================================================ > ================== > --- head/sys/boot/common/util.c Tue Nov 8 06:13:22 2016 (r308433) > +++ head/sys/boot/common/util.c Tue Nov 8 06:50:18 2016 (r308434) > @@ -114,7 +114,7 @@ strlen(const char *s) > return (len); > } > > -void > +int > printf(const char *fmt, ...) > { > va_list ap; > @@ -178,4 +178,5 @@ nextfmt: > } > } > va_end(ap); > + return (0); > } > > Modified: head/sys/boot/common/util.h > ============================================================ > ================== > --- head/sys/boot/common/util.h Tue Nov 8 06:13:22 2016 (r308433) > +++ head/sys/boot/common/util.h Tue Nov 8 06:50:18 2016 (r308434) > @@ -48,6 +48,6 @@ void strcat(char *dst, const char *src); > char *strchr(const char *s, char ch); > size_t strlen(const char *s); > > -void printf(const char *fmt, ...); > +int printf(const char *fmt, ...); > > #endif /* !_UTIL_H_ */ > > Modified: head/sys/boot/efi/libefi/efinet.c > ============================================================ > ================== > --- head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -252,7 +252,7 @@ efinet_end(struct netif *nif) > } > > static int efinet_dev_init(void); > -static void efinet_dev_print(int); > +static int efinet_dev_print(int); > > struct devsw efinet_dev = { > .dv_name = "net", > @@ -346,14 +346,13 @@ efinet_dev_init() > return (0); > } > > -static void > +static int > efinet_dev_print(int verbose) > { > CHAR16 *text; > EFI_HANDLE h; > - int unit; > + int unit, ret = 0; > > - pager_open(); > for (unit = 0, h = efi_find_handle(&efinet_dev, 0); > h != NULL; h = efi_find_handle(&efinet_dev, ++unit)) { > printf(" %s%d:", efinet_dev.dv_name, unit); > @@ -364,8 +363,8 @@ efinet_dev_print(int verbose) > efi_free_devpath_name(text); > } > } > - if (pager_output("\n")) > + if ((ret = pager_output("\n")) != 0) > break; > } > - pager_close(); > + return (ret); > } > > Modified: head/sys/boot/efi/libefi/efipart.c > ============================================================ > ================== > --- head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -47,7 +47,7 @@ static int efipart_realstrategy(void *, > size_t *); > static int efipart_open(struct open_file *, ...); > static int efipart_close(struct open_file *); > -static void efipart_print(int); > +static int efipart_print(int); > > struct devsw efipart_dev = { > .dv_name = "part", > @@ -162,7 +162,7 @@ efipart_init(void) > return (err); > } > > -static void > +static int > efipart_print(int verbose) > { > char line[80]; > @@ -170,28 +170,29 @@ efipart_print(int verbose) > EFI_HANDLE h; > EFI_STATUS status; > u_int unit; > + int ret = 0; > > - pager_open(); > for (unit = 0, h = efi_find_handle(&efipart_dev, 0); > h != NULL; h = efi_find_handle(&efipart_dev, ++unit)) { > - sprintf(line, " %s%d:", efipart_dev.dv_name, unit); > - if (pager_output(line)) > + snprintf(line, sizeof(line), " %s%d:", > + efipart_dev.dv_name, unit); > + if ((ret = pager_output(line)) != 0) > break; > > status = BS->HandleProtocol(h, &blkio_guid, (void > **)&blkio); > if (!EFI_ERROR(status)) { > - sprintf(line, " %llu blocks", > + snprintf(line, sizeof(line), " %llu blocks", > (unsigned long long)(blkio->Media->LastBlock + > 1)); > - if (pager_output(line)) > + if ((ret = pager_output(line)) != 0) > break; > if (blkio->Media->RemovableMedia) > - if (pager_output(" (removable)")) > + if ((ret = pager_output(" (removable)")) > != 0) > break; > } > - if (pager_output("\n")) > + if ((ret = pager_output("\n")) != 0) > break; > } > - pager_close(); > + return (ret); > } > > static int > > Modified: head/sys/boot/efi/loader/main.c > ============================================================ > ================== > --- head/sys/boot/efi/loader/main.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/efi/loader/main.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -533,6 +533,7 @@ command_memmap(int argc, char *argv[]) > UINT32 dver; > EFI_STATUS status; > int i, ndesc; > + char line[80]; > static char *types[] = { > "Reserved", > "LoaderCode", > @@ -564,14 +565,19 @@ command_memmap(int argc, char *argv[]) > } > > ndesc = sz / dsz; > - printf("%23s %12s %12s %8s %4s\n", > + snprintf(line, sizeof(line), "%23s %12s %12s %8s %4s\n", > "Type", "Physical", "Virtual", "#Pages", "Attr"); > + pager_open(); > + if (pager_output(line)) { > + pager_close(); > + return (CMD_OK); > + } > > for (i = 0, p = map; i < ndesc; > i++, p = NextMemoryDescriptor(p, dsz)) { > printf("%23s %012jx %012jx %08jx ", types[p->Type], > - (uintmax_t)p->PhysicalStart, (uintmax_t)p->VirtualStart, > - (uintmax_t)p->NumberOfPages); > + (uintmax_t)p->PhysicalStart, > (uintmax_t)p->VirtualStart, > + (uintmax_t)p->NumberOfPages); > if (p->Attribute & EFI_MEMORY_UC) > printf("UC "); > if (p->Attribute & EFI_MEMORY_WC) > @@ -588,9 +594,11 @@ command_memmap(int argc, char *argv[]) > printf("RP "); > if (p->Attribute & EFI_MEMORY_XP) > printf("XP "); > - printf("\n"); > + if (pager_output("\n")) > + break; > } > > + pager_close(); > return (CMD_OK); > } > > @@ -612,10 +620,17 @@ guid_to_string(EFI_GUID *guid) > static int > command_configuration(int argc, char *argv[]) > { > + char line[80]; > UINTN i; > > - printf("NumberOfTableEntries=%lu\n", > + snprintf(line, sizeof(line), "NumberOfTableEntries=%lu\n", > (unsigned long)ST->NumberOfTableEntries); > + pager_open(); > + if (pager_output(line)) { > + pager_close(); > + return (CMD_OK); > + } > + > for (i = 0; i < ST->NumberOfTableEntries; i++) { > EFI_GUID *guid; > > @@ -642,9 +657,13 @@ command_configuration(int argc, char *ar > printf("FDT Table"); > else > printf("Unknown Table (%s)", guid_to_string(guid)); > - printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); > + snprintf(line, sizeof(line), " at %p\n", > + ST->ConfigurationTable[i].VendorTable); > + if (pager_output(line)) > + break; > } > > + pager_close(); > return (CMD_OK); > } > > > Modified: head/sys/boot/i386/libfirewire/firewire.c > ============================================================ > ================== > --- head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -69,7 +69,7 @@ static int fw_strategy(void *devdata, in > size_t offset, size_t size, char *buf, size_t *rsize); > static int fw_open(struct open_file *f, ...); > static int fw_close(struct open_file *f); > -static void fw_print(int verbose); > +static int fw_print(int verbose); > static void fw_cleanup(void); > > void fw_enable(void); > @@ -148,21 +148,26 @@ fw_init(void) > /* > * Print information about OHCI chips > */ > -static void > +static int > fw_print(int verbose) > { > - int i; > + char line[80]; > + int i, ret = 0; > struct fwohci_softc *sc; > > for (i = 0; i < MAX_OHCI; i ++) { > sc = &fwinfo[i]; > if (sc->state == FWOHCI_STATE_DEAD) > break; > - printf("%d: locator=0x%04x devid=0x%08x" > + snprintf(line, sizeof(line), "%d: locator=0x%04x > devid=0x%08x" > " base_addr=0x%08x handle=0x%08x bus_id=0x%08x\n", > i, sc->locator, sc->devid, > sc->base_addr, sc->handle, sc->bus_id); > + ret = pager_output(line); > + if (ret != 0) > + break; > } > + return (ret); > } > > static int > > Modified: head/sys/boot/i386/libi386/bioscd.c > ============================================================ > ================== > --- head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -100,7 +100,7 @@ static int bc_realstrategy(void *devdata > size_t offset, size_t size, char *buf, size_t *rsize); > static int bc_open(struct open_file *f, ...); > static int bc_close(struct open_file *f); > -static void bc_print(int verbose); > +static int bc_print(int verbose); > > struct devsw bioscd = { > "cd", > @@ -177,20 +177,19 @@ bc_add(int biosdev) > /* > * Print information about disks > */ > -static void > +static int > bc_print(int verbose) > { > char line[80]; > - int i; > + int i, ret = 0; > > - pager_open(); > for (i = 0; i < nbcinfo; i++) { > - sprintf(line, " cd%d: Device 0x%x\n", i, > + snprintf(line, sizeof(line), " cd%d: Device 0x%x\n", i, > bcinfo[i].bc_sp.sp_devicespec); > - if (pager_output(line)) > + if ((ret = pager_output(line)) != 0) > break; > } > - pager_close(); > + return (ret); > } > > /* > > Modified: head/sys/boot/i386/libi386/biosdisk.c > ============================================================ > ================== > --- head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -135,7 +135,7 @@ static int bd_realstrategy(void *devdata > static int bd_open(struct open_file *f, ...); > static int bd_close(struct open_file *f); > static int bd_ioctl(struct open_file *f, u_long cmd, void *data); > -static void bd_print(int verbose); > +static int bd_print(int verbose); > static void bd_cleanup(void); > > #ifdef LOADER_GELI_SUPPORT > @@ -321,21 +321,21 @@ bd_int13probe(struct bdinfo *bd) > /* > * Print information about disks > */ > -static void > +static int > bd_print(int verbose) > { > static char line[80]; > struct disk_devdesc dev; > - int i; > + int i, ret = 0; > > - pager_open(); > for (i = 0; i < nbdinfo; i++) { > - sprintf(line, " disk%d: BIOS drive %c (%ju X %u):\n", > i, > + snprintf(line, sizeof(line), > + " disk%d: BIOS drive %c (%ju X %u):\n", i, > (bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit): > ('C' + bdinfo[i].bd_unit - 0x80), > (uintmax_t)bdinfo[i].bd_sectors, > bdinfo[i].bd_sectorsize); > - if (pager_output(line)) > + if ((ret = pager_output(line)) != 0) > break; > dev.d_dev = &biosdisk; > dev.d_unit = i; > @@ -346,12 +346,14 @@ bd_print(int verbose) > bdinfo[i].bd_sectorsize, > (bdinfo[i].bd_flags & BD_FLOPPY) ? > DISK_F_NOCACHE: 0) == 0) { > - sprintf(line, " disk%d", i); > - disk_print(&dev, line, verbose); > + snprintf(line, sizeof(line), " disk%d", i); > + ret = disk_print(&dev, line, verbose); > disk_close(&dev); > + if (ret != 0) > + return (ret); > } > } > - pager_close(); > + return (ret); > } > > /* > > Modified: head/sys/boot/i386/libi386/pxe.c > ============================================================ > ================== > --- head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -75,7 +75,7 @@ static int pxe_strategy(void *devdata, i > size_t offset, size_t size, char *buf, size_t > *rsize); > static int pxe_open(struct open_file *f, ...); > static int pxe_close(struct open_file *f); > -static void pxe_print(int verbose); > +static int pxe_print(int verbose); > static void pxe_cleanup(void); > static void pxe_setnfshandle(char *rootpath); > > @@ -381,14 +381,20 @@ pxe_close(struct open_file *f) > return (0); > } > > -static void > +static int > pxe_print(int verbose) > { > - > + char line[255]; > if (pxe_call == NULL) > - return; > + return (0); > > - printf(" pxe0: %s:%s\n", inet_ntoa(rootip), rootpath); > + if (verbose) { > + snprintf(line, sizeof(line), " pxe0: %s:%s\n", > + inet_ntoa(rootip), rootpath); > + } else { > + snprintf(line, sizeof(line), " pxe0:\n"); > + } > + return (pager_output(line)); > } > > static void > > Modified: head/sys/boot/mips/beri/loader/beri_disk_cfi.c > ============================================================ > ================== > --- head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 > 06:13:22 2016 (r308433) > +++ head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 > 06:50:18 2016 (r308434) > @@ -47,7 +47,7 @@ static int beri_cfi_disk_close(struct op > static void beri_cfi_disk_cleanup(void); > static int beri_cfi_disk_strategy(void *, int, daddr_t, size_t, > size_t, > char *, size_t *); > -static void beri_cfi_disk_print(int); > +static int beri_cfi_disk_print(int); > > struct devsw beri_cfi_disk = { > .dv_name = "cfi", > @@ -112,25 +112,29 @@ beri_cfi_disk_close(struct open_file *f) > return (disk_close(dev)); > } > > -static void > +static int > beri_cfi_disk_print(int verbose) > { > struct disk_devdesc dev; > char line[80]; > + int ret; > > - sprintf(line, " cfi%d CFI flash device\n", 0); > - pager_output(line); > + snprintf(line, sizeof(line), " cfi%d CFI flash device\n", 0); > + ret = pager_output(line); > + if (ret != 0) > + return (ret); > dev.d_dev = &beri_cfi_disk; > dev.d_unit = 0; > dev.d_slice = -1; > dev.d_partition = -1; > if (disk_open(&dev, cfi_get_mediasize(), > cfi_get_sectorsize(), 0) == 0) { > - sprintf(line, " cfi%d", 0); > - disk_print(&dev, line, verbose); > + snprintf(line, sizeof(line), " cfi%d", 0); > + ret = disk_print(&dev, line, verbose); > disk_close(&dev); > } > > + return (ret); > } > > static void > > Modified: head/sys/boot/mips/beri/loader/beri_disk_sdcard.c > ============================================================ > ================== > --- head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 > 06:13:22 2016 (r308433) > +++ head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 > 06:50:18 2016 (r308434) > @@ -47,7 +47,7 @@ static int beri_sdcard_disk_close(struct > static void beri_sdcard_disk_cleanup(void); > static int beri_sdcard_disk_strategy(void *, int, daddr_t, size_t, > size_t, > char *, size_t *); > -static void beri_sdcard_disk_print(int); > +static int beri_sdcard_disk_print(int); > > struct devsw beri_sdcard_disk = { > .dv_name = "sdcard", > @@ -123,19 +123,23 @@ beri_sdcard_disk_print(int verbose) > { > struct disk_devdesc dev; > char line[80]; > + int ret; > > - sprintf(line, " sdcard%d Altera SD card drive\n", 0); > - pager_output(line); > + snprintf(line, sizeof(line), " sdcard%d Altera SD card > drive\n", 0); > + ret = pager_output(line); > + if (ret != 0) > + return (ret); > dev.d_dev = &beri_sdcard_disk; > dev.d_unit = 0; > dev.d_slice = -1; > dev.d_partition = -1; > if (disk_open(&dev, altera_sdcard_get_mediasize(), > altera_sdcard_get_sectorsize(), 0) == 0) { > - sprintf(line, " sdcard%d", 0); > - disk_print(&dev, line, verbose); > + snprintf(line, sizeof(line), " sdcard%d", 0); > + ret = disk_print(&dev, line, verbose); > disk_close(&dev); > } > + return (ret); > } > > static void > > Modified: head/sys/boot/ofw/libofw/ofw_disk.c > ============================================================ > ================== > --- head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -47,7 +47,7 @@ static int ofwd_strategy(void *devdata, > static int ofwd_open(struct open_file *f, ...); > static int ofwd_close(struct open_file *f); > static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data); > -static void ofwd_print(int verbose); > +static int ofwd_print(int verbose); > > struct devsw ofwdisk = { > "block", > @@ -161,8 +161,8 @@ ofwd_ioctl(struct open_file *f __unused, > return (EINVAL); > } > > -static void > +static int > ofwd_print(int verbose __unused) > { > - > + return (0); > } > > Modified: head/sys/boot/pc98/libpc98/bioscd.c > ============================================================ > ================== > --- head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -99,7 +99,7 @@ static int bc_realstrategy(void *devdata > size_t offset, size_t size, char *buf, size_t *rsize); > static int bc_open(struct open_file *f, ...); > static int bc_close(struct open_file *f); > -static void bc_print(int verbose); > +static int bc_print(int verbose); > > struct devsw bioscd = { > "cd", > @@ -173,20 +173,19 @@ bc_add(int biosdev) > /* > * Print information about disks > */ > -static void > +static int > bc_print(int verbose) > { > char line[80]; > - int i; > + int i, ret = 0; > > - pager_open(); > for (i = 0; i < nbcinfo; i++) { > sprintf(line, " cd%d: Device 0x%x\n", i, > bcinfo[i].bc_sp.sp_devicespec); > - if (pager_output(line)) > + if ((ret = pager_output(line)) != 0) > break; > } > - pager_close(); > + return (ret); > } > > /* > > Modified: head/sys/boot/pc98/libpc98/biosdisk.c > ============================================================ > ================== > --- head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -123,7 +123,7 @@ static int bd_realstrategy(void *devdata > size_t offset, size_t size, char *buf, size_t *rsize); > static int bd_open(struct open_file *f, ...); > static int bd_close(struct open_file *f); > -static void bd_print(int verbose); > +static int bd_print(int verbose); > > struct devsw biosdisk = { > "disk", > @@ -249,21 +249,20 @@ bd_int13probe(struct bdinfo *bd) > /* > * Print information about disks > */ > -static void > +static int > bd_print(int verbose) > { > - int i, j, done; > + int i, j, ret = 0; > char line[80]; > struct i386_devdesc dev; > struct open_disk *od; > struct pc98_partition *dptr; > > - pager_open(); > - done = 0; > - for (i = 0; i < nbdinfo && !done; i++) { > - sprintf(line, " disk%d: BIOS drive %c:\n", i, 'A' + i); > - if (pager_output(line)) > - break; > + for (i = 0; i < nbdinfo; i++) { > + snprintf(line, sizeof(line), " disk%d: BIOS drive %c:\n", > + i, 'A' + i); > + if ((ret = pager_output(line)) != 0) > + break; > > /* try to open the whole disk */ > dev.d_unit = i; > @@ -278,17 +277,17 @@ bd_print(int verbose) > > /* Check for a "dedicated" disk */ > for (j = 0; j < od->od_nslices; j++) { > - sprintf(line, " disk%ds%d", i, j + 1); > - if (bd_printslice(od, &dptr[j], line, verbose)) { > - done = 1; > - break; > - } > + snprintf(line, sizeof(line), " disk%ds%d", i, j + > 1); > + if ((ret = bd_printslice(od, &dptr[j], line, verbose)) > != 0) > + break; > } > } > bd_closedisk(od); > + if (ret != 0) > + break; > } > } > - pager_close(); > + return (ret); > } > > /* Given a size in 512 byte sectors, convert it to a human-readable > number. */ > > Modified: head/sys/boot/powerpc/kboot/hostdisk.c > ============================================================ > ================== > --- head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -37,7 +37,7 @@ static int hostdisk_strategy(void *devda > static int hostdisk_open(struct open_file *f, ...); > static int hostdisk_close(struct open_file *f); > static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data); > -static void hostdisk_print(int verbose); > +static int hostdisk_print(int verbose); > > struct devsw hostdisk = { > "/dev", > @@ -117,9 +117,9 @@ hostdisk_ioctl(struct open_file *f, u_lo > return (EINVAL); > } > > -static void > +static int > hostdisk_print(int verbose) > { > - > + return (0); > } > > > Modified: head/sys/boot/powerpc/ps3/ps3cdrom.c > ============================================================ > ================== > --- head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -49,7 +49,7 @@ static int ps3cdrom_strategy(void *devda > size_t offset, size_t size, char *buf, size_t *rsize); > static int ps3cdrom_open(struct open_file *f, ...); > static int ps3cdrom_close(struct open_file *f); > -static void ps3cdrom_print(int verbose); > +static int ps3cdrom_print(int verbose); > > struct devsw ps3cdrom = { > "cd", > @@ -149,6 +149,7 @@ static int ps3cdrom_close(struct open_fi > return 0; > } > > -static void ps3cdrom_print(int verbose) > +static int ps3cdrom_print(int verbose) > { > + return (0); > } > > Modified: head/sys/boot/powerpc/ps3/ps3disk.c > ============================================================ > ================== > --- head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -61,7 +61,7 @@ static int ps3disk_strategy(void *devdat > size_t offset, size_t size, char *buf, size_t *rsize); > static int ps3disk_open(struct open_file *f, ...); > static int ps3disk_close(struct open_file *f); > -static void ps3disk_print(int verbose); > +static int ps3disk_print(int verbose); > > struct devsw ps3disk = { > "disk", > @@ -186,8 +186,9 @@ static int ps3disk_close(struct open_fil > return 0; > } > > -static void ps3disk_print(int verbose) > +static int ps3disk_print(int verbose) > { > + return (0); > } > > static int ps3disk_open_gpt(struct ps3_devdesc *dev, struct open_dev *od) > > Modified: head/sys/boot/uboot/lib/disk.c > ============================================================ > ================== > --- head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -78,7 +78,7 @@ static int stor_strategy(void *, int, da > static int stor_open(struct open_file *, ...); > static int stor_close(struct open_file *); > static int stor_ioctl(struct open_file *f, u_long cmd, void *data); > -static void stor_print(int); > +static int stor_print(int); > static void stor_cleanup(void); > > struct devsw uboot_storage = { > @@ -238,30 +238,31 @@ stor_readdev(struct disk_devdesc *dev, d > return (err); > } > > -static void > +static int > stor_print(int verbose) > { > struct disk_devdesc dev; > static char line[80]; > - int i; > + int i, ret = 0; > > - pager_open(); > for (i = 0; i < stor_info_no; i++) { > dev.d_dev = &uboot_storage; > dev.d_unit = i; > dev.d_slice = -1; > dev.d_partition = -1; > - sprintf(line, "\tdisk%d (%s)\n", i, > + snprintf(line, sizeof(line), "\tdisk%d (%s)\n", i, > ub_stor_type(SI(&dev).type)); > - if (pager_output(line)) > + if ((ret = pager_output(line)) != 0) > break; > if (stor_opendev(&dev) == 0) { > sprintf(line, "\tdisk%d", i); > - disk_print(&dev, line, verbose); > + ret = disk_print(&dev, line, verbose); > disk_close(&dev); > + if (ret != 0) > + break; > } > } > - pager_close(); > + return (ret); > } > > static int > > Modified: head/sys/boot/usb/storage/umass_loader.c > ============================================================ > ================== > --- head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -50,7 +50,7 @@ static void umass_disk_cleanup(void); > static int umass_disk_ioctl(struct open_file *, u_long, void *); > static int umass_disk_strategy(void *, int, daddr_t, size_t, size_t, char > *, > size_t *); > -static void umass_disk_print(int); > +static int umass_disk_print(int); > > struct devsw umass_disk = { > .dv_name = "umass", > @@ -170,23 +170,26 @@ umass_disk_close(struct open_file *f) > return (disk_close(dev)); > } > > -static void > +static int > umass_disk_print(int verbose) > { > struct disk_devdesc dev; > > memset(&dev, 0, sizeof(dev)); > > - pager_output(" umass0 UMASS device\n"); > + ret = pager_output(" umass0 UMASS device\n"); > + if (ret != 0) > + return (ret); > dev.d_dev = &umass_disk; > dev.d_unit = 0; > dev.d_slice = -1; > dev.d_partition = -1; > > if (umass_disk_open_sub(&dev) == 0) { > - disk_print(&dev, " umass0", verbose); > + ret = disk_print(&dev, " umass0", verbose); > disk_close(&dev); > } > + return (ret); > } > > static void > > Modified: head/sys/boot/userboot/userboot/host.c > ============================================================ > ================== > --- head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:13:22 2016 > (r308433) > +++ head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:50:18 2016 > (r308434) > @@ -134,13 +134,13 @@ host_dev_init(void) > return (0); > } > > -static void > +static int > host_dev_print(int verbose) > { > char line[80]; > > - sprintf(line, " host%d: Host filesystem\n", 0); > - pager_output(line); > + snprintf(line, sizeof(line), " host%d: Host filesystem\n", 0); > + return (pager_output(line)); > } > > /* > > Modified: head/sys/boot/userboot/userboot/userboot_disk.c > ============================================================ > ================== > --- head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 > 06:13:22 2016 (r308433) > +++ head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 > 06:50:18 2016 (r308434) > @@ -60,7 +60,7 @@ static int userdisk_realstrategy(void *d > static int userdisk_open(struct open_file *f, ...); > static int userdisk_close(struct open_file *f); > static int userdisk_ioctl(struct open_file *f, u_long cmd, void > *data); > -static void userdisk_print(int verbose); > +static int userdisk_print(int verbose); > > struct devsw userboot_disk = { > "disk", > @@ -116,27 +116,33 @@ userdisk_cleanup(void) > /* > * Print information about disks > */ > -static void > +static int > userdisk_print(int verbose) > { > struct disk_devdesc dev; > char line[80]; > - int i; > + int i, ret = 0; > > for (i = 0; i < userdisk_maxunit; i++) { > - sprintf(line, " disk%d: Guest drive image\n", i); > - pager_output(line); > + snprintf(line, sizeof(line), > + " disk%d: Guest drive image\n", i); > + ret = pager_output(line); > + if (ret != 0) > + break; > dev.d_dev = &userboot_disk; > dev.d_unit = i; > dev.d_slice = -1; > dev.d_partition = -1; > if (disk_open(&dev, ud_info[i].mediasize, > ud_info[i].sectorsize, 0) == 0) { > - sprintf(line, " disk%d", i); > - disk_print(&dev, line, verbose); > + snprintf(line, sizeof(line), " disk%d", i); > + ret = disk_print(&dev, line, verbose); > disk_close(&dev); > + if (ret != 0) > + break; > } > } > + return (ret); > } > > /* > > Modified: head/sys/boot/zfs/zfs.c > ============================================================ > ================== > --- head/sys/boot/zfs/zfs.c Tue Nov 8 06:13:22 2016 (r308433) > +++ head/sys/boot/zfs/zfs.c Tue Nov 8 06:50:18 2016 (r308434) > @@ -514,20 +514,23 @@ zfs_probe_dev(const char *devname, uint6 > /* > * Print information about ZFS pools > */ > -static void > +static int > zfs_dev_print(int verbose) > { > spa_t *spa; > char line[80]; > + int ret = 0; > > if (verbose) { > - spa_all_status(); > - return; > + return (spa_all_status()); > } > STAILQ_FOREACH(spa, &zfs_pools, spa_link) { > - sprintf(line, " zfs:%s\n", spa->spa_name); > - pager_output(line); > + snprintf(line, sizeof(line), " zfs:%s\n", > spa->spa_name); > + ret = pager_output(line); > + if (ret != 0) > + break; > } > + return (ret); > } > > /* > > Modified: head/sys/boot/zfs/zfsimpl.c > ============================================================ > ================== > --- head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:13:22 2016 (r308433) > +++ head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:50:18 2016 (r308434) > @@ -780,7 +780,7 @@ state_name(vdev_state_t state) > > #else > > -static void > +static int > pager_printf(const char *fmt, ...) > { > char line[80]; > @@ -789,14 +789,14 @@ pager_printf(const char *fmt, ...) > va_start(args, fmt); > vsprintf(line, fmt, args); > va_end(args); > - pager_output(line); > + return (pager_output(line)); > } > > #endif > > #define STATUS_FORMAT " %s %s\n" > > -static void > +static int > print_state(int indent, const char *name, vdev_state_t state) > { > int i; > @@ -806,40 +806,56 @@ print_state(int indent, const char *name > for (i = 0; i < indent; i++) > strcat(buf, " "); > strcat(buf, name); > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Thu Nov 10 22:28:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAF45C3BA29; Thu, 10 Nov 2016 22:28:58 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp001.me.com (st13p35im-asmtp001.me.com [17.164.199.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 536AA83; Thu, 10 Nov 2016 22:28:58 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp001.me.com by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OGG00O006CTL900@st13p35im-asmtp001.me.com>; Thu, 10 Nov 2016 22:28:51 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1478816931; bh=cmFYWe5j02ZrA0gBdWSuKXm3da40IHZbTaNmY8jg9uY=; h=From:Message-id:Content-type:MIME-version:Subject:Date:To; b=hjLF5kfAbNT+HFODgdjdPmnBxlVjG/swasE7Lt2auoAXJXR0nKsSO6JNrmvOCfhMd ER1C6oM8Xe2LOCwC+hdFfhHLdotxrxUvGAH7tl+53CH90f1UC6buHuf6YfjdrVIEmG ieSrfIN5gCYyjoDcuAr69OUplhyF9MOOMSevJYtf66D1Pu10e3doe4C/nAoGBt+a8X fhkVVp+/m4a4FEhV+7qQz89JPJZzOX5+UtSiOHEcd9BFYHULbVFDB4OFkzz4lkFjag +xwNSQrFKze1W757BYtlh/233f7Q+97PuwHbKIVrmOhVVWmX0xaKcN00x2pYdkx3bx GTllzPl4BRHiA== Received: from nazgul.lan (220-90-235-80.dyn.estpak.ee [80.235.90.220]) by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OGG00E7G6FYXT50@st13p35im-asmtp001.me.com>; Thu, 10 Nov 2016 22:28:50 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-10_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=27 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1611100381 From: Toomas Soome Message-id: <8E0E5C94-EFD7-4008-B563-FF080A98F23D@me.com> MIME-version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r308434 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libofw sys... Date: Fri, 11 Nov 2016 00:28:46 +0200 In-reply-to: Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Kamil Czekirda References: <201611080650.uA86oJ7W056026@repo.freebsd.org> X-Mailer: Apple Mail (2.3251) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 22:28:58 -0000 the patch does update the lib/libstand/stand.h to have: struct devsw { . . .=20 int (*dv_print)(int verbose); it was void before; from your svnlite log I can see the = lib/libstand/stand.h is updated, could you confirm if it is int now? if = it is, I suspect the build is getting the old stand.h from somewhere in = the tree and not your /lib/libstand. if so, does the build has target to copy headers in place? I=E2=80=99m = sorry, I don't know all the tricks the build system does as part of the = buildworld.. rgds, toomas > On 11. nov 2016, at 0:21, Kamil Czekirda wrote: >=20 > Hi, >=20 > I got the following: >=20 > root@current:/usr/src # svnlite up -r r308434 > Updating '.': > U lib/libstand/stand.h > U sys/boot/common/dev_net.c > U sys/boot/common/module.c > U sys/boot/common/part.c > U sys/boot/common/util.c > U sys/boot/common/util.h > U sys/boot/efi/libefi/efinet.c > U sys/boot/efi/libefi/efipart.c > U sys/boot/efi/loader/main.c > U sys/boot/i386/libfirewire/firewire.c > U sys/boot/i386/libi386/bioscd.c > U sys/boot/i386/libi386/biosdisk.c > U sys/boot/mips/beri/loader/beri_disk_cfi.c > U sys/boot/mips/beri/loader/beri_disk_sdcard.c > U sys/boot/ofw/libofw/ofw_disk.c > U sys/boot/pc98/libpc98/bioscd.c > U sys/boot/pc98/libpc98/biosdisk.c > U sys/boot/powerpc/kboot/hostdisk.c > U sys/boot/powerpc/ps3/ps3cdrom.c > U sys/boot/powerpc/ps3/ps3disk.c > U sys/boot/uboot/lib/disk.c > U sys/boot/usb/storage/umass_loader.c > U sys/boot/userboot/userboot/host.c > U sys/boot/userboot/userboot/userboot_disk.c > U sys/boot/zfs/zfs.c > U sys/boot/zfs/zfsimpl.c > U sys/boot/i386/libi386/pxe.c > Updated to revision 308434. > root@current:/usr/src # cd sys/boot/ > root@current:/usr/src/sys/boot # make clean > (...) > root@current:/usr/src/sys/boot # make obj > (...) > root@current:/usr/src/sys/boot # make > (...) > cc -O2 -pipe -DSKEIN_LOOP=3D111 -fPIC = -I/usr/src/sys/boot/efi/loader -I/usr/src/sys/boot/efi/loader/arch/amd64 = -I/usr/src/sys/boot/efi/loader/../include = -I/usr/src/sys/boot/efi/loader/../include/amd64 = -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include = -I/usr/src/sys/boot/efi/loader/../../.. = -I/usr/src/sys/boot/efi/loader/../../i386/libi386 = -I/usr/src/sys/boot/efi/loader/../../zfs = -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs = -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT = -DNO_PCI -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH = -I/usr/src/sys/boot/efi/loader/../../ficl = -I/usr/src/sys/boot/efi/loader/../../ficl/amd64 -DLOADER_DISK_SUPPORT = -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC -I/usr/src/sys/boot/ficl = -I/usr/src/sys/boot/ficl/amd64 -I/usr/src/sys/boot/ficl/../common = -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat = -msoft-float -mno-mmx -mno-sse -mno-avx -fshort-wchar -mno-red-zone = -mno-aes -g -MD -MF.depend.vers.o -MTvers.o -std=3Dgnu99 = -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter = -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith = -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body = -Wno-string-plus-int -Wno-unused-const-variable = -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality = -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef = -Qunused-arguments -c vers.c -o vers.o > cc -O2 -pipe -DSKEIN_LOOP=3D111 -fPIC = -I/usr/src/sys/boot/efi/loader -I/usr/src/sys/boot/efi/loader/arch/amd64 = -I/usr/src/sys/boot/efi/loader/../include = -I/usr/src/sys/boot/efi/loader/../include/amd64 = -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include = -I/usr/src/sys/boot/efi/loader/../../.. = -I/usr/src/sys/boot/efi/loader/../../i386/libi386 = -I/usr/src/sys/boot/efi/loader/../../zfs = -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs = -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT = -DNO_PCI -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH = -I/usr/src/sys/boot/efi/loader/../../ficl = -I/usr/src/sys/boot/efi/loader/../../ficl/amd64 -DLOADER_DISK_SUPPORT = -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC -I/usr/src/sys/boot/ficl = -I/usr/src/sys/boot/ficl/amd64 -I/usr/src/sys/boot/ficl/../common = -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat = -msoft-float -mno-mmx -mno-sse -mno-avx -fshort-wchar -mno-red-zone = -mno-aes -g -MD -MF.depend.zfs.o -MTzfs.o -std=3Dgnu99 -Wsystem-headers = -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter = -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith = -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body = -Wno-string-plus-int -Wno-unused-const-variable = -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality = -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef = -Wno-sign-compare -Wno-array-bounds -Wno-missing-prototypes = -Qunused-arguments -c /usr/src/sys/boot/efi/loader/../../zfs/zfs.c -o = zfs.o > /usr/src/sys/boot/efi/loader/../../zfs/zfs.c:599:14: error: = incompatible pointer types initializing 'void (*)(int)' with an = expression of type 'int (int)' [-Werror,-Wincompatible-pointer-types] > .dv_print =3D zfs_dev_print, > ^~~~~~~~~~~~~ > 1 error generated. > *** Error code 1 >=20 > Stop. > make[2]: stopped in /usr/src/sys/boot/efi/loader > *** Error code 1 >=20 > Stop. > make[1]: stopped in /usr/src/sys/boot/efi > *** Error code 1 >=20 > Stop. > make: stopped in /usr/src/sys/boot >=20 >=20 > Kamil >=20 > 2016-11-08 7:50 GMT+01:00 Toomas Soome >: > Author: tsoome > Date: Tue Nov 8 06:50:18 2016 > New Revision: 308434 > URL: https://svnweb.freebsd.org/changeset/base/308434 = >=20 > Log: > Loader paged/pageable data is not always paged. >=20 > This change does modify devsw dv_print() to return the int value, > enabling walkers to interrupt the walk on non zero value from = dv_print(). >=20 > This will allow the pager_print actually to stop displaying data on > user input, and additionally pager is used in various *dev_print = callbacks, > where it was missing. >=20 > For test, lsdev [-v] command should display data by screenfuls and = should > stop when the key 'q' is pressed on pager prompt. >=20 > Reviewed by: allanjude > Approved by: allanjude (mentor) > Differential Revision: https://reviews.freebsd.org/D5461 = >=20 > Modified: > head/lib/libstand/stand.h > head/sys/boot/common/dev_net.c > head/sys/boot/common/module.c > head/sys/boot/common/part.c > head/sys/boot/common/util.c > head/sys/boot/common/util.h > head/sys/boot/efi/libefi/efinet.c > head/sys/boot/efi/libefi/efipart.c > head/sys/boot/efi/loader/main.c > head/sys/boot/i386/libfirewire/firewire.c > head/sys/boot/i386/libi386/bioscd.c > head/sys/boot/i386/libi386/biosdisk.c > head/sys/boot/i386/libi386/pxe.c > head/sys/boot/mips/beri/loader/beri_disk_cfi.c > head/sys/boot/mips/beri/loader/beri_disk_sdcard.c > head/sys/boot/ofw/libofw/ofw_disk.c > head/sys/boot/pc98/libpc98/bioscd.c > head/sys/boot/pc98/libpc98/biosdisk.c > head/sys/boot/powerpc/kboot/hostdisk.c > head/sys/boot/powerpc/ps3/ps3cdrom.c > head/sys/boot/powerpc/ps3/ps3disk.c > head/sys/boot/uboot/lib/disk.c > head/sys/boot/usb/storage/umass_loader.c > head/sys/boot/userboot/userboot/host.c > head/sys/boot/userboot/userboot/userboot_disk.c > head/sys/boot/zfs/zfs.c > head/sys/boot/zfs/zfsimpl.c >=20 > Modified: head/lib/libstand/stand.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libstand/stand.h Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/lib/libstand/stand.h Tue Nov 8 06:50:18 2016 = (r308434) > @@ -143,7 +143,7 @@ struct devsw { > int (*dv_open)(struct open_file *f, ...); > int (*dv_close)(struct open_file *f); > int (*dv_ioctl)(struct open_file *f, u_long cmd, = void *data); > - void (*dv_print)(int verbose); /* print device = information */ > + int (*dv_print)(int verbose); /* print = device information */ > void (*dv_cleanup)(void); > }; >=20 >=20 > Modified: head/sys/boot/common/dev_net.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/common/dev_net.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/common/dev_net.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -80,7 +80,7 @@ static int net_open(struct open_file *, > static int net_close(struct open_file *); > static void net_cleanup(void); > static int net_strategy(); > -static void net_print(int); > +static int net_print(int); >=20 > static int net_getparams(int sock); >=20 > @@ -325,23 +325,27 @@ exit: > return (0); > } >=20 > -static void > +static int > net_print(int verbose) > { > struct netif_driver *drv; > int i, d, cnt; > + int ret =3D 0; >=20 > cnt =3D 0; > for (d =3D 0; netif_drivers[d]; d++) { > drv =3D netif_drivers[d]; > for (i =3D 0; i < drv->netif_nifs; i++) { > printf("\t%s%d:", "net", cnt++); > - if (verbose) > + if (verbose) { > printf(" (%s%d)", drv->netif_bname, > drv->netif_ifs[i].dif_unit); > + } > + if ((ret =3D pager_output("\n")) !=3D 0) > + return (ret); > } > } > - printf("\n"); > + return (ret); > } >=20 > /* >=20 > Modified: head/sys/boot/common/module.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/common/module.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/common/module.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -254,7 +254,7 @@ command_lsmod(int argc, char *argv[]) > struct kernel_module *mp; > struct file_metadata *md; > char lbuf[80]; > - int ch, verbose; > + int ch, verbose, ret =3D 0; >=20 > verbose =3D 0; > optind =3D 1; > @@ -273,11 +273,13 @@ command_lsmod(int argc, char *argv[]) >=20 > pager_open(); > for (fp =3D preloaded_files; fp; fp =3D fp->f_next) { > - sprintf(lbuf, " %p: ", (void *) fp->f_addr); > + snprintf(lbuf, sizeof(lbuf), " %p: ", (void *) fp->f_addr); > pager_output(lbuf); > pager_output(fp->f_name); > - sprintf(lbuf, " (%s, 0x%lx)\n", fp->f_type, (long)fp->f_size); > - pager_output(lbuf); > + snprintf(lbuf, sizeof(lbuf), " (%s, 0x%lx)\n", fp->f_type, > + (long)fp->f_size); > + if (pager_output(lbuf)) > + break; > if (fp->f_args !=3D NULL) { > pager_output(" args: "); > pager_output(fp->f_args); > @@ -287,7 +289,8 @@ command_lsmod(int argc, char *argv[]) > if (fp->f_modules) { > pager_output(" modules: "); > for (mp =3D fp->f_modules; mp; mp =3D mp->m_next) { > - sprintf(lbuf, "%s.%d ", mp->m_name, mp->m_version); > + snprintf(lbuf, sizeof(lbuf), "%s.%d ", mp->m_name, > + mp->m_version); > pager_output(lbuf); > } > if (pager_output("\n")) > @@ -296,11 +299,14 @@ command_lsmod(int argc, char *argv[]) > if (verbose) { > /* XXX could add some formatting smarts here to display = some better */ > for (md =3D fp->f_metadata; md !=3D NULL; md =3D = md->md_next) { > - sprintf(lbuf, " 0x%04x, 0x%lx\n", md->md_type, = (long) md->md_size); > + snprintf(lbuf, sizeof(lbuf), " 0x%04x, 0x%lx\n", > + md->md_type, (long) md->md_size); > if (pager_output(lbuf)) > break; > } > } > + if (ret) > + break; > } > pager_close(); > return(CMD_OK); >=20 > Modified: head/sys/boot/common/part.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/common/part.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/common/part.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -834,6 +834,7 @@ ptable_iterate(const struct ptable *tabl > { > struct pentry *entry; > char name[32]; > + int ret =3D 0; >=20 > name[0] =3D '\0'; > STAILQ_FOREACH(entry, &table->entries, entry) { > @@ -856,9 +857,8 @@ ptable_iterate(const struct ptable *tabl > if (table->type =3D=3D PTABLE_BSD) > sprintf(name, "%c", (u_char) 'a' + > entry->part.index); > - if (iter(arg, name, &entry->part)) > - return 1; > + if ((ret =3D iter(arg, name, &entry->part)) !=3D 0) > + return (ret); > } > - return 0; > + return (ret); > } > - >=20 > Modified: head/sys/boot/common/util.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/common/util.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/common/util.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -114,7 +114,7 @@ strlen(const char *s) > return (len); > } >=20 > -void > +int > printf(const char *fmt, ...) > { > va_list ap; > @@ -178,4 +178,5 @@ nextfmt: > } > } > va_end(ap); > + return (0); > } >=20 > Modified: head/sys/boot/common/util.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/common/util.h Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/common/util.h Tue Nov 8 06:50:18 2016 = (r308434) > @@ -48,6 +48,6 @@ void strcat(char *dst, const char *src); > char *strchr(const char *s, char ch); > size_t strlen(const char *s); >=20 > -void printf(const char *fmt, ...); > +int printf(const char *fmt, ...); >=20 > #endif /* !_UTIL_H_ */ >=20 > Modified: head/sys/boot/efi/libefi/efinet.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -252,7 +252,7 @@ efinet_end(struct netif *nif) > } >=20 > static int efinet_dev_init(void); > -static void efinet_dev_print(int); > +static int efinet_dev_print(int); >=20 > struct devsw efinet_dev =3D { > .dv_name =3D "net", > @@ -346,14 +346,13 @@ efinet_dev_init() > return (0); > } >=20 > -static void > +static int > efinet_dev_print(int verbose) > { > CHAR16 *text; > EFI_HANDLE h; > - int unit; > + int unit, ret =3D 0; >=20 > - pager_open(); > for (unit =3D 0, h =3D efi_find_handle(&efinet_dev, 0); > h !=3D NULL; h =3D efi_find_handle(&efinet_dev, ++unit)) { > printf(" %s%d:", efinet_dev.dv_name, unit); > @@ -364,8 +363,8 @@ efinet_dev_print(int verbose) > efi_free_devpath_name(text); > } > } > - if (pager_output("\n")) > + if ((ret =3D pager_output("\n")) !=3D 0) > break; > } > - pager_close(); > + return (ret); > } >=20 > Modified: head/sys/boot/efi/libefi/efipart.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -47,7 +47,7 @@ static int efipart_realstrategy(void *, > size_t *); > static int efipart_open(struct open_file *, ...); > static int efipart_close(struct open_file *); > -static void efipart_print(int); > +static int efipart_print(int); >=20 > struct devsw efipart_dev =3D { > .dv_name =3D "part", > @@ -162,7 +162,7 @@ efipart_init(void) > return (err); > } >=20 > -static void > +static int > efipart_print(int verbose) > { > char line[80]; > @@ -170,28 +170,29 @@ efipart_print(int verbose) > EFI_HANDLE h; > EFI_STATUS status; > u_int unit; > + int ret =3D 0; >=20 > - pager_open(); > for (unit =3D 0, h =3D efi_find_handle(&efipart_dev, 0); > h !=3D NULL; h =3D efi_find_handle(&efipart_dev, ++unit)) = { > - sprintf(line, " %s%d:", efipart_dev.dv_name, unit); > - if (pager_output(line)) > + snprintf(line, sizeof(line), " %s%d:", > + efipart_dev.dv_name, unit); > + if ((ret =3D pager_output(line)) !=3D 0) > break; >=20 > status =3D BS->HandleProtocol(h, &blkio_guid, (void = **)&blkio); > if (!EFI_ERROR(status)) { > - sprintf(line, " %llu blocks", > + snprintf(line, sizeof(line), " %llu = blocks", > (unsigned long = long)(blkio->Media->LastBlock + 1)); > - if (pager_output(line)) > + if ((ret =3D pager_output(line)) !=3D 0) > break; > if (blkio->Media->RemovableMedia) > - if (pager_output(" (removable)")) > + if ((ret =3D pager_output(" = (removable)")) !=3D 0) > break; > } > - if (pager_output("\n")) > + if ((ret =3D pager_output("\n")) !=3D 0) > break; > } > - pager_close(); > + return (ret); > } >=20 > static int >=20 > Modified: head/sys/boot/efi/loader/main.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/efi/loader/main.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/efi/loader/main.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -533,6 +533,7 @@ command_memmap(int argc, char *argv[]) > UINT32 dver; > EFI_STATUS status; > int i, ndesc; > + char line[80]; > static char *types[] =3D { > "Reserved", > "LoaderCode", > @@ -564,14 +565,19 @@ command_memmap(int argc, char *argv[]) > } >=20 > ndesc =3D sz / dsz; > - printf("%23s %12s %12s %8s %4s\n", > + snprintf(line, sizeof(line), "%23s %12s %12s %8s %4s\n", > "Type", "Physical", "Virtual", "#Pages", "Attr"); > + pager_open(); > + if (pager_output(line)) { > + pager_close(); > + return (CMD_OK); > + } >=20 > for (i =3D 0, p =3D map; i < ndesc; > i++, p =3D NextMemoryDescriptor(p, dsz)) { > printf("%23s %012jx %012jx %08jx ", types[p->Type], > - (uintmax_t)p->PhysicalStart, = (uintmax_t)p->VirtualStart, > - (uintmax_t)p->NumberOfPages); > + (uintmax_t)p->PhysicalStart, = (uintmax_t)p->VirtualStart, > + (uintmax_t)p->NumberOfPages); > if (p->Attribute & EFI_MEMORY_UC) > printf("UC "); > if (p->Attribute & EFI_MEMORY_WC) > @@ -588,9 +594,11 @@ command_memmap(int argc, char *argv[]) > printf("RP "); > if (p->Attribute & EFI_MEMORY_XP) > printf("XP "); > - printf("\n"); > + if (pager_output("\n")) > + break; > } >=20 > + pager_close(); > return (CMD_OK); > } >=20 > @@ -612,10 +620,17 @@ guid_to_string(EFI_GUID *guid) > static int > command_configuration(int argc, char *argv[]) > { > + char line[80]; > UINTN i; >=20 > - printf("NumberOfTableEntries=3D%lu\n", > + snprintf(line, sizeof(line), "NumberOfTableEntries=3D%lu\n", > (unsigned long)ST->NumberOfTableEntries); > + pager_open(); > + if (pager_output(line)) { > + pager_close(); > + return (CMD_OK); > + } > + > for (i =3D 0; i < ST->NumberOfTableEntries; i++) { > EFI_GUID *guid; >=20 > @@ -642,9 +657,13 @@ command_configuration(int argc, char *ar > printf("FDT Table"); > else > printf("Unknown Table (%s)", = guid_to_string(guid)); > - printf(" at %p\n", = ST->ConfigurationTable[i].VendorTable); > + snprintf(line, sizeof(line), " at %p\n", > + ST->ConfigurationTable[i].VendorTable); > + if (pager_output(line)) > + break; > } >=20 > + pager_close(); > return (CMD_OK); > } >=20 >=20 > Modified: head/sys/boot/i386/libfirewire/firewire.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:13:22 = 2016 (r308433) > +++ head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:50:18 = 2016 (r308434) > @@ -69,7 +69,7 @@ static int fw_strategy(void *devdata, in > size_t offset, size_t size, char *buf, size_t = *rsize); > static int fw_open(struct open_file *f, ...); > static int fw_close(struct open_file *f); > -static void fw_print(int verbose); > +static int fw_print(int verbose); > static void fw_cleanup(void); >=20 > void fw_enable(void); > @@ -148,21 +148,26 @@ fw_init(void) > /* > * Print information about OHCI chips > */ > -static void > +static int > fw_print(int verbose) > { > - int i; > + char line[80]; > + int i, ret =3D 0; > struct fwohci_softc *sc; >=20 > for (i =3D 0; i < MAX_OHCI; i ++) { > sc =3D &fwinfo[i]; > if (sc->state =3D=3D FWOHCI_STATE_DEAD) > break; > - printf("%d: locator=3D0x%04x devid=3D0x%08x" > + snprintf(line, sizeof(line), "%d: locator=3D0x%04x = devid=3D0x%08x" > " base_addr=3D0x%08x handle=3D0x%08x = bus_id=3D0x%08x\n", > i, sc->locator, sc->devid, > sc->base_addr, sc->handle, sc->bus_id); > + ret =3D pager_output(line); > + if (ret !=3D 0) > + break; > } > + return (ret); > } >=20 > static int >=20 > Modified: head/sys/boot/i386/libi386/bioscd.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -100,7 +100,7 @@ static int bc_realstrategy(void *devdata > size_t offset, size_t size, char *buf, size_t *rsize); > static int bc_open(struct open_file *f, ...); > static int bc_close(struct open_file *f); > -static void bc_print(int verbose); > +static int bc_print(int verbose); >=20 > struct devsw bioscd =3D { > "cd", > @@ -177,20 +177,19 @@ bc_add(int biosdev) > /* > * Print information about disks > */ > -static void > +static int > bc_print(int verbose) > { > char line[80]; > - int i; > + int i, ret =3D 0; >=20 > - pager_open(); > for (i =3D 0; i < nbcinfo; i++) { > - sprintf(line, " cd%d: Device 0x%x\n", i, > + snprintf(line, sizeof(line), " cd%d: Device = 0x%x\n", i, > bcinfo[i].bc_sp.sp_devicespec); > - if (pager_output(line)) > + if ((ret =3D pager_output(line)) !=3D 0) > break; > } > - pager_close(); > + return (ret); > } >=20 > /* >=20 > Modified: head/sys/boot/i386/libi386/biosdisk.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:13:22 = 2016 (r308433) > +++ head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:50:18 = 2016 (r308434) > @@ -135,7 +135,7 @@ static int bd_realstrategy(void *devdata > static int bd_open(struct open_file *f, ...); > static int bd_close(struct open_file *f); > static int bd_ioctl(struct open_file *f, u_long cmd, void *data); > -static void bd_print(int verbose); > +static int bd_print(int verbose); > static void bd_cleanup(void); >=20 > #ifdef LOADER_GELI_SUPPORT > @@ -321,21 +321,21 @@ bd_int13probe(struct bdinfo *bd) > /* > * Print information about disks > */ > -static void > +static int > bd_print(int verbose) > { > static char line[80]; > struct disk_devdesc dev; > - int i; > + int i, ret =3D 0; >=20 > - pager_open(); > for (i =3D 0; i < nbdinfo; i++) { > - sprintf(line, " disk%d: BIOS drive %c (%ju X = %u):\n", i, > + snprintf(line, sizeof(line), > + " disk%d: BIOS drive %c (%ju X %u):\n", i, > (bdinfo[i].bd_unit < 0x80) ? ('A' + = bdinfo[i].bd_unit): > ('C' + bdinfo[i].bd_unit - 0x80), > (uintmax_t)bdinfo[i].bd_sectors, > bdinfo[i].bd_sectorsize); > - if (pager_output(line)) > + if ((ret =3D pager_output(line)) !=3D 0) > break; > dev.d_dev =3D &biosdisk; > dev.d_unit =3D i; > @@ -346,12 +346,14 @@ bd_print(int verbose) > bdinfo[i].bd_sectorsize, > (bdinfo[i].bd_flags & BD_FLOPPY) ? > DISK_F_NOCACHE: 0) =3D=3D 0) { > - sprintf(line, " disk%d", i); > - disk_print(&dev, line, verbose); > + snprintf(line, sizeof(line), " disk%d", i); > + ret =3D disk_print(&dev, line, verbose); > disk_close(&dev); > + if (ret !=3D 0) > + return (ret); > } > } > - pager_close(); > + return (ret); > } >=20 > /* >=20 > Modified: head/sys/boot/i386/libi386/pxe.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -75,7 +75,7 @@ static int pxe_strategy(void *devdata, i > size_t offset, size_t size, char *buf, = size_t *rsize); > static int pxe_open(struct open_file *f, ...); > static int pxe_close(struct open_file *f); > -static void pxe_print(int verbose); > +static int pxe_print(int verbose); > static void pxe_cleanup(void); > static void pxe_setnfshandle(char *rootpath); >=20 > @@ -381,14 +381,20 @@ pxe_close(struct open_file *f) > return (0); > } >=20 > -static void > +static int > pxe_print(int verbose) > { > - > + char line[255]; > if (pxe_call =3D=3D NULL) > - return; > + return (0); >=20 > - printf(" pxe0: %s:%s\n", inet_ntoa(rootip), rootpath); > + if (verbose) { > + snprintf(line, sizeof(line), " pxe0: %s:%s\n", > + inet_ntoa(rootip), rootpath); > + } else { > + snprintf(line, sizeof(line), " pxe0:\n"); > + } > + return (pager_output(line)); > } >=20 > static void >=20 > Modified: head/sys/boot/mips/beri/loader/beri_disk_cfi.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 = 06:13:22 2016 (r308433) > +++ head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 = 06:50:18 2016 (r308434) > @@ -47,7 +47,7 @@ static int beri_cfi_disk_close(struct op > static void beri_cfi_disk_cleanup(void); > static int beri_cfi_disk_strategy(void *, int, daddr_t, size_t, = size_t, > char *, size_t *); > -static void beri_cfi_disk_print(int); > +static int beri_cfi_disk_print(int); >=20 > struct devsw beri_cfi_disk =3D { > .dv_name =3D "cfi", > @@ -112,25 +112,29 @@ beri_cfi_disk_close(struct open_file *f) > return (disk_close(dev)); > } >=20 > -static void > +static int > beri_cfi_disk_print(int verbose) > { > struct disk_devdesc dev; > char line[80]; > + int ret; >=20 > - sprintf(line, " cfi%d CFI flash device\n", 0); > - pager_output(line); > + snprintf(line, sizeof(line), " cfi%d CFI flash device\n", = 0); > + ret =3D pager_output(line); > + if (ret !=3D 0) > + return (ret); > dev.d_dev =3D &beri_cfi_disk; > dev.d_unit =3D 0; > dev.d_slice =3D -1; > dev.d_partition =3D -1; > if (disk_open(&dev, cfi_get_mediasize(), > cfi_get_sectorsize(), 0) =3D=3D 0) { > - sprintf(line, " cfi%d", 0); > - disk_print(&dev, line, verbose); > + snprintf(line, sizeof(line), " cfi%d", 0); > + ret =3D disk_print(&dev, line, verbose); > disk_close(&dev); > } >=20 > + return (ret); > } >=20 > static void >=20 > Modified: head/sys/boot/mips/beri/loader/beri_disk_sdcard.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 = 06:13:22 2016 (r308433) > +++ head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 = 06:50:18 2016 (r308434) > @@ -47,7 +47,7 @@ static int beri_sdcard_disk_close(struct > static void beri_sdcard_disk_cleanup(void); > static int beri_sdcard_disk_strategy(void *, int, daddr_t, = size_t, size_t, > char *, size_t *); > -static void beri_sdcard_disk_print(int); > +static int beri_sdcard_disk_print(int); >=20 > struct devsw beri_sdcard_disk =3D { > .dv_name =3D "sdcard", > @@ -123,19 +123,23 @@ beri_sdcard_disk_print(int verbose) > { > struct disk_devdesc dev; > char line[80]; > + int ret; >=20 > - sprintf(line, " sdcard%d Altera SD card drive\n", 0); > - pager_output(line); > + snprintf(line, sizeof(line), " sdcard%d Altera SD card = drive\n", 0); > + ret =3D pager_output(line); > + if (ret !=3D 0) > + return (ret); > dev.d_dev =3D &beri_sdcard_disk; > dev.d_unit =3D 0; > dev.d_slice =3D -1; > dev.d_partition =3D -1; > if (disk_open(&dev, altera_sdcard_get_mediasize(), > altera_sdcard_get_sectorsize(), 0) =3D=3D 0) { > - sprintf(line, " sdcard%d", 0); > - disk_print(&dev, line, verbose); > + snprintf(line, sizeof(line), " sdcard%d", 0); > + ret =3D disk_print(&dev, line, verbose); > disk_close(&dev); > } > + return (ret); > } >=20 > static void >=20 > Modified: head/sys/boot/ofw/libofw/ofw_disk.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -47,7 +47,7 @@ static int ofwd_strategy(void *devdata, > static int ofwd_open(struct open_file *f, ...); > static int ofwd_close(struct open_file *f); > static int ofwd_ioctl(struct open_file *f, u_long cmd, void = *data); > -static void ofwd_print(int verbose); > +static int ofwd_print(int verbose); >=20 > struct devsw ofwdisk =3D { > "block", > @@ -161,8 +161,8 @@ ofwd_ioctl(struct open_file *f __unused, > return (EINVAL); > } >=20 > -static void > +static int > ofwd_print(int verbose __unused) > { > - > + return (0); > } >=20 > Modified: head/sys/boot/pc98/libpc98/bioscd.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -99,7 +99,7 @@ static int bc_realstrategy(void *devdata > size_t offset, size_t size, char *buf, size_t = *rsize); > static int bc_open(struct open_file *f, ...); > static int bc_close(struct open_file *f); > -static void bc_print(int verbose); > +static int bc_print(int verbose); >=20 > struct devsw bioscd =3D { > "cd", > @@ -173,20 +173,19 @@ bc_add(int biosdev) > /* > * Print information about disks > */ > -static void > +static int > bc_print(int verbose) > { > char line[80]; > - int i; > + int i, ret =3D 0; >=20 > - pager_open(); > for (i =3D 0; i < nbcinfo; i++) { > sprintf(line, " cd%d: Device 0x%x\n", i, > bcinfo[i].bc_sp.sp_devicespec); > - if (pager_output(line)) > + if ((ret =3D pager_output(line)) !=3D 0) > break; > } > - pager_close(); > + return (ret); > } >=20 > /* >=20 > Modified: head/sys/boot/pc98/libpc98/biosdisk.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:13:22 = 2016 (r308433) > +++ head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:50:18 = 2016 (r308434) > @@ -123,7 +123,7 @@ static int bd_realstrategy(void *devdata > size_t offset, size_t size, char *buf, size_t = *rsize); > static int bd_open(struct open_file *f, ...); > static int bd_close(struct open_file *f); > -static void bd_print(int verbose); > +static int bd_print(int verbose); >=20 > struct devsw biosdisk =3D { > "disk", > @@ -249,21 +249,20 @@ bd_int13probe(struct bdinfo *bd) > /* > * Print information about disks > */ > -static void > +static int > bd_print(int verbose) > { > - int i, j, done; > + int i, j, ret =3D 0; > char line[80]; > struct i386_devdesc dev; > struct open_disk *od; > struct pc98_partition *dptr; >=20 > - pager_open(); > - done =3D 0; > - for (i =3D 0; i < nbdinfo && !done; i++) { > - sprintf(line, " disk%d: BIOS drive %c:\n", i, 'A' + i); > - if (pager_output(line)) > - break; > + for (i =3D 0; i < nbdinfo; i++) { > + snprintf(line, sizeof(line), " disk%d: BIOS drive %c:\n", > + i, 'A' + i); > + if ((ret =3D pager_output(line)) !=3D 0) > + break; >=20 > /* try to open the whole disk */ > dev.d_unit =3D i; > @@ -278,17 +277,17 @@ bd_print(int verbose) >=20 > /* Check for a "dedicated" disk */ > for (j =3D 0; j < od->od_nslices; j++) { > - sprintf(line, " disk%ds%d", i, j + 1); > - if (bd_printslice(od, &dptr[j], line, verbose)) { > - done =3D 1; > - break; > - } > + snprintf(line, sizeof(line), " disk%ds%d", i, = j + 1); > + if ((ret =3D bd_printslice(od, &dptr[j], line, = verbose)) !=3D 0) > + break; > } > } > bd_closedisk(od); > + if (ret !=3D 0) > + break; > } > } > - pager_close(); > + return (ret); > } >=20 > /* Given a size in 512 byte sectors, convert it to a human-readable = number. */ >=20 > Modified: head/sys/boot/powerpc/kboot/hostdisk.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:13:22 = 2016 (r308433) > +++ head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:50:18 = 2016 (r308434) > @@ -37,7 +37,7 @@ static int hostdisk_strategy(void *devda > static int hostdisk_open(struct open_file *f, ...); > static int hostdisk_close(struct open_file *f); > static int hostdisk_ioctl(struct open_file *f, u_long cmd, void = *data); > -static void hostdisk_print(int verbose); > +static int hostdisk_print(int verbose); >=20 > struct devsw hostdisk =3D { > "/dev", > @@ -117,9 +117,9 @@ hostdisk_ioctl(struct open_file *f, u_lo > return (EINVAL); > } >=20 > -static void > +static int > hostdisk_print(int verbose) > { > - > + return (0); > } >=20 >=20 > Modified: head/sys/boot/powerpc/ps3/ps3cdrom.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:13:22 = 2016 (r308433) > +++ head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:50:18 = 2016 (r308434) > @@ -49,7 +49,7 @@ static int ps3cdrom_strategy(void *devda > size_t offset, size_t size, char *buf, size_t *rsize); > static int ps3cdrom_open(struct open_file *f, ...); > static int ps3cdrom_close(struct open_file *f); > -static void ps3cdrom_print(int verbose); > +static int ps3cdrom_print(int verbose); >=20 > struct devsw ps3cdrom =3D { > "cd", > @@ -149,6 +149,7 @@ static int ps3cdrom_close(struct open_fi > return 0; > } >=20 > -static void ps3cdrom_print(int verbose) > +static int ps3cdrom_print(int verbose) > { > + return (0); > } >=20 > Modified: head/sys/boot/powerpc/ps3/ps3disk.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -61,7 +61,7 @@ static int ps3disk_strategy(void *devdat > size_t offset, size_t size, char *buf, size_t *rsize); > static int ps3disk_open(struct open_file *f, ...); > static int ps3disk_close(struct open_file *f); > -static void ps3disk_print(int verbose); > +static int ps3disk_print(int verbose); >=20 > struct devsw ps3disk =3D { > "disk", > @@ -186,8 +186,9 @@ static int ps3disk_close(struct open_fil > return 0; > } >=20 > -static void ps3disk_print(int verbose) > +static int ps3disk_print(int verbose) > { > + return (0); > } >=20 > static int ps3disk_open_gpt(struct ps3_devdesc *dev, struct open_dev = *od) >=20 > Modified: head/sys/boot/uboot/lib/disk.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -78,7 +78,7 @@ static int stor_strategy(void *, int, da > static int stor_open(struct open_file *, ...); > static int stor_close(struct open_file *); > static int stor_ioctl(struct open_file *f, u_long cmd, void *data); > -static void stor_print(int); > +static int stor_print(int); > static void stor_cleanup(void); >=20 > struct devsw uboot_storage =3D { > @@ -238,30 +238,31 @@ stor_readdev(struct disk_devdesc *dev, d > return (err); > } >=20 > -static void > +static int > stor_print(int verbose) > { > struct disk_devdesc dev; > static char line[80]; > - int i; > + int i, ret =3D 0; >=20 > - pager_open(); > for (i =3D 0; i < stor_info_no; i++) { > dev.d_dev =3D &uboot_storage; > dev.d_unit =3D i; > dev.d_slice =3D -1; > dev.d_partition =3D -1; > - sprintf(line, "\tdisk%d (%s)\n", i, > + snprintf(line, sizeof(line), "\tdisk%d (%s)\n", i, > ub_stor_type(SI(&dev).type)); > - if (pager_output(line)) > + if ((ret =3D pager_output(line)) !=3D 0) > break; > if (stor_opendev(&dev) =3D=3D 0) { > sprintf(line, "\tdisk%d", i); > - disk_print(&dev, line, verbose); > + ret =3D disk_print(&dev, line, verbose); > disk_close(&dev); > + if (ret !=3D 0) > + break; > } > } > - pager_close(); > + return (ret); > } >=20 > static int >=20 > Modified: head/sys/boot/usb/storage/umass_loader.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:13:22 = 2016 (r308433) > +++ head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:50:18 = 2016 (r308434) > @@ -50,7 +50,7 @@ static void umass_disk_cleanup(void); > static int umass_disk_ioctl(struct open_file *, u_long, void *); > static int umass_disk_strategy(void *, int, daddr_t, size_t, size_t, = char *, > size_t *); > -static void umass_disk_print(int); > +static int umass_disk_print(int); >=20 > struct devsw umass_disk =3D { > .dv_name =3D "umass", > @@ -170,23 +170,26 @@ umass_disk_close(struct open_file *f) > return (disk_close(dev)); > } >=20 > -static void > +static int > umass_disk_print(int verbose) > { > struct disk_devdesc dev; >=20 > memset(&dev, 0, sizeof(dev)); >=20 > - pager_output(" umass0 UMASS device\n"); > + ret =3D pager_output(" umass0 UMASS device\n"); > + if (ret !=3D 0) > + return (ret); > dev.d_dev =3D &umass_disk; > dev.d_unit =3D 0; > dev.d_slice =3D -1; > dev.d_partition =3D -1; >=20 > if (umass_disk_open_sub(&dev) =3D=3D 0) { > - disk_print(&dev, " umass0", verbose); > + ret =3D disk_print(&dev, " umass0", verbose); > disk_close(&dev); > } > + return (ret); > } >=20 > static void >=20 > Modified: head/sys/boot/userboot/userboot/host.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:13:22 = 2016 (r308433) > +++ head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:50:18 = 2016 (r308434) > @@ -134,13 +134,13 @@ host_dev_init(void) > return (0); > } >=20 > -static void > +static int > host_dev_print(int verbose) > { > char line[80]; >=20 > - sprintf(line, " host%d: Host filesystem\n", 0); > - pager_output(line); > + snprintf(line, sizeof(line), " host%d: Host = filesystem\n", 0); > + return (pager_output(line)); > } >=20 > /* >=20 > Modified: head/sys/boot/userboot/userboot/userboot_disk.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 = 06:13:22 2016 (r308433) > +++ head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 = 06:50:18 2016 (r308434) > @@ -60,7 +60,7 @@ static int userdisk_realstrategy(void *d > static int userdisk_open(struct open_file *f, ...); > static int userdisk_close(struct open_file *f); > static int userdisk_ioctl(struct open_file *f, u_long cmd, void = *data); > -static void userdisk_print(int verbose); > +static int userdisk_print(int verbose); >=20 > struct devsw userboot_disk =3D { > "disk", > @@ -116,27 +116,33 @@ userdisk_cleanup(void) > /* > * Print information about disks > */ > -static void > +static int > userdisk_print(int verbose) > { > struct disk_devdesc dev; > char line[80]; > - int i; > + int i, ret =3D 0; >=20 > for (i =3D 0; i < userdisk_maxunit; i++) { > - sprintf(line, " disk%d: Guest drive image\n", i); > - pager_output(line); > + snprintf(line, sizeof(line), > + " disk%d: Guest drive image\n", i); > + ret =3D pager_output(line); > + if (ret !=3D 0) > + break; > dev.d_dev =3D &userboot_disk; > dev.d_unit =3D i; > dev.d_slice =3D -1; > dev.d_partition =3D -1; > if (disk_open(&dev, ud_info[i].mediasize, > ud_info[i].sectorsize, 0) =3D=3D 0) { > - sprintf(line, " disk%d", i); > - disk_print(&dev, line, verbose); > + snprintf(line, sizeof(line), " disk%d", i); > + ret =3D disk_print(&dev, line, verbose); > disk_close(&dev); > + if (ret !=3D 0) > + break; > } > } > + return (ret); > } >=20 > /* >=20 > Modified: head/sys/boot/zfs/zfs.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/zfs/zfs.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/zfs/zfs.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -514,20 +514,23 @@ zfs_probe_dev(const char *devname, uint6 > /* > * Print information about ZFS pools > */ > -static void > +static int > zfs_dev_print(int verbose) > { > spa_t *spa; > char line[80]; > + int ret =3D 0; >=20 > if (verbose) { > - spa_all_status(); > - return; > + return (spa_all_status()); > } > STAILQ_FOREACH(spa, &zfs_pools, spa_link) { > - sprintf(line, " zfs:%s\n", spa->spa_name); > - pager_output(line); > + snprintf(line, sizeof(line), " zfs:%s\n", = spa->spa_name); > + ret =3D pager_output(line); > + if (ret !=3D 0) > + break; > } > + return (ret); > } >=20 > /* >=20 > Modified: head/sys/boot/zfs/zfsimpl.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:13:22 2016 = (r308433) > +++ head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:50:18 2016 = (r308434) > @@ -780,7 +780,7 @@ state_name(vdev_state_t state) >=20 > #else >=20 > -static void > +static int > pager_printf(const char *fmt, ...) > { > char line[80]; > @@ -789,14 +789,14 @@ pager_printf(const char *fmt, ...) > va_start(args, fmt); > vsprintf(line, fmt, args); > va_end(args); > - pager_output(line); > + return (pager_output(line)); > } >=20 > #endif >=20 > #define STATUS_FORMAT " %s %s\n" >=20 > -static void > +static int > print_state(int indent, const char *name, vdev_state_t state) > { > int i; > @@ -806,40 +806,56 @@ print_state(int indent, const char *name > for (i =3D 0; i < indent; i++) > strcat(buf, " "); > strcat(buf, name); >=20 > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-head@freebsd.org mailing = list > https://lists.freebsd.org/mailman/listinfo/svn-src-head = > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org = " >=20 From owner-svn-src-head@freebsd.org Thu Nov 10 23:22:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70BDAC3B2FC; Thu, 10 Nov 2016 23:22:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22b.google.com (mail-qk0-x22b.google.com [IPv6:2607:f8b0:400d:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BC338D0; Thu, 10 Nov 2016 23:22:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x22b.google.com with SMTP id x190so778007qkb.0; Thu, 10 Nov 2016 15:22:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0ekvJGVAF2yq1Zbo/LQKZhhhvs4WhOQ+CID0jCOcYAE=; b=xEryN/GExfMoJnPj5aG+5RnRyOWUqwJ2LuH6OFgdTxbh/yqyU+B2l0Q01NpMEtONe2 97Kp3gb19tPgkfCVGF2eKSKqff5g+LUiZOh9Z8yBNgBH/M569+v4MUyuSWrMp3PY2p44 b3iUhk9C3LwEanrnF4s1vPBxOwgQe3eR1sfUJHTgqSgPT+YX0nyvqWMMYLKvP1VLcsBa LTt075JWXwFIEbDAXVZB948izaHV58L6FUyIuiMoq/LzHLXXEoMjY2E//o5q5UZ+vfom lRSWJ4emdCXp6kPtV80f5azlSyV9yJ+ClBdARvTa0fXGcbvm6xLwbtV6LxE05QIy2UzL BA5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0ekvJGVAF2yq1Zbo/LQKZhhhvs4WhOQ+CID0jCOcYAE=; b=PcCFPltLhdNNs3qgZ0AFWnogD2qLTGkw7wv7UchPBuvclqwtM7VTRk+OzSBk0pYwjv RVVybeONyeFDTkbDFpWwbRhahtQvq9typIuXRKC9PSBjT0m5axsuhOn+Q4XxXXAxLTiI VI5s/BipDYNJG0o8UqWMN72a68V3n7E27U3dZVSb0UZpIYYd7wKectf+daGxwSdPkR+X ap+X7sVR0lkn4sjoIhDGXyfDCNCZ9XMZctHgz2rnjWX0lGZ4XZomnVSTzOEfm2PvzZl/ 5u/mD8TeMQxrG8fgL2UZRYkllEw3xPWCqxZkZprKyQtcNbfL7/txSk5QJQ/+x8rAy1uk bpUA== X-Gm-Message-State: ABUngvcUotDgQqLdOM/ATOhW8Iugi+Mol0eFoDQ9Q5JpPp1GuMveW7PCQ+hVDsxhhGDeiMPDY45kKqZTyxisOg== X-Received: by 10.55.122.134 with SMTP id v128mr227089qkc.111.1478820171157; Thu, 10 Nov 2016 15:22:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.29.66 with HTTP; Thu, 10 Nov 2016 15:22:50 -0800 (PST) In-Reply-To: References: <201611011818.uA1II9oe069262@repo.freebsd.org> From: Ngie Cooper Date: Thu, 10 Nov 2016 15:22:50 -0800 Message-ID: Subject: Re: svn commit: r308175 - head/libexec/ftpd To: Matteo Riondato Cc: Kurt Lidl , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 23:22:52 -0000 On Thu, Nov 10, 2016 at 1:25 PM, Matteo Riondato wrote: > >> On Nov 1, 2016, at 2:18 PM, Kurt Lidl wrote: >> >> Author: lidl >> Date: Tue Nov 1 18:18:09 2016 >> New Revision: 308175 >> URL: https://svnweb.freebsd.org/changeset/base/308175 >> >> Log: >> Revisit blacklistd support in ftpd > > This commit is breaking buildworld for me with WITHOUT_BLACKLIST=y in src.conf : Kurt, I can't assign the bug to you because you don't have a bugzilla account, but here's one that was filed: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214409 . Cheers, -Ngie From owner-svn-src-head@freebsd.org Thu Nov 10 23:34:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86AB8C3B604; Thu, 10 Nov 2016 23:34:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FA50E95; Thu, 10 Nov 2016 23:34:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id u205so78644057itc.0; Thu, 10 Nov 2016 15:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=llu0SOLQTY1p70BXCr5xyPOBM+eASbcuYpxlMfcO0/U=; b=SD15OgDWkC4MeUzHqM7NdEaLMSRC+nQ7i/flTeS4d/NLPsCtp7V+t1FkUsUQFveQxz 6ePQ8Cp5LR752KaZU0ziDu7I5Fqxn+lh5yPggUguOre+baHaA763fL9LQ1ZRBaGxI69G XJWiOLbUjbvzFrquS8NeeNauAfrTsxhPgCvSFjFBEJUWTX2uWFBjlVfNHu/suP+4HzNy I4+NYNlbooa2aRPzW3PLbYZkJzyXhZasRhbyGGCIiGEE1Teai7N+4rq8DXFYGWov+jlI 2DmgX1tNrdojLytdamYSsZMwpVAHOghQhSratxNlyqr5K3xnEw/J9hGVdeh6tCqi9qzv a9mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=llu0SOLQTY1p70BXCr5xyPOBM+eASbcuYpxlMfcO0/U=; b=hSOhhrDpaSrTj6HnUu+GqaLG5dzDwb7OudXdh3jlyZX0UchPceNPXxV1ojzyMa0uYZ BYt6K4OZHuLkB0gytByNT0A9VgrtvzWHY3/nLJ174N7xcHtgBM3ZL/w6mXjDg2JqBdhW ai/XNyv96TyvjQh6nA/I/19fj4AZjnSq/e3llQlt9xrbJ5SROGaqmHAd39BdlELEWa1I bZNlypICdYHJSXSKQNJgk5vHzoBsg5hQ0B2on+nRLnmPgCfqlYCj+38wUP4uOqRCtzHs +OH7ypwnsoGHaKE93g/Wy4lz+4wufw1ijev7AY8W6fHWbETjkOt2xNlaHi3NhbJ0atmP rnSg== X-Gm-Message-State: ABUngvdyh2fGRbjoWABWpa1YAvUHv7H4fiTbFj33lvmAlxLTdSJsQnwvLoYZox8eu2lPcRz0O5wGAjFBP4nx3Q== X-Received: by 10.36.65.216 with SMTP id b85mr19270485itd.39.1478820857055; Thu, 10 Nov 2016 15:34:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Thu, 10 Nov 2016 15:34:16 -0800 (PST) In-Reply-To: <201609151725.u8FHPqFH081568@repo.freebsd.org> References: <201609151725.u8FHPqFH081568@repo.freebsd.org> From: Adrian Chadd Date: Thu, 10 Nov 2016 15:34:16 -0800 Message-ID: Subject: Re: svn commit: r305843 - in head/sys/mips: include mips To: Brooks Davis , "freebsd-mips@freebsd.org" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 23:34:19 -0000 hi, This patch breaks stuff on my mips24k SoCs (ie, all the atheros chips.) BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x4002a4 got a read fault (type 0x2) at 0 Trapframe Register Dump: zero: 0 at: 0 v0: 0 v1: 0 a0: 0x7fffeecc a1: 0 a2: 0 a3: 0 t0: 0 t1: 0 t2: 0 t3: 0 t4: 0 t5: 0 t6: 0 t7: 0 t8: 0 t9: 0x400260 s0: 0x10 s1: 0x2 s2: 0x7fffeed0 s3: 0 s4: 0 s5: 0 s6: 0 s7: 0 k0: 0 k1: 0 gp: 0x4d55d0 sp: 0x7ffeee90 s8: 0 ra: 0 sr: 0xfc13 mullo: 0 mulhi: 0 badvaddr: 0 cause: 0x8 pc: 0x4002a4 Page table info for pc address 0x4002a4: pde = 0x809a8000, pte = 0xa001b35a Dumping 4 words starting at pc address 0x4002a4: 8c420000 14400003 00908021 8f828024 Page table info for bad address 0: pde = 0, pte = 0 -adrian On 15 September 2016 at 10:25, Brooks Davis wrote: > Author: brooks > Date: Thu Sep 15 17:25:52 2016 > New Revision: 305843 > URL: https://svnweb.freebsd.org/changeset/base/305843 > > Log: > The TLS offset is a property of the process ABI. > > Move to a per-proc TLS offset rather than incorrectly keying off the > presense of freebsd32 compability in the kernel. > > Reviewed by: adrian, sbruno > Obtained from: CheriBSD > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D7843 > > Modified: > head/sys/mips/include/proc.h > head/sys/mips/mips/cpu.c > head/sys/mips/mips/freebsd32_machdep.c > head/sys/mips/mips/genassym.c > head/sys/mips/mips/pm_machdep.c > head/sys/mips/mips/swtch.S > head/sys/mips/mips/sys_machdep.c > head/sys/mips/mips/trap.c > head/sys/mips/mips/vm_machdep.c > > Modified: head/sys/mips/include/proc.h > ============================================================================== > --- head/sys/mips/include/proc.h Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/include/proc.h Thu Sep 15 17:25:52 2016 (r305843) > @@ -62,6 +62,7 @@ struct mdthread { > int md_pc_count; /* performance counter */ > int md_pc_spill; /* performance counter spill */ > void *md_tls; > + size_t md_tls_tcb_offset; /* TCB offset */ > #ifdef CPU_CNMIPS > struct octeon_cop2_state *md_cop2; /* kernel context */ > struct octeon_cop2_state *md_ucop2; /* userland context */ > > Modified: head/sys/mips/mips/cpu.c > ============================================================================== > --- head/sys/mips/mips/cpu.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/cpu.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -71,13 +71,12 @@ struct mips_cpuinfo cpuinfo; > # define _LOAD_T0_MDTLS_A1 \ > _ENCODE_INSN(OP_LD, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) > > -# if defined(COMPAT_FREEBSD32) > -# define _ADDIU_V0_T0_TLS_OFFSET \ > - _ENCODE_INSN(OP_DADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE32)) > -# else > -# define _ADDIU_V0_T0_TLS_OFFSET \ > - _ENCODE_INSN(OP_DADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE)) > -# endif /* ! COMPAT_FREEBSD32 */ > +# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ > + _ENCODE_INSN(OP_LD, A1, T1, 0, \ > + offsetof(struct thread, td_md.md_tls_tcb_offset)) > + > +# define _ADDU_V0_T0_T1 \ > + _ENCODE_INSN(0, T0, T1, V0, OP_DADDU) > > # define _MTC0_V0_USERLOCAL \ > _ENCODE_INSN(OP_COP0, OP_DMT, V0, 4, 2) > @@ -86,8 +85,14 @@ struct mips_cpuinfo cpuinfo; > > # define _LOAD_T0_MDTLS_A1 \ > _ENCODE_INSN(OP_LW, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) > -# define _ADDIU_V0_T0_TLS_OFFSET \ > - _ENCODE_INSN(OP_ADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE)) > + > +# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ > + _ENCODE_INSN(OP_LW, A1, T1, 0, \ > + offsetof(struct thread, td_md.md_tls_tcb_offset)) > + > +# define _ADDU_V0_T0_T1 \ > + _ENCODE_INSN(0, T0, T1, V0, OP_ADDU) > + > # define _MTC0_V0_USERLOCAL \ > _ENCODE_INSN(OP_COP0, OP_MT, V0, 4, 2) > > @@ -111,8 +116,9 @@ remove_userlocal_code(uint32_t *cpu_swit > if (instructp[0] == _JR_RA) > panic("%s: Unable to patch cpu_switch().", __func__); > if (instructp[0] == _LOAD_T0_MDTLS_A1 && > - instructp[1] == _ADDIU_V0_T0_TLS_OFFSET && > - instructp[2] == _MTC0_V0_USERLOCAL) { > + instructp[1] == _LOAD_T0_MDTLS_TCV_OFFSET_A1 && > + instructp[2] == _ADDU_V0_T0_T1 && > + instructp[3] == _MTC0_V0_USERLOCAL) { > instructp[0] = _JR_RA; > instructp[1] = _NOP; > break; > > Modified: head/sys/mips/mips/freebsd32_machdep.c > ============================================================================== > --- head/sys/mips/mips/freebsd32_machdep.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/freebsd32_machdep.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -61,6 +61,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -138,6 +139,8 @@ freebsd32_exec_setregs(struct thread *td > * Clear extended address space bit for userland. > */ > td->td_frame->sr &= ~MIPS_SR_UX; > + > + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; > } > > int > > Modified: head/sys/mips/mips/genassym.c > ============================================================================== > --- head/sys/mips/mips/genassym.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/genassym.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -74,12 +74,7 @@ ASSYM(TD_FLAGS, offsetof(struct thread, > ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); > ASSYM(TD_MDFLAGS, offsetof(struct thread, td_md.md_flags)); > ASSYM(TD_MDTLS, offsetof(struct thread, td_md.md_tls)); > - > -#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) > -ASSYM(TLS_TCB_OFFSET, (TLS_TP_OFFSET + TLS_TCB_SIZE32)); > -#else > -ASSYM(TLS_TCB_OFFSET, (TLS_TP_OFFSET + TLS_TCB_SIZE)); > -#endif > +ASSYM(TD_MDTLS_TCB_OFFSET, offsetof(struct thread, td_md.md_tls_tcb_offset)); > > ASSYM(U_PCB_REGS, offsetof(struct pcb, pcb_regs.zero)); > ASSYM(U_PCB_CONTEXT, offsetof(struct pcb, pcb_context)); > > Modified: head/sys/mips/mips/pm_machdep.c > ============================================================================== > --- head/sys/mips/mips/pm_machdep.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/pm_machdep.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -466,6 +467,8 @@ exec_setregs(struct thread *td, struct i > if (PCPU_GET(fpcurthread) == td) > PCPU_SET(fpcurthread, (struct thread *)0); > td->td_md.md_ss_addr = 0; > + > + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; > } > > int > > Modified: head/sys/mips/mips/swtch.S > ============================================================================== > --- head/sys/mips/mips/swtch.S Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/swtch.S Thu Sep 15 17:25:52 2016 (r305843) > @@ -385,7 +385,8 @@ sw2: > * remove_userlocal_code() in cpu.c. > */ > PTR_L t0, TD_MDTLS(a1) # Get TLS pointer > - PTR_ADDIU v0, t0, TLS_TCB_OFFSET # Add TLS/TCB offset > + PTR_L t1, TD_MDTLS_TCB_OFFSET(a1) # Get TLS/TCB offset > + PTR_ADDU v0, t0, t1 > MTC0 v0, MIPS_COP_0_USERLOCAL, 2 # write it to ULR for rdhwr > > j ra > > Modified: head/sys/mips/mips/sys_machdep.c > ============================================================================== > --- head/sys/mips/mips/sys_machdep.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/sys_machdep.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -69,13 +69,8 @@ sysarch(struct thread *td, struct sysarc > * rdhwr trap() instruction handler. > */ > if (cpuinfo.userlocal_reg == true) { > -#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) > mips_wr_userlocal((unsigned long)(uap->parms + > - TLS_TP_OFFSET + TLS_TCB_SIZE32)); > -#else > - mips_wr_userlocal((unsigned long)(uap->parms + > - TLS_TP_OFFSET + TLS_TCB_SIZE)); > -#endif > + td->td_md.md_tls_tcb_offset)); > } > return (0); > case MIPS_GET_TLS: > > Modified: head/sys/mips/mips/trap.c > ============================================================================== > --- head/sys/mips/mips/trap.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/trap.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -909,12 +909,7 @@ dofault: > if (inst.RType.rd == 29) { > frame_regs = &(trapframe->zero); > frame_regs[inst.RType.rt] = (register_t)(intptr_t)td->td_md.md_tls; > -#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) > - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) > - frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE32; > - else > -#endif > - frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE; > + frame_regs[inst.RType.rt] += td->td_md.md_tls_tcb_offset; > trapframe->pc += sizeof(int); > goto out; > } > > Modified: head/sys/mips/mips/vm_machdep.c > ============================================================================== > --- head/sys/mips/mips/vm_machdep.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/vm_machdep.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -154,6 +154,7 @@ cpu_fork(register struct thread *td1,reg > */ > > td2->td_md.md_tls = td1->td_md.md_tls; > + td2->td_md.md_tls_tcb_offset = td1->td_md.md_tls_tcb_offset; > td2->td_md.md_saved_intr = MIPS_SR_INT_IE; > td2->td_md.md_spinlock_count = 1; > #ifdef CPU_CNMIPS > @@ -494,15 +495,16 @@ int > cpu_set_user_tls(struct thread *td, void *tls_base) > { > > - td->td_md.md_tls = (char*)tls_base; > - if (td == curthread && cpuinfo.userlocal_reg == true) { > #if defined(__mips_n64) && defined(COMPAT_FREEBSD32) > - mips_wr_userlocal((unsigned long)tls_base + TLS_TP_OFFSET + > - TLS_TCB_SIZE32); > -#else > - mips_wr_userlocal((unsigned long)tls_base + TLS_TP_OFFSET + > - TLS_TCB_SIZE); > + if (td->td_proc && SV_PROC_FLAG(td->td_proc, SV_ILP32)) > + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; > + else > #endif > + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; > + td->td_md.md_tls = (char*)tls_base; > + if (td == curthread && cpuinfo.userlocal_reg == true) { > + mips_wr_userlocal((unsigned long)tls_base + > + td->td_md.md_tls_tcb_offset); > } > > return (0); > From owner-svn-src-head@freebsd.org Thu Nov 10 23:37:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09C80C3B6C6; Thu, 10 Nov 2016 23:37:40 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C36571078; Thu, 10 Nov 2016 23:37:39 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x22e.google.com with SMTP id u205so78848387itc.0; Thu, 10 Nov 2016 15:37:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=It19lkmJQkHUNsyuVqjVdSf7s5dql/gCrE1ek1VZGSo=; b=zve/JmXYG3yTnnetHgdzV7QB31ZLbEU3UKjoGLnTPRpz6xoxBIyVZY6meSPo8QtRfu FEU5uRtb1B33DkQoaEDFf9fv/HEIZ75wPVBPM28GZxjyG5PrhtBECdhgUBxOaUclFfTJ lX6sR2Q5uv8jQ/4awRVHcBEj41CQ9XKNG9Bn/kFXqFfjRBak3QyOItxZv/W3x+DvOTPi sXMQ24N+A01WLusAYb4hP3aKTiLjVzOJ3/NQb01kXksXH4v9cadSWNclqziDeRzb6oOu gI2p/RfoFjORrLfUPaVD4P4hs6EluccV0WiwibRzXxwax23P8zZPb49OJ2hatKGVSeF9 7+nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=It19lkmJQkHUNsyuVqjVdSf7s5dql/gCrE1ek1VZGSo=; b=kDHNUbFBuLNYKfz8gjrAu262pcN2VMLT6BZ11xWeEZDXQLp/f1E/lhFOdNwdKNaM2i B7rG2+jrNvkWlcvsUMyz2Y/zjNT7Z3Z63R5eobmx6Ur6QeODkQChcpSr/1AJhhKYDhO2 z/xuf9AeuOSUvkwHkUPf6d0WErnArWfS+VAJtIOE+2X4xEMo1Jr3MsUA836R/9pciI0F jqx7CAf5+LnUkeRnzn9lmzgZXck9xMVdt+jnz0ncgHVDpnN/b0h4j2JCw61CyWaMqOcf 7+QIW4Le1nD2UyYlS3xG8bmpCw0STZYSaZNAOYzmBgAnodfAhznTpSbHN3MtqcRuYvYE ZRAw== X-Gm-Message-State: ABUngvfJlFHvg8cCnb56n5wrDl+sRowoZmf/jJQylbX9g69ImGtbxOcIEsaB019e4VV7F6Jn7E9JwYdkDqruvw== X-Received: by 10.107.174.157 with SMTP id n29mr4753135ioo.177.1478821059234; Thu, 10 Nov 2016 15:37:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Thu, 10 Nov 2016 15:37:38 -0800 (PST) In-Reply-To: <20161110213412.GA21672@bsdpad.com> References: <201610311533.u9VFXw2x053156@repo.freebsd.org> <128f2edc-eced-dc8b-72b4-267e1d26bd48@FreeBSD.org> <20161103201059.GA2104@bsdpad.com> <20161110213412.GA21672@bsdpad.com> From: Adrian Chadd Date: Thu, 10 Nov 2016 15:37:38 -0800 Message-ID: Subject: Re: svn commit: r308130 - in head: . gnu/lib/libgcc gnu/usr.bin/binutils gnu/usr.bin/binutils/ld gnu/usr.bin/binutils/libbfd gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb lib/libc lib/libc/mips... To: Ruslan Bukin Cc: "freebsd-mips@freebsd.org" , Bryan Drewery , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 23:37:40 -0000 The places where we set MIPS_SR_COP_1_BIT in locore.S, exception.S. -adrian On 10 November 2016 at 13:34, Ruslan Bukin wrote: > Hi, Adrian, > > thanks, but I have lack of ideas yet. > > I just tested this on Ingenic X1000 (mips.mipsel) and it works fine, > as well as mips.mipselhf (this hardware has FPU). > > I have no hardware without FPU. > > What exactly COP_1 bits you have commented to get rid of COP1_UNUSABLE? > > Ruslan > > On Thu, Nov 10, 2016 at 01:09:20PM -0800, Adrian Chadd wrote: >> ok, so there are two problems with mips now. >> >> * COP1_UNUSABLE - which is now being logged, and we were likely >> triggering it before. The problem: we always turned it on. If I >> comment out flipping on the COP1 bits in the .S files, those >> exceptions go away. >> >> * Page faults, but that may be me with an older userland: >> >> BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 got a >> read fault (type 0x2) at 0x8 >> Trapframe Register Dump: >> zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: >> 0xffffffffffffffff >> a0: 0x404471b8 a1: 0x7ffeea50 a2: 0x16c a3: 0 >> t0: 0 t1: 0 t2: 0 t3: 0x70000011 >> t4: 0x11 t5: 0x70000013 t6: 0x3 t7: 0 >> t8: 0 t9: 0x4041c940 s0: 0 s1: 0x40417000 >> s2: 0x7fffeee0 s3: 0xffffffffffffffff s4: 0xc s5: 0x40427000 >> s6: 0x7fffeecc s7: 0x7ffeea50 k0: 0 k1: 0 >> gp: 0x4044e630 sp: 0x7ffee838 s8: 0x2 ra: 0x404224d4 >> sr: 0xfc13 mullo: 0 mulhi: 0 badvaddr: 0x8 >> cause: 0x8 pc: 0x404237c0 >> Page table info for pc address 0x404237c0: pde = 0x809aa000, pte = 0xa001ba9a >> Dumping 4 words starting at pc address 0x404237c0: >> 8e100008 1600fff1 8f828070 100000a3 >> >> >> >> -adrian >> >> >> On 10 November 2016 at 12:49, Adrian Chadd wrote: >> > hi, >> > >> > This fails to boot on actual mips24k hardware, no hardfloat: >> > >> > COP1_UNUSABLE: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 ra 0x404224d4 >> > Trapframe Register Dump: >> > zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: >> > 0xffffffffffffffff >> > >> > .. lots of that the moment we boot userland. >> > >> > >> > >> > -adrian >> > >> > >> > On 3 November 2016 at 13:10, Ruslan Bukin wrote: >> >> On Thu, Nov 03, 2016 at 12:39:48PM -0700, Bryan Drewery wrote: >> >>> On 10/31/16 8:33 AM, Ruslan Bukin wrote: >> >>> > Modified: head/share/mk/bsd.cpu.mk >> >>> > ============================================================================== >> >>> > --- head/share/mk/bsd.cpu.mk Mon Oct 31 15:11:55 2016 (r308129) >> >>> > +++ head/share/mk/bsd.cpu.mk Mon Oct 31 15:33:58 2016 (r308130) >> >>> > @@ -303,6 +303,9 @@ MACHINE_CPU = v9 ultrasparc ultrasparc3 >> >>> > >> >>> > .if ${MACHINE_CPUARCH} == "mips" >> >>> > CFLAGS += -G0 >> >>> > +.if ${TARGET_ARCH:Mmips*hf} >> >>> >> >>> TARGET_ARCH is not valid here. This broke building ports. Fixed in >> >>> r308262. >> >>> >> >> >> >> Thank you! >> >> >> >> Ruslan >> >> From owner-svn-src-head@freebsd.org Fri Nov 11 02:42:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95094C3ABA7; Fri, 11 Nov 2016 02:42:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FDE5AA8; Fri, 11 Nov 2016 02:42:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAB2gs6s074112; Fri, 11 Nov 2016 02:42:54 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAB2gsfj074107; Fri, 11 Nov 2016 02:42:54 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201611110242.uAB2gsfj074107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 11 Nov 2016 02:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308493 - in head: contrib/amd contrib/amd/amd contrib/amd/amq contrib/amd/conf/checkmount contrib/amd/conf/mtab contrib/amd/conf/nfs_prot contrib/amd/conf/transp contrib/amd/conf/umoun... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 02:42:55 -0000 Author: cy Date: Fri Nov 11 02:42:53 2016 New Revision: 308493 URL: https://svnweb.freebsd.org/changeset/base/308493 Log: MFV r305100: Update amd from am-utils 6.1.5 to 6.2. Used extensively on my network over the past month. Reviewed by: pfg, brooks Suggested by: pfg Obtained from: ftp://ftp.am-utils.org/pub/am-utils/ MFC after: 6 weeks Relnotes: yes Differential Revision: D8405 Added: head/contrib/amd/amd/info_sun.c - copied unchanged from r305100, vendor/amd/dist/amd/info_sun.c head/contrib/amd/amd/ops_ext.c - copied unchanged from r305100, vendor/amd/dist/amd/ops_ext.c head/contrib/amd/amd/ops_lustre.c - copied unchanged from r305100, vendor/amd/dist/amd/ops_lustre.c head/contrib/amd/amd/ops_nfs4.c - copied unchanged from r305100, vendor/amd/dist/amd/ops_nfs4.c head/contrib/amd/amd/ops_udf.c - copied, changed from r305100, vendor/amd/dist/amd/ops_udf.c head/contrib/amd/amd/sun2amd.8 - copied unchanged from r305100, vendor/amd/dist/amd/sun2amd.8 head/contrib/amd/amd/sun2amd.c - copied unchanged from r305100, vendor/amd/dist/amd/sun2amd.c head/contrib/amd/amd/sun_map.c - copied unchanged from r305100, vendor/amd/dist/amd/sun_map.c head/contrib/amd/amd/sun_map.h - copied unchanged from r305100, vendor/amd/dist/amd/sun_map.h head/contrib/amd/amd/sun_map_parse.y - copied unchanged from r305100, vendor/amd/dist/amd/sun_map_parse.y head/contrib/amd/amd/sun_map_tok.l - copied unchanged from r305100, vendor/amd/dist/amd/sun_map_tok.l head/contrib/amd/amd/test1.sh - copied unchanged from r305100, vendor/amd/dist/amd/test1.sh head/contrib/amd/fsinfo/null_gram.c - copied unchanged from r305100, vendor/amd/dist/fsinfo/null_gram.c head/contrib/amd/fsinfo/null_gram.h - copied unchanged from r305100, vendor/amd/dist/fsinfo/null_gram.h head/contrib/amd/fsinfo/null_gram.y - copied unchanged from r305100, vendor/amd/dist/fsinfo/null_gram.y head/contrib/amd/fsinfo/null_lex.c - copied unchanged from r305100, vendor/amd/dist/fsinfo/null_lex.c head/contrib/amd/fsinfo/null_lex.l - copied unchanged from r305100, vendor/amd/dist/fsinfo/null_lex.l head/contrib/amd/include/nfs_common.h - copied unchanged from r305100, vendor/amd/dist/include/nfs_common.h Modified: head/contrib/amd/AUTHORS head/contrib/amd/BUGS head/contrib/amd/COPYING head/contrib/amd/ChangeLog head/contrib/amd/FAQ head/contrib/amd/INSTALL head/contrib/amd/MIRRORS.html head/contrib/amd/MIRRORS.txt head/contrib/amd/NEWS head/contrib/amd/README head/contrib/amd/README.attrcache head/contrib/amd/README.ldap head/contrib/amd/README.y2k head/contrib/amd/amd/am_ops.c head/contrib/amd/amd/amd.8 head/contrib/amd/amd/amd.c head/contrib/amd/amd/amd.h head/contrib/amd/amd/amfs_auto.c head/contrib/amd/amd/amfs_direct.c head/contrib/amd/amd/amfs_error.c head/contrib/amd/amd/amfs_generic.c head/contrib/amd/amd/amfs_host.c head/contrib/amd/amd/amfs_link.c head/contrib/amd/amd/amfs_linkx.c head/contrib/amd/amd/amfs_nfsl.c head/contrib/amd/amd/amfs_nfsx.c head/contrib/amd/amd/amfs_program.c head/contrib/amd/amd/amfs_root.c head/contrib/amd/amd/amfs_toplvl.c head/contrib/amd/amd/amfs_union.c head/contrib/amd/amd/amq_subr.c head/contrib/amd/amd/amq_svc.c head/contrib/amd/amd/autil.c head/contrib/amd/amd/clock.c head/contrib/amd/amd/conf.c head/contrib/amd/amd/conf_parse.y head/contrib/amd/amd/conf_tok.l head/contrib/amd/amd/get_args.c head/contrib/amd/amd/info_exec.c head/contrib/amd/amd/info_file.c head/contrib/amd/amd/info_hesiod.c head/contrib/amd/amd/info_ldap.c head/contrib/amd/amd/info_ndbm.c head/contrib/amd/amd/info_nis.c head/contrib/amd/amd/info_nisplus.c head/contrib/amd/amd/info_passwd.c head/contrib/amd/amd/info_union.c head/contrib/amd/amd/map.c head/contrib/amd/amd/mapc.c head/contrib/amd/amd/mntfs.c head/contrib/amd/amd/nfs_prot_svc.c head/contrib/amd/amd/nfs_start.c head/contrib/amd/amd/nfs_subr.c head/contrib/amd/amd/ops_TEMPLATE.c head/contrib/amd/amd/ops_cachefs.c head/contrib/amd/amd/ops_cdfs.c head/contrib/amd/amd/ops_efs.c head/contrib/amd/amd/ops_lofs.c head/contrib/amd/amd/ops_mfs.c head/contrib/amd/amd/ops_nfs.c head/contrib/amd/amd/ops_nfs3.c head/contrib/amd/amd/ops_nullfs.c head/contrib/amd/amd/ops_pcfs.c head/contrib/amd/amd/ops_tfs.c head/contrib/amd/amd/ops_tmpfs.c head/contrib/amd/amd/ops_ufs.c head/contrib/amd/amd/ops_umapfs.c head/contrib/amd/amd/ops_unionfs.c head/contrib/amd/amd/ops_xfs.c head/contrib/amd/amd/opts.c head/contrib/amd/amd/readdir.c head/contrib/amd/amd/restart.c head/contrib/amd/amd/rpc_fwd.c head/contrib/amd/amd/sched.c head/contrib/amd/amd/srvr_amfs_auto.c head/contrib/amd/amd/srvr_nfs.c head/contrib/amd/amq/amq.8 head/contrib/amd/amq/amq.c head/contrib/amd/amq/amq.h head/contrib/amd/amq/amq_clnt.c head/contrib/amd/amq/amq_xdr.c head/contrib/amd/amq/pawd.1 head/contrib/amd/amq/pawd.c head/contrib/amd/bootstrap head/contrib/amd/conf/checkmount/checkmount_bsd44.c head/contrib/amd/conf/mtab/mtab_bsd.c head/contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h head/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h head/contrib/amd/conf/transp/transp_sockets.c head/contrib/amd/conf/umount/umount_bsd44.c head/contrib/amd/doc/am-utils.texi head/contrib/amd/doc/stamp-vti head/contrib/amd/doc/texinfo.tex head/contrib/amd/doc/version.texi head/contrib/amd/fixmount/fixmount.8 head/contrib/amd/fixmount/fixmount.c head/contrib/amd/fsinfo/fsi_analyze.c head/contrib/amd/fsinfo/fsi_data.h head/contrib/amd/fsinfo/fsi_dict.c head/contrib/amd/fsinfo/fsi_gram.y head/contrib/amd/fsinfo/fsi_lex.l head/contrib/amd/fsinfo/fsi_util.c head/contrib/amd/fsinfo/fsinfo.8 head/contrib/amd/fsinfo/fsinfo.c head/contrib/amd/fsinfo/fsinfo.h head/contrib/amd/fsinfo/wr_atab.c head/contrib/amd/fsinfo/wr_bparam.c head/contrib/amd/fsinfo/wr_dumpset.c head/contrib/amd/fsinfo/wr_exportfs.c head/contrib/amd/fsinfo/wr_fstab.c head/contrib/amd/hlfsd/hlfsd.8 head/contrib/amd/hlfsd/hlfsd.c head/contrib/amd/hlfsd/hlfsd.h head/contrib/amd/hlfsd/homedir.c head/contrib/amd/hlfsd/nfs_prot_svc.c head/contrib/amd/hlfsd/stubs.c head/contrib/amd/include/am_compat.h head/contrib/amd/include/am_defs.h head/contrib/amd/include/am_utils.h head/contrib/amd/include/am_xdr_func.h head/contrib/amd/include/amq_defs.h head/contrib/amd/include/mount_headers1.h head/contrib/amd/include/mount_headers2.h head/contrib/amd/ldap-id.ms head/contrib/amd/ldap-id.txt head/contrib/amd/libamu/amu.h head/contrib/amd/libamu/hasmntopt.c head/contrib/amd/libamu/misc_rpc.c head/contrib/amd/libamu/mount_fs.c head/contrib/amd/libamu/mtab.c head/contrib/amd/libamu/nfs_prot_xdr.c head/contrib/amd/libamu/strerror.c head/contrib/amd/libamu/strutil.c head/contrib/amd/libamu/wire.c head/contrib/amd/libamu/xdr_func.c head/contrib/amd/libamu/xutil.c head/contrib/amd/mk-amd-map/mk-amd-map.8 head/contrib/amd/mk-amd-map/mk-amd-map.c head/contrib/amd/scripts/amd.conf-sample head/contrib/amd/scripts/amd.conf.5 head/contrib/amd/scripts/automount2amd.8 head/contrib/amd/scripts/fixrmtab.in head/contrib/amd/vers.m4 head/contrib/amd/wire-test/wire-test.8 head/contrib/amd/wire-test/wire-test.c head/usr.sbin/amd/amd/Makefile head/usr.sbin/amd/fsinfo/Makefile head/usr.sbin/amd/include/config.h Directory Properties: head/contrib/amd/ (props changed) Modified: head/contrib/amd/AUTHORS ============================================================================== --- head/contrib/amd/AUTHORS Fri Nov 11 02:40:44 2016 (r308492) +++ head/contrib/amd/AUTHORS Fri Nov 11 02:42:53 2016 (r308493) @@ -6,22 +6,22 @@ This file lists the ones who contributed particular order, and I thank them all. This is of course not to diminish the smaller contributes of the many others. Thank you all. -* Erez Zadok +* Erez Zadok The most significant changes were made by Erez Zadok in terms of bug fixes, ports, and new features added. Erez Zadok is the current maintainer of am-utils, as of January 1997. -* Ion Badulescu +* Ion Badulescu Co-maintainer of am-utils since late 1999: Linux and Solaris autofs support, Linux NFSv3 support, major code reorganization, etc... -* Randall S. Winchester +* Randall S. Winchester May 7, 1997: contributed a special version of upl102 that included NFS V.3 support. Some of the code was contributed by Christos Zoulas -. I (Erez) ported these changes to am-utils. +. I (Erez) ported these changes to am-utils. September 12, 1997: lots of small prototype cleanups and fixes to numerous files. @@ -35,12 +35,12 @@ February 1, 1998: fixes for NetBSD to be September 4, 1999: assorted fixes for NetBSD 1.4+. -* Hannes Reinecke +* Hannes Reinecke Back in 1995, contributed code for linux. A new parser for file system specific options that only exist under linux. -* Leif Johansson +* Leif Johansson June 22, 1997: minor patch to ensure that systems without an RE library work. @@ -52,7 +52,7 @@ functions. Contributed scripts/amd2ldif August 4, 1997: info_ldap.c fixes and adding two new amd.conf ldap variables: ldap_cache_seconds and ldap_cache_maxmem. -* Andreas Stolcke +* Andreas Stolcke June 22, 1997: patches to ensure that proto= and vers= options work properly in mount tables and can be overridden. Later on, more code @@ -68,11 +68,11 @@ message. December 19, 1997: detected an FMR (Free Memory Read) in amd/mntfs.c, uninit_mntfs(). -* Danny Braniss +* Danny Braniss July, 6 1997: contributed patches to hesiod on bsdi3. -* Tom Schmidt +* Tom Schmidt July 10, 1997: Recommdation to include libgdbm if libc has no dbm_open. Patches for netgrp(host) command. Mods to aux/config.guess to recognize @@ -86,7 +86,7 @@ IFF_ROUTE instead of IFF_LOOPBACK. May 30, 2000: correct logging types for addopts/mergeopts messages. -* Daniel S. Riley +* Daniel S. Riley July 11, 1997: fixes to DU-4.0 to support string POSIX.1 signals, and struct sockaddr with sa_len field. @@ -99,15 +99,15 @@ grpid, nosuid, and actimo. August 15, 1998: fix memory leak in processing of /defaults, and avoid accessing uninitialized memory in osf1. -* Roman Hodek +* Roman Hodek July 23, 1997: Got lots of patches from the Debian Linux folks, who fixed several generic bugs, and one serious one for Linux. The latter involved using connected sockets for NFS mounts on kernels 1.3.10 and older. Roman's -work is baed on amd-upl102, and work from Ian Murdock -and Dominik Kubla . +work is baed on amd-upl102, and work from Ian Murdock +and Dominik Kubla . -* Rainer Orth +* Rainer Orth August 6, 1997: assorted fixes to support hesiod-1.3, solaris 2.4 (which I already fixed but did not release yet), and support for $LDFLAGS at @@ -132,34 +132,34 @@ mount tables in Solaris 8. February 9, 2000: new debug options hrtime (hi-res timer) and xdrtrace. bug fixes. -* Jason Thorpe +* Jason Thorpe August 25, 1997: make amd work when talking to NIS+ servers in NIS compatibility mode. Fix originally came from Matthieu Herrb -. +. -* Chris Metcalf +* Chris Metcalf August 29, 1997: patch to make amd use FQHN for NFS/RPC authentication, useful esp. for cross-domain NFS mounts. September 2, 1997: if plock() succeeded, don't display errno string. -* Enami Tsugutomo +* Enami Tsugutomo September 4, 1997: don't ping remote servers with NFS V.3 always, but V.2, regardless of client's NFS version. (conf/transp/transp_sockets.c) -* Dan Riley +* Dan Riley September 19, 1997: make sure that amd works with more secure portmappers that do not allow forwarding of RPC messages to other services. -* Wolfgang Rupprecht +* Wolfgang Rupprecht August 10, 1997: netbsd and other bsd systems have a mask flag for pcfs_args (msdos mount). -* Christos Zoulas +* Christos Zoulas September 25, 1997: fix to initialize uid/gid fields of pcfs_args_t on netbsd. @@ -181,7 +181,7 @@ TLI implementations. Patch to print ver options had been initialized, so we can print domain, host, and hostd. Linux patch to use umount2(2) if umount(2) fails. -* Bill Paul +* Bill Paul November 5, 1997: NFS v.3 support for AIX 4.2.1, which does *not* include headers for this. Bill had to guess at the right structures, field names, @@ -189,26 +189,26 @@ sizes, alignment, etc. January 15, 1999: small ldap bug fixes. -* Stefan Vogel +* Stefan Vogel November 14, 1997: typo in the subscription instructions to amd-dev. -* Guntram Wolski +* Guntram Wolski November 15, 1997: pointed out mismatching documentation for the -o option. -* Michael Hucka +* Michael Hucka January 11, 1997: pointed out reversed definition of NFS mount options vers and proto. -* Albert Chin +* Albert Chin January 12, 1998: minor bug in output of amd -H. June 23, 2005: assortment of small compile bugs on aix4, and solaris 5/6/7. -* Thomas Richter +* Thomas Richter January 13, 1998: use case insensitive comparisons for variables that need it (such as all hostname related ones, and more). @@ -216,11 +216,11 @@ it (such as all hostname related ones, a July 20, 1998: don't leak memory in the private version of yp_all (when vendor yp_all is bad). -* Fred Korz +* Fred Korz January 30, 1998: minor typo fixed to tftp example in am-utils.texi. -* Donald Buczek +* Donald Buczek March 6, 1998: correctly inherit existing NFS V.3 mounts upon restart. @@ -230,36 +230,36 @@ March 20, 1998: do not close stdout in c allow startup script to redirect it. Set a temporary secure umask(0022) before writing log file and restore it afterwards. -* Matthew Crosby +* Matthew Crosby April 20, 1998: allow arbitrary number of interfaces in wire listing. -* David O'Brien +* David O'Brien September 4, 1998: bug fix to avoid overrunning hostname buffer, and minor amd.conf man page typo correction. September 22, 1999: use more secure vsnprintf in real_plog(). -* Danny Rathjens +* Danny Rathjens October 29, 1998: swap arguments to kill(2) in amd.c. -* Mike Mitchell +* Mike Mitchell November 3, 1998: amd/nfs_subr.c (nfsproc_lookup_2_svc): try to avoid a race condition between unmounting and re-mounting an entry, by increasing the ttl of a looked up entry before unmounting it. -* Douglas K. Rand" +* Douglas K. Rand" December 3, 1998: case insensitive host name match for nfsl. -* David Wolfskill +* David Wolfskill January 28, 1999: don't turn on/off noconn option if it was already in that state. -* Jeffrey C Honig +* Jeffrey C Honig March 14, 1999: clean up more autogenerated files upon "make distclean". March 15, 1999: avoid overly verbose NIS warning even on systems that don't @@ -271,30 +271,30 @@ detection for bsdi4. September 17, 1999: fixes to expn. -* Paul Balyoz +* Paul Balyoz March 26, 1999: ensure lostaltmail displays Y2K compliant dates. -* Jon Peatfield +* Jon Peatfield March 30, 1999: turn off incomplete NFS V.3 support in HPUX 10.20. September 22, 1999: safe reloading of maps without first clearing old copies, and using cached copies if map failed to reload. -* Peter Breitenlohner +* Peter Breitenlohner July 24, 1999: patch for linux 2.2.x to work with older libc5 systems, and nis_isup mis-logic fixes. December 13, 2001: report typos in scripts/amd.conf.5. -* Dale Talcott +* Dale Talcott July 26, 1999: added NFS3 support for AIX mounting. -* Christophe Kalt +* Christophe Kalt July 14, 1999: add netgrpd() syntax function which uses FQHN. -* Andrew J. Korty +* Andrew J. Korty September 5, 1999: pawd works for type:=nfsl. -* Nick Williams +* Nick Williams September 1, 1999: bug fix for incorrect symlinks when two locations are requested simultaneously. @@ -306,38 +306,38 @@ doing rapid mounts and umounts in succes June 5, 2000: better handling of potential race-conditions during rapid u/mounts. Correctly update d_drops stats for amq -s. -* Johann Pfefferl +* Johann Pfefferl November 16, 1999: fix to ldap code so repeated calls to string2he don't corrupt the string passed. -* Amitha Perera +* Amitha Perera December 9, 1999: detect all wire() interfaces correctly. -* Steven Danz +* Steven Danz January 25, 2000: allow browsable auto maps. -* Wolfram Klaus . +* Wolfram Klaus . November 21, 2000: recognize proplist mnttab flag. -* Thomas Klausner +* Thomas Klausner November 21, 2000: lots of NetBSD fixes (many of which are generic). April 18, 2003: patch to reference am-utils info pages in man page. November 28, 2004: small fixes to typos in amd.conf(5) man page. -* Olaf Kirch +* Olaf Kirch February 1, 2001: important Linux NFS error number mapping fixed -* Ahmon Dancy +* Ahmon Dancy February 9, 2001: Apple Rhapsody/Darwin/OS X port -* Sebastien Bahloul +* Sebastien Bahloul July 3, 2001: LDAP fixes and updates to support new APIs March 27, 2002: LDAP bug and port to HPUX-11. -* Philippe Troin +* Philippe Troin July 12, 2001: Proper handling of GNU getopt, support for optionally disabling LDAP/Hesiod, fixes for the dev/nodev option on Linux. Texi documentation fix. @@ -348,65 +348,65 @@ generic mount option. July 17, 2003: pref:=null core dump fix. libgdbm portability. tcpd/librap support. And a few other things for the 6.0 branch. -* Trond Myklebust +* Trond Myklebust January 10, 2002: Proper initialization of the timeo parameter on Linux, TCP _must_ have a timeout 2 orders of magnitude larger than UDP -* George Ross +* George Ross April 29, 2002: Rework of old code, support for wildcards in LDAP queries, and an FD leak fix. Amd -A support. October 21, 2002: ldap_unbind fix for SIGPIPE, and support for LDAPv3 -protocol version parameter (with Tim Colles ). +protocol version parameter (with Tim Colles ). -* Matthias Scheler +* Matthias Scheler June 14, 2002: patch to use "xlatecookie" NFS mount option. -* Jun-ichiro itojun Hagino . +* Jun-ichiro itojun Hagino . June 11, 2002: minor fixes to support NetBSD 1.6A. -* Sean Fagan +* Sean Fagan March 14, 2003: detect and use the MNT2_GEN_OPT_AUTOMNTFS mount flag on OS X / Darwin. -* Hendrik Scholz +* Hendrik Scholz June 9, 2003: mk-amd-map should open temp db file using O_EXCL. -* Mark Davies +* Mark Davies July 14, 2003: define "xlatecookie" mnttab option if not defined (for NetBSD). Support null hesiod entries if they start with a ".". -* Eric S. Raymond +* Eric S. Raymond December 9, 2003: fix unbalanced [] typo in fsinfo man page. -* Martin Blapp +* Martin Blapp July 6, 2004: recognize fields in pcfs_args_t in FreeBSD 5. -* Dan Nelson +* Dan Nelson August 2, 2004: pawd to recognize "host" type mounts. -* Hauke Fath +* Hauke Fath August 3, 2004: pawd to recognize "linkx" type mounts. -* Michael van Elst +* Michael van Elst September 1, 2004: bug fix to avoid race condition in calls to mntctl on AIX. -* Jonathan Chen +* Jonathan Chen October 22, 2004: patch/fix to move mlock/mlockall/plock code after the fork(). June 29, 2005: core dump going off end of exported_ap[] array. September 29, 2005: patch/fix for pawd not to go into an infinite loop. October 25, 2005: patch/fix for pawd to repeatedly resolve path. -* David Rage +* David Rage January 17, 2005: prevent Amd from logging 'Read-only filesystem' errors when the mount point has an ancestor (i.e. '/') that is mounted read-only. -* Kevin Layer +* Kevin Layer January 28, 2005: basic instructions how to setup Amd on Mac OS-X. -* Dan Ottavio +* Dan Ottavio March 2, 2005: new global amd.conf option debug_mtab_file, to set the debug mtab file when using debug_options=mtab. Default has changed from "./mtab" to "/tmp/mtab" to avoid security problem. Bug fixed to ensure that Amd @@ -415,16 +415,13 @@ terminates properly even mtab file doesn * Erik Kline January 3, 2005: implementation of executable maps for Amd. -* Jim Zajkowski +* Jim Zajkowski March 14, 2005: small patch to amd2ldif. * Adam Morley January 27, 2005: synchronize what amd2ldif does vs. what the ldap.schema expects. -* Graeme Wilford +* Graeme Wilford July 4, 2005: buffer overflow in pawd. -* Steve Plite -September 22, 2005: repair reversed meaning of D_AMQ, so amq will unregister -on exit. Modified: head/contrib/amd/BUGS ============================================================================== --- head/contrib/amd/BUGS Fri Nov 11 02:40:44 2016 (r308492) +++ head/contrib/amd/BUGS Fri Nov 11 02:42:53 2016 (r308493) @@ -1,7 +1,7 @@ LIST OF KNOWN BUGS IN AM-UTILS OR OPERATING SYSTEMS Note: report am-utils bugs via Bugzilla to https://bugzilla.am-utils.org/ or -by email to the am-utils@am-utils.org mailing list. +by email to the am-utils mailing list (see www.am-utils.org). (1) mips-sgi-irix* @@ -98,11 +98,11 @@ diff -u -r1.1 utsname.h (4) powerpc-ibm-aix4.2.1.0 -[4A] "Randall S. Winchester" reports that for amd to +[4A] "Randall S. Winchester" reports that for amd to start, you need to kill and restart rpc.mountd and possibly also make sure that nfsd is running. Normally these are not required. -[4B] "Stefan Vogel" reports that if your amq +[4B] "Stefan Vogel" reports that if your amq executable dump core unexpectedly, then it may be a bug in gcc 2.7.x. Upgrade to gcc 2.8.x or use IBM's xlC compiler. @@ -123,7 +123,7 @@ but it is not yet in the glibc-2.0.7-19 A bug in libc results in an amq binary that doesn't work; amq -v dumps core in xdr_string. There is no known fix (source code or vendor patch) at this -time. (Please let am-utils@am-utils.org know if you know of a fix.) +time. (Please let us know if you have a fix; see www.am-utils.org.) (7) *-aix4.3.2.0 Modified: head/contrib/amd/COPYING ============================================================================== --- head/contrib/amd/COPYING Fri Nov 11 02:40:44 2016 (r308492) +++ head/contrib/amd/COPYING Fri Nov 11 02:42:53 2016 (r308493) @@ -1,4 +1,4 @@ -Copyright (c) 1997-2006 Erez Zadok +Copyright (c) 1997-2014 Erez Zadok Copyright (c) 1989 Jan-Simon Pendry Copyright (c) 1989 Imperial College of Science, Technology & Medicine Copyright (c) 1989 The Regents of the University of California. @@ -15,12 +15,7 @@ are met: 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgment: - This product includes software developed by the University of - California, Berkeley and its contributors, as well as the Trustees of - Columbia University. -4. Neither the name of the University nor the names of its contributors +3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. Modified: head/contrib/amd/ChangeLog ============================================================================== --- head/contrib/amd/ChangeLog Fri Nov 11 02:40:44 2016 (r308492) +++ head/contrib/amd/ChangeLog Fri Nov 11 02:42:53 2016 (r308493) @@ -1,14 +1,564 @@ -2006-05-11 Erez Zadok +2014-10-28 Christos Zoulas ******************************************************************* - *** Released am-utils-6.1.5 *** + *** Released am-utils-6.2 *** ******************************************************************* -2006-05-10 Erez Zadok + * add ylwrap.amd, sick and tired of patching broken ylwrap. + +2014-09-05 Christos Zoulas + + * factor out the size check for both readdir methods + (raven at themaw.net) + +2014-09-03 Christos Zoulas + + * configure test for 64 bit xdr function (raven at themaw.net) + +2014-09-01 Christos Zoulas + + * bug fix from raven at themaw.net to prevent writing v3 handle + to a v2 structure. + +2014-07-21 Christos Zoulas + + * fix permission problems with access + * auto_nfs_version = 3 now works for me. + +2014-07-20 Christos Zoulas + + * refresh some autoconf files + * force autoconf version since earlier versions don't work + * changes from raven at themaw.net to support NFSv3 for automounted + toplevel filesystems presented to the list in May. A few bug fixes + and integration changes by me. The code now works well enough to + mount the filesystem with NFSv3 and automount children but readdir + does not work yet (so no listing of automounted filesystems). + The new code is not enabled by default. To enable use + auto_nfs_version = 3 + in your configuration file. + +2014-03-26 Christos Zoulas + + From Ian Kent + + * use mktemp in scripts/fixrmtab + * fix documentatio nits + * [linux] Add ext2, ext3, ext4 specific mount options + * fix tcpwrappers (hosts.{allow,deny} problems for specific host + entries + +2014-03-20 Christos Zoulas + + + * don't background autofs umount + * avoid fh NULL dereference on umount + * handle ENOENT umount return for autofs mounts + * fix error message in get_nfs_version + * fix debug log deadlock + * [linux] retry umount on EBUSY + * handle failed umount on exit + +2014-03-09 Christos Zoulas + + * Remove BSD advertising clause. + * Remove expn program which is not used by anything + +2013-12-05 Christos Zoulas + + * Change the way we handle multiple lex scanners and yacc parsers + in a single program. Our old patch to ylwrap does not work anymore + because the bison parsers need shared symbols that start with yy + and we can't easily select which ones work. So now we use -P and + -p to let lex and yacc do the work for us. This requires a patch + to ylwrap, but it is smaller. + + +2013-12-05 Christos Zoulas + + * Change the way we handle multiple lex scanners and yacc parsers + in a single program. Our old patch to ylwrap does not work anymore + because the bison parsers need shared symbols that start with yy + and we can't easily select which ones work. So now we use -P and + -p to let lex and yacc do the work for us. This requires a patch + to ylwrap, but it is smaller. + +2013-05-14 Christos Zoulas + + * update to handle new autoconf and regen files + +2012-11-23 Christos Zoulas + + * recognize mountport=, noacl options + * simplify the bootstrap process, by forcing + all the files to be rebuild with autoreconf -f - i + +2012-10-03 Christos Zoulas + + * add missing ops_nfs4.c to the Makefile.am + +2012-09-14 Christos Zoulas + + * add locking option handling for lustre + * fix noatime, nodiratime, mandlock for linux + +2012-07-25 Christos Zoulas + + * bug fixes for lustre rhost parsing + +2012-06-27 Christos Zoulas + + * Disable 1/2-baked sun map support to avoid SIGSEGV + +2012-06-16 Christos Zoulas + + ******************************************************************* + *** Released am-utils-6.2-rc1 *** + ******************************************************************* + + * Fix libtool.m4 to work with later versions of autoconf. + * In buildall, use eval so that quoted strings work + * Centralize nfs version checking function, and introduce + new configuration variable nfs_vers_ping, which is the + max version we ping for. This is not documented yet, because + there might be a better way separate the max version we can + use vs the max version we ping for. + +2012-06-09 Christos Zoulas + + * fix issue with parsing nfsv4 security option strings + +2012-05-01 Christos Zoulas + + * Handle EPERM return from v4 file handles + in old linux kernels + +2012-03-09 Christos Zoulas + + * fix linux autofs detection + * fix wrong types in new amq mount xdr processing + +2012-01-25 Christos Zoulas + + * FreeBSD portability fixes + +2012-01-23 Christos Zoulas + + * Avoid type punned warnings + +2011-12-29 Christos Zoulas + + * fix bug I introduced in get_nfs_version that caused it to return 0 + * add direct support for ext{2,3,4} + +2011-12-15 Christos Zoulas + + * Include on linux, to grab extra mount flags + * Add support for lustre + +2011-11-28 Christos Zoulas + + * For nfsl mounts, match against either the short local + host name or the fqdn name. + +2011-10-06 Christos Zoulas + + * Add NFSv4 support (loosely based on Ramya's code). + Currently if the NFSv4 mount fails with ENOENT we fail + back to NFSv3, unless -DNO_FALLBACK. + * Replace strdup with xstrdup. It is not nice to replace + system functions with ones that behave differently. + * Add various consistency checks (caller function checks + variable for NULL, but callee does not). + * Fix error handling in various paths. + * Don't check before using XFREE(). free(NULL) works. + +2011-09-15 Christos Zoulas + + * amq -i addition (prints info about the map files) + +2011-09-14 Christos Zoulas + + * Solaris OS and compiler fixes from: + Hofmann, Frank + Sayle, Alex + - (void)&var generates warnings, removed + - __inline is invalid, changed with inline + - and other headers have extra dependendcies + ` +2011-08-11 Christos Zoulas + + * fix potential buffer overflow in expand_error() + (Richard Kettlewell). Does not seem to be exploitable. + + * simplify %option parsing to appease ancient flex. + +2011-06-21 Christos Zoulas + + * add support for linux autofs version 5 (untested) + +2011-06-18 Christos Zoulas + + * roll back to an older version of libtool that works + + * newer versions of config.guess and config.sub + + * minor fixes to buildall + +2011-05-19 Christos Zoulas + + * m4/macros/libtool.m4: for AIX AC_LANG_PROGRAM is incorrectly + used and the latest autoconf gives an error. For now just + quote it. + + * configure.in: Fedora Core 15 and RedHat 6 now don't define + af_family_t in , but in . + Include so that we get + indirectly. This caused the detection + test to fail. + +2010-11-24 Erez Zadok + + * m4/macros/os_cflags.m4: for linux, define _GNU_SOURCE (to get + definitions for O_LARGEFILE and more). + +2010-11-20 Christos Zoulas + + * Update news items, add release readme, mark as rc1 + + * Fix addopts code to work with options that are key=value + when the built-in hasmntopt() code is not used. The problem + was that the code passed "key=" to hasmntopt not "key". + +2009-12-10 Christos Zoulas + + * Copy all fields of the am_opts structure + When we introduced am_loc we also added a function to + create a duplicate of an am_opts structure. As it turns + out, that only made a partial copy of the struct and some + fields (e.g. opt_cache) was left blank in the new structure. + Unfortunately any code that was checking the options + through the mntfs structure was mislead by the partial + copy: caching was disabled completely, for example, and + since browsing relies on caching being enabled it wasn't + working either. + From: Krisztian Kovacs + + * Initialize RPC authentication flavor to AUTH_UNIX instead + of zero. RHEL 5 uses version 6 of the mount_arg structure + that includes the desired RPC authorization flavour. + Unfortunately amd initializes that value to zero, meaning + AUTH_NULL, resulting in all NFS servers denying operations. + From: Krisztian Kovacs + + * Make sure to remove nodes in the proper order when going + down. Depending on what order the nodes got created it's + possible that the parent of a node has a bigger am_mapno + (index in exported_ap[]) so that it gets freed before + its child while the child's am_parent pointer is still + pointing to the already freed block of memory. + This change makes sure that umount_exported() cleans up + all children of a node first before freeing the node. + From: Krisztian Kovacs + + * Fix Linux-specific stuff in ops_tmpfs.c + AUTOFS_TMPFS_FS_FLAGS is defined only in the Linux-specific + conf_linux.c file, so it cannot be built on Solaris. + From: Krisztian Kovacs + + * Add missing parenthesis to fix defined(XXX + From: Krisztian Kovacs + + * In the previous commit we've already made a change that + makes this code unnecessary since the node is returned + even if the backing file server is known to be down. + Since the code path is unused it should be removed. + From: Krisztian Kovacs + + * amfs_generic_lookup_child() tries to find an alternate + file server if it detects that the current one is down. + However, in the comparison used to decide if a possible + mount is the same as the current one it compares the am_loc + pointers instead of the actual mntfs pointers. Since + amfs_lookup_one_location() creates a brand new am_loc + structure for the returned mntfs structure the am_loc + pointer will be different even if the mntfs it's pointing + to is the same. + This tricks amfs_generic_lookup_child() think it has + found an alternate file server while it hasn't and thus + starts multiple racing mounts for the very same node and + mntfs. + From: Krisztian Kovacs + + * In the new am_loc scheme mounted mntfs structures still + have their mf_fo structure left intact. So when restart + creates a fake mntfs for an already mounted filesystem it + should not free mf_fo right away. + From: Krisztian Kovacs + + * Setting the error flag of the mntfs for which the share + is already mounted results in the mount point not being + removed when it times out. (Amd considers it an error + mntfs and thus umount becomse a no-op.) + From: Krisztian Kovacs + + * Right now AMD sets all timeout values to their defaults + even if you explicitly set them to zero. This patch + introduces separate flags that store if the respective + values have been set and the code path setting default + values checks these flags instead of testing the values + for zero. [Linux only] + From: Krisztian Kovacs + + * Fix mntfs related lookup/(un)mount race conditions, by + introducing a new structure linking an mntfs to a node. + From: Krisztian Kovacs + + * We have to free the buffers allocated by the XDR routines when + decoding the mount response after copying them to their final place. + From: Krisztian Kovacs + +2009-12-09 Christos Zoulas + + * Free continuation in amfs_retry() if we don't call amfs_bgmount() + Normally it's amfs_bgmount() which frees the continuation. However, if + the mount is already in progress and we're in amfs_retry() for another + node we don't try mounting the filesystem once again. Still, we have + to free the continuation as we won't get called again and thus would + leak the continuation structure and our am_loc references. + From: Krisztian Kovacs + + * Fix use-after-free and double free of mntfs private data + ops_nfs.c(nfs_init) does not clear private data pointer after free(). + This leads to use-after-free and double free in case mount() fails. + (found by valgrind) + From: Krisztian Kovacs + +2009-11-23 Christos Zoulas + + * The temporary filename buffer was leaked in lock_mtab(). + From: Krisztian Kovacs + +2009-10-27 Christos Zoulas + + * Deal with errno.h->sys/errno.h better + +2009-10-26 Christos Zoulas + + * Fix issue with autoconf 2.63 + + * Fix compile warnings for gcc-4.4.x + +2009-04-15 Christos Zoulas + + * Share the LDAP connection between different maps to save resources + on the LDAP server. (Olaf Flebbe ) + +2009-03-20 Christos Zoulas + + * Fix largefile re-definitions + + * Fix compilation error caused in previous patch + +2009-02-19 Christos Zoulas + + * Add a synchronous unmount amq rpc that will wait for the remote + filesystem to be unmounted, or return an error. Enabled by amq -uu + +2009-01-11 Erez Zadok + + * amd/ops_udf.c: don't define functions/variables which may not be + used. + + * amd/ops_tmpfs.c (mount_tmpfs): force gcc not to complain about + unused variables. + + * config.guess.long: properly support Fedora Core. + +2009-01-09 Christos Zoulas + + * Fix nfs mounts on linux 2.6.26 by explicitly initializing context. + + * Treat an empty sublink as an unset sublink; this allows us to + say sublink:=; in a spec to override the default. (This produces + Bad selector error, but it works. XXX: We need to decide how to + unset a selector. I proposed an unset keyword a while ago). + +2009-01-06 Christos Zoulas + + * re-renerate all generated files with newer versions of the + auto-tools. + + * move INSTALL to INSTALL.am-utils to avoid conflicts + + * fix incompatibilities with new m4 and new autoconf. + + * add UDF filesystem support. + + * fix NetBSD nfs file handle detection. + +2009-01-02 Christos Zoulas + + * add nocasetrans, nojoliet, rrcaseins for cd9660 filesystems + +2008-12-03 Christos Zoulas + + * allow ldap queries try a comma-separated list of servers given as: + + ldap_hostports = host1:port1,host2,host3:port3 + + original patch from Florian Geyer + +2008-09-19 Christos Zoulas + + * the auth_create gid on NetBSD is int + + * deal with lossage from flex -P + + * fix missing/incorrect prototypes + +2008-09-17 Christos Zoulas + + * fix manual page section issues (sorting, non-existant) + + * add missing forward declarations + + * avoid null pointer derefs (coverity) + + * more portable endian detection support + + * implement tmpfs support + + * use sizeof var instead of constant + + * fix yyerror declaration and definition + + * fix yy function renaming, and correct some renaming issues. + + * work around automake < 1.9 issue where ylwrap is not being run + for a single yacc or lex file. + + * NetBSD + - handle headers that need other headers to compile + - add exfs and tmpfs specific glue + - add options log, noatime, nocoredump, nodevmtime, softdep, + symperm, union + - NetBSD's new mount system call needs the size of the opaque + filesystem specific structure, but passing 0 for now works. + We would need to change a lot more code to pass the size from + the fs-specific calls, so for now punt. + - recvfrom takes socklen_t * on NetBSD + - handle newer NetBSD using statvfs + - NetBSD calls its ufs ffs + + * Linux + - Most recent kernels have trouble with trying to parse the pid + hostname and do locking. What before was a silent failure, now + there is a warning printed and the mount is rejected. This is + the simplest fix: + (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=479884) + +2007-04-13 Erez Zadok + + * amd/sun_map.c (sun_append_str): When translating '&' from Sun + automounter maps, replace it with "${key}" in the Amd map, not + with the value of the key at the time. This way '*' maps work + too. + + * config.guess.long: don't use -q option to grep because some + systems don't support it. Bug fix for solaris. + +2007-03-11 Christos Zoulas + + * amd/opts.c (expand_op): Don't call xstrlcpy() to truncate a + string. It causes spurious xstrlcpy() syslog() errors. Use + memcpy() and explicitly terminate the string. + +2007-01-20 Erez Zadok + + * updated copyright year to 2007 on all files. + +2006-12-27 Erez Zadok + + * minor new port: ia64-hp-hpux11.23 + + * m4/macros/check_libwrap_severity.m4 (LIBS): also test if caller + needs to define rfc931_timeout. + + * amd/sun2amd.c: define rfc931_timeout and allow/deny_severity for + libwrap. + + * amd/amq_svc.c: some versions of libwrap require the caller to + define rfc931_timeout in addition to allow/deny_severity. + + * amd/amfs_toplvl.c (amfs_toplvl_init): properly detect when + forced unmount functionality exists for all systems. + + * libamu/mount_fs.c (compute_nfs_args): reset nfs_args_t->pathconf + only if field exists. + + * conf/nfs_prot/nfs_prot_hpux11.h: prevent HPUX 11.23 from + including or (TLI definitions are already + included from elsewhere). + + * configure.in: detect nfs_args_t->pathconf field. + +2006-11-27 Erez Zadok + + * doc/Makefile.am: properly publish html files using newer + text2html. + +2006-11-27 Erez Zadok + + * doc/Makefile.am: obfuscate emails in ChangeLog before it is *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Nov 11 06:53:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 706AAC3A133; Fri, 11 Nov 2016 06:53:31 +0000 (UTC) (envelope-from kczekirda@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91F131DE0; Fri, 11 Nov 2016 06:53:30 +0000 (UTC) (envelope-from kczekirda@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id t79so74618315wmt.0; Thu, 10 Nov 2016 22:53:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=I2Gxi2aufU1la1gjYrB+iy68aZUvDPXPeQJSl8eneqc=; b=Si47b9vndS1z5eTMqLqfbKxkZI0ufB9PgE6L1i6ZzUULxYXldp+HP3ME8SP4Dm5/gr ePFbwyqgzKf6XCuI2RqzgozGAevwGtrOUXMHI94FkHTos/uaA7ytGXpTUKEPq2DSrrpP Jhrs18yHqcCv6IZGj3eRo2TcjAa1s62TxUGzszfdoaOZONFDFNrHeiig3c0Ti9mCDOZ0 UoS6HTqcLGDaJgt/1gncJ9XM1V554TnETxoNWlQGMx5243BmwXiMcf4oA3GMqvfQzWDY 8CuMHPIIyBAZs67NUcFruvZvLcgM4yVTFquWGSwlrqsjHY8f7qzJtKrJtHLwSYUxDsFr OlWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=I2Gxi2aufU1la1gjYrB+iy68aZUvDPXPeQJSl8eneqc=; b=Sn9TLVCzwDIWbvgSKUcGAKdXKVD29ILJz+KscLAyQ9uLEUJN09/4UeuN8AHKBUBRm5 anV5qkET0pZ0T91Kv6bjU1fTf6qz+fxGkSHY17YpX/fBvHsic+C1W5IG2vew2g3oGTEw s3V8Z4wC1E68V7BiDynw8kaAHB8wAWSw8F1Q1MmNUEZWkDhJwxhctpFnAF/Z6frE2Xlt W2AXR7uv7Rfg7Agx3ldH4u0GuQKc0U9ub9fDMmVamv5Twea7Uz0vCiT6IRI0DEJ5exga diPHcbASD1jfU3N2aDsvn4iOHGNU30ONc1YNeFnGZJhjvZYFWBszkG2c7nYb6fDmYKoM cVMg== X-Gm-Message-State: ABUngvcojalP88ArHhK8Wn5MTWo0GXsvYDPd3gIFnYLR8hiyfOyqBCYu2uhxg2xPe7aGBpx5A3aXRXFbpNAMPQ== X-Received: by 10.28.54.161 with SMTP id y33mr10240811wmh.122.1478847208773; Thu, 10 Nov 2016 22:53:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.49.137 with HTTP; Thu, 10 Nov 2016 22:52:57 -0800 (PST) In-Reply-To: <8E0E5C94-EFD7-4008-B563-FF080A98F23D@me.com> References: <201611080650.uA86oJ7W056026@repo.freebsd.org> <8E0E5C94-EFD7-4008-B563-FF080A98F23D@me.com> From: Kamil Czekirda Date: Fri, 11 Nov 2016 07:52:57 +0100 Message-ID: Subject: Re: svn commit: r308434 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libofw sys... To: Toomas Soome Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 06:53:31 -0000 cp /usr/src/lib/libstand/libstand.h /usr/include/stand.h fixed that thanks 2016-11-10 23:28 GMT+01:00 Toomas Soome : > the patch does update the lib/libstand/stand.h to have: > > struct devsw { > . . . > int (*dv_print)(int verbose); > > it was void before; from your svnlite log I can see the > lib/libstand/stand.h is updated, could you confirm if it is int now? if i= t > is, I suspect the build is getting the old stand.h from somewhere in the > tree and not your /lib/libstand. > > if so, does the build has target to copy headers in place? I=E2=80=99m so= rry, I > don't know all the tricks the build system does as part of the buildworld= .. > > rgds, > toomas > > > On 11. nov 2016, at 0:21, Kamil Czekirda wrote: > > Hi, > > I got the following: > > root@current:/usr/src # svnlite up -r r308434 > Updating '.': > U lib/libstand/stand.h > U sys/boot/common/dev_net.c > U sys/boot/common/module.c > U sys/boot/common/part.c > U sys/boot/common/util.c > U sys/boot/common/util.h > U sys/boot/efi/libefi/efinet.c > U sys/boot/efi/libefi/efipart.c > U sys/boot/efi/loader/main.c > U sys/boot/i386/libfirewire/firewire.c > U sys/boot/i386/libi386/bioscd.c > U sys/boot/i386/libi386/biosdisk.c > U sys/boot/mips/beri/loader/beri_disk_cfi.c > U sys/boot/mips/beri/loader/beri_disk_sdcard.c > U sys/boot/ofw/libofw/ofw_disk.c > U sys/boot/pc98/libpc98/bioscd.c > U sys/boot/pc98/libpc98/biosdisk.c > U sys/boot/powerpc/kboot/hostdisk.c > U sys/boot/powerpc/ps3/ps3cdrom.c > U sys/boot/powerpc/ps3/ps3disk.c > U sys/boot/uboot/lib/disk.c > U sys/boot/usb/storage/umass_loader.c > U sys/boot/userboot/userboot/host.c > U sys/boot/userboot/userboot/userboot_disk.c > U sys/boot/zfs/zfs.c > U sys/boot/zfs/zfsimpl.c > U sys/boot/i386/libi386/pxe.c > Updated to revision 308434. > root@current:/usr/src # cd sys/boot/ > root@current:/usr/src/sys/boot # make clean > (...) > root@current:/usr/src/sys/boot # make obj > (...) > root@current:/usr/src/sys/boot # make > (...) > cc -O2 -pipe -DSKEIN_LOOP=3D111 -fPIC -I/usr/src/sys/boot/efi/loader > -I/usr/src/sys/boot/efi/loader/arch/amd64 -I/usr/src/sys/boot/efi/loader/= ../include > -I/usr/src/sys/boot/efi/loader/../include/amd64 > -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include > -I/usr/src/sys/boot/efi/loader/../../.. -I/usr/src/sys/boot/efi/loader/..= /../i386/libi386 > -I/usr/src/sys/boot/efi/loader/../../zfs -I/usr/src/sys/boot/efi/loader/.= ./../../cddl/boot/zfs > -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT > -DNO_PCI -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH > -I/usr/src/sys/boot/efi/loader/../../ficl -I/usr/src/sys/boot/efi/loader/= ../../ficl/amd64 > -DLOADER_DISK_SUPPORT -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC > -I/usr/src/sys/boot/ficl -I/usr/src/sys/boot/ficl/amd64 > -I/usr/src/sys/boot/ficl/../common -I/usr/src/sys/boot/efi/loader/../../= common > -ffreestanding -Wformat -msoft-float -mno-mmx -mno-sse -mno-avx > -fshort-wchar -mno-red-zone -mno-aes -g -MD -MF.depend.vers.o -MTvers.o > -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W > -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes > -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body > -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare > -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function > -Wno-enum-conversion -Wno-unused-local-typedef -Qunused-arguments -c > vers.c -o vers.o > cc -O2 -pipe -DSKEIN_LOOP=3D111 -fPIC -I/usr/src/sys/boot/efi/loader > -I/usr/src/sys/boot/efi/loader/arch/amd64 -I/usr/src/sys/boot/efi/loader/= ../include > -I/usr/src/sys/boot/efi/loader/../include/amd64 > -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include > -I/usr/src/sys/boot/efi/loader/../../.. -I/usr/src/sys/boot/efi/loader/..= /../i386/libi386 > -I/usr/src/sys/boot/efi/loader/../../zfs -I/usr/src/sys/boot/efi/loader/.= ./../../cddl/boot/zfs > -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT > -DNO_PCI -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH > -I/usr/src/sys/boot/efi/loader/../../ficl -I/usr/src/sys/boot/efi/loader/= ../../ficl/amd64 > -DLOADER_DISK_SUPPORT -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC > -I/usr/src/sys/boot/ficl -I/usr/src/sys/boot/ficl/amd64 > -I/usr/src/sys/boot/ficl/../common -I/usr/src/sys/boot/efi/loader/../../= common > -ffreestanding -Wformat -msoft-float -mno-mmx -mno-sse -mno-avx > -fshort-wchar -mno-red-zone -mno-aes -g -MD -MF.depend.zfs.o -MTzfs.o > -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W > -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes > -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body > -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare > -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function > -Wno-enum-conversion -Wno-unused-local-typedef -Wno-sign-compare > -Wno-array-bounds -Wno-missing-prototypes -Qunused-arguments -c > /usr/src/sys/boot/efi/loader/../../zfs/zfs.c -o zfs.o > /usr/src/sys/boot/efi/loader/../../zfs/zfs.c:599:14: error: incompatible > pointer types initializing 'void (*)(int)' with an expression of type 'in= t > (int)' [-Werror,-Wincompatible-pointer-types] > .dv_print =3D zfs_dev_print, > ^~~~~~~~~~~~~ > 1 error generated. > *** Error code 1 > > Stop. > make[2]: stopped in /usr/src/sys/boot/efi/loader > *** Error code 1 > > Stop. > make[1]: stopped in /usr/src/sys/boot/efi > *** Error code 1 > > Stop. > make: stopped in /usr/src/sys/boot > > > Kamil > > 2016-11-08 7:50 GMT+01:00 Toomas Soome : > >> Author: tsoome >> Date: Tue Nov 8 06:50:18 2016 >> New Revision: 308434 >> URL: https://svnweb.freebsd.org/changeset/base/308434 >> >> Log: >> Loader paged/pageable data is not always paged. >> >> This change does modify devsw dv_print() to return the int value, >> enabling walkers to interrupt the walk on non zero value from >> dv_print(). >> >> This will allow the pager_print actually to stop displaying data on >> user input, and additionally pager is used in various *dev_print >> callbacks, >> where it was missing. >> >> For test, lsdev [-v] command should display data by screenfuls and >> should >> stop when the key 'q' is pressed on pager prompt. >> >> Reviewed by: allanjude >> Approved by: allanjude (mentor) >> Differential Revision: https://reviews.freebsd.org/D5461 >> >> Modified: >> head/lib/libstand/stand.h >> head/sys/boot/common/dev_net.c >> head/sys/boot/common/module.c >> head/sys/boot/common/part.c >> head/sys/boot/common/util.c >> head/sys/boot/common/util.h >> head/sys/boot/efi/libefi/efinet.c >> head/sys/boot/efi/libefi/efipart.c >> head/sys/boot/efi/loader/main.c >> head/sys/boot/i386/libfirewire/firewire.c >> head/sys/boot/i386/libi386/bioscd.c >> head/sys/boot/i386/libi386/biosdisk.c >> head/sys/boot/i386/libi386/pxe.c >> head/sys/boot/mips/beri/loader/beri_disk_cfi.c >> head/sys/boot/mips/beri/loader/beri_disk_sdcard.c >> head/sys/boot/ofw/libofw/ofw_disk.c >> head/sys/boot/pc98/libpc98/bioscd.c >> head/sys/boot/pc98/libpc98/biosdisk.c >> head/sys/boot/powerpc/kboot/hostdisk.c >> head/sys/boot/powerpc/ps3/ps3cdrom.c >> head/sys/boot/powerpc/ps3/ps3disk.c >> head/sys/boot/uboot/lib/disk.c >> head/sys/boot/usb/storage/umass_loader.c >> head/sys/boot/userboot/userboot/host.c >> head/sys/boot/userboot/userboot/userboot_disk.c >> head/sys/boot/zfs/zfs.c >> head/sys/boot/zfs/zfsimpl.c >> >> Modified: head/lib/libstand/stand.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/lib/libstand/stand.h Tue Nov 8 06:13:22 2016 (r308433= ) >> +++ head/lib/libstand/stand.h Tue Nov 8 06:50:18 2016 (r308434= ) >> @@ -143,7 +143,7 @@ struct devsw { >> int (*dv_open)(struct open_file *f, ...); >> int (*dv_close)(struct open_file *f); >> int (*dv_ioctl)(struct open_file *f, u_long cmd, voi= d >> *data); >> - void (*dv_print)(int verbose); /* print device >> information */ >> + int (*dv_print)(int verbose); /* print device >> information */ >> void (*dv_cleanup)(void); >> }; >> >> >> Modified: head/sys/boot/common/dev_net.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/common/dev_net.c Tue Nov 8 06:13:22 2016 >> (r308433) >> +++ head/sys/boot/common/dev_net.c Tue Nov 8 06:50:18 2016 >> (r308434) >> @@ -80,7 +80,7 @@ static int net_open(struct open_file *, >> static int net_close(struct open_file *); >> static void net_cleanup(void); >> static int net_strategy(); >> -static void net_print(int); >> +static int net_print(int); >> >> static int net_getparams(int sock); >> >> @@ -325,23 +325,27 @@ exit: >> return (0); >> } >> >> -static void >> +static int >> net_print(int verbose) >> { >> struct netif_driver *drv; >> int i, d, cnt; >> + int ret =3D 0; >> >> cnt =3D 0; >> for (d =3D 0; netif_drivers[d]; d++) { >> drv =3D netif_drivers[d]; >> for (i =3D 0; i < drv->netif_nifs; i++) { >> printf("\t%s%d:", "net", cnt++); >> - if (verbose) >> + if (verbose) { >> printf(" (%s%d)", drv->netif_bname, >> drv->netif_ifs[i].dif_unit); >> + } >> + if ((ret =3D pager_output("\n")) !=3D 0) >> + return (ret); >> } >> } >> - printf("\n"); >> + return (ret); >> } >> >> /* >> >> Modified: head/sys/boot/common/module.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/common/module.c Tue Nov 8 06:13:22 2016 >> (r308433) >> +++ head/sys/boot/common/module.c Tue Nov 8 06:50:18 2016 >> (r308434) >> @@ -254,7 +254,7 @@ command_lsmod(int argc, char *argv[]) >> struct kernel_module *mp; >> struct file_metadata *md; >> char lbuf[80]; >> - int ch, verbose; >> + int ch, verbose, ret =3D 0; >> >> verbose =3D 0; >> optind =3D 1; >> @@ -273,11 +273,13 @@ command_lsmod(int argc, char *argv[]) >> >> pager_open(); >> for (fp =3D preloaded_files; fp; fp =3D fp->f_next) { >> - sprintf(lbuf, " %p: ", (void *) fp->f_addr); >> + snprintf(lbuf, sizeof(lbuf), " %p: ", (void *) fp->f_addr); >> pager_output(lbuf); >> pager_output(fp->f_name); >> - sprintf(lbuf, " (%s, 0x%lx)\n", fp->f_type, (long)fp->f_size); >> - pager_output(lbuf); >> + snprintf(lbuf, sizeof(lbuf), " (%s, 0x%lx)\n", fp->f_type, >> + (long)fp->f_size); >> + if (pager_output(lbuf)) >> + break; >> if (fp->f_args !=3D NULL) { >> pager_output(" args: "); >> pager_output(fp->f_args); >> @@ -287,7 +289,8 @@ command_lsmod(int argc, char *argv[]) >> if (fp->f_modules) { >> pager_output(" modules: "); >> for (mp =3D fp->f_modules; mp; mp =3D mp->m_next) { >> - sprintf(lbuf, "%s.%d ", mp->m_name, mp->m_version); >> + snprintf(lbuf, sizeof(lbuf), "%s.%d ", mp->m_name, >> + mp->m_version); >> pager_output(lbuf); >> } >> if (pager_output("\n")) >> @@ -296,11 +299,14 @@ command_lsmod(int argc, char *argv[]) >> if (verbose) { >> /* XXX could add some formatting smarts here to display some >> better */ >> for (md =3D fp->f_metadata; md !=3D NULL; md =3D md->md_next= ) { >> - sprintf(lbuf, " 0x%04x, 0x%lx\n", md->md_type, >> (long) md->md_size); >> + snprintf(lbuf, sizeof(lbuf), " 0x%04x, 0x%lx\n", >> + md->md_type, (long) md->md_size); >> if (pager_output(lbuf)) >> break; >> } >> } >> + if (ret) >> + break; >> } >> pager_close(); >> return(CMD_OK); >> >> Modified: head/sys/boot/common/part.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/common/part.c Tue Nov 8 06:13:22 2016 (r308433= ) >> +++ head/sys/boot/common/part.c Tue Nov 8 06:50:18 2016 (r308434= ) >> @@ -834,6 +834,7 @@ ptable_iterate(const struct ptable *tabl >> { >> struct pentry *entry; >> char name[32]; >> + int ret =3D 0; >> >> name[0] =3D '\0'; >> STAILQ_FOREACH(entry, &table->entries, entry) { >> @@ -856,9 +857,8 @@ ptable_iterate(const struct ptable *tabl >> if (table->type =3D=3D PTABLE_BSD) >> sprintf(name, "%c", (u_char) 'a' + >> entry->part.index); >> - if (iter(arg, name, &entry->part)) >> - return 1; >> + if ((ret =3D iter(arg, name, &entry->part)) !=3D 0) >> + return (ret); >> } >> - return 0; >> + return (ret); >> } >> - >> >> Modified: head/sys/boot/common/util.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/common/util.c Tue Nov 8 06:13:22 2016 (r308433= ) >> +++ head/sys/boot/common/util.c Tue Nov 8 06:50:18 2016 (r308434= ) >> @@ -114,7 +114,7 @@ strlen(const char *s) >> return (len); >> } >> >> -void >> +int >> printf(const char *fmt, ...) >> { >> va_list ap; >> @@ -178,4 +178,5 @@ nextfmt: >> } >> } >> va_end(ap); >> + return (0); >> } >> >> Modified: head/sys/boot/common/util.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/common/util.h Tue Nov 8 06:13:22 2016 (r308433= ) >> +++ head/sys/boot/common/util.h Tue Nov 8 06:50:18 2016 (r308434= ) >> @@ -48,6 +48,6 @@ void strcat(char *dst, const char *src); >> char *strchr(const char *s, char ch); >> size_t strlen(const char *s); >> >> -void printf(const char *fmt, ...); >> +int printf(const char *fmt, ...); >> >> #endif /* !_UTIL_H_ */ >> >> Modified: head/sys/boot/efi/libefi/efinet.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:13:22 2016 >> (r308433) >> +++ head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:50:18 2016 >> (r308434) >> @@ -252,7 +252,7 @@ efinet_end(struct netif *nif) >> } >> >> static int efinet_dev_init(void); >> -static void efinet_dev_print(int); >> +static int efinet_dev_print(int); >> >> struct devsw efinet_dev =3D { >> .dv_name =3D "net", >> @@ -346,14 +346,13 @@ efinet_dev_init() >> return (0); >> } >> >> -static void >> +static int >> efinet_dev_print(int verbose) >> { >> CHAR16 *text; >> EFI_HANDLE h; >> - int unit; >> + int unit, ret =3D 0; >> >> - pager_open(); >> for (unit =3D 0, h =3D efi_find_handle(&efinet_dev, 0); >> h !=3D NULL; h =3D efi_find_handle(&efinet_dev, ++unit)) { >> printf(" %s%d:", efinet_dev.dv_name, unit); >> @@ -364,8 +363,8 @@ efinet_dev_print(int verbose) >> efi_free_devpath_name(text); >> } >> } >> - if (pager_output("\n")) >> + if ((ret =3D pager_output("\n")) !=3D 0) >> break; >> } >> - pager_close(); >> + return (ret); >> } >> >> Modified: head/sys/boot/efi/libefi/efipart.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:13:22 2016 >> (r308433) >> +++ head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:50:18 2016 >> (r308434) >> @@ -47,7 +47,7 @@ static int efipart_realstrategy(void *, >> size_t *); >> static int efipart_open(struct open_file *, ...); >> static int efipart_close(struct open_file *); >> -static void efipart_print(int); >> +static int efipart_print(int); >> >> struct devsw efipart_dev =3D { >> .dv_name =3D "part", >> @@ -162,7 +162,7 @@ efipart_init(void) >> return (err); >> } >> >> -static void >> +static int >> efipart_print(int verbose) >> { >> char line[80]; >> @@ -170,28 +170,29 @@ efipart_print(int verbose) >> EFI_HANDLE h; >> EFI_STATUS status; >> u_int unit; >> + int ret =3D 0; >> >> - pager_open(); >> for (unit =3D 0, h =3D efi_find_handle(&efipart_dev, 0); >> h !=3D NULL; h =3D efi_find_handle(&efipart_dev, ++unit)) { >> - sprintf(line, " %s%d:", efipart_dev.dv_name, unit); >> - if (pager_output(line)) >> + snprintf(line, sizeof(line), " %s%d:", >> + efipart_dev.dv_name, unit); >> + if ((ret =3D pager_output(line)) !=3D 0) >> break; >> >> status =3D BS->HandleProtocol(h, &blkio_guid, (void >> **)&blkio); >> if (!EFI_ERROR(status)) { >> - sprintf(line, " %llu blocks", >> + snprintf(line, sizeof(line), " %llu blocks", >> (unsigned long long)(blkio->Media->LastBlock >> + 1)); >> - if (pager_output(line)) >> + if ((ret =3D pager_output(line)) !=3D 0) >> break; >> if (blkio->Media->RemovableMedia) >> - if (pager_output(" (removable)")) >> + if ((ret =3D pager_output(" (removable)"= )) >> !=3D 0) >> break; >> } >> - if (pager_output("\n")) >> + if ((ret =3D pager_output("\n")) !=3D 0) >> break; >> } >> - pager_close(); >> + return (ret); >> } >> >> static int >> >> Modified: head/sys/boot/efi/loader/main.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/efi/loader/main.c Tue Nov 8 06:13:22 2016 >> (r308433) >> +++ head/sys/boot/efi/loader/main.c Tue Nov 8 06:50:18 2016 >> (r308434) >> @@ -533,6 +533,7 @@ command_memmap(int argc, char *argv[]) >> UINT32 dver; >> EFI_STATUS status; >> int i, ndesc; >> + char line[80]; >> static char *types[] =3D { >> "Reserved", >> "LoaderCode", >> @@ -564,14 +565,19 @@ command_memmap(int argc, char *argv[]) >> } >> >> ndesc =3D sz / dsz; >> - printf("%23s %12s %12s %8s %4s\n", >> + snprintf(line, sizeof(line), "%23s %12s %12s %8s %4s\n", >> "Type", "Physical", "Virtual", "#Pages", "Attr"); >> + pager_open(); >> + if (pager_output(line)) { >> + pager_close(); >> + return (CMD_OK); >> + } >> >> for (i =3D 0, p =3D map; i < ndesc; >> i++, p =3D NextMemoryDescriptor(p, dsz)) { >> printf("%23s %012jx %012jx %08jx ", types[p->Type], >> - (uintmax_t)p->PhysicalStart, >> (uintmax_t)p->VirtualStart, >> - (uintmax_t)p->NumberOfPages); >> + (uintmax_t)p->PhysicalStart, >> (uintmax_t)p->VirtualStart, >> + (uintmax_t)p->NumberOfPages); >> if (p->Attribute & EFI_MEMORY_UC) >> printf("UC "); >> if (p->Attribute & EFI_MEMORY_WC) >> @@ -588,9 +594,11 @@ command_memmap(int argc, char *argv[]) >> printf("RP "); >> if (p->Attribute & EFI_MEMORY_XP) >> printf("XP "); >> - printf("\n"); >> + if (pager_output("\n")) >> + break; >> } >> >> + pager_close(); >> return (CMD_OK); >> } >> >> @@ -612,10 +620,17 @@ guid_to_string(EFI_GUID *guid) >> static int >> command_configuration(int argc, char *argv[]) >> { >> + char line[80]; >> UINTN i; >> >> - printf("NumberOfTableEntries=3D%lu\n", >> + snprintf(line, sizeof(line), "NumberOfTableEntries=3D%lu\n", >> (unsigned long)ST->NumberOfTableEntries); >> + pager_open(); >> + if (pager_output(line)) { >> + pager_close(); >> + return (CMD_OK); >> + } >> + >> for (i =3D 0; i < ST->NumberOfTableEntries; i++) { >> EFI_GUID *guid; >> >> @@ -642,9 +657,13 @@ command_configuration(int argc, char *ar >> printf("FDT Table"); >> else >> printf("Unknown Table (%s)", >> guid_to_string(guid)); >> - printf(" at %p\n", ST->ConfigurationTable[i].Vend >> orTable); >> + snprintf(line, sizeof(line), " at %p\n", >> + ST->ConfigurationTable[i].VendorTable); >> + if (pager_output(line)) >> + break; >> } >> >> + pager_close(); >> return (CMD_OK); >> } >> >> >> Modified: head/sys/boot/i386/libfirewire/firewire.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:13:22 >> 2016 (r308433) >> +++ head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:50:18 >> 2016 (r308434) >> @@ -69,7 +69,7 @@ static int fw_strategy(void *devdata, in >> size_t offset, size_t size, char *buf, size_t *rsize= ); >> static int fw_open(struct open_file *f, ...); >> static int fw_close(struct open_file *f); >> -static void fw_print(int verbose); >> +static int fw_print(int verbose); >> static void fw_cleanup(void); >> >> void fw_enable(void); >> @@ -148,21 +148,26 @@ fw_init(void) >> /* >> * Print information about OHCI chips >> */ >> -static void >> +static int >> fw_print(int verbose) >> { >> - int i; >> + char line[80]; >> + int i, ret =3D 0; >> struct fwohci_softc *sc; >> >> for (i =3D 0; i < MAX_OHCI; i ++) { >> sc =3D &fwinfo[i]; >> if (sc->state =3D=3D FWOHCI_STATE_DEAD) >> break; >> - printf("%d: locator=3D0x%04x devid=3D0x%08x" >> + snprintf(line, sizeof(line), "%d: locator=3D0x%04x >> devid=3D0x%08x" >> " base_addr=3D0x%08x handle=3D0x%08x bus_id=3D0x= %08x\n", >> i, sc->locator, sc->devid, >> sc->base_addr, sc->handle, sc->bus_id); >> + ret =3D pager_output(line); >> + if (ret !=3D 0) >> + break; >> } >> + return (ret); >> } >> >> static int >> >> Modified: head/sys/boot/i386/libi386/bioscd.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:13:22 2016 >> (r308433) >> +++ head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:50:18 2016 >> (r308434) >> @@ -100,7 +100,7 @@ static int bc_realstrategy(void *devdata >> size_t offset, size_t size, char *buf, size_t *rsize); >> static int bc_open(struct open_file *f, ...); >> static int bc_close(struct open_file *f); >> -static void bc_print(int verbose); >> +static int bc_print(int verbose); >> >> struct devsw bioscd =3D { >> "cd", >> @@ -177,20 +177,19 @@ bc_add(int biosdev) >> /* >> * Print information about disks >> */ >> -static void >> +static int >> bc_print(int verbose) >> { >> char line[80]; >> - int i; >> + int i, ret =3D 0; >> >> - pager_open(); >> for (i =3D 0; i < nbcinfo; i++) { >> - sprintf(line, " cd%d: Device 0x%x\n", i, >> + snprintf(line, sizeof(line), " cd%d: Device 0x%x\n", = i, >> bcinfo[i].bc_sp.sp_devicespec); >> - if (pager_output(line)) >> + if ((ret =3D pager_output(line)) !=3D 0) >> break; >> } >> - pager_close(); >> + return (ret); >> } >> >> /* >> >> Modified: head/sys/boot/i386/libi386/biosdisk.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:13:22 >> 2016 (r308433) >> +++ head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:50:18 >> 2016 (r308434) >> @@ -135,7 +135,7 @@ static int bd_realstrategy(void *devdata >> static int bd_open(struct open_file *f, ...); >> static int bd_close(struct open_file *f); >> static int bd_ioctl(struct open_file *f, u_long cmd, void *data); >> -static void bd_print(int verbose); >> +static int bd_print(int verbose); >> static void bd_cleanup(void); >> >> #ifdef LOADER_GELI_SUPPORT >> @@ -321,21 +321,21 @@ bd_int13probe(struct bdinfo *bd) >> /* >> * Print information about disks >> */ >> -static void >> +static int >> bd_print(int verbose) >> { >> static char line[80]; >> struct disk_devdesc dev; >> - int i; >> + int i, ret =3D 0; >> >> - pager_open(); >> for (i =3D 0; i < nbdinfo; i++) { >> - sprintf(line, " disk%d: BIOS drive %c (%ju X >> %u):\n", i, >> + snprintf(line, sizeof(line), >> + " disk%d: BIOS drive %c (%ju X %u):\n", i, >> (bdinfo[i].bd_unit < 0x80) ? ('A' + >> bdinfo[i].bd_unit): >> ('C' + bdinfo[i].bd_unit - 0x80), >> (uintmax_t)bdinfo[i].bd_sectors, >> bdinfo[i].bd_sectorsize); >> - if (pager_output(line)) >> + if ((ret =3D pager_output(line)) !=3D 0) >> break; >> dev.d_dev =3D &biosdisk; >> dev.d_unit =3D i; >> @@ -346,12 +346,14 @@ bd_print(int verbose) >> bdinfo[i].bd_sectorsize, >> (bdinfo[i].bd_flags & BD_FLOPPY) ? >> DISK_F_NOCACHE: 0) =3D=3D 0) { >> - sprintf(line, " disk%d", i); >> - disk_print(&dev, line, verbose); >> + snprintf(line, sizeof(line), " disk%d", i); >> + ret =3D disk_print(&dev, line, verbose); >> disk_close(&dev); >> + if (ret !=3D 0) >> + return (ret); >> } >> } >> - pager_close(); >> + return (ret); >> } >> >> /* >> >> Modified: head/sys/boot/i386/libi386/pxe.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:13:22 2016 >> (r308433) >> +++ head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:50:18 2016 >> (r308434) >> @@ -75,7 +75,7 @@ static int pxe_strategy(void *devdata, i >> size_t offset, size_t size, char *buf, >> size_t *rsize); >> static int pxe_open(struct open_file *f, ...); >> static int pxe_close(struct open_file *f); >> -static void pxe_print(int verbose); >> +static int pxe_print(int verbose); >> static void pxe_cleanup(void); >> static void pxe_setnfshandle(char *rootpath); >> >> @@ -381,14 +381,20 @@ pxe_close(struct open_file *f) >> return (0); >> } >> >> -static void >> +static int >> pxe_print(int verbose) >> { >> - >> + char line[255]; >> if (pxe_call =3D=3D NULL) >> - return; >> + return (0); >> >> - printf(" pxe0: %s:%s\n", inet_ntoa(rootip), rootpath); >> + if (verbose) { >> + snprintf(line, sizeof(line), " pxe0: %s:%s\n", >> + inet_ntoa(rootip), rootpath); >> + } else { >> + snprintf(line, sizeof(line), " pxe0:\n"); >> + } >> + return (pager_output(line)); >> } >> >> static void >> >> Modified: head/sys/boot/mips/beri/loader/beri_disk_cfi.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 >> 06:13:22 2016 (r308433) >> +++ head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 >> 06:50:18 2016 (r308434) >> @@ -47,7 +47,7 @@ static int beri_cfi_disk_close(struct op >> static void beri_cfi_disk_cleanup(void); >> static int beri_cfi_disk_strategy(void *, int, daddr_t, size_t, >> size_t, >> char *, size_t *); >> -static void beri_cfi_disk_print(int); >> +static int beri_cfi_disk_print(int); >> >> struct devsw beri_cfi_disk =3D { >> .dv_name =3D "cfi", >> @@ -112,25 +112,29 @@ beri_cfi_disk_close(struct open_file *f) >> return (disk_close(dev)); >> } >> >> -static void >> +static int >> beri_cfi_disk_print(int verbose) >> { >> struct disk_devdesc dev; >> char line[80]; >> + int ret; >> >> - sprintf(line, " cfi%d CFI flash device\n", 0); >> - pager_output(line); >> + snprintf(line, sizeof(line), " cfi%d CFI flash device\n", 0= ); >> + ret =3D pager_output(line); >> + if (ret !=3D 0) >> + return (ret); >> dev.d_dev =3D &beri_cfi_disk; >> dev.d_unit =3D 0; >> dev.d_slice =3D -1; >> dev.d_partition =3D -1; >> if (disk_open(&dev, cfi_get_mediasize(), >> cfi_get_sectorsize(), 0) =3D=3D 0) { >> - sprintf(line, " cfi%d", 0); >> - disk_print(&dev, line, verbose); >> + snprintf(line, sizeof(line), " cfi%d", 0); >> + ret =3D disk_print(&dev, line, verbose); >> disk_close(&dev); >> } >> >> + return (ret); >> } >> >> static void >> >> Modified: head/sys/boot/mips/beri/loader/beri_disk_sdcard.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 >> 06:13:22 2016 (r308433) >> +++ head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 >> 06:50:18 2016 (r308434) >> @@ -47,7 +47,7 @@ static int beri_sdcard_disk_close(struct >> static void beri_sdcard_disk_cleanup(void); >> static int beri_sdcard_disk_strategy(void *, int, daddr_t, size_t, >> size_t, >> char *, size_t *); >> -static void beri_sdcard_disk_print(int); >> +static int beri_sdcard_disk_print(int); >> >> struct devsw beri_sdcard_disk =3D { >> .dv_name =3D "sdcard", >> @@ -123,19 +123,23 @@ beri_sdcard_disk_print(int verbose) >> { >> struct disk_devdesc dev; >> char line[80]; >> + int ret; >> >> - sprintf(line, " sdcard%d Altera SD card drive\n", 0); >> - pager_output(line); >> + snprintf(line, sizeof(line), " sdcard%d Altera SD card >> drive\n", 0); >> + ret =3D pager_output(line); >> + if (ret !=3D 0) >> + return (ret); >> dev.d_dev =3D &beri_sdcard_disk; >> dev.d_unit =3D 0; >> dev.d_slice =3D -1; >> dev.d_partition =3D -1; >> if (disk_open(&dev, altera_sdcard_get_mediasize(), >> altera_sdcard_get_sectorsize(), 0) =3D=3D 0) { >> - sprintf(line, " sdcard%d", 0); >> - disk_print(&dev, line, verbose); >> + snprintf(line, sizeof(line), " sdcard%d", 0); >> + ret =3D disk_print(&dev, line, verbose); >> disk_close(&dev); >> } >> + return (ret); >> } >> >> static void >> >> Modified: head/sys/boot/ofw/libofw/ofw_disk.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:13:22 2016 >> (r308433) >> +++ head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:50:18 2016 >> (r308434) >> @@ -47,7 +47,7 @@ static int ofwd_strategy(void *devdata, >> static int ofwd_open(struct open_file *f, ...); >> static int ofwd_close(struct open_file *f); >> static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data); >> -static void ofwd_print(int verbose); >> +static int ofwd_print(int verbose); >> >> struct devsw ofwdisk =3D { >> "block", >> @@ -161,8 +161,8 @@ ofwd_ioctl(struct open_file *f __unused, >> return (EINVAL); >> } >> >> -static void >> +static int >> ofwd_print(int verbose __unused) >> { >> - >> + return (0); >> } >> >> Modified: head/sys/boot/pc98/libpc98/bioscd.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:13:22 2016 >> (r308433) >> +++ head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:50:18 2016 >> (r308434) >> @@ -99,7 +99,7 @@ static int bc_realstrategy(void *devdata >> size_t offset, size_t size, char *buf, size_t *rsize= ); >> static int bc_open(struct open_file *f, ...); >> static int bc_close(struct open_file *f); >> -static void bc_print(int verbose); >> +static int bc_print(int verbose); >> >> struct devsw bioscd =3D { >> "cd", >> @@ -173,20 +173,19 @@ bc_add(int biosdev) >> /* >> * Print information about disks >> */ >> -static void >> +static int >> bc_print(int verbose) >> { >> char line[80]; >> - int i; >> + int i, ret =3D 0; >> >> - pager_open(); >> for (i =3D 0; i < nbcinfo; i++) { >> sprintf(line, " cd%d: Device 0x%x\n", i, >> bcinfo[i].bc_sp.sp_devicespec); >> - if (pager_output(line)) >> + if ((ret =3D pager_output(line)) !=3D 0) >> break; >> } >> - pager_close(); >> + return (ret); >> } >> >> /* >> >> Modified: head/sys/boot/pc98/libpc98/biosdisk.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:13:22 >> 2016 (r308433) >> +++ head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:50:18 >> 2016 (r308434) >> @@ -123,7 +123,7 @@ static int bd_realstrategy(void *devdata >> size_t offset, size_t size, char *buf, size_t *rsize= ); >> static int bd_open(struct open_file *f, ...); >> static int bd_close(struct open_file *f); >> -static void bd_print(int verbose); >> +static int bd_print(int verbose); >> >> struct devsw biosdisk =3D { >> "disk", >> @@ -249,21 +249,20 @@ bd_int13probe(struct bdinfo *bd) >> /* >> * Print information about disks >> */ >> -static void >> +static int >> bd_print(int verbose) >> { >> - int i, j, done; >> + int i, j, ret =3D 0; >> char line[80]; >> struct i386_devdesc dev; >> struct open_disk *od; >> struct pc98_partition *dptr; >> >> - pager_open(); >> - done =3D 0; >> - for (i =3D 0; i < nbdinfo && !done; i++) { >> - sprintf(line, " disk%d: BIOS drive %c:\n", i, 'A' + i); >> - if (pager_output(line)) >> - break; >> + for (i =3D 0; i < nbdinfo; i++) { >> + snprintf(line, sizeof(line), " disk%d: BIOS drive %c:\n", >> + i, 'A' + i); >> + if ((ret =3D pager_output(line)) !=3D 0) >> + break; >> >> /* try to open the whole disk */ >> dev.d_unit =3D i; >> @@ -278,17 +277,17 @@ bd_print(int verbose) >> >> /* Check for a "dedicated" disk */ >> for (j =3D 0; j < od->od_nslices; j++) { >> - sprintf(line, " disk%ds%d", i, j + 1); >> - if (bd_printslice(od, &dptr[j], line, verbose)) { >> - done =3D 1; >> - break; >> - } >> + snprintf(line, sizeof(line), " disk%ds%d", i, j >> + 1); >> + if ((ret =3D bd_printslice(od, &dptr[j], line, >> verbose)) !=3D 0) >> + break; >> } >> } >> bd_closedisk(od); >> + if (ret !=3D 0) >> + break; >> } >> } >> - pager_close(); >> + return (ret); >> } >> >> /* Given a size in 512 byte sectors, convert it to a human-readable >> number. */ >> >> Modified: head/sys/boot/powerpc/kboot/hostdisk.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:13:22 >> 2016 (r308433) >> +++ head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:50:18 >> 2016 (r308434) >> @@ -37,7 +37,7 @@ static int hostdisk_strategy(void *devda >> static int hostdisk_open(struct open_file *f, ...); >> static int hostdisk_close(struct open_file *f); >> static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data); >> -static void hostdisk_print(int verbose); >> +static int hostdisk_print(int verbose); >> >> struct devsw hostdisk =3D { >> "/dev", >> @@ -117,9 +117,9 @@ hostdisk_ioctl(struct open_file *f, u_lo >> return (EINVAL); >> } >> >> -static void >> +static int >> hostdisk_print(int verbose) >> { >> - >> + return (0); >> } >> >> >> Modified: head/sys/boot/powerpc/ps3/ps3cdrom.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:13:22 >> 2016 (r308433) >> +++ head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:50:18 >> 2016 (r308434) >> @@ -49,7 +49,7 @@ static int ps3cdrom_strategy(void *devda >> size_t offset, size_t size, char *buf, size_t *rsize); >> static int ps3cdrom_open(struct open_file *f, ...); >> static int ps3cdrom_close(struct open_file *f); >> -static void ps3cdrom_print(int verbose); >> +static int ps3cdrom_print(int verbose); >> >> struct devsw ps3cdrom =3D { >> "cd", >> @@ -149,6 +149,7 @@ static int ps3cdrom_close(struct open_fi >> return 0; >> } >> >> -static void ps3cdrom_print(int verbose) >> +static int ps3cdrom_print(int verbose) >> { >> + return (0); >> } >> >> Modified: head/sys/boot/powerpc/ps3/ps3disk.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:13:22 2016 >> (r308433) >> +++ head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:50:18 2016 >> (r308434) >> @@ -61,7 +61,7 @@ static int ps3disk_strategy(void *devdat >> size_t offset, size_t size, char *buf, size_t *rsize); >> static int ps3disk_open(struct open_file *f, ...); >> static int ps3disk_close(struct open_file *f); >> -static void ps3disk_print(int verbose); >> +static int ps3disk_print(int verbose); >> >> struct devsw ps3disk =3D { >> "disk", >> @@ -186,8 +186,9 @@ static int ps3disk_close(struct open_fil >> return 0; >> } >> >> -static void ps3disk_print(int verbose) >> +static int ps3disk_print(int verbose) >> { >> + return (0); >> } >> >> static int ps3disk_open_gpt(struct ps3_devdesc *dev, struct open_dev *o= d) >> >> Modified: head/sys/boot/uboot/lib/disk.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:13:22 2016 >> (r308433) >> +++ head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:50:18 2016 >> (r308434) >> @@ -78,7 +78,7 @@ static int stor_strategy(void *, int, da >> static int stor_open(struct open_file *, ...); >> static int stor_close(struct open_file *); >> static int stor_ioctl(struct open_file *f, u_long cmd, void *data); >> -static void stor_print(int); >> +static int stor_print(int); >> static void stor_cleanup(void); >> >> struct devsw uboot_storage =3D { >> @@ -238,30 +238,31 @@ stor_readdev(struct disk_devdesc *dev, d >> return (err); >> } >> >> -static void >> +static int >> stor_print(int verbose) >> { >> struct disk_devdesc dev; >> static char line[80]; >> - int i; >> + int i, ret =3D 0; >> >> - pager_open(); >> for (i =3D 0; i < stor_info_no; i++) { >> dev.d_dev =3D &uboot_storage; >> dev.d_unit =3D i; >> dev.d_slice =3D -1; >> dev.d_partition =3D -1; >> - sprintf(line, "\tdisk%d (%s)\n", i, >> + snprintf(line, sizeof(line), "\tdisk%d (%s)\n", i, >> ub_stor_type(SI(&dev).type)); >> - if (pager_output(line)) >> + if ((ret =3D pager_output(line)) !=3D 0) >> break; >> if (stor_opendev(&dev) =3D=3D 0) { >> sprintf(line, "\tdisk%d", i); >> - disk_print(&dev, line, verbose); >> + ret =3D disk_print(&dev, line, verbose); >> disk_close(&dev); >> + if (ret !=3D 0) >> + break; >> } >> } >> - pager_close(); >> + return (ret); >> } >> >> static int >> >> Modified: head/sys/boot/usb/storage/umass_loader.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:13:22 >> 2016 (r308433) >> +++ head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:50:18 >> 2016 (r308434) >> @@ -50,7 +50,7 @@ static void umass_disk_cleanup(void); >> static int umass_disk_ioctl(struct open_file *, u_long, void *); >> static int umass_disk_strategy(void *, int, daddr_t, size_t, size_t, >> char *, >> size_t *); >> -static void umass_disk_print(int); >> +static int umass_disk_print(int); >> >> struct devsw umass_disk =3D { >> .dv_name =3D "umass", >> @@ -170,23 +170,26 @@ umass_disk_close(struct open_file *f) >> return (disk_close(dev)); >> } >> >> -static void >> +static int >> umass_disk_print(int verbose) >> { >> struct disk_devdesc dev; >> >> memset(&dev, 0, sizeof(dev)); >> >> - pager_output(" umass0 UMASS device\n"); >> + ret =3D pager_output(" umass0 UMASS device\n"); >> + if (ret !=3D 0) >> + return (ret); >> dev.d_dev =3D &umass_disk; >> dev.d_unit =3D 0; >> dev.d_slice =3D -1; >> dev.d_partition =3D -1; >> >> if (umass_disk_open_sub(&dev) =3D=3D 0) { >> - disk_print(&dev, " umass0", verbose); >> + ret =3D disk_print(&dev, " umass0", verbose); >> disk_close(&dev); >> } >> + return (ret); >> } >> >> static void >> >> Modified: head/sys/boot/userboot/userboot/host.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:13:22 >> 2016 (r308433) >> +++ head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:50:18 >> 2016 (r308434) >> @@ -134,13 +134,13 @@ host_dev_init(void) >> return (0); >> } >> >> -static void >> +static int >> host_dev_print(int verbose) >> { >> char line[80]; >> >> - sprintf(line, " host%d: Host filesystem\n", 0); >> - pager_output(line); >> + snprintf(line, sizeof(line), " host%d: Host filesystem\n", >> 0); >> + return (pager_output(line)); >> } >> >> /* >> >> Modified: head/sys/boot/userboot/userboot/userboot_disk.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 >> 06:13:22 2016 (r308433) >> +++ head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 >> 06:50:18 2016 (r308434) >> @@ -60,7 +60,7 @@ static int userdisk_realstrategy(void *d >> static int userdisk_open(struct open_file *f, ...); >> static int userdisk_close(struct open_file *f); >> static int userdisk_ioctl(struct open_file *f, u_long cmd, void >> *data); >> -static void userdisk_print(int verbose); >> +static int userdisk_print(int verbose); >> >> struct devsw userboot_disk =3D { >> "disk", >> @@ -116,27 +116,33 @@ userdisk_cleanup(void) >> /* >> * Print information about disks >> */ >> -static void >> +static int >> userdisk_print(int verbose) >> { >> struct disk_devdesc dev; >> char line[80]; >> - int i; >> + int i, ret =3D 0; >> >> for (i =3D 0; i < userdisk_maxunit; i++) { >> - sprintf(line, " disk%d: Guest drive image\n", i); >> - pager_output(line); >> + snprintf(line, sizeof(line), >> + " disk%d: Guest drive image\n", i); >> + ret =3D pager_output(line); >> + if (ret !=3D 0) >> + break; >> dev.d_dev =3D &userboot_disk; >> dev.d_unit =3D i; >> dev.d_slice =3D -1; >> dev.d_partition =3D -1; >> if (disk_open(&dev, ud_info[i].mediasize, >> ud_info[i].sectorsize, 0) =3D=3D 0) { >> - sprintf(line, " disk%d", i); >> - disk_print(&dev, line, verbose); >> + snprintf(line, sizeof(line), " disk%d", i); >> + ret =3D disk_print(&dev, line, verbose); >> disk_close(&dev); >> + if (ret !=3D 0) >> + break; >> } >> } >> + return (ret); >> } >> >> /* >> >> Modified: head/sys/boot/zfs/zfs.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/zfs/zfs.c Tue Nov 8 06:13:22 2016 (r308433= ) >> +++ head/sys/boot/zfs/zfs.c Tue Nov 8 06:50:18 2016 (r308434= ) >> @@ -514,20 +514,23 @@ zfs_probe_dev(const char *devname, uint6 >> /* >> * Print information about ZFS pools >> */ >> -static void >> +static int >> zfs_dev_print(int verbose) >> { >> spa_t *spa; >> char line[80]; >> + int ret =3D 0; >> >> if (verbose) { >> - spa_all_status(); >> - return; >> + return (spa_all_status()); >> } >> STAILQ_FOREACH(spa, &zfs_pools, spa_link) { >> - sprintf(line, " zfs:%s\n", spa->spa_name); >> - pager_output(line); >> + snprintf(line, sizeof(line), " zfs:%s\n", >> spa->spa_name); >> + ret =3D pager_output(line); >> + if (ret !=3D 0) >> + break; >> } >> + return (ret); >> } >> >> /* >> >> Modified: head/sys/boot/zfs/zfsimpl.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:13:22 2016 (r308433= ) >> +++ head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:50:18 2016 (r308434= ) >> @@ -780,7 +780,7 @@ state_name(vdev_state_t state) >> >> #else >> >> -static void >> +static int >> pager_printf(const char *fmt, ...) >> { >> char line[80]; >> @@ -789,14 +789,14 @@ pager_printf(const char *fmt, ...) >> va_start(args, fmt); >> vsprintf(line, fmt, args); >> va_end(args); >> - pager_output(line); >> + return (pager_output(line)); >> } >> >> #endif >> >> #define STATUS_FORMAT " %s %s\n" >> >> -static void >> +static int >> print_state(int indent, const char *name, vdev_state_t state) >> { >> int i; >> @@ -806,40 +806,56 @@ print_state(int indent, const char *name >> for (i =3D 0; i < indent; i++) >> strcat(buf, " "); >> strcat(buf, name); >> >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >> > > > From owner-svn-src-head@freebsd.org Fri Nov 11 14:19:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27DEEC3B497; Fri, 11 Nov 2016 14:19:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E869B199B; Fri, 11 Nov 2016 14:19:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABEJDap059398; Fri, 11 Nov 2016 14:19:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABEJDKH059397; Fri, 11 Nov 2016 14:19:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611111419.uABEJDKH059397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 11 Nov 2016 14:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308524 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 14:19:14 -0000 Author: andrew Date: Fri Nov 11 14:19:12 2016 New Revision: 308524 URL: https://svnweb.freebsd.org/changeset/base/308524 Log: Replace OF_getprop ... fdt32_to_cpu with OF_getencprop. The latter correctly adjusts for the endian. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Fri Nov 11 09:03:13 2016 (r308523) +++ head/sys/dev/fdt/fdt_common.c Fri Nov 11 14:19:12 2016 (r308524) @@ -419,13 +419,13 @@ fdt_addrsize_cells(phandle_t node, int * * Retrieve #{address,size}-cells. */ cell_size = sizeof(cell); - if (OF_getprop(node, "#address-cells", &cell, cell_size) < cell_size) - cell = 2; - *addr_cells = fdt32_to_cpu((int)cell); + if (OF_getencprop(node, "#address-cells", &cell, cell_size) < cell_size) + *addr_cells = 2; + *addr_cells = (int)cell; - if (OF_getprop(node, "#size-cells", &cell, cell_size) < cell_size) + if (OF_getencprop(node, "#size-cells", &cell, cell_size) < cell_size) cell = 1; - *size_cells = fdt32_to_cpu((int)cell); + *size_cells = (int)cell; if (*addr_cells > 3 || *size_cells > 2) return (ERANGE); @@ -540,11 +540,11 @@ fdt_get_phyaddr(phandle_t node, device_t phy_node = OF_node_from_xref(phy_handle); - if (OF_getprop(phy_node, "reg", (void *)&phy_reg, + if (OF_getencprop(phy_node, "reg", (void *)&phy_reg, sizeof(phy_reg)) <= 0) return (ENXIO); - *phy_addr = fdt32_to_cpu(phy_reg); + *phy_addr = phy_reg; /* * Search for softc used to communicate with phy. From owner-svn-src-head@freebsd.org Fri Nov 11 14:22:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D698AC3B621; Fri, 11 Nov 2016 14:22:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A601D1DC0; Fri, 11 Nov 2016 14:22:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABEMZb4062977; Fri, 11 Nov 2016 14:22:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABEMZEp062972; Fri, 11 Nov 2016 14:22:35 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611111422.uABEMZEp062972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 11 Nov 2016 14:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308525 - in head/sys/arm: altera/socfpga freescale/vybrid rockchip samsung/exynos xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 14:22:37 -0000 Author: andrew Date: Fri Nov 11 14:22:35 2016 New Revision: 308525 URL: https://svnweb.freebsd.org/changeset/base/308525 Log: Remove more unneeded users of the fdt_pic_decode_t table. Sponsored by: ABT Systems Ltd Deleted: head/sys/arm/rockchip/rk30xx_common.c Modified: head/sys/arm/altera/socfpga/socfpga_common.c head/sys/arm/freescale/vybrid/vf_common.c head/sys/arm/rockchip/files.rk30xx head/sys/arm/samsung/exynos/exynos5_common.c head/sys/arm/xilinx/zy7_machdep.c Modified: head/sys/arm/altera/socfpga/socfpga_common.c ============================================================================== --- head/sys/arm/altera/socfpga/socfpga_common.c Fri Nov 11 14:19:12 2016 (r308524) +++ head/sys/arm/altera/socfpga/socfpga_common.c Fri Nov 11 14:22:35 2016 (r308525) @@ -69,24 +69,3 @@ cpu_reset(void) end: while (1); } - -#ifndef INTRNG -static int -fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, - int *pol) -{ - - if (!fdt_is_compatible(node, "arm,gic")) - return (ENXIO); - - *interrupt = fdt32_to_cpu(intr[0]); - *trig = INTR_TRIGGER_CONFORM; - *pol = INTR_POLARITY_CONFORM; - return (0); -} - -fdt_pic_decode_t fdt_pic_table[] = { - &fdt_pic_decode_ic, - NULL -}; -#endif Modified: head/sys/arm/freescale/vybrid/vf_common.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_common.c Fri Nov 11 14:19:12 2016 (r308524) +++ head/sys/arm/freescale/vybrid/vf_common.c Fri Nov 11 14:22:35 2016 (r308525) @@ -61,24 +61,3 @@ cpu_reset(void) end: while (1); } - -#ifndef INTRNG -static int -fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, - int *pol) -{ - - if (!fdt_is_compatible(node, "arm,gic")) - return (ENXIO); - - *interrupt = fdt32_to_cpu(intr[0]); - *trig = INTR_TRIGGER_CONFORM; - *pol = INTR_POLARITY_CONFORM; - return (0); -} - -fdt_pic_decode_t fdt_pic_table[] = { - &fdt_pic_decode_ic, - NULL -}; -#endif Modified: head/sys/arm/rockchip/files.rk30xx ============================================================================== --- head/sys/arm/rockchip/files.rk30xx Fri Nov 11 14:19:12 2016 (r308524) +++ head/sys/arm/rockchip/files.rk30xx Fri Nov 11 14:22:35 2016 (r308525) @@ -1,7 +1,6 @@ # $FreeBSD$ kern/kern_clocksource.c standard -arm/rockchip/rk30xx_common.c standard arm/rockchip/rk30xx_machdep.c standard arm/rockchip/rk30xx_pmu.c standard arm/rockchip/rk30xx_grf.c standard Modified: head/sys/arm/samsung/exynos/exynos5_common.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_common.c Fri Nov 11 14:19:12 2016 (r308524) +++ head/sys/arm/samsung/exynos/exynos5_common.c Fri Nov 11 14:22:35 2016 (r308525) @@ -48,24 +48,3 @@ cpu_reset(void) while (1); } - -#ifndef INTRNG -static int -fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, - int *pol) -{ - - if (!fdt_is_compatible(node, "arm,gic")) - return (ENXIO); - - *interrupt = fdt32_to_cpu(intr[0]); - *trig = INTR_TRIGGER_CONFORM; - *pol = INTR_POLARITY_CONFORM; - return (0); -} - -fdt_pic_decode_t fdt_pic_table[] = { - &fdt_pic_decode_ic, - NULL -}; -#endif Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Fri Nov 11 14:19:12 2016 (r308524) +++ head/sys/arm/xilinx/zy7_machdep.c Fri Nov 11 14:22:35 2016 (r308525) @@ -92,29 +92,6 @@ platform_devmap_init(void) return (0); } - -#ifndef INTRNG -static int -fdt_gic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, - int *pol) -{ - - if (!fdt_is_compatible(node, "arm,gic")) - return (ENXIO); - - *interrupt = fdt32_to_cpu(intr[0]); - *trig = INTR_TRIGGER_CONFORM; - *pol = INTR_POLARITY_CONFORM; - - return (0); -} - -fdt_pic_decode_t fdt_pic_table[] = { - &fdt_gic_decode_ic, - NULL -}; -#endif - void cpu_reset() { From owner-svn-src-head@freebsd.org Fri Nov 11 14:30:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32FACC3B72A; Fri, 11 Nov 2016 14:30:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04E55100F; Fri, 11 Nov 2016 14:30:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABEU9mw063311; Fri, 11 Nov 2016 14:30:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABEU9CM063310; Fri, 11 Nov 2016 14:30:09 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611111430.uABEU9CM063310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 11 Nov 2016 14:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308526 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 14:30:10 -0000 Author: andrew Date: Fri Nov 11 14:30:09 2016 New Revision: 308526 URL: https://svnweb.freebsd.org/changeset/base/308526 Log: Fix ata_at91_alloc_resource to use rman_res_t. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/at91/at91_cfata.c Modified: head/sys/arm/at91/at91_cfata.c ============================================================================== --- head/sys/arm/at91/at91_cfata.c Fri Nov 11 14:22:35 2016 (r308525) +++ head/sys/arm/at91/at91_cfata.c Fri Nov 11 14:30:09 2016 (r308526) @@ -114,7 +114,7 @@ at91_cfata_detach(device_t dev) static struct resource * ata_at91_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct at91_cfata_softc *sc = device_get_softc(dev); From owner-svn-src-head@freebsd.org Fri Nov 11 14:41:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85F92C3BAC5; Fri, 11 Nov 2016 14:41:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 471A21716; Fri, 11 Nov 2016 14:41:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABEf2k7068389; Fri, 11 Nov 2016 14:41:02 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABEf2S3068387; Fri, 11 Nov 2016 14:41:02 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611111441.uABEf2S3068387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 11 Nov 2016 14:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308527 - head/sys/dev/smbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 14:41:03 -0000 Author: avg Date: Fri Nov 11 14:41:02 2016 New Revision: 308527 URL: https://svnweb.freebsd.org/changeset/base/308527 Log: smb: fix SMB_READB, SMB_READW, SMB_PCALL to work as documented Previously, those ioctls were defined as 'in' only, so rdata.byte and rdata.word were never updated in the userland. The read data went only to rbuf if it was provided. Thus, consumers were forced to always use it. Now the ioctls are marked as in-out. Compatibility handlers are provided for old ioctls. PR: 213481 Reported by: Lewis Donzis MFC after: 2 weeks Relnotes: maybe Differential Revision: https://reviews.freebsd.org/D8430 Modified: head/sys/dev/smbus/smb.c head/sys/dev/smbus/smb.h Modified: head/sys/dev/smbus/smb.c ============================================================================== --- head/sys/dev/smbus/smb.c Fri Nov 11 14:30:09 2016 (r308526) +++ head/sys/dev/smbus/smb.c Fri Nov 11 14:41:02 2016 (r308527) @@ -41,7 +41,9 @@ #include "smbus_if.h" -#define BUFSIZE 1024 +#define SMB_OLD_READB _IOW('i', 7, struct smbcmd) +#define SMB_OLD_READW _IOW('i', 8, struct smbcmd) +#define SMB_OLD_PCALL _IOW('i', 9, struct smbcmd) struct smb_softc { device_t sc_dev; @@ -224,7 +226,9 @@ smbioctl(struct cdev *dev, u_long cmd, c s->cmd, s->wdata.word)); break; + case SMB_OLD_READB: case SMB_READB: + /* NB: for SMB_OLD_READB the read data goes to rbuf only. */ error = smbus_error(smbus_readb(parent, s->slave, s->cmd, &s->rdata.byte)); if (error) @@ -235,7 +239,9 @@ smbioctl(struct cdev *dev, u_long cmd, c } break; + case SMB_OLD_READW: case SMB_READW: + /* NB: for SMB_OLD_READW the read data goes to rbuf only. */ error = smbus_error(smbus_readw(parent, s->slave, s->cmd, &s->rdata.word)); if (error) @@ -248,7 +254,9 @@ smbioctl(struct cdev *dev, u_long cmd, c } break; + case SMB_OLD_PCALL: case SMB_PCALL: + /* NB: for SMB_OLD_PCALL the read data goes to rbuf only. */ error = smbus_error(smbus_pcall(parent, s->slave, s->cmd, s->wdata.word, &s->rdata.word)); if (error) Modified: head/sys/dev/smbus/smb.h ============================================================================== --- head/sys/dev/smbus/smb.h Fri Nov 11 14:30:09 2016 (r308526) +++ head/sys/dev/smbus/smb.h Fri Nov 11 14:41:02 2016 (r308527) @@ -63,11 +63,10 @@ struct smbcmd { #define SMB_RECVB _IOWR('i', 4, struct smbcmd) #define SMB_WRITEB _IOW('i', 5, struct smbcmd) #define SMB_WRITEW _IOW('i', 6, struct smbcmd) -#define SMB_READB _IOW('i', 7, struct smbcmd) -#define SMB_READW _IOW('i', 8, struct smbcmd) -#define SMB_PCALL _IOW('i', 9, struct smbcmd) +#define SMB_READB _IOWR('i', 7, struct smbcmd) +#define SMB_READW _IOWR('i', 8, struct smbcmd) +#define SMB_PCALL _IOWR('i', 9, struct smbcmd) #define SMB_BWRITE _IOW('i', 10, struct smbcmd) -#define SMB_OLD_BREAD _IOW('i', 11, struct smbcmd) #define SMB_BREAD _IOWR('i', 11, struct smbcmd) #define SMB_OLD_TRANS _IOWR('i', 12, struct smbcmd) From owner-svn-src-head@freebsd.org Fri Nov 11 15:00:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14635C3B1B3; Fri, 11 Nov 2016 15:00:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C234A1149; Fri, 11 Nov 2016 15:00:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABF0ERZ075962; Fri, 11 Nov 2016 15:00:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABF0Eqi075961; Fri, 11 Nov 2016 15:00:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611111500.uABF0Eqi075961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 11 Nov 2016 15:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308528 - head/usr.sbin/smbmsg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 15:00:15 -0000 Author: avg Date: Fri Nov 11 15:00:13 2016 New Revision: 308528 URL: https://svnweb.freebsd.org/changeset/base/308528 Log: smbmsg: use a more convenient way of accessing data read from a slave Developers writing code for accessing /dev/smb may use this base utility as an example. Now that SMB_READB, SMB_READW, SMB_PCALL behave as documented, wwe can use them in a more convenient way than before. MFC after: 4 weeks X-MFC after: r308527 Modified: head/usr.sbin/smbmsg/smbmsg.c Modified: head/usr.sbin/smbmsg/smbmsg.c ============================================================================== --- head/usr.sbin/smbmsg/smbmsg.c Fri Nov 11 14:41:02 2016 (r308527) +++ head/usr.sbin/smbmsg/smbmsg.c Fri Nov 11 15:00:13 2016 (r308528) @@ -61,7 +61,7 @@ static int wflag; /* word IO */ static unsigned char ibuf[SMB_MAXBLOCKSIZE]; static unsigned char obuf[SMB_MAXBLOCKSIZE]; -static unsigned short oword, iword; +static unsigned short oword; /* * The I2C specs say that all addresses below 16 and above or equal @@ -135,6 +135,8 @@ do_io(void) c.slave = slave; c.cmd = cflag; + c.rcount = 0; + c.wcount = 0; if (fmt == NULL && iflag > 0) fmt = wflag? wordfmt: bytefmt; @@ -163,11 +165,9 @@ do_io(void) } if (iflag == 1 && oflag == -1) { /* command + 1 byte input: read byte op. */ - c.rbuf = ibuf; - c.rcount = iflag; if (ioctl(fd, SMB_READB, &c) == -1) return (-1); - printf(fmt, (int)(unsigned char)ibuf[0]); + printf(fmt, (unsigned char)c.rdata.byte); putchar('\n'); return (0); } else if (iflag == -1 && oflag == 1) { @@ -176,11 +176,9 @@ do_io(void) return (ioctl(fd, SMB_WRITEB, &c)); } else if (wflag && iflag == 2 && oflag == -1) { /* command + 2 bytes input: read word op. */ - c.rbuf = (char*) &iword; - c.rcount = iflag; if (ioctl(fd, SMB_READW, &c) == -1) return (-1); - printf(fmt, (int)(unsigned short)iword); + printf(fmt, (unsigned short)c.rdata.word); putchar('\n'); return (0); } else if (wflag && iflag == -1 && oflag == 2) { @@ -193,11 +191,9 @@ do_io(void) * "process call" op. */ c.wdata.word = oword; - c.rbuf = (char*) &iword; - c.rcount = iflag; if (ioctl(fd, SMB_PCALL, &c) == -1) return (-1); - printf(fmt, (int)(unsigned short)iword); + printf(fmt, (unsigned short)c.rdata.word); putchar('\n'); return (0); } else if (iflag > 1 && oflag == -1) { @@ -206,7 +202,7 @@ do_io(void) c.rcount = iflag; if (ioctl(fd, SMB_BREAD, &c) == -1) return (-1); - for (i = 0; i < iflag; i++) { + for (i = 0; i < c.rcount; i++) { if (i != 0) putchar(' '); printf(fmt, ibuf[i]); From owner-svn-src-head@freebsd.org Fri Nov 11 15:08:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5900AC3B4D4; Fri, 11 Nov 2016 15:08:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19B7318DB; Fri, 11 Nov 2016 15:08:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABF8Cmu080005; Fri, 11 Nov 2016 15:08:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABF8CR9080004; Fri, 11 Nov 2016 15:08:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611111508.uABF8CR9080004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 11 Nov 2016 15:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308529 - head/sys/dev/intpm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 15:08:13 -0000 Author: avg Date: Fri Nov 11 15:08:12 2016 New Revision: 308529 URL: https://svnweb.freebsd.org/changeset/base/308529 Log: intpm: clean up intsmb_bread and intsmb_pcall The hardware does not implement SMBus Process Call command, so remove ifdef-ed out code from intsmb_pcall. The code used exactly the same start sequence as for Write Word command. intsmb_bread code used to access an in value of the count parameter, but that parameter is supposed to be an out only parameter. For example, smb(4) does not initialize it before calling smbus_bread. MFC after: 3 weeks Modified: head/sys/dev/intpm/intpm.c Modified: head/sys/dev/intpm/intpm.c ============================================================================== --- head/sys/dev/intpm/intpm.c Fri Nov 11 15:00:13 2016 (r308528) +++ head/sys/dev/intpm/intpm.c Fri Nov 11 15:08:12 2016 (r308529) @@ -785,39 +785,11 @@ intsmb_readw(device_t dev, u_char slave, return (error); } -/* - * Data sheet claims that it implements all function, but also claims - * that it implements 7 function and not mention PCALL. So I don't know - * whether it will work. - */ static int intsmb_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata) { -#ifdef PROCCALL_TEST - struct intsmb_softc *sc = device_get_softc(dev); - int error; - INTSMB_LOCK(sc); - error = intsmb_free(sc); - if (error) { - INTSMB_UNLOCK(sc); - return (error); - } - bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave & ~LSB); - bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd); - bus_write_1(sc->io_res, PIIX4_SMBHSTDAT0, sdata & 0xff); - bus_write_1(sc->io_res, PIIX4_SMBHSTDAT1, (sdata & 0xff) >> 8); - intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_WDATA, 0); - error = intsmb_stop(sc); - if (error == 0) { - *rdata = bus_read_1(sc->io_res, PIIX4_SMBHSTDAT0); - *rdata |= bus_read_1(sc->io_res, PIIX4_SMBHSTDAT1) << 8; - } - INTSMB_UNLOCK(sc); - return (error); -#else return (SMB_ENOTSUPP); -#endif } static int @@ -857,9 +829,6 @@ intsmb_bread(device_t dev, u_char slave, int error, i; u_char data, nread; - if (*count > SMBBLOCKTRANS_MAX || *count == 0) - return (SMB_EINVAL); - INTSMB_LOCK(sc); error = intsmb_free(sc); if (error) { @@ -872,18 +841,14 @@ intsmb_bread(device_t dev, u_char slave, bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave | LSB); bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd); - bus_write_1(sc->io_res, PIIX4_SMBHSTDAT0, *count); intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_BLOCK, 0); error = intsmb_stop(sc); if (error == 0) { nread = bus_read_1(sc->io_res, PIIX4_SMBHSTDAT0); if (nread != 0 && nread <= SMBBLOCKTRANS_MAX) { - for (i = 0; i < nread; i++) { - data = bus_read_1(sc->io_res, PIIX4_SMBBLKDAT); - if (i < *count) - buf[i] = data; - } *count = nread; + for (i = 0; i < nread; i++) + data = bus_read_1(sc->io_res, PIIX4_SMBBLKDAT); } else error = SMB_EBUSERR; } From owner-svn-src-head@freebsd.org Fri Nov 11 15:11:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0367AC3B638; Fri, 11 Nov 2016 15:11:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F2EE1DFC; Fri, 11 Nov 2016 15:11:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABFBscx081662; Fri, 11 Nov 2016 15:11:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABFBsbQ081661; Fri, 11 Nov 2016 15:11:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611111511.uABFBsbQ081661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 11 Nov 2016 15:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308530 - head/sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 15:11:56 -0000 Author: avg Date: Fri Nov 11 15:11:54 2016 New Revision: 308530 URL: https://svnweb.freebsd.org/changeset/base/308530 Log: iicsmb: SMB_MAXBLOCKSIZE can be used again The constant was set to the correct value in r308242. While there, fix iicsmb_bread() to not use a value of an out parameter 'count'. MFC after: 3 weeks X-MFC after: r308242 Modified: head/sys/dev/iicbus/iicsmb.c Modified: head/sys/dev/iicbus/iicsmb.c ============================================================================== --- head/sys/dev/iicbus/iicsmb.c Fri Nov 11 15:08:12 2016 (r308529) +++ head/sys/dev/iicbus/iicsmb.c Fri Nov 11 15:11:54 2016 (r308530) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "iicbus_if.h" @@ -432,7 +433,7 @@ iicsmb_bwrite(device_t dev, u_char slave }; int error; - if (count > 32 || count == 0) + if (count > SMB_MAXBLOCKSIZE || count == 0) return (SMB_EINVAL); error = TRANSFER_MSGS(dev, msgs); return (iic2smb_error(error)); @@ -450,12 +451,6 @@ iicsmb_bread(device_t dev, u_char slave, }; device_t parent = device_get_parent(dev); int error; - u_char bufsz; - - /* Stash output buffer size before overwriting it. */ - bufsz = *count; - if (bufsz == 0) - return (SMB_EINVAL); /* Have to do this because the command is split in two transfers. */ error = iicbus_request_bus(parent, dev, IIC_WAIT); @@ -465,18 +460,13 @@ iicsmb_bread(device_t dev, u_char slave, /* * If the slave offers an empty or a too long reply, * read one byte to generate the stop or abort. - * XXX 32 is hardcoded until SMB_MAXBLOCKSIZE is restored - * to sanity. */ - if (*count > 32 || *count == 0) + if (*count > SMB_MAXBLOCKSIZE || *count == 0) block_msg[0].len = 1; - /* If longer than the buffer, then clamp at the buffer size. */ - if (*count > bufsz) - block_msg[0].len = bufsz; else block_msg[0].len = *count; error = TRANSFER_MSGS(dev, block_msg); - if (*count > 32 || *count == 0) + if (*count > SMB_MAXBLOCKSIZE || *count == 0) error = SMB_EINVAL; } (void)iicbus_release_bus(parent, dev); From owner-svn-src-head@freebsd.org Fri Nov 11 15:13:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACCD6C3B85C; Fri, 11 Nov 2016 15:13:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E4B510B4; Fri, 11 Nov 2016 15:13:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABFDVnJ084023; Fri, 11 Nov 2016 15:13:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABFDUdM084010; Fri, 11 Nov 2016 15:13:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611111513.uABFDUdM084010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 11 Nov 2016 15:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308531 - in head/sys/arm: allwinner annapurna/alpine arm at91 broadcom/bcm2835 lpc mv rockchip ti/am335x versatile X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 15:13:32 -0000 Author: andrew Date: Fri Nov 11 15:13:30 2016 New Revision: 308531 URL: https://svnweb.freebsd.org/changeset/base/308531 Log: Use the modern spelling of ofw_bus_node_is_compatible in sys/arm. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/allwinner/aw_ccu.c head/sys/arm/annapurna/alpine/alpine_machdep_mp.c head/sys/arm/arm/gic.c head/sys/arm/at91/at91_common.c head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c head/sys/arm/lpc/lpc_intc.c head/sys/arm/mv/gpio.c head/sys/arm/mv/mv_common.c head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/mv_pci.c head/sys/arm/rockchip/rk30xx_gpio.c head/sys/arm/ti/am335x/am335x_lcd_syscons.c head/sys/arm/versatile/versatile_common.c Modified: head/sys/arm/allwinner/aw_ccu.c ============================================================================== --- head/sys/arm/allwinner/aw_ccu.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/allwinner/aw_ccu.c Fri Nov 11 15:13:30 2016 (r308531) @@ -195,7 +195,7 @@ aw_ccu_search_compatible(void) root = OF_finddevice("/"); for (compat = compat_data; compat->ocd_str != NULL; compat++) - if (fdt_is_compatible(root, compat->ocd_str)) + if (ofw_bus_node_is_compatible(root, compat->ocd_str)) break; return (compat); Modified: head/sys/arm/annapurna/alpine/alpine_machdep_mp.c ============================================================================== --- head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Fri Nov 11 15:13:30 2016 (r308531) @@ -81,7 +81,7 @@ static boolean_t alpine_validate_cpu(u_i static boolean_t alpine_validate_cpu(u_int id, phandle_t child, u_int addr_cell, pcell_t *reg) { - return fdt_is_compatible(child, "arm,cortex-a15"); + return ofw_bus_node_is_compatible(child, "arm,cortex-a15"); } static int Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/arm/gic.c Fri Nov 11 15:13:30 2016 (r308531) @@ -312,7 +312,7 @@ gic_decode_fdt(phandle_t iparent, pcell_ if (self == 0) { for (ocd = compat_data; ocd->ocd_str != NULL; ocd++) { - if (fdt_is_compatible(iparent, ocd->ocd_str)) { + if (ofw_bus_node_is_compatible(iparent, ocd->ocd_str)) { self = iparent; break; } Modified: head/sys/arm/at91/at91_common.c ============================================================================== --- head/sys/arm/at91/at91_common.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/at91/at91_common.c Fri Nov 11 15:13:30 2016 (r308531) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -56,7 +57,7 @@ fdt_aic_decode_ic(phandle_t node, pcell_ { int offset; - if (fdt_is_compatible(node, "atmel,at91rm9200-aic")) + if (ofw_bus_node_is_compatible(node, "atmel,at91rm9200-aic")) offset = 0; else return (ENXIO); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Fri Nov 11 15:13:30 2016 (r308531) @@ -1261,7 +1261,7 @@ bcm2835_cpufreq_identify(driver_t *drive root = OF_finddevice("/"); for (compat = compat_data; compat->ocd_str != NULL; compat++) - if (fdt_is_compatible(root, compat->ocd_str)) + if (ofw_bus_node_is_compatible(root, compat->ocd_str)) break; if (compat->ocd_data == 0) Modified: head/sys/arm/lpc/lpc_intc.c ============================================================================== --- head/sys/arm/lpc/lpc_intc.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/lpc/lpc_intc.c Fri Nov 11 15:13:30 2016 (r308531) @@ -232,7 +232,7 @@ static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) { - if (!fdt_is_compatible(node, "lpc,pic")) + if (!ofw_bus_node_is_compatible(node, "lpc,pic")) return (ENXIO); *interrupt = fdt32_to_cpu(intr[0]); Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/mv/gpio.c Fri Nov 11 15:13:30 2016 (r308531) @@ -643,7 +643,7 @@ mv_gpio_init(void) */ ctrl = OF_node_from_xref(fdt32_to_cpu(gpios[0])); - if (fdt_is_compatible(ctrl, e->compat)) + if (ofw_bus_node_is_compatible(ctrl, e->compat)) /* Call a handler. */ if ((rv = e->handler(ctrl, (pcell_t *)&gpios, len))) Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/mv/mv_common.c Fri Nov 11 15:13:30 2016 (r308531) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -230,7 +231,8 @@ fdt_pm(phandle_t node) if (dev_mask & (1 << i)) continue; - compat = fdt_is_compatible(node, fdt_pm_mask_table[i].compat); + compat = ofw_bus_node_is_compatible(node, + fdt_pm_mask_table[i].compat); #if defined(SOC_MV_KIRKWOOD) if (compat && (cpu_pm_ctrl & fdt_pm_mask_table[i].mask)) { dev_mask |= (1 << i); @@ -2092,7 +2094,7 @@ win_cpu_from_dt(void) * Retrieve CESA SRAM data. */ if ((node = OF_finddevice("sram")) != -1) - if (fdt_is_compatible(node, "mrvl,cesa-sram")) + if (ofw_bus_node_is_compatible(node, "mrvl,cesa-sram")) goto moveon; if ((node = OF_finddevice("/")) == 0) @@ -2120,7 +2122,7 @@ moveon: /* Check if there is a second CESA node */ while ((node = OF_peer(node)) != 0) { - if (fdt_is_compatible(node, "mrvl,cesa-sram")) { + if (ofw_bus_node_is_compatible(node, "mrvl,cesa-sram")) { if (fdt_regsize(node, &sram_base, &sram_size) != 0) return (EINVAL); break; @@ -2170,7 +2172,7 @@ fdt_win_setup(void) soc_node = &soc_nodes[i]; - if (!fdt_is_compatible(child, soc_node->compat)) + if (!ofw_bus_node_is_compatible(child,soc_node->compat)) continue; err = fdt_regsize(child, &base, &size); @@ -2319,8 +2321,8 @@ fdt_pic_decode_ic(phandle_t node, pcell_ int *pol) { - if (!fdt_is_compatible(node, "mrvl,pic") && - !fdt_is_compatible(node, "mrvl,mpic")) + if (!ofw_bus_node_is_compatible(node, "mrvl,pic") && + !ofw_bus_node_is_compatible(node, "mrvl,mpic")) return (ENXIO); *interrupt = fdt32_to_cpu(intr[0]); Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/mv/mv_machdep.c Fri Nov 11 15:13:30 2016 (r308531) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include static int platform_mpp_init(void); #if defined(SOC_MV_ARMADAXP) @@ -103,7 +104,7 @@ platform_mpp_init(void) * Try to access the MPP node directly i.e. through /aliases/mpp. */ if ((node = OF_finddevice("mpp")) != -1) - if (fdt_is_compatible(node, "mrvl,mpp")) + if (ofw_bus_node_is_compatible(node, "mrvl,mpp")) goto moveon; /* * Find the node the long way. @@ -290,8 +291,8 @@ platform_sram_devmap(struct devmap_entry * SRAM range. */ if ((child = OF_finddevice("/sram")) != 0) - if (fdt_is_compatible(child, "mrvl,cesa-sram") || - fdt_is_compatible(child, "mrvl,scratchpad")) + if (ofw_bus_node_is_compatible(child, "mrvl,cesa-sram") || + ofw_bus_node_is_compatible(child, "mrvl,scratchpad")) goto moveon; if ((root = OF_finddevice("/")) == 0) @@ -406,7 +407,7 @@ platform_devmap_init(void) i += 2; } - if (fdt_is_compatible(child, "mrvl,lbc")) { + if (ofw_bus_node_is_compatible(child, "mrvl,lbc")) { /* Check available space */ if (OF_getprop(child, "bank-count", (void *)&bank_count, sizeof(bank_count)) <= 0) Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/mv/mv_pci.c Fri Nov 11 15:13:30 2016 (r308531) @@ -429,12 +429,12 @@ mv_pcib_attach(device_t self) node = ofw_bus_get_node(self); parnode = OF_parent(node); - if (fdt_is_compatible(node, "mrvl,pcie")) { + if (ofw_bus_node_is_compatible(node, "mrvl,pcie")) { sc->sc_type = MV_TYPE_PCIE; sc->sc_win_target = MV_WIN_PCIE_TARGET(unit); sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR(unit); sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR(unit); - } else if (fdt_is_compatible(node, "mrvl,pci")) { + } else if (ofw_bus_node_is_compatible(node, "mrvl,pci")) { sc->sc_type = MV_TYPE_PCI; sc->sc_win_target = MV_WIN_PCI_TARGET; sc->sc_mem_win_attr = MV_WIN_PCI_MEM_ATTR; Modified: head/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_gpio.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/rockchip/rk30xx_gpio.c Fri Nov 11 15:13:30 2016 (r308531) @@ -614,7 +614,7 @@ rk30_gpio_init(void) */ ctrl = OF_node_from_xref(fdt32_to_cpu(gpios[0])); - if (fdt_is_compatible(ctrl, e->compat)) + if (ofw_bus_node_is_compatible(ctrl, e->compat)) /* Call a handler. */ if ((rv = e->handler(ctrl, (pcell_t *)&gpios, len))) Modified: head/sys/arm/ti/am335x/am335x_lcd_syscons.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd_syscons.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/ti/am335x/am335x_lcd_syscons.c Fri Nov 11 15:13:30 2016 (r308531) @@ -351,7 +351,7 @@ am335x_syscons_find_panel_node(phandle_t phandle_t result; for (child = OF_child(start); child != 0; child = OF_peer(child)) { - if (fdt_is_compatible(child, "ti,am335x-lcd")) + if (ofw_bus_node_is_compatible(child, "ti,am335x-lcd")) return (child); if ((result = am335x_syscons_find_panel_node(child))) return (result); Modified: head/sys/arm/versatile/versatile_common.c ============================================================================== --- head/sys/arm/versatile/versatile_common.c Fri Nov 11 15:11:54 2016 (r308530) +++ head/sys/arm/versatile/versatile_common.c Fri Nov 11 15:13:30 2016 (r308531) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -52,7 +53,7 @@ fdt_intc_decode_ic(phandle_t node, pcell int *pol) { - if (!fdt_is_compatible(node, "arm,versatile-vic")) + if (!ofw_bus_node_is_compatible(node, "arm,versatile-vic")) return (ENXIO); *interrupt = fdt32_to_cpu(intr[0]); From owner-svn-src-head@freebsd.org Fri Nov 11 15:16:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C4C9C3B930; Fri, 11 Nov 2016 15:16:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F273312C1; Fri, 11 Nov 2016 15:16:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABFGbLE084180; Fri, 11 Nov 2016 15:16:37 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABFGbHr084179; Fri, 11 Nov 2016 15:16:37 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611111516.uABFGbHr084179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 11 Nov 2016 15:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308532 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 15:16:38 -0000 Author: avg Date: Fri Nov 11 15:16:37 2016 New Revision: 308532 URL: https://svnweb.freebsd.org/changeset/base/308532 Log: update SMB_BWRITE documentation, clarify SMB_BREAD After removal of SMB_TRANS some information in the description of SMB_BWRITE has become stale. E.g., the maximum block size has been restored to 32. Also, the descriptions of SMB_BREAD and SMB_BWRITE had some incorrect information on the SMBus protocol details. MFC after: 1 week X-MFC with: r308242 Differential Revision: https://reviews.freebsd.org/D8431 Modified: head/share/man/man4/smb.4 Modified: head/share/man/man4/smb.4 ============================================================================== --- head/share/man/man4/smb.4 Fri Nov 11 15:13:30 2016 (r308531) +++ head/share/man/man4/smb.4 Fri Nov 11 15:16:37 2016 (r308532) @@ -141,26 +141,25 @@ in .Em BlockWrite first sends the byte from .Fa cmd -to the device, followed by +to the device, then the byte from +.Fa wcount +followed by .Fa wcount bytes of data that are taken from the buffer pointed to by .Fa wbuf . The SMBus specification mandates that no more than 32 bytes of -data can be transferred in a single block read or write command, -but since -.Xr smbus 4 -is also used to access I2C devices, the limit has been increased -to 1024. +data can be transferred in a single block read or write command. This value can be read from the constant .Dv SMB_MAXBLOCKSIZE . .It Dv SMB_BREAD Ta .Em BlockRead first sends the byte from .Fa cmd -to the device, then reads -.Fa rcount -bytes of data that from the device. -This data is returned in the buffer pointed to by +to the device, then reads a count of data bytes that the device +is going to provide and then reads that many bytes. +The count is returned in +.Fa rcount. +The data is returned in the buffer pointed to by .Fa rbuf . .El .Pp From owner-svn-src-head@freebsd.org Fri Nov 11 15:42:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11844C3A215; Fri, 11 Nov 2016 15:42:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B97CA12E1; Fri, 11 Nov 2016 15:42:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABFgCt5095620; Fri, 11 Nov 2016 15:42:12 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABFgCsZ095617; Fri, 11 Nov 2016 15:42:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611111542.uABFgCsZ095617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 11 Nov 2016 15:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308533 - in head/sys/dev: fdt uart usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 15:42:14 -0000 Author: andrew Date: Fri Nov 11 15:42:12 2016 New Revision: 308533 URL: https://svnweb.freebsd.org/changeset/base/308533 Log: Use ofw_bus_node_is_compatible in more drivers used on arm. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/fdt/fdt_arm_platform.c head/sys/dev/uart/uart_bus_fdt.c head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/fdt/fdt_arm_platform.c ============================================================================== --- head/sys/dev/fdt/fdt_arm_platform.c Fri Nov 11 15:16:37 2016 (r308532) +++ head/sys/dev/fdt/fdt_arm_platform.c Fri Nov 11 15:42:12 2016 (r308533) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "platform_if.h" @@ -58,7 +59,7 @@ fdt_platform_probe(platform_t plat) /* Is the device is compatible? */ root = OF_finddevice("/"); compat = FDT_PLATFORM(plat)->fdt_compatible; - if (fdt_is_compatible(root, compat) != 0) + if (ofw_bus_node_is_compatible(root, compat) != 0) return 0; /* Not compatible, return an error */ Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Fri Nov 11 15:16:37 2016 (r308532) +++ head/sys/dev/uart/uart_bus_fdt.c Fri Nov 11 15:42:12 2016 (r308533) @@ -123,7 +123,7 @@ uart_fdt_find_compatible(phandle_t node, const struct ofw_compat_data *ocd; for (ocd = cd; ocd->ocd_str != NULL; ocd++) { - if (fdt_is_compatible(node, ocd->ocd_str)) + if (ofw_bus_node_is_compatible(node, ocd->ocd_str)) return (ocd); } return (NULL); Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Fri Nov 11 15:16:37 2016 (r308532) +++ head/sys/dev/usb/net/if_smsc.c Fri Nov 11 15:42:12 2016 (r308533) @@ -1566,8 +1566,8 @@ smsc_fdt_find_eth_node(phandle_t start) /* Traverse through entire tree to find usb ethernet nodes. */ for (node = OF_child(start); node != 0; node = OF_peer(node)) { - if (fdt_is_compatible(node, "net,ethernet") && - fdt_is_compatible(node, "usb,device")) + if (ofw_bus_node_is_compatible(node, "net,ethernet") && + ofw_bus_node_is_compatible(node, "usb,device")) return (node); child = smsc_fdt_find_eth_node(node); if (child != -1) From owner-svn-src-head@freebsd.org Fri Nov 11 16:59:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3846CC3B61C; Fri, 11 Nov 2016 16:59:27 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A15819A0; Fri, 11 Nov 2016 16:59:26 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABGxQDj023893; Fri, 11 Nov 2016 16:59:26 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABGxQ74023892; Fri, 11 Nov 2016 16:59:26 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201611111659.uABGxQ74023892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 11 Nov 2016 16:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308534 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 16:59:27 -0000 Author: stevek Date: Fri Nov 11 16:59:26 2016 New Revision: 308534 URL: https://svnweb.freebsd.org/changeset/base/308534 Log: The file_loadraw function grew an argument, update install function accordingly. Reviewed by: imp Approved by: sjg (mentor) MFC after: 2 weeks Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D8494 Modified: head/sys/boot/common/install.c Modified: head/sys/boot/common/install.c ============================================================================== --- head/sys/boot/common/install.c Fri Nov 11 15:42:12 2016 (r308533) +++ head/sys/boot/common/install.c Fri Nov 11 16:59:26 2016 (r308534) @@ -286,7 +286,7 @@ install(char *pkgname) } s = (inst_rootfs == NULL) ? "/install.iso" : inst_rootfs; - if (file_loadraw(s, "mfs_root") == NULL) { + if (file_loadraw(s, "mfs_root", 1) == NULL) { error = errno; command_errmsg = "cannot load root file system"; goto fail; From owner-svn-src-head@freebsd.org Fri Nov 11 17:08:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74C9EC3BBE8 for ; Fri, 11 Nov 2016 17:08:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33205109A for ; Fri, 11 Nov 2016 17:08:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id e187so337714033itc.0 for ; Fri, 11 Nov 2016 09:08:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=inzpxZ/Ntzrs7WGulQ5IOEftR0CLuWDt7gPmI3O06lQ=; b=zM9s5gvSUbEuds43QVrdDXWqijuoCKiVZHfFQwKRNSQnmFB6Uh/2RtoLFoAD472Wgk HnoCrTJi18vmijSaQIuQbD9P5kyf6yDq46ipkIu21xQS5m0937lP+sErwXGwJn7AjMUY B8RX8tNMN7T54/ZH2gRA1APbSr/SIQDKQ+eUaeOTdhQWuP5vdCKS1VRDMwb5bhJQqY4R NkwzEyeWO3fWLI0Ec3/QZ7+gMeOHBIzwbxkjQTtEeMlwVUZj4+oQ320hDaF6OUFXD+MS OgpKKZx9a5RTDa2b+SFoa2LZFp4JgTJgv1zMYn+2X0GuYDcYQYYBRkAoPCJr0WdVrUNF dIcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=inzpxZ/Ntzrs7WGulQ5IOEftR0CLuWDt7gPmI3O06lQ=; b=fKBgo9xU/hPmkKaJszXzgb4vwnN8KIq3EXbu9tofgOMdcEZ8ht7Lns5e4VuSchcRId pYWywdhFDQA1iudWVySd+IfNzIJUNIvksRzyo4dILSqE8YLtR4X6KrFSpY0B597oBoTZ A0hbZNYTvADtFEzZ1SzB6DZHXgATCKFkxZQFwS4iY0SfGjVIYo6QHTT6stLTlLdyCN/F 8QsZ98nn7bpCz2/YHhC9jLP7am30pGRKTAXulcffhpTXR1s5Fn/r4CFr4fql+X7lA6qa yLXpUgCawOi7Z/pZIYZKVywrRFRqbs7eSh4cCclJBb6hO7eYjHM0iYbDKSwG7U+9bESR NpUg== X-Gm-Message-State: ABUngvfiuxdXNAvCBUHud1Z9+s5bfKd0G9M1+0NT2gr9UsGM8Nq8YgYOjsY3HwoEPst8PQcr/A8Ox7lWQF/sbw== X-Received: by 10.107.132.74 with SMTP id g71mr12928467iod.19.1478884128965; Fri, 11 Nov 2016 09:08:48 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.134.66 with HTTP; Fri, 11 Nov 2016 09:08:47 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201611080650.uA86oJ7W056026@repo.freebsd.org> <8E0E5C94-EFD7-4008-B563-FF080A98F23D@me.com> From: Warner Losh Date: Fri, 11 Nov 2016 10:08:47 -0700 X-Google-Sender-Auth: H1oKtb4qlVm9Y56Zd9EYjrYJIkA Message-ID: Subject: Re: svn commit: r308434 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libofw sys... To: Kamil Czekirda Cc: Toomas Soome , Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 17:08:54 -0000 This suggests we've created an update / upgrade problem. Do we? Warner On Thu, Nov 10, 2016 at 11:52 PM, Kamil Czekirda wrot= e: > cp /usr/src/lib/libstand/libstand.h /usr/include/stand.h fixed that > > thanks > > 2016-11-10 23:28 GMT+01:00 Toomas Soome : >> >> the patch does update the lib/libstand/stand.h to have: >> >> struct devsw { >> . . . >> int (*dv_print)(int verbose); >> >> it was void before; from your svnlite log I can see the >> lib/libstand/stand.h is updated, could you confirm if it is int now? if = it >> is, I suspect the build is getting the old stand.h from somewhere in the >> tree and not your /lib/libstand. >> >> if so, does the build has target to copy headers in place? I=E2=80=99m s= orry, I >> don't know all the tricks the build system does as part of the buildworl= d.. >> >> rgds, >> toomas >> >> >> On 11. nov 2016, at 0:21, Kamil Czekirda wrote: >> >> Hi, >> >> I got the following: >> >> root@current:/usr/src # svnlite up -r r308434 >> Updating '.': >> U lib/libstand/stand.h >> U sys/boot/common/dev_net.c >> U sys/boot/common/module.c >> U sys/boot/common/part.c >> U sys/boot/common/util.c >> U sys/boot/common/util.h >> U sys/boot/efi/libefi/efinet.c >> U sys/boot/efi/libefi/efipart.c >> U sys/boot/efi/loader/main.c >> U sys/boot/i386/libfirewire/firewire.c >> U sys/boot/i386/libi386/bioscd.c >> U sys/boot/i386/libi386/biosdisk.c >> U sys/boot/mips/beri/loader/beri_disk_cfi.c >> U sys/boot/mips/beri/loader/beri_disk_sdcard.c >> U sys/boot/ofw/libofw/ofw_disk.c >> U sys/boot/pc98/libpc98/bioscd.c >> U sys/boot/pc98/libpc98/biosdisk.c >> U sys/boot/powerpc/kboot/hostdisk.c >> U sys/boot/powerpc/ps3/ps3cdrom.c >> U sys/boot/powerpc/ps3/ps3disk.c >> U sys/boot/uboot/lib/disk.c >> U sys/boot/usb/storage/umass_loader.c >> U sys/boot/userboot/userboot/host.c >> U sys/boot/userboot/userboot/userboot_disk.c >> U sys/boot/zfs/zfs.c >> U sys/boot/zfs/zfsimpl.c >> U sys/boot/i386/libi386/pxe.c >> Updated to revision 308434. >> root@current:/usr/src # cd sys/boot/ >> root@current:/usr/src/sys/boot # make clean >> (...) >> root@current:/usr/src/sys/boot # make obj >> (...) >> root@current:/usr/src/sys/boot # make >> (...) >> cc -O2 -pipe -DSKEIN_LOOP=3D111 -fPIC -I/usr/src/sys/boot/efi/loader >> -I/usr/src/sys/boot/efi/loader/arch/amd64 >> -I/usr/src/sys/boot/efi/loader/../include >> -I/usr/src/sys/boot/efi/loader/../include/amd64 >> -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include >> -I/usr/src/sys/boot/efi/loader/../../.. >> -I/usr/src/sys/boot/efi/loader/../../i386/libi386 >> -I/usr/src/sys/boot/efi/loader/../../zfs >> -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs >> -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT -DNO= _PCI >> -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH >> -I/usr/src/sys/boot/efi/loader/../../ficl >> -I/usr/src/sys/boot/efi/loader/../../ficl/amd64 -DLOADER_DISK_SUPPORT >> -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC -I/usr/src/sys/boot/ficl >> -I/usr/src/sys/boot/ficl/amd64 -I/usr/src/sys/boot/ficl/../common >> -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat >> -msoft-float -mno-mmx -mno-sse -mno-avx -fshort-wchar -mno-red-zone -mno= -aes >> -g -MD -MF.depend.vers.o -MTvers.o -std=3Dgnu99 -Wsystem-headers -Werro= r >> -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes >> -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sig= n >> -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable >> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality >> -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef >> -Qunused-arguments -c vers.c -o vers.o >> cc -O2 -pipe -DSKEIN_LOOP=3D111 -fPIC -I/usr/src/sys/boot/efi/loader >> -I/usr/src/sys/boot/efi/loader/arch/amd64 >> -I/usr/src/sys/boot/efi/loader/../include >> -I/usr/src/sys/boot/efi/loader/../include/amd64 >> -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include >> -I/usr/src/sys/boot/efi/loader/../../.. >> -I/usr/src/sys/boot/efi/loader/../../i386/libi386 >> -I/usr/src/sys/boot/efi/loader/../../zfs >> -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs >> -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT -DNO= _PCI >> -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH >> -I/usr/src/sys/boot/efi/loader/../../ficl >> -I/usr/src/sys/boot/efi/loader/../../ficl/amd64 -DLOADER_DISK_SUPPORT >> -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC -I/usr/src/sys/boot/ficl >> -I/usr/src/sys/boot/ficl/amd64 -I/usr/src/sys/boot/ficl/../common >> -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat >> -msoft-float -mno-mmx -mno-sse -mno-avx -fshort-wchar -mno-red-zone -mno= -aes >> -g -MD -MF.depend.zfs.o -MTzfs.o -std=3Dgnu99 -Wsystem-headers -Werror = -Wall >> -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes >> -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sig= n >> -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable >> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality >> -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef >> -Wno-sign-compare -Wno-array-bounds -Wno-missing-prototypes >> -Qunused-arguments -c /usr/src/sys/boot/efi/loader/../../zfs/zfs.c -o z= fs.o >> /usr/src/sys/boot/efi/loader/../../zfs/zfs.c:599:14: error: incompatible >> pointer types initializing 'void (*)(int)' with an expression of type 'i= nt >> (int)' [-Werror,-Wincompatible-pointer-types] >> .dv_print =3D zfs_dev_print, >> ^~~~~~~~~~~~~ >> 1 error generated. >> *** Error code 1 >> >> Stop. >> make[2]: stopped in /usr/src/sys/boot/efi/loader >> *** Error code 1 >> >> Stop. >> make[1]: stopped in /usr/src/sys/boot/efi >> *** Error code 1 >> >> Stop. >> make: stopped in /usr/src/sys/boot >> >> >> Kamil >> >> 2016-11-08 7:50 GMT+01:00 Toomas Soome : >>> >>> Author: tsoome >>> Date: Tue Nov 8 06:50:18 2016 >>> New Revision: 308434 >>> URL: https://svnweb.freebsd.org/changeset/base/308434 >>> >>> Log: >>> Loader paged/pageable data is not always paged. >>> >>> This change does modify devsw dv_print() to return the int value, >>> enabling walkers to interrupt the walk on non zero value from >>> dv_print(). >>> >>> This will allow the pager_print actually to stop displaying data on >>> user input, and additionally pager is used in various *dev_print >>> callbacks, >>> where it was missing. >>> >>> For test, lsdev [-v] command should display data by screenfuls and >>> should >>> stop when the key 'q' is pressed on pager prompt. >>> >>> Reviewed by: allanjude >>> Approved by: allanjude (mentor) >>> Differential Revision: https://reviews.freebsd.org/D5461 >>> >>> Modified: >>> head/lib/libstand/stand.h >>> head/sys/boot/common/dev_net.c >>> head/sys/boot/common/module.c >>> head/sys/boot/common/part.c >>> head/sys/boot/common/util.c >>> head/sys/boot/common/util.h >>> head/sys/boot/efi/libefi/efinet.c >>> head/sys/boot/efi/libefi/efipart.c >>> head/sys/boot/efi/loader/main.c >>> head/sys/boot/i386/libfirewire/firewire.c >>> head/sys/boot/i386/libi386/bioscd.c >>> head/sys/boot/i386/libi386/biosdisk.c >>> head/sys/boot/i386/libi386/pxe.c >>> head/sys/boot/mips/beri/loader/beri_disk_cfi.c >>> head/sys/boot/mips/beri/loader/beri_disk_sdcard.c >>> head/sys/boot/ofw/libofw/ofw_disk.c >>> head/sys/boot/pc98/libpc98/bioscd.c >>> head/sys/boot/pc98/libpc98/biosdisk.c >>> head/sys/boot/powerpc/kboot/hostdisk.c >>> head/sys/boot/powerpc/ps3/ps3cdrom.c >>> head/sys/boot/powerpc/ps3/ps3disk.c >>> head/sys/boot/uboot/lib/disk.c >>> head/sys/boot/usb/storage/umass_loader.c >>> head/sys/boot/userboot/userboot/host.c >>> head/sys/boot/userboot/userboot/userboot_disk.c >>> head/sys/boot/zfs/zfs.c >>> head/sys/boot/zfs/zfsimpl.c >>> >>> Modified: head/lib/libstand/stand.h >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/lib/libstand/stand.h Tue Nov 8 06:13:22 2016 (r30843= 3) >>> +++ head/lib/libstand/stand.h Tue Nov 8 06:50:18 2016 (r30843= 4) >>> @@ -143,7 +143,7 @@ struct devsw { >>> int (*dv_open)(struct open_file *f, ...); >>> int (*dv_close)(struct open_file *f); >>> int (*dv_ioctl)(struct open_file *f, u_long cmd, vo= id >>> *data); >>> - void (*dv_print)(int verbose); /* print device >>> information */ >>> + int (*dv_print)(int verbose); /* print device >>> information */ >>> void (*dv_cleanup)(void); >>> }; >>> >>> >>> Modified: head/sys/boot/common/dev_net.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/common/dev_net.c Tue Nov 8 06:13:22 2016 >>> (r308433) >>> +++ head/sys/boot/common/dev_net.c Tue Nov 8 06:50:18 2016 >>> (r308434) >>> @@ -80,7 +80,7 @@ static int net_open(struct open_file *, >>> static int net_close(struct open_file *); >>> static void net_cleanup(void); >>> static int net_strategy(); >>> -static void net_print(int); >>> +static int net_print(int); >>> >>> static int net_getparams(int sock); >>> >>> @@ -325,23 +325,27 @@ exit: >>> return (0); >>> } >>> >>> -static void >>> +static int >>> net_print(int verbose) >>> { >>> struct netif_driver *drv; >>> int i, d, cnt; >>> + int ret =3D 0; >>> >>> cnt =3D 0; >>> for (d =3D 0; netif_drivers[d]; d++) { >>> drv =3D netif_drivers[d]; >>> for (i =3D 0; i < drv->netif_nifs; i++) { >>> printf("\t%s%d:", "net", cnt++); >>> - if (verbose) >>> + if (verbose) { >>> printf(" (%s%d)", drv->netif_bname, >>> drv->netif_ifs[i].dif_unit); >>> + } >>> + if ((ret =3D pager_output("\n")) !=3D 0) >>> + return (ret); >>> } >>> } >>> - printf("\n"); >>> + return (ret); >>> } >>> >>> /* >>> >>> Modified: head/sys/boot/common/module.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/common/module.c Tue Nov 8 06:13:22 2016 >>> (r308433) >>> +++ head/sys/boot/common/module.c Tue Nov 8 06:50:18 2016 >>> (r308434) >>> @@ -254,7 +254,7 @@ command_lsmod(int argc, char *argv[]) >>> struct kernel_module *mp; >>> struct file_metadata *md; >>> char lbuf[80]; >>> - int ch, verbose; >>> + int ch, verbose, ret =3D 0; >>> >>> verbose =3D 0; >>> optind =3D 1; >>> @@ -273,11 +273,13 @@ command_lsmod(int argc, char *argv[]) >>> >>> pager_open(); >>> for (fp =3D preloaded_files; fp; fp =3D fp->f_next) { >>> - sprintf(lbuf, " %p: ", (void *) fp->f_addr); >>> + snprintf(lbuf, sizeof(lbuf), " %p: ", (void *) fp->f_addr); >>> pager_output(lbuf); >>> pager_output(fp->f_name); >>> - sprintf(lbuf, " (%s, 0x%lx)\n", fp->f_type, (long)fp->f_size); >>> - pager_output(lbuf); >>> + snprintf(lbuf, sizeof(lbuf), " (%s, 0x%lx)\n", fp->f_type, >>> + (long)fp->f_size); >>> + if (pager_output(lbuf)) >>> + break; >>> if (fp->f_args !=3D NULL) { >>> pager_output(" args: "); >>> pager_output(fp->f_args); >>> @@ -287,7 +289,8 @@ command_lsmod(int argc, char *argv[]) >>> if (fp->f_modules) { >>> pager_output(" modules: "); >>> for (mp =3D fp->f_modules; mp; mp =3D mp->m_next) { >>> - sprintf(lbuf, "%s.%d ", mp->m_name, mp->m_version); >>> + snprintf(lbuf, sizeof(lbuf), "%s.%d ", mp->m_name, >>> + mp->m_version); >>> pager_output(lbuf); >>> } >>> if (pager_output("\n")) >>> @@ -296,11 +299,14 @@ command_lsmod(int argc, char *argv[]) >>> if (verbose) { >>> /* XXX could add some formatting smarts here to display som= e >>> better */ >>> for (md =3D fp->f_metadata; md !=3D NULL; md =3D md->md_nex= t) { >>> - sprintf(lbuf, " 0x%04x, 0x%lx\n", md->md_type, >>> (long) md->md_size); >>> + snprintf(lbuf, sizeof(lbuf), " 0x%04x, 0x%lx\n", >>> + md->md_type, (long) md->md_size); >>> if (pager_output(lbuf)) >>> break; >>> } >>> } >>> + if (ret) >>> + break; >>> } >>> pager_close(); >>> return(CMD_OK); >>> >>> Modified: head/sys/boot/common/part.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/common/part.c Tue Nov 8 06:13:22 2016 (r30843= 3) >>> +++ head/sys/boot/common/part.c Tue Nov 8 06:50:18 2016 (r30843= 4) >>> @@ -834,6 +834,7 @@ ptable_iterate(const struct ptable *tabl >>> { >>> struct pentry *entry; >>> char name[32]; >>> + int ret =3D 0; >>> >>> name[0] =3D '\0'; >>> STAILQ_FOREACH(entry, &table->entries, entry) { >>> @@ -856,9 +857,8 @@ ptable_iterate(const struct ptable *tabl >>> if (table->type =3D=3D PTABLE_BSD) >>> sprintf(name, "%c", (u_char) 'a' + >>> entry->part.index); >>> - if (iter(arg, name, &entry->part)) >>> - return 1; >>> + if ((ret =3D iter(arg, name, &entry->part)) !=3D 0) >>> + return (ret); >>> } >>> - return 0; >>> + return (ret); >>> } >>> - >>> >>> Modified: head/sys/boot/common/util.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/common/util.c Tue Nov 8 06:13:22 2016 (r30843= 3) >>> +++ head/sys/boot/common/util.c Tue Nov 8 06:50:18 2016 (r30843= 4) >>> @@ -114,7 +114,7 @@ strlen(const char *s) >>> return (len); >>> } >>> >>> -void >>> +int >>> printf(const char *fmt, ...) >>> { >>> va_list ap; >>> @@ -178,4 +178,5 @@ nextfmt: >>> } >>> } >>> va_end(ap); >>> + return (0); >>> } >>> >>> Modified: head/sys/boot/common/util.h >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/common/util.h Tue Nov 8 06:13:22 2016 (r30843= 3) >>> +++ head/sys/boot/common/util.h Tue Nov 8 06:50:18 2016 (r30843= 4) >>> @@ -48,6 +48,6 @@ void strcat(char *dst, const char *src); >>> char *strchr(const char *s, char ch); >>> size_t strlen(const char *s); >>> >>> -void printf(const char *fmt, ...); >>> +int printf(const char *fmt, ...); >>> >>> #endif /* !_UTIL_H_ */ >>> >>> Modified: head/sys/boot/efi/libefi/efinet.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:13:22 2016 >>> (r308433) >>> +++ head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:50:18 2016 >>> (r308434) >>> @@ -252,7 +252,7 @@ efinet_end(struct netif *nif) >>> } >>> >>> static int efinet_dev_init(void); >>> -static void efinet_dev_print(int); >>> +static int efinet_dev_print(int); >>> >>> struct devsw efinet_dev =3D { >>> .dv_name =3D "net", >>> @@ -346,14 +346,13 @@ efinet_dev_init() >>> return (0); >>> } >>> >>> -static void >>> +static int >>> efinet_dev_print(int verbose) >>> { >>> CHAR16 *text; >>> EFI_HANDLE h; >>> - int unit; >>> + int unit, ret =3D 0; >>> >>> - pager_open(); >>> for (unit =3D 0, h =3D efi_find_handle(&efinet_dev, 0); >>> h !=3D NULL; h =3D efi_find_handle(&efinet_dev, ++unit)) { >>> printf(" %s%d:", efinet_dev.dv_name, unit); >>> @@ -364,8 +363,8 @@ efinet_dev_print(int verbose) >>> efi_free_devpath_name(text); >>> } >>> } >>> - if (pager_output("\n")) >>> + if ((ret =3D pager_output("\n")) !=3D 0) >>> break; >>> } >>> - pager_close(); >>> + return (ret); >>> } >>> >>> Modified: head/sys/boot/efi/libefi/efipart.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:13:22 2016 >>> (r308433) >>> +++ head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:50:18 2016 >>> (r308434) >>> @@ -47,7 +47,7 @@ static int efipart_realstrategy(void *, >>> size_t *); >>> static int efipart_open(struct open_file *, ...); >>> static int efipart_close(struct open_file *); >>> -static void efipart_print(int); >>> +static int efipart_print(int); >>> >>> struct devsw efipart_dev =3D { >>> .dv_name =3D "part", >>> @@ -162,7 +162,7 @@ efipart_init(void) >>> return (err); >>> } >>> >>> -static void >>> +static int >>> efipart_print(int verbose) >>> { >>> char line[80]; >>> @@ -170,28 +170,29 @@ efipart_print(int verbose) >>> EFI_HANDLE h; >>> EFI_STATUS status; >>> u_int unit; >>> + int ret =3D 0; >>> >>> - pager_open(); >>> for (unit =3D 0, h =3D efi_find_handle(&efipart_dev, 0); >>> h !=3D NULL; h =3D efi_find_handle(&efipart_dev, ++unit)) { >>> - sprintf(line, " %s%d:", efipart_dev.dv_name, unit); >>> - if (pager_output(line)) >>> + snprintf(line, sizeof(line), " %s%d:", >>> + efipart_dev.dv_name, unit); >>> + if ((ret =3D pager_output(line)) !=3D 0) >>> break; >>> >>> status =3D BS->HandleProtocol(h, &blkio_guid, (void >>> **)&blkio); >>> if (!EFI_ERROR(status)) { >>> - sprintf(line, " %llu blocks", >>> + snprintf(line, sizeof(line), " %llu blocks", >>> (unsigned long long)(blkio->Media->LastBloc= k >>> + 1)); >>> - if (pager_output(line)) >>> + if ((ret =3D pager_output(line)) !=3D 0) >>> break; >>> if (blkio->Media->RemovableMedia) >>> - if (pager_output(" (removable)")) >>> + if ((ret =3D pager_output(" (removable)= ")) >>> !=3D 0) >>> break; >>> } >>> - if (pager_output("\n")) >>> + if ((ret =3D pager_output("\n")) !=3D 0) >>> break; >>> } >>> - pager_close(); >>> + return (ret); >>> } >>> >>> static int >>> >>> Modified: head/sys/boot/efi/loader/main.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/efi/loader/main.c Tue Nov 8 06:13:22 2016 >>> (r308433) >>> +++ head/sys/boot/efi/loader/main.c Tue Nov 8 06:50:18 2016 >>> (r308434) >>> @@ -533,6 +533,7 @@ command_memmap(int argc, char *argv[]) >>> UINT32 dver; >>> EFI_STATUS status; >>> int i, ndesc; >>> + char line[80]; >>> static char *types[] =3D { >>> "Reserved", >>> "LoaderCode", >>> @@ -564,14 +565,19 @@ command_memmap(int argc, char *argv[]) >>> } >>> >>> ndesc =3D sz / dsz; >>> - printf("%23s %12s %12s %8s %4s\n", >>> + snprintf(line, sizeof(line), "%23s %12s %12s %8s %4s\n", >>> "Type", "Physical", "Virtual", "#Pages", "Attr"); >>> + pager_open(); >>> + if (pager_output(line)) { >>> + pager_close(); >>> + return (CMD_OK); >>> + } >>> >>> for (i =3D 0, p =3D map; i < ndesc; >>> i++, p =3D NextMemoryDescriptor(p, dsz)) { >>> printf("%23s %012jx %012jx %08jx ", types[p->Type], >>> - (uintmax_t)p->PhysicalStart, >>> (uintmax_t)p->VirtualStart, >>> - (uintmax_t)p->NumberOfPages); >>> + (uintmax_t)p->PhysicalStart, >>> (uintmax_t)p->VirtualStart, >>> + (uintmax_t)p->NumberOfPages); >>> if (p->Attribute & EFI_MEMORY_UC) >>> printf("UC "); >>> if (p->Attribute & EFI_MEMORY_WC) >>> @@ -588,9 +594,11 @@ command_memmap(int argc, char *argv[]) >>> printf("RP "); >>> if (p->Attribute & EFI_MEMORY_XP) >>> printf("XP "); >>> - printf("\n"); >>> + if (pager_output("\n")) >>> + break; >>> } >>> >>> + pager_close(); >>> return (CMD_OK); >>> } >>> >>> @@ -612,10 +620,17 @@ guid_to_string(EFI_GUID *guid) >>> static int >>> command_configuration(int argc, char *argv[]) >>> { >>> + char line[80]; >>> UINTN i; >>> >>> - printf("NumberOfTableEntries=3D%lu\n", >>> + snprintf(line, sizeof(line), "NumberOfTableEntries=3D%lu\n", >>> (unsigned long)ST->NumberOfTableEntries); >>> + pager_open(); >>> + if (pager_output(line)) { >>> + pager_close(); >>> + return (CMD_OK); >>> + } >>> + >>> for (i =3D 0; i < ST->NumberOfTableEntries; i++) { >>> EFI_GUID *guid; >>> >>> @@ -642,9 +657,13 @@ command_configuration(int argc, char *ar >>> printf("FDT Table"); >>> else >>> printf("Unknown Table (%s)", >>> guid_to_string(guid)); >>> - printf(" at %p\n", >>> ST->ConfigurationTable[i].VendorTable); >>> + snprintf(line, sizeof(line), " at %p\n", >>> + ST->ConfigurationTable[i].VendorTable); >>> + if (pager_output(line)) >>> + break; >>> } >>> >>> + pager_close(); >>> return (CMD_OK); >>> } >>> >>> >>> Modified: head/sys/boot/i386/libfirewire/firewire.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:13:22 201= 6 >>> (r308433) >>> +++ head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:50:18 201= 6 >>> (r308434) >>> @@ -69,7 +69,7 @@ static int fw_strategy(void *devdata, in >>> size_t offset, size_t size, char *buf, size_t >>> *rsize); >>> static int fw_open(struct open_file *f, ...); >>> static int fw_close(struct open_file *f); >>> -static void fw_print(int verbose); >>> +static int fw_print(int verbose); >>> static void fw_cleanup(void); >>> >>> void fw_enable(void); >>> @@ -148,21 +148,26 @@ fw_init(void) >>> /* >>> * Print information about OHCI chips >>> */ >>> -static void >>> +static int >>> fw_print(int verbose) >>> { >>> - int i; >>> + char line[80]; >>> + int i, ret =3D 0; >>> struct fwohci_softc *sc; >>> >>> for (i =3D 0; i < MAX_OHCI; i ++) { >>> sc =3D &fwinfo[i]; >>> if (sc->state =3D=3D FWOHCI_STATE_DEAD) >>> break; >>> - printf("%d: locator=3D0x%04x devid=3D0x%08x" >>> + snprintf(line, sizeof(line), "%d: locator=3D0x%04x >>> devid=3D0x%08x" >>> " base_addr=3D0x%08x handle=3D0x%08x >>> bus_id=3D0x%08x\n", >>> i, sc->locator, sc->devid, >>> sc->base_addr, sc->handle, sc->bus_id); >>> + ret =3D pager_output(line); >>> + if (ret !=3D 0) >>> + break; >>> } >>> + return (ret); >>> } >>> >>> static int >>> >>> Modified: head/sys/boot/i386/libi386/bioscd.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:13:22 2016 >>> (r308433) >>> +++ head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:50:18 2016 >>> (r308434) >>> @@ -100,7 +100,7 @@ static int bc_realstrategy(void *devdata >>> size_t offset, size_t size, char *buf, size_t *rsize); >>> static int bc_open(struct open_file *f, ...); >>> static int bc_close(struct open_file *f); >>> -static void bc_print(int verbose); >>> +static int bc_print(int verbose); >>> >>> struct devsw bioscd =3D { >>> "cd", >>> @@ -177,20 +177,19 @@ bc_add(int biosdev) >>> /* >>> * Print information about disks >>> */ >>> -static void >>> +static int >>> bc_print(int verbose) >>> { >>> char line[80]; >>> - int i; >>> + int i, ret =3D 0; >>> >>> - pager_open(); >>> for (i =3D 0; i < nbcinfo; i++) { >>> - sprintf(line, " cd%d: Device 0x%x\n", i, >>> + snprintf(line, sizeof(line), " cd%d: Device 0x%x\n", >>> i, >>> bcinfo[i].bc_sp.sp_devicespec); >>> - if (pager_output(line)) >>> + if ((ret =3D pager_output(line)) !=3D 0) >>> break; >>> } >>> - pager_close(); >>> + return (ret); >>> } >>> >>> /* >>> >>> Modified: head/sys/boot/i386/libi386/biosdisk.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:13:22 201= 6 >>> (r308433) >>> +++ head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:50:18 201= 6 >>> (r308434) >>> @@ -135,7 +135,7 @@ static int bd_realstrategy(void *devdata >>> static int bd_open(struct open_file *f, ...); >>> static int bd_close(struct open_file *f); >>> static int bd_ioctl(struct open_file *f, u_long cmd, void *data); >>> -static void bd_print(int verbose); >>> +static int bd_print(int verbose); >>> static void bd_cleanup(void); >>> >>> #ifdef LOADER_GELI_SUPPORT >>> @@ -321,21 +321,21 @@ bd_int13probe(struct bdinfo *bd) >>> /* >>> * Print information about disks >>> */ >>> -static void >>> +static int >>> bd_print(int verbose) >>> { >>> static char line[80]; >>> struct disk_devdesc dev; >>> - int i; >>> + int i, ret =3D 0; >>> >>> - pager_open(); >>> for (i =3D 0; i < nbdinfo; i++) { >>> - sprintf(line, " disk%d: BIOS drive %c (%ju X >>> %u):\n", i, >>> + snprintf(line, sizeof(line), >>> + " disk%d: BIOS drive %c (%ju X %u):\n", i, >>> (bdinfo[i].bd_unit < 0x80) ? ('A' + >>> bdinfo[i].bd_unit): >>> ('C' + bdinfo[i].bd_unit - 0x80), >>> (uintmax_t)bdinfo[i].bd_sectors, >>> bdinfo[i].bd_sectorsize); >>> - if (pager_output(line)) >>> + if ((ret =3D pager_output(line)) !=3D 0) >>> break; >>> dev.d_dev =3D &biosdisk; >>> dev.d_unit =3D i; >>> @@ -346,12 +346,14 @@ bd_print(int verbose) >>> bdinfo[i].bd_sectorsize, >>> (bdinfo[i].bd_flags & BD_FLOPPY) ? >>> DISK_F_NOCACHE: 0) =3D=3D 0) { >>> - sprintf(line, " disk%d", i); >>> - disk_print(&dev, line, verbose); >>> + snprintf(line, sizeof(line), " disk%d", i); >>> + ret =3D disk_print(&dev, line, verbose); >>> disk_close(&dev); >>> + if (ret !=3D 0) >>> + return (ret); >>> } >>> } >>> - pager_close(); >>> + return (ret); >>> } >>> >>> /* >>> >>> Modified: head/sys/boot/i386/libi386/pxe.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:13:22 2016 >>> (r308433) >>> +++ head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:50:18 2016 >>> (r308434) >>> @@ -75,7 +75,7 @@ static int pxe_strategy(void *devdata, i >>> size_t offset, size_t size, char *buf, >>> size_t *rsize); >>> static int pxe_open(struct open_file *f, ...); >>> static int pxe_close(struct open_file *f); >>> -static void pxe_print(int verbose); >>> +static int pxe_print(int verbose); >>> static void pxe_cleanup(void); >>> static void pxe_setnfshandle(char *rootpath); >>> >>> @@ -381,14 +381,20 @@ pxe_close(struct open_file *f) >>> return (0); >>> } >>> >>> -static void >>> +static int >>> pxe_print(int verbose) >>> { >>> - >>> + char line[255]; >>> if (pxe_call =3D=3D NULL) >>> - return; >>> + return (0); >>> >>> - printf(" pxe0: %s:%s\n", inet_ntoa(rootip), rootpath); >>> + if (verbose) { >>> + snprintf(line, sizeof(line), " pxe0: %s:%s\n", >>> + inet_ntoa(rootip), rootpath); >>> + } else { >>> + snprintf(line, sizeof(line), " pxe0:\n"); >>> + } >>> + return (pager_output(line)); >>> } >>> >>> static void >>> >>> Modified: head/sys/boot/mips/beri/loader/beri_disk_cfi.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 >>> 06:13:22 2016 (r308433) >>> +++ head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 >>> 06:50:18 2016 (r308434) >>> @@ -47,7 +47,7 @@ static int beri_cfi_disk_close(struct op >>> static void beri_cfi_disk_cleanup(void); >>> static int beri_cfi_disk_strategy(void *, int, daddr_t, size_t, >>> size_t, >>> char *, size_t *); >>> -static void beri_cfi_disk_print(int); >>> +static int beri_cfi_disk_print(int); >>> >>> struct devsw beri_cfi_disk =3D { >>> .dv_name =3D "cfi", >>> @@ -112,25 +112,29 @@ beri_cfi_disk_close(struct open_file *f) >>> return (disk_close(dev)); >>> } >>> >>> -static void >>> +static int >>> beri_cfi_disk_print(int verbose) >>> { >>> struct disk_devdesc dev; >>> char line[80]; >>> + int ret; >>> >>> - sprintf(line, " cfi%d CFI flash device\n", 0); >>> - pager_output(line); >>> + snprintf(line, sizeof(line), " cfi%d CFI flash device\n", >>> 0); >>> + ret =3D pager_output(line); >>> + if (ret !=3D 0) >>> + return (ret); >>> dev.d_dev =3D &beri_cfi_disk; >>> dev.d_unit =3D 0; >>> dev.d_slice =3D -1; >>> dev.d_partition =3D -1; >>> if (disk_open(&dev, cfi_get_mediasize(), >>> cfi_get_sectorsize(), 0) =3D=3D 0) { >>> - sprintf(line, " cfi%d", 0); >>> - disk_print(&dev, line, verbose); >>> + snprintf(line, sizeof(line), " cfi%d", 0); >>> + ret =3D disk_print(&dev, line, verbose); >>> disk_close(&dev); >>> } >>> >>> + return (ret); >>> } >>> >>> static void >>> >>> Modified: head/sys/boot/mips/beri/loader/beri_disk_sdcard.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 >>> 06:13:22 2016 (r308433) >>> +++ head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 >>> 06:50:18 2016 (r308434) >>> @@ -47,7 +47,7 @@ static int beri_sdcard_disk_close(struct >>> static void beri_sdcard_disk_cleanup(void); >>> static int beri_sdcard_disk_strategy(void *, int, daddr_t, size_t, >>> size_t, >>> char *, size_t *); >>> -static void beri_sdcard_disk_print(int); >>> +static int beri_sdcard_disk_print(int); >>> >>> struct devsw beri_sdcard_disk =3D { >>> .dv_name =3D "sdcard", >>> @@ -123,19 +123,23 @@ beri_sdcard_disk_print(int verbose) >>> { >>> struct disk_devdesc dev; >>> char line[80]; >>> + int ret; >>> >>> - sprintf(line, " sdcard%d Altera SD card drive\n", 0); >>> - pager_output(line); >>> + snprintf(line, sizeof(line), " sdcard%d Altera SD card >>> drive\n", 0); >>> + ret =3D pager_output(line); >>> + if (ret !=3D 0) >>> + return (ret); >>> dev.d_dev =3D &beri_sdcard_disk; >>> dev.d_unit =3D 0; >>> dev.d_slice =3D -1; >>> dev.d_partition =3D -1; >>> if (disk_open(&dev, altera_sdcard_get_mediasize(), >>> altera_sdcard_get_sectorsize(), 0) =3D=3D 0) { >>> - sprintf(line, " sdcard%d", 0); >>> - disk_print(&dev, line, verbose); >>> + snprintf(line, sizeof(line), " sdcard%d", 0); >>> + ret =3D disk_print(&dev, line, verbose); >>> disk_close(&dev); >>> } >>> + return (ret); >>> } >>> >>> static void >>> >>> Modified: head/sys/boot/ofw/libofw/ofw_disk.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:13:22 2016 >>> (r308433) >>> +++ head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:50:18 2016 >>> (r308434) >>> @@ -47,7 +47,7 @@ static int ofwd_strategy(void *devdata, >>> static int ofwd_open(struct open_file *f, ...); >>> static int ofwd_close(struct open_file *f); >>> static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data)= ; >>> -static void ofwd_print(int verbose); >>> +static int ofwd_print(int verbose); >>> >>> struct devsw ofwdisk =3D { >>> "block", >>> @@ -161,8 +161,8 @@ ofwd_ioctl(struct open_file *f __unused, >>> return (EINVAL); >>> } >>> >>> -static void >>> +static int >>> ofwd_print(int verbose __unused) >>> { >>> - >>> + return (0); >>> } >>> >>> Modified: head/sys/boot/pc98/libpc98/bioscd.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:13:22 2016 >>> (r308433) >>> +++ head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:50:18 2016 >>> (r308434) >>> @@ -99,7 +99,7 @@ static int bc_realstrategy(void *devdata >>> size_t offset, size_t size, char *buf, size_t >>> *rsize); >>> static int bc_open(struct open_file *f, ...); >>> static int bc_close(struct open_file *f); >>> -static void bc_print(int verbose); >>> +static int bc_print(int verbose); >>> >>> struct devsw bioscd =3D { >>> "cd", >>> @@ -173,20 +173,19 @@ bc_add(int biosdev) >>> /* >>> * Print information about disks >>> */ >>> -static void >>> +static int >>> bc_print(int verbose) >>> { >>> char line[80]; >>> - int i; >>> + int i, ret =3D 0; >>> >>> - pager_open(); >>> for (i =3D 0; i < nbcinfo; i++) { >>> sprintf(line, " cd%d: Device 0x%x\n", i, >>> bcinfo[i].bc_sp.sp_devicespec); >>> - if (pager_output(line)) >>> + if ((ret =3D pager_output(line)) !=3D 0) >>> break; >>> } >>> - pager_close(); >>> + return (ret); >>> } >>> >>> /* >>> >>> Modified: head/sys/boot/pc98/libpc98/biosdisk.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:13:22 201= 6 >>> (r308433) >>> +++ head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:50:18 201= 6 >>> (r308434) >>> @@ -123,7 +123,7 @@ static int bd_realstrategy(void *devdata >>> size_t offset, size_t size, char *buf, size_t >>> *rsize); >>> static int bd_open(struct open_file *f, ...); >>> static int bd_close(struct open_file *f); >>> -static void bd_print(int verbose); >>> +static int bd_print(int verbose); >>> >>> struct devsw biosdisk =3D { >>> "disk", >>> @@ -249,21 +249,20 @@ bd_int13probe(struct bdinfo *bd) >>> /* >>> * Print information about disks >>> */ >>> -static void >>> +static int >>> bd_print(int verbose) >>> { >>> - int i, j, done; >>> + int i, j, ret =3D 0; >>> char line[80]; >>> struct i386_devdesc dev; >>> struct open_disk *od; >>> struct pc98_partition *dptr; >>> >>> - pager_open(); >>> - done =3D 0; >>> - for (i =3D 0; i < nbdinfo && !done; i++) { >>> - sprintf(line, " disk%d: BIOS drive %c:\n", i, 'A' + i); >>> - if (pager_output(line)) >>> - break; >>> + for (i =3D 0; i < nbdinfo; i++) { >>> + snprintf(line, sizeof(line), " disk%d: BIOS drive %c:\n", >>> + i, 'A' + i); >>> + if ((ret =3D pager_output(line)) !=3D 0) >>> + break; >>> >>> /* try to open the whole disk */ >>> dev.d_unit =3D i; >>> @@ -278,17 +277,17 @@ bd_print(int verbose) >>> >>> /* Check for a "dedicated" disk */ >>> for (j =3D 0; j < od->od_nslices; j++) { >>> - sprintf(line, " disk%ds%d", i, j + 1); >>> - if (bd_printslice(od, &dptr[j], line, verbose)) { >>> - done =3D 1; >>> - break; >>> - } >>> + snprintf(line, sizeof(line), " disk%ds%d", i, = j >>> + 1); >>> + if ((ret =3D bd_printslice(od, &dptr[j], line, >>> verbose)) !=3D 0) >>> + break; >>> } >>> } >>> bd_closedisk(od); >>> + if (ret !=3D 0) >>> + break; >>> } >>> } >>> - pager_close(); >>> + return (ret); >>> } >>> >>> /* Given a size in 512 byte sectors, convert it to a human-readable >>> number. */ >>> >>> Modified: head/sys/boot/powerpc/kboot/hostdisk.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:13:22 201= 6 >>> (r308433) >>> +++ head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:50:18 201= 6 >>> (r308434) >>> @@ -37,7 +37,7 @@ static int hostdisk_strategy(void *devda >>> static int hostdisk_open(struct open_file *f, ...); >>> static int hostdisk_close(struct open_file *f); >>> static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data)= ; >>> -static void hostdisk_print(int verbose); >>> +static int hostdisk_print(int verbose); >>> >>> struct devsw hostdisk =3D { >>> "/dev", >>> @@ -117,9 +117,9 @@ hostdisk_ioctl(struct open_file *f, u_lo >>> return (EINVAL); >>> } >>> >>> -static void >>> +static int >>> hostdisk_print(int verbose) >>> { >>> - >>> + return (0); >>> } >>> >>> >>> Modified: head/sys/boot/powerpc/ps3/ps3cdrom.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:13:22 201= 6 >>> (r308433) >>> +++ head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:50:18 201= 6 >>> (r308434) >>> @@ -49,7 +49,7 @@ static int ps3cdrom_strategy(void *devda >>> size_t offset, size_t size, char *buf, size_t *rsize); >>> static int ps3cdrom_open(struct open_file *f, ...); >>> static int ps3cdrom_close(struct open_file *f); >>> -static void ps3cdrom_print(int verbose); >>> +static int ps3cdrom_print(int verbose); >>> >>> struct devsw ps3cdrom =3D { >>> "cd", >>> @@ -149,6 +149,7 @@ static int ps3cdrom_close(struct open_fi >>> return 0; >>> } >>> >>> -static void ps3cdrom_print(int verbose) >>> +static int ps3cdrom_print(int verbose) >>> { >>> + return (0); >>> } >>> >>> Modified: head/sys/boot/powerpc/ps3/ps3disk.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:13:22 2016 >>> (r308433) >>> +++ head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:50:18 2016 >>> (r308434) >>> @@ -61,7 +61,7 @@ static int ps3disk_strategy(void *devdat >>> size_t offset, size_t size, char *buf, size_t *rsize); >>> static int ps3disk_open(struct open_file *f, ...); >>> static int ps3disk_close(struct open_file *f); >>> -static void ps3disk_print(int verbose); >>> +static int ps3disk_print(int verbose); >>> >>> struct devsw ps3disk =3D { >>> "disk", >>> @@ -186,8 +186,9 @@ static int ps3disk_close(struct open_fil >>> return 0; >>> } >>> >>> -static void ps3disk_print(int verbose) >>> +static int ps3disk_print(int verbose) >>> { >>> + return (0); >>> } >>> >>> static int ps3disk_open_gpt(struct ps3_devdesc *dev, struct open_dev >>> *od) >>> >>> Modified: head/sys/boot/uboot/lib/disk.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:13:22 2016 >>> (r308433) >>> +++ head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:50:18 2016 >>> (r308434) >>> @@ -78,7 +78,7 @@ static int stor_strategy(void *, int, da >>> static int stor_open(struct open_file *, ...); >>> static int stor_close(struct open_file *); >>> static int stor_ioctl(struct open_file *f, u_long cmd, void *data); >>> -static void stor_print(int); >>> +static int stor_print(int); >>> static void stor_cleanup(void); >>> >>> struct devsw uboot_storage =3D { >>> @@ -238,30 +238,31 @@ stor_readdev(struct disk_devdesc *dev, d >>> return (err); >>> } >>> >>> -static void >>> +static int >>> stor_print(int verbose) >>> { >>> struct disk_devdesc dev; >>> static char line[80]; >>> - int i; >>> + int i, ret =3D 0; >>> >>> - pager_open(); >>> for (i =3D 0; i < stor_info_no; i++) { >>> dev.d_dev =3D &uboot_storage; >>> dev.d_unit =3D i; >>> dev.d_slice =3D -1; >>> dev.d_partition =3D -1; >>> - sprintf(line, "\tdisk%d (%s)\n", i, >>> + snprintf(line, sizeof(line), "\tdisk%d (%s)\n", i, >>> ub_stor_type(SI(&dev).type)); >>> - if (pager_output(line)) >>> + if ((ret =3D pager_output(line)) !=3D 0) >>> break; >>> if (stor_opendev(&dev) =3D=3D 0) { >>> sprintf(line, "\tdisk%d", i); >>> - disk_print(&dev, line, verbose); >>> + ret =3D disk_print(&dev, line, verbose); >>> disk_close(&dev); >>> + if (ret !=3D 0) >>> + break; >>> } >>> } >>> - pager_close(); >>> + return (ret); >>> } >>> >>> static int >>> >>> Modified: head/sys/boot/usb/storage/umass_loader.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:13:22 201= 6 >>> (r308433) >>> +++ head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:50:18 201= 6 >>> (r308434) >>> @@ -50,7 +50,7 @@ static void umass_disk_cleanup(void); >>> static int umass_disk_ioctl(struct open_file *, u_long, void *); >>> static int umass_disk_strategy(void *, int, daddr_t, size_t, size_t, >>> char *, >>> size_t *); >>> -static void umass_disk_print(int); >>> +static int umass_disk_print(int); >>> >>> struct devsw umass_disk =3D { >>> .dv_name =3D "umass", >>> @@ -170,23 +170,26 @@ umass_disk_close(struct open_file *f) >>> return (disk_close(dev)); >>> } >>> >>> -static void >>> +static int >>> umass_disk_print(int verbose) >>> { >>> struct disk_devdesc dev; >>> >>> memset(&dev, 0, sizeof(dev)); >>> >>> - pager_output(" umass0 UMASS device\n"); >>> + ret =3D pager_output(" umass0 UMASS device\n"); >>> + if (ret !=3D 0) >>> + return (ret); >>> dev.d_dev =3D &umass_disk; >>> dev.d_unit =3D 0; >>> dev.d_slice =3D -1; >>> dev.d_partition =3D -1; >>> >>> if (umass_disk_open_sub(&dev) =3D=3D 0) { >>> - disk_print(&dev, " umass0", verbose); >>> + ret =3D disk_print(&dev, " umass0", verbose); >>> disk_close(&dev); >>> } >>> + return (ret); >>> } >>> >>> static void >>> >>> Modified: head/sys/boot/userboot/userboot/host.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:13:22 201= 6 >>> (r308433) >>> +++ head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:50:18 201= 6 >>> (r308434) >>> @@ -134,13 +134,13 @@ host_dev_init(void) >>> return (0); >>> } >>> >>> -static void >>> +static int >>> host_dev_print(int verbose) >>> { >>> char line[80]; >>> >>> - sprintf(line, " host%d: Host filesystem\n", 0); >>> - pager_output(line); >>> + snprintf(line, sizeof(line), " host%d: Host filesystem\n", >>> 0); >>> + return (pager_output(line)); >>> } >>> >>> /* >>> >>> Modified: head/sys/boot/userboot/userboot/userboot_disk.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 >>> 06:13:22 2016 (r308433) >>> +++ head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 >>> 06:50:18 2016 (r308434) >>> @@ -60,7 +60,7 @@ static int userdisk_realstrategy(void *d >>> static int userdisk_open(struct open_file *f, ...); >>> static int userdisk_close(struct open_file *f); >>> static int userdisk_ioctl(struct open_file *f, u_long cmd, void >>> *data); >>> -static void userdisk_print(int verbose); >>> +static int userdisk_print(int verbose); >>> >>> struct devsw userboot_disk =3D { >>> "disk", >>> @@ -116,27 +116,33 @@ userdisk_cleanup(void) >>> /* >>> * Print information about disks >>> */ >>> -static void >>> +static int >>> userdisk_print(int verbose) >>> { >>> struct disk_devdesc dev; >>> char line[80]; >>> - int i; >>> + int i, ret =3D 0; >>> >>> for (i =3D 0; i < userdisk_maxunit; i++) { >>> - sprintf(line, " disk%d: Guest drive image\n", i); >>> - pager_output(line); >>> + snprintf(line, sizeof(line), >>> + " disk%d: Guest drive image\n", i); >>> + ret =3D pager_output(line); >>> + if (ret !=3D 0) >>> + break; >>> dev.d_dev =3D &userboot_disk; >>> dev.d_unit =3D i; >>> dev.d_slice =3D -1; >>> dev.d_partition =3D -1; >>> if (disk_open(&dev, ud_info[i].mediasize, >>> ud_info[i].sectorsize, 0) =3D=3D 0) { >>> - sprintf(line, " disk%d", i); >>> - disk_print(&dev, line, verbose); >>> + snprintf(line, sizeof(line), " disk%d", i); >>> + ret =3D disk_print(&dev, line, verbose); >>> disk_close(&dev); >>> + if (ret !=3D 0) >>> + break; >>> } >>> } >>> + return (ret); >>> } >>> >>> /* >>> >>> Modified: head/sys/boot/zfs/zfs.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/zfs/zfs.c Tue Nov 8 06:13:22 2016 (r30843= 3) >>> +++ head/sys/boot/zfs/zfs.c Tue Nov 8 06:50:18 2016 (r30843= 4) >>> @@ -514,20 +514,23 @@ zfs_probe_dev(const char *devname, uint6 >>> /* >>> * Print information about ZFS pools >>> */ >>> -static void >>> +static int >>> zfs_dev_print(int verbose) >>> { >>> spa_t *spa; >>> char line[80]; >>> + int ret =3D 0; >>> >>> if (verbose) { >>> - spa_all_status(); >>> - return; >>> + return (spa_all_status()); >>> } >>> STAILQ_FOREACH(spa, &zfs_pools, spa_link) { >>> - sprintf(line, " zfs:%s\n", spa->spa_name); >>> - pager_output(line); >>> + snprintf(line, sizeof(line), " zfs:%s\n", >>> spa->spa_name); >>> + ret =3D pager_output(line); >>> + if (ret !=3D 0) >>> + break; >>> } >>> + return (ret); >>> } >>> >>> /* >>> >>> Modified: head/sys/boot/zfs/zfsimpl.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:13:22 2016 (r30843= 3) >>> +++ head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:50:18 2016 (r30843= 4) >>> @@ -780,7 +780,7 @@ state_name(vdev_state_t state) >>> >>> #else >>> >>> -static void >>> +static int >>> pager_printf(const char *fmt, ...) >>> { >>> char line[80]; >>> @@ -789,14 +789,14 @@ pager_printf(const char *fmt, ...) >>> va_start(args, fmt); >>> vsprintf(line, fmt, args); >>> va_end(args); >>> - pager_output(line); >>> + return (pager_output(line)); >>> } >>> >>> #endif >>> >>> #define STATUS_FORMAT " %s %s\n" >>> >>> -static void >>> +static int >>> print_state(int indent, const char *name, vdev_state_t state) >>> { >>> int i; >>> @@ -806,40 +806,56 @@ print_state(int indent, const char *name >>> for (i =3D 0; i < indent; i++) >>> strcat(buf, " "); >>> strcat(buf, name); >>> >>> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >>> _______________________________________________ >>> svn-src-head@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/svn-src-head >>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >> >> >> > From owner-svn-src-head@freebsd.org Fri Nov 11 17:24:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDD65C3C12A for ; Fri, 11 Nov 2016 17:24:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 815921AFC for ; Fri, 11 Nov 2016 17:24:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id q124so135071269itd.1 for ; Fri, 11 Nov 2016 09:24:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=oAimcw16Iwq8qq6++g4O2Gi2AO8lVietfE/NZtwfZFA=; b=s78XNgOemw4KNe59AJSVBbic3ZeeQewhCwywDzZAfRQQtrfF12gR3KEPf4yrXHctoT 6JyNPvf+E0K1SVLMzGdQh2AmI+fp2isBp/Z0HroRT2XB9gGoFGsLuR9zBOAQLRljRWEM ffxHIA4l1yLHi2G7BW9j68BHJ251U/aWIxuWOgTSpuIGQ5LH4DmUsHRG/1lJB2BmCZbC y3GwcG6A9SD0t6MQNIcO5g3dTmqXNInane1QPZ8HH+Cw5PlUvzffLvHRCWMWVb7kaCcV tMsVzyHeLFNzuoJR3iSr8dQqknBZNhQEetYDitrerw1uy4zT/+ERDfVuTa0iYWLBDleJ GSeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=oAimcw16Iwq8qq6++g4O2Gi2AO8lVietfE/NZtwfZFA=; b=X9BLUujFakZfNUXBXn8EEKyqvBNZR5BcoN8bm01IZb9OlBFfNidGGn0OYMDyosVjFa XKbU2V4h46m/horuPcfXrnQNA/ucEfOoVwoNqL00RVlcrNq7Yw0ILafnDs6a3Mx4dgkF QTuAkCRIrZLIWW4hpiN5bUul+vSixJqlI9QMqGTKiacfImfqo0Z8bcBR2RQ0T06K+af2 q5S2DZk4mpA6lCUTdIEA5fEdfyOb80A+bjeAx7I7PzNQQPKT2t/rhupRrn0cXxeu5+H4 4oHEMxO5vbJiCP7GIxJAMm2RFZwjmZGwt/6nXRSHgw7Or9Zkzy3Nn6zUVSLnkXROU8RY D7AA== X-Gm-Message-State: ABUngvdmRCJVUw4xjS6hMgf4WvLkvIXZ9GWq0HEBNn3vqStGeEOvN642sifuNN9hYgcgIuRweGUGpWwM0xteCQ== X-Received: by 10.36.93.193 with SMTP id w184mr22725268ita.85.1478885053522; Fri, 11 Nov 2016 09:24:13 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.134.66 with HTTP; Fri, 11 Nov 2016 09:24:12 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <0B89F169-9FAB-4FEA-BBBE-0000DE54F09A@me.com> References: <201611080650.uA86oJ7W056026@repo.freebsd.org> <8E0E5C94-EFD7-4008-B563-FF080A98F23D@me.com> <0B89F169-9FAB-4FEA-BBBE-0000DE54F09A@me.com> From: Warner Losh Date: Fri, 11 Nov 2016 10:24:12 -0700 X-Google-Sender-Auth: 0-WLjdHkm5TDEpYXe90enSuJtkY Message-ID: Subject: Re: svn commit: r308434 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libofw sys... To: Toomas Soome Cc: Kamil Czekirda , Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 17:24:15 -0000 On Fri, Nov 11, 2016 at 10:20 AM, Toomas Soome wrote: > >> On 11. nov 2016, at 19:08, Warner Losh wrote: >> >> This suggests we've created an update / upgrade problem. Do we? >> >> Warner > > > Not if the normal build suggestion (make buildworld buildkernel) is follo= wed, as then the headers from the source tree are put in proper place as pa= rt of the build procedure - in this case the source was fetched by svn upda= te and attempt was made to build part of the fetched tree. > > In that sense, I don=E2=80=99t see the problem, as direct build without s= cene setup is not really supported. Or am I wrong? The same issue will happ= en with any header change, as you can not really build new source with usin= g old headers. OK. Nah, this is cool. libstand's API is somewhat unstable and not needed in the upgrade path. Warner > rgds, > toomas > >> >> On Thu, Nov 10, 2016 at 11:52 PM, Kamil Czekirda w= rote: >>> cp /usr/src/lib/libstand/libstand.h /usr/include/stand.h fixed that >>> >>> thanks >>> >>> 2016-11-10 23:28 GMT+01:00 Toomas Soome : >>>> >>>> the patch does update the lib/libstand/stand.h to have: >>>> >>>> struct devsw { >>>> . . . >>>> int (*dv_print)(int verbose); >>>> >>>> it was void before; from your svnlite log I can see the >>>> lib/libstand/stand.h is updated, could you confirm if it is int now? i= f it >>>> is, I suspect the build is getting the old stand.h from somewhere in t= he >>>> tree and not your /lib/libstand. >>>> >>>> if so, does the build has target to copy headers in place? I=E2=80=99m= sorry, I >>>> don't know all the tricks the build system does as part of the buildwo= rld.. >>>> >>>> rgds, >>>> toomas >>>> >>>> >>>> On 11. nov 2016, at 0:21, Kamil Czekirda wrote: >>>> >>>> Hi, >>>> >>>> I got the following: >>>> >>>> root@current:/usr/src # svnlite up -r r308434 >>>> Updating '.': >>>> U lib/libstand/stand.h >>>> U sys/boot/common/dev_net.c >>>> U sys/boot/common/module.c >>>> U sys/boot/common/part.c >>>> U sys/boot/common/util.c >>>> U sys/boot/common/util.h >>>> U sys/boot/efi/libefi/efinet.c >>>> U sys/boot/efi/libefi/efipart.c >>>> U sys/boot/efi/loader/main.c >>>> U sys/boot/i386/libfirewire/firewire.c >>>> U sys/boot/i386/libi386/bioscd.c >>>> U sys/boot/i386/libi386/biosdisk.c >>>> U sys/boot/mips/beri/loader/beri_disk_cfi.c >>>> U sys/boot/mips/beri/loader/beri_disk_sdcard.c >>>> U sys/boot/ofw/libofw/ofw_disk.c >>>> U sys/boot/pc98/libpc98/bioscd.c >>>> U sys/boot/pc98/libpc98/biosdisk.c >>>> U sys/boot/powerpc/kboot/hostdisk.c >>>> U sys/boot/powerpc/ps3/ps3cdrom.c >>>> U sys/boot/powerpc/ps3/ps3disk.c >>>> U sys/boot/uboot/lib/disk.c >>>> U sys/boot/usb/storage/umass_loader.c >>>> U sys/boot/userboot/userboot/host.c >>>> U sys/boot/userboot/userboot/userboot_disk.c >>>> U sys/boot/zfs/zfs.c >>>> U sys/boot/zfs/zfsimpl.c >>>> U sys/boot/i386/libi386/pxe.c >>>> Updated to revision 308434. >>>> root@current:/usr/src # cd sys/boot/ >>>> root@current:/usr/src/sys/boot # make clean >>>> (...) >>>> root@current:/usr/src/sys/boot # make obj >>>> (...) >>>> root@current:/usr/src/sys/boot # make >>>> (...) >>>> cc -O2 -pipe -DSKEIN_LOOP=3D111 -fPIC -I/usr/src/sys/boot/efi/loade= r >>>> -I/usr/src/sys/boot/efi/loader/arch/amd64 >>>> -I/usr/src/sys/boot/efi/loader/../include >>>> -I/usr/src/sys/boot/efi/loader/../include/amd64 >>>> -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include >>>> -I/usr/src/sys/boot/efi/loader/../../.. >>>> -I/usr/src/sys/boot/efi/loader/../../i386/libi386 >>>> -I/usr/src/sys/boot/efi/loader/../../zfs >>>> -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs >>>> -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT -D= NO_PCI >>>> -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH >>>> -I/usr/src/sys/boot/efi/loader/../../ficl >>>> -I/usr/src/sys/boot/efi/loader/../../ficl/amd64 -DLOADER_DISK_SUPPORT >>>> -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC -I/usr/src/sys/boot/fi= cl >>>> -I/usr/src/sys/boot/ficl/amd64 -I/usr/src/sys/boot/ficl/../common >>>> -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat >>>> -msoft-float -mno-mmx -mno-sse -mno-avx -fshort-wchar -mno-red-zone -m= no-aes >>>> -g -MD -MF.depend.vers.o -MTvers.o -std=3Dgnu99 -Wsystem-headers -Wer= ror >>>> -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes >>>> -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-s= ign >>>> -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable >>>> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality >>>> -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef >>>> -Qunused-arguments -c vers.c -o vers.o >>>> cc -O2 -pipe -DSKEIN_LOOP=3D111 -fPIC -I/usr/src/sys/boot/efi/loade= r >>>> -I/usr/src/sys/boot/efi/loader/arch/amd64 >>>> -I/usr/src/sys/boot/efi/loader/../include >>>> -I/usr/src/sys/boot/efi/loader/../include/amd64 >>>> -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include >>>> -I/usr/src/sys/boot/efi/loader/../../.. >>>> -I/usr/src/sys/boot/efi/loader/../../i386/libi386 >>>> -I/usr/src/sys/boot/efi/loader/../../zfs >>>> -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs >>>> -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT -D= NO_PCI >>>> -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH >>>> -I/usr/src/sys/boot/efi/loader/../../ficl >>>> -I/usr/src/sys/boot/efi/loader/../../ficl/amd64 -DLOADER_DISK_SUPPORT >>>> -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC -I/usr/src/sys/boot/fi= cl >>>> -I/usr/src/sys/boot/ficl/amd64 -I/usr/src/sys/boot/ficl/../common >>>> -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat >>>> -msoft-float -mno-mmx -mno-sse -mno-avx -fshort-wchar -mno-red-zone -m= no-aes >>>> -g -MD -MF.depend.zfs.o -MTzfs.o -std=3Dgnu99 -Wsystem-headers -Werro= r -Wall >>>> -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes >>>> -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-s= ign >>>> -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable >>>> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality >>>> -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef >>>> -Wno-sign-compare -Wno-array-bounds -Wno-missing-prototypes >>>> -Qunused-arguments -c /usr/src/sys/boot/efi/loader/../../zfs/zfs.c -o= zfs.o >>>> /usr/src/sys/boot/efi/loader/../../zfs/zfs.c:599:14: error: incompatib= le >>>> pointer types initializing 'void (*)(int)' with an expression of type = 'int >>>> (int)' [-Werror,-Wincompatible-pointer-types] >>>> .dv_print =3D zfs_dev_print, >>>> ^~~~~~~~~~~~~ >>>> 1 error generated. >>>> *** Error code 1 >>>> >>>> Stop. >>>> make[2]: stopped in /usr/src/sys/boot/efi/loader >>>> *** Error code 1 >>>> >>>> Stop. >>>> make[1]: stopped in /usr/src/sys/boot/efi >>>> *** Error code 1 >>>> >>>> Stop. >>>> make: stopped in /usr/src/sys/boot >>>> >>>> >>>> Kamil >>>> >>>> 2016-11-08 7:50 GMT+01:00 Toomas Soome : >>>>> >>>>> Author: tsoome >>>>> Date: Tue Nov 8 06:50:18 2016 >>>>> New Revision: 308434 >>>>> URL: https://svnweb.freebsd.org/changeset/base/308434 >>>>> >>>>> Log: >>>>> Loader paged/pageable data is not always paged. >>>>> >>>>> This change does modify devsw dv_print() to return the int value, >>>>> enabling walkers to interrupt the walk on non zero value from >>>>> dv_print(). >>>>> >>>>> This will allow the pager_print actually to stop displaying data on >>>>> user input, and additionally pager is used in various *dev_print >>>>> callbacks, >>>>> where it was missing. >>>>> >>>>> For test, lsdev [-v] command should display data by screenfuls and >>>>> should >>>>> stop when the key 'q' is pressed on pager prompt. >>>>> >>>>> Reviewed by: allanjude >>>>> Approved by: allanjude (mentor) >>>>> Differential Revision: https://reviews.freebsd.org/D5461 >>>>> >>>>> Modified: >>>>> head/lib/libstand/stand.h >>>>> head/sys/boot/common/dev_net.c >>>>> head/sys/boot/common/module.c >>>>> head/sys/boot/common/part.c >>>>> head/sys/boot/common/util.c >>>>> head/sys/boot/common/util.h >>>>> head/sys/boot/efi/libefi/efinet.c >>>>> head/sys/boot/efi/libefi/efipart.c >>>>> head/sys/boot/efi/loader/main.c >>>>> head/sys/boot/i386/libfirewire/firewire.c >>>>> head/sys/boot/i386/libi386/bioscd.c >>>>> head/sys/boot/i386/libi386/biosdisk.c >>>>> head/sys/boot/i386/libi386/pxe.c >>>>> head/sys/boot/mips/beri/loader/beri_disk_cfi.c >>>>> head/sys/boot/mips/beri/loader/beri_disk_sdcard.c >>>>> head/sys/boot/ofw/libofw/ofw_disk.c >>>>> head/sys/boot/pc98/libpc98/bioscd.c >>>>> head/sys/boot/pc98/libpc98/biosdisk.c >>>>> head/sys/boot/powerpc/kboot/hostdisk.c >>>>> head/sys/boot/powerpc/ps3/ps3cdrom.c >>>>> head/sys/boot/powerpc/ps3/ps3disk.c >>>>> head/sys/boot/uboot/lib/disk.c >>>>> head/sys/boot/usb/storage/umass_loader.c >>>>> head/sys/boot/userboot/userboot/host.c >>>>> head/sys/boot/userboot/userboot/userboot_disk.c >>>>> head/sys/boot/zfs/zfs.c >>>>> head/sys/boot/zfs/zfsimpl.c >>>>> >>>>> Modified: head/lib/libstand/stand.h >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/lib/libstand/stand.h Tue Nov 8 06:13:22 2016 (r308= 433) >>>>> +++ head/lib/libstand/stand.h Tue Nov 8 06:50:18 2016 (r308= 434) >>>>> @@ -143,7 +143,7 @@ struct devsw { >>>>> int (*dv_open)(struct open_file *f, ...); >>>>> int (*dv_close)(struct open_file *f); >>>>> int (*dv_ioctl)(struct open_file *f, u_long cmd, v= oid >>>>> *data); >>>>> - void (*dv_print)(int verbose); /* print device >>>>> information */ >>>>> + int (*dv_print)(int verbose); /* print devi= ce >>>>> information */ >>>>> void (*dv_cleanup)(void); >>>>> }; >>>>> >>>>> >>>>> Modified: head/sys/boot/common/dev_net.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/common/dev_net.c Tue Nov 8 06:13:22 2016 >>>>> (r308433) >>>>> +++ head/sys/boot/common/dev_net.c Tue Nov 8 06:50:18 2016 >>>>> (r308434) >>>>> @@ -80,7 +80,7 @@ static int net_open(struct open_file *, >>>>> static int net_close(struct open_file *); >>>>> static void net_cleanup(void); >>>>> static int net_strategy(); >>>>> -static void net_print(int); >>>>> +static int net_print(int); >>>>> >>>>> static int net_getparams(int sock); >>>>> >>>>> @@ -325,23 +325,27 @@ exit: >>>>> return (0); >>>>> } >>>>> >>>>> -static void >>>>> +static int >>>>> net_print(int verbose) >>>>> { >>>>> struct netif_driver *drv; >>>>> int i, d, cnt; >>>>> + int ret =3D 0; >>>>> >>>>> cnt =3D 0; >>>>> for (d =3D 0; netif_drivers[d]; d++) { >>>>> drv =3D netif_drivers[d]; >>>>> for (i =3D 0; i < drv->netif_nifs; i++) { >>>>> printf("\t%s%d:", "net", cnt++); >>>>> - if (verbose) >>>>> + if (verbose) { >>>>> printf(" (%s%d)", drv->netif_bname, >>>>> drv->netif_ifs[i].dif_unit); >>>>> + } >>>>> + if ((ret =3D pager_output("\n")) !=3D 0) >>>>> + return (ret); >>>>> } >>>>> } >>>>> - printf("\n"); >>>>> + return (ret); >>>>> } >>>>> >>>>> /* >>>>> >>>>> Modified: head/sys/boot/common/module.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/common/module.c Tue Nov 8 06:13:22 2016 >>>>> (r308433) >>>>> +++ head/sys/boot/common/module.c Tue Nov 8 06:50:18 2016 >>>>> (r308434) >>>>> @@ -254,7 +254,7 @@ command_lsmod(int argc, char *argv[]) >>>>> struct kernel_module *mp; >>>>> struct file_metadata *md; >>>>> char lbuf[80]; >>>>> - int ch, verbose; >>>>> + int ch, verbose, ret =3D 0; >>>>> >>>>> verbose =3D 0; >>>>> optind =3D 1; >>>>> @@ -273,11 +273,13 @@ command_lsmod(int argc, char *argv[]) >>>>> >>>>> pager_open(); >>>>> for (fp =3D preloaded_files; fp; fp =3D fp->f_next) { >>>>> - sprintf(lbuf, " %p: ", (void *) fp->f_addr); >>>>> + snprintf(lbuf, sizeof(lbuf), " %p: ", (void *) fp->f_addr); >>>>> pager_output(lbuf); >>>>> pager_output(fp->f_name); >>>>> - sprintf(lbuf, " (%s, 0x%lx)\n", fp->f_type, (long)fp->f_size)= ; >>>>> - pager_output(lbuf); >>>>> + snprintf(lbuf, sizeof(lbuf), " (%s, 0x%lx)\n", fp->f_type, >>>>> + (long)fp->f_size); >>>>> + if (pager_output(lbuf)) >>>>> + break; >>>>> if (fp->f_args !=3D NULL) { >>>>> pager_output(" args: "); >>>>> pager_output(fp->f_args); >>>>> @@ -287,7 +289,8 @@ command_lsmod(int argc, char *argv[]) >>>>> if (fp->f_modules) { >>>>> pager_output(" modules: "); >>>>> for (mp =3D fp->f_modules; mp; mp =3D mp->m_next) { >>>>> - sprintf(lbuf, "%s.%d ", mp->m_name, mp->m_version); >>>>> + snprintf(lbuf, sizeof(lbuf), "%s.%d ", mp->m_name, >>>>> + mp->m_version); >>>>> pager_output(lbuf); >>>>> } >>>>> if (pager_output("\n")) >>>>> @@ -296,11 +299,14 @@ command_lsmod(int argc, char *argv[]) >>>>> if (verbose) { >>>>> /* XXX could add some formatting smarts here to display so= me >>>>> better */ >>>>> for (md =3D fp->f_metadata; md !=3D NULL; md =3D md->md_ne= xt) { >>>>> - sprintf(lbuf, " 0x%04x, 0x%lx\n", md->md_type, >>>>> (long) md->md_size); >>>>> + snprintf(lbuf, sizeof(lbuf), " 0x%04x, 0x%lx\n", >>>>> + md->md_type, (long) md->md_size); >>>>> if (pager_output(lbuf)) >>>>> break; >>>>> } >>>>> } >>>>> + if (ret) >>>>> + break; >>>>> } >>>>> pager_close(); >>>>> return(CMD_OK); >>>>> >>>>> Modified: head/sys/boot/common/part.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/common/part.c Tue Nov 8 06:13:22 2016 (r308= 433) >>>>> +++ head/sys/boot/common/part.c Tue Nov 8 06:50:18 2016 (r308= 434) >>>>> @@ -834,6 +834,7 @@ ptable_iterate(const struct ptable *tabl >>>>> { >>>>> struct pentry *entry; >>>>> char name[32]; >>>>> + int ret =3D 0; >>>>> >>>>> name[0] =3D '\0'; >>>>> STAILQ_FOREACH(entry, &table->entries, entry) { >>>>> @@ -856,9 +857,8 @@ ptable_iterate(const struct ptable *tabl >>>>> if (table->type =3D=3D PTABLE_BSD) >>>>> sprintf(name, "%c", (u_char) 'a' + >>>>> entry->part.index); >>>>> - if (iter(arg, name, &entry->part)) >>>>> - return 1; >>>>> + if ((ret =3D iter(arg, name, &entry->part)) !=3D 0) >>>>> + return (ret); >>>>> } >>>>> - return 0; >>>>> + return (ret); >>>>> } >>>>> - >>>>> >>>>> Modified: head/sys/boot/common/util.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/common/util.c Tue Nov 8 06:13:22 2016 (r308= 433) >>>>> +++ head/sys/boot/common/util.c Tue Nov 8 06:50:18 2016 (r308= 434) >>>>> @@ -114,7 +114,7 @@ strlen(const char *s) >>>>> return (len); >>>>> } >>>>> >>>>> -void >>>>> +int >>>>> printf(const char *fmt, ...) >>>>> { >>>>> va_list ap; >>>>> @@ -178,4 +178,5 @@ nextfmt: >>>>> } >>>>> } >>>>> va_end(ap); >>>>> + return (0); >>>>> } >>>>> >>>>> Modified: head/sys/boot/common/util.h >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/common/util.h Tue Nov 8 06:13:22 2016 (r308= 433) >>>>> +++ head/sys/boot/common/util.h Tue Nov 8 06:50:18 2016 (r308= 434) >>>>> @@ -48,6 +48,6 @@ void strcat(char *dst, const char *src); >>>>> char *strchr(const char *s, char ch); >>>>> size_t strlen(const char *s); >>>>> >>>>> -void printf(const char *fmt, ...); >>>>> +int printf(const char *fmt, ...); >>>>> >>>>> #endif /* !_UTIL_H_ */ >>>>> >>>>> Modified: head/sys/boot/efi/libefi/efinet.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:13:22 2016 >>>>> (r308433) >>>>> +++ head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:50:18 2016 >>>>> (r308434) >>>>> @@ -252,7 +252,7 @@ efinet_end(struct netif *nif) >>>>> } >>>>> >>>>> static int efinet_dev_init(void); >>>>> -static void efinet_dev_print(int); >>>>> +static int efinet_dev_print(int); >>>>> >>>>> struct devsw efinet_dev =3D { >>>>> .dv_name =3D "net", >>>>> @@ -346,14 +346,13 @@ efinet_dev_init() >>>>> return (0); >>>>> } >>>>> >>>>> -static void >>>>> +static int >>>>> efinet_dev_print(int verbose) >>>>> { >>>>> CHAR16 *text; >>>>> EFI_HANDLE h; >>>>> - int unit; >>>>> + int unit, ret =3D 0; >>>>> >>>>> - pager_open(); >>>>> for (unit =3D 0, h =3D efi_find_handle(&efinet_dev, 0); >>>>> h !=3D NULL; h =3D efi_find_handle(&efinet_dev, ++unit)) { >>>>> printf(" %s%d:", efinet_dev.dv_name, unit); >>>>> @@ -364,8 +363,8 @@ efinet_dev_print(int verbose) >>>>> efi_free_devpath_name(text); >>>>> } >>>>> } >>>>> - if (pager_output("\n")) >>>>> + if ((ret =3D pager_output("\n")) !=3D 0) >>>>> break; >>>>> } >>>>> - pager_close(); >>>>> + return (ret); >>>>> } >>>>> >>>>> Modified: head/sys/boot/efi/libefi/efipart.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:13:22 2016 >>>>> (r308433) >>>>> +++ head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:50:18 2016 >>>>> (r308434) >>>>> @@ -47,7 +47,7 @@ static int efipart_realstrategy(void *, >>>>> size_t *); >>>>> static int efipart_open(struct open_file *, ...); >>>>> static int efipart_close(struct open_file *); >>>>> -static void efipart_print(int); >>>>> +static int efipart_print(int); >>>>> >>>>> struct devsw efipart_dev =3D { >>>>> .dv_name =3D "part", >>>>> @@ -162,7 +162,7 @@ efipart_init(void) >>>>> return (err); >>>>> } >>>>> >>>>> -static void >>>>> +static int >>>>> efipart_print(int verbose) >>>>> { >>>>> char line[80]; >>>>> @@ -170,28 +170,29 @@ efipart_print(int verbose) >>>>> EFI_HANDLE h; >>>>> EFI_STATUS status; >>>>> u_int unit; >>>>> + int ret =3D 0; >>>>> >>>>> - pager_open(); >>>>> for (unit =3D 0, h =3D efi_find_handle(&efipart_dev, 0); >>>>> h !=3D NULL; h =3D efi_find_handle(&efipart_dev, ++unit)) = { >>>>> - sprintf(line, " %s%d:", efipart_dev.dv_name, unit)= ; >>>>> - if (pager_output(line)) >>>>> + snprintf(line, sizeof(line), " %s%d:", >>>>> + efipart_dev.dv_name, unit); >>>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>>> break; >>>>> >>>>> status =3D BS->HandleProtocol(h, &blkio_guid, (void >>>>> **)&blkio); >>>>> if (!EFI_ERROR(status)) { >>>>> - sprintf(line, " %llu blocks", >>>>> + snprintf(line, sizeof(line), " %llu blocks= ", >>>>> (unsigned long long)(blkio->Media->LastBlo= ck >>>>> + 1)); >>>>> - if (pager_output(line)) >>>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>>> break; >>>>> if (blkio->Media->RemovableMedia) >>>>> - if (pager_output(" (removable)")) >>>>> + if ((ret =3D pager_output(" (removabl= e)")) >>>>> !=3D 0) >>>>> break; >>>>> } >>>>> - if (pager_output("\n")) >>>>> + if ((ret =3D pager_output("\n")) !=3D 0) >>>>> break; >>>>> } >>>>> - pager_close(); >>>>> + return (ret); >>>>> } >>>>> >>>>> static int >>>>> >>>>> Modified: head/sys/boot/efi/loader/main.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/efi/loader/main.c Tue Nov 8 06:13:22 2016 >>>>> (r308433) >>>>> +++ head/sys/boot/efi/loader/main.c Tue Nov 8 06:50:18 2016 >>>>> (r308434) >>>>> @@ -533,6 +533,7 @@ command_memmap(int argc, char *argv[]) >>>>> UINT32 dver; >>>>> EFI_STATUS status; >>>>> int i, ndesc; >>>>> + char line[80]; >>>>> static char *types[] =3D { >>>>> "Reserved", >>>>> "LoaderCode", >>>>> @@ -564,14 +565,19 @@ command_memmap(int argc, char *argv[]) >>>>> } >>>>> >>>>> ndesc =3D sz / dsz; >>>>> - printf("%23s %12s %12s %8s %4s\n", >>>>> + snprintf(line, sizeof(line), "%23s %12s %12s %8s %4s\n", >>>>> "Type", "Physical", "Virtual", "#Pages", "Attr"); >>>>> + pager_open(); >>>>> + if (pager_output(line)) { >>>>> + pager_close(); >>>>> + return (CMD_OK); >>>>> + } >>>>> >>>>> for (i =3D 0, p =3D map; i < ndesc; >>>>> i++, p =3D NextMemoryDescriptor(p, dsz)) { >>>>> printf("%23s %012jx %012jx %08jx ", types[p->Type], >>>>> - (uintmax_t)p->PhysicalStart, >>>>> (uintmax_t)p->VirtualStart, >>>>> - (uintmax_t)p->NumberOfPages); >>>>> + (uintmax_t)p->PhysicalStart, >>>>> (uintmax_t)p->VirtualStart, >>>>> + (uintmax_t)p->NumberOfPages); >>>>> if (p->Attribute & EFI_MEMORY_UC) >>>>> printf("UC "); >>>>> if (p->Attribute & EFI_MEMORY_WC) >>>>> @@ -588,9 +594,11 @@ command_memmap(int argc, char *argv[]) >>>>> printf("RP "); >>>>> if (p->Attribute & EFI_MEMORY_XP) >>>>> printf("XP "); >>>>> - printf("\n"); >>>>> + if (pager_output("\n")) >>>>> + break; >>>>> } >>>>> >>>>> + pager_close(); >>>>> return (CMD_OK); >>>>> } >>>>> >>>>> @@ -612,10 +620,17 @@ guid_to_string(EFI_GUID *guid) >>>>> static int >>>>> command_configuration(int argc, char *argv[]) >>>>> { >>>>> + char line[80]; >>>>> UINTN i; >>>>> >>>>> - printf("NumberOfTableEntries=3D%lu\n", >>>>> + snprintf(line, sizeof(line), "NumberOfTableEntries=3D%lu\n", >>>>> (unsigned long)ST->NumberOfTableEntries); >>>>> + pager_open(); >>>>> + if (pager_output(line)) { >>>>> + pager_close(); >>>>> + return (CMD_OK); >>>>> + } >>>>> + >>>>> for (i =3D 0; i < ST->NumberOfTableEntries; i++) { >>>>> EFI_GUID *guid; >>>>> >>>>> @@ -642,9 +657,13 @@ command_configuration(int argc, char *ar >>>>> printf("FDT Table"); >>>>> else >>>>> printf("Unknown Table (%s)", >>>>> guid_to_string(guid)); >>>>> - printf(" at %p\n", >>>>> ST->ConfigurationTable[i].VendorTable); >>>>> + snprintf(line, sizeof(line), " at %p\n", >>>>> + ST->ConfigurationTable[i].VendorTable); >>>>> + if (pager_output(line)) >>>>> + break; >>>>> } >>>>> >>>>> + pager_close(); >>>>> return (CMD_OK); >>>>> } >>>>> >>>>> >>>>> Modified: head/sys/boot/i386/libfirewire/firewire.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:13:22 2= 016 >>>>> (r308433) >>>>> +++ head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:50:18 2= 016 >>>>> (r308434) >>>>> @@ -69,7 +69,7 @@ static int fw_strategy(void *devdata, in >>>>> size_t offset, size_t size, char *buf, size_t >>>>> *rsize); >>>>> static int fw_open(struct open_file *f, ...); >>>>> static int fw_close(struct open_file *f); >>>>> -static void fw_print(int verbose); >>>>> +static int fw_print(int verbose); >>>>> static void fw_cleanup(void); >>>>> >>>>> void fw_enable(void); >>>>> @@ -148,21 +148,26 @@ fw_init(void) >>>>> /* >>>>> * Print information about OHCI chips >>>>> */ >>>>> -static void >>>>> +static int >>>>> fw_print(int verbose) >>>>> { >>>>> - int i; >>>>> + char line[80]; >>>>> + int i, ret =3D 0; >>>>> struct fwohci_softc *sc; >>>>> >>>>> for (i =3D 0; i < MAX_OHCI; i ++) { >>>>> sc =3D &fwinfo[i]; >>>>> if (sc->state =3D=3D FWOHCI_STATE_DEAD) >>>>> break; >>>>> - printf("%d: locator=3D0x%04x devid=3D0x%08x" >>>>> + snprintf(line, sizeof(line), "%d: locator=3D0x%04x >>>>> devid=3D0x%08x" >>>>> " base_addr=3D0x%08x handle=3D0x%08x >>>>> bus_id=3D0x%08x\n", >>>>> i, sc->locator, sc->devid, >>>>> sc->base_addr, sc->handle, sc->bus_id); >>>>> + ret =3D pager_output(line); >>>>> + if (ret !=3D 0) >>>>> + break; >>>>> } >>>>> + return (ret); >>>>> } >>>>> >>>>> static int >>>>> >>>>> Modified: head/sys/boot/i386/libi386/bioscd.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:13:22 2016 >>>>> (r308433) >>>>> +++ head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:50:18 2016 >>>>> (r308434) >>>>> @@ -100,7 +100,7 @@ static int bc_realstrategy(void *devdata >>>>> size_t offset, size_t size, char *buf, size_t *rsize); >>>>> static int bc_open(struct open_file *f, ...); >>>>> static int bc_close(struct open_file *f); >>>>> -static void bc_print(int verbose); >>>>> +static int bc_print(int verbose); >>>>> >>>>> struct devsw bioscd =3D { >>>>> "cd", >>>>> @@ -177,20 +177,19 @@ bc_add(int biosdev) >>>>> /* >>>>> * Print information about disks >>>>> */ >>>>> -static void >>>>> +static int >>>>> bc_print(int verbose) >>>>> { >>>>> char line[80]; >>>>> - int i; >>>>> + int i, ret =3D 0; >>>>> >>>>> - pager_open(); >>>>> for (i =3D 0; i < nbcinfo; i++) { >>>>> - sprintf(line, " cd%d: Device 0x%x\n", i, >>>>> + snprintf(line, sizeof(line), " cd%d: Device 0x%x\n= ", >>>>> i, >>>>> bcinfo[i].bc_sp.sp_devicespec); >>>>> - if (pager_output(line)) >>>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>>> break; >>>>> } >>>>> - pager_close(); >>>>> + return (ret); >>>>> } >>>>> >>>>> /* >>>>> >>>>> Modified: head/sys/boot/i386/libi386/biosdisk.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:13:22 2= 016 >>>>> (r308433) >>>>> +++ head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:50:18 2= 016 >>>>> (r308434) >>>>> @@ -135,7 +135,7 @@ static int bd_realstrategy(void *devdata >>>>> static int bd_open(struct open_file *f, ...); >>>>> static int bd_close(struct open_file *f); >>>>> static int bd_ioctl(struct open_file *f, u_long cmd, void *data); >>>>> -static void bd_print(int verbose); >>>>> +static int bd_print(int verbose); >>>>> static void bd_cleanup(void); >>>>> >>>>> #ifdef LOADER_GELI_SUPPORT >>>>> @@ -321,21 +321,21 @@ bd_int13probe(struct bdinfo *bd) >>>>> /* >>>>> * Print information about disks >>>>> */ >>>>> -static void >>>>> +static int >>>>> bd_print(int verbose) >>>>> { >>>>> static char line[80]; >>>>> struct disk_devdesc dev; >>>>> - int i; >>>>> + int i, ret =3D 0; >>>>> >>>>> - pager_open(); >>>>> for (i =3D 0; i < nbdinfo; i++) { >>>>> - sprintf(line, " disk%d: BIOS drive %c (%ju X >>>>> %u):\n", i, >>>>> + snprintf(line, sizeof(line), >>>>> + " disk%d: BIOS drive %c (%ju X %u):\n", i, >>>>> (bdinfo[i].bd_unit < 0x80) ? ('A' + >>>>> bdinfo[i].bd_unit): >>>>> ('C' + bdinfo[i].bd_unit - 0x80), >>>>> (uintmax_t)bdinfo[i].bd_sectors, >>>>> bdinfo[i].bd_sectorsize); >>>>> - if (pager_output(line)) >>>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>>> break; >>>>> dev.d_dev =3D &biosdisk; >>>>> dev.d_unit =3D i; >>>>> @@ -346,12 +346,14 @@ bd_print(int verbose) >>>>> bdinfo[i].bd_sectorsize, >>>>> (bdinfo[i].bd_flags & BD_FLOPPY) ? >>>>> DISK_F_NOCACHE: 0) =3D=3D 0) { >>>>> - sprintf(line, " disk%d", i); >>>>> - disk_print(&dev, line, verbose); >>>>> + snprintf(line, sizeof(line), " disk%d", i)= ; >>>>> + ret =3D disk_print(&dev, line, verbose); >>>>> disk_close(&dev); >>>>> + if (ret !=3D 0) >>>>> + return (ret); >>>>> } >>>>> } >>>>> - pager_close(); >>>>> + return (ret); >>>>> } >>>>> >>>>> /* >>>>> >>>>> Modified: head/sys/boot/i386/libi386/pxe.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:13:22 2016 >>>>> (r308433) >>>>> +++ head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:50:18 2016 >>>>> (r308434) >>>>> @@ -75,7 +75,7 @@ static int pxe_strategy(void *devdata, i >>>>> size_t offset, size_t size, char *buf, >>>>> size_t *rsize); >>>>> static int pxe_open(struct open_file *f, ...); >>>>> static int pxe_close(struct open_file *f); >>>>> -static void pxe_print(int verbose); >>>>> +static int pxe_print(int verbose); >>>>> static void pxe_cleanup(void); >>>>> static void pxe_setnfshandle(char *rootpath); >>>>> >>>>> @@ -381,14 +381,20 @@ pxe_close(struct open_file *f) >>>>> return (0); >>>>> } >>>>> >>>>> -static void >>>>> +static int >>>>> pxe_print(int verbose) >>>>> { >>>>> - >>>>> + char line[255]; >>>>> if (pxe_call =3D=3D NULL) >>>>> - return; >>>>> + return (0); >>>>> >>>>> - printf(" pxe0: %s:%s\n", inet_ntoa(rootip), rootpath); >>>>> + if (verbose) { >>>>> + snprintf(line, sizeof(line), " pxe0: %s:%s\n", >>>>> + inet_ntoa(rootip), rootpath); >>>>> + } else { >>>>> + snprintf(line, sizeof(line), " pxe0:\n"); >>>>> + } >>>>> + return (pager_output(line)); >>>>> } >>>>> >>>>> static void >>>>> >>>>> Modified: head/sys/boot/mips/beri/loader/beri_disk_cfi.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 >>>>> 06:13:22 2016 (r308433) >>>>> +++ head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 >>>>> 06:50:18 2016 (r308434) >>>>> @@ -47,7 +47,7 @@ static int beri_cfi_disk_close(struct op >>>>> static void beri_cfi_disk_cleanup(void); >>>>> static int beri_cfi_disk_strategy(void *, int, daddr_t, size_t, >>>>> size_t, >>>>> char *, size_t *); >>>>> -static void beri_cfi_disk_print(int); >>>>> +static int beri_cfi_disk_print(int); >>>>> >>>>> struct devsw beri_cfi_disk =3D { >>>>> .dv_name =3D "cfi", >>>>> @@ -112,25 +112,29 @@ beri_cfi_disk_close(struct open_file *f) >>>>> return (disk_close(dev)); >>>>> } >>>>> >>>>> -static void >>>>> +static int >>>>> beri_cfi_disk_print(int verbose) >>>>> { >>>>> struct disk_devdesc dev; >>>>> char line[80]; >>>>> + int ret; >>>>> >>>>> - sprintf(line, " cfi%d CFI flash device\n", 0); >>>>> - pager_output(line); >>>>> + snprintf(line, sizeof(line), " cfi%d CFI flash device\n"= , >>>>> 0); >>>>> + ret =3D pager_output(line); >>>>> + if (ret !=3D 0) >>>>> + return (ret); >>>>> dev.d_dev =3D &beri_cfi_disk; >>>>> dev.d_unit =3D 0; >>>>> dev.d_slice =3D -1; >>>>> dev.d_partition =3D -1; >>>>> if (disk_open(&dev, cfi_get_mediasize(), >>>>> cfi_get_sectorsize(), 0) =3D=3D 0) { >>>>> - sprintf(line, " cfi%d", 0); >>>>> - disk_print(&dev, line, verbose); >>>>> + snprintf(line, sizeof(line), " cfi%d", 0); >>>>> + ret =3D disk_print(&dev, line, verbose); >>>>> disk_close(&dev); >>>>> } >>>>> >>>>> + return (ret); >>>>> } >>>>> >>>>> static void >>>>> >>>>> Modified: head/sys/boot/mips/beri/loader/beri_disk_sdcard.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 >>>>> 06:13:22 2016 (r308433) >>>>> +++ head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 >>>>> 06:50:18 2016 (r308434) >>>>> @@ -47,7 +47,7 @@ static int beri_sdcard_disk_close(struct >>>>> static void beri_sdcard_disk_cleanup(void); >>>>> static int beri_sdcard_disk_strategy(void *, int, daddr_t, size_t= , >>>>> size_t, >>>>> char *, size_t *); >>>>> -static void beri_sdcard_disk_print(int); >>>>> +static int beri_sdcard_disk_print(int); >>>>> >>>>> struct devsw beri_sdcard_disk =3D { >>>>> .dv_name =3D "sdcard", >>>>> @@ -123,19 +123,23 @@ beri_sdcard_disk_print(int verbose) >>>>> { >>>>> struct disk_devdesc dev; >>>>> char line[80]; >>>>> + int ret; >>>>> >>>>> - sprintf(line, " sdcard%d Altera SD card drive\n", 0); >>>>> - pager_output(line); >>>>> + snprintf(line, sizeof(line), " sdcard%d Altera SD card >>>>> drive\n", 0); >>>>> + ret =3D pager_output(line); >>>>> + if (ret !=3D 0) >>>>> + return (ret); >>>>> dev.d_dev =3D &beri_sdcard_disk; >>>>> dev.d_unit =3D 0; >>>>> dev.d_slice =3D -1; >>>>> dev.d_partition =3D -1; >>>>> if (disk_open(&dev, altera_sdcard_get_mediasize(), >>>>> altera_sdcard_get_sectorsize(), 0) =3D=3D 0) { >>>>> - sprintf(line, " sdcard%d", 0); >>>>> - disk_print(&dev, line, verbose); >>>>> + snprintf(line, sizeof(line), " sdcard%d", 0); >>>>> + ret =3D disk_print(&dev, line, verbose); >>>>> disk_close(&dev); >>>>> } >>>>> + return (ret); >>>>> } >>>>> >>>>> static void >>>>> >>>>> Modified: head/sys/boot/ofw/libofw/ofw_disk.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:13:22 2016 >>>>> (r308433) >>>>> +++ head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:50:18 2016 >>>>> (r308434) >>>>> @@ -47,7 +47,7 @@ static int ofwd_strategy(void *devdata, >>>>> static int ofwd_open(struct open_file *f, ...); >>>>> static int ofwd_close(struct open_file *f); >>>>> static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data= ); >>>>> -static void ofwd_print(int verbose); >>>>> +static int ofwd_print(int verbose); >>>>> >>>>> struct devsw ofwdisk =3D { >>>>> "block", >>>>> @@ -161,8 +161,8 @@ ofwd_ioctl(struct open_file *f __unused, >>>>> return (EINVAL); >>>>> } >>>>> >>>>> -static void >>>>> +static int >>>>> ofwd_print(int verbose __unused) >>>>> { >>>>> - >>>>> + return (0); >>>>> } >>>>> >>>>> Modified: head/sys/boot/pc98/libpc98/bioscd.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:13:22 2016 >>>>> (r308433) >>>>> +++ head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:50:18 2016 >>>>> (r308434) >>>>> @@ -99,7 +99,7 @@ static int bc_realstrategy(void *devdata >>>>> size_t offset, size_t size, char *buf, size_t >>>>> *rsize); >>>>> static int bc_open(struct open_file *f, ...); >>>>> static int bc_close(struct open_file *f); >>>>> -static void bc_print(int verbose); >>>>> +static int bc_print(int verbose); >>>>> >>>>> struct devsw bioscd =3D { >>>>> "cd", >>>>> @@ -173,20 +173,19 @@ bc_add(int biosdev) >>>>> /* >>>>> * Print information about disks >>>>> */ >>>>> -static void >>>>> +static int >>>>> bc_print(int verbose) >>>>> { >>>>> char line[80]; >>>>> - int i; >>>>> + int i, ret =3D 0; >>>>> >>>>> - pager_open(); >>>>> for (i =3D 0; i < nbcinfo; i++) { >>>>> sprintf(line, " cd%d: Device 0x%x\n", i, >>>>> bcinfo[i].bc_sp.sp_devicespec); >>>>> - if (pager_output(line)) >>>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>>> break; >>>>> } >>>>> - pager_close(); >>>>> + return (ret); >>>>> } >>>>> >>>>> /* >>>>> >>>>> Modified: head/sys/boot/pc98/libpc98/biosdisk.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:13:22 2= 016 >>>>> (r308433) >>>>> +++ head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:50:18 2= 016 >>>>> (r308434) >>>>> @@ -123,7 +123,7 @@ static int bd_realstrategy(void *devdata >>>>> size_t offset, size_t size, char *buf, size_t >>>>> *rsize); >>>>> static int bd_open(struct open_file *f, ...); >>>>> static int bd_close(struct open_file *f); >>>>> -static void bd_print(int verbose); >>>>> +static int bd_print(int verbose); >>>>> >>>>> struct devsw biosdisk =3D { >>>>> "disk", >>>>> @@ -249,21 +249,20 @@ bd_int13probe(struct bdinfo *bd) >>>>> /* >>>>> * Print information about disks >>>>> */ >>>>> -static void >>>>> +static int >>>>> bd_print(int verbose) >>>>> { >>>>> - int i, j, done; >>>>> + int i, j, ret =3D 0; >>>>> char line[80]; >>>>> struct i386_devdesc dev; >>>>> struct open_disk *od; >>>>> struct pc98_partition *dptr; >>>>> >>>>> - pager_open(); >>>>> - done =3D 0; >>>>> - for (i =3D 0; i < nbdinfo && !done; i++) { >>>>> - sprintf(line, " disk%d: BIOS drive %c:\n", i, 'A' + i); >>>>> - if (pager_output(line)) >>>>> - break; >>>>> + for (i =3D 0; i < nbdinfo; i++) { >>>>> + snprintf(line, sizeof(line), " disk%d: BIOS drive %c:\n"= , >>>>> + i, 'A' + i); >>>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>>> + break; >>>>> >>>>> /* try to open the whole disk */ >>>>> dev.d_unit =3D i; >>>>> @@ -278,17 +277,17 @@ bd_print(int verbose) >>>>> >>>>> /* Check for a "dedicated" disk */ >>>>> for (j =3D 0; j < od->od_nslices; j++) { >>>>> - sprintf(line, " disk%ds%d", i, j + 1); >>>>> - if (bd_printslice(od, &dptr[j], line, verbose)) { >>>>> - done =3D 1; >>>>> - break; >>>>> - } >>>>> + snprintf(line, sizeof(line), " disk%ds%d", i= , j >>>>> + 1); >>>>> + if ((ret =3D bd_printslice(od, &dptr[j], line, >>>>> verbose)) !=3D 0) >>>>> + break; >>>>> } >>>>> } >>>>> bd_closedisk(od); >>>>> + if (ret !=3D 0) >>>>> + break; >>>>> } >>>>> } >>>>> - pager_close(); >>>>> + return (ret); >>>>> } >>>>> >>>>> /* Given a size in 512 byte sectors, convert it to a human-readable >>>>> number. */ >>>>> >>>>> Modified: head/sys/boot/powerpc/kboot/hostdisk.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:13:22 2= 016 >>>>> (r308433) >>>>> +++ head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:50:18 2= 016 >>>>> (r308434) >>>>> @@ -37,7 +37,7 @@ static int hostdisk_strategy(void *devda >>>>> static int hostdisk_open(struct open_file *f, ...); >>>>> static int hostdisk_close(struct open_file *f); >>>>> static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data= ); >>>>> -static void hostdisk_print(int verbose); >>>>> +static int hostdisk_print(int verbose); >>>>> >>>>> struct devsw hostdisk =3D { >>>>> "/dev", >>>>> @@ -117,9 +117,9 @@ hostdisk_ioctl(struct open_file *f, u_lo >>>>> return (EINVAL); >>>>> } >>>>> >>>>> -static void >>>>> +static int >>>>> hostdisk_print(int verbose) >>>>> { >>>>> - >>>>> + return (0); >>>>> } >>>>> >>>>> >>>>> Modified: head/sys/boot/powerpc/ps3/ps3cdrom.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:13:22 2= 016 >>>>> (r308433) >>>>> +++ head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:50:18 2= 016 >>>>> (r308434) >>>>> @@ -49,7 +49,7 @@ static int ps3cdrom_strategy(void *devda >>>>> size_t offset, size_t size, char *buf, size_t *rsize); >>>>> static int ps3cdrom_open(struct open_file *f, ...); >>>>> static int ps3cdrom_close(struct open_file *f); >>>>> -static void ps3cdrom_print(int verbose); >>>>> +static int ps3cdrom_print(int verbose); >>>>> >>>>> struct devsw ps3cdrom =3D { >>>>> "cd", >>>>> @@ -149,6 +149,7 @@ static int ps3cdrom_close(struct open_fi >>>>> return 0; >>>>> } >>>>> >>>>> -static void ps3cdrom_print(int verbose) >>>>> +static int ps3cdrom_print(int verbose) >>>>> { >>>>> + return (0); >>>>> } >>>>> >>>>> Modified: head/sys/boot/powerpc/ps3/ps3disk.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:13:22 2016 >>>>> (r308433) >>>>> +++ head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:50:18 2016 >>>>> (r308434) >>>>> @@ -61,7 +61,7 @@ static int ps3disk_strategy(void *devdat >>>>> size_t offset, size_t size, char *buf, size_t *rsize); >>>>> static int ps3disk_open(struct open_file *f, ...); >>>>> static int ps3disk_close(struct open_file *f); >>>>> -static void ps3disk_print(int verbose); >>>>> +static int ps3disk_print(int verbose); >>>>> >>>>> struct devsw ps3disk =3D { >>>>> "disk", >>>>> @@ -186,8 +186,9 @@ static int ps3disk_close(struct open_fil >>>>> return 0; >>>>> } >>>>> >>>>> -static void ps3disk_print(int verbose) >>>>> +static int ps3disk_print(int verbose) >>>>> { >>>>> + return (0); >>>>> } >>>>> >>>>> static int ps3disk_open_gpt(struct ps3_devdesc *dev, struct open_dev >>>>> *od) >>>>> >>>>> Modified: head/sys/boot/uboot/lib/disk.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:13:22 2016 >>>>> (r308433) >>>>> +++ head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:50:18 2016 >>>>> (r308434) >>>>> @@ -78,7 +78,7 @@ static int stor_strategy(void *, int, da >>>>> static int stor_open(struct open_file *, ...); >>>>> static int stor_close(struct open_file *); >>>>> static int stor_ioctl(struct open_file *f, u_long cmd, void *data); >>>>> -static void stor_print(int); >>>>> +static int stor_print(int); >>>>> static void stor_cleanup(void); >>>>> >>>>> struct devsw uboot_storage =3D { >>>>> @@ -238,30 +238,31 @@ stor_readdev(struct disk_devdesc *dev, d >>>>> return (err); >>>>> } >>>>> >>>>> -static void >>>>> +static int >>>>> stor_print(int verbose) >>>>> { >>>>> struct disk_devdesc dev; >>>>> static char line[80]; >>>>> - int i; >>>>> + int i, ret =3D 0; >>>>> >>>>> - pager_open(); >>>>> for (i =3D 0; i < stor_info_no; i++) { >>>>> dev.d_dev =3D &uboot_storage; >>>>> dev.d_unit =3D i; >>>>> dev.d_slice =3D -1; >>>>> dev.d_partition =3D -1; >>>>> - sprintf(line, "\tdisk%d (%s)\n", i, >>>>> + snprintf(line, sizeof(line), "\tdisk%d (%s)\n", i, >>>>> ub_stor_type(SI(&dev).type)); >>>>> - if (pager_output(line)) >>>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>>> break; >>>>> if (stor_opendev(&dev) =3D=3D 0) { >>>>> sprintf(line, "\tdisk%d", i); >>>>> - disk_print(&dev, line, verbose); >>>>> + ret =3D disk_print(&dev, line, verbose); >>>>> disk_close(&dev); >>>>> + if (ret !=3D 0) >>>>> + break; >>>>> } >>>>> } >>>>> - pager_close(); >>>>> + return (ret); >>>>> } >>>>> >>>>> static int >>>>> >>>>> Modified: head/sys/boot/usb/storage/umass_loader.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:13:22 2= 016 >>>>> (r308433) >>>>> +++ head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:50:18 2= 016 >>>>> (r308434) >>>>> @@ -50,7 +50,7 @@ static void umass_disk_cleanup(void); >>>>> static int umass_disk_ioctl(struct open_file *, u_long, void *); >>>>> static int umass_disk_strategy(void *, int, daddr_t, size_t, size_t, >>>>> char *, >>>>> size_t *); >>>>> -static void umass_disk_print(int); >>>>> +static int umass_disk_print(int); >>>>> >>>>> struct devsw umass_disk =3D { >>>>> .dv_name =3D "umass", >>>>> @@ -170,23 +170,26 @@ umass_disk_close(struct open_file *f) >>>>> return (disk_close(dev)); >>>>> } >>>>> >>>>> -static void >>>>> +static int >>>>> umass_disk_print(int verbose) >>>>> { >>>>> struct disk_devdesc dev; >>>>> >>>>> memset(&dev, 0, sizeof(dev)); >>>>> >>>>> - pager_output(" umass0 UMASS device\n"); >>>>> + ret =3D pager_output(" umass0 UMASS device\n"); >>>>> + if (ret !=3D 0) >>>>> + return (ret); >>>>> dev.d_dev =3D &umass_disk; >>>>> dev.d_unit =3D 0; >>>>> dev.d_slice =3D -1; >>>>> dev.d_partition =3D -1; >>>>> >>>>> if (umass_disk_open_sub(&dev) =3D=3D 0) { >>>>> - disk_print(&dev, " umass0", verbose); >>>>> + ret =3D disk_print(&dev, " umass0", verbose); >>>>> disk_close(&dev); >>>>> } >>>>> + return (ret); >>>>> } >>>>> >>>>> static void >>>>> >>>>> Modified: head/sys/boot/userboot/userboot/host.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:13:22 2= 016 >>>>> (r308433) >>>>> +++ head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:50:18 2= 016 >>>>> (r308434) >>>>> @@ -134,13 +134,13 @@ host_dev_init(void) >>>>> return (0); >>>>> } >>>>> >>>>> -static void >>>>> +static int >>>>> host_dev_print(int verbose) >>>>> { >>>>> char line[80]; >>>>> >>>>> - sprintf(line, " host%d: Host filesystem\n", 0); >>>>> - pager_output(line); >>>>> + snprintf(line, sizeof(line), " host%d: Host filesystem\n= ", >>>>> 0); >>>>> + return (pager_output(line)); >>>>> } >>>>> >>>>> /* >>>>> >>>>> Modified: head/sys/boot/userboot/userboot/userboot_disk.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 >>>>> 06:13:22 2016 (r308433) >>>>> +++ head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 >>>>> 06:50:18 2016 (r308434) >>>>> @@ -60,7 +60,7 @@ static int userdisk_realstrategy(void *d >>>>> static int userdisk_open(struct open_file *f, ...); >>>>> static int userdisk_close(struct open_file *f); >>>>> static int userdisk_ioctl(struct open_file *f, u_long cmd, void >>>>> *data); >>>>> -static void userdisk_print(int verbose); >>>>> +static int userdisk_print(int verbose); >>>>> >>>>> struct devsw userboot_disk =3D { >>>>> "disk", >>>>> @@ -116,27 +116,33 @@ userdisk_cleanup(void) >>>>> /* >>>>> * Print information about disks >>>>> */ >>>>> -static void >>>>> +static int >>>>> userdisk_print(int verbose) >>>>> { >>>>> struct disk_devdesc dev; >>>>> char line[80]; >>>>> - int i; >>>>> + int i, ret =3D 0; >>>>> >>>>> for (i =3D 0; i < userdisk_maxunit; i++) { >>>>> - sprintf(line, " disk%d: Guest drive image\n", i)= ; >>>>> - pager_output(line); >>>>> + snprintf(line, sizeof(line), >>>>> + " disk%d: Guest drive image\n", i); >>>>> + ret =3D pager_output(line); >>>>> + if (ret !=3D 0) >>>>> + break; >>>>> dev.d_dev =3D &userboot_disk; >>>>> dev.d_unit =3D i; >>>>> dev.d_slice =3D -1; >>>>> dev.d_partition =3D -1; >>>>> if (disk_open(&dev, ud_info[i].mediasize, >>>>> ud_info[i].sectorsize, 0) =3D=3D 0) { >>>>> - sprintf(line, " disk%d", i); >>>>> - disk_print(&dev, line, verbose); >>>>> + snprintf(line, sizeof(line), " disk%d", i)= ; >>>>> + ret =3D disk_print(&dev, line, verbose); >>>>> disk_close(&dev); >>>>> + if (ret !=3D 0) >>>>> + break; >>>>> } >>>>> } >>>>> + return (ret); >>>>> } >>>>> >>>>> /* >>>>> >>>>> Modified: head/sys/boot/zfs/zfs.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/zfs/zfs.c Tue Nov 8 06:13:22 2016 (r308= 433) >>>>> +++ head/sys/boot/zfs/zfs.c Tue Nov 8 06:50:18 2016 (r308= 434) >>>>> @@ -514,20 +514,23 @@ zfs_probe_dev(const char *devname, uint6 >>>>> /* >>>>> * Print information about ZFS pools >>>>> */ >>>>> -static void >>>>> +static int >>>>> zfs_dev_print(int verbose) >>>>> { >>>>> spa_t *spa; >>>>> char line[80]; >>>>> + int ret =3D 0; >>>>> >>>>> if (verbose) { >>>>> - spa_all_status(); >>>>> - return; >>>>> + return (spa_all_status()); >>>>> } >>>>> STAILQ_FOREACH(spa, &zfs_pools, spa_link) { >>>>> - sprintf(line, " zfs:%s\n", spa->spa_name); >>>>> - pager_output(line); >>>>> + snprintf(line, sizeof(line), " zfs:%s\n", >>>>> spa->spa_name); >>>>> + ret =3D pager_output(line); >>>>> + if (ret !=3D 0) >>>>> + break; >>>>> } >>>>> + return (ret); >>>>> } >>>>> >>>>> /* >>>>> >>>>> Modified: head/sys/boot/zfs/zfsimpl.c >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:13:22 2016 (r308= 433) >>>>> +++ head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:50:18 2016 (r308= 434) >>>>> @@ -780,7 +780,7 @@ state_name(vdev_state_t state) >>>>> >>>>> #else >>>>> >>>>> -static void >>>>> +static int >>>>> pager_printf(const char *fmt, ...) >>>>> { >>>>> char line[80]; >>>>> @@ -789,14 +789,14 @@ pager_printf(const char *fmt, ...) >>>>> va_start(args, fmt); >>>>> vsprintf(line, fmt, args); >>>>> va_end(args); >>>>> - pager_output(line); >>>>> + return (pager_output(line)); >>>>> } >>>>> >>>>> #endif >>>>> >>>>> #define STATUS_FORMAT " %s %s\n" >>>>> >>>>> -static void >>>>> +static int >>>>> print_state(int indent, const char *name, vdev_state_t state) >>>>> { >>>>> int i; >>>>> @@ -806,40 +806,56 @@ print_state(int indent, const char *name >>>>> for (i =3D 0; i < indent; i++) >>>>> strcat(buf, " "); >>>>> strcat(buf, name); >>>>> >>>>> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >>>>> _______________________________________________ >>>>> svn-src-head@freebsd.org mailing list >>>>> https://lists.freebsd.org/mailman/listinfo/svn-src-head >>>>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.or= g" >>>> >>>> >>>> >>> > From owner-svn-src-head@freebsd.org Fri Nov 11 17:41:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65163C3C4CB; Fri, 11 Nov 2016 17:41:18 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A8B813DB; Fri, 11 Nov 2016 17:41:18 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABHfHci046813; Fri, 11 Nov 2016 17:41:17 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABHfHLq046812; Fri, 11 Nov 2016 17:41:17 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201611111741.uABHfHLq046812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 11 Nov 2016 17:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308535 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 17:41:18 -0000 Author: stevek Date: Fri Nov 11 17:41:17 2016 New Revision: 308535 URL: https://svnweb.freebsd.org/changeset/base/308535 Log: Add support for LOADER_RC setting in the pkgfs manifest (defaults to /loader.rc) to specify a Forth file to read from the pkgfs tarball and process by Ficl. This allows for the tarball to do runtime things like load a platform-specific FDT blob, among other things. Reviewed by: imp Approved by: sjg (mentor) MFC after: 2 weeks Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D8494 Modified: head/sys/boot/common/install.c Modified: head/sys/boot/common/install.c ============================================================================== --- head/sys/boot/common/install.c Fri Nov 11 16:59:26 2016 (r308534) +++ head/sys/boot/common/install.c Fri Nov 11 17:41:17 2016 (r308535) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" -extern struct in_addr rootip; extern struct in_addr servip; extern int pkgfs_init(const char *, struct fs_ops *); @@ -50,6 +49,7 @@ COMMAND_SET(install, "install", "install static char *inst_kernel; static char **inst_modules; static char *inst_rootfs; +static char *inst_loader_rc; static int setpath(char **what, char *val) @@ -146,6 +146,8 @@ read_metatags(int fd) error = setmultipath(&inst_modules, val); else if (strcmp(tag, "ROOTFS") == 0) error = setpath(&inst_rootfs, val); + else if (strcmp(tag, "LOADER_RC") == 0) + error = setpath(&inst_loader_rc, val); tag = p; } @@ -173,6 +175,10 @@ cleanup(void) free(inst_rootfs); inst_rootfs = NULL; } + if (inst_loader_rc != NULL) { + free(inst_loader_rc); + inst_loader_rc = NULL; + } pkgfs_cleanup(); } @@ -275,6 +281,16 @@ install(char *pkgname) goto fail; } + /* If there is a loader.rc in the package, execute it */ + s = (inst_loader_rc == NULL) ? "/loader.rc" : inst_loader_rc; + fd = open(s, O_RDONLY); + if (fd != -1) { + close(fd); + error = include(s); + if (error == CMD_ERROR) + goto fail; + } + i = 0; while (inst_modules != NULL && inst_modules[i] != NULL) { error = mod_loadkld(inst_modules[i], 0, NULL); From owner-svn-src-head@freebsd.org Fri Nov 11 18:10:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D91EC3C9FF; Fri, 11 Nov 2016 18:10:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEBE91260; Fri, 11 Nov 2016 18:10:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABIAEh4062908; Fri, 11 Nov 2016 18:10:14 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABIADni062903; Fri, 11 Nov 2016 18:10:13 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201611111810.uABIADni062903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 11 Nov 2016 18:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308536 - head/sys/dev/dpaa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 18:10:15 -0000 Author: jhibbits Date: Fri Nov 11 18:10:13 2016 New Revision: 308536 URL: https://svnweb.freebsd.org/changeset/base/308536 Log: Use ofw_bus_node_is_compatible() instead of fdt_is_compatible() No need to have two functions that do the same thing, let's let fdt_* go away, and use ofw_bus_* equivalents instead. Requested by: andrew Modified: head/sys/dev/dpaa/bman_fdt.c head/sys/dev/dpaa/if_dtsec_fdt.c head/sys/dev/dpaa/qman_fdt.c Modified: head/sys/dev/dpaa/bman_fdt.c ============================================================================== --- head/sys/dev/dpaa/bman_fdt.c Fri Nov 11 17:41:17 2016 (r308535) +++ head/sys/dev/dpaa/bman_fdt.c Fri Nov 11 18:10:13 2016 (r308536) @@ -36,8 +36,6 @@ __FBSDID("$FreeBSD$"); #include -#include - #include #include #include @@ -154,7 +152,7 @@ bman_portals_fdt_attach(device_t dev) /* Find portals tied to CPUs */ for (child = OF_child(node); child != 0; child = OF_peer(child)) { - if (!fdt_is_compatible(child, "fsl,bman-portal")) { + if (!ofw_bus_node_is_compatible(child, "fsl,bman-portal")) { continue; } /* Checkout related cpu */ Modified: head/sys/dev/dpaa/if_dtsec_fdt.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec_fdt.c Fri Nov 11 17:41:17 2016 (r308535) +++ head/sys/dev/dpaa/if_dtsec_fdt.c Fri Nov 11 18:10:13 2016 (r308536) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -156,9 +155,9 @@ dtsec_fdt_attach(device_t dev) } /* Get link speed */ - if (fdt_is_compatible(enet_node, "fsl,fman-1g-mac") != 0) + if (ofw_bus_node_is_compatible(enet_node, "fsl,fman-1g-mac") != 0) sc->sc_eth_dev_type = ETH_DTSEC; - else if (fdt_is_compatible(enet_node, "fsl,fman-10g-mac") != 0) + else if (ofw_bus_node_is_compatible(enet_node, "fsl,fman-10g-mac") != 0) sc->sc_eth_dev_type = ETH_10GSEC; else return(ENXIO); @@ -211,10 +210,12 @@ dtsec_fdt_attach(device_t dev) fman_rxtx_node[0] = OF_instance_to_package(fman_rxtx_node[0]); fman_rxtx_node[1] = OF_instance_to_package(fman_rxtx_node[1]); - if (fdt_is_compatible(fman_rxtx_node[0], "fsl,fman-port-1g-rx") == 0) + if (ofw_bus_node_is_compatible(fman_rxtx_node[0], + "fsl,fman-port-1g-rx") == 0) return (ENXIO); - if (fdt_is_compatible(fman_rxtx_node[1], "fsl,fman-port-1g-tx") == 0) + if (ofw_bus_node_is_compatible(fman_rxtx_node[1], + "fsl,fman-port-1g-tx") == 0) return (ENXIO); /* Get RX port HW id */ Modified: head/sys/dev/dpaa/qman_fdt.c ============================================================================== --- head/sys/dev/dpaa/qman_fdt.c Fri Nov 11 17:41:17 2016 (r308535) +++ head/sys/dev/dpaa/qman_fdt.c Fri Nov 11 18:10:13 2016 (r308536) @@ -36,8 +36,6 @@ __FBSDID("$FreeBSD$"); #include -#include - #include #include #include @@ -154,7 +152,7 @@ qman_portals_fdt_attach(device_t dev) /* Find portals tied to CPUs */ for (child = OF_child(node); child != 0; child = OF_peer(child)) { - if (!fdt_is_compatible(child, "fsl,qman-portal")) { + if (!ofw_bus_node_is_compatible(child, "fsl,qman-portal")) { continue; } /* Checkout related cpu */ From owner-svn-src-head@freebsd.org Fri Nov 11 18:20:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3637FC3CFA2; Fri, 11 Nov 2016 18:20:59 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp004.me.com (st13p35im-asmtp004.me.com [17.164.199.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECD981A34; Fri, 11 Nov 2016 18:20:58 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp004.me.com by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OGH00800ML0W300@st13p35im-asmtp004.me.com>; Fri, 11 Nov 2016 17:20:51 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1478884851; bh=1FYsWbe5woVwZDqtmWJIgikyDXFxu1DivHlDR0810no=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=Mp9+MZIkwkJQBzdMVcA9wPHo6bpdaIkz64SPmEydF9zlLkCWq3E0BXmtrDb2loG/K awzGOVH+cbY3hZ3hGhMwhwUL78Arp0UxkZrMRzuLKTwrnNsXAYpKOba5vcmTQMHQAu WUlS2MwrJl87g+3+Ui7rLgla70u9MlFSbZ2+ThHm3VRZGOZvtZH34r3LglI8160A/Y /ZE5KBw8KWIvk8bT6ioeG7QlHI7ABa+qIo+tt6fX9h6JS0dArIVAaREjuz9pey0sGX v1zr/j65jXzqfFWQmctWvvKKjZHADEYHP+Da9/rWo9CwREMHd6YERbOcoe2GkhrALs sINpYAQec9XNA== Received: from nazgul.lan (220-90-235-80.dyn.estpak.ee [80.235.90.220]) by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OGH008DEMUNPU00@st13p35im-asmtp004.me.com>; Fri, 11 Nov 2016 17:20:51 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-11_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=27 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1611110306 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r308434 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libofw sys... From: Toomas Soome In-reply-to: Date: Fri, 11 Nov 2016 19:20:46 +0200 Cc: Kamil Czekirda , Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-transfer-encoding: quoted-printable Message-id: <0B89F169-9FAB-4FEA-BBBE-0000DE54F09A@me.com> References: <201611080650.uA86oJ7W056026@repo.freebsd.org> <8E0E5C94-EFD7-4008-B563-FF080A98F23D@me.com> To: Warner Losh X-Mailer: Apple Mail (2.3251) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 18:20:59 -0000 > On 11. nov 2016, at 19:08, Warner Losh wrote: >=20 > This suggests we've created an update / upgrade problem. Do we? >=20 > Warner Not if the normal build suggestion (make buildworld buildkernel) is = followed, as then the headers from the source tree are put in proper = place as part of the build procedure - in this case the source was = fetched by svn update and attempt was made to build part of the fetched = tree. In that sense, I don=E2=80=99t see the problem, as direct build without = scene setup is not really supported. Or am I wrong? The same issue will = happen with any header change, as you can not really build new source = with using old headers. rgds, toomas >=20 > On Thu, Nov 10, 2016 at 11:52 PM, Kamil Czekirda = wrote: >> cp /usr/src/lib/libstand/libstand.h /usr/include/stand.h fixed that >>=20 >> thanks >>=20 >> 2016-11-10 23:28 GMT+01:00 Toomas Soome : >>>=20 >>> the patch does update the lib/libstand/stand.h to have: >>>=20 >>> struct devsw { >>> . . . >>> int (*dv_print)(int verbose); >>>=20 >>> it was void before; from your svnlite log I can see the >>> lib/libstand/stand.h is updated, could you confirm if it is int now? = if it >>> is, I suspect the build is getting the old stand.h from somewhere in = the >>> tree and not your /lib/libstand. >>>=20 >>> if so, does the build has target to copy headers in place? I=E2=80=99m= sorry, I >>> don't know all the tricks the build system does as part of the = buildworld.. >>>=20 >>> rgds, >>> toomas >>>=20 >>>=20 >>> On 11. nov 2016, at 0:21, Kamil Czekirda = wrote: >>>=20 >>> Hi, >>>=20 >>> I got the following: >>>=20 >>> root@current:/usr/src # svnlite up -r r308434 >>> Updating '.': >>> U lib/libstand/stand.h >>> U sys/boot/common/dev_net.c >>> U sys/boot/common/module.c >>> U sys/boot/common/part.c >>> U sys/boot/common/util.c >>> U sys/boot/common/util.h >>> U sys/boot/efi/libefi/efinet.c >>> U sys/boot/efi/libefi/efipart.c >>> U sys/boot/efi/loader/main.c >>> U sys/boot/i386/libfirewire/firewire.c >>> U sys/boot/i386/libi386/bioscd.c >>> U sys/boot/i386/libi386/biosdisk.c >>> U sys/boot/mips/beri/loader/beri_disk_cfi.c >>> U sys/boot/mips/beri/loader/beri_disk_sdcard.c >>> U sys/boot/ofw/libofw/ofw_disk.c >>> U sys/boot/pc98/libpc98/bioscd.c >>> U sys/boot/pc98/libpc98/biosdisk.c >>> U sys/boot/powerpc/kboot/hostdisk.c >>> U sys/boot/powerpc/ps3/ps3cdrom.c >>> U sys/boot/powerpc/ps3/ps3disk.c >>> U sys/boot/uboot/lib/disk.c >>> U sys/boot/usb/storage/umass_loader.c >>> U sys/boot/userboot/userboot/host.c >>> U sys/boot/userboot/userboot/userboot_disk.c >>> U sys/boot/zfs/zfs.c >>> U sys/boot/zfs/zfsimpl.c >>> U sys/boot/i386/libi386/pxe.c >>> Updated to revision 308434. >>> root@current:/usr/src # cd sys/boot/ >>> root@current:/usr/src/sys/boot # make clean >>> (...) >>> root@current:/usr/src/sys/boot # make obj >>> (...) >>> root@current:/usr/src/sys/boot # make >>> (...) >>> cc -O2 -pipe -DSKEIN_LOOP=3D111 -fPIC = -I/usr/src/sys/boot/efi/loader >>> -I/usr/src/sys/boot/efi/loader/arch/amd64 >>> -I/usr/src/sys/boot/efi/loader/../include >>> -I/usr/src/sys/boot/efi/loader/../include/amd64 >>> -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include >>> -I/usr/src/sys/boot/efi/loader/../../.. >>> -I/usr/src/sys/boot/efi/loader/../../i386/libi386 >>> -I/usr/src/sys/boot/efi/loader/../../zfs >>> -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs >>> -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT = -DNO_PCI >>> -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH >>> -I/usr/src/sys/boot/efi/loader/../../ficl >>> -I/usr/src/sys/boot/efi/loader/../../ficl/amd64 = -DLOADER_DISK_SUPPORT >>> -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC = -I/usr/src/sys/boot/ficl >>> -I/usr/src/sys/boot/ficl/amd64 -I/usr/src/sys/boot/ficl/../common >>> -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat >>> -msoft-float -mno-mmx -mno-sse -mno-avx -fshort-wchar -mno-red-zone = -mno-aes >>> -g -MD -MF.depend.vers.o -MTvers.o -std=3Dgnu99 -Wsystem-headers = -Werror >>> -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes >>> -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized = -Wno-pointer-sign >>> -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable >>> -Wno-tautological-compare -Wno-unused-value = -Wno-parentheses-equality >>> -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef >>> -Qunused-arguments -c vers.c -o vers.o >>> cc -O2 -pipe -DSKEIN_LOOP=3D111 -fPIC = -I/usr/src/sys/boot/efi/loader >>> -I/usr/src/sys/boot/efi/loader/arch/amd64 >>> -I/usr/src/sys/boot/efi/loader/../include >>> -I/usr/src/sys/boot/efi/loader/../include/amd64 >>> -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include >>> -I/usr/src/sys/boot/efi/loader/../../.. >>> -I/usr/src/sys/boot/efi/loader/../../i386/libi386 >>> -I/usr/src/sys/boot/efi/loader/../../zfs >>> -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs >>> -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT = -DNO_PCI >>> -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH >>> -I/usr/src/sys/boot/efi/loader/../../ficl >>> -I/usr/src/sys/boot/efi/loader/../../ficl/amd64 = -DLOADER_DISK_SUPPORT >>> -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC = -I/usr/src/sys/boot/ficl >>> -I/usr/src/sys/boot/ficl/amd64 -I/usr/src/sys/boot/ficl/../common >>> -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat >>> -msoft-float -mno-mmx -mno-sse -mno-avx -fshort-wchar -mno-red-zone = -mno-aes >>> -g -MD -MF.depend.zfs.o -MTzfs.o -std=3Dgnu99 -Wsystem-headers = -Werror -Wall >>> -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes >>> -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized = -Wno-pointer-sign >>> -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable >>> -Wno-tautological-compare -Wno-unused-value = -Wno-parentheses-equality >>> -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef >>> -Wno-sign-compare -Wno-array-bounds -Wno-missing-prototypes >>> -Qunused-arguments -c /usr/src/sys/boot/efi/loader/../../zfs/zfs.c = -o zfs.o >>> /usr/src/sys/boot/efi/loader/../../zfs/zfs.c:599:14: error: = incompatible >>> pointer types initializing 'void (*)(int)' with an expression of = type 'int >>> (int)' [-Werror,-Wincompatible-pointer-types] >>> .dv_print =3D zfs_dev_print, >>> ^~~~~~~~~~~~~ >>> 1 error generated. >>> *** Error code 1 >>>=20 >>> Stop. >>> make[2]: stopped in /usr/src/sys/boot/efi/loader >>> *** Error code 1 >>>=20 >>> Stop. >>> make[1]: stopped in /usr/src/sys/boot/efi >>> *** Error code 1 >>>=20 >>> Stop. >>> make: stopped in /usr/src/sys/boot >>>=20 >>>=20 >>> Kamil >>>=20 >>> 2016-11-08 7:50 GMT+01:00 Toomas Soome : >>>>=20 >>>> Author: tsoome >>>> Date: Tue Nov 8 06:50:18 2016 >>>> New Revision: 308434 >>>> URL: https://svnweb.freebsd.org/changeset/base/308434 >>>>=20 >>>> Log: >>>> Loader paged/pageable data is not always paged. >>>>=20 >>>> This change does modify devsw dv_print() to return the int value, >>>> enabling walkers to interrupt the walk on non zero value from >>>> dv_print(). >>>>=20 >>>> This will allow the pager_print actually to stop displaying data = on >>>> user input, and additionally pager is used in various *dev_print >>>> callbacks, >>>> where it was missing. >>>>=20 >>>> For test, lsdev [-v] command should display data by screenfuls and >>>> should >>>> stop when the key 'q' is pressed on pager prompt. >>>>=20 >>>> Reviewed by: allanjude >>>> Approved by: allanjude (mentor) >>>> Differential Revision: https://reviews.freebsd.org/D5461 >>>>=20 >>>> Modified: >>>> head/lib/libstand/stand.h >>>> head/sys/boot/common/dev_net.c >>>> head/sys/boot/common/module.c >>>> head/sys/boot/common/part.c >>>> head/sys/boot/common/util.c >>>> head/sys/boot/common/util.h >>>> head/sys/boot/efi/libefi/efinet.c >>>> head/sys/boot/efi/libefi/efipart.c >>>> head/sys/boot/efi/loader/main.c >>>> head/sys/boot/i386/libfirewire/firewire.c >>>> head/sys/boot/i386/libi386/bioscd.c >>>> head/sys/boot/i386/libi386/biosdisk.c >>>> head/sys/boot/i386/libi386/pxe.c >>>> head/sys/boot/mips/beri/loader/beri_disk_cfi.c >>>> head/sys/boot/mips/beri/loader/beri_disk_sdcard.c >>>> head/sys/boot/ofw/libofw/ofw_disk.c >>>> head/sys/boot/pc98/libpc98/bioscd.c >>>> head/sys/boot/pc98/libpc98/biosdisk.c >>>> head/sys/boot/powerpc/kboot/hostdisk.c >>>> head/sys/boot/powerpc/ps3/ps3cdrom.c >>>> head/sys/boot/powerpc/ps3/ps3disk.c >>>> head/sys/boot/uboot/lib/disk.c >>>> head/sys/boot/usb/storage/umass_loader.c >>>> head/sys/boot/userboot/userboot/host.c >>>> head/sys/boot/userboot/userboot/userboot_disk.c >>>> head/sys/boot/zfs/zfs.c >>>> head/sys/boot/zfs/zfsimpl.c >>>>=20 >>>> Modified: head/lib/libstand/stand.h >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/lib/libstand/stand.h Tue Nov 8 06:13:22 2016 = (r308433) >>>> +++ head/lib/libstand/stand.h Tue Nov 8 06:50:18 2016 = (r308434) >>>> @@ -143,7 +143,7 @@ struct devsw { >>>> int (*dv_open)(struct open_file *f, ...); >>>> int (*dv_close)(struct open_file *f); >>>> int (*dv_ioctl)(struct open_file *f, u_long cmd, = void >>>> *data); >>>> - void (*dv_print)(int verbose); /* print device >>>> information */ >>>> + int (*dv_print)(int verbose); /* print = device >>>> information */ >>>> void (*dv_cleanup)(void); >>>> }; >>>>=20 >>>>=20 >>>> Modified: head/sys/boot/common/dev_net.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/common/dev_net.c Tue Nov 8 06:13:22 2016 >>>> (r308433) >>>> +++ head/sys/boot/common/dev_net.c Tue Nov 8 06:50:18 2016 >>>> (r308434) >>>> @@ -80,7 +80,7 @@ static int net_open(struct open_file *, >>>> static int net_close(struct open_file *); >>>> static void net_cleanup(void); >>>> static int net_strategy(); >>>> -static void net_print(int); >>>> +static int net_print(int); >>>>=20 >>>> static int net_getparams(int sock); >>>>=20 >>>> @@ -325,23 +325,27 @@ exit: >>>> return (0); >>>> } >>>>=20 >>>> -static void >>>> +static int >>>> net_print(int verbose) >>>> { >>>> struct netif_driver *drv; >>>> int i, d, cnt; >>>> + int ret =3D 0; >>>>=20 >>>> cnt =3D 0; >>>> for (d =3D 0; netif_drivers[d]; d++) { >>>> drv =3D netif_drivers[d]; >>>> for (i =3D 0; i < drv->netif_nifs; i++) { >>>> printf("\t%s%d:", "net", cnt++); >>>> - if (verbose) >>>> + if (verbose) { >>>> printf(" (%s%d)", drv->netif_bname, >>>> drv->netif_ifs[i].dif_unit); >>>> + } >>>> + if ((ret =3D pager_output("\n")) !=3D 0) >>>> + return (ret); >>>> } >>>> } >>>> - printf("\n"); >>>> + return (ret); >>>> } >>>>=20 >>>> /* >>>>=20 >>>> Modified: head/sys/boot/common/module.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/common/module.c Tue Nov 8 06:13:22 2016 >>>> (r308433) >>>> +++ head/sys/boot/common/module.c Tue Nov 8 06:50:18 2016 >>>> (r308434) >>>> @@ -254,7 +254,7 @@ command_lsmod(int argc, char *argv[]) >>>> struct kernel_module *mp; >>>> struct file_metadata *md; >>>> char lbuf[80]; >>>> - int ch, verbose; >>>> + int ch, verbose, ret =3D 0; >>>>=20 >>>> verbose =3D 0; >>>> optind =3D 1; >>>> @@ -273,11 +273,13 @@ command_lsmod(int argc, char *argv[]) >>>>=20 >>>> pager_open(); >>>> for (fp =3D preloaded_files; fp; fp =3D fp->f_next) { >>>> - sprintf(lbuf, " %p: ", (void *) fp->f_addr); >>>> + snprintf(lbuf, sizeof(lbuf), " %p: ", (void *) fp->f_addr); >>>> pager_output(lbuf); >>>> pager_output(fp->f_name); >>>> - sprintf(lbuf, " (%s, 0x%lx)\n", fp->f_type, = (long)fp->f_size); >>>> - pager_output(lbuf); >>>> + snprintf(lbuf, sizeof(lbuf), " (%s, 0x%lx)\n", fp->f_type, >>>> + (long)fp->f_size); >>>> + if (pager_output(lbuf)) >>>> + break; >>>> if (fp->f_args !=3D NULL) { >>>> pager_output(" args: "); >>>> pager_output(fp->f_args); >>>> @@ -287,7 +289,8 @@ command_lsmod(int argc, char *argv[]) >>>> if (fp->f_modules) { >>>> pager_output(" modules: "); >>>> for (mp =3D fp->f_modules; mp; mp =3D mp->m_next) { >>>> - sprintf(lbuf, "%s.%d ", mp->m_name, mp->m_version); >>>> + snprintf(lbuf, sizeof(lbuf), "%s.%d ", mp->m_name, >>>> + mp->m_version); >>>> pager_output(lbuf); >>>> } >>>> if (pager_output("\n")) >>>> @@ -296,11 +299,14 @@ command_lsmod(int argc, char *argv[]) >>>> if (verbose) { >>>> /* XXX could add some formatting smarts here to display = some >>>> better */ >>>> for (md =3D fp->f_metadata; md !=3D NULL; md =3D = md->md_next) { >>>> - sprintf(lbuf, " 0x%04x, 0x%lx\n", md->md_type, >>>> (long) md->md_size); >>>> + snprintf(lbuf, sizeof(lbuf), " 0x%04x, = 0x%lx\n", >>>> + md->md_type, (long) md->md_size); >>>> if (pager_output(lbuf)) >>>> break; >>>> } >>>> } >>>> + if (ret) >>>> + break; >>>> } >>>> pager_close(); >>>> return(CMD_OK); >>>>=20 >>>> Modified: head/sys/boot/common/part.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/common/part.c Tue Nov 8 06:13:22 2016 = (r308433) >>>> +++ head/sys/boot/common/part.c Tue Nov 8 06:50:18 2016 = (r308434) >>>> @@ -834,6 +834,7 @@ ptable_iterate(const struct ptable *tabl >>>> { >>>> struct pentry *entry; >>>> char name[32]; >>>> + int ret =3D 0; >>>>=20 >>>> name[0] =3D '\0'; >>>> STAILQ_FOREACH(entry, &table->entries, entry) { >>>> @@ -856,9 +857,8 @@ ptable_iterate(const struct ptable *tabl >>>> if (table->type =3D=3D PTABLE_BSD) >>>> sprintf(name, "%c", (u_char) 'a' + >>>> entry->part.index); >>>> - if (iter(arg, name, &entry->part)) >>>> - return 1; >>>> + if ((ret =3D iter(arg, name, &entry->part)) !=3D 0) >>>> + return (ret); >>>> } >>>> - return 0; >>>> + return (ret); >>>> } >>>> - >>>>=20 >>>> Modified: head/sys/boot/common/util.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/common/util.c Tue Nov 8 06:13:22 2016 = (r308433) >>>> +++ head/sys/boot/common/util.c Tue Nov 8 06:50:18 2016 = (r308434) >>>> @@ -114,7 +114,7 @@ strlen(const char *s) >>>> return (len); >>>> } >>>>=20 >>>> -void >>>> +int >>>> printf(const char *fmt, ...) >>>> { >>>> va_list ap; >>>> @@ -178,4 +178,5 @@ nextfmt: >>>> } >>>> } >>>> va_end(ap); >>>> + return (0); >>>> } >>>>=20 >>>> Modified: head/sys/boot/common/util.h >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/common/util.h Tue Nov 8 06:13:22 2016 = (r308433) >>>> +++ head/sys/boot/common/util.h Tue Nov 8 06:50:18 2016 = (r308434) >>>> @@ -48,6 +48,6 @@ void strcat(char *dst, const char *src); >>>> char *strchr(const char *s, char ch); >>>> size_t strlen(const char *s); >>>>=20 >>>> -void printf(const char *fmt, ...); >>>> +int printf(const char *fmt, ...); >>>>=20 >>>> #endif /* !_UTIL_H_ */ >>>>=20 >>>> Modified: head/sys/boot/efi/libefi/efinet.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:13:22 2016 >>>> (r308433) >>>> +++ head/sys/boot/efi/libefi/efinet.c Tue Nov 8 06:50:18 2016 >>>> (r308434) >>>> @@ -252,7 +252,7 @@ efinet_end(struct netif *nif) >>>> } >>>>=20 >>>> static int efinet_dev_init(void); >>>> -static void efinet_dev_print(int); >>>> +static int efinet_dev_print(int); >>>>=20 >>>> struct devsw efinet_dev =3D { >>>> .dv_name =3D "net", >>>> @@ -346,14 +346,13 @@ efinet_dev_init() >>>> return (0); >>>> } >>>>=20 >>>> -static void >>>> +static int >>>> efinet_dev_print(int verbose) >>>> { >>>> CHAR16 *text; >>>> EFI_HANDLE h; >>>> - int unit; >>>> + int unit, ret =3D 0; >>>>=20 >>>> - pager_open(); >>>> for (unit =3D 0, h =3D efi_find_handle(&efinet_dev, 0); >>>> h !=3D NULL; h =3D efi_find_handle(&efinet_dev, ++unit)) = { >>>> printf(" %s%d:", efinet_dev.dv_name, unit); >>>> @@ -364,8 +363,8 @@ efinet_dev_print(int verbose) >>>> efi_free_devpath_name(text); >>>> } >>>> } >>>> - if (pager_output("\n")) >>>> + if ((ret =3D pager_output("\n")) !=3D 0) >>>> break; >>>> } >>>> - pager_close(); >>>> + return (ret); >>>> } >>>>=20 >>>> Modified: head/sys/boot/efi/libefi/efipart.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:13:22 2016 >>>> (r308433) >>>> +++ head/sys/boot/efi/libefi/efipart.c Tue Nov 8 06:50:18 2016 >>>> (r308434) >>>> @@ -47,7 +47,7 @@ static int efipart_realstrategy(void *, >>>> size_t *); >>>> static int efipart_open(struct open_file *, ...); >>>> static int efipart_close(struct open_file *); >>>> -static void efipart_print(int); >>>> +static int efipart_print(int); >>>>=20 >>>> struct devsw efipart_dev =3D { >>>> .dv_name =3D "part", >>>> @@ -162,7 +162,7 @@ efipart_init(void) >>>> return (err); >>>> } >>>>=20 >>>> -static void >>>> +static int >>>> efipart_print(int verbose) >>>> { >>>> char line[80]; >>>> @@ -170,28 +170,29 @@ efipart_print(int verbose) >>>> EFI_HANDLE h; >>>> EFI_STATUS status; >>>> u_int unit; >>>> + int ret =3D 0; >>>>=20 >>>> - pager_open(); >>>> for (unit =3D 0, h =3D efi_find_handle(&efipart_dev, 0); >>>> h !=3D NULL; h =3D efi_find_handle(&efipart_dev, = ++unit)) { >>>> - sprintf(line, " %s%d:", efipart_dev.dv_name, = unit); >>>> - if (pager_output(line)) >>>> + snprintf(line, sizeof(line), " %s%d:", >>>> + efipart_dev.dv_name, unit); >>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>> break; >>>>=20 >>>> status =3D BS->HandleProtocol(h, &blkio_guid, (void >>>> **)&blkio); >>>> if (!EFI_ERROR(status)) { >>>> - sprintf(line, " %llu blocks", >>>> + snprintf(line, sizeof(line), " %llu = blocks", >>>> (unsigned long = long)(blkio->Media->LastBlock >>>> + 1)); >>>> - if (pager_output(line)) >>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>> break; >>>> if (blkio->Media->RemovableMedia) >>>> - if (pager_output(" (removable)")) >>>> + if ((ret =3D pager_output(" = (removable)")) >>>> !=3D 0) >>>> break; >>>> } >>>> - if (pager_output("\n")) >>>> + if ((ret =3D pager_output("\n")) !=3D 0) >>>> break; >>>> } >>>> - pager_close(); >>>> + return (ret); >>>> } >>>>=20 >>>> static int >>>>=20 >>>> Modified: head/sys/boot/efi/loader/main.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/efi/loader/main.c Tue Nov 8 06:13:22 2016 >>>> (r308433) >>>> +++ head/sys/boot/efi/loader/main.c Tue Nov 8 06:50:18 2016 >>>> (r308434) >>>> @@ -533,6 +533,7 @@ command_memmap(int argc, char *argv[]) >>>> UINT32 dver; >>>> EFI_STATUS status; >>>> int i, ndesc; >>>> + char line[80]; >>>> static char *types[] =3D { >>>> "Reserved", >>>> "LoaderCode", >>>> @@ -564,14 +565,19 @@ command_memmap(int argc, char *argv[]) >>>> } >>>>=20 >>>> ndesc =3D sz / dsz; >>>> - printf("%23s %12s %12s %8s %4s\n", >>>> + snprintf(line, sizeof(line), "%23s %12s %12s %8s %4s\n", >>>> "Type", "Physical", "Virtual", "#Pages", "Attr"); >>>> + pager_open(); >>>> + if (pager_output(line)) { >>>> + pager_close(); >>>> + return (CMD_OK); >>>> + } >>>>=20 >>>> for (i =3D 0, p =3D map; i < ndesc; >>>> i++, p =3D NextMemoryDescriptor(p, dsz)) { >>>> printf("%23s %012jx %012jx %08jx ", types[p->Type], >>>> - (uintmax_t)p->PhysicalStart, >>>> (uintmax_t)p->VirtualStart, >>>> - (uintmax_t)p->NumberOfPages); >>>> + (uintmax_t)p->PhysicalStart, >>>> (uintmax_t)p->VirtualStart, >>>> + (uintmax_t)p->NumberOfPages); >>>> if (p->Attribute & EFI_MEMORY_UC) >>>> printf("UC "); >>>> if (p->Attribute & EFI_MEMORY_WC) >>>> @@ -588,9 +594,11 @@ command_memmap(int argc, char *argv[]) >>>> printf("RP "); >>>> if (p->Attribute & EFI_MEMORY_XP) >>>> printf("XP "); >>>> - printf("\n"); >>>> + if (pager_output("\n")) >>>> + break; >>>> } >>>>=20 >>>> + pager_close(); >>>> return (CMD_OK); >>>> } >>>>=20 >>>> @@ -612,10 +620,17 @@ guid_to_string(EFI_GUID *guid) >>>> static int >>>> command_configuration(int argc, char *argv[]) >>>> { >>>> + char line[80]; >>>> UINTN i; >>>>=20 >>>> - printf("NumberOfTableEntries=3D%lu\n", >>>> + snprintf(line, sizeof(line), "NumberOfTableEntries=3D%lu\n", >>>> (unsigned long)ST->NumberOfTableEntries); >>>> + pager_open(); >>>> + if (pager_output(line)) { >>>> + pager_close(); >>>> + return (CMD_OK); >>>> + } >>>> + >>>> for (i =3D 0; i < ST->NumberOfTableEntries; i++) { >>>> EFI_GUID *guid; >>>>=20 >>>> @@ -642,9 +657,13 @@ command_configuration(int argc, char *ar >>>> printf("FDT Table"); >>>> else >>>> printf("Unknown Table (%s)", >>>> guid_to_string(guid)); >>>> - printf(" at %p\n", >>>> ST->ConfigurationTable[i].VendorTable); >>>> + snprintf(line, sizeof(line), " at %p\n", >>>> + ST->ConfigurationTable[i].VendorTable); >>>> + if (pager_output(line)) >>>> + break; >>>> } >>>>=20 >>>> + pager_close(); >>>> return (CMD_OK); >>>> } >>>>=20 >>>>=20 >>>> Modified: head/sys/boot/i386/libfirewire/firewire.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:13:22 = 2016 >>>> (r308433) >>>> +++ head/sys/boot/i386/libfirewire/firewire.c Tue Nov 8 06:50:18 = 2016 >>>> (r308434) >>>> @@ -69,7 +69,7 @@ static int fw_strategy(void *devdata, in >>>> size_t offset, size_t size, char *buf, size_t >>>> *rsize); >>>> static int fw_open(struct open_file *f, ...); >>>> static int fw_close(struct open_file *f); >>>> -static void fw_print(int verbose); >>>> +static int fw_print(int verbose); >>>> static void fw_cleanup(void); >>>>=20 >>>> void fw_enable(void); >>>> @@ -148,21 +148,26 @@ fw_init(void) >>>> /* >>>> * Print information about OHCI chips >>>> */ >>>> -static void >>>> +static int >>>> fw_print(int verbose) >>>> { >>>> - int i; >>>> + char line[80]; >>>> + int i, ret =3D 0; >>>> struct fwohci_softc *sc; >>>>=20 >>>> for (i =3D 0; i < MAX_OHCI; i ++) { >>>> sc =3D &fwinfo[i]; >>>> if (sc->state =3D=3D FWOHCI_STATE_DEAD) >>>> break; >>>> - printf("%d: locator=3D0x%04x devid=3D0x%08x" >>>> + snprintf(line, sizeof(line), "%d: locator=3D0x%04x >>>> devid=3D0x%08x" >>>> " base_addr=3D0x%08x handle=3D0x%08x >>>> bus_id=3D0x%08x\n", >>>> i, sc->locator, sc->devid, >>>> sc->base_addr, sc->handle, sc->bus_id); >>>> + ret =3D pager_output(line); >>>> + if (ret !=3D 0) >>>> + break; >>>> } >>>> + return (ret); >>>> } >>>>=20 >>>> static int >>>>=20 >>>> Modified: head/sys/boot/i386/libi386/bioscd.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:13:22 2016 >>>> (r308433) >>>> +++ head/sys/boot/i386/libi386/bioscd.c Tue Nov 8 06:50:18 2016 >>>> (r308434) >>>> @@ -100,7 +100,7 @@ static int bc_realstrategy(void *devdata >>>> size_t offset, size_t size, char *buf, size_t *rsize); >>>> static int bc_open(struct open_file *f, ...); >>>> static int bc_close(struct open_file *f); >>>> -static void bc_print(int verbose); >>>> +static int bc_print(int verbose); >>>>=20 >>>> struct devsw bioscd =3D { >>>> "cd", >>>> @@ -177,20 +177,19 @@ bc_add(int biosdev) >>>> /* >>>> * Print information about disks >>>> */ >>>> -static void >>>> +static int >>>> bc_print(int verbose) >>>> { >>>> char line[80]; >>>> - int i; >>>> + int i, ret =3D 0; >>>>=20 >>>> - pager_open(); >>>> for (i =3D 0; i < nbcinfo; i++) { >>>> - sprintf(line, " cd%d: Device 0x%x\n", i, >>>> + snprintf(line, sizeof(line), " cd%d: Device = 0x%x\n", >>>> i, >>>> bcinfo[i].bc_sp.sp_devicespec); >>>> - if (pager_output(line)) >>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>> break; >>>> } >>>> - pager_close(); >>>> + return (ret); >>>> } >>>>=20 >>>> /* >>>>=20 >>>> Modified: head/sys/boot/i386/libi386/biosdisk.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:13:22 = 2016 >>>> (r308433) >>>> +++ head/sys/boot/i386/libi386/biosdisk.c Tue Nov 8 06:50:18 = 2016 >>>> (r308434) >>>> @@ -135,7 +135,7 @@ static int bd_realstrategy(void *devdata >>>> static int bd_open(struct open_file *f, ...); >>>> static int bd_close(struct open_file *f); >>>> static int bd_ioctl(struct open_file *f, u_long cmd, void *data); >>>> -static void bd_print(int verbose); >>>> +static int bd_print(int verbose); >>>> static void bd_cleanup(void); >>>>=20 >>>> #ifdef LOADER_GELI_SUPPORT >>>> @@ -321,21 +321,21 @@ bd_int13probe(struct bdinfo *bd) >>>> /* >>>> * Print information about disks >>>> */ >>>> -static void >>>> +static int >>>> bd_print(int verbose) >>>> { >>>> static char line[80]; >>>> struct disk_devdesc dev; >>>> - int i; >>>> + int i, ret =3D 0; >>>>=20 >>>> - pager_open(); >>>> for (i =3D 0; i < nbdinfo; i++) { >>>> - sprintf(line, " disk%d: BIOS drive %c (%ju X >>>> %u):\n", i, >>>> + snprintf(line, sizeof(line), >>>> + " disk%d: BIOS drive %c (%ju X %u):\n", i, >>>> (bdinfo[i].bd_unit < 0x80) ? ('A' + >>>> bdinfo[i].bd_unit): >>>> ('C' + bdinfo[i].bd_unit - 0x80), >>>> (uintmax_t)bdinfo[i].bd_sectors, >>>> bdinfo[i].bd_sectorsize); >>>> - if (pager_output(line)) >>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>> break; >>>> dev.d_dev =3D &biosdisk; >>>> dev.d_unit =3D i; >>>> @@ -346,12 +346,14 @@ bd_print(int verbose) >>>> bdinfo[i].bd_sectorsize, >>>> (bdinfo[i].bd_flags & BD_FLOPPY) ? >>>> DISK_F_NOCACHE: 0) =3D=3D 0) { >>>> - sprintf(line, " disk%d", i); >>>> - disk_print(&dev, line, verbose); >>>> + snprintf(line, sizeof(line), " disk%d", = i); >>>> + ret =3D disk_print(&dev, line, verbose); >>>> disk_close(&dev); >>>> + if (ret !=3D 0) >>>> + return (ret); >>>> } >>>> } >>>> - pager_close(); >>>> + return (ret); >>>> } >>>>=20 >>>> /* >>>>=20 >>>> Modified: head/sys/boot/i386/libi386/pxe.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:13:22 2016 >>>> (r308433) >>>> +++ head/sys/boot/i386/libi386/pxe.c Tue Nov 8 06:50:18 2016 >>>> (r308434) >>>> @@ -75,7 +75,7 @@ static int pxe_strategy(void *devdata, i >>>> size_t offset, size_t size, char *buf, >>>> size_t *rsize); >>>> static int pxe_open(struct open_file *f, ...); >>>> static int pxe_close(struct open_file *f); >>>> -static void pxe_print(int verbose); >>>> +static int pxe_print(int verbose); >>>> static void pxe_cleanup(void); >>>> static void pxe_setnfshandle(char *rootpath); >>>>=20 >>>> @@ -381,14 +381,20 @@ pxe_close(struct open_file *f) >>>> return (0); >>>> } >>>>=20 >>>> -static void >>>> +static int >>>> pxe_print(int verbose) >>>> { >>>> - >>>> + char line[255]; >>>> if (pxe_call =3D=3D NULL) >>>> - return; >>>> + return (0); >>>>=20 >>>> - printf(" pxe0: %s:%s\n", inet_ntoa(rootip), = rootpath); >>>> + if (verbose) { >>>> + snprintf(line, sizeof(line), " pxe0: = %s:%s\n", >>>> + inet_ntoa(rootip), rootpath); >>>> + } else { >>>> + snprintf(line, sizeof(line), " pxe0:\n"); >>>> + } >>>> + return (pager_output(line)); >>>> } >>>>=20 >>>> static void >>>>=20 >>>> Modified: head/sys/boot/mips/beri/loader/beri_disk_cfi.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 >>>> 06:13:22 2016 (r308433) >>>> +++ head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Nov 8 >>>> 06:50:18 2016 (r308434) >>>> @@ -47,7 +47,7 @@ static int beri_cfi_disk_close(struct op >>>> static void beri_cfi_disk_cleanup(void); >>>> static int beri_cfi_disk_strategy(void *, int, daddr_t, size_t, >>>> size_t, >>>> char *, size_t *); >>>> -static void beri_cfi_disk_print(int); >>>> +static int beri_cfi_disk_print(int); >>>>=20 >>>> struct devsw beri_cfi_disk =3D { >>>> .dv_name =3D "cfi", >>>> @@ -112,25 +112,29 @@ beri_cfi_disk_close(struct open_file *f) >>>> return (disk_close(dev)); >>>> } >>>>=20 >>>> -static void >>>> +static int >>>> beri_cfi_disk_print(int verbose) >>>> { >>>> struct disk_devdesc dev; >>>> char line[80]; >>>> + int ret; >>>>=20 >>>> - sprintf(line, " cfi%d CFI flash device\n", 0); >>>> - pager_output(line); >>>> + snprintf(line, sizeof(line), " cfi%d CFI flash = device\n", >>>> 0); >>>> + ret =3D pager_output(line); >>>> + if (ret !=3D 0) >>>> + return (ret); >>>> dev.d_dev =3D &beri_cfi_disk; >>>> dev.d_unit =3D 0; >>>> dev.d_slice =3D -1; >>>> dev.d_partition =3D -1; >>>> if (disk_open(&dev, cfi_get_mediasize(), >>>> cfi_get_sectorsize(), 0) =3D=3D 0) { >>>> - sprintf(line, " cfi%d", 0); >>>> - disk_print(&dev, line, verbose); >>>> + snprintf(line, sizeof(line), " cfi%d", 0); >>>> + ret =3D disk_print(&dev, line, verbose); >>>> disk_close(&dev); >>>> } >>>>=20 >>>> + return (ret); >>>> } >>>>=20 >>>> static void >>>>=20 >>>> Modified: head/sys/boot/mips/beri/loader/beri_disk_sdcard.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 >>>> 06:13:22 2016 (r308433) >>>> +++ head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Nov 8 >>>> 06:50:18 2016 (r308434) >>>> @@ -47,7 +47,7 @@ static int beri_sdcard_disk_close(struct >>>> static void beri_sdcard_disk_cleanup(void); >>>> static int beri_sdcard_disk_strategy(void *, int, daddr_t, = size_t, >>>> size_t, >>>> char *, size_t *); >>>> -static void beri_sdcard_disk_print(int); >>>> +static int beri_sdcard_disk_print(int); >>>>=20 >>>> struct devsw beri_sdcard_disk =3D { >>>> .dv_name =3D "sdcard", >>>> @@ -123,19 +123,23 @@ beri_sdcard_disk_print(int verbose) >>>> { >>>> struct disk_devdesc dev; >>>> char line[80]; >>>> + int ret; >>>>=20 >>>> - sprintf(line, " sdcard%d Altera SD card drive\n", 0); >>>> - pager_output(line); >>>> + snprintf(line, sizeof(line), " sdcard%d Altera SD card >>>> drive\n", 0); >>>> + ret =3D pager_output(line); >>>> + if (ret !=3D 0) >>>> + return (ret); >>>> dev.d_dev =3D &beri_sdcard_disk; >>>> dev.d_unit =3D 0; >>>> dev.d_slice =3D -1; >>>> dev.d_partition =3D -1; >>>> if (disk_open(&dev, altera_sdcard_get_mediasize(), >>>> altera_sdcard_get_sectorsize(), 0) =3D=3D 0) { >>>> - sprintf(line, " sdcard%d", 0); >>>> - disk_print(&dev, line, verbose); >>>> + snprintf(line, sizeof(line), " sdcard%d", 0); >>>> + ret =3D disk_print(&dev, line, verbose); >>>> disk_close(&dev); >>>> } >>>> + return (ret); >>>> } >>>>=20 >>>> static void >>>>=20 >>>> Modified: head/sys/boot/ofw/libofw/ofw_disk.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:13:22 2016 >>>> (r308433) >>>> +++ head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov 8 06:50:18 2016 >>>> (r308434) >>>> @@ -47,7 +47,7 @@ static int ofwd_strategy(void *devdata, >>>> static int ofwd_open(struct open_file *f, ...); >>>> static int ofwd_close(struct open_file *f); >>>> static int ofwd_ioctl(struct open_file *f, u_long cmd, void = *data); >>>> -static void ofwd_print(int verbose); >>>> +static int ofwd_print(int verbose); >>>>=20 >>>> struct devsw ofwdisk =3D { >>>> "block", >>>> @@ -161,8 +161,8 @@ ofwd_ioctl(struct open_file *f __unused, >>>> return (EINVAL); >>>> } >>>>=20 >>>> -static void >>>> +static int >>>> ofwd_print(int verbose __unused) >>>> { >>>> - >>>> + return (0); >>>> } >>>>=20 >>>> Modified: head/sys/boot/pc98/libpc98/bioscd.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:13:22 2016 >>>> (r308433) >>>> +++ head/sys/boot/pc98/libpc98/bioscd.c Tue Nov 8 06:50:18 2016 >>>> (r308434) >>>> @@ -99,7 +99,7 @@ static int bc_realstrategy(void *devdata >>>> size_t offset, size_t size, char *buf, size_t >>>> *rsize); >>>> static int bc_open(struct open_file *f, ...); >>>> static int bc_close(struct open_file *f); >>>> -static void bc_print(int verbose); >>>> +static int bc_print(int verbose); >>>>=20 >>>> struct devsw bioscd =3D { >>>> "cd", >>>> @@ -173,20 +173,19 @@ bc_add(int biosdev) >>>> /* >>>> * Print information about disks >>>> */ >>>> -static void >>>> +static int >>>> bc_print(int verbose) >>>> { >>>> char line[80]; >>>> - int i; >>>> + int i, ret =3D 0; >>>>=20 >>>> - pager_open(); >>>> for (i =3D 0; i < nbcinfo; i++) { >>>> sprintf(line, " cd%d: Device 0x%x\n", i, >>>> bcinfo[i].bc_sp.sp_devicespec); >>>> - if (pager_output(line)) >>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>> break; >>>> } >>>> - pager_close(); >>>> + return (ret); >>>> } >>>>=20 >>>> /* >>>>=20 >>>> Modified: head/sys/boot/pc98/libpc98/biosdisk.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:13:22 = 2016 >>>> (r308433) >>>> +++ head/sys/boot/pc98/libpc98/biosdisk.c Tue Nov 8 06:50:18 = 2016 >>>> (r308434) >>>> @@ -123,7 +123,7 @@ static int bd_realstrategy(void *devdata >>>> size_t offset, size_t size, char *buf, size_t >>>> *rsize); >>>> static int bd_open(struct open_file *f, ...); >>>> static int bd_close(struct open_file *f); >>>> -static void bd_print(int verbose); >>>> +static int bd_print(int verbose); >>>>=20 >>>> struct devsw biosdisk =3D { >>>> "disk", >>>> @@ -249,21 +249,20 @@ bd_int13probe(struct bdinfo *bd) >>>> /* >>>> * Print information about disks >>>> */ >>>> -static void >>>> +static int >>>> bd_print(int verbose) >>>> { >>>> - int i, j, done; >>>> + int i, j, ret =3D 0; >>>> char line[80]; >>>> struct i386_devdesc dev; >>>> struct open_disk *od; >>>> struct pc98_partition *dptr; >>>>=20 >>>> - pager_open(); >>>> - done =3D 0; >>>> - for (i =3D 0; i < nbdinfo && !done; i++) { >>>> - sprintf(line, " disk%d: BIOS drive %c:\n", i, 'A' + = i); >>>> - if (pager_output(line)) >>>> - break; >>>> + for (i =3D 0; i < nbdinfo; i++) { >>>> + snprintf(line, sizeof(line), " disk%d: BIOS drive = %c:\n", >>>> + i, 'A' + i); >>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>> + break; >>>>=20 >>>> /* try to open the whole disk */ >>>> dev.d_unit =3D i; >>>> @@ -278,17 +277,17 @@ bd_print(int verbose) >>>>=20 >>>> /* Check for a "dedicated" disk */ >>>> for (j =3D 0; j < od->od_nslices; j++) { >>>> - sprintf(line, " disk%ds%d", i, j + 1); >>>> - if (bd_printslice(od, &dptr[j], line, verbose)) = { >>>> - done =3D 1; >>>> - break; >>>> - } >>>> + snprintf(line, sizeof(line), " disk%ds%d", = i, j >>>> + 1); >>>> + if ((ret =3D bd_printslice(od, &dptr[j], line, >>>> verbose)) !=3D 0) >>>> + break; >>>> } >>>> } >>>> bd_closedisk(od); >>>> + if (ret !=3D 0) >>>> + break; >>>> } >>>> } >>>> - pager_close(); >>>> + return (ret); >>>> } >>>>=20 >>>> /* Given a size in 512 byte sectors, convert it to a human-readable >>>> number. */ >>>>=20 >>>> Modified: head/sys/boot/powerpc/kboot/hostdisk.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:13:22 = 2016 >>>> (r308433) >>>> +++ head/sys/boot/powerpc/kboot/hostdisk.c Tue Nov 8 06:50:18 = 2016 >>>> (r308434) >>>> @@ -37,7 +37,7 @@ static int hostdisk_strategy(void *devda >>>> static int hostdisk_open(struct open_file *f, ...); >>>> static int hostdisk_close(struct open_file *f); >>>> static int hostdisk_ioctl(struct open_file *f, u_long cmd, void = *data); >>>> -static void hostdisk_print(int verbose); >>>> +static int hostdisk_print(int verbose); >>>>=20 >>>> struct devsw hostdisk =3D { >>>> "/dev", >>>> @@ -117,9 +117,9 @@ hostdisk_ioctl(struct open_file *f, u_lo >>>> return (EINVAL); >>>> } >>>>=20 >>>> -static void >>>> +static int >>>> hostdisk_print(int verbose) >>>> { >>>> - >>>> + return (0); >>>> } >>>>=20 >>>>=20 >>>> Modified: head/sys/boot/powerpc/ps3/ps3cdrom.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:13:22 = 2016 >>>> (r308433) >>>> +++ head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Nov 8 06:50:18 = 2016 >>>> (r308434) >>>> @@ -49,7 +49,7 @@ static int ps3cdrom_strategy(void *devda >>>> size_t offset, size_t size, char *buf, size_t *rsize); >>>> static int ps3cdrom_open(struct open_file *f, ...); >>>> static int ps3cdrom_close(struct open_file *f); >>>> -static void ps3cdrom_print(int verbose); >>>> +static int ps3cdrom_print(int verbose); >>>>=20 >>>> struct devsw ps3cdrom =3D { >>>> "cd", >>>> @@ -149,6 +149,7 @@ static int ps3cdrom_close(struct open_fi >>>> return 0; >>>> } >>>>=20 >>>> -static void ps3cdrom_print(int verbose) >>>> +static int ps3cdrom_print(int verbose) >>>> { >>>> + return (0); >>>> } >>>>=20 >>>> Modified: head/sys/boot/powerpc/ps3/ps3disk.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:13:22 2016 >>>> (r308433) >>>> +++ head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov 8 06:50:18 2016 >>>> (r308434) >>>> @@ -61,7 +61,7 @@ static int ps3disk_strategy(void *devdat >>>> size_t offset, size_t size, char *buf, size_t *rsize); >>>> static int ps3disk_open(struct open_file *f, ...); >>>> static int ps3disk_close(struct open_file *f); >>>> -static void ps3disk_print(int verbose); >>>> +static int ps3disk_print(int verbose); >>>>=20 >>>> struct devsw ps3disk =3D { >>>> "disk", >>>> @@ -186,8 +186,9 @@ static int ps3disk_close(struct open_fil >>>> return 0; >>>> } >>>>=20 >>>> -static void ps3disk_print(int verbose) >>>> +static int ps3disk_print(int verbose) >>>> { >>>> + return (0); >>>> } >>>>=20 >>>> static int ps3disk_open_gpt(struct ps3_devdesc *dev, struct = open_dev >>>> *od) >>>>=20 >>>> Modified: head/sys/boot/uboot/lib/disk.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:13:22 2016 >>>> (r308433) >>>> +++ head/sys/boot/uboot/lib/disk.c Tue Nov 8 06:50:18 2016 >>>> (r308434) >>>> @@ -78,7 +78,7 @@ static int stor_strategy(void *, int, da >>>> static int stor_open(struct open_file *, ...); >>>> static int stor_close(struct open_file *); >>>> static int stor_ioctl(struct open_file *f, u_long cmd, void *data); >>>> -static void stor_print(int); >>>> +static int stor_print(int); >>>> static void stor_cleanup(void); >>>>=20 >>>> struct devsw uboot_storage =3D { >>>> @@ -238,30 +238,31 @@ stor_readdev(struct disk_devdesc *dev, d >>>> return (err); >>>> } >>>>=20 >>>> -static void >>>> +static int >>>> stor_print(int verbose) >>>> { >>>> struct disk_devdesc dev; >>>> static char line[80]; >>>> - int i; >>>> + int i, ret =3D 0; >>>>=20 >>>> - pager_open(); >>>> for (i =3D 0; i < stor_info_no; i++) { >>>> dev.d_dev =3D &uboot_storage; >>>> dev.d_unit =3D i; >>>> dev.d_slice =3D -1; >>>> dev.d_partition =3D -1; >>>> - sprintf(line, "\tdisk%d (%s)\n", i, >>>> + snprintf(line, sizeof(line), "\tdisk%d (%s)\n", i, >>>> ub_stor_type(SI(&dev).type)); >>>> - if (pager_output(line)) >>>> + if ((ret =3D pager_output(line)) !=3D 0) >>>> break; >>>> if (stor_opendev(&dev) =3D=3D 0) { >>>> sprintf(line, "\tdisk%d", i); >>>> - disk_print(&dev, line, verbose); >>>> + ret =3D disk_print(&dev, line, verbose); >>>> disk_close(&dev); >>>> + if (ret !=3D 0) >>>> + break; >>>> } >>>> } >>>> - pager_close(); >>>> + return (ret); >>>> } >>>>=20 >>>> static int >>>>=20 >>>> Modified: head/sys/boot/usb/storage/umass_loader.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:13:22 = 2016 >>>> (r308433) >>>> +++ head/sys/boot/usb/storage/umass_loader.c Tue Nov 8 06:50:18 = 2016 >>>> (r308434) >>>> @@ -50,7 +50,7 @@ static void umass_disk_cleanup(void); >>>> static int umass_disk_ioctl(struct open_file *, u_long, void *); >>>> static int umass_disk_strategy(void *, int, daddr_t, size_t, = size_t, >>>> char *, >>>> size_t *); >>>> -static void umass_disk_print(int); >>>> +static int umass_disk_print(int); >>>>=20 >>>> struct devsw umass_disk =3D { >>>> .dv_name =3D "umass", >>>> @@ -170,23 +170,26 @@ umass_disk_close(struct open_file *f) >>>> return (disk_close(dev)); >>>> } >>>>=20 >>>> -static void >>>> +static int >>>> umass_disk_print(int verbose) >>>> { >>>> struct disk_devdesc dev; >>>>=20 >>>> memset(&dev, 0, sizeof(dev)); >>>>=20 >>>> - pager_output(" umass0 UMASS device\n"); >>>> + ret =3D pager_output(" umass0 UMASS device\n"); >>>> + if (ret !=3D 0) >>>> + return (ret); >>>> dev.d_dev =3D &umass_disk; >>>> dev.d_unit =3D 0; >>>> dev.d_slice =3D -1; >>>> dev.d_partition =3D -1; >>>>=20 >>>> if (umass_disk_open_sub(&dev) =3D=3D 0) { >>>> - disk_print(&dev, " umass0", verbose); >>>> + ret =3D disk_print(&dev, " umass0", verbose); >>>> disk_close(&dev); >>>> } >>>> + return (ret); >>>> } >>>>=20 >>>> static void >>>>=20 >>>> Modified: head/sys/boot/userboot/userboot/host.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:13:22 = 2016 >>>> (r308433) >>>> +++ head/sys/boot/userboot/userboot/host.c Tue Nov 8 06:50:18 = 2016 >>>> (r308434) >>>> @@ -134,13 +134,13 @@ host_dev_init(void) >>>> return (0); >>>> } >>>>=20 >>>> -static void >>>> +static int >>>> host_dev_print(int verbose) >>>> { >>>> char line[80]; >>>>=20 >>>> - sprintf(line, " host%d: Host filesystem\n", 0); >>>> - pager_output(line); >>>> + snprintf(line, sizeof(line), " host%d: Host = filesystem\n", >>>> 0); >>>> + return (pager_output(line)); >>>> } >>>>=20 >>>> /* >>>>=20 >>>> Modified: head/sys/boot/userboot/userboot/userboot_disk.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 >>>> 06:13:22 2016 (r308433) >>>> +++ head/sys/boot/userboot/userboot/userboot_disk.c Tue Nov 8 >>>> 06:50:18 2016 (r308434) >>>> @@ -60,7 +60,7 @@ static int userdisk_realstrategy(void *d >>>> static int userdisk_open(struct open_file *f, ...); >>>> static int userdisk_close(struct open_file *f); >>>> static int userdisk_ioctl(struct open_file *f, u_long cmd, void >>>> *data); >>>> -static void userdisk_print(int verbose); >>>> +static int userdisk_print(int verbose); >>>>=20 >>>> struct devsw userboot_disk =3D { >>>> "disk", >>>> @@ -116,27 +116,33 @@ userdisk_cleanup(void) >>>> /* >>>> * Print information about disks >>>> */ >>>> -static void >>>> +static int >>>> userdisk_print(int verbose) >>>> { >>>> struct disk_devdesc dev; >>>> char line[80]; >>>> - int i; >>>> + int i, ret =3D 0; >>>>=20 >>>> for (i =3D 0; i < userdisk_maxunit; i++) { >>>> - sprintf(line, " disk%d: Guest drive image\n", = i); >>>> - pager_output(line); >>>> + snprintf(line, sizeof(line), >>>> + " disk%d: Guest drive image\n", i); >>>> + ret =3D pager_output(line); >>>> + if (ret !=3D 0) >>>> + break; >>>> dev.d_dev =3D &userboot_disk; >>>> dev.d_unit =3D i; >>>> dev.d_slice =3D -1; >>>> dev.d_partition =3D -1; >>>> if (disk_open(&dev, ud_info[i].mediasize, >>>> ud_info[i].sectorsize, 0) =3D=3D 0) { >>>> - sprintf(line, " disk%d", i); >>>> - disk_print(&dev, line, verbose); >>>> + snprintf(line, sizeof(line), " disk%d", = i); >>>> + ret =3D disk_print(&dev, line, verbose); >>>> disk_close(&dev); >>>> + if (ret !=3D 0) >>>> + break; >>>> } >>>> } >>>> + return (ret); >>>> } >>>>=20 >>>> /* >>>>=20 >>>> Modified: head/sys/boot/zfs/zfs.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/zfs/zfs.c Tue Nov 8 06:13:22 2016 = (r308433) >>>> +++ head/sys/boot/zfs/zfs.c Tue Nov 8 06:50:18 2016 = (r308434) >>>> @@ -514,20 +514,23 @@ zfs_probe_dev(const char *devname, uint6 >>>> /* >>>> * Print information about ZFS pools >>>> */ >>>> -static void >>>> +static int >>>> zfs_dev_print(int verbose) >>>> { >>>> spa_t *spa; >>>> char line[80]; >>>> + int ret =3D 0; >>>>=20 >>>> if (verbose) { >>>> - spa_all_status(); >>>> - return; >>>> + return (spa_all_status()); >>>> } >>>> STAILQ_FOREACH(spa, &zfs_pools, spa_link) { >>>> - sprintf(line, " zfs:%s\n", spa->spa_name); >>>> - pager_output(line); >>>> + snprintf(line, sizeof(line), " zfs:%s\n", >>>> spa->spa_name); >>>> + ret =3D pager_output(line); >>>> + if (ret !=3D 0) >>>> + break; >>>> } >>>> + return (ret); >>>> } >>>>=20 >>>> /* >>>>=20 >>>> Modified: head/sys/boot/zfs/zfsimpl.c >>>>=20 >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:13:22 2016 = (r308433) >>>> +++ head/sys/boot/zfs/zfsimpl.c Tue Nov 8 06:50:18 2016 = (r308434) >>>> @@ -780,7 +780,7 @@ state_name(vdev_state_t state) >>>>=20 >>>> #else >>>>=20 >>>> -static void >>>> +static int >>>> pager_printf(const char *fmt, ...) >>>> { >>>> char line[80]; >>>> @@ -789,14 +789,14 @@ pager_printf(const char *fmt, ...) >>>> va_start(args, fmt); >>>> vsprintf(line, fmt, args); >>>> va_end(args); >>>> - pager_output(line); >>>> + return (pager_output(line)); >>>> } >>>>=20 >>>> #endif >>>>=20 >>>> #define STATUS_FORMAT " %s %s\n" >>>>=20 >>>> -static void >>>> +static int >>>> print_state(int indent, const char *name, vdev_state_t state) >>>> { >>>> int i; >>>> @@ -806,40 +806,56 @@ print_state(int indent, const char *name >>>> for (i =3D 0; i < indent; i++) >>>> strcat(buf, " "); >>>> strcat(buf, name); >>>>=20 >>>> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >>>> _______________________________________________ >>>> svn-src-head@freebsd.org mailing list >>>> https://lists.freebsd.org/mailman/listinfo/svn-src-head >>>> To unsubscribe, send any mail to = "svn-src-head-unsubscribe@freebsd.org" >>>=20 >>>=20 >>>=20 >>=20 From owner-svn-src-head@freebsd.org Fri Nov 11 18:47:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AFFDC3B460; Fri, 11 Nov 2016 18:47:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 181C31942; Fri, 11 Nov 2016 18:47:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABIlrdq079718; Fri, 11 Nov 2016 18:47:53 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABIlrxf079717; Fri, 11 Nov 2016 18:47:53 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201611111847.uABIlrxf079717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 11 Nov 2016 18:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308537 - head/lib/libgcc_s X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 18:47:54 -0000 Author: gjb Date: Fri Nov 11 18:47:53 2016 New Revision: 308537 URL: https://svnweb.freebsd.org/changeset/base/308537 Log: Spell 'PACKAGE' correctly. Submitted by: Kyle Evans, emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/lib/libgcc_s/Makefile Modified: head/lib/libgcc_s/Makefile ============================================================================== --- head/lib/libgcc_s/Makefile Fri Nov 11 18:10:13 2016 (r308536) +++ head/lib/libgcc_s/Makefile Fri Nov 11 18:47:53 2016 (r308537) @@ -1,6 +1,6 @@ # $FreeBSD$ -PKG= clibs +PACKAGE= clibs SHLIB_NAME= libgcc_s.so.1 SHLIBDIR?= /lib From owner-svn-src-head@freebsd.org Fri Nov 11 18:57:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77871C3B6EE; Fri, 11 Nov 2016 18:57:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 392061FE0; Fri, 11 Nov 2016 18:57:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABIvfSO083722; Fri, 11 Nov 2016 18:57:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABIvfp8083721; Fri, 11 Nov 2016 18:57:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201611111857.uABIvfp8083721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 11 Nov 2016 18:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308538 - head/sys/dev/cpuctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 18:57:42 -0000 Author: kib Date: Fri Nov 11 18:57:41 2016 New Revision: 308538 URL: https://svnweb.freebsd.org/changeset/base/308538 Log: Increase the max allowed size of the microcode update blob for x86. Newer CPUs (SkyLakes) have updates of 100K size, which is bigger than current limit 32K. Increase it to 4M but leave the check around to prevent kernel memory allocator abuse. Some time ago, the memory for update was allocated by contigmalloc(9), and it was reasonable to be conservative as much as possible. Since all uses of contigmalloc(9) appear to be either misunderstanding or too cautious, and were removed, provide more slack than strictly neccessary. Submitted by: Oliver Pinter MFC after: 1 week Differential revision: https://reviews.freebsd.org/D8486 Modified: head/sys/dev/cpuctl/cpuctl.c Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Fri Nov 11 18:47:53 2016 (r308537) +++ head/sys/dev/cpuctl/cpuctl.c Fri Nov 11 18:57:41 2016 (r308538) @@ -63,7 +63,7 @@ static d_ioctl_t cpuctl_ioctl; # define DPRINTF(...) #endif -#define UCODE_SIZE_MAX (32 * 1024) +#define UCODE_SIZE_MAX (4 * 1024 * 1024) static int cpuctl_do_msr(int cpu, cpuctl_msr_args_t *data, u_long cmd, struct thread *td); From owner-svn-src-head@freebsd.org Fri Nov 11 20:09:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EFD8C3CA6E; Fri, 11 Nov 2016 20:09:56 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1C8E1287; Fri, 11 Nov 2016 20:09:55 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABK9t5Q014439; Fri, 11 Nov 2016 20:09:55 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABK9t0i014438; Fri, 11 Nov 2016 20:09:55 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201611112009.uABK9t0i014438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 11 Nov 2016 20:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308553 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 20:09:56 -0000 Author: cem Date: Fri Nov 11 20:09:54 2016 New Revision: 308553 URL: https://svnweb.freebsd.org/changeset/base/308553 Log: ioat(4): Fix race between process_events and reset_hw In the case where a hardware error is detected during ioat_process_events, hardware may advance (by one descriptor, probably) and a subsequent ioat_process_events may race the intended ioat_reset_hw followup. In that case, the second process_events would observe a completion update that does not match the software "last_seen" status, and attempt to successfully complete already-failed descriptors. Guard against this race with the resetting_cleanup flag. Reviewed by: bdrewery, markj Sponsored by: Dell EMC Isilon Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Fri Nov 11 20:08:45 2016 (r308552) +++ head/sys/dev/ioat/ioat.c Fri Nov 11 20:09:54 2016 (r308553) @@ -765,6 +765,15 @@ out: mtx_lock(&ioat->submit_lock); mtx_lock(&ioat->cleanup_lock); ioat->quiescing = TRUE; + /* + * This is safe to do here because we have both locks and the submit + * queue is quiesced. We know that we will drain all outstanding + * events, so ioat_reset_hw can't deadlock. It is necessary to + * protect other ioat_process_event threads from racing ioat_reset_hw, + * reading an indeterminate hw state, and attempting to continue + * issuing completions. + */ + ioat->resetting_cleanup = TRUE; chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); if (1 <= g_ioat_debug_level) From owner-svn-src-head@freebsd.org Fri Nov 11 20:44:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C22D0C3B388; Fri, 11 Nov 2016 20:44:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BA231792; Fri, 11 Nov 2016 20:44:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABKiXJW030934; Fri, 11 Nov 2016 20:44:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABKiXat030933; Fri, 11 Nov 2016 20:44:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201611112044.uABKiXat030933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 11 Nov 2016 20:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308558 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 20:44:34 -0000 Author: cem Date: Fri Nov 11 20:44:33 2016 New Revision: 308558 URL: https://svnweb.freebsd.org/changeset/base/308558 Log: queue.3: Document existing QMD_* macros Feedback from: bapt, bdrewery, emaste Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D3983 Modified: head/sys/sys/queue.h Modified: head/sys/sys/queue.h ============================================================================== --- head/sys/sys/queue.h Fri Nov 11 20:31:23 2016 (r308557) +++ head/sys/sys/queue.h Fri Nov 11 20:44:33 2016 (r308558) @@ -472,6 +472,12 @@ struct { \ */ #if (defined(_KERNEL) && defined(INVARIANTS)) +/* + * QMD_LIST_CHECK_HEAD(LIST_HEAD *head, LIST_ENTRY NAME) + * + * If the list is non-empty, validates that the first element of the list + * points back at 'head.' + */ #define QMD_LIST_CHECK_HEAD(head, field) do { \ if (LIST_FIRST((head)) != NULL && \ LIST_FIRST((head))->field.le_prev != \ @@ -479,6 +485,12 @@ struct { \ panic("Bad list head %p first->prev != head", (head)); \ } while (0) +/* + * QMD_LIST_CHECK_NEXT(TYPE *elm, LIST_ENTRY NAME) + * + * If an element follows 'elm' in the list, validates that the next element + * points back at 'elm.' + */ #define QMD_LIST_CHECK_NEXT(elm, field) do { \ if (LIST_NEXT((elm), field) != NULL && \ LIST_NEXT((elm), field)->field.le_prev != \ @@ -486,6 +498,11 @@ struct { \ panic("Bad link elm %p next->prev != elm", (elm)); \ } while (0) +/* + * QMD_LIST_CHECK_PREV(TYPE *elm, LIST_ENTRY NAME) + * + * Validates that the previous element (or head of the list) points to 'elm.' + */ #define QMD_LIST_CHECK_PREV(elm, field) do { \ if (*(elm)->field.le_prev != (elm)) \ panic("Bad link elm %p prev->next != elm", (elm)); \ @@ -634,6 +651,12 @@ struct { \ * Tail queue functions. */ #if (defined(_KERNEL) && defined(INVARIANTS)) +/* + * QMD_TAILQ_CHECK_HEAD(TAILQ_HEAD *head, TAILQ_ENTRY NAME) + * + * If the tailq is non-empty, validates that the first element of the tailq + * points back at 'head.' + */ #define QMD_TAILQ_CHECK_HEAD(head, field) do { \ if (!TAILQ_EMPTY(head) && \ TAILQ_FIRST((head))->field.tqe_prev != \ @@ -641,11 +664,22 @@ struct { \ panic("Bad tailq head %p first->prev != head", (head)); \ } while (0) +/* + * QMD_TAILQ_CHECK_TAIL(TAILQ_HEAD *head, TAILQ_ENTRY NAME) + * + * Validates that the tail of the tailq is a pointer to pointer to NULL. + */ #define QMD_TAILQ_CHECK_TAIL(head, field) do { \ if (*(head)->tqh_last != NULL) \ panic("Bad tailq NEXT(%p->tqh_last) != NULL", (head)); \ } while (0) +/* + * QMD_TAILQ_CHECK_NEXT(TYPE *elm, TAILQ_ENTRY NAME) + * + * If an element follows 'elm' in the tailq, validates that the next element + * points back at 'elm.' + */ #define QMD_TAILQ_CHECK_NEXT(elm, field) do { \ if (TAILQ_NEXT((elm), field) != NULL && \ TAILQ_NEXT((elm), field)->field.tqe_prev != \ @@ -653,6 +687,11 @@ struct { \ panic("Bad link elm %p next->prev != elm", (elm)); \ } while (0) +/* + * QMD_TAILQ_CHECK_PREV(TYPE *elm, TAILQ_ENTRY NAME) + * + * Validates that the previous element (or head of the tailq) points to 'elm.' + */ #define QMD_TAILQ_CHECK_PREV(elm, field) do { \ if (*(elm)->field.tqe_prev != (elm)) \ panic("Bad link elm %p prev->next != elm", (elm)); \ From owner-svn-src-head@freebsd.org Fri Nov 11 21:01:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DA6DC3B67B; Fri, 11 Nov 2016 21:01:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D39B21E88; Fri, 11 Nov 2016 21:01:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABL1kG1038133; Fri, 11 Nov 2016 21:01:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABL1koq038132; Fri, 11 Nov 2016 21:01:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201611112101.uABL1koq038132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 11 Nov 2016 21:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308559 - head/contrib/llvm/lib/Target/AArch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 21:01:47 -0000 Author: dim Date: Fri Nov 11 21:01:45 2016 New Revision: 308559 URL: https://svnweb.freebsd.org/changeset/base/308559 Log: Pull in r263169 from upstream llvm trunk (by Tim Northover): AArch64: only try to use scaled fcvt ops on legal vector types. Before we ended up calling getSimpleVectorType on a <3 x float>, which asserted. This fixes an assertion when building the print/ghostscript9-agpl-base port for AArch64. PR: 213865 MFC after: 3 days Modified: head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Modified: head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Fri Nov 11 20:44:33 2016 (r308558) +++ head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Fri Nov 11 21:01:45 2016 (r308559) @@ -7581,7 +7581,8 @@ static SDValue performFpToIntCombine(SDN return SDValue(); SDValue Op = N->getOperand(0); - if (!Op.getValueType().isVector() || Op.getOpcode() != ISD::FMUL) + if (!Op.getValueType().isVector() || !Op.getValueType().isSimple() || + Op.getOpcode() != ISD::FMUL) return SDValue(); SDValue ConstVec = Op->getOperand(1); From owner-svn-src-head@freebsd.org Fri Nov 11 21:29:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F322C3BD5E; Fri, 11 Nov 2016 21:29:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F4261BFD; Fri, 11 Nov 2016 21:29:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABLTmk5047222; Fri, 11 Nov 2016 21:29:48 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABLTmgA047221; Fri, 11 Nov 2016 21:29:48 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201611112129.uABLTmgA047221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 11 Nov 2016 21:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308560 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 21:29:49 -0000 Author: jhibbits Date: Fri Nov 11 21:29:48 2016 New Revision: 308560 URL: https://svnweb.freebsd.org/changeset/base/308560 Log: Replace another fdt_is_compatible() call. Modified: head/sys/dev/fdt/fdt_powerpc.c Modified: head/sys/dev/fdt/fdt_powerpc.c ============================================================================== --- head/sys/dev/fdt/fdt_powerpc.c Fri Nov 11 21:01:45 2016 (r308559) +++ head/sys/dev/fdt/fdt_powerpc.c Fri Nov 11 21:29:48 2016 (r308560) @@ -112,7 +112,7 @@ fdt_fixup_fman(phandle_t root) * That frequency is equal to /soc node bus-frequency. */ for (node = OF_child(node); node != 0; node = OF_peer(node)) { - if (fdt_is_compatible(node, "fsl,fman") == 0) + if (ofw_bus_node_is_compatible(node, "fsl,fman") == 0) continue; if (OF_setprop(node, "clock-frequency", (void *)&freq, From owner-svn-src-head@freebsd.org Fri Nov 11 21:53:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83B07C3C51F; Fri, 11 Nov 2016 21:53:39 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53BBB19F2; Fri, 11 Nov 2016 21:53:39 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABLrcVh058887; Fri, 11 Nov 2016 21:53:38 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABLrcQa058886; Fri, 11 Nov 2016 21:53:38 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201611112153.uABLrcQa058886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Fri, 11 Nov 2016 21:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308561 - head/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 21:53:39 -0000 Author: gavin Date: Fri Nov 11 21:53:38 2016 New Revision: 308561 URL: https://svnweb.freebsd.org/changeset/base/308561 Log: Correct spelling in syslog: getttimeofday -> gettimeofday Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c Fri Nov 11 21:29:48 2016 (r308560) +++ head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c Fri Nov 11 21:53:38 2016 (r308561) @@ -356,7 +356,7 @@ bridge_get_time_since_tc(struct bridge_i if (gettimeofday(&ct, NULL) < 0) { syslog(LOG_ERR, "bridge get time since last TC:" - "getttimeofday failed: %s", strerror(errno)); + "gettimeofday failed: %s", strerror(errno)); return (-1); } From owner-svn-src-head@freebsd.org Fri Nov 11 23:07:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8174DC3915F; Fri, 11 Nov 2016 23:07:32 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFED1763; Fri, 11 Nov 2016 23:07:32 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABN7VMb086636; Fri, 11 Nov 2016 23:07:31 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABN7V6U086633; Fri, 11 Nov 2016 23:07:31 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201611112307.uABN7V6U086633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Fri, 11 Nov 2016 23:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308562 - head/tools/tools/git X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 23:07:32 -0000 Author: rstone Date: Fri Nov 11 23:07:31 2016 New Revision: 308562 URL: https://svnweb.freebsd.org/changeset/base/308562 Log: Fix git tools when run against a worktree In a git worktree, the gitdir is in an entirely different location. In arcgit, use git rev-parse --git-dir to get the correct path to it always. When running git from outside of the work tree, as in importgit, the path provided by git rev-parse --git-dir can be either a relative or absolute path depending on the work tree. Rather than trying to deal with that, just use git -C. Differential Revision: https://reviews.freebsd.org/D8501 Reviewed by: markj Modified: head/tools/tools/git/arcgit head/tools/tools/git/importgit Modified: head/tools/tools/git/arcgit ============================================================================== --- head/tools/tools/git/arcgit Fri Nov 11 21:53:38 2016 (r308561) +++ head/tools/tools/git/arcgit Fri Nov 11 23:07:31 2016 (r308562) @@ -69,7 +69,7 @@ create_review() git checkout $commit > /dev/null || error "Could not checkout $commit" - arc_dir="$(git rev-parse --show-toplevel)/.git/arc" + arc_dir="$(git rev-parse --git-dir)/arc" arc_msg="$arc_dir/create-message" mkdir -p $arc_dir git show -s --format='%B' HEAD > $arc_msg Modified: head/tools/tools/git/importgit ============================================================================== --- head/tools/tools/git/importgit Fri Nov 11 21:53:38 2016 (r308561) +++ head/tools/tools/git/importgit Fri Nov 11 23:07:31 2016 (r308562) @@ -50,7 +50,7 @@ error() exit 1 } -unset git range commit dry_run +unset git_repo range commit dry_run while getopts ":c:g:nr:" o do @@ -95,16 +95,16 @@ then error -u "-g argument is mandatory" fi -git="$git_repo/.git" - -if [ ! -d "$git" ] +if ! type git > /dev/null 2> /dev/null then - error "$git_repo does not seem to be a git repo" + error "Install devel/git first" fi -if ! type git > /dev/null 2> /dev/null +GIT="git -C $git_repo" + +if ! $GIT rev-parse --git-dir 2> /dev/null > /dev/null then - error "Install devel/git first" + error "$git_repo does not seem to be a git repo" fi if ! type svn > /dev/null 2> /dev/null @@ -122,21 +122,21 @@ then error "Could not communicate with svn server. Is your ssh key loaded?" fi -git --git-dir=$git log --format=%H $range | tail -r | while read -r commit +$GIT log --format=%H $range | tail -r | while read -r commit do - echo "Applying `git --git-dir=$git show -s --oneline $commit`" + echo "Applying `$GIT show -s --oneline $commit`" - if [ -n "$(git --git-dir=$git show --diff-filter=CDRTUXB $commit)" ] + if [ -n "$($GIT show --diff-filter=CDRTUXB $commit)" ] then error "Commit performed unsupported change (e.g. delete/rename)" fi - if [ "$(git --git-dir=$git show -s --format=%P $commit | wc -w)" -ne 1 ] + if [ "$($GIT show -s --format=%P $commit | wc -w)" -ne 1 ] then error "Cannot import merge commits" fi - git --git-dir=$git diff --diff-filter=A --name-only \ + $GIT diff --diff-filter=A --name-only \ ${commit}~..$commit | while read -r newfile do if [ -f "$newfile" ] @@ -158,10 +158,10 @@ do continue fi - git --git-dir=$git show $commit | patch -p 1 -s || \ + $GIT show $commit | patch -p 1 -s || \ error "Failed to apply patch" - git --git-dir=$git diff --diff-filter=A --name-only \ + $GIT diff --diff-filter=A --name-only \ ${commit}~..$commit | while read -r newfile do svn add --parents --depth=infinity $newfile || \ @@ -176,7 +176,7 @@ do exit $ret fi - git --git-dir=$git show -s --format='%B' $commit | svn commit -F - || \ + $GIT show -s --format='%B' $commit | svn commit -F - || \ error "Failed to commit" done From owner-svn-src-head@freebsd.org Fri Nov 11 23:28:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DB45C394CC; Fri, 11 Nov 2016 23:28:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EFF51F4D; Fri, 11 Nov 2016 23:28:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uABNS8DY094714; Fri, 11 Nov 2016 23:28:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uABNS831094712; Fri, 11 Nov 2016 23:28:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611112328.uABNS831094712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 11 Nov 2016 23:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308563 - in head/lib: libgcc_eh libgcc_s X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 23:28:09 -0000 Author: emaste Date: Fri Nov 11 23:28:07 2016 New Revision: 308563 URL: https://svnweb.freebsd.org/changeset/base/308563 Log: libcc_{s,eh}: build without SSP As in the gnu/lib/libgcc Makefile: libgcc is linked in last and thus cannot depend on ssp symbols coming from earlier libraries. Disable stack protection for this library. Reviewed by: dim Sponsored by: The FreeBSD Foundation Modified: head/lib/libgcc_eh/Makefile head/lib/libgcc_s/Makefile Modified: head/lib/libgcc_eh/Makefile ============================================================================== --- head/lib/libgcc_eh/Makefile Fri Nov 11 23:07:31 2016 (r308562) +++ head/lib/libgcc_eh/Makefile Fri Nov 11 23:28:07 2016 (r308563) @@ -5,6 +5,7 @@ PACKAGE= clibs LIB= gcc_eh NO_PIC= +MK_SSP= no WARNS?= 2 .include "Makefile.inc" Modified: head/lib/libgcc_s/Makefile ============================================================================== --- head/lib/libgcc_s/Makefile Fri Nov 11 23:07:31 2016 (r308562) +++ head/lib/libgcc_s/Makefile Fri Nov 11 23:28:07 2016 (r308563) @@ -4,6 +4,7 @@ PACKAGE= clibs SHLIB_NAME= libgcc_s.so.1 SHLIBDIR?= /lib +MK_SSP= no WARNS?= 2 LDFLAGS+= -nodefaultlibs From owner-svn-src-head@freebsd.org Fri Nov 11 23:36:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BA17C3978D; Fri, 11 Nov 2016 23:36:18 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:c:538::195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B5BA144E; Fri, 11 Nov 2016 23:36:17 +0000 (UTC) (envelope-from joerg@bec.de) Received: from britannica.bec.de (p200300D2ABC8E8104639C4FFFE599710.dip0.t-ipconnect.de [IPv6:2003:d2:abc8:e810:4639:c4ff:fe59:9710]) (Authenticated sender: joerg@bec.de) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id E045AA80C0; Sat, 12 Nov 2016 00:36:13 +0100 (CET) Date: Sat, 12 Nov 2016 00:36:12 +0100 From: Joerg Sonnenberger To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308563 - in head/lib: libgcc_eh libgcc_s Message-ID: <20161111233612.GA28088@britannica.bec.de> References: <201611112328.uABNS831094712@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201611112328.uABNS831094712@repo.freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 23:36:18 -0000 On Fri, Nov 11, 2016 at 11:28:08PM +0000, Ed Maste wrote: > Author: emaste > Date: Fri Nov 11 23:28:07 2016 > New Revision: 308563 > URL: https://svnweb.freebsd.org/changeset/base/308563 > > Log: > libcc_{s,eh}: build without SSP > > As in the gnu/lib/libgcc Makefile: > libgcc is linked in last and thus cannot depend on ssp > symbols coming from earlier libraries. Disable stack protection > for this library. That doesn't make sense to me given that libgcc_s at least definitely depends on libc for the system calls? Joerg From owner-svn-src-head@freebsd.org Sat Nov 12 00:14:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 347F2C3A69E; Sat, 12 Nov 2016 00:14:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 116C8C14; Sat, 12 Nov 2016 00:14:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAC0EDAt014780; Sat, 12 Nov 2016 00:14:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAC0EDQs014779; Sat, 12 Nov 2016 00:14:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201611120014.uAC0EDQs014779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 12 Nov 2016 00:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308564 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 00:14:14 -0000 Author: jhb Date: Sat Nov 12 00:14:13 2016 New Revision: 308564 URL: https://svnweb.freebsd.org/changeset/base/308564 Log: Don't place threads on the run queue after waking up other CPUs. The other CPU might resume and see a still-empty runq and go back to sleep before sched_add() adds the thread to the runq. This results in a lost wakeup and a potential hang if the system is otherwise completely idle. The race originated due to a micro-optimization (my fault) in 4BSD in that it avoided putting a thread on the run queue if the scheduler was going to preempt to the new thread. To avoid complexity while fixing this race, just drop this optimization. 4BSD now always sets the "owepreempt" flag when a preemption is warranted and defers the actual preemption to the thread_unlock of the caller the same as ULE. MFC after: 2 weeks Sponsored by: Netflix Modified: head/sys/kern/sched_4bsd.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Fri Nov 11 23:28:07 2016 (r308563) +++ head/sys/kern/sched_4bsd.c Sat Nov 12 00:14:13 2016 (r308564) @@ -308,9 +308,8 @@ maybe_resched(struct thread *td) /* * This function is called when a thread is about to be put on run queue * because it has been made runnable or its priority has been adjusted. It - * determines if the new thread should be immediately preempted to. If so, - * it switches to it and eventually returns true. If not, it returns false - * so that the caller may place the thread on an appropriate run queue. + * determines if the new thread should preempt the current thread. If so, + * it sets td_owepreempt to request a preemption. */ int maybe_preempt(struct thread *td) @@ -356,29 +355,8 @@ maybe_preempt(struct thread *td) return (0); #endif - if (ctd->td_critnest > 1) { - CTR1(KTR_PROC, "maybe_preempt: in critical section %d", - ctd->td_critnest); - ctd->td_owepreempt = 1; - return (0); - } - /* - * Thread is runnable but not yet put on system run queue. - */ - MPASS(ctd->td_lock == td->td_lock); - MPASS(TD_ON_RUNQ(td)); - TD_SET_RUNNING(td); - CTR3(KTR_PROC, "preempting to thread %p (pid %d, %s)\n", td, - td->td_proc->p_pid, td->td_name); - mi_switch(SW_INVOL | SW_PREEMPT | SWT_PREEMPT, td); - /* - * td's lock pointer may have changed. We have to return with it - * locked. - */ - spinlock_enter(); - thread_unlock(ctd); - thread_lock(td); - spinlock_exit(); + CTR0(KTR_PROC, "maybe_preempt: scheduling preemption"); + ctd->td_owepreempt = 1; return (1); #else return (0); @@ -1332,6 +1310,12 @@ sched_add(struct thread *td, int flags) ts->ts_runq = &runq; } + if ((td->td_flags & TDF_NOLOAD) == 0) + sched_load_add(); + runq_add(ts->ts_runq, td, flags); + if (cpu != NOCPU) + runq_length[cpu]++; + cpuid = PCPU_GET(cpuid); if (single_cpu && cpu != cpuid) { kick_other_cpu(td->td_priority, cpu); @@ -1348,18 +1332,10 @@ sched_add(struct thread *td, int flags) } if (!forwarded) { - if ((flags & SRQ_YIELDING) == 0 && maybe_preempt(td)) - return; - else + if (!maybe_preempt(td)) maybe_resched(td); } } - - if ((td->td_flags & TDF_NOLOAD) == 0) - sched_load_add(); - runq_add(ts->ts_runq, td, flags); - if (cpu != NOCPU) - runq_length[cpu]++; } #else /* SMP */ { @@ -1393,23 +1369,11 @@ sched_add(struct thread *td, int flags) CTR2(KTR_RUNQ, "sched_add: adding td_sched:%p (td:%p) to runq", ts, td); ts->ts_runq = &runq; - /* - * If we are yielding (on the way out anyhow) or the thread - * being saved is US, then don't try be smart about preemption - * or kicking off another CPU as it won't help and may hinder. - * In the YIEDLING case, we are about to run whoever is being - * put in the queue anyhow, and in the OURSELF case, we are - * putting ourself on the run queue which also only happens - * when we are about to yield. - */ - if ((flags & SRQ_YIELDING) == 0) { - if (maybe_preempt(td)) - return; - } if ((td->td_flags & TDF_NOLOAD) == 0) sched_load_add(); runq_add(ts->ts_runq, td, flags); - maybe_resched(td); + if (!maybe_preempt(td)) + maybe_resched(td); } #endif /* SMP */ From owner-svn-src-head@freebsd.org Sat Nov 12 00:23:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD08BC3A93A; Sat, 12 Nov 2016 00:23:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F0451185; Sat, 12 Nov 2016 00:23:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAC0N9vj018533; Sat, 12 Nov 2016 00:23:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAC0N9fe018532; Sat, 12 Nov 2016 00:23:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201611120023.uAC0N9fe018532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 12 Nov 2016 00:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308565 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 00:23:10 -0000 Author: jhb Date: Sat Nov 12 00:23:09 2016 New Revision: 308565 URL: https://svnweb.freebsd.org/changeset/base/308565 Log: Allow scheduling during early boot. - Send IPI wakeups once SMP is started even if cold is true. - Permit preemptions when cold is true. These changes are needed for EARLY_AP_STARTUP. MFC after: 2 weeks Sponsored by: Netflix Modified: head/sys/kern/sched_4bsd.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Sat Nov 12 00:14:13 2016 (r308564) +++ head/sys/kern/sched_4bsd.c Sat Nov 12 00:23:09 2016 (r308565) @@ -326,7 +326,6 @@ maybe_preempt(struct thread *td) * - The current thread has a higher (numerically lower) or * equivalent priority. Note that this prevents curthread from * trying to preempt to itself. - * - It is too early in the boot for context switches (cold is set). * - The current thread has an inhibitor set or is in the process of * exiting. In this case, the current thread is about to switch * out anyways, so there's no point in preempting. If we did, @@ -347,7 +346,7 @@ maybe_preempt(struct thread *td) ("maybe_preempt: trying to run inhibited thread")); pri = td->td_priority; cpri = ctd->td_priority; - if (panicstr != NULL || pri >= cpri || cold /* || dumping */ || + if (panicstr != NULL || pri >= cpri /* || dumping */ || TD_IS_INHIBITED(ctd)) return (0); #ifndef FULL_PREEMPTION @@ -1105,7 +1104,7 @@ forward_wakeup(int cpunum) if ((!forward_wakeup_enabled) || (forward_wakeup_use_mask == 0 && forward_wakeup_use_loop == 0)) return (0); - if (!smp_started || cold || panicstr) + if (!smp_started || panicstr) return (0); forward_wakeups_requested++; From owner-svn-src-head@freebsd.org Sat Nov 12 01:41:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A87F5C3AF1D; Sat, 12 Nov 2016 01:41:44 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75A5E1DE6; Sat, 12 Nov 2016 01:41:44 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAC1fh8L049370; Sat, 12 Nov 2016 01:41:43 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAC1fh2J049369; Sat, 12 Nov 2016 01:41:43 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <201611120141.uAC1fh2J049369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Sat, 12 Nov 2016 01:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308566 - head/sys/dev/virtio/console X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 01:41:44 -0000 Author: jceel Date: Sat Nov 12 01:41:43 2016 New Revision: 308566 URL: https://svnweb.freebsd.org/changeset/base/308566 Log: Reserve space for control message payload (currently a port name). Approved by: trasz (mentor) Sponsored by: iXsystems, Inc. Modified: head/sys/dev/virtio/console/virtio_console.c Modified: head/sys/dev/virtio/console/virtio_console.c ============================================================================== --- head/sys/dev/virtio/console/virtio_console.c Sat Nov 12 00:23:09 2016 (r308565) +++ head/sys/dev/virtio/console/virtio_console.c Sat Nov 12 01:41:43 2016 (r308566) @@ -600,7 +600,7 @@ vtcon_ctrl_event_enqueue(struct vtcon_so sglist_init(&sg, 2, segs); error = sglist_append(&sg, control, - sizeof(struct virtio_console_control)); + sizeof(struct virtio_console_control) + VTCON_BULK_BUFSZ); KASSERT(error == 0, ("%s: error %d adding control to sglist", __func__, error)); @@ -633,7 +633,8 @@ vtcon_ctrl_event_requeue(struct vtcon_so { int error; - bzero(control, sizeof(struct virtio_console_control)); + bzero(control, sizeof(struct virtio_console_control) + + VTCON_BULK_BUFSZ); error = vtcon_ctrl_event_enqueue(sc, control); KASSERT(error == 0, From owner-svn-src-head@freebsd.org Sat Nov 12 03:07:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76520C3C1FC; Sat, 12 Nov 2016 03:07:42 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47F291840; Sat, 12 Nov 2016 03:07:42 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAC37fYp083244; Sat, 12 Nov 2016 03:07:41 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAC37f2S083243; Sat, 12 Nov 2016 03:07:41 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201611120307.uAC37f2S083243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Sat, 12 Nov 2016 03:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308567 - head/libexec/ftpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 03:07:42 -0000 Author: lidl Date: Sat Nov 12 03:07:41 2016 New Revision: 308567 URL: https://svnweb.freebsd.org/changeset/base/308567 Log: Fix build when WITHOUT_BLACKLIST=yes is specified PR: 214409 Submitted by: matthew Reported by: matteo MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/libexec/ftpd/ftpd.c Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Sat Nov 12 01:41:43 2016 (r308566) +++ head/libexec/ftpd/ftpd.c Sat Nov 12 03:07:41 2016 (r308567) @@ -93,10 +93,7 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifdef USE_BLACKLIST #include "blacklist_client.h" -#endif - #include "pathnames.h" #include "extern.h" From owner-svn-src-head@freebsd.org Sat Nov 12 03:10:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70E98C3C37D; Sat, 12 Nov 2016 03:10:31 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from hydra.pix.net (hydra.pix.net [IPv6:2001:470:e254:11::4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.pix.net", Issuer "Pix.Com Technologies LLC CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4199C1A94; Sat, 12 Nov 2016 03:10:31 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from torb.pix.net (torb.pix.net [192.168.16.32]) (authenticated bits=0) by hydra.pix.net (8.16.0.19/8.15.2) with ESMTPA id uAC3ATcQ053656; Fri, 11 Nov 2016 22:10:29 -0500 (EST) (envelope-from lidl@FreeBSD.org) Reply-To: lidl@FreeBSD.org Subject: Re: svn commit: r308175 - head/libexec/ftpd References: <201611011818.uA1II9oe069262@repo.freebsd.org> To: Matteo Riondato Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kurt Lidl Message-ID: Date: Fri, 11 Nov 2016 22:10:29 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 03:10:31 -0000 On 11/10/16 4:25 PM, Matteo Riondato wrote: > >> On Nov 1, 2016, at 2:18 PM, Kurt Lidl wrote: >> >> Author: lidl >> Date: Tue Nov 1 18:18:09 2016 >> New Revision: 308175 >> URL: https://svnweb.freebsd.org/changeset/base/308175 >> >> Log: >> Revisit blacklistd support in ftpd > > This commit is breaking buildworld for me with WITHOUT_BLACKLIST=y in src.conf : Oops. Should be fixed in r308567. -Kurt From owner-svn-src-head@freebsd.org Sat Nov 12 05:09:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D58EC3D62C; Sat, 12 Nov 2016 05:09:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD7C61B4A; Sat, 12 Nov 2016 05:09:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAC59e7W030457; Sat, 12 Nov 2016 05:09:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAC59eCd030456; Sat, 12 Nov 2016 05:09:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611120509.uAC59eCd030456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 12 Nov 2016 05:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308568 - head/sys/dev/acpi_support X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 05:09:41 -0000 Author: mav Date: Sat Nov 12 05:09:39 2016 New Revision: 308568 URL: https://svnweb.freebsd.org/changeset/base/308568 Log: Set of improvements to acpi_hp(4) driver. - Attach only to WMI devices that provide supported GUIDs. HP Spectre x360 has two WMI devices, only one of which provides the GUIDs. - Pass proper device to ACPI_WMI_REMOVE_EVENT_HANDLER() on detach. - Improve error WMI handling separating status and data paths. This allows to hide sysctls not supported by specific hardware/BIOS. - Improve CMI block parser to make it work on HP Spectre x360 laptop. - In verbose mode log all unknown events to help futher improvements. Modified: head/sys/dev/acpi_support/acpi_hp.c Modified: head/sys/dev/acpi_support/acpi_hp.c ============================================================================== --- head/sys/dev/acpi_support/acpi_hp.c Sat Nov 12 03:07:41 2016 (r308567) +++ head/sys/dev/acpi_support/acpi_hp.c Sat Nov 12 05:09:39 2016 (r308568) @@ -66,11 +66,17 @@ ACPI_MODULE_NAME("HP") #define ACPI_HP_WMI_BIOS_GUID "5FB7F034-2C63-45E9-BE91-3D44E2C707E4" #define ACPI_HP_WMI_CMI_GUID "2D114B49-2DFB-4130-B8FE-4A3C09E75133" -#define ACPI_HP_WMI_DISPLAY_COMMAND 0x1 -#define ACPI_HP_WMI_HDDTEMP_COMMAND 0x2 -#define ACPI_HP_WMI_ALS_COMMAND 0x3 -#define ACPI_HP_WMI_DOCK_COMMAND 0x4 -#define ACPI_HP_WMI_WIRELESS_COMMAND 0x5 +#define ACPI_HP_WMI_DISPLAY_COMMAND 0x1 +#define ACPI_HP_WMI_HDDTEMP_COMMAND 0x2 +#define ACPI_HP_WMI_ALS_COMMAND 0x3 +#define ACPI_HP_WMI_DOCK_COMMAND 0x4 +#define ACPI_HP_WMI_WIRELESS_COMMAND 0x5 +#define ACPI_HP_WMI_BIOS_COMMAND 0x9 +#define ACPI_HP_WMI_FEATURE_COMMAND 0xb +#define ACPI_HP_WMI_HOTKEY_COMMAND 0xc +#define ACPI_HP_WMI_FEATURE2_COMMAND 0xd +#define ACPI_HP_WMI_WIRELESS2_COMMAND 0x1b +#define ACPI_HP_WMI_POSTCODEERROR_COMMAND 0x2a #define ACPI_HP_METHOD_WLAN_ENABLED 1 #define ACPI_HP_METHOD_WLAN_RADIO 2 @@ -104,11 +110,32 @@ ACPI_MODULE_NAME("HP") #define HP_MASK_BLUETOOTH_ENABLED 0x20000 #define HP_MASK_WLAN_ENABLED 0x200 +#define ACPI_HP_EVENT_DOCK 0x01 +#define ACPI_HP_EVENT_PARK_HDD 0x02 +#define ACPI_HP_EVENT_SMART_ADAPTER 0x03 +#define ACPI_HP_EVENT_BEZEL_BUTTON 0x04 +#define ACPI_HP_EVENT_WIRELESS 0x05 +#define ACPI_HP_EVENT_CPU_BATTERY_THROTTLE 0x06 +#define ACPI_HP_EVENT_LOCK_SWITCH 0x07 +#define ACPI_HP_EVENT_LID_SWITCH 0x08 +#define ACPI_HP_EVENT_SCREEN_ROTATION 0x09 +#define ACPI_HP_EVENT_COOLSENSE_SYSTEM_MOBILE 0x0A +#define ACPI_HP_EVENT_COOLSENSE_SYSTEM_HOT 0x0B +#define ACPI_HP_EVENT_PROXIMITY_SENSOR 0x0C +#define ACPI_HP_EVENT_BACKLIT_KB_BRIGHTNESS 0x0D +#define ACPI_HP_EVENT_PEAKSHIFT_PERIOD 0x0F +#define ACPI_HP_EVENT_BATTERY_CHARGE_PERIOD 0x10 + #define ACPI_HP_CMI_DETAIL_PATHS 0x01 #define ACPI_HP_CMI_DETAIL_ENUMS 0x02 #define ACPI_HP_CMI_DETAIL_FLAGS 0x04 #define ACPI_HP_CMI_DETAIL_SHOW_MAX_INSTANCE 0x08 +#define ACPI_HP_WMI_RET_WRONG_SIGNATURE 0x02 +#define ACPI_HP_WMI_RET_UNKNOWN_COMMAND 0x03 +#define ACPI_HP_WMI_RET_UNKNOWN_CMDTYPE 0x04 +#define ACPI_HP_WMI_RET_INVALID_PARAMETERS 0x05 + struct acpi_hp_inst_seq_pair { UINT32 sequence; /* sequence number as suggested by cmi bios */ UINT8 instance; /* object instance on guid */ @@ -119,6 +146,7 @@ struct acpi_hp_softc { device_t wmi_dev; int has_notify; /* notification GUID found */ int has_cmi; /* CMI GUID found */ + int has_wireless; /* Wireless command found */ int cmi_detail; /* CMI detail level (set by sysctl) */ int verbose; /* add debug output */ @@ -287,7 +315,7 @@ static int acpi_hp_sysctl_set(struct acp int arg, int oldarg); static int acpi_hp_sysctl_get(struct acpi_hp_softc *sc, int method); static int acpi_hp_exec_wmi_command(device_t wmi_dev, int command, - int is_write, int val); + int is_write, int val, int *retval); static void acpi_hp_notify(ACPI_HANDLE h, UINT32 notify, void *context); static int acpi_hp_get_cmi_block(device_t wmi_dev, const char* guid, UINT8 instance, char* outbuf, size_t outsize, @@ -332,13 +360,18 @@ MODULE_DEPEND(acpi_hp, acpi, 1, 1, 1); static void acpi_hp_evaluate_auto_on_off(struct acpi_hp_softc *sc) { + int res; int wireless; int new_wlan_status; int new_bluetooth_status; int new_wwan_status; - wireless = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0); + res = acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0, &wireless); + if (res != 0) { + device_printf(sc->wmi_dev, "Wireless command error %x\n", res); + return; + } new_wlan_status = -1; new_bluetooth_status = -1; new_wwan_status = -1; @@ -348,41 +381,41 @@ acpi_hp_evaluate_auto_on_off(struct acpi if (sc->wlan_disable_if_radio_off && !(wireless & HP_MASK_WLAN_RADIO) && (wireless & HP_MASK_WLAN_ENABLED)) { acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 1, 0x100); + ACPI_HP_WMI_WIRELESS_COMMAND, 1, 0x100, NULL); new_wlan_status = 0; } else if (sc->wlan_enable_if_radio_on && (wireless & HP_MASK_WLAN_RADIO) && !(wireless & HP_MASK_WLAN_ENABLED)) { acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 1, 0x101); + ACPI_HP_WMI_WIRELESS_COMMAND, 1, 0x101, NULL); new_wlan_status = 1; } if (sc->bluetooth_disable_if_radio_off && !(wireless & HP_MASK_BLUETOOTH_RADIO) && (wireless & HP_MASK_BLUETOOTH_ENABLED)) { acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 1, 0x200); + ACPI_HP_WMI_WIRELESS_COMMAND, 1, 0x200, NULL); new_bluetooth_status = 0; } else if (sc->bluetooth_enable_if_radio_on && (wireless & HP_MASK_BLUETOOTH_RADIO) && !(wireless & HP_MASK_BLUETOOTH_ENABLED)) { acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 1, 0x202); + ACPI_HP_WMI_WIRELESS_COMMAND, 1, 0x202, NULL); new_bluetooth_status = 1; } if (sc->wwan_disable_if_radio_off && !(wireless & HP_MASK_WWAN_RADIO) && (wireless & HP_MASK_WWAN_ENABLED)) { acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 1, 0x400); + ACPI_HP_WMI_WIRELESS_COMMAND, 1, 0x400, NULL); new_wwan_status = 0; } else if (sc->wwan_enable_if_radio_on && (wireless & HP_MASK_WWAN_RADIO) && !(wireless & HP_MASK_WWAN_ENABLED)) { acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 1, 0x404); + ACPI_HP_WMI_WIRELESS_COMMAND, 1, 0x404, NULL); new_wwan_status = 1; } @@ -441,6 +474,11 @@ acpi_hp_identify(driver_t *driver, devic if (device_find_child(parent, "acpi_hp", -1) != NULL) return; + /* Check BIOS GUID to see whether system is compatible. */ + if (!ACPI_WMI_PROVIDES_GUID_STRING(parent, + ACPI_HP_WMI_BIOS_GUID)) + return; + if (BUS_ADD_CHILD(parent, 0, "acpi_hp", -1) == NULL) device_printf(parent, "add acpi_hp child failed\n"); } @@ -476,7 +514,7 @@ acpi_hp_attach(device_t dev) sc->was_wwan_on_air = 0; sc->cmi_detail = 0; sc->cmi_order_size = -1; - sc->verbose = 0; + sc->verbose = bootverbose; memset(sc->cmi_order, 0, sizeof(sc->cmi_order)); sc->wmi_dev = device_get_parent(dev); @@ -513,13 +551,17 @@ acpi_hp_attach(device_t dev) sc->hpcmi_bufptr = -1; } + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0, NULL) == 0) + sc->has_wireless = 1; + ACPI_SERIAL_BEGIN(hp); sc->sysctl_ctx = device_get_sysctl_ctx(dev); sc->sysctl_tree = device_get_sysctl_tree(dev); for (int i = 0; acpi_hp_sysctls[i].name != NULL; ++i) { arg = 0; - if ((!sc->has_notify && + if (((!sc->has_notify || !sc->has_wireless) && (acpi_hp_sysctls[i].method == ACPI_HP_METHOD_WLAN_ENABLE_IF_RADIO_ON || acpi_hp_sysctls[i].method == @@ -577,8 +619,10 @@ acpi_hp_detach(device_t dev) if (sc->has_cmi && sc->hpcmi_open_pid != 0) return (EBUSY); - if (sc->has_notify) - ACPI_WMI_REMOVE_EVENT_HANDLER(dev, ACPI_HP_WMI_EVENT_GUID); + if (sc->has_notify) { + ACPI_WMI_REMOVE_EVENT_HANDLER(sc->wmi_dev, + ACPI_HP_WMI_EVENT_GUID); + } if (sc->has_cmi) { if (sc->hpcmi_bufptr != -1) { @@ -630,18 +674,21 @@ acpi_hp_sysctl_get(struct acpi_hp_softc switch (method) { case ACPI_HP_METHOD_WLAN_ENABLED: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0, &val)) + return (-EINVAL); val = ((val & HP_MASK_WLAN_ENABLED) != 0); break; case ACPI_HP_METHOD_WLAN_RADIO: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0, &val)) + return (-EINVAL); val = ((val & HP_MASK_WLAN_RADIO) != 0); break; case ACPI_HP_METHOD_WLAN_ON_AIR: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0, &val)) + return (-EINVAL); val = ((val & HP_MASK_WLAN_ON_AIR) != 0); break; case ACPI_HP_METHOD_WLAN_ENABLE_IF_RADIO_ON: @@ -651,18 +698,21 @@ acpi_hp_sysctl_get(struct acpi_hp_softc val = sc->wlan_disable_if_radio_off; break; case ACPI_HP_METHOD_BLUETOOTH_ENABLED: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0, &val)) + return (-EINVAL); val = ((val & HP_MASK_BLUETOOTH_ENABLED) != 0); break; case ACPI_HP_METHOD_BLUETOOTH_RADIO: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0, &val)) + return (-EINVAL); val = ((val & HP_MASK_BLUETOOTH_RADIO) != 0); break; case ACPI_HP_METHOD_BLUETOOTH_ON_AIR: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0, &val)) + return (-EINVAL); val = ((val & HP_MASK_BLUETOOTH_ON_AIR) != 0); break; case ACPI_HP_METHOD_BLUETOOTH_ENABLE_IF_RADIO_ON: @@ -672,18 +722,21 @@ acpi_hp_sysctl_get(struct acpi_hp_softc val = sc->bluetooth_disable_if_radio_off; break; case ACPI_HP_METHOD_WWAN_ENABLED: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0, &val)) + return (-EINVAL); val = ((val & HP_MASK_WWAN_ENABLED) != 0); break; case ACPI_HP_METHOD_WWAN_RADIO: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0, &val)) + return (-EINVAL); val = ((val & HP_MASK_WWAN_RADIO) != 0); break; case ACPI_HP_METHOD_WWAN_ON_AIR: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0, &val)) + return (-EINVAL); val = ((val & HP_MASK_WWAN_ON_AIR) != 0); break; case ACPI_HP_METHOD_WWAN_ENABLE_IF_RADIO_ON: @@ -693,20 +746,24 @@ acpi_hp_sysctl_get(struct acpi_hp_softc val = sc->wwan_disable_if_radio_off; break; case ACPI_HP_METHOD_ALS: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_ALS_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_ALS_COMMAND, 0, 0, &val)) + return (-EINVAL); break; case ACPI_HP_METHOD_DISPLAY: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_DISPLAY_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_DISPLAY_COMMAND, 0, 0, &val)) + return (-EINVAL); break; case ACPI_HP_METHOD_HDDTEMP: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_HDDTEMP_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_HDDTEMP_COMMAND, 0, 0, &val)) + return (-EINVAL); break; case ACPI_HP_METHOD_DOCK: - val = acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_DOCK_COMMAND, 0, 0); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_DOCK_COMMAND, 0, 0, &val)) + return (-EINVAL); break; case ACPI_HP_METHOD_CMI_DETAIL: val = sc->cmi_detail; @@ -732,9 +789,11 @@ acpi_hp_sysctl_set(struct acpi_hp_softc if (arg != oldarg) { switch (method) { case ACPI_HP_METHOD_WLAN_ENABLED: - return (acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 1, - arg?0x101:0x100)); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 1, + arg?0x101:0x100, NULL)) + return (-EINVAL); + break; case ACPI_HP_METHOD_WLAN_ENABLE_IF_RADIO_ON: sc->wlan_enable_if_radio_on = arg; acpi_hp_evaluate_auto_on_off(sc); @@ -744,9 +803,11 @@ acpi_hp_sysctl_set(struct acpi_hp_softc acpi_hp_evaluate_auto_on_off(sc); break; case ACPI_HP_METHOD_BLUETOOTH_ENABLED: - return (acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 1, - arg?0x202:0x200)); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 1, + arg?0x202:0x200, NULL)) + return (-EINVAL); + break; case ACPI_HP_METHOD_BLUETOOTH_ENABLE_IF_RADIO_ON: sc->bluetooth_enable_if_radio_on = arg; acpi_hp_evaluate_auto_on_off(sc); @@ -756,9 +817,11 @@ acpi_hp_sysctl_set(struct acpi_hp_softc acpi_hp_evaluate_auto_on_off(sc); break; case ACPI_HP_METHOD_WWAN_ENABLED: - return (acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_WIRELESS_COMMAND, 1, - arg?0x404:0x400)); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_WIRELESS_COMMAND, 1, + arg?0x404:0x400, NULL)) + return (-EINVAL); + break; case ACPI_HP_METHOD_WWAN_ENABLE_IF_RADIO_ON: sc->wwan_enable_if_radio_on = arg?1:0; acpi_hp_evaluate_auto_on_off(sc); @@ -768,9 +831,10 @@ acpi_hp_sysctl_set(struct acpi_hp_softc acpi_hp_evaluate_auto_on_off(sc); break; case ACPI_HP_METHOD_ALS: - return (acpi_hp_exec_wmi_command(sc->wmi_dev, - ACPI_HP_WMI_ALS_COMMAND, 1, - arg?1:0)); + if (acpi_hp_exec_wmi_command(sc->wmi_dev, + ACPI_HP_WMI_ALS_COMMAND, 1, arg?1:0, NULL)) + return (-EINVAL); + break; case ACPI_HP_METHOD_CMI_DETAIL: sc->cmi_detail = arg; if ((arg & ACPI_HP_CMI_DETAIL_SHOW_MAX_INSTANCE) != @@ -806,26 +870,32 @@ acpi_hp_notify(ACPI_HANDLE h, UINT32 not ACPI_WMI_GET_EVENT_DATA(sc->wmi_dev, notify, &response); obj = (ACPI_OBJECT*) response.Pointer; if (obj && obj->Type == ACPI_TYPE_BUFFER && obj->Buffer.Length == 8) { - if (*((UINT8 *) obj->Buffer.Pointer) == 0x5) { + switch (*((UINT8 *) obj->Buffer.Pointer)) { + case ACPI_HP_EVENT_WIRELESS: acpi_hp_evaluate_auto_on_off(sc); + break; + default: + if (sc->verbose) { + device_printf(sc->dev, "Event %02x\n", + *((UINT8 *) obj->Buffer.Pointer)); + } + break; } } acpi_hp_free_buffer(&response); } static int -acpi_hp_exec_wmi_command(device_t wmi_dev, int command, int is_write, int val) +acpi_hp_exec_wmi_command(device_t wmi_dev, int command, int is_write, + int val, int *retval) { - UINT32 params[5] = { 0x55434553, - is_write?2:1, - command, - is_write?4:0, - val}; + UINT32 params[4+32] = { 0x55434553, is_write ? 2 : 1, + command, 4, val}; UINT32* result; ACPI_OBJECT *obj; ACPI_BUFFER in = { sizeof(params), ¶ms }; ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL }; - int retval; + int res; if (ACPI_FAILURE(ACPI_WMI_EVALUATE_CALL(wmi_dev, ACPI_HP_WMI_BIOS_GUID, 0, 0x3, &in, &out))) { @@ -838,13 +908,12 @@ acpi_hp_exec_wmi_command(device_t wmi_de return (-EINVAL); } result = (UINT32*) obj->Buffer.Pointer; - retval = result[2]; - if (result[1] > 0) { - retval = result[1]; - } + res = result[1]; + if (res == 0 && retval != NULL) + *retval = result[2]; acpi_hp_free_buffer(&out); - return (retval); + return (res); } static __inline char* @@ -909,81 +978,91 @@ acpi_hp_get_cmi_block(device_t wmi_dev, return (-EINVAL); } - if (obj->Package.Count >= 8 && - obj->Package.Elements[7].Type == ACPI_TYPE_INTEGER) { - valuebase = 8 + obj->Package.Elements[7].Integer.Value; - } - - /* check if this matches our expectations based on limited knowledge */ - if (valuebase > 7 && obj->Package.Count > valuebase + 1 && - obj->Package.Elements[0].Type == ACPI_TYPE_STRING && - obj->Package.Elements[1].Type == ACPI_TYPE_STRING && - obj->Package.Elements[2].Type == ACPI_TYPE_STRING && - obj->Package.Elements[3].Type == ACPI_TYPE_INTEGER && - obj->Package.Elements[4].Type == ACPI_TYPE_INTEGER && - obj->Package.Elements[5].Type == ACPI_TYPE_INTEGER && - obj->Package.Elements[6].Type == ACPI_TYPE_INTEGER && - obj->Package.Elements[valuebase].Type == ACPI_TYPE_STRING && - obj->Package.Elements[valuebase+1].Type == ACPI_TYPE_INTEGER && - obj->Package.Count > valuebase + - obj->Package.Elements[valuebase+1].Integer.Value - ) { - enumbase = valuebase + 1; - if (detail & ACPI_HP_CMI_DETAIL_PATHS) { - strlcat(outbuf, acpi_hp_get_string_from_object( - &obj->Package.Elements[2], string_buffer, size), - outsize); - outlen += 48; - while (strlen(outbuf) < outlen) - strlcat(outbuf, " ", outsize); - } - strlcat(outbuf, acpi_hp_get_string_from_object( - &obj->Package.Elements[0], string_buffer, size), - outsize); - outlen += 43; - while (strlen(outbuf) < outlen) - strlcat(outbuf, " ", outsize); + /* Check if first 6 bytes matches our expectations. */ + if (obj->Package.Count < 8 || + obj->Package.Elements[0].Type != ACPI_TYPE_STRING || + obj->Package.Elements[1].Type != ACPI_TYPE_STRING || + obj->Package.Elements[2].Type != ACPI_TYPE_STRING || + obj->Package.Elements[3].Type != ACPI_TYPE_INTEGER || + obj->Package.Elements[4].Type != ACPI_TYPE_INTEGER || + obj->Package.Elements[5].Type != ACPI_TYPE_INTEGER || + obj->Package.Elements[6].Type != ACPI_TYPE_INTEGER || + obj->Package.Elements[7].Type != ACPI_TYPE_INTEGER) { + acpi_hp_free_buffer(&out); + return (-EINVAL); + } + + /* Skip prerequisites and optionally array. */ + valuebase = 8 + obj->Package.Elements[7].Integer.Value; + if (obj->Package.Count <= valuebase) { + acpi_hp_free_buffer(&out); + return (-EINVAL); + } + if (obj->Package.Elements[valuebase].Type == ACPI_TYPE_INTEGER) + valuebase += 1 + obj->Package.Elements[valuebase].Integer.Value; + + /* Check if we have value and enum. */ + if (obj->Package.Count <= valuebase + 1 || + obj->Package.Elements[valuebase].Type != ACPI_TYPE_STRING || + obj->Package.Elements[valuebase+1].Type != ACPI_TYPE_INTEGER) { + acpi_hp_free_buffer(&out); + return (-EINVAL); + } + enumbase = valuebase + 1; + if (obj->Package.Count <= valuebase + + obj->Package.Elements[enumbase].Integer.Value) { + acpi_hp_free_buffer(&out); + return (-EINVAL); + } + + if (detail & ACPI_HP_CMI_DETAIL_PATHS) { strlcat(outbuf, acpi_hp_get_string_from_object( - &obj->Package.Elements[valuebase], string_buffer, - size), - outsize); - outlen += 21; + &obj->Package.Elements[2], string_buffer, size), outsize); + outlen += 48; while (strlen(outbuf) < outlen) strlcat(outbuf, " ", outsize); - for (i = 0; i < strlen(outbuf); ++i) - if (outbuf[i] == '\\') - outbuf[i] = '/'; - if (detail & ACPI_HP_CMI_DETAIL_ENUMS) { - for (i = enumbase + 1; i < enumbase + 1 + - obj->Package.Elements[enumbase].Integer.Value; - ++i) { - acpi_hp_get_string_from_object( - &obj->Package.Elements[i], string_buffer, - size); - if (strlen(string_buffer) > 1 || - (strlen(string_buffer) == 1 && - string_buffer[0] != ' ')) { - if (has_enums) - strlcat(outbuf, "/", outsize); - else - strlcat(outbuf, " (", outsize); - strlcat(outbuf, string_buffer, outsize); - has_enums = 1; - } + } + strlcat(outbuf, acpi_hp_get_string_from_object( + &obj->Package.Elements[0], string_buffer, size), outsize); + outlen += 43; + while (strlen(outbuf) < outlen) + strlcat(outbuf, " ", outsize); + strlcat(outbuf, acpi_hp_get_string_from_object( + &obj->Package.Elements[valuebase], string_buffer, size), outsize); + outlen += 21; + while (strlen(outbuf) < outlen) + strlcat(outbuf, " ", outsize); + for (i = 0; i < strlen(outbuf); ++i) + if (outbuf[i] == '\\') + outbuf[i] = '/'; + if (detail & ACPI_HP_CMI_DETAIL_ENUMS) { + for (i = enumbase + 1; i < enumbase + 1 + + obj->Package.Elements[enumbase].Integer.Value; ++i) { + acpi_hp_get_string_from_object( + &obj->Package.Elements[i], string_buffer, size); + if (strlen(string_buffer) > 1 || + (strlen(string_buffer) == 1 && + string_buffer[0] != ' ')) { + if (has_enums) + strlcat(outbuf, "/", outsize); + else + strlcat(outbuf, " (", outsize); + strlcat(outbuf, string_buffer, outsize); + has_enums = 1; } } - if (has_enums) - strlcat(outbuf, ")", outsize); - if (detail & ACPI_HP_CMI_DETAIL_FLAGS) { - strlcat(outbuf, obj->Package.Elements[3].Integer.Value? - " [ReadOnly]":"", outsize); - strlcat(outbuf, obj->Package.Elements[4].Integer.Value? - "":" [NOUI]", outsize); - strlcat(outbuf, obj->Package.Elements[5].Integer.Value? - " [RPP]":"", outsize); - } - *sequence = (UINT32) obj->Package.Elements[6].Integer.Value; } + if (has_enums) + strlcat(outbuf, ")", outsize); + if (detail & ACPI_HP_CMI_DETAIL_FLAGS) { + strlcat(outbuf, obj->Package.Elements[3].Integer.Value ? + " [ReadOnly]" : "", outsize); + strlcat(outbuf, obj->Package.Elements[4].Integer.Value ? + "" : " [NOUI]", outsize); + strlcat(outbuf, obj->Package.Elements[5].Integer.Value ? + " [RPP]" : "", outsize); + } + *sequence = (UINT32) obj->Package.Elements[6].Integer.Value; acpi_hp_free_buffer(&out); return (0); From owner-svn-src-head@freebsd.org Sat Nov 12 09:28:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24844C28A6B; Sat, 12 Nov 2016 09:28:38 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C64D410D8; Sat, 12 Nov 2016 09:28:37 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id a20so2353834wme.2; Sat, 12 Nov 2016 01:28:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=z54nAzU1APfRrOaTlDgj3l54wdvubYI8kTU4/CtMXow=; b=lL/u1Qy4diXpDDaQvCY1cGXMfvPp6NnvNnfSb8ox8m6Y90GSTy7yrE5+BhMXBGTAUP KxTbAGX0VZ8W+EFZx7R036upNoNm5wkwLdmMoMgXcO3rHrQbK666iNPot7YIwA29HKjB Gx6Vu5+RpLiYuq5Hw1MRtuLsFWaX9Onl9DjJeVPgXk6g56MwLSiUQWTud+SzzufRtuqa 3bXA9dMlVYgof9XNmggfJM701J0yhtsbH7D3/HBPZRqTi5WoSKblWRESg/vwYN63AiSp ozBtqkO6Ql9d7hKOgJVxVrtFfAZRGYLtSU+m/oGQhf6nKkHNc4xWnvX2CAuIzN7ACffC JtWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=z54nAzU1APfRrOaTlDgj3l54wdvubYI8kTU4/CtMXow=; b=RRp0ZJGMh3T7Pc7m7DXu6nN8atcCkEbFvzqgQVMl4a9EMenXxNDj++gAgrB0xEb3l9 7nWdOEHOG3SyvlFDGyHNQOnaqiulygZhy3LwpeSzAuXu9MNX4lwpiytlfdRHoijubJlq ZJL2Y8Tl0flaMGLhgv2XgWgoqczBXxhaMxATqMNXU+98DwFAjosLE1rwp69n/QbPye8B mwb2jWUryAtrr6Vw5yICJy4hkTBIFlKs4CzcMMjRoORVHT/39GKYaVN+WFKx9qR2V8q8 RU2clEB5uDJdnyTamSz6Y8bv1K5HZjTepgroiXKZrBaAUZQo6N42cbVKwon3w3dDJjs4 2jrQ== X-Gm-Message-State: ABUngvfprEyDtR+upfza15S4gzLQpKG6uvsFYvNkPtTxE0CRMj9lRX/B6uzQHWdpz+5/QA== X-Received: by 10.194.201.103 with SMTP id jz7mr13892688wjc.70.1478942915682; Sat, 12 Nov 2016 01:28:35 -0800 (PST) Received: from ernst.home (p578E14E0.dip0.t-ipconnect.de. [87.142.20.224]) by smtp.gmail.com with ESMTPSA id c202sm33680860wme.1.2016.11.12.01.28.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Nov 2016 01:28:35 -0800 (PST) Date: Sat, 12 Nov 2016 10:28:33 +0100 From: Gary Jennejohn To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308565 - head/sys/kern Message-ID: <20161112102833.5cc951b8@ernst.home> In-Reply-To: <201611120023.uAC0N9fe018532@repo.freebsd.org> References: <201611120023.uAC0N9fe018532@repo.freebsd.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 09:28:38 -0000 On Sat, 12 Nov 2016 00:23:09 +0000 (UTC) John Baldwin wrote: > Author: jhb > Date: Sat Nov 12 00:23:09 2016 > New Revision: 308565 > URL: https://svnweb.freebsd.org/changeset/base/308565 > > Log: > Allow scheduling during early boot. > > - Send IPI wakeups once SMP is started even if cold is true. > - Permit preemptions when cold is true. > > These changes are needed for EARLY_AP_STARTUP. > > MFC after: 2 weeks > Sponsored by: Netflix > > Modified: > head/sys/kern/sched_4bsd.c > Thank you, jhb! -- Gary Jennejohn From owner-svn-src-head@freebsd.org Sat Nov 12 16:40:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B061CC3D468; Sat, 12 Nov 2016 16:40:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7291DD4; Sat, 12 Nov 2016 16:40:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from airbears2-10-142-121-215.airbears2.1918.berkeley.edu (unknown [IPv6:2607:f140:400:a01e:e051:653d:b021:c582]) by mail.baldwin.cx (Postfix) with ESMTPSA id 6B31E10A718; Sat, 12 Nov 2016 11:40:30 -0500 (EST) Subject: Re: svn commit: r308565 - head/sys/kern To: gljennjohn@gmail.com References: <201611120023.uAC0N9fe018532@repo.freebsd.org> <20161112102833.5cc951b8@ernst.home> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <9d2a931d-cd92-4a82-0c47-a6737d6c6104@FreeBSD.org> Date: Sat, 12 Nov 2016 08:40:28 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161112102833.5cc951b8@ernst.home> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Sat, 12 Nov 2016 11:40:30 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 16:40:32 -0000 On 11/12/16 1:28 AM, Gary Jennejohn wrote: > On Sat, 12 Nov 2016 00:23:09 +0000 (UTC) > John Baldwin wrote: > >> Author: jhb >> Date: Sat Nov 12 00:23:09 2016 >> New Revision: 308565 >> URL: https://svnweb.freebsd.org/changeset/base/308565 >> >> Log: >> Allow scheduling during early boot. >> >> - Send IPI wakeups once SMP is started even if cold is true. >> - Permit preemptions when cold is true. >> >> These changes are needed for EARLY_AP_STARTUP. >> >> MFC after: 2 weeks >> Sponsored by: Netflix >> >> Modified: >> head/sys/kern/sched_4bsd.c >> > > Thank you, jhb! I believe the previous change fixed the original issue you reported as I was finally able to reproduce a similar hang with sched_bind when igb0 was pinning its interrupts. It was quite a bit of a PITA to track down. :( If you get a chance, can you please verify that 4BSD + EARLY_AP_STARTUP now works for you? -- John Baldwin From owner-svn-src-head@freebsd.org Sat Nov 12 17:03:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78C15C3D020; Sat, 12 Nov 2016 17:03:22 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AB8311C7; Sat, 12 Nov 2016 17:03:22 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uACH3LRU020254; Sat, 12 Nov 2016 17:03:21 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uACH3L3x020253; Sat, 12 Nov 2016 17:03:21 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201611121703.uACH3L3x020253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Sat, 12 Nov 2016 17:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308569 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 17:03:22 -0000 Author: skra Date: Sat Nov 12 17:03:21 2016 New Revision: 308569 URL: https://svnweb.freebsd.org/changeset/base/308569 Log: Always call PHYS_TO_VM_PAGE() in is_managed(). Fast road for addresses under first_page cannot be taken as this variable is connected only to vm_page_array segment. There could be more segments in system like the ones for various fictitious page ranges. These can be situated under vm_page_array segment and so, they could be skipped before this fix. However, as far as I know, there is no report associated with it. While here, the return type of this function is changed from boolean_t to bool type. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D8502 Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat Nov 12 05:09:39 2016 (r308568) +++ head/sys/arm/arm/pmap-v6.c Sat Nov 12 17:03:21 2016 (r308569) @@ -2739,21 +2739,15 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_ /* * Is given page managed? */ -static __inline boolean_t +static __inline bool is_managed(vm_paddr_t pa) { - vm_offset_t pgnum; vm_page_t m; - pgnum = atop(pa); - if (pgnum >= first_page) { - m = PHYS_TO_VM_PAGE(pa); - if (m == NULL) - return (FALSE); - if ((m->oflags & VPO_UNMANAGED) == 0) - return (TRUE); - } - return (FALSE); + m = PHYS_TO_VM_PAGE(pa); + if (m == NULL) + return (false); + return ((m->oflags & VPO_UNMANAGED) == 0); } static __inline boolean_t From owner-svn-src-head@freebsd.org Sat Nov 12 17:24:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4138FC3D62F; Sat, 12 Nov 2016 17:24:42 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 133C41B32; Sat, 12 Nov 2016 17:24:42 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uACHOftv027989; Sat, 12 Nov 2016 17:24:41 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uACHOfct027988; Sat, 12 Nov 2016 17:24:41 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201611121724.uACHOfct027988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Sat, 12 Nov 2016 17:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308570 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 17:24:42 -0000 Author: skra Date: Sat Nov 12 17:24:41 2016 New Revision: 308570 URL: https://svnweb.freebsd.org/changeset/base/308570 Log: The return type of is_managed() was changed from boolean_t to bool type in r308569. Now, propagate this change further for consistency sake. MFC after: 2 weeks Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat Nov 12 17:03:21 2016 (r308569) +++ head/sys/arm/arm/pmap-v6.c Sat Nov 12 17:24:41 2016 (r308570) @@ -2750,14 +2750,14 @@ is_managed(vm_paddr_t pa) return ((m->oflags & VPO_UNMANAGED) == 0); } -static __inline boolean_t +static __inline bool pte1_is_managed(pt1_entry_t pte1) { return (is_managed(pte1_pa(pte1))); } -static __inline boolean_t +static __inline bool pte2_is_managed(pt2_entry_t pte2) { @@ -6097,7 +6097,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad pt1_entry_t *pte1p, pte1; pt2_entry_t *pte2p, pte2; vm_paddr_t pa; - boolean_t managed; + bool managed; int val; PMAP_LOCK(pmap); @@ -6124,7 +6124,7 @@ retry: if (pte2 & PTE2_A) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; } else { - managed = FALSE; + managed = false; val = 0; } if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != From owner-svn-src-head@freebsd.org Sat Nov 12 17:58:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2F59C3DAA7; Sat, 12 Nov 2016 17:58:38 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B02211A31; Sat, 12 Nov 2016 17:58:38 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uACHwbSx041257; Sat, 12 Nov 2016 17:58:37 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uACHwbgO041250; Sat, 12 Nov 2016 17:58:37 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201611121758.uACHwbgO041250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 12 Nov 2016 17:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308575 - in head: share/man/man4 sys/dev/rtwn sys/dev/rtwn/pci sys/dev/rtwn/rtl8192c/pci sys/dev/rtwn/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 17:58:38 -0000 Author: avos Date: Sat Nov 12 17:58:37 2016 New Revision: 308575 URL: https://svnweb.freebsd.org/changeset/base/308575 Log: rtwn: enable 11n support for RTL8188CE. - Increase Rx buffer size from MCLBYTES to MJUMPAGESIZE. - Provide an additional defragmentation routine for frames larger than MCLBYTES; that is required by A-MSDU / Atheros Fast-Frames support to work with current Tx path implementation. Enabled features list for RTL8188CE: - Atheros Fast-Frames; - A-MPDU (Tx / Rx); - A-MSDU (Tx / Rx; 4k only); - Short Guard Interval. Tested with: - RTL8188CE (STA+AP) + RTL8821AU (STA). - RTL8188CE (STA) + RTL8188CUS (AP). Relnotes: yes Modified: head/share/man/man4/rtwn_pci.4 head/sys/dev/rtwn/if_rtwn_tx.h head/sys/dev/rtwn/pci/rtwn_pci_attach.c head/sys/dev/rtwn/pci/rtwn_pci_rx.c head/sys/dev/rtwn/pci/rtwn_pci_tx.c head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c head/sys/dev/rtwn/usb/rtwn_usb_rx.c Modified: head/share/man/man4/rtwn_pci.4 ============================================================================== --- head/share/man/man4/rtwn_pci.4 Sat Nov 12 17:36:28 2016 (r308574) +++ head/share/man/man4/rtwn_pci.4 Sat Nov 12 17:58:37 2016 (r308575) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd October 17, 2016 +.Dd November 12, 2016 .Dt RTWN_PCI 4 .Os .Sh NAME @@ -58,6 +58,3 @@ It operates in the 2GHz spectrum only. .Xr rtwnfw 4 , .Xr rtwn_usb 4 , .Xr pci 4 -.Sh CAVEATS -Most 802.11 capabilities were turned off; some more testing -is required to re-enable them. Modified: head/sys/dev/rtwn/if_rtwn_tx.h ============================================================================== --- head/sys/dev/rtwn/if_rtwn_tx.h Sat Nov 12 17:36:28 2016 (r308574) +++ head/sys/dev/rtwn/if_rtwn_tx.h Sat Nov 12 17:58:37 2016 (r308575) @@ -20,7 +20,9 @@ #define IF_RTWN_TX_H void rtwn_drain_mbufq(struct rtwn_softc *); +#ifdef IEEE80211_SUPPORT_SUPERG void rtwn_ff_flush_all(struct rtwn_softc *, union sec_param *); +#endif int rtwn_transmit(struct ieee80211com *, struct mbuf *); void rtwn_start(struct rtwn_softc *); int rtwn_raw_xmit(struct ieee80211_node *, struct mbuf *, Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_attach.c Sat Nov 12 17:36:28 2016 (r308574) +++ head/sys/dev/rtwn/pci/rtwn_pci_attach.c Sat Nov 12 17:58:37 2016 (r308575) @@ -149,8 +149,8 @@ rtwn_pci_alloc_rx_list(struct rtwn_softc /* Create RX buffer DMA tag. */ error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, - 1, MCLBYTES, 0, NULL, NULL, &rx_ring->data_dmat); + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + MJUMPAGESIZE, 1, MJUMPAGESIZE, 0, NULL, NULL, &rx_ring->data_dmat); if (error != 0) { device_printf(sc->sc_dev, "could not create rx buf DMA tag\n"); goto fail; @@ -166,7 +166,8 @@ rtwn_pci_alloc_rx_list(struct rtwn_softc goto fail; } - rx_data->m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + rx_data->m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, + MJUMPAGESIZE); if (rx_data->m == NULL) { device_printf(sc->sc_dev, "could not allocate rx mbuf\n"); @@ -175,8 +176,8 @@ rtwn_pci_alloc_rx_list(struct rtwn_softc } error = bus_dmamap_load(rx_ring->data_dmat, rx_data->map, - mtod(rx_data->m, void *), MCLBYTES, rtwn_pci_dma_map_addr, - &rx_data->paddr, BUS_DMA_NOWAIT); + mtod(rx_data->m, void *), MJUMPAGESIZE, + rtwn_pci_dma_map_addr, &rx_data->paddr, BUS_DMA_NOWAIT); if (error != 0) { device_printf(sc->sc_dev, "could not load rx buf DMA map"); @@ -184,7 +185,7 @@ rtwn_pci_alloc_rx_list(struct rtwn_softc } rtwn_pci_setup_rx_desc(pc, &rx_ring->desc[i], rx_data->paddr, - MCLBYTES, i); + MJUMPAGESIZE, i); } rx_ring->cur = 0; @@ -206,7 +207,7 @@ rtwn_pci_reset_rx_list(struct rtwn_softc for (i = 0; i < RTWN_PCI_RX_LIST_COUNT; i++) { rx_data = &rx_ring->rx_data[i]; rtwn_pci_setup_rx_desc(pc, &rx_ring->desc[i], - rx_data->paddr, MCLBYTES, i); + rx_data->paddr, MJUMPAGESIZE, i); } rx_ring->cur = 0; } @@ -287,8 +288,8 @@ rtwn_pci_alloc_tx_list(struct rtwn_softc BUS_DMASYNC_PREWRITE); error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, - 1, MCLBYTES, 0, NULL, NULL, &tx_ring->data_dmat); + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + MJUMPAGESIZE, 1, MJUMPAGESIZE, 0, NULL, NULL, &tx_ring->data_dmat); if (error != 0) { device_printf(sc->sc_dev, "could not create tx buf DMA tag\n"); goto fail; Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_rx.c Sat Nov 12 17:36:28 2016 (r308574) +++ head/sys/dev/rtwn/pci/rtwn_pci_rx.c Sat Nov 12 17:58:37 2016 (r308575) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -120,7 +121,7 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, pktlen = MS(rxdw0, R92C_RXDW0_PKTLEN); if (__predict_false(pktlen < sizeof(struct ieee80211_frame_ack) || - pktlen > MCLBYTES)) { + pktlen > MJUMPAGESIZE)) { RTWN_DPRINTF(sc, RTWN_DEBUG_RECV, "%s: frame is too short/long: %d\n", __func__, pktlen); goto fail; @@ -129,7 +130,7 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, infosz = MS(rxdw0, R92C_RXDW0_INFOSZ) * 8; shift = MS(rxdw0, R92C_RXDW0_SHIFT); - m1 = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + m1 = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); if (__predict_false(m1 == NULL)) { device_printf(sc->sc_dev, "%s: could not allocate RX mbuf\n", __func__); @@ -139,20 +140,20 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, bus_dmamap_unload(ring->data_dmat, rx_data->map); error = bus_dmamap_load(ring->data_dmat, rx_data->map, mtod(m1, void *), - MCLBYTES, rtwn_pci_dma_map_addr, &rx_data->paddr, 0); + MJUMPAGESIZE, rtwn_pci_dma_map_addr, &rx_data->paddr, 0); if (error != 0) { m_freem(m1); error = bus_dmamap_load(ring->data_dmat, rx_data->map, - mtod(rx_data->m, void *), MCLBYTES, rtwn_pci_dma_map_addr, - &rx_data->paddr, BUS_DMA_NOWAIT); + mtod(rx_data->m, void *), MJUMPAGESIZE, + rtwn_pci_dma_map_addr, &rx_data->paddr, BUS_DMA_NOWAIT); if (error != 0) panic("%s: could not load old RX mbuf", device_get_name(sc->sc_dev)); /* Physical address may have changed. */ - rtwn_pci_setup_rx_desc(pc, rx_desc, rx_data->paddr, MCLBYTES, - desc_idx); + rtwn_pci_setup_rx_desc(pc, rx_desc, rx_data->paddr, + MJUMPAGESIZE, desc_idx); goto fail; } @@ -169,7 +170,7 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, __func__, pktlen, infosz, shift, rssi); /* Update RX descriptor. */ - rtwn_pci_setup_rx_desc(pc, rx_desc, rx_data->paddr, MCLBYTES, + rtwn_pci_setup_rx_desc(pc, rx_desc, rx_data->paddr, MJUMPAGESIZE, desc_idx); /* Send the frame to the 802.11 layer. */ @@ -222,6 +223,8 @@ rtwn_pci_tx_done(struct rtwn_softc *sc, data->ni = NULL; ring->queued--; + KASSERT(ring->queued >= 0, + ("ring->queued (qid %d) underflow!\n", qid)); } else m_freem(data->m); @@ -235,9 +238,27 @@ rtwn_pci_tx_done(struct rtwn_softc *sc, #endif } - if (ring->queued < (RTWN_PCI_TX_LIST_COUNT - 1)) + if ((sc->qfullmsk & (1 << qid)) != 0 && + ring->queued < (RTWN_PCI_TX_LIST_COUNT - 1)) { sc->qfullmsk &= ~(1 << qid); - rtwn_start(sc); + rtwn_start(sc); + } + +#ifdef IEEE80211_SUPPORT_SUPERG + /* + * If the TX active queue drops below a certain + * threshold, ensure we age fast-frames out so they're + * transmitted. + */ + if (sc->sc_ratectl != RTWN_RATECTL_NET80211 && ring->queued <= 1) { + /* + * XXX TODO: just make this a callout timer schedule + * so we can flush the FF staging queue if we're + * approaching idle. + */ + rtwn_cmd_sleepable(sc, NULL, 0, rtwn_ff_flush_all); + } +#endif } static void @@ -261,6 +282,17 @@ rtwn_pci_rx_done(struct rtwn_softc *sc) ring->cur = (ring->cur + 1) % RTWN_PCI_RX_LIST_COUNT; } + + /* Finished receive; age anything left on the FF queue by a little bump */ + /* + * XXX TODO: just make this a callout timer schedule so we can + * flush the FF staging queue if we're approaching idle. + */ +#ifdef IEEE80211_SUPPORT_SUPERG + if (!(sc->sc_flags & RTWN_FW_LOADED) || + sc->sc_ratectl != RTWN_RATECTL_NET80211) + rtwn_cmd_sleepable(sc, NULL, 0, rtwn_ff_flush_all); +#endif } void Modified: head/sys/dev/rtwn/pci/rtwn_pci_tx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_tx.c Sat Nov 12 17:36:28 2016 (r308574) +++ head/sys/dev/rtwn/pci/rtwn_pci_tx.c Sat Nov 12 17:58:37 2016 (r308575) @@ -58,6 +58,37 @@ __FBSDID("$FreeBSD$"); #include +static struct mbuf * +rtwn_mbuf_defrag(struct mbuf *m0, int how) +{ + struct mbuf *m = NULL; + + KASSERT(m0->m_flags & M_PKTHDR, + ("M_PKTHDR flag is absent (m %p)!", m0)); + + /* NB: we need _exactly_ one mbuf (no less, no more). */ + if (m0->m_pkthdr.len > MJUMPAGESIZE) { + /* XXX MJUM9BYTES? */ + return (NULL); + } else if (m0->m_pkthdr.len > MCLBYTES) { + m = m_getjcl(how, MT_DATA, M_PKTHDR, MJUMPAGESIZE); + if (m == NULL) + return (NULL); + + if (m_dup_pkthdr(m, m0, how) == 0) { + m_freem(m); + return (NULL); + } + + m_copydata(m0, 0, m0->m_pkthdr.len, mtod(m, caddr_t)); + m->m_len = m->m_pkthdr.len; + m_freem(m0); + + return (m); + } else + return (m_defrag(m0, how)); +} + static int rtwn_pci_tx_start_frame(struct rtwn_softc *sc, struct ieee80211_node *ni, struct mbuf *m, uint8_t *tx_desc, uint8_t type) @@ -114,7 +145,7 @@ rtwn_pci_tx_start_frame(struct rtwn_soft if (error != 0) { struct mbuf *mnew; - mnew = m_defrag(m, M_NOWAIT); + mnew = rtwn_mbuf_defrag(m, M_NOWAIT); if (mnew == NULL) { device_printf(sc->sc_dev, "can't defragment mbuf\n"); return (ENOBUFS); Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Sat Nov 12 17:36:28 2016 (r308574) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Sat Nov 12 17:58:37 2016 (r308575) @@ -138,15 +138,11 @@ r92ce_adj_devcaps(struct rtwn_softc *sc) { struct ieee80211com *ic = &sc->sc_ic; - /* XXX TODO: test everything that removed here before enabling. */ - /* XX do NOT enable PMGT until RSVD_PAGE command will not be fixed. */ - ic->ic_caps &= ~( - IEEE80211_C_PMGT /* check null frame / device usability */ - | IEEE80211_C_SWAMSDUTX - | IEEE80211_C_FF - ); - - ic->ic_htcaps = 0; + /* + * XXX do NOT enable PMGT until RSVD_PAGE command + * will not be tested / fixed + HRPWM register must be set too. + */ + ic->ic_caps &= ~IEEE80211_C_PMGT; } void Modified: head/sys/dev/rtwn/usb/rtwn_usb_rx.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_rx.c Sat Nov 12 17:36:28 2016 (r308574) +++ head/sys/dev/rtwn/usb/rtwn_usb_rx.c Sat Nov 12 17:58:37 2016 (r308575) @@ -326,7 +326,8 @@ finish: * flush the FF staging queue if we're approaching idle. */ #ifdef IEEE80211_SUPPORT_SUPERG - if (!(sc->sc_flags & RTWN_FW_LOADED)) + if (!(sc->sc_flags & RTWN_FW_LOADED) || + sc->sc_ratectl != RTWN_RATECTL_NET80211) rtwn_cmd_sleepable(sc, NULL, 0, rtwn_ff_flush_all); #endif From owner-svn-src-head@freebsd.org Sat Nov 12 18:04:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8918FC3DE60; Sat, 12 Nov 2016 18:04:04 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 596A0113B; Sat, 12 Nov 2016 18:04:04 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uACI43Am045219; Sat, 12 Nov 2016 18:04:03 GMT (envelope-from def@FreeBSD.org) Received: (from def@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uACI43wH045218; Sat, 12 Nov 2016 18:04:03 GMT (envelope-from def@FreeBSD.org) Message-Id: <201611121804.uACI43wH045218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: def set sender to def@FreeBSD.org using -f From: Konrad Witaszczyk Date: Sat, 12 Nov 2016 18:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308576 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 18:04:04 -0000 Author: def Date: Sat Nov 12 18:04:03 2016 New Revision: 308576 URL: https://svnweb.freebsd.org/changeset/base/308576 Log: Add myself (def) as a src committer and pjd as my mentor. Approved by: pjd (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sat Nov 12 17:58:37 2016 (r308575) +++ head/share/misc/committers-src.dot Sat Nov 12 18:04:03 2016 (r308576) @@ -143,6 +143,7 @@ csjp [label="Christian S.J. Peron\ncsjp@ das [label="David Schultz\ndas@FreeBSD.org\n2003/02/21"] davide [label="Davide Italiano\ndavide@FreeBSD.org\n2012/01/27"] dchagin [label="Dmitry Chagin\ndchagin@FreeBSD.org\n2009/02/28"] +def [label="Konrad Witaszczyk\ndef@FreeBSD.org\n2016/11/02"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"] des [label="Dag-Erling Smorgrav\ndes@FreeBSD.org\n1998/04/03"] dfr [label="Doug Rabson\ndfr@FreeBSD.org\n????/??/??"] @@ -683,6 +684,7 @@ philip -> kp phk -> jkoshy phk -> mux +pjd -> def pjd -> kib pjd -> lulf pjd -> oshogbo From owner-svn-src-head@freebsd.org Sat Nov 12 18:26:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82E06C3E50E; Sat, 12 Nov 2016 18:26:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D19E1E3B; Sat, 12 Nov 2016 18:26:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x229.google.com with SMTP id u205so36974798itc.0; Sat, 12 Nov 2016 10:26:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qkYRw2xfXrW9shdat3lManDEkW4YQrKM03EfRqtb45o=; b=lO1HeSfD2fC9P8LZq96JPIbltZ4XkBFXdN+bs51TRG/Zh9f1T1wXeCZa31B5PW2Hx8 jPLET+5e62PDnIQT/qrmfkOKhhXJm6ZxSjuqohNLK36Dak/edpjpdg47KyFDA0Xz022c 4YzgLyx9j/udnZSXvq4jOKdEqXtUFUXQPZ9Pduza6ZtLA5x/XujJ7+5wm+ExQcUXJ4oE hDe2drJa1uGTcNekDG+KLNyw/XHPLI+emf9XyMCsPm2K13nPK8U4niujyfj2uHYuLaHv MBgW5bvtPpM5ORqjEkbAtnbxq4EwQDVlz5DcZUIeDlLJZzEV3vBU/NcyHFTb7rKPMxJa XkcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qkYRw2xfXrW9shdat3lManDEkW4YQrKM03EfRqtb45o=; b=N9YYwa9qn7RZE8Z13kOmxCaBPiwCQlNo6ZS/7A0r+683v8bcigZCm17HjZAf3TBP0G LpVJ1JqHkraYDBr/rSrBZmgR5yPEjT6dtRYsNAONau4PXcpFyOnvssPKm8YnoDpkb3Fk xMUWtNIory0oIpuSHZtlla7aI4B9q7GhG/rGgLo1/kg/vaJGahCK48KqDLsh1IvWRWvZ plM46dwb5fNpidDQYlzxagJVbuHHGrCDK8mWEIhouHgPl3qXgVis/lNNRqrQVhwdBIA5 2AY006ZblqZktehlNRR6qwNCSRLp2dqf2LhT+PkR3HO0lf58YxvySMf1V6wo0lis/xp2 qTXg== X-Gm-Message-State: ABUngvd/Hr6euSwc+u5S7S+8gwaETXPnCMJn5BjglOd9cHP2WxjFd3zkgs8lqS7caTTv6J/Ew7qrj248A+61kg== X-Received: by 10.107.192.194 with SMTP id q185mr17624094iof.129.1478975210733; Sat, 12 Nov 2016 10:26:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Sat, 12 Nov 2016 10:26:49 -0800 (PST) In-Reply-To: <201609230445.u8N4jCtK066601@repo.freebsd.org> References: <201609230445.u8N4jCtK066601@repo.freebsd.org> From: Adrian Chadd Date: Sat, 12 Nov 2016 10:26:49 -0800 Message-ID: Subject: Re: svn commit: r306224 - head/sys/kern To: Mateusz Guzik Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 18:26:52 -0000 This causes the AR9331 / Carambola2 kernel to just plainly not start. :( -adrian On 22 September 2016 at 21:45, Mateusz Guzik wrote: > Author: mjg > Date: Fri Sep 23 04:45:11 2016 > New Revision: 306224 > URL: https://svnweb.freebsd.org/changeset/base/306224 > > Log: > cache: get rid of the global lock > > Add a table of vnode locks and use them along with bucketlocks to provide > concurrent modification support. The approach taken is to preserve the > current behaviour of the namecache and just lock all relevant parts before > any changes are made. > > Lookups still require the relevant bucket to be locked. > > Discussed with: kib > Tested by: pho > > Modified: > head/sys/kern/subr_witness.c > head/sys/kern/vfs_cache.c > > Modified: head/sys/kern/subr_witness.c > ============================================================================== > --- head/sys/kern/subr_witness.c Fri Sep 23 03:21:40 2016 (r306223) > +++ head/sys/kern/subr_witness.c Fri Sep 23 04:45:11 2016 (r306224) > @@ -625,7 +625,7 @@ static struct witness_order_list_entry o > /* > * VFS namecache > */ > - { "ncglobal", &lock_class_rw }, > + { "ncvn", &lock_class_mtx_sleep }, > { "ncbuc", &lock_class_rw }, > { "vnode interlock", &lock_class_mtx_sleep }, > { "ncneg", &lock_class_mtx_sleep }, > > Modified: head/sys/kern/vfs_cache.c > ============================================================================== > --- head/sys/kern/vfs_cache.c Fri Sep 23 03:21:40 2016 (r306223) > +++ head/sys/kern/vfs_cache.c Fri Sep 23 04:45:11 2016 (r306224) > @@ -151,21 +151,35 @@ struct namecache_ts { > * name is located in the cache, it will be dropped. > * > * These locks are used (in the order in which they can be taken): > - * NAME TYPE ROLE > - * cache_lock rwlock global, needed for all modifications > - * bucketlock rwlock for access to given hash bucket > - * ncneg_mtx mtx negative entry LRU management > + * NAME TYPE ROLE > + * vnodelock mtx vnode lists and v_cache_dd field protection > + * bucketlock rwlock for access to given set of hash buckets > + * ncneg_mtx mtx negative entry LRU management > * > - * A name -> vnode lookup can be safely performed by either locking cache_lock > - * or the relevant hash bucket. > + * Additionally, ncneg_shrink_lock mtx is used to have at most one thread > + * shrinking the LRU list. > * > - * ".." and vnode -> name lookups require cache_lock. > + * It is legal to take multiple vnodelock and bucketlock locks. The locking > + * order is lower address first. Both are recursive. > * > - * Modifications require both cache_lock and relevant bucketlock taken for > - * writing. > + * "." lookups are lockless. > * > - * Negative entry LRU management requires ncneg_mtx taken on top of either > - * cache_lock or bucketlock. > + * ".." and vnode -> name lookups require vnodelock. > + * > + * name -> vnode lookup requires the relevant bucketlock to be held for reading. > + * > + * Insertions and removals of entries require involved vnodes and bucketlocks > + * to be write-locked to prevent other threads from seeing the entry. > + * > + * Some lookups result in removal of the found entry (e.g. getting rid of a > + * negative entry with the intent to create a positive one), which poses a > + * problem when multiple threads reach the state. Similarly, two different > + * threads can purge two different vnodes and try to remove the same name. > + * > + * If the already held vnode lock is lower than the second required lock, we > + * can just take the other lock. However, in the opposite case, this could > + * deadlock. As such, this is resolved by trylocking and if that fails unlocking > + * the first node, locking everything in order and revalidating the state. > */ > > /* > @@ -196,15 +210,9 @@ SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor > > struct nchstats nchstats; /* cache effectiveness statistics */ > > -static struct rwlock cache_lock; > -RW_SYSINIT(vfscache, &cache_lock, "ncglobal"); > - > -#define CACHE_TRY_WLOCK() rw_try_wlock(&cache_lock) > -#define CACHE_UPGRADE_LOCK() rw_try_upgrade(&cache_lock) > -#define CACHE_RLOCK() rw_rlock(&cache_lock) > -#define CACHE_RUNLOCK() rw_runlock(&cache_lock) > -#define CACHE_WLOCK() rw_wlock(&cache_lock) > -#define CACHE_WUNLOCK() rw_wunlock(&cache_lock) > +static struct mtx ncneg_shrink_lock; > +MTX_SYSINIT(vfscache_shrink_neg, &ncneg_shrink_lock, "Name Cache shrink neg", > + MTX_DEF); > > static struct mtx_padalign ncneg_mtx; > MTX_SYSINIT(vfscache_neg, &ncneg_mtx, "ncneg", MTX_DEF); > @@ -214,6 +222,19 @@ static struct rwlock_padalign *bucketlo > #define HASH2BUCKETLOCK(hash) \ > ((struct rwlock *)(&bucketlocks[((hash) % numbucketlocks)])) > > +static u_int numvnodelocks; > +static struct mtx *vnodelocks; > +static inline struct mtx * > +VP2VNODELOCK(struct vnode *vp) > +{ > + struct mtx *vlp; > + > + if (vp == NULL) > + return (NULL); > + vlp = &vnodelocks[(((uintptr_t)(vp) >> 8) % numvnodelocks)]; > + return (vlp); > +} > + > /* > * UMA zones for the VFS cache. > * > @@ -329,19 +350,49 @@ STATNODE_COUNTER(numfullpathfail2, > "Number of fullpath search errors (VOP_VPTOCNP failures)"); > STATNODE_COUNTER(numfullpathfail4, "Number of fullpath search errors (ENOMEM)"); > STATNODE_COUNTER(numfullpathfound, "Number of successful fullpath calls"); > -static long numupgrades; STATNODE_ULONG(numupgrades, > - "Number of updates of the cache after lookup (write lock + retry)"); > static long zap_and_exit_bucket_fail; STATNODE_ULONG(zap_and_exit_bucket_fail, > - "Number of times bucketlocked zap_and_exit case failed to writelock"); > + "Number of times zap_and_exit failed to lock"); > +static long cache_lock_vnodes_cel_3_failures; > +STATNODE_ULONG(cache_lock_vnodes_cel_3_failures, > + "Number of times 3-way vnode locking failed"); > > -static void cache_zap(struct namecache *ncp); > -static int vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf, > - u_int *buflen); > +static void cache_zap_locked(struct namecache *ncp, bool neg_locked); > static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, > char *buf, char **retbuf, u_int buflen); > > static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); > > +static int cache_yield; > +SYSCTL_INT(_vfs_cache, OID_AUTO, yield, CTLFLAG_RD, &cache_yield, 0, > + "Number of times cache called yield"); > + > +static void > +cache_maybe_yield(void) > +{ > + > + if (should_yield()) { > + cache_yield++; > + kern_yield(PRI_USER); > + } > +} > + > +static inline void > +cache_assert_vlp_locked(struct mtx *vlp) > +{ > + > + if (vlp != NULL) > + mtx_assert(vlp, MA_OWNED); > +} > + > +static inline void > +cache_assert_vnode_locked(struct vnode *vp) > +{ > + struct mtx *vlp; > + > + vlp = VP2VNODELOCK(vp); > + cache_assert_vlp_locked(vlp); > +} > + > static uint32_t > cache_get_hash(char *name, u_char len, struct vnode *dvp) > { > @@ -352,21 +403,41 @@ cache_get_hash(char *name, u_char len, s > return (hash); > } > > +static inline struct rwlock * > +NCP2BUCKETLOCK(struct namecache *ncp) > +{ > + uint32_t hash; > + > + hash = cache_get_hash(nc_get_name(ncp), ncp->nc_nlen, ncp->nc_dvp); > + return (HASH2BUCKETLOCK(hash)); > +} > + > #ifdef INVARIANTS > static void > cache_assert_bucket_locked(struct namecache *ncp, int mode) > { > - struct rwlock *bucketlock; > - uint32_t hash; > + struct rwlock *blp; > > - hash = cache_get_hash(nc_get_name(ncp), ncp->nc_nlen, ncp->nc_dvp); > - bucketlock = HASH2BUCKETLOCK(hash); > - rw_assert(bucketlock, mode); > + blp = NCP2BUCKETLOCK(ncp); > + rw_assert(blp, mode); > } > #else > #define cache_assert_bucket_locked(x, y) do { } while (0) > #endif > > +#define cache_sort(x, y) _cache_sort((void **)(x), (void **)(y)) > +static void > +_cache_sort(void **p1, void **p2) > +{ > + void *tmp; > + > + if (*p1 > *p2) { > + tmp = *p2; > + *p2 = *p1; > + *p1 = tmp; > + } > +} > + > static void > cache_lock_all_buckets(void) > { > @@ -385,6 +456,56 @@ cache_unlock_all_buckets(void) > rw_wunlock(&bucketlocks[i]); > } > > +static void > +cache_lock_all_vnodes(void) > +{ > + u_int i; > + > + for (i = 0; i < numvnodelocks; i++) > + mtx_lock(&vnodelocks[i]); > +} > + > +static void > +cache_unlock_all_vnodes(void) > +{ > + u_int i; > + > + for (i = 0; i < numvnodelocks; i++) > + mtx_unlock(&vnodelocks[i]); > +} > + > +static int > +cache_trylock_vnodes(struct mtx *vlp1, struct mtx *vlp2) > +{ > + > + cache_sort(&vlp1, &vlp2); > + MPASS(vlp2 != NULL); > + > + if (vlp1 != NULL) { > + if (!mtx_trylock(vlp1)) > + return (EAGAIN); > + } > + if (!mtx_trylock(vlp2)) { > + if (vlp1 != NULL) > + mtx_unlock(vlp1); > + return (EAGAIN); > + } > + > + return (0); > +} > + > +static void > +cache_unlock_vnodes(struct mtx *vlp1, struct mtx *vlp2) > +{ > + > + MPASS(vlp1 != NULL || vlp2 != NULL); > + > + if (vlp1 != NULL) > + mtx_unlock(vlp1); > + if (vlp2 != NULL) > + mtx_unlock(vlp2); > +} > + > static int > sysctl_nchstats(SYSCTL_HANDLER_ARGS) > { > @@ -426,9 +547,9 @@ retry: > if (req->oldptr == NULL) > return SYSCTL_OUT(req, 0, n_nchash * sizeof(int)); > cntbuf = malloc(n_nchash * sizeof(int), M_TEMP, M_ZERO | M_WAITOK); > - CACHE_RLOCK(); > + cache_lock_all_buckets(); > if (n_nchash != nchash + 1) { > - CACHE_RUNLOCK(); > + cache_unlock_all_buckets(); > free(cntbuf, M_TEMP); > goto retry; > } > @@ -436,7 +557,7 @@ retry: > for (ncpp = nchashtbl, i = 0; i < n_nchash; ncpp++, i++) > LIST_FOREACH(ncp, ncpp, nc_hash) > cntbuf[i]++; > - CACHE_RUNLOCK(); > + cache_unlock_all_buckets(); > for (error = 0, i = 0; i < n_nchash; i++) > if ((error = SYSCTL_OUT(req, &cntbuf[i], sizeof(int))) != 0) > break; > @@ -459,7 +580,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HAND > if (!req->oldptr) > return SYSCTL_OUT(req, 0, 4 * sizeof(int)); > > - CACHE_RLOCK(); > + cache_lock_all_buckets(); > n_nchash = nchash + 1; /* nchash is max index, not count */ > used = 0; > maxlength = 0; > @@ -476,7 +597,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HAND > maxlength = count; > } > n_nchash = nchash + 1; > - CACHE_RUNLOCK(); > + cache_unlock_all_buckets(); > pct = (used * 100) / (n_nchash / 100); > error = SYSCTL_OUT(req, &n_nchash, sizeof(n_nchash)); > if (error) > @@ -504,6 +625,7 @@ static void > cache_negative_hit(struct namecache *ncp) > { > > + MPASS(ncp->nc_vp == NULL); > mtx_lock(&ncneg_mtx); > TAILQ_REMOVE(&ncneg, ncp, nc_dst); > TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst); > @@ -514,9 +636,8 @@ static void > cache_negative_insert(struct namecache *ncp) > { > > - rw_assert(&cache_lock, RA_WLOCKED); > - cache_assert_bucket_locked(ncp, RA_WLOCKED); > MPASS(ncp->nc_vp == NULL); > + cache_assert_bucket_locked(ncp, RA_WLOCKED); > mtx_lock(&ncneg_mtx); > TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst); > numneg++; > @@ -524,43 +645,74 @@ cache_negative_insert(struct namecache * > } > > static void > -cache_negative_remove(struct namecache *ncp) > +cache_negative_remove(struct namecache *ncp, bool neg_locked) > { > > - rw_assert(&cache_lock, RA_WLOCKED); > - cache_assert_bucket_locked(ncp, RA_WLOCKED); > MPASS(ncp->nc_vp == NULL); > - mtx_lock(&ncneg_mtx); > + cache_assert_bucket_locked(ncp, RA_WLOCKED); > + if (!neg_locked) > + mtx_lock(&ncneg_mtx); > + else > + mtx_assert(&ncneg_mtx, MA_OWNED); > TAILQ_REMOVE(&ncneg, ncp, nc_dst); > numneg--; > - mtx_unlock(&ncneg_mtx); > + if (!neg_locked) > + mtx_unlock(&ncneg_mtx); > } > > -static struct namecache * > +static void > cache_negative_zap_one(void) > { > - struct namecache *ncp; > + struct namecache *ncp, *ncp2; > + struct mtx *dvlp; > + struct rwlock *blp; > + > + if (!mtx_trylock(&ncneg_shrink_lock)) > + return; > > - rw_assert(&cache_lock, RA_WLOCKED); > + mtx_lock(&ncneg_mtx); > ncp = TAILQ_FIRST(&ncneg); > - KASSERT(ncp->nc_vp == NULL, ("ncp %p vp %p on ncneg", > - ncp, ncp->nc_vp)); > - cache_zap(ncp); > - return (ncp); > + if (ncp == NULL) { > + mtx_unlock(&ncneg_mtx); > + goto out; > + } > + MPASS(ncp->nc_vp == NULL); > + dvlp = VP2VNODELOCK(ncp->nc_dvp); > + blp = NCP2BUCKETLOCK(ncp); > + mtx_unlock(&ncneg_mtx); > + mtx_lock(dvlp); > + rw_wlock(blp); > + mtx_lock(&ncneg_mtx); > + ncp2 = TAILQ_FIRST(&ncneg); > + if (ncp != ncp2 || dvlp != VP2VNODELOCK(ncp2->nc_dvp) || > + blp != NCP2BUCKETLOCK(ncp2) || ncp2->nc_vp != NULL) { > + ncp = NULL; > + goto out_unlock_all; > + } > + cache_zap_locked(ncp, true); > +out_unlock_all: > + mtx_unlock(&ncneg_mtx); > + rw_wunlock(blp); > + mtx_unlock(dvlp); > +out: > + mtx_unlock(&ncneg_shrink_lock); > + cache_free(ncp); > } > > /* > - * cache_zap(): > + * cache_zap_locked(): > * > * Removes a namecache entry from cache, whether it contains an actual > * pointer to a vnode or if it is just a negative cache entry. > */ > static void > -cache_zap_locked(struct namecache *ncp) > +cache_zap_locked(struct namecache *ncp, bool neg_locked) > { > > - rw_assert(&cache_lock, RA_WLOCKED); > + cache_assert_vnode_locked(ncp->nc_vp); > + cache_assert_vnode_locked(ncp->nc_dvp); > cache_assert_bucket_locked(ncp, RA_WLOCKED); > + > CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, ncp->nc_vp); > if (ncp->nc_vp != NULL) { > SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, > @@ -577,7 +729,7 @@ cache_zap_locked(struct namecache *ncp) > LIST_REMOVE(ncp, nc_src); > if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { > ncp->nc_flag |= NCF_DVDROP; > - numcachehv--; > + atomic_subtract_rel_long(&numcachehv, 1); > } > } > if (ncp->nc_vp) { > @@ -585,24 +737,198 @@ cache_zap_locked(struct namecache *ncp) > if (ncp == ncp->nc_vp->v_cache_dd) > ncp->nc_vp->v_cache_dd = NULL; > } else { > - cache_negative_remove(ncp); > + cache_negative_remove(ncp, neg_locked); > } > - numcache--; > + atomic_subtract_rel_long(&numcache, 1); > } > > static void > -cache_zap(struct namecache *ncp) > +cache_zap_negative_locked_vnode_kl(struct namecache *ncp, struct vnode *vp) > { > - struct rwlock *bucketlock; > - uint32_t hash; > + struct rwlock *blp; > > - rw_assert(&cache_lock, RA_WLOCKED); > + MPASS(ncp->nc_dvp == vp); > + MPASS(ncp->nc_vp == NULL); > + cache_assert_vnode_locked(vp); > > - hash = cache_get_hash(nc_get_name(ncp), ncp->nc_nlen, ncp->nc_dvp); > - bucketlock = HASH2BUCKETLOCK(hash); > - rw_wlock(bucketlock); > - cache_zap_locked(ncp); > - rw_wunlock(bucketlock); > + blp = NCP2BUCKETLOCK(ncp); > + rw_wlock(blp); > + cache_zap_locked(ncp, false); > + rw_wunlock(blp); > +} > + > +static bool > +cache_zap_locked_vnode_kl2(struct namecache *ncp, struct vnode *vp, > + struct mtx **vlpp) > +{ > + struct mtx *pvlp, *vlp1, *vlp2, *to_unlock; > + struct rwlock *blp; > + > + MPASS(vp == ncp->nc_dvp || vp == ncp->nc_vp); > + cache_assert_vnode_locked(vp); > + > + if (ncp->nc_vp == NULL) { > + if (*vlpp != NULL) { > + mtx_unlock(*vlpp); > + *vlpp = NULL; > + } > + cache_zap_negative_locked_vnode_kl(ncp, vp); > + return (true); > + } > + > + pvlp = VP2VNODELOCK(vp); > + blp = NCP2BUCKETLOCK(ncp); > + vlp1 = VP2VNODELOCK(ncp->nc_dvp); > + vlp2 = VP2VNODELOCK(ncp->nc_vp); > + > + if (*vlpp == vlp1 || *vlpp == vlp2) { > + to_unlock = *vlpp; > + *vlpp = NULL; > + } else { > + if (*vlpp != NULL) { > + mtx_unlock(*vlpp); > + *vlpp = NULL; > + } > + cache_sort(&vlp1, &vlp2); > + if (vlp1 == pvlp) { > + mtx_lock(vlp2); > + to_unlock = vlp2; > + } else { > + if (!mtx_trylock(vlp1)) > + goto out_relock; > + to_unlock = vlp1; > + } > + } > + rw_wlock(blp); > + cache_zap_locked(ncp, false); > + rw_wunlock(blp); > + if (to_unlock != NULL) > + mtx_unlock(to_unlock); > + return (true); > + > +out_relock: > + mtx_unlock(vlp2); > + mtx_lock(vlp1); > + mtx_lock(vlp2); > + MPASS(*vlpp == NULL); > + *vlpp = vlp1; > + return (false); > +} > + > +static int > +cache_zap_locked_vnode(struct namecache *ncp, struct vnode *vp) > +{ > + struct mtx *pvlp, *vlp1, *vlp2, *to_unlock; > + struct rwlock *blp; > + int error = 0; > + > + MPASS(vp == ncp->nc_dvp || vp == ncp->nc_vp); > + cache_assert_vnode_locked(vp); > + > + pvlp = VP2VNODELOCK(vp); > + if (ncp->nc_vp == NULL) { > + cache_zap_negative_locked_vnode_kl(ncp, vp); > + goto out; > + } > + > + blp = NCP2BUCKETLOCK(ncp); > + vlp1 = VP2VNODELOCK(ncp->nc_dvp); > + vlp2 = VP2VNODELOCK(ncp->nc_vp); > + cache_sort(&vlp1, &vlp2); > + if (vlp1 == pvlp) { > + mtx_lock(vlp2); > + to_unlock = vlp2; > + } else { > + if (!mtx_trylock(vlp1)) { > + error = EAGAIN; > + goto out; > + } > + to_unlock = vlp1; > + } > + rw_wlock(blp); > + cache_zap_locked(ncp, false); > + rw_wunlock(blp); > + mtx_unlock(to_unlock); > +out: > + mtx_unlock(pvlp); > + return (error); > +} > + > +static int > +cache_zap_rlocked_bucket(struct namecache *ncp, struct rwlock *blp) > +{ > + struct mtx *dvlp, *vlp; > + > + cache_assert_bucket_locked(ncp, RA_RLOCKED); > + > + dvlp = VP2VNODELOCK(ncp->nc_dvp); > + vlp = VP2VNODELOCK(ncp->nc_vp); > + if (cache_trylock_vnodes(dvlp, vlp) == 0) { > + rw_runlock(blp); > + rw_wlock(blp); > + cache_zap_locked(ncp, false); > + rw_wunlock(blp); > + cache_unlock_vnodes(dvlp, vlp); > + return (0); > + } > + > + rw_runlock(blp); > + return (EAGAIN); > +} > + > +static int > +cache_zap_wlocked_bucket_kl(struct namecache *ncp, struct rwlock *blp, > + struct mtx **vlpp1, struct mtx **vlpp2) > +{ > + struct mtx *dvlp, *vlp; > + > + cache_assert_bucket_locked(ncp, RA_WLOCKED); > + > + dvlp = VP2VNODELOCK(ncp->nc_dvp); > + vlp = VP2VNODELOCK(ncp->nc_vp); > + cache_sort(&dvlp, &vlp); > + > + if (*vlpp1 == dvlp && *vlpp2 == vlp) { > + cache_zap_locked(ncp, false); > + cache_unlock_vnodes(dvlp, vlp); > + *vlpp1 = NULL; > + *vlpp2 = NULL; > + return (0); > + } > + > + if (*vlpp1 != NULL) > + mtx_unlock(*vlpp1); > + if (*vlpp2 != NULL) > + mtx_unlock(*vlpp2); > + *vlpp1 = NULL; > + *vlpp2 = NULL; > + > + if (cache_trylock_vnodes(dvlp, vlp) == 0) { > + cache_zap_locked(ncp, false); > + cache_unlock_vnodes(dvlp, vlp); > + return (0); > + } > + > + rw_wunlock(blp); > + *vlpp1 = dvlp; > + *vlpp2 = vlp; > + if (*vlpp1 != NULL) > + mtx_lock(*vlpp1); > + mtx_lock(*vlpp2); > + rw_wlock(blp); > + return (EAGAIN); > +} > + > +static void > +cache_lookup_unlock(struct rwlock *blp, struct mtx *vlp) > +{ > + > + if (blp != NULL) { > + rw_runlock(blp); > + mtx_assert(vlp, MA_NOTOWNED); > + } else { > + mtx_unlock(vlp); > + } > } > > /* > @@ -622,44 +948,26 @@ cache_zap(struct namecache *ncp) > * not recursively acquired. > */ > > -enum { UNLOCKED, WLOCKED, RLOCKED }; > - > -static void > -cache_unlock(int cache_locked) > -{ > - > - switch (cache_locked) { > - case UNLOCKED: > - break; > - case WLOCKED: > - CACHE_WUNLOCK(); > - break; > - case RLOCKED: > - CACHE_RUNLOCK(); > - break; > - } > -} > - > int > cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, > struct timespec *tsp, int *ticksp) > { > - struct rwlock *bucketlock; > struct namecache *ncp; > + struct rwlock *blp; > + struct mtx *dvlp, *dvlp2; > uint32_t hash; > - int error, ltype, cache_locked; > + int error, ltype; > > if (!doingcache) { > cnp->cn_flags &= ~MAKEENTRY; > return (0); > } > retry: > - bucketlock = NULL; > - cache_locked = UNLOCKED; > + blp = NULL; > + dvlp = VP2VNODELOCK(dvp); > error = 0; > counter_u64_add(numcalls, 1); > > -retry_wlocked: > if (cnp->cn_nameptr[0] == '.') { > if (cnp->cn_namelen == 1) { > *vpp = dvp; > @@ -693,32 +1001,37 @@ retry_wlocked: > } > if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { > counter_u64_add(dotdothits, 1); > - if (cache_locked == UNLOCKED) { > - CACHE_RLOCK(); > - cache_locked = RLOCKED; > - } > - > - if (dvp->v_cache_dd == NULL) { > + dvlp2 = NULL; > + mtx_lock(dvlp); > +retry_dotdot: > + ncp = dvp->v_cache_dd; > + if (ncp == NULL) { > SDT_PROBE3(vfs, namecache, lookup, miss, dvp, > "..", NULL); > - goto unlock; > + mtx_unlock(dvlp); > + return (0); > } > if ((cnp->cn_flags & MAKEENTRY) == 0) { > - if (cache_locked != WLOCKED && > - !CACHE_UPGRADE_LOCK()) > - goto wlock; > - ncp = NULL; > - if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) { > - ncp = dvp->v_cache_dd; > - cache_zap(ncp); > + if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) { > + if (ncp->nc_dvp != dvp) > + panic("dvp %p v_cache_dd %p\n", dvp, ncp); > + if (!cache_zap_locked_vnode_kl2(ncp, > + dvp, &dvlp2)) > + goto retry_dotdot; > + MPASS(dvp->v_cache_dd == NULL); > + mtx_unlock(dvlp); > + if (dvlp2 != NULL) > + mtx_unlock(dvlp2); > + cache_free(ncp); > + } else { > + dvp->v_cache_dd = NULL; > + mtx_unlock(dvlp); > + if (dvlp2 != NULL) > + mtx_unlock(dvlp2); > } > - dvp->v_cache_dd = NULL; > - CACHE_WUNLOCK(); > - cache_free(ncp); > return (0); > } > - ncp = dvp->v_cache_dd; > - if (ncp->nc_flag & NCF_ISDOTDOT) > + if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) > *vpp = ncp->nc_vp; > else > *vpp = ncp->nc_dvp; > @@ -739,10 +1052,8 @@ retry_wlocked: > } > > hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); > - if (cache_locked == UNLOCKED) { > - bucketlock = HASH2BUCKETLOCK(hash); > - rw_rlock(bucketlock); > - } > + blp = HASH2BUCKETLOCK(hash); > + rw_rlock(blp); > > LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { > counter_u64_add(numchecks, 1); > @@ -795,24 +1106,9 @@ negative_success: > SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, > nc_get_name(ncp)); > cache_out_ts(ncp, tsp, ticksp); > - MPASS(bucketlock != NULL || cache_locked != UNLOCKED); > - if (bucketlock != NULL) > - rw_runlock(bucketlock); > - cache_unlock(cache_locked); > + cache_lookup_unlock(blp, dvlp); > return (ENOENT); > > -wlock: > - /* > - * We need to update the cache after our lookup, so upgrade to > - * a write lock and retry the operation. > - */ > - CACHE_RUNLOCK(); > -wlock_unlocked: > - CACHE_WLOCK(); > - numupgrades++; > - cache_locked = WLOCKED; > - goto retry_wlocked; > - > success: > /* > * On success we return a locked and ref'd vnode as per the lookup > @@ -825,10 +1121,7 @@ success: > VOP_UNLOCK(dvp, 0); > } > vhold(*vpp); > - MPASS(bucketlock != NULL || cache_locked != UNLOCKED); > - if (bucketlock != NULL) > - rw_runlock(bucketlock); > - cache_unlock(cache_locked); > + cache_lookup_unlock(blp, dvlp); > error = vget(*vpp, cnp->cn_lkflags | LK_VNHELD, cnp->cn_thread); > if (cnp->cn_flags & ISDOTDOT) { > vn_lock(dvp, ltype | LK_RETRY); > @@ -850,32 +1143,232 @@ success: > return (-1); > > unlock: > - MPASS(bucketlock != NULL || cache_locked != UNLOCKED); > - if (bucketlock != NULL) > - rw_runlock(bucketlock); > - cache_unlock(cache_locked); > + cache_lookup_unlock(blp, dvlp); > return (0); > > zap_and_exit: > - if (bucketlock != NULL) { > - rw_assert(&cache_lock, RA_UNLOCKED); > - if (!CACHE_TRY_WLOCK()) { > - rw_runlock(bucketlock); > - bucketlock = NULL; > - zap_and_exit_bucket_fail++; > - goto wlock_unlocked; > - } > - cache_locked = WLOCKED; > - rw_runlock(bucketlock); > - bucketlock = NULL; > - } else if (cache_locked != WLOCKED && !CACHE_UPGRADE_LOCK()) > - goto wlock; > - cache_zap(ncp); > - CACHE_WUNLOCK(); > + if (blp != NULL) > + error = cache_zap_rlocked_bucket(ncp, blp); > + else > + error = cache_zap_locked_vnode(ncp, dvp); > + if (error != 0) { > + zap_and_exit_bucket_fail++; > + cache_maybe_yield(); > + goto retry; > + } > cache_free(ncp); > return (0); > } > > +struct celockstate { > + struct mtx *vlp[3]; > + struct rwlock *blp[2]; > +}; > +CTASSERT((nitems(((struct celockstate *)0)->vlp) == 3)); > +CTASSERT((nitems(((struct celockstate *)0)->blp) == 2)); > + > +static inline void > +cache_celockstate_init(struct celockstate *cel) > +{ > + > + bzero(cel, sizeof(*cel)); > +} > + > +static void > +cache_lock_vnodes_cel(struct celockstate *cel, struct vnode *vp, > + struct vnode *dvp) > +{ > + struct mtx *vlp1, *vlp2; > + > + MPASS(cel->vlp[0] == NULL); > + MPASS(cel->vlp[1] == NULL); > + MPASS(cel->vlp[2] == NULL); > + > + MPASS(vp != NULL || dvp != NULL); > + > + vlp1 = VP2VNODELOCK(vp); > + vlp2 = VP2VNODELOCK(dvp); > + cache_sort(&vlp1, &vlp2); > + > + if (vlp1 != NULL) { > + mtx_lock(vlp1); > + cel->vlp[0] = vlp1; > + } > + mtx_lock(vlp2); > + cel->vlp[1] = vlp2; > +} > + > +static void > +cache_unlock_vnodes_cel(struct celockstate *cel) > +{ > + > + MPASS(cel->vlp[0] != NULL || cel->vlp[1] != NULL); > + > + if (cel->vlp[0] != NULL) > + mtx_unlock(cel->vlp[0]); > + if (cel->vlp[1] != NULL) > + mtx_unlock(cel->vlp[1]); > + if (cel->vlp[2] != NULL) > + mtx_unlock(cel->vlp[2]); > +} > + > +static bool > +cache_lock_vnodes_cel_3(struct celockstate *cel, struct vnode *vp) > +{ > + struct mtx *vlp; > + bool ret; > + > + cache_assert_vlp_locked(cel->vlp[0]); > + cache_assert_vlp_locked(cel->vlp[1]); > + MPASS(cel->vlp[2] == NULL); > + > + vlp = VP2VNODELOCK(vp); > + if (vlp == NULL) > + return (true); > + > + ret = true; > + if (vlp >= cel->vlp[1]) { > + mtx_lock(vlp); > + } else { > + if (mtx_trylock(vlp)) > + goto out; > + cache_lock_vnodes_cel_3_failures++; > + cache_unlock_vnodes_cel(cel); > + if (vlp < cel->vlp[0]) { > + mtx_lock(vlp); > + mtx_lock(cel->vlp[0]); > + mtx_lock(cel->vlp[1]); > + } else { > + if (cel->vlp[0] != NULL) > + mtx_lock(cel->vlp[0]); > + mtx_lock(vlp); > + mtx_lock(cel->vlp[1]); > + } > + ret = false; > + } > +out: > + cel->vlp[2] = vlp; > + return (ret); > +} > + > +static void > +cache_lock_buckets_cel(struct celockstate *cel, struct rwlock *blp1, > + struct rwlock *blp2) > +{ > + > + MPASS(cel->blp[0] == NULL); > + MPASS(cel->blp[1] == NULL); > + > + cache_sort(&blp1, &blp2); > + > + if (blp1 != NULL) { > + rw_wlock(blp1); > + cel->blp[0] = blp1; > + } > + rw_wlock(blp2); > + cel->blp[1] = blp2; > +} > + > +static void > +cache_unlock_buckets_cel(struct celockstate *cel) > +{ > + > + if (cel->blp[0] != NULL) > + rw_wunlock(cel->blp[0]); > + rw_wunlock(cel->blp[1]); > +} > + > +/* > + * Lock part of the cache affected by the insertion. > + * > + * This means vnodelocks for dvp, vp and the relevant bucketlock. > + * However, insertion can result in removal of an old entry. In this > + * case we have an additional vnode and bucketlock pair to lock. If the > + * entry is negative, ncelock is locked instead of the vnode. > + * > + * That is, in the worst case we have to lock 3 vnodes and 2 bucketlocks, while > + * preserving the locking order (smaller address first). > + */ > +static void > +cache_enter_lock(struct celockstate *cel, struct vnode *dvp, struct vnode *vp, > + uint32_t hash) > +{ > + struct namecache *ncp; > + struct rwlock *blps[2]; > + > + blps[0] = HASH2BUCKETLOCK(hash); > + for (;;) { > + blps[1] = NULL; > + cache_lock_vnodes_cel(cel, dvp, vp); > + if (vp == NULL || vp->v_type != VDIR) > + break; > + ncp = vp->v_cache_dd; > + if (ncp == NULL) > + break; > + if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) > + break; > + MPASS(ncp->nc_dvp == vp); > + blps[1] = NCP2BUCKETLOCK(ncp); > + if (cache_lock_vnodes_cel_3(cel, ncp->nc_vp)) > + break; > + /* > + * All vnodes got re-locked. Re-validate the state and if > + * nothing changed we are done. Otherwise restart. > + */ > + if (ncp == vp->v_cache_dd && > + (ncp->nc_flag & NCF_ISDOTDOT) != 0 && > + blps[1] == NCP2BUCKETLOCK(ncp) && > + VP2VNODELOCK(ncp->nc_vp) == cel->vlp[2]) > + break; > + cache_unlock_vnodes_cel(cel); > + cel->vlp[0] = NULL; > + cel->vlp[1] = NULL; > + cel->vlp[2] = NULL; > + } > + cache_lock_buckets_cel(cel, blps[0], blps[1]); > +} > + > +static void > +cache_enter_lock_dd(struct celockstate *cel, struct vnode *dvp, struct vnode *vp, > + uint32_t hash) > +{ > + struct namecache *ncp; > + struct rwlock *blps[2]; > + > + blps[0] = HASH2BUCKETLOCK(hash); > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@freebsd.org Sat Nov 12 18:33:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 097CDC3E8DE; Sat, 12 Nov 2016 18:33:58 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB09E167B; Sat, 12 Nov 2016 18:33:57 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uACIXuTh057651; Sat, 12 Nov 2016 18:33:56 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uACIXu72057650; Sat, 12 Nov 2016 18:33:56 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201611121833.uACIXu72057650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Sat, 12 Nov 2016 18:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308577 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 18:33:58 -0000 Author: gavin Date: Sat Nov 12 18:33:56 2016 New Revision: 308577 URL: https://svnweb.freebsd.org/changeset/base/308577 Log: iwm: If firmware load fails during init via iwm_preinit() we bail out before calling ieee80211_ifattach() so the taskqueue hasn't been initialized. Don't try to drain it, we'll panic. Looks like this issue was introduced in r303326. Reviewed by: avos, sbruno, adrian Differential Revision: https://reviews.freebsd.org/D8499 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sat Nov 12 18:04:03 2016 (r308576) +++ head/sys/dev/iwm/if_iwm.c Sat Nov 12 18:33:56 2016 (r308577) @@ -6192,7 +6192,8 @@ iwm_detach_local(struct iwm_softc *sc, i device_t dev = sc->sc_dev; int i; - ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task); + if (do_net80211) + ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task); callout_drain(&sc->sc_led_blink_to); callout_drain(&sc->sc_watchdog_to); From owner-svn-src-head@freebsd.org Sat Nov 12 18:57:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C42BC3D0CB; Sat, 12 Nov 2016 18:57:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 560ADB2E; Sat, 12 Nov 2016 18:57:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uACIvc9E066403; Sat, 12 Nov 2016 18:57:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uACIvca7066402; Sat, 12 Nov 2016 18:57:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611121857.uACIvca7066402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 12 Nov 2016 18:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308579 - head/sys/geom/multipath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 18:57:39 -0000 Author: mav Date: Sat Nov 12 18:57:38 2016 New Revision: 308579 URL: https://svnweb.freebsd.org/changeset/base/308579 Log: Do not report error on close even if we have no paths left. MFC after: 2 weeks Modified: head/sys/geom/multipath/g_multipath.c Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Sat Nov 12 18:49:46 2016 (r308578) +++ head/sys/geom/multipath/g_multipath.c Sat Nov 12 18:57:38 2016 (r308579) @@ -470,7 +470,7 @@ g_multipath_access(struct g_provider *pp gp = pp->geom; /* Error used if we have no valid consumers. */ - error = ENXIO; + error = (dr > 0 || dw > 0 || de > 0) ? ENXIO : 0; LIST_FOREACH(cp, &gp->consumer, consumer) { if (cp->index & MP_WITHER) From owner-svn-src-head@freebsd.org Sat Nov 12 19:03:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07AF6C3D2AA; Sat, 12 Nov 2016 19:03:25 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD468F4A; Sat, 12 Nov 2016 19:03:24 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uACJ3NTA070197; Sat, 12 Nov 2016 19:03:23 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uACJ3NjC070196; Sat, 12 Nov 2016 19:03:23 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201611121903.uACJ3NjC070196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Sat, 12 Nov 2016 19:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308580 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 19:03:25 -0000 Author: rstone Date: Sat Nov 12 19:03:23 2016 New Revision: 308580 URL: https://svnweb.freebsd.org/changeset/base/308580 Log: Don't read if_counters with if_addr_lock held Calling into an ifnet implementation with the if_addr_lock already held can cause a LOR and potentially a deadlock, as ifnet implementations typically can take the if_addr_lock after their own locks during configuration. Refactor a sysctl handler that was violating this to read if_counter data in a temporary buffer before the if_addr_lock is taken, and then copying the data in its final location later, when the if_addr_lock is held. PR: 194109 Reported by: Jean-Sebastien Pedron MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D8498 Reviewed by: sbruno Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Nov 12 18:57:38 2016 (r308579) +++ head/sys/net/rtsock.c Sat Nov 12 19:03:23 2016 (r308580) @@ -1566,8 +1566,8 @@ sysctl_dumpentry(struct radix_node *rn, } static int -sysctl_iflist_ifml(struct ifnet *ifp, struct rt_addrinfo *info, - struct walkarg *w, int len) +sysctl_iflist_ifml(struct ifnet *ifp, const struct if_data *src_ifd, + struct rt_addrinfo *info, struct walkarg *w, int len) { struct if_msghdrl *ifm; struct if_data *ifd; @@ -1598,14 +1598,14 @@ sysctl_iflist_ifml(struct ifnet *ifp, st ifd = &ifm->ifm_data; } - if_data_copy(ifp, ifd); + memcpy(ifd, src_ifd, sizeof(*ifd)); return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); } static int -sysctl_iflist_ifm(struct ifnet *ifp, struct rt_addrinfo *info, - struct walkarg *w, int len) +sysctl_iflist_ifm(struct ifnet *ifp, const struct if_data *src_ifd, + struct rt_addrinfo *info, struct walkarg *w, int len) { struct if_msghdr *ifm; struct if_data *ifd; @@ -1630,7 +1630,7 @@ sysctl_iflist_ifm(struct ifnet *ifp, str ifd = &ifm->ifm_data; } - if_data_copy(ifp, ifd); + memcpy(ifd, src_ifd, sizeof(*ifd)); return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); } @@ -1705,15 +1705,18 @@ sysctl_iflist(int af, struct walkarg *w) { struct ifnet *ifp; struct ifaddr *ifa; + struct if_data ifd; struct rt_addrinfo info; int len, error = 0; struct sockaddr_storage ss; bzero((caddr_t)&info, sizeof(info)); + bzero(&ifd, sizeof(ifd)); IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (w->w_arg && w->w_arg != ifp->if_index) continue; + if_data_copy(ifp, &ifd); IF_ADDR_RLOCK(ifp); ifa = ifp->if_addr; info.rti_info[RTAX_IFP] = ifa->ifa_addr; @@ -1723,9 +1726,11 @@ sysctl_iflist(int af, struct walkarg *w) info.rti_info[RTAX_IFP] = NULL; if (w->w_req && w->w_tmem) { if (w->w_op == NET_RT_IFLISTL) - error = sysctl_iflist_ifml(ifp, &info, w, len); + error = sysctl_iflist_ifml(ifp, &ifd, &info, w, + len); else - error = sysctl_iflist_ifm(ifp, &info, w, len); + error = sysctl_iflist_ifm(ifp, &ifd, &info, w, + len); if (error) goto done; } From owner-svn-src-head@freebsd.org Sat Nov 12 19:05:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9B6AC3D49B; Sat, 12 Nov 2016 19:05:42 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B9321357; Sat, 12 Nov 2016 19:05:42 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uACJ5fRp070375; Sat, 12 Nov 2016 19:05:41 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uACJ5fGW070374; Sat, 12 Nov 2016 19:05:41 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201611121905.uACJ5fGW070374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 12 Nov 2016 19:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308581 - head/sys/modules/rpi_ft5406 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 19:05:42 -0000 Author: gonzo Date: Sat Nov 12 19:05:41 2016 New Revision: 308581 URL: https://svnweb.freebsd.org/changeset/base/308581 Log: [rpi_ft5406] Add missing dependency on mbox_if.h Submitted by: hselasky MFC after: ASAP Modified: head/sys/modules/rpi_ft5406/Makefile Modified: head/sys/modules/rpi_ft5406/Makefile ============================================================================== --- head/sys/modules/rpi_ft5406/Makefile Sat Nov 12 19:03:23 2016 (r308580) +++ head/sys/modules/rpi_ft5406/Makefile Sat Nov 12 19:05:41 2016 (r308581) @@ -5,6 +5,6 @@ KMOD= rpi_ft5406 SRCS= bcm2835_ft5406.c -SRCS+= bus_if.h device_if.h ofw_bus_if.h +SRCS+= bus_if.h device_if.h mbox_if.h ofw_bus_if.h .include From owner-svn-src-head@freebsd.org Sat Nov 12 19:26:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB70BC3DCFF; Sat, 12 Nov 2016 19:26:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89E6C1F97; Sat, 12 Nov 2016 19:26:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uACJQDDo078955; Sat, 12 Nov 2016 19:26:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uACJQDsu078946; Sat, 12 Nov 2016 19:26:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201611121926.uACJQDsu078946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 12 Nov 2016 19:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308582 - in head: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 19:26:14 -0000 Author: markj Date: Sat Nov 12 19:26:12 2016 New Revision: 308582 URL: https://svnweb.freebsd.org/changeset/base/308582 Log: Remove the DTrace printt and typeref actions. These are FreeBSD-specific and were added in r178576 to provide the ability to pretty-print instances of compound types. However, the print action has long since been augmented to provide this functionality with a simpler interface. Discussed with: gnn Differential Revision: https://reviews.freebsd.org/D8478 Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Sat Nov 12 19:05:41 2016 (r308581) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Sat Nov 12 19:26:12 2016 (r308582) @@ -1058,46 +1058,6 @@ dt_action_printm(dtrace_hdl_t *dtp, dt_n } static void -dt_action_printt(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp) -{ - dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp); - - dt_node_t *size = dnp->dn_args; - dt_node_t *addr = dnp->dn_args->dn_list; - - char n[DT_TYPE_NAMELEN]; - - if (dt_node_is_posconst(size) == 0) { - dnerror(size, D_PRINTT_SIZE, "printt( ) argument #1 must " - "be a non-zero positive integral constant expression\n"); - } - - if (addr == NULL || addr->dn_kind != DT_NODE_FUNC || - addr->dn_ident != dt_idhash_lookup(dtp->dt_globals, "typeref")) { - dnerror(addr, D_PRINTT_ADDR, - "printt( ) argument #2 is incompatible with " - "prototype:\n\tprototype: typeref()\n" - "\t argument: %s\n", - dt_node_type_name(addr, n, sizeof (n))); - } - - dt_cg(yypcb, addr); - ap->dtad_difo = dt_as(yypcb); - ap->dtad_kind = DTRACEACT_PRINTT; - - ap->dtad_difo->dtdo_rtype.dtdt_flags |= DIF_TF_BYREF; - - /* - * Allow additional buffer space for the data size, type size, - * type string length and a stab in the dark (32 bytes) for the - * type string. The type string is part of the typeref() that - * this action references. - */ - ap->dtad_difo->dtdo_rtype.dtdt_size = size->dn_value + 3 * sizeof(uintptr_t) + 32; - -} - -static void dt_action_commit(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp) { dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp); @@ -1169,9 +1129,6 @@ dt_compile_fun(dtrace_hdl_t *dtp, dt_nod case DT_ACT_PRINTM: dt_action_printm(dtp, dnp->dn_expr, sdp); break; - case DT_ACT_PRINTT: - dt_action_printt(dtp, dnp->dn_expr, sdp); - break; case DT_ACT_RAISE: dt_action_raise(dtp, dnp->dn_expr, sdp); break; Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c Sat Nov 12 19:05:41 2016 (r308581) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c Sat Nov 12 19:26:12 2016 (r308582) @@ -1353,40 +1353,6 @@ dt_cg_inline(dt_node_t *dnp, dt_irlist_t } } -static void -dt_cg_func_typeref(dtrace_hdl_t *dtp, dt_node_t *dnp) -{ - dtrace_typeinfo_t dtt; - dt_node_t *addr = dnp->dn_args; - dt_node_t *nelm = addr->dn_list; - dt_node_t *strp = nelm->dn_list; - dt_node_t *typs = strp->dn_list; - char buf[DT_TYPE_NAMELEN]; - char *p; - - ctf_type_name(addr->dn_ctfp, addr->dn_type, buf, sizeof (buf)); - - /* - * XXX Hack alert! XXX - * The prototype has two dummy args that we munge to represent - * the type string and the type size. - * - * Yes, I hear your grumble, but it works for now. We'll come - * up with a more elegant implementation later. :-) - */ - free(strp->dn_string); - - if ((p = strchr(buf, '*')) != NULL) - *p = '\0'; - - strp->dn_string = strdup(buf); - - if (dtrace_lookup_by_type(dtp, DTRACE_OBJ_EVERY, buf, &dtt) < 0) - return; - - typs->dn_value = ctf_type_size(dtt.dtt_ctfp, dtt.dtt_type); -} - typedef struct dt_xlmemb { dt_ident_t *dtxl_idp; /* translated ident */ dt_irlist_t *dtxl_dlp; /* instruction list */ @@ -2002,8 +1968,6 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t * switch (dnp->dn_kind) { case DT_NODE_FUNC: { - dtrace_hdl_t *dtp = yypcb->pcb_hdl; - if ((idp = dnp->dn_ident)->di_kind != DT_IDENT_FUNC) { dnerror(dnp, D_CG_EXPR, "%s %s( ) may not be " "called from a D expression (D program " @@ -2011,15 +1975,6 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t * dt_idkind_name(idp->di_kind), idp->di_name); } - switch (idp->di_id) { - case DIF_SUBR_TYPEREF: - dt_cg_func_typeref(dtp, dnp); - break; - - default: - break; - } - dt_cg_arglist(dnp->dn_ident, dnp->dn_args, dlp, drp); dnp->dn_reg = dt_regset_alloc(drp); Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Sat Nov 12 19:05:41 2016 (r308581) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Sat Nov 12 19:26:12 2016 (r308582) @@ -1537,314 +1537,6 @@ dt_print_umod(dtrace_hdl_t *dtp, FILE *f return (err); } -int -dt_print_memory(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr) -{ - int quiet = (dtp->dt_options[DTRACEOPT_QUIET] != DTRACEOPT_UNSET); - size_t nbytes = *((uintptr_t *) addr); - - return (dt_print_bytes(dtp, fp, addr + sizeof(uintptr_t), - nbytes, 50, quiet, 1)); -} - -typedef struct dt_type_cbdata { - dtrace_hdl_t *dtp; - dtrace_typeinfo_t dtt; - caddr_t addr; - caddr_t addrend; - const char *name; - int f_type; - int indent; - int type_width; - int name_width; - FILE *fp; -} dt_type_cbdata_t; - -static int dt_print_type_data(dt_type_cbdata_t *, ctf_id_t); - -static int -dt_print_type_member(const char *name, ctf_id_t type, ulong_t off, void *arg) -{ - dt_type_cbdata_t cbdata; - dt_type_cbdata_t *cbdatap = arg; - ssize_t ssz; - - if ((ssz = ctf_type_size(cbdatap->dtt.dtt_ctfp, type)) <= 0) - return (0); - - off /= 8; - - cbdata = *cbdatap; - cbdata.name = name; - cbdata.addr += off; - cbdata.addrend = cbdata.addr + ssz; - - return (dt_print_type_data(&cbdata, type)); -} - -static int -dt_print_type_width(const char *name, ctf_id_t type, ulong_t off, void *arg) -{ - char buf[DT_TYPE_NAMELEN]; - char *p; - dt_type_cbdata_t *cbdatap = arg; - size_t sz = strlen(name); - - ctf_type_name(cbdatap->dtt.dtt_ctfp, type, buf, sizeof (buf)); - - if ((p = strchr(buf, '[')) != NULL) - p[-1] = '\0'; - else - p = ""; - - sz += strlen(p); - - if (sz > cbdatap->name_width) - cbdatap->name_width = sz; - - sz = strlen(buf); - - if (sz > cbdatap->type_width) - cbdatap->type_width = sz; - - return (0); -} - -static int -dt_print_type_data(dt_type_cbdata_t *cbdatap, ctf_id_t type) -{ - caddr_t addr = cbdatap->addr; - caddr_t addrend = cbdatap->addrend; - char buf[DT_TYPE_NAMELEN]; - char *p; - int cnt = 0; - uint_t kind = ctf_type_kind(cbdatap->dtt.dtt_ctfp, type); - ssize_t ssz = ctf_type_size(cbdatap->dtt.dtt_ctfp, type); - - ctf_type_name(cbdatap->dtt.dtt_ctfp, type, buf, sizeof (buf)); - - if ((p = strchr(buf, '[')) != NULL) - p[-1] = '\0'; - else - p = ""; - - if (cbdatap->f_type) { - int type_width = roundup(cbdatap->type_width + 1, 4); - int name_width = roundup(cbdatap->name_width + 1, 4); - - name_width -= strlen(cbdatap->name); - - dt_printf(cbdatap->dtp, cbdatap->fp, "%*s%-*s%s%-*s = ",cbdatap->indent * 4,"",type_width,buf,cbdatap->name,name_width,p); - } - - while (addr < addrend) { - dt_type_cbdata_t cbdata; - ctf_arinfo_t arinfo; - ctf_encoding_t cte; - uintptr_t *up; - void *vp = addr; - cbdata = *cbdatap; - cbdata.name = ""; - cbdata.addr = addr; - cbdata.addrend = addr + ssz; - cbdata.f_type = 0; - cbdata.indent++; - cbdata.type_width = 0; - cbdata.name_width = 0; - - if (cnt > 0) - dt_printf(cbdatap->dtp, cbdatap->fp, "%*s", cbdatap->indent * 4,""); - - switch (kind) { - case CTF_K_INTEGER: - if (ctf_type_encoding(cbdatap->dtt.dtt_ctfp, type, &cte) != 0) - return (-1); - if ((cte.cte_format & CTF_INT_SIGNED) != 0) - switch (cte.cte_bits) { - case 8: - if (isprint(*((char *) vp))) - dt_printf(cbdatap->dtp, cbdatap->fp, "'%c', ", *((char *) vp)); - dt_printf(cbdatap->dtp, cbdatap->fp, "%d (0x%x);\n", *((char *) vp), *((char *) vp)); - break; - case 16: - dt_printf(cbdatap->dtp, cbdatap->fp, "%hd (0x%hx);\n", *((short *) vp), *((u_short *) vp)); - break; - case 32: - dt_printf(cbdatap->dtp, cbdatap->fp, "%d (0x%x);\n", *((int *) vp), *((u_int *) vp)); - break; - case 64: - dt_printf(cbdatap->dtp, cbdatap->fp, "%jd (0x%jx);\n", *((long long *) vp), *((unsigned long long *) vp)); - break; - default: - dt_printf(cbdatap->dtp, cbdatap->fp, "CTF_K_INTEGER: format %x offset %u bits %u\n",cte.cte_format,cte.cte_offset,cte.cte_bits); - break; - } - else - switch (cte.cte_bits) { - case 8: - dt_printf(cbdatap->dtp, cbdatap->fp, "%u (0x%x);\n", *((uint8_t *) vp) & 0xff, *((uint8_t *) vp) & 0xff); - break; - case 16: - dt_printf(cbdatap->dtp, cbdatap->fp, "%hu (0x%hx);\n", *((u_short *) vp), *((u_short *) vp)); - break; - case 32: - dt_printf(cbdatap->dtp, cbdatap->fp, "%u (0x%x);\n", *((u_int *) vp), *((u_int *) vp)); - break; - case 64: - dt_printf(cbdatap->dtp, cbdatap->fp, "%ju (0x%jx);\n", *((unsigned long long *) vp), *((unsigned long long *) vp)); - break; - default: - dt_printf(cbdatap->dtp, cbdatap->fp, "CTF_K_INTEGER: format %x offset %u bits %u\n",cte.cte_format,cte.cte_offset,cte.cte_bits); - break; - } - break; - case CTF_K_FLOAT: - dt_printf(cbdatap->dtp, cbdatap->fp, "CTF_K_FLOAT: format %x offset %u bits %u\n",cte.cte_format,cte.cte_offset,cte.cte_bits); - break; - case CTF_K_POINTER: - dt_printf(cbdatap->dtp, cbdatap->fp, "%p;\n", *((void **) addr)); - break; - case CTF_K_ARRAY: - if (ctf_array_info(cbdatap->dtt.dtt_ctfp, type, &arinfo) != 0) - return (-1); - dt_printf(cbdatap->dtp, cbdatap->fp, "{\n%*s",cbdata.indent * 4,""); - dt_print_type_data(&cbdata, arinfo.ctr_contents); - dt_printf(cbdatap->dtp, cbdatap->fp, "%*s};\n",cbdatap->indent * 4,""); - break; - case CTF_K_FUNCTION: - dt_printf(cbdatap->dtp, cbdatap->fp, "CTF_K_FUNCTION:\n"); - break; - case CTF_K_STRUCT: - cbdata.f_type = 1; - if (ctf_member_iter(cbdatap->dtt.dtt_ctfp, type, - dt_print_type_width, &cbdata) != 0) - return (-1); - dt_printf(cbdatap->dtp, cbdatap->fp, "{\n"); - if (ctf_member_iter(cbdatap->dtt.dtt_ctfp, type, - dt_print_type_member, &cbdata) != 0) - return (-1); - dt_printf(cbdatap->dtp, cbdatap->fp, "%*s};\n",cbdatap->indent * 4,""); - break; - case CTF_K_UNION: - cbdata.f_type = 1; - if (ctf_member_iter(cbdatap->dtt.dtt_ctfp, type, - dt_print_type_width, &cbdata) != 0) - return (-1); - dt_printf(cbdatap->dtp, cbdatap->fp, "{\n"); - if (ctf_member_iter(cbdatap->dtt.dtt_ctfp, type, - dt_print_type_member, &cbdata) != 0) - return (-1); - dt_printf(cbdatap->dtp, cbdatap->fp, "%*s};\n",cbdatap->indent * 4,""); - break; - case CTF_K_ENUM: - dt_printf(cbdatap->dtp, cbdatap->fp, "%s;\n", ctf_enum_name(cbdatap->dtt.dtt_ctfp, type, *((int *) vp))); - break; - case CTF_K_TYPEDEF: - dt_print_type_data(&cbdata, ctf_type_reference(cbdatap->dtt.dtt_ctfp,type)); - break; - case CTF_K_VOLATILE: - if (cbdatap->f_type) - dt_printf(cbdatap->dtp, cbdatap->fp, "volatile "); - dt_print_type_data(&cbdata, ctf_type_reference(cbdatap->dtt.dtt_ctfp,type)); - break; - case CTF_K_CONST: - if (cbdatap->f_type) - dt_printf(cbdatap->dtp, cbdatap->fp, "const "); - dt_print_type_data(&cbdata, ctf_type_reference(cbdatap->dtt.dtt_ctfp,type)); - break; - case CTF_K_RESTRICT: - if (cbdatap->f_type) - dt_printf(cbdatap->dtp, cbdatap->fp, "restrict "); - dt_print_type_data(&cbdata, ctf_type_reference(cbdatap->dtt.dtt_ctfp,type)); - break; - default: - break; - } - - addr += ssz; - cnt++; - } - - return (0); -} - -static int -dt_print_type(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr) -{ - caddr_t addrend; - char *p; - dtrace_typeinfo_t dtt; - dt_type_cbdata_t cbdata; - int num = 0; - int quiet = (dtp->dt_options[DTRACEOPT_QUIET] != DTRACEOPT_UNSET); - ssize_t ssz; - - if (!quiet) - dt_printf(dtp, fp, "\n"); - - /* Get the total number of bytes of data buffered. */ - size_t nbytes = *((uintptr_t *) addr); - addr += sizeof(uintptr_t); - - /* - * Get the size of the type so that we can check that it matches - * the CTF data we look up and so that we can figure out how many - * type elements are buffered. - */ - size_t typs = *((uintptr_t *) addr); - addr += sizeof(uintptr_t); - - /* - * Point to the type string in the buffer. Get it's string - * length and round it up to become the offset to the start - * of the buffered type data which we would like to be aligned - * for easy access. - */ - char *strp = (char *) addr; - int offset = roundup(strlen(strp) + 1, sizeof(uintptr_t)); - - /* - * The type string might have a format such as 'int [20]'. - * Check if there is an array dimension present. - */ - if ((p = strchr(strp, '[')) != NULL) { - /* Strip off the array dimension. */ - *p++ = '\0'; - - for (; *p != '\0' && *p != ']'; p++) - num = num * 10 + *p - '0'; - } else - /* No array dimension, so default. */ - num = 1; - - /* Lookup the CTF type from the type string. */ - if (dtrace_lookup_by_type(dtp, DTRACE_OBJ_EVERY, strp, &dtt) < 0) - return (-1); - - /* Offset the buffer address to the start of the data... */ - addr += offset; - - ssz = ctf_type_size(dtt.dtt_ctfp, dtt.dtt_type); - - if (typs != ssz) { - printf("Expected type size from buffer (%lu) to match type size looked up now (%ld)\n", (u_long) typs, (long) ssz); - return (-1); - } - - cbdata.dtp = dtp; - cbdata.dtt = dtt; - cbdata.name = ""; - cbdata.addr = addr; - cbdata.addrend = addr + nbytes; - cbdata.indent = 1; - cbdata.f_type = 1; - cbdata.type_width = 0; - cbdata.name_width = 0; - cbdata.fp = fp; - - return (dt_print_type_data(&cbdata, dtt.dtt_type)); -} - static int dt_print_sym(dtrace_hdl_t *dtp, FILE *fp, const char *format, caddr_t addr) { @@ -1904,6 +1596,16 @@ dt_print_mod(dtrace_hdl_t *dtp, FILE *fp return (0); } +static int +dt_print_memory(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr) +{ + int quiet = (dtp->dt_options[DTRACEOPT_QUIET] != DTRACEOPT_UNSET); + size_t nbytes = *((uintptr_t *) addr); + + return (dt_print_bytes(dtp, fp, addr + sizeof(uintptr_t), + nbytes, 50, quiet, 1)); +} + typedef struct dt_normal { dtrace_aggvarid_t dtnd_id; uint64_t dtnd_normal; @@ -2644,12 +2346,6 @@ dt_consume_cpu(dtrace_hdl_t *dtp, FILE * goto nextrec; } - if (act == DTRACEACT_PRINTT) { - if (dt_print_type(dtp, fp, addr) < 0) - return (-1); - goto nextrec; - } - if (DTRACEACT_ISPRINTFLIKE(act)) { void *fmtdata; int (*func)(dtrace_hdl_t *, FILE *, void *, Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Sat Nov 12 19:05:41 2016 (r308581) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Sat Nov 12 19:26:12 2016 (r308582) @@ -265,8 +265,6 @@ typedef enum { D_NOREG, /* no available internal registers */ D_PRINTM_ADDR, /* printm() memref bad type */ D_PRINTM_SIZE, /* printm() size bad type */ - D_PRINTT_ADDR, /* printt() typeref bad type */ - D_PRINTT_SIZE /* printt() size bad type */ } dt_errtag_t; extern const char *dt_errtag(dt_errtag_t); Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Sat Nov 12 19:05:41 2016 (r308581) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Sat Nov 12 19:26:12 2016 (r308582) @@ -488,7 +488,6 @@ struct dtrace_hdl { #define DT_ACT_SETOPT DT_ACT(28) /* setopt() action */ #define DT_ACT_PRINT DT_ACT(29) /* print() action */ #define DT_ACT_PRINTM DT_ACT(30) /* printm() action */ -#define DT_ACT_PRINTT DT_ACT(31) /* printt() action */ /* * Sentinel to tell freopen() to restore the saved stdout. This must not Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Sat Nov 12 19:05:41 2016 (r308581) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Sat Nov 12 19:26:12 2016 (r308582) @@ -392,8 +392,6 @@ static const dt_ident_t _dtrace_globals[ &dt_idops_func, "void(@, ...)" }, { "printm", DT_IDENT_ACTFUNC, 0, DT_ACT_PRINTM, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_func, "void(size_t, uintptr_t *)" }, -{ "printt", DT_IDENT_ACTFUNC, 0, DT_ACT_PRINTT, DT_ATTR_STABCMN, DT_VERS_1_0, - &dt_idops_func, "void(size_t, uintptr_t *)" }, { "probefunc", DT_IDENT_SCALAR, 0, DIF_VAR_PROBEFUNC, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_type, "string" }, { "probemod", DT_IDENT_SCALAR, 0, DIF_VAR_PROBEMOD, @@ -505,8 +503,6 @@ static const dt_ident_t _dtrace_globals[ &dt_idops_func, "void(@, size_t, ...)" }, { "trunc", DT_IDENT_ACTFUNC, 0, DT_ACT_TRUNC, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_func, "void(...)" }, -{ "typeref", DT_IDENT_FUNC, 0, DIF_SUBR_TYPEREF, DT_ATTR_STABCMN, DT_VERS_1_1, - &dt_idops_func, "uintptr_t *(void *, size_t, string, size_t)" }, { "uaddr", DT_IDENT_ACTFUNC, 0, DT_ACT_UADDR, DT_ATTR_STABCMN, DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" }, { "ucaller", DT_IDENT_SCALAR, 0, DIF_VAR_UCALLER, DT_ATTR_STABCMN, Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Nov 12 19:05:41 2016 (r308581) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Nov 12 19:26:12 2016 (r308582) @@ -6042,22 +6042,6 @@ inetout: regs[rd] = (uintptr_t)end + 1; break; } #endif - - case DIF_SUBR_TYPEREF: { - uintptr_t size = 4 * sizeof(uintptr_t); - uintptr_t *typeref = (uintptr_t *) P2ROUNDUP(mstate->dtms_scratch_ptr, sizeof(uintptr_t)); - size_t scratch_size = ((uintptr_t) typeref - mstate->dtms_scratch_ptr) + size; - - /* address, num_elements, type_str, type_len */ - typeref[0] = tupregs[0].dttk_value; - typeref[1] = tupregs[1].dttk_value; - typeref[2] = tupregs[2].dttk_value; - typeref[3] = tupregs[3].dttk_value; - - regs[rd] = (uintptr_t) typeref; - mstate->dtms_scratch_ptr += scratch_size; - break; - } } } @@ -7707,66 +7691,6 @@ dtrace_probe(dtrace_id_t id, uintptr_t a break; } - case DTRACEACT_PRINTT: { - /* The DIF returns a 'typeref'. */ - uintptr_t *typeref = (uintptr_t *)(uintptr_t) val; - char c = '\0' + 1; - size_t s; - - /* - * Get the type string length and round it - * up so that the data that follows is - * aligned for easy access. - */ - size_t typs = strlen((char *) typeref[2]) + 1; - typs = roundup(typs, sizeof(uintptr_t)); - - /* - *Get the size from the typeref using the - * number of elements and the type size. - */ - size = typeref[1] * typeref[3]; - - /* - * Check if the size exceeds the allocated - * buffer size. - */ - if (size + typs + 2 * sizeof(uintptr_t) > dp->dtdo_rtype.dtdt_size) { - /* Flag a drop! */ - *flags |= CPU_DTRACE_DROP; - - } - - /* Store the size in the buffer first. */ - DTRACE_STORE(uintptr_t, tomax, - valoffs, size); - valoffs += sizeof(uintptr_t); - - /* Store the type size in the buffer. */ - DTRACE_STORE(uintptr_t, tomax, - valoffs, typeref[3]); - valoffs += sizeof(uintptr_t); - - val = typeref[2]; - - for (s = 0; s < typs; s++) { - if (c != '\0') - c = dtrace_load8(val++); - - DTRACE_STORE(uint8_t, tomax, - valoffs++, c); - } - - /* - * Reset to the memory address rather than - * the typeref array, then let the BYREF - * code below do the work to store the - * memory data in the buffer. - */ - val = typeref[0]; - break; - } - case DTRACEACT_CHILL: if (dtrace_priv_kernel_destructive(state)) dtrace_action_chill(&mstate, val); @@ -10342,12 +10266,12 @@ dtrace_difo_validate_helper(dtrace_difo_ subr == DIF_SUBR_NTOHS || subr == DIF_SUBR_NTOHL || subr == DIF_SUBR_NTOHLL || - subr == DIF_SUBR_MEMREF || -#ifndef illumos - subr == DIF_SUBR_MEMSTR || -#endif - subr == DIF_SUBR_TYPEREF) + subr == DIF_SUBR_MEMREF) break; +#ifdef __FreeBSD__ + if (subr == DIF_SUBR_MEMSTR) + break; +#endif err += efunc(pc, "invalid subr %u\n", subr); break; @@ -11647,10 +11571,6 @@ dtrace_ecb_action_add(dtrace_ecb_t *ecb, size = dp->dtdo_rtype.dtdt_size; break; - case DTRACEACT_PRINTT: - size = dp->dtdo_rtype.dtdt_size; - break; - case DTRACEACT_COMMIT: { dtrace_action_t *act = ecb->dte_action; Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Sat Nov 12 19:05:41 2016 (r308581) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Sat Nov 12 19:26:12 2016 (r308582) @@ -308,7 +308,7 @@ typedef enum dtrace_probespec { #define DIF_SUBR_TOUPPER 44 #define DIF_SUBR_TOLOWER 45 #define DIF_SUBR_MEMREF 46 -#define DIF_SUBR_TYPEREF 47 +#define DIF_SUBR_UNUSED 47 #define DIF_SUBR_SX_SHARED_HELD 48 #define DIF_SUBR_SX_EXCLUSIVE_HELD 49 #define DIF_SUBR_SX_ISEXCLUSIVE 50 @@ -429,7 +429,6 @@ typedef struct dtrace_difv { #define DTRACEACT_TRACEMEM 6 /* tracemem() action */ #define DTRACEACT_TRACEMEM_DYNSIZE 7 /* dynamic tracemem() size */ #define DTRACEACT_PRINTM 8 /* printm() action (BSD) */ -#define DTRACEACT_PRINTT 9 /* printt() action (BSD) */ #define DTRACEACT_PROC 0x0100 #define DTRACEACT_USTACK (DTRACEACT_PROC + 1) From owner-svn-src-head@freebsd.org Sat Nov 12 19:45:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9002C3E1B3; Sat, 12 Nov 2016 19:45:56 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 792CE1891; Sat, 12 Nov 2016 19:45:56 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uACJjtEO086737; Sat, 12 Nov 2016 19:45:55 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uACJjtb0086736; Sat, 12 Nov 2016 19:45:55 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201611121945.uACJjtb0086736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sat, 12 Nov 2016 19:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308583 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 19:45:56 -0000 Author: bcr (doc committer) Date: Sat Nov 12 19:45:55 2016 New Revision: 308583 URL: https://svnweb.freebsd.org/changeset/base/308583 Log: Fix a broken link to the USB audio class specs. PR: 214240 Submitted by: Tobias Kortkamp t@tobik.me MFC after: 5 days Modified: head/share/man/man4/snd_uaudio.4 Modified: head/share/man/man4/snd_uaudio.4 ============================================================================== --- head/share/man/man4/snd_uaudio.4 Sat Nov 12 19:26:12 2016 (r308582) +++ head/share/man/man4/snd_uaudio.4 Sat Nov 12 19:45:55 2016 (r308583) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 19, 2015 +.Dd November 12, 2016 .Dt SND_UAUDIO 4 .Os .Sh NAME @@ -73,7 +73,7 @@ for more information. .Xr usb 4 .Rs .%T "USB Audio Class Specifications" -.%U http://www.usb.org/developers/devclass_docs/ +.%U http://www.usb.org/developers/docs/devclass_docs/ .Re .Sh HISTORY The From owner-svn-src-head@freebsd.org Sat Nov 12 20:45:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B0C8C3D2CA; Sat, 12 Nov 2016 20:45:06 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C42AA199A; Sat, 12 Nov 2016 20:45:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uACKj5Bt011163; Sat, 12 Nov 2016 20:45:05 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uACKj3Sk011148; Sat, 12 Nov 2016 20:45:03 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201611122045.uACKj3Sk011148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 12 Nov 2016 20:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308584 - in head/sys: boot/fdt/dts/powerpc dev/dpaa powerpc/conf/dpaa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 20:45:06 -0000 Author: jhibbits Date: Sat Nov 12 20:45:03 2016 New Revision: 308584 URL: https://svnweb.freebsd.org/changeset/base/308584 Log: Make dpaa work with only slightly modified Linux device trees. Linux has a slightly different device tree definition for DPAA than originally done in the FreeBSD driver. This changes the driver to be mostly compatible with the Linux device tree definitions. Currently the differences are: bman-portals: compatible = "fsl,bman-portals" (Linux is "simple-bus") qman-portals: compatible = "fsl,qman-portals" (Linux is "simple-bus") fman: compatible = "fsl,fman" (Linux is "simple-bus") The Linux device tree doesn't specify anything for rgmii in the mdio. This change still requires the device tree to specify the phy-handle, and doesn't yet support tbi. Deleted: head/sys/dev/dpaa/dpaa.c Modified: head/sys/boot/fdt/dts/powerpc/p2041rdb.dts head/sys/boot/fdt/dts/powerpc/p2041si.dtsi head/sys/boot/fdt/dts/powerpc/p3041ds.dts head/sys/boot/fdt/dts/powerpc/p3041si.dtsi head/sys/boot/fdt/dts/powerpc/p5020ds.dts head/sys/boot/fdt/dts/powerpc/p5020si.dtsi head/sys/dev/dpaa/bman_fdt.c head/sys/dev/dpaa/fman.c head/sys/dev/dpaa/fman.h head/sys/dev/dpaa/if_dtsec.c head/sys/dev/dpaa/if_dtsec_fdt.c head/sys/dev/dpaa/if_dtsec_rm.c head/sys/dev/dpaa/qman_fdt.c head/sys/powerpc/conf/dpaa/files.dpaa Modified: head/sys/boot/fdt/dts/powerpc/p2041rdb.dts ============================================================================== --- head/sys/boot/fdt/dts/powerpc/p2041rdb.dts Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/boot/fdt/dts/powerpc/p2041rdb.dts Sat Nov 12 20:45:03 2016 (r308584) @@ -442,47 +442,6 @@ }; }; - fsl,dpaa { - compatible = "fsl,p2041-dpaa", "fsl,dpaa"; - - ethernet@0 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet0>; - status = "okay"; - }; - ethernet@1 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet1>; - status = "okay"; - }; - ethernet@2 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet2>; - status = "okay"; - }; - ethernet@3 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet3>; - status = "okay"; - }; - ethernet@4 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet4>; - status = "okay"; - }; - ethernet@5 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet5>; - status = "okay"; - }; - }; - chosen { stdin = "serial0"; stdout = "serial0"; Modified: head/sys/boot/fdt/dts/powerpc/p2041si.dtsi ============================================================================== --- head/sys/boot/fdt/dts/powerpc/p2041si.dtsi Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/boot/fdt/dts/powerpc/p2041si.dtsi Sat Nov 12 20:45:03 2016 (r308584) @@ -208,7 +208,7 @@ bman-portals@ff4000000 { #address-cells = <0x1>; #size-cells = <0x1>; - compatible = "bman-portals"; + compatible = "fsl,bman-portals"; ranges = <0x0 0xf 0xfde00000 0x200000>; bman-portal@0 { cell-index = <0x0>; @@ -281,7 +281,7 @@ qman-portals@ff4200000 { #address-cells = <0x1>; #size-cells = <0x1>; - compatible = "qman-portals"; + compatible = "fsl,qman-portals"; ranges = <0x0 0xf 0xfdc00000 0x200000>; qportal0: qman-portal@0 { cell-index = <0x0>; @@ -913,8 +913,8 @@ pme: pme@316000 { compatible = "fsl,pme"; reg = <0x316000 0x10000>; - /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ - /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ + /* "fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ + /* "fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ interrupts = <16 2 1 5>; }; @@ -923,16 +923,16 @@ reg = <0x318000 0x1000>; interrupts = <16 2 1 3>; /* Commented out, use default allocation */ - /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ - /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ + /* "fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ + /* "fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ }; bman: bman@31a000 { compatible = "fsl,p2041-bman", "fsl,bman"; reg = <0x31a000 0x1000>; interrupts = <16 2 1 2>; - /* Same as fsl,qman-*, use default allocation */ - /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ + /* Same as "fsl,qman-*, use default allocation */ + /* "fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ }; fman0: fman@400000 { @@ -983,27 +983,27 @@ fman0_rx0: port@88000 { cell-index = <0>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x88000 0x1000>; }; fman0_rx1: port@89000 { cell-index = <1>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x89000 0x1000>; }; fman0_rx2: port@8a000 { cell-index = <2>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8a000 0x1000>; }; fman0_rx3: port@8b000 { cell-index = <3>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8b000 0x1000>; }; fman0_rx4: port@8c000 { cell-index = <4>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8c000 0x1000>; }; fman0_rx5: port@90000 { @@ -1020,31 +1020,31 @@ }; fman0_tx0: port@a8000 { cell-index = <0>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xa8000 0x1000>; fsl,qman-channel-id = <0x41>; }; fman0_tx1: port@a9000 { cell-index = <1>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xa9000 0x1000>; fsl,qman-channel-id = <0x42>; }; fman0_tx2: port@aa000 { cell-index = <2>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xaa000 0x1000>; fsl,qman-channel-id = <0x43>; }; fman0_tx3: port@ab000 { cell-index = <3>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xab000 0x1000>; fsl,qman-channel-id = <0x44>; }; fman0_tx4: port@ac000 { cell-index = <4>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xac000 0x1000>; fsl,qman-channel-id = <0x45>; }; @@ -1093,7 +1093,7 @@ enet0: ethernet@e0000 { cell-index = <0>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe0000 0x1000>; fsl,port-handles = <&fman0_rx0 &fman0_tx0>; }; @@ -1108,7 +1108,7 @@ enet1: ethernet@e2000 { cell-index = <1>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe2000 0x1000>; fsl,port-handles = <&fman0_rx1 &fman0_tx1>; }; @@ -1123,7 +1123,7 @@ enet2: ethernet@e4000 { cell-index = <2>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe4000 0x1000>; fsl,port-handles = <&fman0_rx2 &fman0_tx2>; }; @@ -1138,7 +1138,7 @@ enet3: ethernet@e6000 { cell-index = <3>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe6000 0x1000>; fsl,port-handles = <&fman0_rx3 &fman0_tx3>; }; @@ -1153,7 +1153,7 @@ enet4: ethernet@e8000 { cell-index = <4>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe8000 0x1000>; fsl,port-handles = <&fman0_rx4 &fman0_tx4>; }; @@ -1168,7 +1168,7 @@ enet5: ethernet@f0000 { cell-index = <0>; - compatible = "fsl,p2041-fman-10g-mac", "fsl,fman-10g-mac"; + compatible = "fsl,p2041-fman-10g-mac", "fsl,fman-10g-mac", "fsl,fman-xgec"; reg = <0xf0000 0x1000>; fsl,port-handles = <&fman0_rx5 &fman0_tx5>; }; Modified: head/sys/boot/fdt/dts/powerpc/p3041ds.dts ============================================================================== --- head/sys/boot/fdt/dts/powerpc/p3041ds.dts Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/boot/fdt/dts/powerpc/p3041ds.dts Sat Nov 12 20:45:03 2016 (r308584) @@ -539,47 +539,6 @@ }; }; - fsl,dpaa { - compatible = "fsl,p3041-dpaa", "fsl,dpaa"; - - ethernet@0 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet0>; - status="okay"; - }; - ethernet@1 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet1>; - status = "disabled"; - }; - ethernet@2 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet2>; - status = "disabled"; - }; - ethernet@3 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet3>; - status = "disabled"; - }; - ethernet@4 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet4>; - status = "okay"; - }; - ethernet@5 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet5>; - status = "disabled"; - }; - }; - chosen { stdin = "serial0"; stdout = "serial0"; Modified: head/sys/boot/fdt/dts/powerpc/p3041si.dtsi ============================================================================== --- head/sys/boot/fdt/dts/powerpc/p3041si.dtsi Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/boot/fdt/dts/powerpc/p3041si.dtsi Sat Nov 12 20:45:03 2016 (r308584) @@ -209,7 +209,7 @@ bman-portals@ff4000000 { #address-cells = <0x1>; #size-cells = <0x1>; - compatible = "bman-portals"; + compatible = "fsl,bman-portals"; ranges = <0x0 0xf 0xfde00000 0x200000>; bman-portal@0 { cell-index = <0x0>; @@ -282,7 +282,7 @@ qman-portals@ff4200000 { #address-cells = <0x1>; #size-cells = <0x1>; - compatible = "qman-portals"; + compatible = "fsl,qman-portals"; ranges = <0x0 0xf 0xfdc00000 0x200000>; qportal0: qman-portal@0 { cell-index = <0x0>; @@ -915,8 +915,8 @@ pme: pme@316000 { compatible = "fsl,pme"; reg = <0x316000 0x10000>; - /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ - /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ + /* "fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ + /* "fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ interrupts = <16 2 1 5>; }; @@ -925,16 +925,16 @@ reg = <0x318000 0x1000>; interrupts = <16 2 1 3>; /* Commented out, use default allocation */ - /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ - /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ + /* "fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ + /* "fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ }; bman: bman@31a000 { compatible = "fsl,p3041-bman", "fsl,bman"; reg = <0x31a000 0x1000>; interrupts = <16 2 1 2>; - /* Same as fsl,qman-*, use default allocation */ - /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ + /* Same as "fsl,qman-*, use default allocation */ + /* "fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ }; fman0: fman@400000 { @@ -985,27 +985,27 @@ fman0_rx0: port@88000 { cell-index = <0>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x88000 0x1000>; }; fman0_rx1: port@89000 { cell-index = <1>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x89000 0x1000>; }; fman0_rx2: port@8a000 { cell-index = <2>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8a000 0x1000>; }; fman0_rx3: port@8b000 { cell-index = <3>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8b000 0x1000>; }; fman0_rx4: port@8c000 { cell-index = <4>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8c000 0x1000>; }; fman0_rx5: port@90000 { @@ -1022,31 +1022,31 @@ }; fman0_tx0: port@a8000 { cell-index = <0>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xa8000 0x1000>; fsl,qman-channel-id = <0x41>; }; fman0_tx1: port@a9000 { cell-index = <1>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xa9000 0x1000>; fsl,qman-channel-id = <0x42>; }; fman0_tx2: port@aa000 { cell-index = <2>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xaa000 0x1000>; fsl,qman-channel-id = <0x43>; }; fman0_tx3: port@ab000 { cell-index = <3>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xab000 0x1000>; fsl,qman-channel-id = <0x44>; }; fman0_tx4: port@ac000 { cell-index = <4>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xac000 0x1000>; fsl,qman-channel-id = <0x45>; }; @@ -1095,7 +1095,8 @@ enet0: ethernet@e0000 { cell-index = <0>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p3041-fman-1g-mac", + "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe0000 0x1000>; fsl,port-handles = <&fman0_rx0 &fman0_tx0>; ptimer-handle = <&ptp_timer0>; @@ -1111,7 +1112,8 @@ enet1: ethernet@e2000 { cell-index = <1>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p3041-fman-1g-mac", + "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe2000 0x1000>; fsl,port-handles = <&fman0_rx1 &fman0_tx1>; ptimer-handle = <&ptp_timer0>; @@ -1127,7 +1129,8 @@ enet2: ethernet@e4000 { cell-index = <2>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p3041-fman-1g-mac", + "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe4000 0x1000>; fsl,port-handles = <&fman0_rx2 &fman0_tx2>; ptimer-handle = <&ptp_timer0>; @@ -1143,7 +1146,8 @@ enet3: ethernet@e6000 { cell-index = <3>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p3041-fman-1g-mac", + "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe6000 0x1000>; fsl,port-handles = <&fman0_rx3 &fman0_tx3>; }; @@ -1158,7 +1162,8 @@ enet4: ethernet@e8000 { cell-index = <4>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p3041-fman-1g-mac", + "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe8000 0x1000>; fsl,port-handles = <&fman0_rx4 &fman0_tx4>; ptimer-handle = <&ptp_timer0>; @@ -1174,7 +1179,8 @@ enet5: ethernet@f0000 { cell-index = <0>; - compatible = "fsl,p3041-fman-10g-mac", "fsl,fman-10g-mac"; + compatible = "fsl,p3041-fman-10g-mac", + "fsl,fman-10g-mac", "fsl,fman-xgec"; reg = <0xf0000 0x1000>; fsl,port-handles = <&fman0_rx5 &fman0_tx5>; }; Modified: head/sys/boot/fdt/dts/powerpc/p5020ds.dts ============================================================================== --- head/sys/boot/fdt/dts/powerpc/p5020ds.dts Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/boot/fdt/dts/powerpc/p5020ds.dts Sat Nov 12 20:45:03 2016 (r308584) @@ -535,47 +535,6 @@ }; }; - fsl,dpaa { - compatible = "fsl,p5020-dpaa", "fsl,dpaa"; - - ethernet@0 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet0>; - status = "okay"; - }; - ethernet@1 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet1>; - status = "disabled"; - }; - ethernet@2 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet2>; - status = "disabled"; - }; - ethernet@3 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet3>; - status = "disabled"; - }; - ethernet@4 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet4>; - status = "okay"; - }; - ethernet@5 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet5>; - status = "disabled"; - }; - }; - chosen { stdin = "serial0"; stdout = "serial0"; Modified: head/sys/boot/fdt/dts/powerpc/p5020si.dtsi ============================================================================== --- head/sys/boot/fdt/dts/powerpc/p5020si.dtsi Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/boot/fdt/dts/powerpc/p5020si.dtsi Sat Nov 12 20:45:03 2016 (r308584) @@ -194,7 +194,7 @@ bman-portals@ff4000000 { #address-cells = <0x1>; #size-cells = <0x1>; - compatible = "bman-portals"; + compatible = "fsl,bman-portals"; ranges = <0x0 0xf 0xfde00000 0x200000>; bman-portal@0 { cell-index = <0x0>; @@ -267,7 +267,7 @@ qman-portals@ff4200000 { #address-cells = <0x1>; #size-cells = <0x1>; - compatible = "qman-portals"; + compatible = "fsl,qman-portals"; ranges = <0x0 0xf 0xfdc00000 0x200000>; qportal0: qman-portal@0 { cell-index = <0x0>; @@ -960,8 +960,8 @@ pme: pme@316000 { compatible = "fsl,pme"; reg = <0x316000 0x10000>; - /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ - /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ + /* "fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ + /* "fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ interrupts = <16 2 1 5>; }; @@ -970,16 +970,16 @@ reg = <0x318000 0x1000>; interrupts = <16 2 1 3>; /* Commented out, use default allocation */ - /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ - /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ + /* "fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ + /* "fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ }; bman: bman@31a000 { compatible = "fsl,p5020-bman", "fsl,bman"; reg = <0x31a000 0x1000>; interrupts = <16 2 1 2>; - /* Same as fsl,qman-*, use default allocation */ - /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ + /* Same as "fsl,qman-*, use default allocation */ + /* "fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ }; fman0: fman@400000 { @@ -1030,27 +1030,27 @@ fman0_rx0: port@88000 { cell-index = <0>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x88000 0x1000>; }; fman0_rx1: port@89000 { cell-index = <1>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x89000 0x1000>; }; fman0_rx2: port@8a000 { cell-index = <2>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8a000 0x1000>; }; fman0_rx3: port@8b000 { cell-index = <3>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8b000 0x1000>; }; fman0_rx4: port@8c000 { cell-index = <4>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8c000 0x1000>; }; fman0_rx5: port@90000 { @@ -1067,31 +1067,31 @@ }; fman0_tx0: port@a8000 { cell-index = <0>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xa8000 0x1000>; fsl,qman-channel-id = <0x41>; }; fman0_tx1: port@a9000 { cell-index = <1>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xa9000 0x1000>; fsl,qman-channel-id = <0x42>; }; fman0_tx2: port@aa000 { cell-index = <2>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xaa000 0x1000>; fsl,qman-channel-id = <0x43>; }; fman0_tx3: port@ab000 { cell-index = <3>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xab000 0x1000>; fsl,qman-channel-id = <0x44>; }; fman0_tx4: port@ac000 { cell-index = <4>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xac000 0x1000>; fsl,qman-channel-id = <0x45>; }; @@ -1140,7 +1140,7 @@ enet0: ethernet@e0000 { cell-index = <0>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe0000 0x1000>; fsl,port-handles = <&fman0_rx0 &fman0_tx0>; ptimer-handle = <&ptp_timer0>; @@ -1156,7 +1156,7 @@ enet1: ethernet@e2000 { cell-index = <1>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe2000 0x1000>; fsl,port-handles = <&fman0_rx1 &fman0_tx1>; ptimer-handle = <&ptp_timer0>; @@ -1172,7 +1172,7 @@ enet2: ethernet@e4000 { cell-index = <2>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe4000 0x1000>; fsl,port-handles = <&fman0_rx2 &fman0_tx2>; ptimer-handle = <&ptp_timer0>; @@ -1188,7 +1188,7 @@ enet3: ethernet@e6000 { cell-index = <3>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe6000 0x1000>; fsl,port-handles = <&fman0_rx3 &fman0_tx3>; ptimer-handle = <&ptp_timer0>; @@ -1204,7 +1204,7 @@ enet4: ethernet@e8000 { cell-index = <4>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe8000 0x1000>; fsl,port-handles = <&fman0_rx4 &fman0_tx4>; ptimer-handle = <&ptp_timer0>; @@ -1220,7 +1220,7 @@ enet5: ethernet@f0000 { cell-index = <0>; - compatible = "fsl,p5020-fman-10g-mac", "fsl,fman-10g-mac"; + compatible = "fsl,p5020-fman-10g-mac", "fsl,fman-10g-mac", "fsl,fman-xgec"; reg = <0xf0000 0x1000>; fsl,port-handles = <&fman0_rx5 &fman0_tx5>; }; Modified: head/sys/dev/dpaa/bman_fdt.c ============================================================================== --- head/sys/dev/dpaa/bman_fdt.c Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/bman_fdt.c Sat Nov 12 20:45:03 2016 (r308584) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -105,7 +106,8 @@ static driver_t bm_portals_driver = { }; static devclass_t bm_portals_devclass; -DRIVER_MODULE(bman_portals, ofwbus, bm_portals_driver, bm_portals_devclass, 0, 0); +EARLY_DRIVER_MODULE(bman_portals, ofwbus, bm_portals_driver, + bm_portals_devclass, 0, 0, BUS_PASS_BUS); static void get_addr_props(phandle_t node, uint32_t *addrp, uint32_t *sizep) @@ -121,7 +123,7 @@ static int bman_portals_fdt_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "bman-portals")) + if (!ofw_bus_is_compatible(dev, "fsl,bman-portals")) return (ENXIO); device_set_desc(dev, BMAN_PORT_DEVSTR); @@ -129,6 +131,25 @@ bman_portals_fdt_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +static phandle_t +bman_portal_find_cpu(int cpu) +{ + phandle_t node; + pcell_t reg; + + node = OF_finddevice("/cpus"); + if (node == -1) + return (node); + + for (node = OF_child(node); node != 0; node = OF_peer(node)) { + if (OF_getprop(node, "reg", ®, sizeof(reg)) <= 0) + continue; + if (reg == cpu) + return (node); + } + return (-1); +} + static int bman_portals_fdt_attach(device_t dev) { @@ -152,13 +173,17 @@ bman_portals_fdt_attach(device_t dev) /* Find portals tied to CPUs */ for (child = OF_child(node); child != 0; child = OF_peer(child)) { + if (cpus >= mp_ncpus) + break; if (!ofw_bus_node_is_compatible(child, "fsl,bman-portal")) { continue; } /* Checkout related cpu */ if (OF_getprop(child, "cpu-handle", (void *)&cpu, sizeof(cpu)) <= 0) { - continue; + cpu = bman_portal_find_cpu(cpus); + if (cpu <= 0) + continue; } /* Acquire cpu number */ cpu_node = OF_instance_to_package(cpu); @@ -169,9 +194,6 @@ bman_portals_fdt_attach(device_t dev) cpus++; - if (cpus > MAXCPU) - break; - if (ofw_bus_gen_setup_devinfo(&ofw_di, child) != 0) { device_printf(dev, "could not set up devinfo\n"); continue; Modified: head/sys/dev/dpaa/fman.c ============================================================================== --- head/sys/dev/dpaa/fman.c Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/fman.c Sat Nov 12 20:45:03 2016 (r308584) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -50,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include "fman.h" +static MALLOC_DEFINE(M_FMAN, "fman", "fman devices information"); + /** * @group FMan private defines. * @{ @@ -259,6 +260,8 @@ fman_attach(device_t dev) { struct fman_softc *sc; struct fman_config cfg; + pcell_t qchan_range[2]; + phandle_t node; sc = device_get_softc(dev); sc->sc_base.dev = dev; @@ -272,6 +275,14 @@ fman_attach(device_t dev) XX_TrackInit(); + node = ofw_bus_get_node(dev); + if (OF_getencprop(node, "fsl,qman-channel-range", qchan_range, + sizeof(qchan_range)) <= 0) { + device_printf(dev, "Missing QMan channel range property!\n"); + return (ENXIO); + } + sc->qman_chan_base = qchan_range[0]; + sc->qman_chan_count = qchan_range[1]; sc->mem_rid = 0; sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, RF_ACTIVE | RF_SHAREABLE); @@ -379,4 +390,21 @@ fman_shutdown(device_t dev) return (0); } +int +fman_qman_channel_id(device_t dev, int port) +{ + struct fman_softc *sc; + int qman_port_id[] = {0x31, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, + 0x2f, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->qman_chan_count; i++) { + if (qman_port_id[i] == port) + return (sc->qman_chan_base + i); + } + + return (0); +} + /** @} */ Modified: head/sys/dev/dpaa/fman.h ============================================================================== --- head/sys/dev/dpaa/fman.h Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/fman.h Sat Nov 12 20:45:03 2016 (r308584) @@ -42,6 +42,8 @@ struct fman_softc { int mem_rid; int irq_rid; int err_irq_rid; + int qman_chan_base; + int qman_chan_count; t_Handle fm_handle; t_Handle muram_handle; @@ -59,6 +61,7 @@ int fman_resume(device_t dev); int fman_shutdown(device_t dev); int fman_read_ivar(device_t dev, device_t child, int index, uintptr_t *result); +int fman_qman_channel_id(device_t, int); /** @} */ uint32_t fman_get_clock(struct fman_softc *sc); Modified: head/sys/dev/dpaa/if_dtsec.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec.c Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/if_dtsec.c Sat Nov 12 20:45:03 2016 (r308584) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/sys/dev/dpaa/if_dtsec_fdt.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec_fdt.c Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/if_dtsec_fdt.c Sat Nov 12 20:45:03 2016 (r308584) @@ -87,7 +87,7 @@ static driver_t dtsec_driver = { }; static devclass_t dtsec_devclass; -DRIVER_MODULE(dtsec, dpaa, dtsec_driver, dtsec_devclass, 0, 0); +DRIVER_MODULE(dtsec, fman, dtsec_driver, dtsec_devclass, 0, 0); DRIVER_MODULE(miibus, dtsec, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(dtsec, ether, 1, 1, 1); MODULE_DEPEND(dtsec, miibus, 1, 1, 1); @@ -96,7 +96,8 @@ static int dtsec_fdt_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "fsl,dpa-ethernet")) + if (!ofw_bus_is_compatible(dev, "fsl,fman-dtsec") && + !ofw_bus_is_compatible(dev, "fsl,fman-xgec")) return (ENXIO); device_set_desc(dev, "Freescale Data Path Triple Speed Ethernet " @@ -119,9 +120,7 @@ find_mdio(phandle_t phy_node, device_t m if (phy_node <= 0) return (ENOENT); - if (fman_get_dev(&bus) < 0) - return (ENOENT); - + bus = device_get_parent(mac); *mdio_dev = ofw_bus_find_child_device_by_phandle(bus, phy_node); return (0); @@ -131,21 +130,13 @@ static int dtsec_fdt_attach(device_t dev) { struct dtsec_softc *sc; - phandle_t node, enet_node, phy_node; + phandle_t enet_node, phy_node; phandle_t fman_rxtx_node[2]; char phy_type[6]; + pcell_t fman_tx_cell; sc = device_get_softc(dev); - node = ofw_bus_get_node(dev); - - if (OF_getprop(node, "fsl,fman-mac", (void *)&enet_node, - sizeof(enet_node)) == -1) { - device_printf(dev, "Could not load fsl,fman-mac property " - "from DTS\n"); - return (ENXIO); - } - - enet_node = OF_instance_to_package(enet_node); + enet_node = ofw_bus_get_node(dev); if (OF_getprop(enet_node, "local-mac-address", (void *)sc->sc_mac_addr, 6) == -1) { @@ -155,9 +146,9 @@ dtsec_fdt_attach(device_t dev) } /* Get link speed */ - if (ofw_bus_node_is_compatible(enet_node, "fsl,fman-1g-mac") != 0) + if (ofw_bus_is_compatible(dev, "fsl,fman-dtsec") != 0) sc->sc_eth_dev_type = ETH_DTSEC; - else if (ofw_bus_node_is_compatible(enet_node, "fsl,fman-10g-mac") != 0) + else if (ofw_bus_is_compatible(dev, "fsl,fman-xgec") != 0) sc->sc_eth_dev_type = ETH_10GSEC; else return(ENXIO); @@ -197,7 +188,7 @@ dtsec_fdt_attach(device_t dev) return (ENXIO); /* Get RX/TX port handles */ - if (OF_getprop(enet_node, "fsl,port-handles", (void *)fman_rxtx_node, + if (OF_getprop(enet_node, "fsl,fman-ports", (void *)fman_rxtx_node, sizeof(fman_rxtx_node)) <= 0) return (ENXIO); @@ -211,11 +202,11 @@ dtsec_fdt_attach(device_t dev) fman_rxtx_node[1] = OF_instance_to_package(fman_rxtx_node[1]); if (ofw_bus_node_is_compatible(fman_rxtx_node[0], - "fsl,fman-port-1g-rx") == 0) + "fsl,fman-v2-port-rx") == 0) return (ENXIO); if (ofw_bus_node_is_compatible(fman_rxtx_node[1], - "fsl,fman-port-1g-tx") == 0) + "fsl,fman-v2-port-tx") == 0) return (ENXIO); /* Get RX port HW id */ @@ -228,11 +219,12 @@ dtsec_fdt_attach(device_t dev) sizeof(sc->sc_port_tx_hw_id)) <= 0) return (ENXIO); - /* Get QMan channel */ - if (OF_getprop(fman_rxtx_node[1], "fsl,qman-channel-id", - (void *)&sc->sc_port_tx_qman_chan, - sizeof(sc->sc_port_tx_qman_chan)) <= 0) + if (OF_getprop(fman_rxtx_node[1], "cell-index", &fman_tx_cell, + sizeof(fman_tx_cell)) <= 0) return (ENXIO); + /* Get QMan channel */ + sc->sc_port_tx_qman_chan = fman_qman_channel_id(device_get_parent(dev), + fman_tx_cell); return (dtsec_attach(dev)); } Modified: head/sys/dev/dpaa/if_dtsec_rm.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec_rm.c Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/if_dtsec_rm.c Sat Nov 12 20:45:03 2016 (r308584) @@ -323,6 +323,7 @@ dtsec_rm_pool_rx_init(struct dtsec_softc DTSEC_RM_POOL_RX_HIGH_MARK, 0, 0, dtsec_rm_pool_rx_depleted, sc, NULL, NULL); if (sc->sc_rx_pool == NULL) { + device_printf(sc->sc_dev, "NULL rx pool somehow\n"); dtsec_rm_pool_rx_free(sc); return (EIO); } Modified: head/sys/dev/dpaa/qman_fdt.c ============================================================================== --- head/sys/dev/dpaa/qman_fdt.c Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/qman_fdt.c Sat Nov 12 20:45:03 2016 (r308584) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -105,7 +106,8 @@ static driver_t qm_portals_driver = { }; static devclass_t qm_portals_devclass; -DRIVER_MODULE(qman_portals, ofwbus, qm_portals_driver, qm_portals_devclass, 0, 0); +EARLY_DRIVER_MODULE(qman_portals, ofwbus, qm_portals_driver, + qm_portals_devclass, 0, 0, BUS_PASS_BUS); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Nov 12 23:19:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58E5AC3D20D; Sat, 12 Nov 2016 23:19:15 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D577137A; Sat, 12 Nov 2016 23:19:15 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x242.google.com with SMTP id q124so4647112itd.1; Sat, 12 Nov 2016 15:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=togl0GepTOhWHt9ilkIHEOCvaE9N0xy0dgRHCW9586o=; b=Ne7aQQLV4kAIkQHCWn5KYtMKVHgZs9F0xuYQtfTmthESeffa4lpMkr/AADx8qIKct2 kKxqmEnr8hupkcenx6XQuetE/PZLkVmf95TAVUYk+5IiVsVKQeYxpW36Sd5FPcL2GRKa ER+29HJyNfxPJYYIbpZnEPG7clXVOrmCZi6YO+3Z0vlFgG2kpWY8UbUYNpdg9KVzybHs iCRMKIn2YotAO2DmIvlI8cgD3TTrtqOibjnhFhhph/D/XjJM5ve2ec2BeLbn2KcZud6w e+mq8sZQzbu7v41WzrgpE9i2Qcnf5B7bcjZwwLRl2ktoURoqoDGxyb7rwr79BQYdafmT sXTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=togl0GepTOhWHt9ilkIHEOCvaE9N0xy0dgRHCW9586o=; b=gR1DO+3r1qPDma4Ii84LlZ12yMbUcb+gu9gVk/Eyh+OA0XGjqhsAgnbbr4LOJ2aNS3 n8ZBAu8v0GhtZ7eaLMy1uIolGBbWN3c2uMNL+T9GP9kVCWKHsuWzISKgb3hSzoWPXsp+ RkghxQzfac1YVH587qjbJ6zMSVoCTrX9zLkrQF/kWVcsZLW0hfGePi2hQrUKRvOXVViu tnJMAWrJdCtcD3LFysepJRVbfUxIQiWr81yN2s5fGQMIxYTWUTTF1kBriQvpcBQw0n/4 sGHocGm/emXQun8gToJxNmt85POUBSUx8Q7rTCXyVyp+i7dRFph9JjbQ0Vul6SbJWVFm 1QlA== X-Gm-Message-State: ABUngveT8Enh2t0Kp2vFcoQgrl0+Chap0P19KqCZM4CWT30ZPfY0Or+x8EyHoXlsUUzKntkdPT99ByLO4tEryg== X-Received: by 10.107.174.157 with SMTP id n29mr14027616ioo.177.1478992753897; Sat, 12 Nov 2016 15:19:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Sat, 12 Nov 2016 15:19:13 -0800 (PST) In-Reply-To: <201610191109.u9JB9TTC002727@repo.freebsd.org> References: <201610191109.u9JB9TTC002727@repo.freebsd.org> From: Adrian Chadd Date: Sat, 12 Nov 2016 15:19:13 -0800 Message-ID: Subject: Re: svn commit: r307626 - head/sys/ufs/ffs To: Konstantin Belousov , "freebsd-mips@freebsd.org" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 23:19:15 -0000 hi! This broke freebsd on mips24k. BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x4002a4 got a read fault (type 0x2) at 0 Trapframe Register Dump: zero: 0 at: 0 v0: 0 v1: 0 a0: 0x7fffeecc a1: 0 a2: 0 a3: 0 t0: 0 t1: 0 t2: 0 t3: 0 t4: 0 t5: 0 t6: 0 t7: 0 t8: 0 t9: 0x400260 s0: 0x10 s1: 0x2 s2: 0x7fffeed0 s3: 0 s4: 0 s5: 0 s6: 0 s7: 0 k0: 0 k1: 0 gp: 0x4d55d0 sp: 0x7ffeee90 s8: 0 ra: 0 sr: 0xfc13 mullo: 0 mulhi: 0 badvaddr: 0 cause: 0x8 pc: 0x4002a4 Page table info for pc address 0x4002a4: pde = 0x809be000, pte = 0xa001acda Dumping 4 words starting at pc address 0x4002a4: 8c420000 14400003 00908021 8f828024 Page table info for bad address 0: pde = 0, pte = 0 .. and yes, I've spent three days bisecting everything to get to this particular commit. -adrian On 19 October 2016 at 04:09, Konstantin Belousov wrote: > Author: kib > Date: Wed Oct 19 11:09:29 2016 > New Revision: 307626 > URL: https://svnweb.freebsd.org/changeset/base/307626 > > Log: > Add FFS pager, which uses buffer cache read operation to validate pages. > See the comments for more detailed description of the algorithm. > > The pager is used unconditionally when the block size of the > underlying device is larger than the machine page size, since local > vnode pager cannot handle the configuration [1]. Otherwise, the > vfs.ffs.use_buf_pager sysctl allows to switch to the local pager. > > Measurements demonstrated no regression in the ever-important > buildworld benchmark, and small (~5%) throughput improvements in the > special microbenchmark configuration for dbench over swap-backed > md(4). > > Code can be generalized and reused for other filesystems which use > buffer cache. > > Reported by: Anton Yuzhaninov [1] > Tested by: pho > Benchmarked by: mjg, pho > Reviewed by: alc, markj, mckusick (previous version) > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Differential revision: https://reviews.freebsd.org/D8198 > > Modified: > head/sys/ufs/ffs/ffs_vnops.c > > Modified: head/sys/ufs/ffs/ffs_vnops.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_vnops.c Wed Oct 19 10:01:04 2016 (r307625) > +++ head/sys/ufs/ffs/ffs_vnops.c Wed Oct 19 11:09:29 2016 (r307626) > @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > > @@ -86,6 +87,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > > #include > @@ -102,8 +104,9 @@ __FBSDID("$FreeBSD$"); > #ifdef DIRECTIO > extern int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone); > #endif > -static vop_fsync_t ffs_fsync; > static vop_fdatasync_t ffs_fdatasync; > +static vop_fsync_t ffs_fsync; > +static vop_getpages_t ffs_getpages; > static vop_lock1_t ffs_lock; > static vop_read_t ffs_read; > static vop_write_t ffs_write; > @@ -119,13 +122,12 @@ static vop_openextattr_t ffs_openextattr > static vop_setextattr_t ffs_setextattr; > static vop_vptofh_t ffs_vptofh; > > - > /* Global vfs data structures for ufs. */ > struct vop_vector ffs_vnodeops1 = { > .vop_default = &ufs_vnodeops, > .vop_fsync = ffs_fsync, > .vop_fdatasync = ffs_fdatasync, > - .vop_getpages = vnode_pager_local_getpages, > + .vop_getpages = ffs_getpages, > .vop_getpages_async = vnode_pager_local_getpages_async, > .vop_lock1 = ffs_lock, > .vop_read = ffs_read, > @@ -147,7 +149,7 @@ struct vop_vector ffs_vnodeops2 = { > .vop_default = &ufs_vnodeops, > .vop_fsync = ffs_fsync, > .vop_fdatasync = ffs_fdatasync, > - .vop_getpages = vnode_pager_local_getpages, > + .vop_getpages = ffs_getpages, > .vop_getpages_async = vnode_pager_local_getpages_async, > .vop_lock1 = ffs_lock, > .vop_read = ffs_read, > @@ -1784,3 +1786,165 @@ vop_vptofh { > ufhp->ufid_gen = ip->i_gen; > return (0); > } > + > +SYSCTL_DECL(_vfs_ffs); > +static int use_buf_pager = 1; > +SYSCTL_INT(_vfs_ffs, OID_AUTO, use_buf_pager, CTLFLAG_RWTUN, &use_buf_pager, 0, > + "Always use buffer pager instead of bmap"); > +static int buf_pager_relbuf; > +SYSCTL_INT(_vfs_ffs, OID_AUTO, buf_pager_relbuf, CTLFLAG_RWTUN, > + &buf_pager_relbuf, 0, > + "Make buffer pager release buffers after reading"); > + > +/* > + * The FFS pager. It uses buffer reads to validate pages. > + * > + * In contrast to the generic local pager from vm/vnode_pager.c, this > + * pager correctly and easily handles volumes where the underlying > + * device block size is greater than the machine page size. The > + * buffer cache transparently extends the requested page run to be > + * aligned at the block boundary, and does the necessary bogus page > + * replacements in the addends to avoid obliterating already valid > + * pages. > + * > + * The only non-trivial issue is that the exclusive busy state for > + * pages, which is assumed by the vm_pager_getpages() interface, is > + * incompatible with the VMIO buffer cache's desire to share-busy the > + * pages. This function performs a trivial downgrade of the pages' > + * state before reading buffers, and a less trivial upgrade from the > + * shared-busy to excl-busy state after the read. > + */ > +static int > +ffs_getpages(struct vop_getpages_args *ap) > +{ > + struct vnode *vp; > + vm_page_t *ma, m; > + vm_object_t object; > + struct buf *bp; > + struct ufsmount *um; > + ufs_lbn_t lbn, lbnp; > + vm_ooffset_t la, lb; > + long bsize; > + int bo_bs, count, error, i; > + bool redo, lpart; > + > + vp = ap->a_vp; > + ma = ap->a_m; > + count = ap->a_count; > + > + um = VFSTOUFS(ap->a_vp->v_mount); > + bo_bs = um->um_devvp->v_bufobj.bo_bsize; > + if (!use_buf_pager && bo_bs <= PAGE_SIZE) > + return (vnode_pager_generic_getpages(vp, ma, count, > + ap->a_rbehind, ap->a_rahead, NULL, NULL)); > + > + object = vp->v_object; > + la = IDX_TO_OFF(ma[count - 1]->pindex); > + if (la >= object->un_pager.vnp.vnp_size) > + return (VM_PAGER_BAD); > + lpart = la + PAGE_SIZE > object->un_pager.vnp.vnp_size; > + if (ap->a_rbehind != NULL) { > + lb = IDX_TO_OFF(ma[0]->pindex); > + *ap->a_rbehind = OFF_TO_IDX(lb - rounddown2(lb, bo_bs)); > + } > + if (ap->a_rahead != NULL) { > + *ap->a_rahead = OFF_TO_IDX(roundup2(la, bo_bs) - la); > + if (la + IDX_TO_OFF(*ap->a_rahead) >= > + object->un_pager.vnp.vnp_size) { > + *ap->a_rahead = OFF_TO_IDX(roundup2(object->un_pager. > + vnp.vnp_size, PAGE_SIZE) - la); > + } > + } > + VM_OBJECT_WLOCK(object); > +again: > + for (i = 0; i < count; i++) > + vm_page_busy_downgrade(ma[i]); > + VM_OBJECT_WUNLOCK(object); > + > + lbnp = -1; > + for (i = 0; i < count; i++) { > + m = ma[i]; > + > + /* > + * Pages are shared busy and the object lock is not > + * owned, which together allow for the pages' > + * invalidation. The racy test for validity avoids > + * useless creation of the buffer for the most typical > + * case when invalidation is not used in redo or for > + * parallel read. The shared->excl upgrade loop at > + * the end of the function catches the race in a > + * reliable way (protected by the object lock). > + */ > + if (m->valid == VM_PAGE_BITS_ALL) > + continue; > + > + lbn = lblkno(um->um_fs, IDX_TO_OFF(m->pindex)); > + if (lbn != lbnp) { > + bsize = blksize(um->um_fs, VTOI(vp), lbn); > + error = bread_gb(vp, lbn, bsize, NOCRED, GB_UNMAPPED, > + &bp); > + if (error != 0) > + break; > + KASSERT(1 /* racy, enable for debugging */ || > + m->valid == VM_PAGE_BITS_ALL || i == count - 1, > + ("buf %d %p invalid", i, m)); > + if (i == count - 1 && lpart) { > + VM_OBJECT_WLOCK(object); > + if (m->valid != 0 && > + m->valid != VM_PAGE_BITS_ALL) > + vm_page_zero_invalid(m, TRUE); > + VM_OBJECT_WUNLOCK(object); > + } > + if (LIST_EMPTY(&bp->b_dep)) { > + /* > + * Invalidation clears m->valid, but > + * may leave B_CACHE flag if the > + * buffer existed at the invalidation > + * time. In this case, recycle the > + * buffer to do real read on next > + * bread() after redo. > + * > + * Otherwise B_RELBUF is not strictly > + * necessary, enable to reduce buf > + * cache pressure. > + */ > + if (buf_pager_relbuf || > + m->valid != VM_PAGE_BITS_ALL) > + bp->b_flags |= B_RELBUF; > + > + bp->b_flags &= ~B_NOCACHE; > + brelse(bp); > + } else { > + bqrelse(bp); > + } > + lbnp = lbn; > + } > + } > + > + VM_OBJECT_WLOCK(object); > + redo = false; > + for (i = 0; i < count; i++) { > + vm_page_sunbusy(ma[i]); > + ma[i] = vm_page_grab(object, ma[i]->pindex, VM_ALLOC_NORMAL); > + > + /* > + * Since the pages were only sbusy while neither the > + * buffer nor the object lock was held by us, or > + * reallocated while vm_page_grab() slept for busy > + * relinguish, they could have been invalidated. > + * Recheck the valid bits and re-read as needed. > + * > + * Note that the last page is made fully valid in the > + * read loop, and partial validity for the page at > + * index count - 1 could mean that the page was > + * invalidated or removed, so we must restart for > + * safety as well. > + */ > + if (ma[i]->valid != VM_PAGE_BITS_ALL) > + redo = true; > + } > + if (redo && error == 0) > + goto again; > + VM_OBJECT_WUNLOCK(object); > + return (error != 0 ? VM_PAGER_ERROR : VM_PAGER_OK); > +} >