From owner-svn-src-head@freebsd.org Sun Aug 23 01:17:53 2015 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 46A719BF729; Sun, 23 Aug 2015 01:17:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 1AE3C1F25; Sun, 23 Aug 2015 01:17:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7N1HqNl017110; Sun, 23 Aug 2015 01:17:52 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7N1Hqj8017109; Sun, 23 Aug 2015 01:17:52 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508230117.t7N1Hqj8017109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 23 Aug 2015 01:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287029 - 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.20 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, 23 Aug 2015 01:17:53 -0000 Author: adrian Date: Sun Aug 23 01:17:52 2015 New Revision: 287029 URL: https://svnweb.freebsd.org/changeset/base/287029 Log: Reset the channel to the first available channel if the interface is configured on a channel that isn't valid in the new operating mode. This isn't strictly true - it should find the first channel that is available for the given operating mode. However, I think defaulting to the first channel is fine - it's typically available for all modes. If someone would like to correctly implement this feature - try to find a channel that is valid for the given operating mode and error out if we can't find one. This prevents various NICs (eg wpi(4)) from throwing a firmware error. Tested: * ath(4), STA/AP mode * iwn(4), STA/adhoc mode PR: kern/202502 Submitted by: Andriy Voskoboinyk Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Sat Aug 22 23:09:19 2015 (r287028) +++ head/sys/net80211/ieee80211_proto.c Sun Aug 23 01:17:52 2015 (r287029) @@ -1215,6 +1215,41 @@ ieee80211_waitfor_parent(struct ieee8021 } /* + * Check to see whether the current channel needs reset. + * + * Some devices don't handle being given an invalid channel + * in their operating mode very well (eg wpi(4) will throw a + * firmware exception.) + * + * Return 0 if we're ok, 1 if the channel needs to be reset. + * + * See PR kern/202502. + */ +static int +ieee80211_start_check_reset_chan(struct ieee80211vap *vap) +{ + struct ieee80211com *ic = vap->iv_ic; + + if ((vap->iv_opmode == IEEE80211_M_IBSS && + IEEE80211_IS_CHAN_NOADHOC(ic->ic_curchan)) || + (vap->iv_opmode == IEEE80211_M_HOSTAP && + IEEE80211_IS_CHAN_NOHOSTAP(ic->ic_curchan))) + return (1); + return (0); +} + +/* + * Reset the curchan to a known good state. + */ +static void +ieee80211_start_reset_chan(struct ieee80211vap *vap) +{ + struct ieee80211com *ic = vap->iv_ic; + + ic->ic_curchan = &ic->ic_channels[0]; +} + +/* * Start a vap running. If this is the first vap to be * set running on the underlying device then we * automatically bring the device up. @@ -1248,6 +1283,11 @@ ieee80211_start_locked(struct ieee80211v */ if (ic->ic_nrunning++ == 0 && (parent->if_drv_flags & IFF_DRV_RUNNING) == 0) { + + /* reset the channel to a known good channel */ + if (ieee80211_start_check_reset_chan(vap)) + ieee80211_start_reset_chan(vap); + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, "%s: up parent %s\n", __func__, parent->if_xname); From owner-svn-src-head@freebsd.org Sun Aug 23 08:22:01 2015 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 9F16D9BF7AE; Sun, 23 Aug 2015 08:22:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8DD95170B; Sun, 23 Aug 2015 08:22:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7N8M1FY096670; Sun, 23 Aug 2015 08:22:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7N8M1rf096669; Sun, 23 Aug 2015 08:22:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508230822.t7N8M1rf096669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 23 Aug 2015 08:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287030 - head/usr.bin/whois 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.20 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, 23 Aug 2015 08:22:01 -0000 Author: delphij Date: Sun Aug 23 08:22:00 2015 New Revision: 287030 URL: https://svnweb.freebsd.org/changeset/base/287030 Log: Although the website [1] says US-ASCII is accepted, ISO-8859-1 seems to be the only accepted character that is close enough to US-ASCII (and this is also done on OpenBSD; the alternative would be to use UTF-8). [1] http://www.denic.de/en/domains/technik/denic_whois-server/index.html MFC after: 2 weeks Modified: head/usr.bin/whois/whois.c Modified: head/usr.bin/whois/whois.c ============================================================================== --- head/usr.bin/whois/whois.c Sun Aug 23 01:17:52 2015 (r287029) +++ head/usr.bin/whois/whois.c Sun Aug 23 08:22:00 2015 (r287030) @@ -454,7 +454,7 @@ done: if (fp == NULL) err(EX_OSERR, "fdopen()"); if (strcmp(hostname, GERMNICHOST) == 0) { - fprintf(fp, "-T dn,ace -C US-ASCII %s\r\n", query); + fprintf(fp, "-T dn,ace -C ISO-8859-1 %s\r\n", query); } else if (strcmp(hostname, "dk" QNICHOST_TAIL) == 0) { fprintf(fp, "--show-handles %s\r\n", query); } else { From owner-svn-src-head@freebsd.org Sun Aug 23 13:18:57 2015 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 4FCD09C011E; Sun, 23 Aug 2015 13:18:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 405E41391; Sun, 23 Aug 2015 13:18:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7NDIvXs016049; Sun, 23 Aug 2015 13:18:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7NDIvpk016048; Sun, 23 Aug 2015 13:18:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508231318.t7NDIvpk016048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 23 Aug 2015 13:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287031 - head/sys/arm64/arm64 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.20 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, 23 Aug 2015 13:18:57 -0000 Author: andrew Date: Sun Aug 23 13:18:56 2015 New Revision: 287031 URL: https://svnweb.freebsd.org/changeset/base/287031 Log: Handle the breakpoint instruction in userland by sending a SIGTRAP signal. Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Sun Aug 23 08:22:00 2015 (r287030) +++ head/sys/arm64/arm64/trap.c Sun Aug 23 13:18:56 2015 (r287031) @@ -327,6 +327,7 @@ el0_excp_unknown(struct trapframe *frame void do_el0_sync(struct trapframe *frame) { + struct thread *td; uint32_t exception; uint64_t esr; @@ -368,6 +369,11 @@ do_el0_sync(struct trapframe *frame) case EXCP_UNKNOWN: el0_excp_unknown(frame); break; + case EXCP_BRK: + td = curthread; + call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_elr); + userret(td, frame); + break; default: print_registers(frame); panic("Unknown userland exception %x esr_el1 %lx\n", exception, From owner-svn-src-head@freebsd.org Sun Aug 23 13:51:07 2015 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 75A219C05EE; Sun, 23 Aug 2015 13:51:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5F03B1ED0; Sun, 23 Aug 2015 13:51:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7NDp7ux031198; Sun, 23 Aug 2015 13:51:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7NDp7Hf031197; Sun, 23 Aug 2015 13:51:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508231351.t7NDp7Hf031197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 23 Aug 2015 13:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287032 - head/share/man/man5 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.20 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, 23 Aug 2015 13:51:07 -0000 Author: trasz Date: Sun Aug 23 13:51:06 2015 New Revision: 287032 URL: https://svnweb.freebsd.org/changeset/base/287032 Log: Tweak the "rctl_enable" description to not give the impression of being disabled by default. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sun Aug 23 13:18:56 2015 (r287031) +++ head/share/man/man5/rc.conf.5 Sun Aug 23 13:51:06 2015 (r287032) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 20, 2015 +.Dd August 23, 2015 .Dt RC.CONF 5 .Os .Sh NAME @@ -4442,9 +4442,9 @@ polled at a 1-second interval. The default is 30. .It Va rctl_enable .Pq Vt bool -Set to -.Dq Li YES -to load +If set to +.Dq Li YES , +load .Xr rctl 8 rules from the defined ruleset. The kernel must be built with From owner-svn-src-head@freebsd.org Sun Aug 23 13:53:22 2015 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 341809C06A2; Sun, 23 Aug 2015 13:53:22 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (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 BE48134D; Sun, 23 Aug 2015 13:53:21 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by wicne3 with SMTP id ne3so50546713wic.0; Sun, 23 Aug 2015 06:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=KoO7HZKI6XTjq8N67UL0gJ6WHG+HdWLfQ7kweNESo6E=; b=vQ0/lUd7bPSgUWA7/H68FSuG8ul1vWzSdYvPtQerW6f31B3h4t+Xr5sO8GOo5JTJae aF3k9OmhxFlWD5wbLry3B6EdGrLgWs2GlUS8qcH3LidQtZaeP/AbX8wrz28JK/AWUpBO +ioGVApKM3EAjMuSZY45RHJ4LwZVA5a8iTWN5MaI54JiPJNn4Y1C4Kuc/vw3wM+FTiYO zR8+t9gglAbEtjK6tnGA6a1KZVRWweyz2Y6vz0Zwo3s53Qa6VVdYKuAv/EFzpHlttMjy qZkISgpCaWN03Zap+sFMS2xq97gVHqIAH+Ik6Rv+zsbTtvWn20sAZnvaxBEhFxI0uKmj D4DA== X-Received: by 10.180.105.234 with SMTP id gp10mr21145817wib.40.1440338000210; Sun, 23 Aug 2015 06:53:20 -0700 (PDT) Received: from brick.home (adik184.neoplus.adsl.tpnet.pl. [79.184.192.184]) by smtp.gmail.com with ESMTPSA id y15sm11734448wib.7.2015.08.23.06.53.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Aug 2015 06:53:18 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sun, 23 Aug 2015 15:31:48 +0200 From: Edward Tomasz Napierala To: Dmitry Sivachenko Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286329 - in head/etc: defaults rc.d Message-ID: <20150823133148.GB9866@brick.home> Mail-Followup-To: Dmitry Sivachenko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201508051738.t75Hc2MP038354@repo.freebsd.org> <92FC24C2-8B61-4B02-87E0-D4C6D4DA8ECF@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <92FC24C2-8B61-4B02-87E0-D4C6D4DA8ECF@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 23 Aug 2015 13:53:22 -0000 On 0806T1152, Dmitry Sivachenko wrote: > > > On 5 авг. 2015 г., at 20:38, Edward Tomasz Napierala wrote: > > > > Author: trasz > > Date: Wed Aug 5 17:38:02 2015 > > New Revision: 286329 > > URL: https://svnweb.freebsd.org/changeset/base/286329 > > > > Log: > > Make rctl_enable rc variable actually work. To avoid breaking existing > > setups that worked before, flip the default to "YES". Most people don't > > have /etc/rctl.conf, so they won't be affected in any way. > > > > MFC after: 1 month > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/etc/defaults/rc.conf > > head/etc/rc.d/rctl > > > > Modified: head/etc/defaults/rc.conf > > ============================================================================== > > --- head/etc/defaults/rc.conf Wed Aug 5 17:21:42 2015 (r286328) > > +++ head/etc/defaults/rc.conf Wed Aug 5 17:38:02 2015 (r286329) > > @@ -664,7 +664,7 @@ opensm_enable="NO" # Opensm(8) for infin > > casperd_enable="YES" # casperd(8) daemon > > > > # rctl(8) requires kernel options RACCT and RCTL > > -rctl_enable="NO" # Load rctl(8) rules on boot > > +rctl_enable="YES" # Load rctl(8) rules on boot > > > Sad to see that rarely used feature has default as "YES". Requiring users to enable it in rc.conf would break existing setups, but it's also that it doesn't make much sense, IMHO. The etc/rc.d/rctl script was modeled after etc/rc.d/sysctl, and sysctl doesn't have the enable knob either. > PS: Please adjust rc.conf(5) accordingly, it assumes the default is NO. Done. From owner-svn-src-head@freebsd.org Sun Aug 23 14:53:56 2015 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 0F3FB9C017A; Sun, 23 Aug 2015 14:53:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 DA0FC164; Sun, 23 Aug 2015 14:53:55 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7NErtFL056840; Sun, 23 Aug 2015 14:53:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7NErtw9056836; Sun, 23 Aug 2015 14:53:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508231453.t7NErtw9056836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 23 Aug 2015 14:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287033 - in head/sys: fs/devfs kern 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.20 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, 23 Aug 2015 14:53:56 -0000 Author: trasz Date: Sun Aug 23 14:53:54 2015 New Revision: 287033 URL: https://svnweb.freebsd.org/changeset/base/287033 Log: After r286237 it should be fine to call vgone(9) on a busy GEOM vnode; remove KASSERT that would prevent forced devfs unmount from working. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Sun Aug 23 13:51:06 2015 (r287032) +++ head/sys/fs/devfs/devfs_vnops.c Sun Aug 23 14:53:54 2015 (r287033) @@ -65,6 +65,7 @@ #include static struct vop_vector devfs_vnodeops; +static struct vop_vector devfs_specops; static struct fileops devfs_ops_f; #include @@ -1862,7 +1863,7 @@ static struct vop_vector devfs_vnodeops .vop_vptocnp = devfs_vptocnp, }; -struct vop_vector devfs_specops = { +static struct vop_vector devfs_specops = { .vop_default = &default_vnodeops, .vop_access = devfs_access, Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Aug 23 13:51:06 2015 (r287032) +++ head/sys/kern/vfs_subr.c Sun Aug 23 14:53:54 2015 (r287033) @@ -2709,10 +2709,6 @@ loop: * If FORCECLOSE is set, forcibly close the vnode. */ if (vp->v_usecount == 0 || (flags & FORCECLOSE)) { - VNASSERT(vp->v_usecount == 0 || - vp->v_op != &devfs_specops || - (vp->v_type != VCHR && vp->v_type != VBLK), vp, - ("device VNODE %p is FORCECLOSED", vp)); vgonel(vp); } else { busy++; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Aug 23 13:51:06 2015 (r287032) +++ head/sys/sys/vnode.h Sun Aug 23 14:53:54 2015 (r287033) @@ -827,7 +827,6 @@ void vnode_destroy_vobject(struct vnode extern struct vop_vector fifo_specops; extern struct vop_vector dead_vnodeops; extern struct vop_vector default_vnodeops; -extern struct vop_vector devfs_specops; #define VOP_PANIC ((void*)(uintptr_t)vop_panic) #define VOP_NULL ((void*)(uintptr_t)vop_null) From owner-svn-src-head@freebsd.org Sun Aug 23 15:16:55 2015 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 797E99C0650; Sun, 23 Aug 2015 15:16:55 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E639114A; Sun, 23 Aug 2015 15:16:55 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 7B17D358C66; Sun, 23 Aug 2015 17:16:51 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 5D06028494; Sun, 23 Aug 2015 17:16:51 +0200 (CEST) Date: Sun, 23 Aug 2015 17:16:51 +0200 From: Jilles Tjoelker To: Jason Evans Cc: Jan Beich , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/... Message-ID: <20150823151651.GA45396@stack.nl> References: <201508180021.t7I0LQwE016289@repo.freebsd.org> <20150818211743.GA29760@stack.nl> <790D5607-6662-4817-8CD0-6A435D1F7E49@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <790D5607-6662-4817-8CD0-6A435D1F7E49@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 23 Aug 2015 15:16:55 -0000 On Tue, Aug 18, 2015 at 02:28:25PM -0700, Jason Evans wrote: > On Aug 18, 2015, at 2:17 PM, Jilles Tjoelker wrote: > > On Tue, Aug 18, 2015 at 09:49:44PM +0200, Jan Beich wrote: > >> Jason Evans writes: > >>>>> + - Remove the *allocm() API, which is superseded by the *allocx() API. > >>>> Symbol.map and manpages haven't been updated. > > You can't really remove anything from Symbol.map files, since that > > breaks binary compatibility for applications that used the removed > > symbols. Such breakage usually crashes the application if and when it > > attempts to use a removed symbol. To avoid the breakage, wrappers > > invoking the new APIs should be provided; using some special symver > > directives, it is possible to prevent linking new applications against > > the obsolete symbols. > *allocm() compatibility functions are in place, so I think this is > correctly sorted out. Jan also pointed out missing entries for > sdallocx() in a previous email, which I've already committed the fix > for (r286872). Sorry, I didn't read the code sufficiently thoroughly. The compatibility code looks good, now I see it. > > A corollary is that experimental APIs should not be added to Symbol.map. > > It may be better for developers that want to use experimental APIs to > > build jemalloc themselves, or to use jemalloc from ports (although such > > a port doesn't seem to exist, currently). > Yes, exposing *allocm() was a big mistake. :( Does that mean that mallocx() and friends will stay for a long time? -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Sun Aug 23 15:20:50 2015 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 C19829C0923; Sun, 23 Aug 2015 15:20:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A56F61A18; Sun, 23 Aug 2015 15:20:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7NFKonn066871; Sun, 23 Aug 2015 15:20:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7NFKoV6066870; Sun, 23 Aug 2015 15:20:50 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508231520.t7NFKoV6066870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 23 Aug 2015 15:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287034 - head/contrib/subversion/subversion/svn 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.20 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, 23 Aug 2015 15:20:50 -0000 Author: trasz Date: Sun Aug 23 15:20:49 2015 New Revision: 287034 URL: https://svnweb.freebsd.org/changeset/base/287034 Log: Update svnlite(1) commit template. This makes it possible to set the "freebsd-sponsored-by" and "freebsd-mfc-after" in ~/.subversion/config, in the "[miscellany]" section - just like you already can with devel/subversion port/package. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/contrib/subversion/subversion/svn/util.c Modified: head/contrib/subversion/subversion/svn/util.c ============================================================================== --- head/contrib/subversion/subversion/svn/util.c Sun Aug 23 14:53:54 2015 (r287033) +++ head/contrib/subversion/subversion/svn/util.c Sun Aug 23 15:20:49 2015 (r287034) @@ -333,7 +333,6 @@ truncate_buffer_at_prefix(apr_size_t *ne static const char *prefixes[] = { "PR:", - "Differential Revision:", "Submitted by:", "Reviewed by:", "Approved by:", @@ -342,7 +341,8 @@ static const char *prefixes[] = { "MFH:", "Relnotes:", "Security:", - "Sponsored by:" + "Sponsored by:", + "Differential Revision:", }; void @@ -401,30 +401,42 @@ svn_cl__get_log_message(const char **log svn_stringbuf_t *default_msg = NULL; struct log_msg_baton *lmb = baton; svn_stringbuf_t *message = NULL; + svn_config_t *cfg; + const char *mfc_after, *sponsored_by; + + cfg = lmb->config ? svn_hash_gets(lmb->config, SVN_CONFIG_CATEGORY_CONFIG) : NULL; /* Set default message. */ default_msg = svn_stringbuf_create(APR_EOL_STR, pool); svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "PR:\t\t" APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "Differential Revision:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Submitted by:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Reviewed by:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Approved by:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Obtained from:\t" APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "MFC after:\t" APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "MFC after:\t"); + svn_config_get(cfg, &mfc_after, SVN_CONFIG_SECTION_MISCELLANY, "freebsd-mfc-after", NULL); + if (mfc_after != NULL) + svn_stringbuf_appendcstr(default_msg, mfc_after); + svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "MFH:\t\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Relnotes:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Security:\t" APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "Sponsored by:\t" + svn_stringbuf_appendcstr(default_msg, "Sponsored by:\t"); + svn_config_get(cfg, &sponsored_by, SVN_CONFIG_SECTION_MISCELLANY, "freebsd-sponsored-by", #ifdef HAS_ORGANIZATION_NAME - ORGANIZATION_NAME + ORGANIZATION_NAME); +#else + NULL); #endif - APR_EOL_STR); + if (sponsored_by != NULL) + svn_stringbuf_appendcstr(default_msg, sponsored_by); + svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "Differential Revision:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, EDITOR_EOF_PREFIX); svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Description of fields to fill in above: 76 columns --|" APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "> PR: If a Bugzilla PR is affected by the change." APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "> Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed)." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> PR: If a GNATS PR is affected by the change." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Submitted by: If someone else sent in the change." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Reviewed by: If someone else reviewed your modification." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Approved by: If you needed approval for this commit." APR_EOL_STR); @@ -434,6 +446,7 @@ svn_cl__get_log_message(const char **log svn_stringbuf_appendcstr(default_msg, "> Relnotes: Set to 'yes' for mention in release notes." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Security: Vulnerability reference (one per line) or description." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Sponsored by: If the change was sponsored by an organization." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed)." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Empty fields above will be automatically removed." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); From owner-svn-src-head@freebsd.org Sun Aug 23 20:44:55 2015 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 848809C0345; Sun, 23 Aug 2015 20:44:55 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6A395114B; Sun, 23 Aug 2015 20:44:55 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7NKit43006914; Sun, 23 Aug 2015 20:44:55 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7NKisCs006909; Sun, 23 Aug 2015 20:44:54 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201508232044.t7NKisCs006909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 23 Aug 2015 20:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287081 - in head/bin/sh: . tests/errors 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.20 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, 23 Aug 2015 20:44:55 -0000 Author: jilles Date: Sun Aug 23 20:44:53 2015 New Revision: 287081 URL: https://svnweb.freebsd.org/changeset/base/287081 Log: sh: Don't create bad parse result when postponing a bad substitution error. An invalid substitution like ${var@} does not cause a parse error but is stored in the intermediate representation, to be written as part of the error message. If there is a CTL* byte in the stored part, this confuses some code such as the code to skip an unused alternative such as in ${var-alternative}. To keep things simple, do not store CTL* bytes. Found with afl-fuzz. MFC after: 1 week Added: head/bin/sh/tests/errors/bad-parm-exp7.0 (contents, props changed) head/bin/sh/tests/errors/bad-parm-exp8.0 (contents, props changed) Modified: head/bin/sh/parser.c head/bin/sh/tests/errors/Makefile Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Aug 23 20:39:19 2015 (r287080) +++ head/bin/sh/parser.c Sun Aug 23 20:44:53 2015 (r287081) @@ -1662,7 +1662,7 @@ varname: pungetc(); else if (c == '\n' || c == PEOF) synerror("Unexpected end of line in substitution"); - else + else if (BASESYNTAX[c] != CCTL) USTPUTC(c, out); } if (subtype == 0) { @@ -1678,7 +1678,8 @@ varname: synerror("Unexpected end of line in substitution"); if (flags == VSNUL) STPUTC(':', out); - STPUTC(c, out); + if (BASESYNTAX[c] != CCTL) + STPUTC(c, out); subtype = VSERROR; } else subtype = p - types + VSNORMAL; Modified: head/bin/sh/tests/errors/Makefile ============================================================================== --- head/bin/sh/tests/errors/Makefile Sun Aug 23 20:39:19 2015 (r287080) +++ head/bin/sh/tests/errors/Makefile Sun Aug 23 20:44:53 2015 (r287081) @@ -19,6 +19,8 @@ FILES+= bad-parm-exp3.2 bad-parm-exp3.2 FILES+= bad-parm-exp4.2 bad-parm-exp4.2.stderr FILES+= bad-parm-exp5.2 bad-parm-exp5.2.stderr FILES+= bad-parm-exp6.2 bad-parm-exp6.2.stderr +FILES+= bad-parm-exp7.0 +FILES+= bad-parm-exp8.0 FILES+= option-error.0 FILES+= redirection-error.0 FILES+= redirection-error2.2 Added: head/bin/sh/tests/errors/bad-parm-exp7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/errors/bad-parm-exp7.0 Sun Aug 23 20:44:53 2015 (r287081) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +v=1 +eval ": $(printf '${v-${\372}}')" Added: head/bin/sh/tests/errors/bad-parm-exp8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/errors/bad-parm-exp8.0 Sun Aug 23 20:44:53 2015 (r287081) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +v=1 +eval ": $(printf '${v-${w\372}}')" From owner-svn-src-head@freebsd.org Sun Aug 23 21:10:21 2015 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 BE84F9C0B4B; Sun, 23 Aug 2015 21:10:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A404A36A; Sun, 23 Aug 2015 21:10:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7NLALpo016728; Sun, 23 Aug 2015 21:10:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7NLALSc016726; Sun, 23 Aug 2015 21:10:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508232110.t7NLALSc016726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 23 Aug 2015 21:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287083 - 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.20 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, 23 Aug 2015 21:10:21 -0000 Author: andrew Date: Sun Aug 23 21:10:20 2015 New Revision: 287083 URL: https://svnweb.freebsd.org/changeset/base/287083 Log: Enable KDTRACE_HOOKS by default on all armv6 kernels to get more testing. Modified: head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/std.armv6 Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sun Aug 23 20:50:22 2015 (r287082) +++ head/sys/arm/conf/BEAGLEBONE Sun Aug 23 21:10:20 2015 (r287083) @@ -28,11 +28,6 @@ include "../ti/am335x/std.am335x" makeoptions MODULES_EXTRA="dtb/am335x am335x_dmtpps" -# DTrace support -options KDTRACE_HOOKS # Kernel DTrace hooks -options DDB_CTF # all architectures - kernel ELF linker loads CTF data -makeoptions WITH_CTF=1 - options HZ=100 options SCHED_4BSD # 4BSD scheduler options PLATFORM Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Sun Aug 23 20:50:22 2015 (r287082) +++ head/sys/arm/conf/std.armv6 Sun Aug 23 21:10:20 2015 (r287083) @@ -38,3 +38,8 @@ options FREEBSD_BOOT_LOADER # Process m options VFP # Enable floating point hardware support options ARM_NEW_PMAP # Use new pmap code. + +# DTrace support +options KDTRACE_HOOKS # Kernel DTrace hooks +options DDB_CTF # all architectures - kernel ELF linker loads CTF data +makeoptions WITH_CTF=1 From owner-svn-src-head@freebsd.org Sun Aug 23 23:12:31 2015 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 6E1F59C1230; Sun, 23 Aug 2015 23:12:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5EE7934B; Sun, 23 Aug 2015 23:12:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7NNCVIG073774; Sun, 23 Aug 2015 23:12:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7NNCUP1073772; Sun, 23 Aug 2015 23:12:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508232312.t7NNCUP1073772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 23 Aug 2015 23:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287085 - in head: . cddl/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.20 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, 23 Aug 2015 23:12:31 -0000 Author: imp Date: Sun Aug 23 23:12:30 2015 New Revision: 287085 URL: https://svnweb.freebsd.org/changeset/base/287085 Log: Sparc64 is the odd-man out, so form the if that way rather than listing everybody else. Modified: head/Makefile.inc1 head/cddl/lib/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Aug 23 21:42:27 2015 (r287084) +++ head/Makefile.inc1 Sun Aug 23 23:12:30 2015 (r287085) @@ -1778,9 +1778,7 @@ cddl/lib/libctf__L: lib/libz__L .endif # cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built # on select architectures though (see cddl/lib/Makefile) -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" || ${MACHINE_ARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" +.if ${MACHINE_CPUARCH} != "sparc64" _prebuild_libs+= lib/libproc lib/librtld_db .endif Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Sun Aug 23 21:42:27 2015 (r287084) +++ head/cddl/lib/Makefile Sun Aug 23 23:12:30 2015 (r287085) @@ -26,9 +26,7 @@ _libzpool= libzpool .endif .endif -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" || ${MACHINE_ARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" +.if ${MACHINE_CPUARCH} != "sparc64" _drti= drti _libdtrace= libdtrace .endif From owner-svn-src-head@freebsd.org Mon Aug 24 00:03:52 2015 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 2CDE49C1BEC; Mon, 24 Aug 2015 00:03:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 1118A1D58; Mon, 24 Aug 2015 00:03:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O03pu0096384; Mon, 24 Aug 2015 00:03:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O03pGp096383; Mon, 24 Aug 2015 00:03:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508240003.t7O03pGp096383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Aug 2015 00:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287086 - head/share/mk 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.20 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, 24 Aug 2015 00:03:52 -0000 Author: imp Date: Mon Aug 24 00:03:51 2015 New Revision: 287086 URL: https://svnweb.freebsd.org/changeset/base/287086 Log: We need to add the soft float to the CFLAGS always, not just when NO_CPUCFLAGS is not defined since it is part of the ABI as we've defined it, not just a nice optimization. Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Sun Aug 23 23:12:30 2015 (r287085) +++ head/share/mk/bsd.cpu.mk Mon Aug 24 00:03:51 2015 (r287086) @@ -273,7 +273,9 @@ CFLAGS += -G0 .endif .if ${MACHINE_ARCH} == "armv6" -_CPUCFLAGS += -mfloat-abi=softfp +# Needs to be CFLAGS not _CPUCFLAGS because it's needed for the ABI +# not a nice optimization. +CFLAGS += -mfloat-abi=softfp .endif # NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk From owner-svn-src-head@freebsd.org Mon Aug 24 00:34:10 2015 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 575459C114D; Mon, 24 Aug 2015 00:34:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 40E77EE3; Mon, 24 Aug 2015 00:34:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O0YAbl009083; Mon, 24 Aug 2015 00:34:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O0YAB1009082; Mon, 24 Aug 2015 00:34:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508240034.t7O0YAB1009082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Aug 2015 00:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287087 - head/usr.sbin/config 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.20 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, 24 Aug 2015 00:34:10 -0000 Author: imp Date: Mon Aug 24 00:34:09 2015 New Revision: 287087 URL: https://svnweb.freebsd.org/changeset/base/287087 Log: Make it clear that we're ignoring the return value fread(3). All errors that might happen here will be reported a few lines down. CID: 1295248 Modified: head/usr.sbin/config/main.c Modified: head/usr.sbin/config/main.c ============================================================================== --- head/usr.sbin/config/main.c Mon Aug 24 00:03:51 2015 (r287086) +++ head/usr.sbin/config/main.c Mon Aug 24 00:34:09 2015 (r287087) @@ -714,7 +714,7 @@ kernconfdump(const char *file) if (pp == NULL) errx(EXIT_FAILURE, "popen() failed"); free(cmd); - fread(o, osz, 1, pp); + (void)fread(o, osz, 1, pp); pclose(pp); r = sscanf(o, "%d%d%d%d%d", &off, &size, &t1, &t2, &align); free(o); From owner-svn-src-head@freebsd.org Mon Aug 24 01:51:11 2015 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 D5B1C9C024C; Mon, 24 Aug 2015 01:51:11 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C68C1114C; Mon, 24 Aug 2015 01:51:11 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O1pB6W040216; Mon, 24 Aug 2015 01:51:11 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O1pBvw040215; Mon, 24 Aug 2015 01:51:11 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508240151.t7O1pBvw040215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 24 Aug 2015 01:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287088 - head/lib/libc/string 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.20 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, 24 Aug 2015 01:51:11 -0000 Author: araujo Date: Mon Aug 24 01:51:10 2015 New Revision: 287088 URL: https://svnweb.freebsd.org/changeset/base/287088 Log: Update bzero(3) manpage to following the Posix Standard. Reviewed by: wblock, pfg Approved by: bapt (mentor) Differential Revision: D3380 Modified: head/lib/libc/string/bzero.3 Modified: head/lib/libc/string/bzero.3 ============================================================================== --- head/lib/libc/string/bzero.3 Mon Aug 24 00:34:09 2015 (r287087) +++ head/lib/libc/string/bzero.3 Mon Aug 24 01:51:10 2015 (r287088) @@ -31,7 +31,7 @@ .\" @(#)bzero.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 6, 2014 +.Dd August 24, 2015 .Dt BZERO 3 .Os .Sh NAME @@ -88,3 +88,11 @@ function first appeared in .Ox 5.5 and .Fx 11.0 . +.Pp +.St -p1003.1-2008 +removes the specification of +.Fn bzero +and it is marked as LEGACY in +.St -p1003.1-2004 . +For portability with other systems new programs should use +.Xr memset 3 . From owner-svn-src-head@freebsd.org Mon Aug 24 01:53:19 2015 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 8A6079C02BD; Mon, 24 Aug 2015 01:53:19 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7B6041356; Mon, 24 Aug 2015 01:53:19 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O1rJhL041336; Mon, 24 Aug 2015 01:53:19 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O1rJ4x041335; Mon, 24 Aug 2015 01:53:19 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508240153.t7O1rJ4x041335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 24 Aug 2015 01:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287089 - head/lib/libc/string 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.20 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, 24 Aug 2015 01:53:19 -0000 Author: araujo Date: Mon Aug 24 01:53:18 2015 New Revision: 287089 URL: https://svnweb.freebsd.org/changeset/base/287089 Log: Fix spelling. Reviewed by: wblock, pfg Approved by: bapt (mentor) Differential Revision: D3380 Modified: head/lib/libc/string/bcopy.3 Modified: head/lib/libc/string/bcopy.3 ============================================================================== --- head/lib/libc/string/bcopy.3 Mon Aug 24 01:51:10 2015 (r287088) +++ head/lib/libc/string/bcopy.3 Mon Aug 24 01:53:18 2015 (r287089) @@ -31,7 +31,7 @@ .\" @(#)bcopy.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd August 14, 2015 +.Dd August 24, 2015 .Dt BCOPY 3 .Os .Sh NAME @@ -76,7 +76,6 @@ for .St -p1003.1-2001 compliance. .Pp -The .St -p1003.1-2008 removes the specification of .Fn bcopy From owner-svn-src-head@freebsd.org Mon Aug 24 04:39:08 2015 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 E78D59C1C04; Mon, 24 Aug 2015 04:39:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D8A0F12A6; Mon, 24 Aug 2015 04:39:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O4d8Sf007404; Mon, 24 Aug 2015 04:39:08 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O4d8M4007403; Mon, 24 Aug 2015 04:39:08 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508240439.t7O4d8M4007403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 24 Aug 2015 04:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287092 - head/sys/powerpc/ofw 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.20 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, 24 Aug 2015 04:39:09 -0000 Author: jhibbits Date: Mon Aug 24 04:39:07 2015 New Revision: 287092 URL: https://svnweb.freebsd.org/changeset/base/287092 Log: Fix static fdt support. FDT_DTB_STATIC is defined in opt_platform.h, and fdt_static_dtb is in fdt_common.h, so include those files. Sponsored by: Alex Perez/Inertial Computing Modified: head/sys/powerpc/ofw/ofw_machdep.c Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Mon Aug 24 03:51:18 2015 (r287091) +++ head/sys/powerpc/ofw/ofw_machdep.c Mon Aug 24 04:39:07 2015 (r287092) @@ -34,6 +34,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" #include #include #include @@ -47,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include From owner-svn-src-head@freebsd.org Mon Aug 24 04:49:21 2015 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 5E39D9C1D46; Mon, 24 Aug 2015 04:49:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4517417D0; Mon, 24 Aug 2015 04:49:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O4nLuT011539; Mon, 24 Aug 2015 04:49:21 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O4nLV4011538; Mon, 24 Aug 2015 04:49:21 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508240449.t7O4nLV4011538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 24 Aug 2015 04:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287093 - head/lib/libc/posix1e 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.20 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, 24 Aug 2015 04:49:21 -0000 Author: delphij Date: Mon Aug 24 04:49:20 2015 New Revision: 287093 URL: https://svnweb.freebsd.org/changeset/base/287093 Log: Instead of doing an no-op (|= 0), actually clear the flags in acl_clear_flags_np. MFC after: 2 weeks Modified: head/lib/libc/posix1e/acl_flag.c Modified: head/lib/libc/posix1e/acl_flag.c ============================================================================== --- head/lib/libc/posix1e/acl_flag.c Mon Aug 24 04:39:07 2015 (r287092) +++ head/lib/libc/posix1e/acl_flag.c Mon Aug 24 04:49:20 2015 (r287093) @@ -71,7 +71,7 @@ acl_clear_flags_np(acl_flagset_t flagset return (-1); } - *flagset_d |= 0; + *flagset_d = 0; return (0); } From owner-svn-src-head@freebsd.org Mon Aug 24 05:21:51 2015 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 78AAF9C1277; Mon, 24 Aug 2015 05:21:51 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5B08F392; Mon, 24 Aug 2015 05:21:51 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O5LpgX027392; Mon, 24 Aug 2015 05:21:51 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O5Lot8027387; Mon, 24 Aug 2015 05:21:50 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201508240521.t7O5Lot8027387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Mon, 24 Aug 2015 05:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287094 - head/sys/netinet6 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.20 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, 24 Aug 2015 05:21:51 -0000 Author: hrs Date: Mon Aug 24 05:21:49 2015 New Revision: 287094 URL: https://svnweb.freebsd.org/changeset/base/287094 Log: - Deprecate IN6_IFF_NODAD. It was used to prevent DAD on a loopback interface but in6if_do_dad() already had a check for IFF_LOOPBACK. - Remove in6if_do_dad() check in in6_broadcast_ifa(). An address which needs DAD always has IN6_IFF_TENTATIVE there. - in6if_do_dad() now returns EAGAIN when the interface is not ready since DAD callout handler ignores such an interface. - In DAD callout handler, mark an address as IN6_IFF_TENTATIVE when the interface has ND6_IFF_IFDISABLED. And Do IFF_UP and IFF_DRV_RUNNING check consistently when DAD is required. - draft-ietf-6man-enhanced-dad is now published as RFC 7527. - Fix some typos. Modified: head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_var.h head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Aug 24 04:49:20 2015 (r287093) +++ head/sys/netinet6/in6.c Mon Aug 24 05:21:49 2015 (r287094) @@ -1243,13 +1243,8 @@ in6_broadcast_ifa(struct ifnet *ifp, str } } - /* - * Perform DAD, if needed. - * XXX It may be of use, if we can administratively disable DAD. - */ - if (in6if_do_dad(ifp) && ((ifra->ifra_flags & IN6_IFF_NODAD) == 0) && - (ia->ia6_flags & IN6_IFF_TENTATIVE)) - { + /* Perform DAD, if the address is TENTATIVE. */ + if ((ia->ia6_flags & IN6_IFF_TENTATIVE)) { int delay, mindelay, maxdelay; delay = 0; @@ -1379,8 +1374,8 @@ in6_unlink_ifa(struct in6_ifaddr *ia, st } /* - * Notifies other other subsystems about address change/arrival: - * 1) Notifies device handler on first IPv6 address assignment + * Notifies other subsystems about address change/arrival: + * 1) Notifies device handler on the first IPv6 address assignment * 2) Handle routing table changes for P2P links and route * 3) Handle routing table changes for address host route */ @@ -1957,13 +1952,13 @@ in6if_do_dad(struct ifnet *ifp) * However, some interfaces can be up before the RUNNING * status. Additionaly, users may try to assign addresses * before the interface becomes up (or running). - * We simply skip DAD in such a case as a work around. - * XXX: we should rather mark "tentative" on such addresses, - * and do DAD after the interface becomes ready. + * This function returns EAGAIN in that case. + * The caller should mark "tentative" on the address instead of + * performing DAD immediately. */ if (!((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING))) - return (0); + return (EAGAIN); return (1); } Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Mon Aug 24 04:49:20 2015 (r287093) +++ head/sys/netinet6/in6_ifattach.c Mon Aug 24 05:21:49 2015 (r287094) @@ -566,9 +566,6 @@ in6_ifattach_loopback(struct ifnet *ifp) ifra.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME; ifra.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME; - /* we don't need to perform DAD on loopback interfaces. */ - ifra.ifra_flags |= IN6_IFF_NODAD; - /* skip registration to the prefix list. XXX should be temporary. */ ifra.ifra_flags |= IN6_IFF_NOPFX; Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Mon Aug 24 04:49:20 2015 (r287093) +++ head/sys/netinet6/in6_var.h Mon Aug 24 05:21:49 2015 (r287094) @@ -494,7 +494,7 @@ struct in6_rrenumreq { #define IN6_IFF_DETACHED 0x08 /* may be detached from the link */ #define IN6_IFF_DEPRECATED 0x10 /* deprecated address */ #define IN6_IFF_NODAD 0x20 /* don't perform DAD on this address - * (used only at first SIOC* call) + * (obsolete) */ #define IN6_IFF_AUTOCONF 0x40 /* autoconfigurable address. */ #define IN6_IFF_TEMPORARY 0x80 /* temporary (anonymous) address. */ Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Mon Aug 24 04:49:20 2015 (r287093) +++ head/sys/netinet6/nd6_nbr.c Mon Aug 24 05:21:49 2015 (r287094) @@ -574,7 +574,7 @@ nd6_ns_output_fib(struct ifnet *ifp, con /* * Add a Nonce option (RFC 3971) to detect looped back NS messages. * This behavior is documented as Enhanced Duplicate Address - * Detection in draft-ietf-6man-enhanced-dad-13. + * Detection in RFC 7527. * net.inet6.ip6.dad_enhanced=0 disables this. */ if (V_dad_enhanced != 0 && nonce != NULL) { @@ -1302,11 +1302,16 @@ nd6_dad_start(struct ifaddr *ifa, int de } if (ifa->ifa_ifp == NULL) panic("nd6_dad_start: ifa->ifa_ifp == NULL"); - if (!(ifa->ifa_ifp->if_flags & IFF_UP)) { + if (ND_IFINFO(ifa->ifa_ifp)->flags & ND6_IFF_NO_DAD) { + ia->ia6_flags &= ~IN6_IFF_TENTATIVE; return; } - if (ND_IFINFO(ifa->ifa_ifp)->flags & ND6_IFF_IFDISABLED) + if (!(ifa->ifa_ifp->if_flags & IFF_UP) || + !(ifa->ifa_ifp->if_drv_flags & IFF_DRV_RUNNING) || + (ND_IFINFO(ifa->ifa_ifp)->flags & ND6_IFF_IFDISABLED)) { + ia->ia6_flags |= IN6_IFF_TENTATIVE; return; + } if ((dp = nd6_dad_find(ifa, NULL)) != NULL) { /* DAD already in progress */ nd6_dad_rele(dp); From owner-svn-src-head@freebsd.org Mon Aug 24 05:28:24 2015 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 96FF39C12AF; Mon, 24 Aug 2015 05:28:24 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7D655809; Mon, 24 Aug 2015 05:28:24 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O5SOPJ027699; Mon, 24 Aug 2015 05:28:24 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O5SO2l027698; Mon, 24 Aug 2015 05:28:24 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201508240528.t7O5SO2l027698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Mon, 24 Aug 2015 05:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287095 - head/usr.sbin/ndp 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.20 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, 24 Aug 2015 05:28:24 -0000 Author: hrs Date: Mon Aug 24 05:28:23 2015 New Revision: 287095 URL: https://svnweb.freebsd.org/changeset/base/287095 Log: Remove obsolete API (SIOCGDRLST_IN6 and SIOCGPRLST_IN6) support. Modified: head/usr.sbin/ndp/ndp.c Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Mon Aug 24 05:21:49 2015 (r287094) +++ head/usr.sbin/ndp/ndp.c Mon Aug 24 05:28:23 2015 (r287095) @@ -150,14 +150,12 @@ static void setdefif(char *); static char *sec2str(time_t); static void ts_print(const struct timeval *); -#ifdef ICMPV6CTL_ND6_DRLIST static char *rtpref_str[] = { "medium", /* 00 */ "high", /* 01 */ "rsv", /* 10 */ "low" /* 11 */ }; -#endif int mode = 0; char *arg = NULL; @@ -1056,7 +1054,6 @@ ifinfo(char *ifname, int argc, char **ar void rtrlist() { -#ifdef ICMPV6CTL_ND6_DRLIST int mib[] = { CTL_NET, PF_INET6, IPPROTO_ICMPV6, ICMPV6CTL_ND6_DRLIST }; char *buf; struct in6_defrouter *p, *ep; @@ -1104,54 +1101,11 @@ rtrlist() sec2str(p->expire - now.tv_sec)); } free(buf); -#else - struct in6_drlist dr; - int s, i; - struct timeval now; - - if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - err(1, "socket"); - /* NOTREACHED */ - } - bzero(&dr, sizeof(dr)); - strlcpy(dr.ifname, "lo0", sizeof(dr.ifname)); /* dummy */ - if (ioctl(s, SIOCGDRLST_IN6, (caddr_t)&dr) < 0) { - err(1, "ioctl(SIOCGDRLST_IN6)"); - /* NOTREACHED */ - } -#define DR dr.defrouter[i] - for (i = 0 ; DR.if_index && i < DRLSTSIZ ; i++) { - struct sockaddr_in6 sin6; - - bzero(&sin6, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(sin6); - sin6.sin6_addr = DR.rtaddr; - getnameinfo((struct sockaddr *)&sin6, sin6.sin6_len, host_buf, - sizeof(host_buf), NULL, 0, - (nflag ? NI_NUMERICHOST : 0)); - - printf("%s if=%s", host_buf, - if_indextoname(DR.if_index, ifix_buf)); - printf(", flags=%s%s", - DR.flags & ND_RA_FLAG_MANAGED ? "M" : "", - DR.flags & ND_RA_FLAG_OTHER ? "O" : ""); - gettimeofday(&now, 0); - if (DR.expire == 0) - printf(", expire=Never\n"); - else - printf(", expire=%s\n", - sec2str(DR.expire - now.tv_sec)); - } -#undef DR - close(s); -#endif } void plist() { -#ifdef ICMPV6CTL_ND6_PRLIST int mib[] = { CTL_NET, PF_INET6, IPPROTO_ICMPV6, ICMPV6CTL_ND6_PRLIST }; char *buf; struct in6_prefix *p, *ep, *n; @@ -1261,161 +1215,6 @@ plist() printf(" No advertising router\n"); } free(buf); -#else - struct in6_prlist pr; - int s, i; - struct timeval now; - - gettimeofday(&now, 0); - - if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - err(1, "socket"); - /* NOTREACHED */ - } - bzero(&pr, sizeof(pr)); - strlcpy(pr.ifname, "lo0", sizeof(pr.ifname)); /* dummy */ - if (ioctl(s, SIOCGPRLST_IN6, (caddr_t)&pr) < 0) { - err(1, "ioctl(SIOCGPRLST_IN6)"); - /* NOTREACHED */ - } -#define PR pr.prefix[i] - for (i = 0; PR.if_index && i < PRLSTSIZ ; i++) { - struct sockaddr_in6 p6; - char namebuf[NI_MAXHOST]; - int niflags; - -#ifdef NDPRF_ONLINK - p6 = PR.prefix; -#else - memset(&p6, 0, sizeof(p6)); - p6.sin6_family = AF_INET6; - p6.sin6_len = sizeof(p6); - p6.sin6_addr = PR.prefix; -#endif - niflags = NI_NUMERICHOST; - if (getnameinfo((struct sockaddr *)&p6, - sizeof(p6), namebuf, sizeof(namebuf), - NULL, 0, niflags)) { - warnx("getnameinfo failed"); - continue; - } - printf("%s/%d if=%s\n", namebuf, PR.prefixlen, - if_indextoname(PR.if_index, ifix_buf)); - - gettimeofday(&now, 0); - /* - * meaning of fields, especially flags, is very different - * by origin. notify the difference to the users. - */ -#if 0 - printf(" %s", - PR.origin == PR_ORIG_RA ? "" : "advertise: "); -#endif -#ifdef NDPRF_ONLINK - printf("flags=%s%s%s%s%s", - PR.raflags.onlink ? "L" : "", - PR.raflags.autonomous ? "A" : "", - (PR.flags & NDPRF_ONLINK) != 0 ? "O" : "", - (PR.flags & NDPRF_DETACHED) != 0 ? "D" : "", -#ifdef NDPRF_HOME - (PR.flags & NDPRF_HOME) != 0 ? "H" : "" -#else - "" -#endif - ); -#else - printf("flags=%s%s", - PR.raflags.onlink ? "L" : "", - PR.raflags.autonomous ? "A" : ""); -#endif - if (PR.vltime == ND6_INFINITE_LIFETIME) - printf(" vltime=infinity"); - else - printf(" vltime=%lu", PR.vltime); - if (PR.pltime == ND6_INFINITE_LIFETIME) - printf(", pltime=infinity"); - else - printf(", pltime=%lu", PR.pltime); - if (PR.expire == 0) - printf(", expire=Never"); - else if (PR.expire >= now.tv_sec) - printf(", expire=%s", - sec2str(PR.expire - now.tv_sec)); - else - printf(", expired"); -#ifdef NDPRF_ONLINK - printf(", ref=%d", PR.refcnt); -#endif -#if 0 - switch (PR.origin) { - case PR_ORIG_RA: - printf(", origin=RA"); - break; - case PR_ORIG_RR: - printf(", origin=RR"); - break; - case PR_ORIG_STATIC: - printf(", origin=static"); - break; - case PR_ORIG_KERNEL: - printf(", origin=kernel"); - break; - default: - printf(", origin=?"); - break; - } -#endif - printf("\n"); - /* - * "advertising router" list is meaningful only if the prefix - * information is from RA. - */ - if (0 && /* prefix origin is almost obsolted */ - PR.origin != PR_ORIG_RA) - ; - else if (PR.advrtrs) { - int j; - printf(" advertised by\n"); - for (j = 0; j < PR.advrtrs; j++) { - struct sockaddr_in6 sin6; - struct in6_nbrinfo *nbi; - - bzero(&sin6, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(sin6); - sin6.sin6_addr = PR.advrtr[j]; - sin6.sin6_scope_id = PR.if_index; /* XXX */ - getnameinfo((struct sockaddr *)&sin6, - sin6.sin6_len, host_buf, - sizeof(host_buf), NULL, 0, - (nflag ? NI_NUMERICHOST : 0)); - printf(" %s", host_buf); - - nbi = getnbrinfo(&sin6.sin6_addr, - PR.if_index, 0); - if (nbi) { - switch (nbi->state) { - case ND6_LLINFO_REACHABLE: - case ND6_LLINFO_STALE: - case ND6_LLINFO_DELAY: - case ND6_LLINFO_PROBE: - printf(" (reachable)\n"); - break; - default: - printf(" (unreachable)\n"); - } - } else - printf(" (no neighbor state)\n"); - } - if (PR.advrtrs > DRLSTSIZ) - printf(" and %d routers\n", - PR.advrtrs - DRLSTSIZ); - } else - printf(" No advertising router\n"); - } -#undef PR - close(s); -#endif } void From owner-svn-src-head@freebsd.org Mon Aug 24 05:36:09 2015 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 64D539C144F; Mon, 24 Aug 2015 05:36:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4A3DFC99; Mon, 24 Aug 2015 05:36:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O5a9Yw031676; Mon, 24 Aug 2015 05:36:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O5a8dK031674; Mon, 24 Aug 2015 05:36:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508240536.t7O5a8dK031674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 24 Aug 2015 05:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287096 - head/sys/netinet6 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.20 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, 24 Aug 2015 05:36:09 -0000 Author: adrian Date: Mon Aug 24 05:36:08 2015 New Revision: 287096 URL: https://svnweb.freebsd.org/changeset/base/287096 Log: Implement the IPv6 RSS software hash function. This isn't yet linked into the receive/transmit paths anywhere just yet. This is part of a GSoC 2015 project. Submitted by: Tiwei Bie Reviewed by: hiren, gnn Differential Revision: https://reviews.freebsd.org/D3423 Modified: head/sys/netinet6/in6_rss.c head/sys/netinet6/in6_rss.h Modified: head/sys/netinet6/in6_rss.c ============================================================================== --- head/sys/netinet6/in6_rss.c Mon Aug 24 05:28:23 2015 (r287095) +++ head/sys/netinet6/in6_rss.c Mon Aug 24 05:36:08 2015 (r287096) @@ -101,3 +101,52 @@ rss_hash_ip6_4tuple(const struct in6_add datalen += sizeof(dstport); return (rss_hash(datalen, data)); } + +/* + * Calculate an appropriate ipv6 2-tuple or 4-tuple given the given + * IPv6 source/destination address, UDP or TCP source/destination ports + * and the protocol type. + * + * The protocol code may wish to do a software hash of the given + * tuple. This depends upon the currently configured RSS hash types. + * + * This assumes that the packet in question isn't a fragment. + * + * It also assumes the packet source/destination address + * are in "incoming" packet order (ie, source is "far" address.) + */ +int +rss_proto_software_hash_v6(const struct in6_addr *s, const struct in6_addr *d, + u_short sp, u_short dp, int proto, + uint32_t *hashval, uint32_t *hashtype) +{ + uint32_t hash; + + /* + * Next, choose the hash type depending upon the protocol + * identifier. + */ + if ((proto == IPPROTO_TCP) && + (rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV6)) { + hash = rss_hash_ip6_4tuple(s, sp, d, dp); + *hashval = hash; + *hashtype = M_HASHTYPE_RSS_TCP_IPV6; + return (0); + } else if ((proto == IPPROTO_UDP) && + (rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV6)) { + hash = rss_hash_ip6_4tuple(s, sp, d, dp); + *hashval = hash; + *hashtype = M_HASHTYPE_RSS_UDP_IPV6; + return (0); + } else if (rss_gethashconfig() & RSS_HASHTYPE_RSS_IPV6) { + /* RSS doesn't hash on other protocols like SCTP; so 2-tuple */ + hash = rss_hash_ip6_2tuple(s, d); + *hashval = hash; + *hashtype = M_HASHTYPE_RSS_IPV6; + return (0); + } + + /* No configured available hashtypes! */ + printf("%s: no available hashtypes!\n", __func__); + return (-1); +} Modified: head/sys/netinet6/in6_rss.h ============================================================================== --- head/sys/netinet6/in6_rss.h Mon Aug 24 05:28:23 2015 (r287095) +++ head/sys/netinet6/in6_rss.h Mon Aug 24 05:36:08 2015 (r287096) @@ -42,4 +42,12 @@ uint32_t rss_hash_ip6_4tuple(const struc uint32_t rss_hash_ip6_2tuple(const struct in6_addr *src, const struct in6_addr *dst); +/* + * Functions to calculate a software RSS hash for a given mbuf or + * packet detail. + */ +int rss_proto_software_hash_v6(const struct in6_addr *src, + const struct in6_addr *dst, u_short src_port, + u_short dst_port, int proto, uint32_t *hashval, + uint32_t *hashtype); #endif /* !_NETINET6_IN6_RSS_H_ */ From owner-svn-src-head@freebsd.org Mon Aug 24 05:38:06 2015 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 799B19C14B8; Mon, 24 Aug 2015 05:38:06 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5AF77E31; Mon, 24 Aug 2015 05:38:06 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O5c6sW031788; Mon, 24 Aug 2015 05:38:06 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O5c6FL031787; Mon, 24 Aug 2015 05:38:06 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201508240538.t7O5c6FL031787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Mon, 24 Aug 2015 05:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287097 - head/usr.sbin/ndp 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.20 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, 24 Aug 2015 05:38:06 -0000 Author: hrs Date: Mon Aug 24 05:38:05 2015 New Revision: 287097 URL: https://svnweb.freebsd.org/changeset/base/287097 Log: Add static and remove unused variables. Modified: head/usr.sbin/ndp/ndp.c Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Mon Aug 24 05:36:08 2015 (r287096) +++ head/usr.sbin/ndp/ndp.c Mon Aug 24 05:38:05 2015 (r287097) @@ -121,28 +121,26 @@ static int32_t thiszone; /* time differe static int s = -1; static int repeat = 0; -char ntop_buf[INET6_ADDRSTRLEN]; /* inet_ntop() */ -char host_buf[NI_MAXHOST]; /* getnameinfo() */ -char ifix_buf[IFNAMSIZ]; /* if_indextoname() */ +static char host_buf[NI_MAXHOST]; /* getnameinfo() */ +static char ifix_buf[IFNAMSIZ]; /* if_indextoname() */ -int main(int, char **); static int file(char *); -void getsocket(void); -int set(int, char **); -void get(char *); -int delete(char *); -void dump(struct sockaddr_in6 *, int); +static void getsocket(void); +static int set(int, char **); +static void get(char *); +static int delete(char *); +static void dump(struct sockaddr_in6 *, int); static struct in6_nbrinfo *getnbrinfo(struct in6_addr *, int, int); static char *ether_str(struct sockaddr_dl *); -int ndp_ether_aton(char *, u_char *); -void usage(void); -int rtmsg(int); -void ifinfo(char *, int, char **); -void rtrlist(void); -void plist(void); -void pfx_flush(void); -void rtr_flush(void); -void harmonize_rtr(void); +static int ndp_ether_aton(char *, u_char *); +static void usage(void); +static int rtmsg(int); +static void ifinfo(char *, int, char **); +static void rtrlist(void); +static void plist(void); +static void pfx_flush(void); +static void rtr_flush(void); +static void harmonize_rtr(void); #ifdef SIOCSDEFIFACE_IN6 /* XXX: check SIOCGDEFIFACE_IN6 as well? */ static void getdefif(void); static void setdefif(char *); @@ -157,13 +155,11 @@ static char *rtpref_str[] = { "low" /* 11 */ }; -int mode = 0; -char *arg = NULL; - int main(int argc, char **argv) { - int ch; + int ch, mode = 0; + char *arg = NULL; pid = getpid(); thiszone = gmt2local(0); @@ -346,7 +342,7 @@ file(char *name) return (retval); } -void +static void getsocket() { if (s < 0) { @@ -358,20 +354,31 @@ getsocket() } } -struct sockaddr_in6 so_mask = {sizeof(so_mask), AF_INET6 }; -struct sockaddr_in6 blank_sin = {sizeof(blank_sin), AF_INET6 }, sin_m; -struct sockaddr_dl blank_sdl = {sizeof(blank_sdl), AF_LINK }, sdl_m; -time_t expire_time; -int flags, found_entry; -struct { +static struct sockaddr_in6 so_mask = { + .sin6_len = sizeof(so_mask), + .sin6_family = AF_INET6 +}; +static struct sockaddr_in6 blank_sin = { + .sin6_len = sizeof(blank_sin), + .sin6_family = AF_INET6 +}; +static struct sockaddr_in6 sin_m; +static struct sockaddr_dl blank_sdl = { + .sdl_len = sizeof(blank_sdl), + .sdl_family = AF_LINK +}; +static struct sockaddr_dl sdl_m; +static time_t expire_time; +static int flags, found_entry; +static struct { struct rt_msghdr m_rtm; char m_space[512]; -} m_rtmsg; +} m_rtmsg; /* * Set an individual neighbor cache entry */ -int +static int set(int argc, char **argv) { register struct sockaddr_in6 *sin = &sin_m; @@ -446,7 +453,7 @@ overwrite: /* * Display an individual neighbor cache entry */ -void +static void get(char *host) { struct sockaddr_in6 *sin = &sin_m; @@ -478,7 +485,7 @@ get(char *host) /* * Delete a neighbor cache entry */ -int +static int delete(char *host) { struct sockaddr_in6 *sin = &sin_m; @@ -546,7 +553,7 @@ delete: /* * Dump the entire neighbor cache */ -void +static void dump(struct sockaddr_in6 *addr, int cflag) { int mib[6]; @@ -780,7 +787,6 @@ static char * ether_str(struct sockaddr_dl *sdl) { static char hbuf[NI_MAXHOST]; - char *cp; if (sdl->sdl_alen == ETHER_ADDR_LEN) { strlcpy(hbuf, ether_ntoa((struct ether_addr *)LLADDR(sdl)), @@ -794,7 +800,7 @@ ether_str(struct sockaddr_dl *sdl) return(hbuf); } -int +static int ndp_ether_aton(char *a, u_char *n) { int i, o[6]; @@ -810,7 +816,7 @@ ndp_ether_aton(char *a, u_char *n) return (0); } -void +static void usage() { printf("usage: ndp [-nt] hostname\n"); @@ -826,7 +832,7 @@ usage() exit(1); } -int +static int rtmsg(int cmd) { static int seq; @@ -891,7 +897,7 @@ doit: return (0); } -void +static void ifinfo(char *ifname, int argc, char **argv) { struct in6_ndireq nd; @@ -1051,7 +1057,7 @@ ifinfo(char *ifname, int argc, char **ar #define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */ #endif -void +static void rtrlist() { int mib[] = { CTL_NET, PF_INET6, IPPROTO_ICMPV6, ICMPV6CTL_ND6_DRLIST }; @@ -1103,7 +1109,7 @@ rtrlist() free(buf); } -void +static void plist() { int mib[] = { CTL_NET, PF_INET6, IPPROTO_ICMPV6, ICMPV6CTL_ND6_PRLIST }; @@ -1217,7 +1223,7 @@ plist() free(buf); } -void +static void pfx_flush() { char dummyif[IFNAMSIZ+8]; @@ -1230,7 +1236,7 @@ pfx_flush() err(1, "ioctl(SIOCSPFXFLUSH_IN6)"); } -void +static void rtr_flush() { char dummyif[IFNAMSIZ+8]; @@ -1245,7 +1251,7 @@ rtr_flush() close(s); } -void +static void harmonize_rtr() { char dummyif[IFNAMSIZ+8]; From owner-svn-src-head@freebsd.org Mon Aug 24 07:49:28 2015 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 0BFED9C1A7C; Mon, 24 Aug 2015 07:49:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 EE47A78F; Mon, 24 Aug 2015 07:49:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O7nR4W084484; Mon, 24 Aug 2015 07:49:27 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O7nRZL084483; Mon, 24 Aug 2015 07:49:27 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508240749.t7O7nRZL084483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 24 Aug 2015 07:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287098 - head/sys/teken 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.20 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, 24 Aug 2015 07:49:28 -0000 Author: ed Date: Mon Aug 24 07:49:27 2015 New Revision: 287098 URL: https://svnweb.freebsd.org/changeset/base/287098 Log: Sync HPA and VPA implementations with CUP. After fixing the 16-bits integer arithmetic overflow in 286981, we should also make sure to fix the VPA sequence. Bring HPA and VPA in sync with how we now implement CUP. PR: 202612 Reported by: kcwu csie org MFC after: 1 month Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Mon Aug 24 05:38:05 2015 (r287097) +++ head/sys/teken/teken_subr.h Mon Aug 24 07:49:27 2015 (r287098) @@ -583,9 +583,9 @@ static void teken_subr_horizontal_position_absolute(teken_t *t, unsigned int col) { - t->t_cursor.tp_col = col - 1; - if (t->t_cursor.tp_col >= t->t_winsize.tp_col) - t->t_cursor.tp_col = t->t_winsize.tp_col - 1; + col--; + t->t_cursor.tp_col = col < t->t_winsize.tp_col ? + col : t->t_winsize.tp_col - 1; t->t_stateflags &= ~TS_WRAPPED; teken_funcs_cursor(t); @@ -1297,9 +1297,9 @@ static void teken_subr_vertical_position_absolute(teken_t *t, unsigned int row) { - t->t_cursor.tp_row = t->t_originreg.ts_begin + row - 1; - if (t->t_cursor.tp_row >= t->t_originreg.ts_end) - t->t_cursor.tp_row = t->t_originreg.ts_end - 1; + row = row - 1 + t->t_originreg.ts_begin; + t->t_cursor.tp_row = row < t->t_originreg.ts_end ? + row : t->t_originreg.ts_end - 1; t->t_stateflags &= ~TS_WRAPPED; teken_funcs_cursor(t); From owner-svn-src-head@freebsd.org Mon Aug 24 08:10:53 2015 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 1E9FF9BF29B; Mon, 24 Aug 2015 08:10:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 0BD311177; Mon, 24 Aug 2015 08:10:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O8AqwO096320; Mon, 24 Aug 2015 08:10:52 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O8Aq0J096319; Mon, 24 Aug 2015 08:10:52 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201508240810.t7O8Aq0J096319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 24 Aug 2015 08:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287099 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.20 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, 24 Aug 2015 08:10:53 -0000 Author: avg Date: Mon Aug 24 08:10:52 2015 New Revision: 287099 URL: https://svnweb.freebsd.org/changeset/base/287099 Log: account for ashift when gathering buffers to be written to l2arc device The change that introduced the L2ARC compression support also introduced a bug where the on-disk size of the selected buffers could end up larger than the target size if the ashift is greater than 9. This was because the buffer selection could did not take into account the fact that on-disk size could be larger than the in-memory buffer size due to the alignment requirements. At the moment b_asize is a misnomer as it does not always represent the allocated size: if a buffer is compressed, then the compressed size is properly rounded (on FreeBSD), but if the compression fails or it is not applied, then the original size is kept and it could be smaller than what ashift requires. For the same reasons arcstat_l2_asize and the reported used space on the cache device could be smaller than the actual allocated size if ashift > 9. That problem is not fixed by this change. This change only ensures that l2ad_hand is not advanced by more than target_sz. Otherwise we would overwrite active (unevicted) L2ARC buffers. That problem is manifested as growing l2_cksum_bad and l2_io_error counters. This change also changes 'p' prefix to 'a' prefix in a few places where variables represent allocated rather than physical size. The resolved problem could also result in the reported allocated size being greater than the cache device's capacity, because of the overwritten buffers (more than one buffer claiming the same disk space). This change is already in ZFS-on-Linux: zfsonlinux/zfs@ef56b0780c80ebb0b1e637b8b8c79530a8ab3201 PR: 198242 PR: 195746 (possibly related) Reviewed by: mahrens (https://reviews.csiden.org/r/229/) Tested by: gkontos@aicom.gr (most recently) MFC after: 15 days X-MFC note: patch does not apply as is at the moment Relnotes: yes Sponsored by: ClusterHQ Differential Revision: https://reviews.freebsd.org/D2764 Reviewed by: noone (@FreeBSD.org) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Aug 24 07:49:27 2015 (r287098) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Aug 24 08:10:52 2015 (r287099) @@ -6182,8 +6182,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de boolean_t *headroom_boost) { arc_buf_hdr_t *hdr, *hdr_prev, *head; - uint64_t write_asize, write_psize, write_sz, headroom, - buf_compress_minsz; + uint64_t write_asize, write_sz, headroom, buf_compress_minsz; void *buf_data; boolean_t full; l2arc_write_callback_t *cb; @@ -6198,7 +6197,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de *headroom_boost = B_FALSE; pio = NULL; - write_sz = write_asize = write_psize = 0; + write_sz = write_asize = 0; full = B_FALSE; head = kmem_cache_alloc(hdr_l2only_cache, KM_PUSHPAGE); head->b_flags |= ARC_FLAG_L2_WRITE_HEAD; @@ -6240,6 +6239,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de for (; hdr; hdr = hdr_prev) { kmutex_t *hash_lock; uint64_t buf_sz; + uint64_t buf_a_sz; if (arc_warm == B_FALSE) hdr_prev = multilist_sublist_next(mls, hdr); @@ -6271,7 +6271,15 @@ l2arc_write_buffers(spa_t *spa, l2arc_de continue; } - if ((write_sz + hdr->b_size) > target_sz) { + /* + * Assume that the buffer is not going to be compressed + * and could take more space on disk because of a larger + * disk block size. + */ + buf_sz = hdr->b_size; + buf_a_sz = vdev_psize_to_asize(dev->l2ad_vdev, buf_sz); + + if ((write_asize + buf_a_sz) > target_sz) { full = B_TRUE; mutex_exit(hash_lock); ARCSTAT_BUMP(arcstat_l2_write_full); @@ -6336,8 +6344,6 @@ l2arc_write_buffers(spa_t *spa, l2arc_de * using it to denote the header's state change. */ hdr->b_l2hdr.b_daddr = L2ARC_ADDR_UNSET; - - buf_sz = hdr->b_size; hdr->b_flags |= ARC_FLAG_HAS_L2HDR; mutex_enter(&dev->l2ad_mtx); @@ -6354,6 +6360,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de mutex_exit(hash_lock); write_sz += buf_sz; + write_asize += buf_a_sz; } multilist_sublist_unlock(mls); @@ -6373,6 +6380,19 @@ l2arc_write_buffers(spa_t *spa, l2arc_de mutex_enter(&dev->l2ad_mtx); /* + * Note that elsewhere in this file arcstat_l2_asize + * and the used space on l2ad_vdev are updated using b_asize, + * which is not necessarily rounded up to the device block size. + * Too keep accounting consistent we do the same here as well: + * stats_size accumulates the sum of b_asize of the written buffers, + * while write_asize accumulates the sum of b_asize rounded up + * to the device block size. + * The latter sum is used only to validate the corectness of the code. + */ + uint64_t stats_size = 0; + write_asize = 0; + + /* * Now start writing the buffers. We're starting at the write head * and work backwards, retracing the course of the buffer selector * loop above. @@ -6425,7 +6445,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de /* Compression may have squashed the buffer to zero length. */ if (buf_sz != 0) { - uint64_t buf_p_sz; + uint64_t buf_a_sz; wzio = zio_write_phys(pio, dev->l2ad_vdev, dev->l2ad_hand, buf_sz, buf_data, ZIO_CHECKSUM_OFF, @@ -6436,14 +6456,14 @@ l2arc_write_buffers(spa_t *spa, l2arc_de zio_t *, wzio); (void) zio_nowait(wzio); - write_asize += buf_sz; + stats_size += buf_sz; /* * Keep the clock hand suitably device-aligned. */ - buf_p_sz = vdev_psize_to_asize(dev->l2ad_vdev, buf_sz); - write_psize += buf_p_sz; - dev->l2ad_hand += buf_p_sz; + buf_a_sz = vdev_psize_to_asize(dev->l2ad_vdev, buf_sz); + write_asize += buf_a_sz; + dev->l2ad_hand += buf_a_sz; } } @@ -6453,8 +6473,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de ARCSTAT_BUMP(arcstat_l2_writes_sent); ARCSTAT_INCR(arcstat_l2_write_bytes, write_asize); ARCSTAT_INCR(arcstat_l2_size, write_sz); - ARCSTAT_INCR(arcstat_l2_asize, write_asize); - vdev_space_update(dev->l2ad_vdev, write_asize, 0, 0); + ARCSTAT_INCR(arcstat_l2_asize, stats_size); + vdev_space_update(dev->l2ad_vdev, stats_size, 0, 0); /* * Bump device hand to the device start if it is approaching the end. From owner-svn-src-head@freebsd.org Mon Aug 24 08:26:38 2015 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 8601A9BF8FB; Mon, 24 Aug 2015 08:26:38 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-yk0-x22e.google.com (mail-yk0-x22e.google.com [IPv6:2607:f8b0:4002:c07::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 40FF31EBB; Mon, 24 Aug 2015 08:26:38 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: by ykfw73 with SMTP id w73so127420621ykf.3; Mon, 24 Aug 2015 01:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=jZCcd0OBJ4hGTljU/eM9lmW99AyXMiB+3Lwpoie4G40=; b=QowTyU5YfP0B/I1vNiyp0hJrpQ3Xtr3m/hGMhiPmqeuMFbekS9cZbcneYBuAPwKJzw AaQQJkS4ZjI2YBCgcsLwxIYciQ6vnzCVHaNUiVJpUe2cFjZhZXoo4C5mOKfufEtaU5cS Qtv6PrPK6VLk8zUhJ7qxljYHQorzItknZSg1kOkBCieRNDMAI63JZKhPhToI9Syl3QP+ oX8zb3JY8POCSKRWxgahi5H9c+2/TSXNtnWdgyTfXJul987jkJNk4dJrqW5kP2mfM6TE F0lh4xs21mtcZzVtjSBaiQSL5bukyrw8Tx4xYxkky6vk0cHgpo903Hh5cXAr9CFqykb6 Ncaw== MIME-Version: 1.0 X-Received: by 10.170.190.136 with SMTP id h130mr27397661yke.70.1440404797268; Mon, 24 Aug 2015 01:26:37 -0700 (PDT) Received: by 10.129.73.205 with HTTP; Mon, 24 Aug 2015 01:26:37 -0700 (PDT) In-Reply-To: References: <201508212202.t7LM2MhF015522@repo.freebsd.org> Date: Mon, 24 Aug 2015 10:26:37 +0200 Message-ID: Subject: Re: svn commit: r287009 - in head: sbin/pfctl share/man/man4 sys/conf sys/net/altq sys/netpfil/pf From: =?UTF-8?Q?Ermal_Lu=C3=A7i?= To: Luiz Otavio O Souza Cc: Luiz Otavio O Souza , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 24 Aug 2015 08:26:38 -0000 On Sun, Aug 23, 2015 at 12:34 AM, Luiz Otavio O Souza wrote: > On Sat, Aug 22, 2015 at 6:18 AM, Ermal Lu=C3=A7i wrote: > > > > > > On Sat, Aug 22, 2015 at 12:02 AM, Luiz Otavio O Souza > > wrote: > >> > >> Author: loos > >> Date: Fri Aug 21 22:02:22 2015 > >> New Revision: 287009 > >> URL: https://svnweb.freebsd.org/changeset/base/287009 > >> > >> Log: > >> Add ALTQ(9) support for the CoDel algorithm. > >> > >> CoDel is a parameterless queue discipline that handles variable > >> bandwidth > >> and RTT. > >> > >> It can be used as the single queue discipline on an interface or as = a > >> sub > >> discipline of existing queue disciplines such as PRIQ, CBQ, HFSC, > FAIRQ. > >> > >> Differential Revision: https://reviews.freebsd.org/D3272 > >> Reviewd by: rpaulo, gnn (previous version) > > > > > > I thought part of this commit message was taken from me as a reviewer, > no? > > Sorry Ermal, my bad. As you only commented and not accepted the review > I thought you don't want to be implied with a reviewed by. > No issue just to be sure that you understood the whole thing there! > > [...] > > >> Added: head/sys/net/altq/altq_codel.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 > >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) > >> +++ head/sys/net/altq/altq_codel.c Fri Aug 21 22:02:22 2015 > >> (r287009) > >> @@ -0,0 +1,477 @@ > >> +/* > >> + * CoDel - The Controlled-Delay Active Queue Management algorithm > >> + * > >> + * Copyright (C) 2013 Ermal Luci > > > > > > Can you correct my name? > > > > Sure, I'll commit the fix soon (probably on monday) I'm AFK this weekend. > > No rush :) > I really appreciate your work on Codel. > > Regards, > Luiz > --=20 Ermal From owner-svn-src-head@freebsd.org Mon Aug 24 08:44:45 2015 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 E40539BFF3A; Mon, 24 Aug 2015 08:44:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D4859BBD; Mon, 24 Aug 2015 08:44:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O8ijDU009409; Mon, 24 Aug 2015 08:44:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O8ijxD009408; Mon, 24 Aug 2015 08:44:45 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201508240844.t7O8ijxD009408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 24 Aug 2015 08:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287100 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.20 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, 24 Aug 2015 08:44:46 -0000 Author: avg Date: Mon Aug 24 08:44:44 2015 New Revision: 287100 URL: https://svnweb.freebsd.org/changeset/base/287100 Log: spa_import_rootpool: prevent lock and resource leak The lock leak could lead to a deadlock later. PR: 198563 Submitted by: Fabian Keil MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Aug 24 08:10:52 2015 (r287099) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Aug 24 08:44:44 2015 (r287100) @@ -4146,6 +4146,8 @@ spa_import_rootpool(const char *name) &spa->spa_ubsync.ub_version) != 0) spa->spa_ubsync.ub_version = SPA_VERSION_INITIAL; } else if ((spa = spa_lookup(name)) == NULL) { + mutex_exit(&spa_namespace_lock); + nvlist_free(config); cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", name); return (EIO); From owner-svn-src-head@freebsd.org Mon Aug 24 09:30:28 2015 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 A83CB9C1EC6; Mon, 24 Aug 2015 09:30:28 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8EE2482B; Mon, 24 Aug 2015 09:30:28 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O9USCL028249; Mon, 24 Aug 2015 09:30:28 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O9US2T028246; Mon, 24 Aug 2015 09:30:28 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201508240930.t7O9US2T028246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Mon, 24 Aug 2015 09:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287101 - 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.20 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, 24 Aug 2015 09:30:28 -0000 Author: jch Date: Mon Aug 24 09:30:27 2015 New Revision: 287101 URL: https://svnweb.freebsd.org/changeset/base/287101 Log: Revert r284245: "Fix a callout race condition introduced in TCP timers callouts with r281599." r281599 fixed a TCP timer race condition, but due a callout(9) bug it also introduced another race condition workaround-ed with r284245. The callout(9) bug being fixed with r286880, we can now revert the workaround (r284245). Differential Revision: https://reviews.freebsd.org/D2079 (Initial change) Differential Revision: https://reviews.freebsd.org/D2763 (Workaround) Differential Revision: https://reviews.freebsd.org/D3078 (Fix) Sponsored by: Verisign, Inc. MFC after: 2 weeks Modified: head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Mon Aug 24 08:44:44 2015 (r287100) +++ head/sys/netinet/tcp_timer.c Mon Aug 24 09:30:27 2015 (r287101) @@ -355,12 +355,10 @@ tcp_timer_2msl(void *xtp) TCPSTAT_INC(tcps_finwait2_drops); tp = tcp_close(tp); } else { - if (ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) { - if (!callout_reset(&tp->t_timers->tt_2msl, - TP_KEEPINTVL(tp), tcp_timer_2msl, tp)) { - tp->t_timers->tt_flags &= ~TT_2MSL_RST; - } - } else + if (ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) + callout_reset(&tp->t_timers->tt_2msl, + TP_KEEPINTVL(tp), tcp_timer_2msl, tp); + else tp = tcp_close(tp); } @@ -440,14 +438,11 @@ tcp_timer_keep(void *xtp) tp->rcv_nxt, tp->snd_una - 1, 0); free(t_template, M_TEMP); } - if (!callout_reset(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), - tcp_timer_keep, tp)) { - tp->t_timers->tt_flags &= ~TT_KEEP_RST; - } - } else if (!callout_reset(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), - tcp_timer_keep, tp)) { - tp->t_timers->tt_flags &= ~TT_KEEP_RST; - } + callout_reset(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), + tcp_timer_keep, tp); + } else + callout_reset(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), + tcp_timer_keep, tp); #ifdef TCPDEBUG if (inp->inp_socket->so_options & SO_DEBUG) @@ -806,7 +801,6 @@ tcp_timer_activate(struct tcpcb *tp, uin timeout_t *f_callout; struct inpcb *inp = tp->t_inpcb; int cpu = inp_to_cpuid(inp); - uint32_t f_reset; #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) @@ -820,49 +814,38 @@ tcp_timer_activate(struct tcpcb *tp, uin case TT_DELACK: t_callout = &tp->t_timers->tt_delack; f_callout = tcp_timer_delack; - f_reset = TT_DELACK_RST; break; case TT_REXMT: t_callout = &tp->t_timers->tt_rexmt; f_callout = tcp_timer_rexmt; - f_reset = TT_REXMT_RST; break; case TT_PERSIST: t_callout = &tp->t_timers->tt_persist; f_callout = tcp_timer_persist; - f_reset = TT_PERSIST_RST; break; case TT_KEEP: t_callout = &tp->t_timers->tt_keep; f_callout = tcp_timer_keep; - f_reset = TT_KEEP_RST; break; case TT_2MSL: t_callout = &tp->t_timers->tt_2msl; f_callout = tcp_timer_2msl; - f_reset = TT_2MSL_RST; break; default: panic("tp %p bad timer_type %#x", tp, timer_type); } if (delta == 0) { if ((tp->t_timers->tt_flags & timer_type) && - callout_stop(t_callout) && - (tp->t_timers->tt_flags & f_reset)) { - tp->t_timers->tt_flags &= ~(timer_type | f_reset); + callout_stop(t_callout)) { + tp->t_timers->tt_flags &= ~timer_type; } } else { if ((tp->t_timers->tt_flags & timer_type) == 0) { - tp->t_timers->tt_flags |= (timer_type | f_reset); + tp->t_timers->tt_flags |= timer_type; callout_reset_on(t_callout, delta, f_callout, tp, cpu); } else { /* Reset already running callout on the same CPU. */ - if (!callout_reset(t_callout, delta, f_callout, tp)) { - /* - * Callout not cancelled, consider it as not - * properly restarted. */ - tp->t_timers->tt_flags &= ~f_reset; - } + callout_reset(t_callout, delta, f_callout, tp); } } } @@ -899,7 +882,6 @@ tcp_timer_stop(struct tcpcb *tp, uint32_ { struct callout *t_callout; timeout_t *f_callout; - uint32_t f_reset; tp->t_timers->tt_flags |= TT_STOPPED; @@ -907,36 +889,30 @@ tcp_timer_stop(struct tcpcb *tp, uint32_ case TT_DELACK: t_callout = &tp->t_timers->tt_delack; f_callout = tcp_timer_delack_discard; - f_reset = TT_DELACK_RST; break; case TT_REXMT: t_callout = &tp->t_timers->tt_rexmt; f_callout = tcp_timer_rexmt_discard; - f_reset = TT_REXMT_RST; break; case TT_PERSIST: t_callout = &tp->t_timers->tt_persist; f_callout = tcp_timer_persist_discard; - f_reset = TT_PERSIST_RST; break; case TT_KEEP: t_callout = &tp->t_timers->tt_keep; f_callout = tcp_timer_keep_discard; - f_reset = TT_KEEP_RST; break; case TT_2MSL: t_callout = &tp->t_timers->tt_2msl; f_callout = tcp_timer_2msl_discard; - f_reset = TT_2MSL_RST; break; default: panic("tp %p bad timer_type %#x", tp, timer_type); } if (tp->t_timers->tt_flags & timer_type) { - if (callout_stop(t_callout) && - (tp->t_timers->tt_flags & f_reset)) { - tp->t_timers->tt_flags &= ~(timer_type | f_reset); + if (callout_stop(t_callout)) { + tp->t_timers->tt_flags &= ~timer_type; } else { /* * Can't stop the callout, defer tcpcb actual deletion Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Mon Aug 24 08:44:44 2015 (r287100) +++ head/sys/netinet/tcp_timer.h Mon Aug 24 09:30:27 2015 (r287101) @@ -159,12 +159,6 @@ struct tcp_timer { #define TT_2MSL 0x0010 #define TT_MASK (TT_DELACK|TT_REXMT|TT_PERSIST|TT_KEEP|TT_2MSL) -#define TT_DELACK_RST 0x0100 -#define TT_REXMT_RST 0x0200 -#define TT_PERSIST_RST 0x0400 -#define TT_KEEP_RST 0x0800 -#define TT_2MSL_RST 0x1000 - #define TT_STOPPED 0x00010000 #define TP_KEEPINIT(tp) ((tp)->t_keepinit ? (tp)->t_keepinit : tcp_keepinit) From owner-svn-src-head@freebsd.org Mon Aug 24 09:33:13 2015 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 72DF99C1FD7; Mon, 24 Aug 2015 09:33:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 631BFB97; Mon, 24 Aug 2015 09:33:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O9XDtD031549; Mon, 24 Aug 2015 09:33:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O9XDle031548; Mon, 24 Aug 2015 09:33:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508240933.t7O9XDle031548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 24 Aug 2015 09:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287102 - head/usr.sbin/ctld 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.20 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, 24 Aug 2015 09:33:13 -0000 Author: trasz Date: Mon Aug 24 09:33:12 2015 New Revision: 287102 URL: https://svnweb.freebsd.org/changeset/base/287102 Log: Some random tweaks to ctl.conf(5). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Mon Aug 24 09:30:27 2015 (r287101) +++ head/usr.sbin/ctld/ctl.conf.5 Mon Aug 24 09:33:12 2015 (r287102) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 24, 2015 +.Dd August 24, 2015 .Dt CTL.CONF 5 .Os .Sh NAME @@ -104,11 +104,11 @@ which can then be assigned to any number .It Ic lun Ar name Create a .Sy lun -configuration context, defining a LUN to be exported by some target(s). +configuration context, defining a LUN to be exported by any number of targets. .It Ic target Ar name Create a .Sy target -configuration context, which can contain one or more +configuration context, which can optionally contain one or more .Sy lun contexts. .It Ic timeout Ar seconds @@ -265,9 +265,10 @@ Another predefined .Qq Ar no-authentication , may be used to permit access without authentication. -Note that targets must only use one of -.Sy auth-group , chap , No or Sy chap-mutual ; -it is a configuration error to mix multiple types in one target. +Note that this clause can be overridden using the second argument +to a +.Sy portal-group +clause. .It Ic auth-type Ar type Sets the authentication type. Type can be either @@ -314,20 +315,42 @@ This clause is mutually exclusive with .Sy auth-group ; one cannot use both in a single target. -.It Ic portal-group Ar name Op Ar agname +.Pp +The +.Sy auth-type , +.Sy chap , +.Sy chap-mutual , +.Sy initiator-name , +and +.Sy initiator-portal +clauses in the target context provide an alternative to assigning an +.Sy auth-group +defined separately, useful in the common case of authentication settings +specific to a single target. +.It Ic portal-group Ar name Op Ar ag-name Assign a previously defined portal group to the target. The default portal group is .Qq Ar default , which makes the target available on TCP port 3260 on all configured IPv4 and IPv6 addresses. -Optional second argument specifies auth group name for connections -to this specific portal group. -If second argument is not specified, target auth group is used. +Optional second argument specifies +.Sy auth-group +for connections to this specific portal group. +If second argument is not specified, target +.Sy auth-group +is used. .It Ic port Ar name .It Ic port Ar name/pp .It Ic port Ar name/pp/vp Assign specified CTL port (such as "isp0" or "isp2/1") to the target. -On startup ctld configures LUN mapping and enables all assigned ports. +This is used to export the target through a specific physical - eg Fibre +Channel - port, in addition to portal-groups configured for the target. +Use +.Cm "ctladm portlist" +command to retrieve the list of available ports. +On startup +.Xr ctld 8 +configures LUN mapping and enables all assigned ports. Each port can be assigned to only one target. .It Ic redirect Ar address IPv4 or IPv6 address to redirect initiators to. @@ -342,6 +365,9 @@ by the parent target. Create a .Sy lun configuration context, defining a LUN exported by the parent target. +.Pp +This is an alternative to defining the LUN separately, useful in the common +case of a LUN being exported by a single target. .El .Ss lun Context .Bl -tag -width indent @@ -429,7 +455,7 @@ target iqn.2012-06.com.example:target1 { lun 0 example_1 lun 1 { path /dev/zvol/tank/example_2 - option foo bar + option vendor "FreeBSD" } } From owner-svn-src-head@freebsd.org Mon Aug 24 09:48:52 2015 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 30E129C14EE; Mon, 24 Aug 2015 09:48:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 20A9411F6; Mon, 24 Aug 2015 09:48:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7O9mpeS037105; Mon, 24 Aug 2015 09:48:51 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7O9mpsP037099; Mon, 24 Aug 2015 09:48:51 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201508240948.t7O9mpsP037099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 24 Aug 2015 09:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287103 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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.20 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, 24 Aug 2015 09:48:52 -0000 Author: avg Date: Mon Aug 24 09:48:50 2015 New Revision: 287103 URL: https://svnweb.freebsd.org/changeset/base/287103 Log: MFV (partial) r286889: 5692 expose the number of hole blocks in a file FreeBSD porting notes: - only kernel-side changes are merged - the new ioctl is not actually implemented yet - thus, the goal is to synchronize DMU code illumos/illumos-gate@2bcf0248e992f292c7b814458bcdce2f004925d6 https://www.illumos.org/issues/5692 we would like to expose the number of hole (sparse) blocks in a file. this can be useful to for example if you want to fill in the holes with some data; knowing the number of holes in advances allows you to report progress on hole filling. We could use SEEK_HOLE to do that but it would be O(n) where n is the number of holes present in the file. Author: Max Grossman Reviewed by: Adam Leventhal Reviewed by: Matthew Ahrens Reviewed by: Boris Protopopov Approved by: Richard Lowe Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Aug 24 09:33:12 2015 (r287102) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Aug 24 09:48:50 2015 (r287103) @@ -1900,25 +1900,20 @@ int dmu_offset_next(objset_t *os, uint64_t object, boolean_t hole, uint64_t *off) { dnode_t *dn; - int i, err; + int err; - err = dnode_hold(os, object, FTAG, &dn); - if (err) - return (err); /* * Sync any current changes before * we go trundling through the block pointers. */ - for (i = 0; i < TXG_SIZE; i++) { - if (list_link_active(&dn->dn_dirty_link[i])) - break; + err = dmu_object_wait_synced(os, object); + if (err) { + return (err); } - if (i != TXG_SIZE) { - dnode_rele(dn, FTAG); - txg_wait_synced(dmu_objset_pool(os), 0); - err = dnode_hold(os, object, FTAG, &dn); - if (err) - return (err); + + err = dnode_hold(os, object, FTAG, &dn); + if (err) { + return (err); } err = dnode_next_offset(dn, (hole ? DNODE_FIND_HOLE : 0), off, 1, 1, 0); @@ -1927,6 +1922,36 @@ dmu_offset_next(objset_t *os, uint64_t o return (err); } +/* + * Given the ZFS object, if it contains any dirty nodes + * this function flushes all dirty blocks to disk. This + * ensures the DMU object info is updated. A more efficient + * future version might just find the TXG with the maximum + * ID and wait for that to be synced. + */ +int +dmu_object_wait_synced(objset_t *os, uint64_t object) { + dnode_t *dn; + int error, i; + + error = dnode_hold(os, object, FTAG, &dn); + if (error) { + return (error); + } + + for (i = 0; i < TXG_SIZE; i++) { + if (list_link_active(&dn->dn_dirty_link[i])) { + break; + } + } + dnode_rele(dn, FTAG); + if (i != TXG_SIZE) { + txg_wait_synced(dmu_objset_pool(os), 0); + } + + return (0); +} + void dmu_object_info_from_dnode(dnode_t *dn, dmu_object_info_t *doi) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Mon Aug 24 09:33:12 2015 (r287102) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Mon Aug 24 09:48:50 2015 (r287103) @@ -915,6 +915,15 @@ int dmu_offset_next(objset_t *os, uint64 uint64_t *off); /* + * Check if a DMU object has any dirty blocks. If so, sync out + * all pending transaction groups. Otherwise, this function + * does not alter DMU state. This could be improved to only sync + * out the necessary transaction groups for this particular + * object. + */ +int dmu_object_wait_synced(objset_t *os, uint64_t object); + +/* * Initial setup and final teardown. */ extern void dmu_init(void); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 24 09:33:12 2015 (r287102) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 24 09:48:50 2015 (r287103) @@ -293,24 +293,31 @@ zfs_ioctl(vnode_t *vp, u_long com, intpt int *rvalp, caller_context_t *ct) { offset_t off; + offset_t ndata; + dmu_object_info_t doi; int error; zfsvfs_t *zfsvfs; znode_t *zp; switch (com) { case _FIOFFS: + { return (0); /* * The following two ioctls are used by bfu. Faking out, * necessary to avoid bfu errors. */ + } case _FIOGDIO: case _FIOSDIO: + { return (0); + } case _FIO_SEEK_DATA: case _FIO_SEEK_HOLE: + { #ifdef illumos if (ddi_copyin((void *)data, &off, sizeof (off), flag)) return (SET_ERROR(EFAULT)); @@ -335,6 +342,48 @@ zfs_ioctl(vnode_t *vp, u_long com, intpt #endif return (0); } +#ifdef illumos + case _FIO_COUNT_FILLED: + { + /* + * _FIO_COUNT_FILLED adds a new ioctl command which + * exposes the number of filled blocks in a + * ZFS object. + */ + zp = VTOZ(vp); + zfsvfs = zp->z_zfsvfs; + ZFS_ENTER(zfsvfs); + ZFS_VERIFY_ZP(zp); + + /* + * Wait for all dirty blocks for this object + * to get synced out to disk, and the DMU info + * updated. + */ + error = dmu_object_wait_synced(zfsvfs->z_os, zp->z_id); + if (error) { + ZFS_EXIT(zfsvfs); + return (error); + } + + /* + * Retrieve fill count from DMU object. + */ + error = dmu_object_info(zfsvfs->z_os, zp->z_id, &doi); + if (error) { + ZFS_EXIT(zfsvfs); + return (error); + } + + ndata = doi.doi_fill_count; + + ZFS_EXIT(zfsvfs); + if (ddi_copyout(&ndata, (void *)data, sizeof (ndata), flag)) + return (SET_ERROR(EFAULT)); + return (0); + } +#endif + } return (SET_ERROR(ENOTTY)); } From owner-svn-src-head@freebsd.org Mon Aug 24 10:30:02 2015 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 2F8C49BE97C for ; Mon, 24 Aug 2015 10:30:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 706239CC for ; Mon, 24 Aug 2015 10:30:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA14716; Mon, 24 Aug 2015 13:29:59 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ZTp0p-000IfY-59; Mon, 24 Aug 2015 13:29:59 +0300 Subject: Re: svn commit: r285021 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Fabian Keil References: <201507020832.t628W3WJ002944@repo.freebsd.org> <55BF6A84.1040808@FreeBSD.org> <25a69eb6.5dfe13af@fabiankeil.de> Cc: "svn-src-head@freebsd.org" From: Andriy Gapon Message-ID: <55DAF1EF.2080900@FreeBSD.org> Date: Mon, 24 Aug 2015 13:29:03 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <25a69eb6.5dfe13af@fabiankeil.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 24 Aug 2015 10:30:02 -0000 On 03/08/2015 16:29, Fabian Keil wrote: > Andriy Gapon wrote: > >> On 30/07/2015 10:24, K. Macy wrote: >>> Just FYI this change introduces a deadlock with with the >>> spa_namespace_lock. Mount will be holding this lock while trying to >>> acquire the spa_namespace_lock. zfskern on the other hand holds the >>> spa_namespace_lock when calling zfs_freebsd_access which in turn >>> tries to acquire the teardown lock. >> >> I missed the fact that zpool.cache file is being written with spa_namespace_lock >> held. >> I'll try to either resolve the problem in the next day or I will revert the change. > > BTW, there's another (unrelated) spa_namespace_lock issue in spa_import_rootpool(): > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198563 Committed. Thank you! -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Aug 24 10:55:55 2015 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 C968D9C037B; Mon, 24 Aug 2015 10:55:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 BA05B1250; Mon, 24 Aug 2015 10:55:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OAttKO070955; Mon, 24 Aug 2015 10:55:55 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OAtth3070954; Mon, 24 Aug 2015 10:55:55 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508241055.t7OAtth3070954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 24 Aug 2015 10:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287104 - head/sys/arm64/arm64 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.20 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, 24 Aug 2015 10:55:55 -0000 Author: andrew Date: Mon Aug 24 10:55:54 2015 New Revision: 287104 URL: https://svnweb.freebsd.org/changeset/base/287104 Log: Add pages used by the PV entries to minidumps. Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Aug 24 09:48:50 2015 (r287103) +++ head/sys/arm64/arm64/pmap.c Mon Aug 24 10:55:54 2015 (r287104) @@ -1516,9 +1516,7 @@ free_pv_chunk(struct pv_chunk *pc) PV_STAT(atomic_add_int(&pc_chunk_frees, 1)); /* entire chunk is free, return it */ m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); -#if 0 /* TODO: For minidump */ dump_drop_page(m->phys_addr); -#endif vm_page_unwire(m, PQ_INACTIVE); vm_page_free(m); } @@ -1580,9 +1578,7 @@ retry: } PV_STAT(atomic_add_int(&pc_chunk_count, 1)); PV_STAT(atomic_add_int(&pc_chunk_allocs, 1)); -#if 0 /* TODO: This is for minidump */ dump_add_page(m->phys_addr); -#endif pc = (void *)PHYS_TO_DMAP(m->phys_addr); pc->pc_pmap = pmap; pc->pc_map[0] = PC_FREE0 & ~1ul; /* preallocated bit 0 */ From owner-svn-src-head@freebsd.org Mon Aug 24 12:01:39 2015 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 F38149C2279; Mon, 24 Aug 2015 12:01:39 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E46DF1257; Mon, 24 Aug 2015 12:01:39 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OC1dqu004885; Mon, 24 Aug 2015 12:01:39 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OC1diU004884; Mon, 24 Aug 2015 12:01:39 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508241201.t7OC1diU004884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 24 Aug 2015 12:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287105 - head/sys/arm64/arm64 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.20 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, 24 Aug 2015 12:01:40 -0000 Author: andrew Date: Mon Aug 24 12:01:39 2015 New Revision: 287105 URL: https://svnweb.freebsd.org/changeset/base/287105 Log: Add support for pmap_sync_icache on arm64. Reviewed by: emaste, imp (both earlier version) Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3438 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Aug 24 10:55:54 2015 (r287104) +++ head/sys/arm64/arm64/pmap.c Mon Aug 24 12:01:39 2015 (r287105) @@ -3050,10 +3050,32 @@ pmap_activate(struct thread *td) } void -pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +pmap_sync_icache(pmap_t pmap, vm_offset_t va, vm_size_t sz) { - panic("ARM64TODO: pmap_sync_icache"); + if (va >= VM_MIN_KERNEL_ADDRESS) { + cpu_icache_sync_range(va, sz); + } else { + u_int len, offset; + vm_paddr_t pa; + + /* Find the length of data in this page to flush */ + offset = va & PAGE_MASK; + len = imin(PAGE_SIZE - offset, sz); + + while (sz != 0) { + /* Extract the physical address & find it in the DMAP */ + pa = pmap_extract(pmap, va); + if (pa != 0) + cpu_icache_sync_range(PHYS_TO_DMAP(pa), len); + + /* Move to the next page */ + sz -= len; + va += len; + /* Set the length for the next iteration */ + len = imin(PAGE_SIZE, sz); + } + } } /* From owner-svn-src-head@freebsd.org Mon Aug 24 12:17:16 2015 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 1F3AE9C2830; Mon, 24 Aug 2015 12:17:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 1021C1D2E; Mon, 24 Aug 2015 12:17:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OCHFoa010802; Mon, 24 Aug 2015 12:17:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OCHFL8010800; Mon, 24 Aug 2015 12:17:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508241217.t7OCHFL8010800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 24 Aug 2015 12:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287106 - head/lib/libproc 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.20 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, 24 Aug 2015 12:17:16 -0000 Author: andrew Date: Mon Aug 24 12:17:15 2015 New Revision: 287106 URL: https://svnweb.freebsd.org/changeset/base/287106 Log: Fix libproc on architectures that don't need the program counter to be adjusted. This seems to be the case on all non-x86 architectures libproc supports. Reviewed by: kib Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3465 Modified: head/lib/libproc/proc_bkpt.c Modified: head/lib/libproc/proc_bkpt.c ============================================================================== --- head/lib/libproc/proc_bkpt.c Mon Aug 24 12:01:39 2015 (r287105) +++ head/lib/libproc/proc_bkpt.c Mon Aug 24 12:17:15 2015 (r287106) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #elif defined(__amd64__) || defined(__i386__) #define BREAKPOINT_INSTR 0xcc /* int 0x3 */ #define BREAKPOINT_INSTR_SZ 1 +#define BREAKPOINT_ADJUST_SZ BREAKPOINT_INSTR_SZ #elif defined(__arm__) #define BREAKPOINT_INSTR 0xe7ffffff /* bkpt */ #define BREAKPOINT_INSTR_SZ 4 @@ -195,11 +196,19 @@ proc_bkptdel(struct proc_handle *phdl, u /* * Decrement pc so that we delete the breakpoint at the correct * address, i.e. at the BREAKPOINT_INSTR address. + * + * This is only needed on some architectures where the pc value + * when reading registers points at the instruction after the + * breakpoint, e.g. x86. */ void proc_bkptregadj(unsigned long *pc) { - *pc = *pc - BREAKPOINT_INSTR_SZ; + + (void)pc; +#ifdef BREAKPOINT_ADJUST_SZ + *pc = *pc - BREAKPOINT_ADJUST_SZ; +#endif } /* From owner-svn-src-head@freebsd.org Mon Aug 24 13:18:15 2015 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 7ED389C12D4; Mon, 24 Aug 2015 13:18:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6F666B7; Mon, 24 Aug 2015 13:18:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7ODIFnA039802; Mon, 24 Aug 2015 13:18:15 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7ODIEiL039798; Mon, 24 Aug 2015 13:18:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508241318.t7ODIEiL039798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 24 Aug 2015 13:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287107 - in head/sys: kern 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.20 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, 24 Aug 2015 13:18:15 -0000 Author: trasz Date: Mon Aug 24 13:18:13 2015 New Revision: 287107 URL: https://svnweb.freebsd.org/changeset/base/287107 Log: Make vfs_unmountall() unmount /dev after /, not before. The only reason this didn't result in an unclean shutdown is that devfs ignores MNT_FORCE flag. Reviewed by: kib@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3467 Modified: head/sys/kern/vfs_mount.c head/sys/kern/vfs_mountroot.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Aug 24 12:17:15 2015 (r287106) +++ head/sys/kern/vfs_mount.c Mon Aug 24 13:18:13 2015 (r287107) @@ -1359,6 +1359,8 @@ dounmount(struct mount *mp, int flags, s vput(coveredvp); } vfs_event_signal(NULL, VQ_UNMOUNT, 0); + if (mp == rootdevmp) + rootdevmp = NULL; vfs_mount_destroy(mp); return (0); } Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Mon Aug 24 12:17:15 2015 (r287106) +++ head/sys/kern/vfs_mountroot.c Mon Aug 24 13:18:13 2015 (r287107) @@ -95,6 +95,11 @@ static struct mntarg *parse_mountroot_op */ struct vnode *rootvnode; +/* + * Mount of the system's /dev. + */ +struct mount *rootdevmp; + char *rootdevnames[2] = {NULL, NULL}; struct mtx root_holds_mtx; @@ -236,6 +241,7 @@ vfs_mountroot_devfs(struct thread *td, s mtx_unlock(&mountlist_mtx); *mpp = mp; + rootdevmp = mp; set_rootvnode(); error = kern_symlinkat(td, "/", AT_FDCWD, "dev", UIO_SYSSPACE); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Aug 24 12:17:15 2015 (r287106) +++ head/sys/kern/vfs_subr.c Mon Aug 24 13:18:13 2015 (r287107) @@ -3543,6 +3543,21 @@ SYSCTL_PROC(_kern, KERN_VNODE, vnode, CT ""); #endif +static void +unmount_or_warn(struct mount *mp) +{ + int error; + + error = dounmount(mp, MNT_FORCE, curthread); + if (error != 0) { + printf("unmount of %s failed (", mp->mnt_stat.f_mntonname); + if (error == EBUSY) + printf("BUSY)\n"); + else + printf("%d)\n", error); + } +} + /* * Unmount all filesystems. The list is traversed in reverse order * of mounting to avoid dependencies. @@ -3550,42 +3565,28 @@ SYSCTL_PROC(_kern, KERN_VNODE, vnode, CT void vfs_unmountall(void) { - struct mount *mp; - struct thread *td; - int error; + struct mount *mp, *tmp; CTR1(KTR_VFS, "%s: unmounting all filesystems", __func__); - td = curthread; /* * Since this only runs when rebooting, it is not interlocked. */ - while(!TAILQ_EMPTY(&mountlist)) { - mp = TAILQ_LAST(&mountlist, mntlist); + TAILQ_FOREACH_REVERSE_SAFE(mp, &mountlist, mntlist, mnt_list, tmp) { vfs_ref(mp); - error = dounmount(mp, MNT_FORCE, td); - if (error != 0) { - TAILQ_REMOVE(&mountlist, mp, mnt_list); - /* - * XXX: Due to the way in which we mount the root - * file system off of devfs, devfs will generate a - * "busy" warning when we try to unmount it before - * the root. Don't print a warning as a result in - * order to avoid false positive errors that may - * cause needless upset. - */ - if (strcmp(mp->mnt_vfc->vfc_name, "devfs") != 0) { - printf("unmount of %s failed (", - mp->mnt_stat.f_mntonname); - if (error == EBUSY) - printf("BUSY)\n"); - else - printf("%d)\n", error); - } - } else { - /* The unmount has removed mp from the mountlist */ - } + + /* + * Forcibly unmounting "/dev" before "/" would prevent clean + * unmount of the latter. + */ + if (mp == rootdevmp) + continue; + + unmount_or_warn(mp); } + + if (rootdevmp != NULL) + unmount_or_warn(rootdevmp); } /* Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Aug 24 12:17:15 2015 (r287106) +++ head/sys/sys/vnode.h Mon Aug 24 13:18:13 2015 (r287107) @@ -420,6 +420,7 @@ extern int vttoif_tab[]; * Global vnode data. */ extern struct vnode *rootvnode; /* root (i.e. "/") vnode */ +extern struct mount *rootdevmp; /* "/dev" mount */ extern int async_io_version; /* 0 or POSIX version of AIO i'face */ extern int desiredvnodes; /* number of vnodes desired */ extern struct uma_zone *namei_zone; From owner-svn-src-head@freebsd.org Mon Aug 24 13:46:13 2015 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 6777B9C1FD0; Mon, 24 Aug 2015 13:46:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 588041336; Mon, 24 Aug 2015 13:46:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7ODkDsB052029; Mon, 24 Aug 2015 13:46:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7ODkCpT052027; Mon, 24 Aug 2015 13:46:12 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508241346.t7ODkCpT052027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 24 Aug 2015 13:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287108 - in head: . share/mk 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.20 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, 24 Aug 2015 13:46:13 -0000 Author: bapt Date: Mon Aug 24 13:46:12 2015 New Revision: 287108 URL: https://svnweb.freebsd.org/changeset/base/287108 Log: Remove now unused LIBPRIVATEDIR Sponsored by: Gandi.net Modified: head/Makefile.inc1 head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Aug 24 13:18:13 2015 (r287107) +++ head/Makefile.inc1 Mon Aug 24 13:46:12 2015 (r287108) @@ -449,7 +449,6 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${LIB32 PATH=${TMPPATH} \ LIBDIR=/usr/lib32 \ SHLIBDIR=/usr/lib32 \ - LIBPRIVATEDIR=/usr/lib32/private \ DTRACE="${DTRACE} -32" LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAGS}" \ CXX="${XCXX} ${LIB32FLAGS}" \ Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Aug 24 13:18:13 2015 (r287107) +++ head/share/mk/bsd.own.mk Mon Aug 24 13:46:12 2015 (r287108) @@ -28,8 +28,6 @@ # # LIBCOMPATDIR Base path for compat libraries. [/usr/lib/compat] # -# LIBPRIVATEDIR Base path for private libraries. [/usr/lib/private] -# # LIBDATADIR Base path for misc. utility data files. [/usr/libdata] # # LIBEXECDIR Base path for system daemons and utilities. [/usr/libexec] @@ -171,7 +169,6 @@ DTBMODE?= 444 LIBDIR?= /usr/lib LIBCOMPATDIR?= /usr/lib/compat -LIBPRIVATEDIR?= /usr/lib/private LIBDATADIR?= /usr/libdata LIBEXECDIR?= /usr/libexec LINTLIBDIR?= /usr/libdata/lint From owner-svn-src-head@freebsd.org Mon Aug 24 14:04:45 2015 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 3A4BC9C2715; Mon, 24 Aug 2015 14:04:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2B436C2; Mon, 24 Aug 2015 14:04:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OE4j8B060090; Mon, 24 Aug 2015 14:04:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OE4j9N060089; Mon, 24 Aug 2015 14:04:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508241404.t7OE4j9N060089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 24 Aug 2015 14:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287109 - head/sys/fs/devfs 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.20 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, 24 Aug 2015 14:04:45 -0000 Author: trasz Date: Mon Aug 24 14:04:44 2015 New Revision: 287109 URL: https://svnweb.freebsd.org/changeset/base/287109 Log: Make it possible to forcibly unmount devfs. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/devfs/devfs_vfsops.c Modified: head/sys/fs/devfs/devfs_vfsops.c ============================================================================== --- head/sys/fs/devfs/devfs_vfsops.c Mon Aug 24 13:46:12 2015 (r287108) +++ head/sys/fs/devfs/devfs_vfsops.c Mon Aug 24 14:04:44 2015 (r287109) @@ -182,6 +182,8 @@ devfs_unmount(struct mount *mp, int mntf fmp = VFSTODEVFS(mp); KASSERT(fmp->dm_mount != NULL, ("devfs_unmount unmounted devfs_mount")); + if (mntflags & MNT_FORCE) + flags |= FORCECLOSE; /* There is 1 extra root vnode reference from devfs_mount(). */ error = vflush(mp, 1, flags, curthread); if (error) From owner-svn-src-head@freebsd.org Mon Aug 24 16:26:24 2015 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 6340E9C2156; Mon, 24 Aug 2015 16:26:24 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4FB571234; Mon, 24 Aug 2015 16:26:24 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OGQOTf017720; Mon, 24 Aug 2015 16:26:24 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OGQLGF017708; Mon, 24 Aug 2015 16:26:21 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508241626.t7OGQLGF017708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 24 Aug 2015 16:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287111 - in head: bin/ls bin/ps contrib/libxo contrib/libxo/bin contrib/libxo/doc contrib/libxo/encoder contrib/libxo/encoder/cbor contrib/libxo/encoder/test contrib/libxo/libxo contri... 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.20 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, 24 Aug 2015 16:26:24 -0000 Author: marcel Date: Mon Aug 24 16:26:20 2015 New Revision: 287111 URL: https://svnweb.freebsd.org/changeset/base/287111 Log: Upgrade libxo to 0.4.5. Local changes incorporated by 0.4.5: r284340 Local changes retained: r276260, r282117 Obtained from: https://github.com/Juniper/libxo Added: head/contrib/libxo/INSTALL.md head/contrib/libxo/encoder/ head/contrib/libxo/encoder/Makefile.am (contents, props changed) head/contrib/libxo/encoder/cbor/ head/contrib/libxo/encoder/cbor/Makefile.am (contents, props changed) head/contrib/libxo/encoder/cbor/enc_cbor.c (contents, props changed) head/contrib/libxo/encoder/test/ head/contrib/libxo/encoder/test/Makefile.am (contents, props changed) head/contrib/libxo/encoder/test/enc_test.c (contents, props changed) head/contrib/libxo/libxo/add.man head/contrib/libxo/libxo/add.man.in (contents, props changed) head/contrib/libxo/libxo/xo_buf.h (contents, props changed) head/contrib/libxo/libxo/xo_config.h - copied, changed from r287110, head/contrib/libxo/libxo/xoconfig.h head/contrib/libxo/libxo/xo_emit_err.3 (contents, props changed) head/contrib/libxo/libxo/xo_encoder.c (contents, props changed) head/contrib/libxo/libxo/xo_encoder.h (contents, props changed) head/contrib/libxo/libxo/xo_humanize.h (contents, props changed) head/contrib/libxo/libxo/xo_message.3 (contents, props changed) head/contrib/libxo/libxo/xo_set_syslog_enterprise_id.3 (contents, props changed) head/contrib/libxo/libxo/xo_syslog.3 (contents, props changed) head/contrib/libxo/libxo/xo_syslog.c (contents, props changed) head/contrib/libxo/libxo/xo_wcwidth.h (contents, props changed) head/contrib/libxo/tests/core/saved/test_01.E.err head/contrib/libxo/tests/core/saved/test_01.E.out head/contrib/libxo/tests/core/saved/test_02.E.err head/contrib/libxo/tests/core/saved/test_02.E.out head/contrib/libxo/tests/core/saved/test_03.E.err head/contrib/libxo/tests/core/saved/test_03.E.out head/contrib/libxo/tests/core/saved/test_04.E.err head/contrib/libxo/tests/core/saved/test_04.E.out head/contrib/libxo/tests/core/saved/test_05.E.err head/contrib/libxo/tests/core/saved/test_05.E.out (contents, props changed) head/contrib/libxo/tests/core/saved/test_06.E.err head/contrib/libxo/tests/core/saved/test_06.E.out head/contrib/libxo/tests/core/saved/test_07.E.err head/contrib/libxo/tests/core/saved/test_07.E.out head/contrib/libxo/tests/core/saved/test_08.E.err head/contrib/libxo/tests/core/saved/test_08.E.out head/contrib/libxo/tests/core/saved/test_09.E.err head/contrib/libxo/tests/core/saved/test_09.E.out head/contrib/libxo/tests/core/saved/test_10.E.err head/contrib/libxo/tests/core/saved/test_10.E.out head/contrib/libxo/tests/core/saved/test_11.E.err head/contrib/libxo/tests/core/saved/test_11.E.out head/contrib/libxo/tests/core/saved/test_11.H.err head/contrib/libxo/tests/core/saved/test_11.H.out head/contrib/libxo/tests/core/saved/test_11.HIPx.err head/contrib/libxo/tests/core/saved/test_11.HIPx.out head/contrib/libxo/tests/core/saved/test_11.HP.err head/contrib/libxo/tests/core/saved/test_11.HP.out head/contrib/libxo/tests/core/saved/test_11.J.err head/contrib/libxo/tests/core/saved/test_11.J.out head/contrib/libxo/tests/core/saved/test_11.JP.err head/contrib/libxo/tests/core/saved/test_11.JP.out head/contrib/libxo/tests/core/saved/test_11.T.err head/contrib/libxo/tests/core/saved/test_11.T.out head/contrib/libxo/tests/core/saved/test_11.X.err head/contrib/libxo/tests/core/saved/test_11.X.out head/contrib/libxo/tests/core/saved/test_11.XP.err head/contrib/libxo/tests/core/saved/test_11.XP.out head/contrib/libxo/tests/core/test_11.c (contents, props changed) head/contrib/libxo/tests/gettext/ head/contrib/libxo/tests/gettext/Makefile.am (contents, props changed) head/contrib/libxo/tests/gettext/gt_01.c (contents, props changed) head/contrib/libxo/tests/gettext/gt_01.pot head/contrib/libxo/tests/gettext/ldns.pot head/contrib/libxo/tests/gettext/po/ head/contrib/libxo/tests/gettext/po/pig_latin/ head/contrib/libxo/tests/gettext/po/pig_latin/gt_01.po head/contrib/libxo/tests/gettext/po/pig_latin/ldns.po head/contrib/libxo/tests/gettext/po/pig_latin/strerror.po head/contrib/libxo/tests/gettext/saved/ head/contrib/libxo/tests/gettext/saved/gt_01.H.err head/contrib/libxo/tests/gettext/saved/gt_01.H.out head/contrib/libxo/tests/gettext/saved/gt_01.HIPx.err head/contrib/libxo/tests/gettext/saved/gt_01.HIPx.out head/contrib/libxo/tests/gettext/saved/gt_01.HP.err head/contrib/libxo/tests/gettext/saved/gt_01.HP.out head/contrib/libxo/tests/gettext/saved/gt_01.J.err head/contrib/libxo/tests/gettext/saved/gt_01.J.out head/contrib/libxo/tests/gettext/saved/gt_01.JP.err head/contrib/libxo/tests/gettext/saved/gt_01.JP.out head/contrib/libxo/tests/gettext/saved/gt_01.T.err head/contrib/libxo/tests/gettext/saved/gt_01.T.out head/contrib/libxo/tests/gettext/saved/gt_01.X.err head/contrib/libxo/tests/gettext/saved/gt_01.X.out head/contrib/libxo/tests/gettext/saved/gt_01.XP.err head/contrib/libxo/tests/gettext/saved/gt_01.XP.out head/contrib/libxo/tests/gettext/strerror.pot head/contrib/libxo/xopo/ head/contrib/libxo/xopo/Makefile.am (contents, props changed) head/contrib/libxo/xopo/xopo.1 (contents, props changed) head/contrib/libxo/xopo/xopo.c (contents, props changed) Deleted: head/contrib/libxo/libxo/xoconfig.h head/contrib/libxo/libxo/xoconfig.h.in head/contrib/libxo/libxo/xoversion.h head/contrib/libxo/libxo/xoversion.h.in Modified: head/bin/ls/Makefile head/bin/ps/Makefile head/contrib/libxo/.gitignore head/contrib/libxo/.travis.yml head/contrib/libxo/Makefile.am head/contrib/libxo/bin/Zaliases head/contrib/libxo/bin/setup.sh head/contrib/libxo/configure.ac head/contrib/libxo/doc/Makefile.am head/contrib/libxo/doc/libxo.txt head/contrib/libxo/libxo/Makefile.am head/contrib/libxo/libxo/libxo.3 head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xo.h head/contrib/libxo/libxo/xo_attr.3 head/contrib/libxo/libxo/xo_create.3 head/contrib/libxo/libxo/xo_emit.3 head/contrib/libxo/libxo/xo_err.3 head/contrib/libxo/libxo/xo_error.3 head/contrib/libxo/libxo/xo_finish.3 head/contrib/libxo/libxo/xo_flush.3 head/contrib/libxo/libxo/xo_format.5 head/contrib/libxo/libxo/xo_no_setlocale.3 head/contrib/libxo/libxo/xo_open_container.3 head/contrib/libxo/libxo/xo_open_list.3 head/contrib/libxo/libxo/xo_open_marker.3 head/contrib/libxo/libxo/xo_parse_args.3 head/contrib/libxo/libxo/xo_set_allocator.3 head/contrib/libxo/libxo/xo_set_flags.3 head/contrib/libxo/libxo/xo_set_info.3 head/contrib/libxo/libxo/xo_set_options.3 head/contrib/libxo/libxo/xo_set_style.3 head/contrib/libxo/libxo/xo_set_version.3 head/contrib/libxo/libxo/xo_set_writer.3 head/contrib/libxo/tests/Makefile.am head/contrib/libxo/tests/core/Makefile.am head/contrib/libxo/tests/core/saved/test_01.H.out head/contrib/libxo/tests/core/saved/test_01.HIPx.out head/contrib/libxo/tests/core/saved/test_01.HP.out head/contrib/libxo/tests/core/saved/test_01.J.out head/contrib/libxo/tests/core/saved/test_01.JP.out head/contrib/libxo/tests/core/saved/test_01.T.out head/contrib/libxo/tests/core/saved/test_01.X.out head/contrib/libxo/tests/core/saved/test_01.XP.out head/contrib/libxo/tests/core/saved/test_02.H.out head/contrib/libxo/tests/core/saved/test_02.HIPx.out head/contrib/libxo/tests/core/saved/test_02.HP.out head/contrib/libxo/tests/core/saved/test_02.J.out head/contrib/libxo/tests/core/saved/test_02.JP.out head/contrib/libxo/tests/core/saved/test_02.T.out head/contrib/libxo/tests/core/saved/test_02.X.out head/contrib/libxo/tests/core/saved/test_02.XP.out head/contrib/libxo/tests/core/saved/test_05.H.out head/contrib/libxo/tests/core/saved/test_05.HIPx.out head/contrib/libxo/tests/core/saved/test_05.HP.out head/contrib/libxo/tests/core/saved/test_05.J.out head/contrib/libxo/tests/core/saved/test_05.JP.out (contents, props changed) head/contrib/libxo/tests/core/saved/test_05.T.out head/contrib/libxo/tests/core/saved/test_05.X.out (contents, props changed) head/contrib/libxo/tests/core/saved/test_05.XP.out (contents, props changed) head/contrib/libxo/tests/core/saved/test_08.H.err head/contrib/libxo/tests/core/saved/test_08.HIPx.err head/contrib/libxo/tests/core/saved/test_08.HIPx.out head/contrib/libxo/tests/core/saved/test_08.HP.err head/contrib/libxo/tests/core/saved/test_08.J.err head/contrib/libxo/tests/core/saved/test_08.J.out head/contrib/libxo/tests/core/saved/test_08.JP.err head/contrib/libxo/tests/core/saved/test_08.JP.out head/contrib/libxo/tests/core/saved/test_08.T.err head/contrib/libxo/tests/core/saved/test_08.X.err head/contrib/libxo/tests/core/saved/test_08.X.out head/contrib/libxo/tests/core/saved/test_08.XP.err head/contrib/libxo/tests/core/saved/test_08.XP.out head/contrib/libxo/tests/core/test_01.c head/contrib/libxo/tests/core/test_02.c head/contrib/libxo/tests/core/test_05.c head/contrib/libxo/tests/core/test_08.c head/contrib/libxo/xo/Makefile.am head/contrib/libxo/xo/xo.1 head/contrib/libxo/xo/xo.c head/contrib/libxo/xohtml/Makefile.am head/contrib/libxo/xohtml/xohtml.1 head/contrib/libxo/xolint/Makefile.am head/contrib/libxo/xolint/xolint.1 head/contrib/libxo/xolint/xolint.pl head/etc/mtree/BSD.usr.dist head/lib/libxo/Makefile head/libexec/ftpd/Makefile head/sbin/savecore/Makefile head/usr.bin/iscsictl/Makefile head/usr.bin/netstat/Makefile head/usr.bin/w/Makefile head/usr.bin/wc/Makefile head/usr.bin/xo/Makefile Modified: head/bin/ls/Makefile ============================================================================== --- head/bin/ls/Makefile Mon Aug 24 14:32:57 2015 (r287110) +++ head/bin/ls/Makefile Mon Aug 24 16:26:20 2015 (r287111) @@ -5,7 +5,7 @@ PROG= ls SRCS= cmp.c ls.c print.c util.c -LIBADD= util xo +LIBADD= xo util .if !defined(RELEASE_CRUNCH) && \ ${MK_LS_COLORS} != no Modified: head/bin/ps/Makefile ============================================================================== --- head/bin/ps/Makefile Mon Aug 24 14:32:57 2015 (r287110) +++ head/bin/ps/Makefile Mon Aug 24 16:26:20 2015 (r287111) @@ -11,6 +11,6 @@ SRCS= fmt.c keyword.c nlist.c print.c ps # on large systems. # CFLAGS+=-DLAZY_PS -LIBADD= m kvm jail xo +LIBADD= m kvm jail xo util .include Modified: head/contrib/libxo/.gitignore ============================================================================== --- head/contrib/libxo/.gitignore Mon Aug 24 14:32:57 2015 (r287110) +++ head/contrib/libxo/.gitignore Mon Aug 24 16:26:20 2015 (r287111) @@ -27,14 +27,17 @@ config.guess config.h.in config.sub depcomp +install-sh ltmain.sh missing +m4 Makefile.in configure .DS_Store xoconfig.h.in +xo_config.h.in .gdbinit .gdbinit.local Modified: head/contrib/libxo/.travis.yml ============================================================================== --- head/contrib/libxo/.travis.yml Mon Aug 24 14:32:57 2015 (r287110) +++ head/contrib/libxo/.travis.yml Mon Aug 24 16:26:20 2015 (r287111) @@ -1,6 +1,6 @@ language: c -script: printenv && uname -a && /bin/sh ./bin/setup.sh && cd build && ../configure --enable-warnings && make && sudo make install && make test +script: printenv && uname -a && ls -l && /bin/sh -x ./bin/setup.sh && cd build && ../configure --enable-warnings && make && sudo make install && make test notifications: recipients: Added: head/contrib/libxo/INSTALL.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libxo/INSTALL.md Mon Aug 24 16:26:20 2015 (r287111) @@ -0,0 +1,15 @@ + + +## Instructions for building libxo + +Instructions for building libxo are now available in the +[wiki](http://juniper.github.io/libxo/libxo-manual.html#getting-libxo). Modified: head/contrib/libxo/Makefile.am ============================================================================== --- head/contrib/libxo/Makefile.am Mon Aug 24 14:32:57 2015 (r287110) +++ head/contrib/libxo/Makefile.am Mon Aug 24 16:26:20 2015 (r287111) @@ -10,7 +10,7 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = libxo xo xolint xohtml tests doc +SUBDIRS = libxo xo xopo xolint xohtml tests doc encoder bin_SCRIPTS=libxo-config dist_doc_DATA = Copyright @@ -94,3 +94,9 @@ packages: && git commit -m 'new packaging data' \ ${GH_PACKAGING_DIR} \ && git push origin gh-pages ) ; true + +ANALYZE_DIR = ~/trash/libxo +ANALYZE_CMD = scan-build-mp-3.6 + +analyze: + ${ANALYZE_CMD} -o ${ANALYZE_DIR} ${MAKE} Modified: head/contrib/libxo/bin/Zaliases ============================================================================== --- head/contrib/libxo/bin/Zaliases Mon Aug 24 14:32:57 2015 (r287110) +++ head/contrib/libxo/bin/Zaliases Mon Aug 24 16:26:20 2015 (r287111) @@ -6,6 +6,7 @@ set opts=' \ --enable-debug \ --enable-warnings \ --enable-printflike \ +--with-gettext=/opt/local \ --prefix ${HOME}/work/root \ ' set opts=`echo $opts` @@ -22,3 +23,7 @@ cd build alias xx 'cc -I.. -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wformat -Wimplicit -Wmissing-declarations -Wnested-externs -Wparentheses -Wreturn-type -Wshadow -Wswitch -Wtrigraphs -Wuninitialized -Wunused -Wwrite-strings -fno-inline-functions-called-once -g -O2 -o xtest -DUNIT_TEST libxo.c' + +alias mm "make CFLAGS='-O0 -g'" + +alias mmi 'mm && mi' Modified: head/contrib/libxo/bin/setup.sh ============================================================================== --- head/contrib/libxo/bin/setup.sh Mon Aug 24 14:32:57 2015 (r287110) +++ head/contrib/libxo/bin/setup.sh Mon Aug 24 16:26:20 2015 (r287111) @@ -11,6 +11,8 @@ if [ ! -f configure ]; then vers=`autoreconf --version | head -1` echo "Using" $vers + mkdir -p m4 + autoreconf --install if [ ! -f configure ]; then Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Mon Aug 24 14:32:57 2015 (r287110) +++ head/contrib/libxo/configure.ac Mon Aug 24 16:26:20 2015 (r287111) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.3.2], [phil@juniper.net]) +AC_INIT([libxo], [0.4.5], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. @@ -54,12 +54,16 @@ AC_CHECK_FUNCS([sranddev srand strlcpy]) AC_CHECK_FUNCS([fdopen getrusage]) AC_CHECK_FUNCS([gettimeofday ctime]) AC_CHECK_FUNCS([getpass]) +AC_CHECK_FUNCS([getprogname]) AC_CHECK_FUNCS([sysctlbyname]) AC_CHECK_FUNCS([flock]) AC_CHECK_FUNCS([asprintf]) AC_CHECK_FUNCS([__flbf]) +AC_CHECK_FUNCS([sysctlbyname]) + AC_CHECK_HEADERS([dlfcn.h]) +AC_CHECK_HEADERS([dlfcn.h]) AC_CHECK_HEADERS([stdio_ext.h]) AC_CHECK_HEADERS([tzfile.h]) AC_CHECK_HEADERS([stdtime/tzfile.h]) @@ -69,10 +73,139 @@ AC_CHECK_HEADERS([sys/time.h]) AC_CHECK_HEADERS([ctype.h errno.h stdio.h stdlib.h]) AC_CHECK_HEADERS([string.h sys/param.h unistd.h ]) AC_CHECK_HEADERS([sys/sysctl.h]) +AC_CHECK_HEADERS([threads.h]) + +dnl humanize_number(3) is a great function, but it's not standard. +dnl Note Macosx has the function in libutil.a but doesn't ship the +dnl header file, so I'll need to carry my own implementation. See: +dnl https://devforums.apple.com/thread/271121 +AC_CHECK_HEADERS([libutil.h]) +AC_CHECK_LIB([util], [humanize_number], + [HAVE_HUMANIZE_NUMBER=$ac_cv_header_libutil_h], + [HAVE_HUMANIZE_NUMBER=no]) + +AC_MSG_RESULT(humanize_number results: :${HAVE_HUMANIZE_NUMBER}:${ac_cv_header_libutil_h}:) + +if test "$HAVE_HUMANIZE_NUMBER" = "yes"; then + AC_DEFINE([HAVE_HUMANIZE_NUMBER], [1], [humanize_number(3)]) +fi + +AM_CONDITIONAL([HAVE_HUMANIZE_NUMBER], [test "$HAVE_HUMANIZE_NUMBER" = "yes"]) + +AC_ARG_ENABLE([gettext], + [ --disable-gettext Turn off support for gettext], + [GETTEXT_ENABLE=$enableval], + [GETTEXT_ENABLE=yes]) + +dnl Looking for gettext(), assumably in libintl +AC_ARG_WITH(gettext, + [ --with-gettext=[PFX] Specify location of gettext installation], + [GETTEXT_PREFIX=$withval], + [GETTEXT_PREFIX=/usr], +) + +HAVE_GETTEXT=no + +if test "$GETTEXT_ENABLE" != "no"; then + + AC_MSG_CHECKING([gettext in ${GETTEXT_PREFIX}]) + + _save_cflags="$CFLAGS" + CFLAGS="$CFLAGS -I${GETTEXT_PREFIX}/include -L${GETTEXT_PREFIX}/lib -Werror -lintl" + AC_LINK_IFELSE([AC_LANG_SOURCE([[#include ] + [int main() {char *cp = dgettext(NULL, "xx"); return 0; }]])], + [HAVE_GETTEXT=yes], + [HAVE_GETTEXT=no]) + CFLAGS="$_save_cflags" + + AC_MSG_RESULT([$HAVE_GETTEXT]) + + if test "$HAVE_GETTEXT" != "yes"; then + GETTEXT_PREFIX=/opt/local + AC_MSG_CHECKING([gettext in ${GETTEXT_PREFIX}]) + + _save_cflags="$CFLAGS" + CFLAGS="$CFLAGS -I${GETTEXT_PREFIX}/include -L${GETTEXT_PREFIX}/lib -Werror -lintl" + AC_LINK_IFELSE([AC_LANG_SOURCE([[#include ] + [int main() {char *cp = dgettext(NULL, "xx"); return 0; }]])], + [HAVE_GETTEXT=yes], + [HAVE_GETTEXT=no]) + CFLAGS="$_save_cflags" + + AC_MSG_RESULT([$HAVE_GETTEXT]) + fi +fi + +if test "$HAVE_GETTEXT" = "yes"; then + AC_DEFINE([HAVE_GETTEXT], [1], [gettext(3)]) + GETTEXT_CFLAGS="-I${GETTEXT_PREFIX}/include" + GETTEXT_LIBS="-L${GETTEXT_PREFIX}/lib -lintl" +else + GETTEXT_PREFIX=none + GETTEXT_CFLAGS= + GETTEXT_LIBS= +fi +AC_SUBST(GETTEXT_CFLAGS) +AC_SUBST(GETTEXT_LIBS) +GETTEXT_BINDIR=${GETTEXT_PREFIX}/bin +AC_SUBST(GETTEXT_BINDIR) +GETTEXT_LIBDIR=${GETTEXT_PREFIX}/lib +AC_SUBST(GETTEXT_LIBDIR) + +AM_CONDITIONAL([HAVE_GETTEXT], [test "$HAVE_GETTEXT" = "yes"]) + +dnl Looking for how to do thread-local variables +AC_ARG_WITH(threads, + [ --with-threads=[STYLE] Specify style of thread-local support (none)], + [THREAD_LOCAL=$withval], + [THREAD_LOCAL=unknown], +) + +AC_MSG_CHECKING([thread-locals are ${THREAD_LOCAL}]) + +if test "$THREAD_LOCAL" = "unknown"; then + AC_LINK_IFELSE([AC_LANG_SOURCE([[] + [__thread int foo; int main() { foo++; return foo; }]])], + [THREAD_LOCAL=before], + [THREAD_LOCAL=unknown]) + + AC_MSG_RESULT([$THREAD_LOCAL]) +fi + +if test "$THREAD_LOCAL" = "unknown"; then + AC_LINK_IFELSE([AC_LANG_SOURCE([[] + [int __thread foo; int main() { foo++; return foo; }]])], + [THREAD_LOCAL=after], + [THREAD_LOCAL=unknown]) + AC_MSG_RESULT([$THREAD_LOCAL]) +fi + +if test "$THREAD_LOCAL" = "unknown"; then + AC_LINK_IFELSE([AC_LANG_SOURCE([[] + [__declspec(int) foo; int main() { foo++; return foo; }]])], + [THREAD_LOCAL=declspec], + [THREAD_LOCAL=unknown]) + AC_MSG_RESULT([$THREAD_LOCAL]) +fi + +if test "$THREAD_LOCAL" != "unknown"; then + AC_DEFINE_UNQUOTED([HAVE_THREAD_LOCAL], + THREAD_LOCAL_${THREAD_LOCAL}, [thread-local setting]) +fi + +dnl Looking for libcrypto.... AC_CHECK_LIB([crypto], [MD5_Init]) AM_CONDITIONAL([HAVE_LIBCRYPTO], [test "$HAVE_LIBCRYPTO" != "no"]) +AC_CHECK_MEMBER([struct sockaddr_un.sun_len], + [HAVE_SUN_LEN=yes ; + AC_DEFINE([HAVE_SUN_LEN], [1], [Have struct sockaddr_un.sun_len])], + [HAS_SUN_LEN=no], [[#include ]]) + +AC_CHECK_DECLS([__isthreaded], [], [], [#include ]) +HAVE_ISTHREADED=${ac_cv_have_decl___isthreaded} + dnl dnl Some packages need to be checked against version numbers so we dnl define a function here for later use @@ -107,12 +240,15 @@ then SLAX_BINDIR="`$SLAX_CONFIG --bindir | head -1`" SLAX_OXTRADOCDIR="`$SLAX_CONFIG --oxtradoc | head -1`" AC_MSG_RESULT($LIBSLAX_VERSION found) + HAVE_OXTRADOC=yes else LIBSLAX_VERSION= SLAX_BINDIR= SLAX_OXTRADOCDIR= AC_MSG_RESULT([no]) + HAVE_OXTRADOC=no fi +AM_CONDITIONAL([HAVE_OXTRADOC], [test "$HAVE_OXTRADOC" != "no"]) AC_SUBST(SLAX_BINDIR) AC_SUBST(SLAX_OXTRADOCDIR) @@ -141,6 +277,16 @@ AC_ARG_ENABLE([text-only], AC_MSG_RESULT([$LIBXO_TEXT_ONLY]) AM_CONDITIONAL([LIBXO_TEXT_ONLY], [test "$LIBXO_TEXT_ONLY" != "no"]) +AC_MSG_CHECKING([whether to build with local wcwidth implementation]) +AC_ARG_ENABLE([wcwidth], + [ --disable-wcwidth Disable local wcwidth implementation], + [LIBXO_WCWIDTH=$enableval], + [LIBXO_WCWIDTH=yes]) +AC_MSG_RESULT([$LIBXO_WCWIDTH]) +if test "${LIBXO_WCWIDTH}" != "no"; then + AC_DEFINE([LIBXO_WCWIDTH], [1], [Enable local wcwidth implementation]) +fi + AC_CHECK_LIB([m], [lrint]) AM_CONDITIONAL([HAVE_LIBM], [test "$HAVE_LIBM" != "no"]) @@ -177,13 +323,16 @@ AM_CONDITIONAL([NO_LIBXO_OPTIONS], [test case $host_os in darwin*) LIBTOOL=glibtool + XO_LIBEXT=dylib ;; Linux*|linux*) CFLAGS="-D_GNU_SOURCE $CFLAGS" LDFLAGS=-ldl + XO_LIBEXT=so ;; cygwin*|CYGWIN*) LDFLAGS=-no-undefined + XO_LIBEXT=ddl ;; esac @@ -203,6 +352,14 @@ AC_SUBST(XO_SRCDIR) AC_SUBST(XO_LIBDIR) AC_SUBST(XO_BINDIR) AC_SUBST(XO_INCLUDEDIR) +AC_SUBST(XO_LIBEXT) + +AC_ARG_WITH(encoder-dir, + [ --with-encoder-dir=[DIR] Specify location of encoder libraries], + [XO_ENCODERDIR=$withval], + [XO_ENCODERDIR=$libdir/libxo/encoder] +) +AC_SUBST(XO_ENCODERDIR) AC_ARG_WITH(share-dir, [ --with-share-dir=[DIR] Specify location of shared files], @@ -232,20 +389,34 @@ AC_SUBST(LIBXO_VERSION) AC_SUBST(LIBXO_VERSION_NUMBER) AC_SUBST(LIBXO_VERSION_EXTRA) -AC_CONFIG_HEADERS([libxo/xoconfig.h]) +AC_DEFINE_UNQUOTED(LIBXO_VERSION, ["$LIBXO_VERSION"], + [Version number as dotted value]) +AC_DEFINE_UNQUOTED(LIBXO_VERSION_NUMBER, [$LIBXO_VERSION_NUMBER], + [Version number as a number]) +AC_DEFINE_UNQUOTED(LIBXO_VERSION_STRING, ["$LIBXO_VERSION_NUMBER"], + [Version number as string]) +AC_DEFINE_UNQUOTED(LIBXO_VERSION_EXTRA, ["$LIBXO_VERSION_EXTRA"], + [Version number extra information]) + +AC_CONFIG_HEADERS([libxo/xo_config.h]) AC_CONFIG_FILES([ Makefile libxo-config xohtml/xohtml.sh libxo/Makefile - libxo/xoversion.h + libxo/add.man + encoder/Makefile + encoder/cbor/Makefile + encoder/test/Makefile xo/Makefile xolint/Makefile xohtml/Makefile + xopo/Makefile packaging/libxo.pc doc/Makefile tests/Makefile tests/core/Makefile + tests/gettext/Makefile tests/xo/Makefile packaging/libxo.spec packaging/libxo.rb.base @@ -262,6 +433,7 @@ AC_MSG_NOTICE([summary of build options: bindir: ${XO_BINDIR} includedir: ${XO_INCLUDEDIR} share dir: ${XO_SHAREDIR} + extensions dir: ${XO_ENCODERDIR} oxtradoc dir: ${SLAX_OXTRADOCDIR} compiler: ${CC} (${HAVE_GCC:-no}) @@ -273,4 +445,8 @@ AC_MSG_NOTICE([summary of build options: printf-like: ${HAVE_PRINTFLIKE:-no} libxo-options: ${LIBXO_OPTS:-no} text-only: ${LIBXO_TEXT_ONLY:-no} + gettext: ${HAVE_GETTEXT:-no} (${GETTEXT_PREFIX}) + isthreaded: ${HAVE_ISTHREADED:-no} + thread-local: ${THREAD_LOCAL:-no} + local wcwidth: ${LIBXO_WCWIDTH:-no} ]) Modified: head/contrib/libxo/doc/Makefile.am ============================================================================== --- head/contrib/libxo/doc/Makefile.am Mon Aug 24 14:32:57 2015 (r287110) +++ head/contrib/libxo/doc/Makefile.am Mon Aug 24 16:26:20 2015 (r287111) @@ -8,6 +8,7 @@ # using the SOFTWARE, you agree to be bound by the terms of that # LICENSE. +if HAVE_OXTRADOC OXTRADOC_DIR = ${SLAX_OXTRADOCDIR} OXTRADOC_PREFIX = ${OXTRADOC_DIR} OXTRADOC = ${OXTRADOC_DIR}/oxtradoc @@ -38,28 +39,32 @@ OX_ARGS += -S ${SLAXPROC} -p doc OX_CMD = ${PERL} ${PERLOPTS} ${OXTRADOC} ${OX_ARGS} OXTRADOC_CMD = ${OX_CMD} - OUTPUT = libxo-manual -INPUT = libxo.txt +INPUT = libxo EXTRA_DIST = \ - ${INPUT} \ + ${INPUT}.txt \ ${OUTPUT}.html \ ${OUTPUT}.txt doc docs: ${OUTPUT}.txt ${OUTPUT}.html -${OUTPUT}.txt: ${INPUT} ${OXTRADOC} xolint.txt +${OUTPUT}.txt: ${INPUT}.txt ${OXTRADOC} xolint.txt ${OXTRADOC_CMD} -m text -o $@ $< -${OUTPUT}.html: ${INPUT} ${OXTRADOC} ${XML2HTMLBIN} xolint.txt +${OUTPUT}.html: ${INPUT}.txt ${OXTRADOC} ${XML2HTMLBIN} xolint.txt ${OXTRADOC_CMD} -m html -o $@ $< xolint.txt: ${top_srcdir}/xolint/xolint.pl perl ${top_srcdir}/xolint/xolint.pl -D > xolint.txt CLEANFILES = \ -${OUTPUT}.xml \ -${OUTPUT}.txt \ -${OUTPUT}.fxml \ -${OUTPUT}.html +xolint.txt \ +${INPUT}.xml \ +${INPUT}.txt \ +${INPUT}.fxml \ +${INPUT}.html +else +doc docs: + @${ECHO} "The 'oxtradoc' tool is not installed; see libslax.org" +endif Modified: head/contrib/libxo/doc/libxo.txt ============================================================================== --- head/contrib/libxo/doc/libxo.txt Mon Aug 24 14:32:57 2015 (r287110) +++ head/contrib/libxo/doc/libxo.txt Mon Aug 24 16:26:20 2015 (r287111) @@ -8,7 +8,7 @@ # Phil Shafer, July 2014 # -* libxo +* Overview libxo - A Library for Generating Text, XML, JSON, and HTML Output @@ -28,10 +28,10 @@ decides at run time which output style s application calls a function "xo_emit" to product output that is described in a format string. A "field descriptor" tells libxo what the field is and what it means. Each field descriptor is placed in -braces with a printf-like format string: +braces with a printf-like format string (^format-strings^): xo_emit(" {:lines/%7ju} {:words/%7ju} " - "{:characters/%7ju}{d:filename/%s}\n", + "{:characters/%7ju} {d:filename/%s}\n", linect, wordct, charct, file); Each field can have a role, with the 'value' role being the default, @@ -43,10 +43,10 @@ can then be generated in various style, % wc --libxo xml,pretty,warn /etc/motd - /etc/motd 25 165 1140 + /etc/motd % wc --libxo json,pretty,warn /etc/motd @@ -54,10 +54,10 @@ can then be generated in various style, "wc": { "file": [ { - "filename": "/etc/motd", "lines": 25, "words": 165, - "characters": 1140 + "characters": 1140, + "filename": "/etc/motd" } ] } @@ -95,10 +95,151 @@ command: We're using semantic release numbering, as defined in ^http://semver.org/spec/v2.0.0.html^. -libxo is open source, distributed under the BSD license. It -is shipped as part of FreeBSD 11.0. +libxo is open source, distributed under the BSD license. It shipped +as part of the FreeBSD operating system starting with release 11.0. -* Overview +Issues, problems, and bugs should be directly to the issues page on +our github site. + +*** Downloading libxo Source Code + +You can retrieve the source for libxo in two ways: + +A) Use a "distfile" for a specific release. We use +github to maintain our releases. Visit +github release page (^https://github.com/Juniper/libxo/releases^) +to see the list of releases. To download the latest, look for the +release with the green "Latest release" button and the green +"libxo-RELEASE.tar.gz" button under that section. + +After downloading that release's distfile, untar it as follows: + + tar -zxf libxo-RELEASE.tar.gz + cd libxo-RELEASE + +[Note: for Solaris users, your "tar" command lacks the "-z" flag, +so you'll need to substitute "gzip -dc "file" | tar xf -" instead of +"tar -zxf "file"".] + +B) Use the current build from github. This gives you the most recent +source code, which might be less stable than a specific release. To +build libxo from the git repo: + + git clone https://github.com/Juniper/libxo.git + cd libxo + +_BE AWARE_: The github repository does _not_ contain the files +generated by "autoreconf", with the notable exception of the "m4" +directory. Since these files (depcomp, configure, missing, +install-sh, etc) are generated files, we keep them out of the source +code repository. + +This means that if you download the a release distfile, these files +will be ready and you'll just need to run "configure", but if you +download the source code from svn, then you'll need to run +"autoreconf" by hand. This step is done for you by the "setup.sh" +script, described in the next section. + +*** Building libxo + +To build libxo, you'll need to set up the build, run the "configure" +script, run the "make" command, and run the regression tests. + +The following is a summary of the commands needed. These commands are +explained in detail in the rest of this section. + + sh bin/setup.sh + cd build + ../configure + make + make test + sudo make install + +The following sections will walk thru each of these steps with +additional details and options, but the above directions should be all +that's needed. + +**** Setting up the build + +[If you downloaded a distfile, you can skip this step.] + +Run the "setup.sh" script to set up the build. This script runs the +"autoreconf" command to generate the "configure" script and other +generated files. + + sh bin/setup.sh + +Note: We're are currently using autoreconf version 2.69. + +**** Running the "configure" Script + +Configure (and autoconf in general) provides a means of building +software in diverse environments. Our configure script supports +a set of options that can be used to adjust to your operating +environment. Use "configure --help" to view these options. + +We use the "build" directory to keep object files and generated files +away from the source tree. + +To run the configure script, change into the "build" directory, and +run the "configure" script. Add any required options to the +"../configure" command line. + + cd build + ../configure + +Expect to see the "configure" script generate the following error: + + /usr/bin/rm: cannot remove `libtoolT': No such file or directory + +This error is harmless and can be safely ignored. + +By default, libxo installs architecture-independent files, including +extension library files, in the /usr/local directories. To specify an +installation prefix other than /usr/local for all installation files, +include the --prefix=prefix option and specify an alternate +location. To install just the extension library files in a different, +user-defined location, include the --with-extensions-dir=dir option +and specify the location where the extension libraries will live. + + cd build + ../configure [OPTION]... [VAR=VALUE]... + +**** Running the "make" command + +Once the "configure" script is run, build the images using the "make" +command: + + make + +**** Running the Regression Tests + +libxo includes a set of regression tests that can be run to ensure +the software is working properly. These test are optional, but will +help determine if there are any issues running libxo on your +machine. To run the regression tests: + + make test + +**** Installing libxo + +Once the software is built, you'll need to install libxo using the +"make install" command. If you are the root user, or the owner of the +installation directory, simply issue the command: + + make install + +If you are not the "root" user and are using the "sudo" package, use: + + sudo make install + +Verify the installation by viewing the output of "xo --version": + + % xo --version + libxo version 0.3.5-git-develop + xo version 0.3.5-git-develop + +* Formatting with libxo Most unix commands emit text output aimed at humans. It is designed to be parsed and understood by a user. Humans are gifted at @@ -128,26 +269,41 @@ A single libxo function call in source c xo_emit("Connecting to {:host}.{:domain}...\n", host, domain); - Text: - Connection to my-box.example.com... + TEXT: + Connecting to my-box.example.com... XML: my-box example.com JSON: "host": "my-box", "domain": "example.com" - -For brevity, the HTML output is emitted. + HTML: +
+
Connecting to
+
my-box
+
.
+
example.com
+
...
+
** Encoding Styles -There are four encoding styles supported by libxo: TEXT, HTML, JSON, -and XML. JSON and XML are suitable for encoding data, while TEXT and -HTML are suited for display to the user. TEXT output can be display -on a terminal session, allowing compatibility with traditional usage. -HTML can be matched with a small CSS file to permit rendering in any -HTML5 browser. XML output is suitable for tools like XPath and -protocols like NETCONF. JSON output can be used for RESTful APIs. +There are four encoding styles supported by libxo: + +- TEXT output can be display on a terminal session, allowing +compatibility with traditional command line usage. +- XML output is suitable for tools like XPath and protocols like +NETCONF. +- JSON output can be used for RESTful APIs and integration with +languages like Javascript and Python. +- HTML can be matched with a small CSS file to permit rendering in any +HTML5 browser. + +In general, XML and JSON are suitable for encoding data, while TEXT is +suited for terminal output and HTML is suited for display in a web +browser (see ^xohtml^). *** Text Output @@ -164,7 +320,7 @@ data might look like: printf("%d\t%s\n", num_blocks, path); Simple, direct, obvious. But it's only making text output. Imagine -using a single code path to make text, XML, JSON or HTML, deciding at +using a single code path to make TEXT, XML, JSON or HTML, deciding at run time which to generate. libxo expands on the idea of printf format strings to make a single @@ -257,7 +413,7 @@ field descriptions within the format str The field description is given as follows: - '{' [ role | modifier ]* ':' [ content ] + '{' [ role | modifier ]* [',' long-names ]* ':' [ content ] [ '/' field-format [ '/' encoding-format ]] '}' The role describes the function of the field, while the modifiers @@ -271,23 +427,31 @@ label ("In stock"), and the third is a v in-stock field has a "%u" format that will parse the next argument passed to the xo_emit function as an unsigned integer. - xo_emit("{P: }{Lwc:In stock}{:in-stock/%u}\n", 65); + xo_emit("{P: }{Lwc:In stock}{:in-stock/%u}\n", 65); This single line of code can generate text (" In stock: 65\n"), XML ("65"), JSON ('"in-stock": 6'), or HTML (too lengthy to be listed here). -*** Modifier Roles +While roles and modifiers typically use single character for brevity, +there are alternative names for each which allow more verbose +formatting strings. These names must be preceded by a comma, and may +follow any single-character values: + + xo_emit("{L,white,colon:In stock}{,key:in-stock/%u}\n", 65); -Modifiers are optional, and indicate the role and formatting of the +*** Field Roles + +Field roles are optional, and indicate the role and formatting of the content. The roles are listed below; only one role is permitted: |---+--------------+-------------------------------------------------| -| M | Name | Description | +| R | Name | Description | |---+--------------+-------------------------------------------------| -| C | color/effect | Field has color and effect controls | +| C | color | Field has color and effect controls | | D | decoration | Field is non-text (e.g., colon, comma) | | E | error | Field is an error message | +| G | gettext | Call gettext(3) on the format string | | L | label | Field is text that prefixes a value | | N | note | Field is text that follows a value | | P | padding | Field is spaces needed for vertical alignment | @@ -295,25 +459,59 @@ content. The roles are listed below; on | U | units | Field is the units for the previous value field | | V | value | Field is the name of field (the default) | | W | warning | Field is a warning message | -| [ | start anchor | Begin a section of anchored variable-width text | -| ] | stop anchor | End a section of anchored variable-width text | +| [ | start-anchor | Begin a section of anchored variable-width text | +| ] | stop-anchor | End a section of anchored variable-width text | |---+--------------+-------------------------------------------------| -**** The Color Role ({C:}) + EXAMPLE: + xo_emit("{L:Free}{D::}{P: }{:free/%u} {U:Blocks}\n", + free_blocks); + +When a role is not provided, the "value" role is used as the default. + +Roles and modifiers can also use more verbose names, when preceeded by +a comma: + + EXAMPLE: + xo_emit("{,label:Free}{,decoration::}{,padding: }" + "{,value:free/%u} {,units:Blocks}\n", + free_blocks); + +**** The Color Role ({C:}) @color-role@ Colors and effects control how text values are displayed; they are -used for display styles (TEXT and HTML). The color content can be -either static, when placed directly within the field descriptor, or a -printf-style format descriptor can be used, if preceded by a slash ("/"): +used for display styles (TEXT and HTML). + + xo_emit("{C:bold}{:value}{C:no-bold}\n", value); + +Colors and effects remain in effect until modified by other "C"-role +fields. + + xo_emit("{C:bold}{C:inverse}both{C:no-bold}only inverse\n"); + +If the content is empty, the "reset" action is performed. + + xo_emit("{C:both,underline}{:value}{C:}\n", value); + +The content should be a comma-separated list of zero or more colors or +display effects. + + xo_emit("{C:bold,inverse}Ugly{C:no-bold,no-inverse}\n"); + +The color content can be either static, when placed directly within +the field descriptor, or a printf-style format descriptor can be used, +if preceded by a slash ("/"): + + xo_emit("{C:/%s%s}{:value}{C:}", need_bold ? "bold" : "", + need_underline ? "underline" : "", value); + +Color names are prefixed with either "fg-" or "bg-" to change the +foreground and background colors, respectively. - xo_emit("{C:bold}{Lwc:Cost}{:cost/%u}{C:reset}\n", cost); xo_emit("{C:/fg-%s,bg-%s}{Lwc:Cost}{:cost/%u}{C:reset}\n", fg_color, bg_color, cost); -The content should be a comma-separated list of zero or more colors or -display effects. Colors and effects remain in effect until -modified by other "C" roles. If the content is empty, the "reset" -action is performed. +The following table lists the supported effects: |---------------+-------------------------------------------------| | Name | Description | @@ -332,22 +530,19 @@ action is performed. The following color names are supported: -|---------------| -| Name | -|---------------| -| black | -| blue | -| cyan | -| default | -| green | -| magenta | -| red | -| white | -| yellow | -|---------------| - -Color names are prefixed with either "fg-" or "bg-" to change the -foreground and background colors, respectively. +|---------+--------------------------------------------| +| Name | Description | +|---------+--------------------------------------------| +| black | | +| blue | | +| cyan | | +| default | Default color for foreground or background | +| green | | +| magenta | | +| red | | +| white | | +| yellow | | +|---------+--------------------------------------------| **** The Decoration Role ({D:}) @@ -358,6 +553,37 @@ can use CSS to direct their display para xo_emit("{D:((}{:name}{D:))}\n", name); +**** The Gettext Role ({G:}) @gettext-role@ + +libxo supports internationalization (i18n) through its use of +gettext(3). Use the "{G:}" role to request that the remaining part of +the format string, following the "{G:}" field, be handled using +gettext(). + +Since gettext() uses the string as the key into the message catalog, +libxo uses a simplified version of the format string that removes +unimportant field formatting and modifiers, stopping minor formatting +changes from impacting the expensive translation process. A developer +change such as changing "/%06d" to "/%08d" should not force hand +inspection of all .po files. + +The simplified version can be generated for a single message using the +"xopo -s " command, or an entire .pot can be translated using +the "xopo -f -o " command. + + xo_emit("{G:}Invalid token\n"); + +The {G:} role allows a domain name to be set. gettext calls will +continue to use that domain name until the current format string +processing is complete, enabling a library function to emit strings +using it's own catalog. The domain name can be either static as the +content of the field, or a format can be used to get the domain name +from the arguments. + + xo_emit("{G:libc}Service unavailable in restricted mode\n"); + +See ^howto-i18n^ for additional details. + **** The Label Role ({L:}) Labels are text that appears before a value. @@ -370,7 +596,7 @@ Notes are text that appears after a valu xo_emit("{:cost/%u} {N:per year}\n", cost); -**** The Padding Role ({P:}) +**** The Padding Role ({P:}) @padding-role@ Padding represents whitespace used before and between fields. @@ -440,7 +666,7 @@ format descriptors default to "%s". xo_emit("{:author} wrote \"{:poem}\" in {:year/%4d}\n, author, poem, year); -**** The Anchor Modifiers ({[:} and {]:}) +**** The Anchor Roles ({[:} and {]:}) @anchor-role@ The anchor roles allow a set of strings by be padded as a group, but still be visible to xo_emit as distinct fields. Either the start @@ -468,29 +694,38 @@ than the absolute value of the given wid Widths over 8k are considered probable errors and not supported. If XOF_WARN is set, a warning will be generated. -*** Modifier Flags +*** Field Modifiers -The modifiers can also include the following flags, which modify the -content emitted for some output styles: +Field modifiers are flags which modify the way content emitted for +particular output styles: -|---+--------------+-------------------------------------------------| -| M | Name | Description | -|---+--------------+-------------------------------------------------| -| c | colon | A colon (":") is appended after the label | -| d | display | Only emit field for display styles (text/HTML) | -| e | encoding | Only emit for encoding styles (XML/JSON) | -| k | key | Field is a key, suitable for XPath predicates | -| l | leaf-list | Field is a leaf-list -| n | no-quotes | Do not quote the field when using JSON style | -| q | quotes | Quote the field when using JSON style | -| w | white space | A blank (" ") is appended after the label | -|---+--------------+-------------------------------------------------| - -For example, the modifier string "Lwc" means the field has a label -role (text that describes the next field) and should be followed by a -colon ('c') and a space ('w'). The modifier string "Vkq" means the -field has a value role, that it is a key for the current instance, and -that the value should be quoted when encoded for JSON. +|---+---------------+-------------------------------------------------| +| M | Name | Description | +|---+---------------+-------------------------------------------------| +| c | colon | A colon (":") is appended after the label | +| d | display | Only emit field for display styles (text/HTML) | +| e | encoding | Only emit for encoding styles (XML/JSON) | +| g | gettext | Call gettext on field's render content | +| h | humanize (hn) | Format large numbers in human-readable style | +| | hn-space | Humanize: Place space between numeric and unit | +| | hn-decimal | Humanize: Add a decimal digit, if number < 10 | +| | hn-1000 | Humanize: Use 1000 as divisor instead of 1024 | +| k | key | Field is a key, suitable for XPath predicates | +| l | leaf-list | Field is a leaf-list | +| n | no-quotes | Do not quote the field when using JSON style | +| p | plural | Gettext: Use comma-separated plural form | +| q | quotes | Quote the field when using JSON style | +| t | trim | Trim leading and trailing whitespace | +| w | white | A blank (" ") is appended after the label | +|---+---------------+-------------------------------------------------| + +Roles and modifiers can also use more verbose names, when preceeded by +a comma. For example, the modifier string "Lwc" (or "L,white,colon") +means the field has a label role (text that describes the next field) +and should be followed by a colon ('c') and a space ('w'). The +modifier string "Vkq" (or ":key,quote") means the field has a value +role (the default role), that it is a key for the current instance, +and that the value should be quoted when encoded for JSON. **** The Colon Modifier ({c:}) @@ -535,6 +770,58 @@ the display output styles, TEXT and HTML The encoding modifier is the opposite of the display modifier, and they are often used to give to distinct views of the underlying data. +**** The Gettext Modifier ({g:}) @gettext-modifier@ + +The gettext modifier is used to translate individual fields using the *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 24 16:32:59 2015 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 B1ECB9C242F; Mon, 24 Aug 2015 16:32:59 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A0B8B18F9; Mon, 24 Aug 2015 16:32:59 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OGWxrh021788; Mon, 24 Aug 2015 16:32:59 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OGWwns021783; Mon, 24 Aug 2015 16:32:58 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201508241632.t7OGWwns021783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 24 Aug 2015 16:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287112 - 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.20 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, 24 Aug 2015 16:32:59 -0000 Author: sbruno Date: Mon Aug 24 16:32:57 2015 New Revision: 287112 URL: https://svnweb.freebsd.org/changeset/base/287112 Log: Style/whitespace cleanup in shared/common code. Differential Revision: https://reviews.freebsd.org/D3159 Submitted by: erj MFC after: 2 weeks Modified: head/sys/dev/e1000/e1000_82541.c head/sys/dev/e1000/e1000_82541.h head/sys/dev/e1000/e1000_82542.c head/sys/dev/e1000/e1000_82543.c head/sys/dev/e1000/e1000_82543.h head/sys/dev/e1000/e1000_82571.h head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_api.h head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_manage.c head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/e1000_regs.h Modified: head/sys/dev/e1000/e1000_82541.c ============================================================================== --- head/sys/dev/e1000/e1000_82541.c Mon Aug 24 16:26:20 2015 (r287111) +++ head/sys/dev/e1000/e1000_82541.c Mon Aug 24 16:32:57 2015 (r287112) @@ -49,34 +49,34 @@ static s32 e1000_init_mac_params_82541( static s32 e1000_reset_hw_82541(struct e1000_hw *hw); static s32 e1000_init_hw_82541(struct e1000_hw *hw); static s32 e1000_get_link_up_info_82541(struct e1000_hw *hw, u16 *speed, - u16 *duplex); + u16 *duplex); static s32 e1000_phy_hw_reset_82541(struct e1000_hw *hw); static s32 e1000_setup_copper_link_82541(struct e1000_hw *hw); static s32 e1000_check_for_link_82541(struct e1000_hw *hw); static s32 e1000_get_cable_length_igp_82541(struct e1000_hw *hw); static s32 e1000_set_d3_lplu_state_82541(struct e1000_hw *hw, - bool active); + bool active); static s32 e1000_setup_led_82541(struct e1000_hw *hw); static s32 e1000_cleanup_led_82541(struct e1000_hw *hw); static void e1000_clear_hw_cntrs_82541(struct e1000_hw *hw); static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw); static s32 e1000_config_dsp_after_link_change_82541(struct e1000_hw *hw, - bool link_up); + bool link_up); static s32 e1000_phy_init_script_82541(struct e1000_hw *hw); static void e1000_power_down_phy_copper_82541(struct e1000_hw *hw); -static const u16 e1000_igp_cable_length_table[] = - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 25, 25, 25, - 25, 25, 25, 25, 30, 30, 30, 30, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 50, 50, 50, 50, 50, 50, 50, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 70, 70, 70, 70, 70, 70, 80, 80, 80, 80, 80, 80, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120}; +static const u16 e1000_igp_cable_length_table[] = { + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, + 10, 10, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 25, 25, 30, 30, 30, 30, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 50, 50, 50, 50, 50, 50, 50, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 70, 70, 70, 70, 70, 70, 80, 80, 80, 80, 80, + 80, 90, 90, 90, 90, 90, 90, 90, 90, 90, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120}; #define IGP01E1000_AGC_LENGTH_TABLE_SIZE \ - (sizeof(e1000_igp_cable_length_table) / \ - sizeof(e1000_igp_cable_length_table[0])) + (sizeof(e1000_igp_cable_length_table) / \ + sizeof(e1000_igp_cable_length_table[0])) /** * e1000_init_phy_params_82541 - Init PHY func ptrs. @@ -89,23 +89,23 @@ static s32 e1000_init_phy_params_82541(s DEBUGFUNC("e1000_init_phy_params_82541"); - phy->addr = 1; - phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; - phy->reset_delay_us = 10000; - phy->type = e1000_phy_igp; + phy->addr = 1; + phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; + phy->reset_delay_us = 10000; + phy->type = e1000_phy_igp; /* Function Pointers */ - phy->ops.check_polarity = e1000_check_polarity_igp; - phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; - phy->ops.get_cable_length = e1000_get_cable_length_igp_82541; - phy->ops.get_cfg_done = e1000_get_cfg_done_generic; - phy->ops.get_info = e1000_get_phy_info_igp; - phy->ops.read_reg = e1000_read_phy_reg_igp; - phy->ops.reset = e1000_phy_hw_reset_82541; - phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82541; - phy->ops.write_reg = e1000_write_phy_reg_igp; - phy->ops.power_up = e1000_power_up_phy_copper; - phy->ops.power_down = e1000_power_down_phy_copper_82541; + phy->ops.check_polarity = e1000_check_polarity_igp; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; + phy->ops.get_cable_length = e1000_get_cable_length_igp_82541; + phy->ops.get_cfg_done = e1000_get_cfg_done_generic; + phy->ops.get_info = e1000_get_phy_info_igp; + phy->ops.read_reg = e1000_read_phy_reg_igp; + phy->ops.reset = e1000_phy_hw_reset_82541; + phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82541; + phy->ops.write_reg = e1000_write_phy_reg_igp; + phy->ops.power_up = e1000_power_up_phy_copper; + phy->ops.power_down = e1000_power_down_phy_copper_82541; ret_val = e1000_get_phy_id(hw); if (ret_val) @@ -127,8 +127,8 @@ out: **/ static s32 e1000_init_nvm_params_82541(struct e1000_hw *hw) { - struct e1000_nvm_info *nvm = &hw->nvm; - s32 ret_val = E1000_SUCCESS; + struct e1000_nvm_info *nvm = &hw->nvm; + s32 ret_val = E1000_SUCCESS; u32 eecd = E1000_READ_REG(hw, E1000_EECD); u16 size; @@ -152,28 +152,25 @@ static s32 e1000_init_nvm_params_82541(s eecd &= ~E1000_EECD_SIZE; break; default: - nvm->type = eecd & E1000_EECD_TYPE - ? e1000_nvm_eeprom_spi - : e1000_nvm_eeprom_microwire; + nvm->type = eecd & E1000_EECD_TYPE ? e1000_nvm_eeprom_spi + : e1000_nvm_eeprom_microwire; break; } if (nvm->type == e1000_nvm_eeprom_spi) { - nvm->address_bits = (eecd & E1000_EECD_ADDR_BITS) - ? 16 : 8; - nvm->delay_usec = 1; - nvm->opcode_bits = 8; - nvm->page_size = (eecd & E1000_EECD_ADDR_BITS) - ? 32 : 8; + nvm->address_bits = (eecd & E1000_EECD_ADDR_BITS) ? 16 : 8; + nvm->delay_usec = 1; + nvm->opcode_bits = 8; + nvm->page_size = (eecd & E1000_EECD_ADDR_BITS) ? 32 : 8; /* Function Pointers */ - nvm->ops.acquire = e1000_acquire_nvm_generic; - nvm->ops.read = e1000_read_nvm_spi; - nvm->ops.release = e1000_release_nvm_generic; - nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.acquire = e1000_acquire_nvm_generic; + nvm->ops.read = e1000_read_nvm_spi; + nvm->ops.release = e1000_release_nvm_generic; + nvm->ops.update = e1000_update_nvm_checksum_generic; nvm->ops.valid_led_default = e1000_valid_led_default_generic; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; - nvm->ops.write = e1000_write_nvm_spi; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.write = e1000_write_nvm_spi; /* * nvm->word_size must be discovered after the pointers @@ -196,21 +193,19 @@ static s32 e1000_init_nvm_params_82541(s nvm->word_size = 1 << size; } } else { - nvm->address_bits = (eecd & E1000_EECD_ADDR_BITS) - ? 8 : 6; - nvm->delay_usec = 50; - nvm->opcode_bits = 3; - nvm->word_size = (eecd & E1000_EECD_ADDR_BITS) - ? 256 : 64; + nvm->address_bits = (eecd & E1000_EECD_ADDR_BITS) ? 8 : 6; + nvm->delay_usec = 50; + nvm->opcode_bits = 3; + nvm->word_size = (eecd & E1000_EECD_ADDR_BITS) ? 256 : 64; /* Function Pointers */ - nvm->ops.acquire = e1000_acquire_nvm_generic; - nvm->ops.read = e1000_read_nvm_microwire; - nvm->ops.release = e1000_release_nvm_generic; - nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.acquire = e1000_acquire_nvm_generic; + nvm->ops.read = e1000_read_nvm_microwire; + nvm->ops.release = e1000_release_nvm_generic; + nvm->ops.update = e1000_update_nvm_checksum_generic; nvm->ops.valid_led_default = e1000_valid_led_default_generic; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; - nvm->ops.write = e1000_write_nvm_microwire; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.write = e1000_write_nvm_microwire; } out: @@ -390,11 +385,10 @@ static s32 e1000_init_hw_82541(struct e1 DEBUGOUT("Error initializing identification LED\n"); /* This is not fatal and we should not stop init due to this */ } - + /* Storing the Speed Power Down value for later use */ - ret_val = hw->phy.ops.read_reg(hw, - IGP01E1000_GMII_FIFO, - &dev_spec->spd_default); + ret_val = hw->phy.ops.read_reg(hw, IGP01E1000_GMII_FIFO, + &dev_spec->spd_default); if (ret_val) goto out; @@ -423,7 +417,7 @@ static s32 e1000_init_hw_82541(struct e1 txdctl = E1000_READ_REG(hw, E1000_TXDCTL(0)); txdctl = (txdctl & ~E1000_TXDCTL_WTHRESH) | - E1000_TXDCTL_FULL_TX_DESC_WB; + E1000_TXDCTL_FULL_TX_DESC_WB; E1000_WRITE_REG(hw, E1000_TXDCTL(0), txdctl); /* @@ -447,7 +441,7 @@ out: * Retrieve the current speed and duplex configuration. **/ static s32 e1000_get_link_up_info_82541(struct e1000_hw *hw, u16 *speed, - u16 *duplex) + u16 *duplex) { struct e1000_phy_info *phy = &hw->phy; s32 ret_val; @@ -549,6 +543,7 @@ static s32 e1000_setup_copper_link_82541 ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); E1000_WRITE_REG(hw, E1000_CTRL, ctrl); + /* Earlier revs of the IGP phy require us to force MDI. */ if (hw->mac.type == e1000_82541 || hw->mac.type == e1000_82547) { dev_spec->dsp_config = e1000_dsp_config_disabled; @@ -651,9 +646,8 @@ static s32 e1000_check_for_link_82541(st * different link partner. */ ret_val = e1000_config_fc_after_link_up_generic(hw); - if (ret_val) { + if (ret_val) DEBUGOUT("Error configuring flow control\n"); - } out: return ret_val; @@ -671,7 +665,7 @@ out: * gigabit link is achieved to improve link quality. **/ static s32 e1000_config_dsp_after_link_change_82541(struct e1000_hw *hw, - bool link_up) + bool link_up) { struct e1000_phy_info *phy = &hw->phy; struct e1000_dev_spec_82541 *dev_spec = &hw->dev_spec._82541; @@ -679,11 +673,11 @@ static s32 e1000_config_dsp_after_link_c u32 idle_errs = 0; u16 phy_data, phy_saved_data, speed, duplex, i; u16 ffe_idle_err_timeout = FFE_IDLE_ERR_COUNT_TIMEOUT_20; - u16 dsp_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = - {IGP01E1000_PHY_AGC_PARAM_A, - IGP01E1000_PHY_AGC_PARAM_B, - IGP01E1000_PHY_AGC_PARAM_C, - IGP01E1000_PHY_AGC_PARAM_D}; + u16 dsp_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = { + IGP01E1000_PHY_AGC_PARAM_A, + IGP01E1000_PHY_AGC_PARAM_B, + IGP01E1000_PHY_AGC_PARAM_C, + IGP01E1000_PHY_AGC_PARAM_D}; DEBUGFUNC("e1000_config_dsp_after_link_change_82541"); @@ -708,16 +702,16 @@ static s32 e1000_config_dsp_after_link_c for (i = 0; i < IGP01E1000_PHY_CHANNEL_NUM; i++) { ret_val = phy->ops.read_reg(hw, - dsp_reg_array[i], - &phy_data); + dsp_reg_array[i], + &phy_data); if (ret_val) goto out; phy_data &= ~IGP01E1000_PHY_EDAC_MU_INDEX; ret_val = phy->ops.write_reg(hw, - dsp_reg_array[i], - phy_data); + dsp_reg_array[i], + phy_data); if (ret_val) goto out; } @@ -737,9 +731,8 @@ static s32 e1000_config_dsp_after_link_c for (i = 0; i < ffe_idle_err_timeout; i++) { usec_delay(1000); - ret_val = phy->ops.read_reg(hw, - PHY_1000T_STATUS, - &phy_data); + ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, + &phy_data); if (ret_val) goto out; @@ -748,8 +741,8 @@ static s32 e1000_config_dsp_after_link_c dev_spec->ffe_config = e1000_ffe_config_active; ret_val = phy->ops.write_reg(hw, - IGP01E1000_PHY_DSP_FFE, - IGP01E1000_PHY_DSP_FFE_CM_CP); + IGP01E1000_PHY_DSP_FFE, + IGP01E1000_PHY_DSP_FFE_CM_CP); if (ret_val) goto out; break; @@ -757,7 +750,7 @@ static s32 e1000_config_dsp_after_link_c if (idle_errs) ffe_idle_err_timeout = - FFE_IDLE_ERR_COUNT_TIMEOUT_100; + FFE_IDLE_ERR_COUNT_TIMEOUT_100; } } else { if (dev_spec->dsp_config == e1000_dsp_config_activated) { @@ -765,9 +758,8 @@ static s32 e1000_config_dsp_after_link_c * Save off the current value of register 0x2F5B * to be restored at the end of the routines. */ - ret_val = phy->ops.read_reg(hw, - 0x2F5B, - &phy_saved_data); + ret_val = phy->ops.read_reg(hw, 0x2F5B, + &phy_saved_data); if (ret_val) goto out; @@ -778,15 +770,14 @@ static s32 e1000_config_dsp_after_link_c msec_delay_irq(20); - ret_val = phy->ops.write_reg(hw, - 0x0000, - IGP01E1000_IEEE_FORCE_GIG); + ret_val = phy->ops.write_reg(hw, 0x0000, + IGP01E1000_IEEE_FORCE_GIG); if (ret_val) goto out; for (i = 0; i < IGP01E1000_PHY_CHANNEL_NUM; i++) { ret_val = phy->ops.read_reg(hw, - dsp_reg_array[i], - &phy_data); + dsp_reg_array[i], + &phy_data); if (ret_val) goto out; @@ -794,24 +785,22 @@ static s32 e1000_config_dsp_after_link_c phy_data |= IGP01E1000_PHY_EDAC_SIGN_EXT_9_BITS; ret_val = phy->ops.write_reg(hw, - dsp_reg_array[i], - phy_data); + dsp_reg_array[i], + phy_data); if (ret_val) goto out; } - ret_val = phy->ops.write_reg(hw, - 0x0000, - IGP01E1000_IEEE_RESTART_AUTONEG); + ret_val = phy->ops.write_reg(hw, 0x0000, + IGP01E1000_IEEE_RESTART_AUTONEG); if (ret_val) goto out; msec_delay_irq(20); /* Now enable the transmitter */ - ret_val = phy->ops.write_reg(hw, - 0x2F5B, - phy_saved_data); + ret_val = phy->ops.write_reg(hw, 0x2F5B, + phy_saved_data); if (ret_val) goto out; @@ -838,21 +827,18 @@ static s32 e1000_config_dsp_after_link_c msec_delay_irq(20); - ret_val = phy->ops.write_reg(hw, - 0x0000, - IGP01E1000_IEEE_FORCE_GIG); + ret_val = phy->ops.write_reg(hw, 0x0000, + IGP01E1000_IEEE_FORCE_GIG); if (ret_val) goto out; - ret_val = phy->ops.write_reg(hw, - IGP01E1000_PHY_DSP_FFE, - IGP01E1000_PHY_DSP_FFE_DEFAULT); + ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_DSP_FFE, + IGP01E1000_PHY_DSP_FFE_DEFAULT); if (ret_val) goto out; - ret_val = phy->ops.write_reg(hw, - 0x0000, - IGP01E1000_IEEE_RESTART_AUTONEG); + ret_val = phy->ops.write_reg(hw, 0x0000, + IGP01E1000_IEEE_RESTART_AUTONEG); if (ret_val) goto out; @@ -889,11 +875,10 @@ static s32 e1000_get_cable_length_igp_82 u16 i, data; u16 cur_agc_value, agc_value = 0; u16 min_agc_value = IGP01E1000_AGC_LENGTH_TABLE_SIZE; - u16 agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = - {IGP01E1000_PHY_AGC_A, - IGP01E1000_PHY_AGC_B, - IGP01E1000_PHY_AGC_C, - IGP01E1000_PHY_AGC_D}; + u16 agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = {IGP01E1000_PHY_AGC_A, + IGP01E1000_PHY_AGC_B, + IGP01E1000_PHY_AGC_C, + IGP01E1000_PHY_AGC_D}; DEBUGFUNC("e1000_get_cable_length_igp_82541"); @@ -929,12 +914,12 @@ static s32 e1000_get_cable_length_igp_82 } phy->min_cable_length = (e1000_igp_cable_length_table[agc_value] > - IGP01E1000_AGC_RANGE) - ? (e1000_igp_cable_length_table[agc_value] - - IGP01E1000_AGC_RANGE) - : 0; + IGP01E1000_AGC_RANGE) + ? (e1000_igp_cable_length_table[agc_value] - + IGP01E1000_AGC_RANGE) + : 0; phy->max_cable_length = e1000_igp_cable_length_table[agc_value] + - IGP01E1000_AGC_RANGE; + IGP01E1000_AGC_RANGE; phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; @@ -992,50 +977,48 @@ static s32 e1000_set_d3_lplu_state_82541 */ if (phy->smart_speed == e1000_smart_speed_on) { ret_val = phy->ops.read_reg(hw, - IGP01E1000_PHY_PORT_CONFIG, - &data); + IGP01E1000_PHY_PORT_CONFIG, + &data); if (ret_val) goto out; data |= IGP01E1000_PSCFR_SMART_SPEED; ret_val = phy->ops.write_reg(hw, - IGP01E1000_PHY_PORT_CONFIG, - data); + IGP01E1000_PHY_PORT_CONFIG, + data); if (ret_val) goto out; } else if (phy->smart_speed == e1000_smart_speed_off) { ret_val = phy->ops.read_reg(hw, - IGP01E1000_PHY_PORT_CONFIG, - &data); + IGP01E1000_PHY_PORT_CONFIG, + &data); if (ret_val) goto out; data &= ~IGP01E1000_PSCFR_SMART_SPEED; ret_val = phy->ops.write_reg(hw, - IGP01E1000_PHY_PORT_CONFIG, - data); + IGP01E1000_PHY_PORT_CONFIG, + data); if (ret_val) goto out; } } else if ((phy->autoneg_advertised == E1000_ALL_SPEED_DUPLEX) || - (phy->autoneg_advertised == E1000_ALL_NOT_GIG) || - (phy->autoneg_advertised == E1000_ALL_10_SPEED)) { + (phy->autoneg_advertised == E1000_ALL_NOT_GIG) || + (phy->autoneg_advertised == E1000_ALL_10_SPEED)) { data |= IGP01E1000_GMII_FLEX_SPD; ret_val = phy->ops.write_reg(hw, IGP01E1000_GMII_FIFO, data); if (ret_val) goto out; /* When LPLU is enabled, we should disable SmartSpeed */ - ret_val = phy->ops.read_reg(hw, - IGP01E1000_PHY_PORT_CONFIG, - &data); + ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + &data); if (ret_val) goto out; data &= ~IGP01E1000_PSCFR_SMART_SPEED; - ret_val = phy->ops.write_reg(hw, - IGP01E1000_PHY_PORT_CONFIG, - data); + ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + data); } out: @@ -1056,16 +1039,14 @@ static s32 e1000_setup_led_82541(struct DEBUGFUNC("e1000_setup_led_82541"); - ret_val = hw->phy.ops.read_reg(hw, - IGP01E1000_GMII_FIFO, - &dev_spec->spd_default); + ret_val = hw->phy.ops.read_reg(hw, IGP01E1000_GMII_FIFO, + &dev_spec->spd_default); if (ret_val) goto out; - ret_val = hw->phy.ops.write_reg(hw, - IGP01E1000_GMII_FIFO, - (u16)(dev_spec->spd_default & - ~IGP01E1000_GMII_SPD)); + ret_val = hw->phy.ops.write_reg(hw, IGP01E1000_GMII_FIFO, + (u16)(dev_spec->spd_default & + ~IGP01E1000_GMII_SPD)); if (ret_val) goto out; @@ -1089,9 +1070,8 @@ static s32 e1000_cleanup_led_82541(struc DEBUGFUNC("e1000_cleanup_led_82541"); - ret_val = hw->phy.ops.write_reg(hw, - IGP01E1000_GMII_FIFO, - dev_spec->spd_default); + ret_val = hw->phy.ops.write_reg(hw, IGP01E1000_GMII_FIFO, + dev_spec->spd_default); if (ret_val) goto out; @@ -1178,14 +1158,12 @@ static s32 e1000_phy_init_script_82541(s u16 fused, fine, coarse; /* Move to analog registers page */ - hw->phy.ops.read_reg(hw, - IGP01E1000_ANALOG_SPARE_FUSE_STATUS, - &fused); + hw->phy.ops.read_reg(hw, IGP01E1000_ANALOG_SPARE_FUSE_STATUS, + &fused); if (!(fused & IGP01E1000_ANALOG_SPARE_FUSE_ENABLED)) { - hw->phy.ops.read_reg(hw, - IGP01E1000_ANALOG_FUSE_STATUS, - &fused); + hw->phy.ops.read_reg(hw, IGP01E1000_ANALOG_FUSE_STATUS, + &fused); fine = fused & IGP01E1000_ANALOG_FUSE_FINE_MASK; coarse = fused & IGP01E1000_ANALOG_FUSE_COARSE_MASK; @@ -1194,19 +1172,19 @@ static s32 e1000_phy_init_script_82541(s coarse -= IGP01E1000_ANALOG_FUSE_COARSE_10; fine -= IGP01E1000_ANALOG_FUSE_FINE_1; } else if (coarse == - IGP01E1000_ANALOG_FUSE_COARSE_THRESH) + IGP01E1000_ANALOG_FUSE_COARSE_THRESH) fine -= IGP01E1000_ANALOG_FUSE_FINE_10; fused = (fused & IGP01E1000_ANALOG_FUSE_POLY_MASK) | - (fine & IGP01E1000_ANALOG_FUSE_FINE_MASK) | - (coarse & IGP01E1000_ANALOG_FUSE_COARSE_MASK); + (fine & IGP01E1000_ANALOG_FUSE_FINE_MASK) | + (coarse & IGP01E1000_ANALOG_FUSE_COARSE_MASK); hw->phy.ops.write_reg(hw, - IGP01E1000_ANALOG_FUSE_CONTROL, - fused); + IGP01E1000_ANALOG_FUSE_CONTROL, + fused); hw->phy.ops.write_reg(hw, - IGP01E1000_ANALOG_FUSE_BYPASS, - IGP01E1000_ANALOG_FUSE_ENABLE_SW_CONTROL); + IGP01E1000_ANALOG_FUSE_BYPASS, + IGP01E1000_ANALOG_FUSE_ENABLE_SW_CONTROL); } } Modified: head/sys/dev/e1000/e1000_82541.h ============================================================================== --- head/sys/dev/e1000/e1000_82541.h Mon Aug 24 16:26:20 2015 (r287111) +++ head/sys/dev/e1000/e1000_82541.h Mon Aug 24 16:32:57 2015 (r287112) @@ -37,55 +37,55 @@ #define NVM_WORD_SIZE_BASE_SHIFT_82541 (NVM_WORD_SIZE_BASE_SHIFT + 1) -#define IGP01E1000_PHY_CHANNEL_NUM 4 +#define IGP01E1000_PHY_CHANNEL_NUM 4 -#define IGP01E1000_PHY_AGC_A 0x1172 -#define IGP01E1000_PHY_AGC_B 0x1272 -#define IGP01E1000_PHY_AGC_C 0x1472 -#define IGP01E1000_PHY_AGC_D 0x1872 - -#define IGP01E1000_PHY_AGC_PARAM_A 0x1171 -#define IGP01E1000_PHY_AGC_PARAM_B 0x1271 -#define IGP01E1000_PHY_AGC_PARAM_C 0x1471 -#define IGP01E1000_PHY_AGC_PARAM_D 0x1871 - -#define IGP01E1000_PHY_EDAC_MU_INDEX 0xC000 -#define IGP01E1000_PHY_EDAC_SIGN_EXT_9_BITS 0x8000 - -#define IGP01E1000_PHY_DSP_RESET 0x1F33 - -#define IGP01E1000_PHY_DSP_FFE 0x1F35 -#define IGP01E1000_PHY_DSP_FFE_CM_CP 0x0069 -#define IGP01E1000_PHY_DSP_FFE_DEFAULT 0x002A - -#define IGP01E1000_IEEE_FORCE_GIG 0x0140 -#define IGP01E1000_IEEE_RESTART_AUTONEG 0x3300 - -#define IGP01E1000_AGC_LENGTH_SHIFT 7 -#define IGP01E1000_AGC_RANGE 10 - -#define FFE_IDLE_ERR_COUNT_TIMEOUT_20 20 -#define FFE_IDLE_ERR_COUNT_TIMEOUT_100 100 - -#define IGP01E1000_ANALOG_FUSE_STATUS 0x20D0 -#define IGP01E1000_ANALOG_SPARE_FUSE_STATUS 0x20D1 -#define IGP01E1000_ANALOG_FUSE_CONTROL 0x20DC -#define IGP01E1000_ANALOG_FUSE_BYPASS 0x20DE - -#define IGP01E1000_ANALOG_SPARE_FUSE_ENABLED 0x0100 -#define IGP01E1000_ANALOG_FUSE_FINE_MASK 0x0F80 -#define IGP01E1000_ANALOG_FUSE_COARSE_MASK 0x0070 -#define IGP01E1000_ANALOG_FUSE_COARSE_THRESH 0x0040 -#define IGP01E1000_ANALOG_FUSE_COARSE_10 0x0010 -#define IGP01E1000_ANALOG_FUSE_FINE_1 0x0080 -#define IGP01E1000_ANALOG_FUSE_FINE_10 0x0500 -#define IGP01E1000_ANALOG_FUSE_POLY_MASK 0xF000 +#define IGP01E1000_PHY_AGC_A 0x1172 +#define IGP01E1000_PHY_AGC_B 0x1272 +#define IGP01E1000_PHY_AGC_C 0x1472 +#define IGP01E1000_PHY_AGC_D 0x1872 + +#define IGP01E1000_PHY_AGC_PARAM_A 0x1171 +#define IGP01E1000_PHY_AGC_PARAM_B 0x1271 +#define IGP01E1000_PHY_AGC_PARAM_C 0x1471 +#define IGP01E1000_PHY_AGC_PARAM_D 0x1871 + +#define IGP01E1000_PHY_EDAC_MU_INDEX 0xC000 +#define IGP01E1000_PHY_EDAC_SIGN_EXT_9_BITS 0x8000 + +#define IGP01E1000_PHY_DSP_RESET 0x1F33 + +#define IGP01E1000_PHY_DSP_FFE 0x1F35 +#define IGP01E1000_PHY_DSP_FFE_CM_CP 0x0069 +#define IGP01E1000_PHY_DSP_FFE_DEFAULT 0x002A + +#define IGP01E1000_IEEE_FORCE_GIG 0x0140 +#define IGP01E1000_IEEE_RESTART_AUTONEG 0x3300 + +#define IGP01E1000_AGC_LENGTH_SHIFT 7 +#define IGP01E1000_AGC_RANGE 10 + +#define FFE_IDLE_ERR_COUNT_TIMEOUT_20 20 +#define FFE_IDLE_ERR_COUNT_TIMEOUT_100 100 + +#define IGP01E1000_ANALOG_FUSE_STATUS 0x20D0 +#define IGP01E1000_ANALOG_SPARE_FUSE_STATUS 0x20D1 +#define IGP01E1000_ANALOG_FUSE_CONTROL 0x20DC +#define IGP01E1000_ANALOG_FUSE_BYPASS 0x20DE + +#define IGP01E1000_ANALOG_SPARE_FUSE_ENABLED 0x0100 +#define IGP01E1000_ANALOG_FUSE_FINE_MASK 0x0F80 +#define IGP01E1000_ANALOG_FUSE_COARSE_MASK 0x0070 +#define IGP01E1000_ANALOG_FUSE_COARSE_THRESH 0x0040 +#define IGP01E1000_ANALOG_FUSE_COARSE_10 0x0010 +#define IGP01E1000_ANALOG_FUSE_FINE_1 0x0080 +#define IGP01E1000_ANALOG_FUSE_FINE_10 0x0500 +#define IGP01E1000_ANALOG_FUSE_POLY_MASK 0xF000 #define IGP01E1000_ANALOG_FUSE_ENABLE_SW_CONTROL 0x0002 -#define IGP01E1000_MSE_CHANNEL_D 0x000F -#define IGP01E1000_MSE_CHANNEL_C 0x00F0 -#define IGP01E1000_MSE_CHANNEL_B 0x0F00 -#define IGP01E1000_MSE_CHANNEL_A 0xF000 +#define IGP01E1000_MSE_CHANNEL_D 0x000F +#define IGP01E1000_MSE_CHANNEL_C 0x00F0 +#define IGP01E1000_MSE_CHANNEL_B 0x0F00 +#define IGP01E1000_MSE_CHANNEL_A 0xF000 void e1000_init_script_state_82541(struct e1000_hw *hw, bool state); Modified: head/sys/dev/e1000/e1000_82542.c ============================================================================== --- head/sys/dev/e1000/e1000_82542.c Mon Aug 24 16:26:20 2015 (r287111) +++ head/sys/dev/e1000/e1000_82542.c Mon Aug 24 16:32:57 2015 (r287112) @@ -62,7 +62,7 @@ static s32 e1000_init_phy_params_82542(s DEBUGFUNC("e1000_init_phy_params_82542"); - phy->type = e1000_phy_none; + phy->type = e1000_phy_none; return ret_val; } @@ -77,18 +77,18 @@ static s32 e1000_init_nvm_params_82542(s DEBUGFUNC("e1000_init_nvm_params_82542"); - nvm->address_bits = 6; - nvm->delay_usec = 50; - nvm->opcode_bits = 3; - nvm->type = e1000_nvm_eeprom_microwire; - nvm->word_size = 64; + nvm->address_bits = 6; + nvm->delay_usec = 50; + nvm->opcode_bits = 3; + nvm->type = e1000_nvm_eeprom_microwire; + nvm->word_size = 64; /* Function Pointers */ - nvm->ops.read = e1000_read_nvm_microwire; - nvm->ops.release = e1000_stop_nvm; - nvm->ops.write = e1000_write_nvm_microwire; - nvm->ops.update = e1000_update_nvm_checksum_generic; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.read = e1000_read_nvm_microwire; + nvm->ops.release = e1000_stop_nvm; + nvm->ops.write = e1000_write_nvm_microwire; + nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; return E1000_SUCCESS; } @@ -124,7 +124,8 @@ static s32 e1000_init_mac_params_82542(s /* link setup */ mac->ops.setup_link = e1000_setup_link_82542; /* phy/fiber/serdes setup */ - mac->ops.setup_physical_interface = e1000_setup_fiber_serdes_link_generic; + mac->ops.setup_physical_interface = + e1000_setup_fiber_serdes_link_generic; /* check for link */ mac->ops.check_for_link = e1000_check_for_fiber_link_generic; /* multicast address update */ @@ -143,7 +144,8 @@ static s32 e1000_init_mac_params_82542(s /* clear hardware counters */ mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_82542; /* link info */ - mac->ops.get_link_up_info = e1000_get_speed_and_duplex_fiber_serdes_generic; + mac->ops.get_link_up_info = + e1000_get_speed_and_duplex_fiber_serdes_generic; return E1000_SUCCESS; } @@ -325,7 +327,7 @@ static s32 e1000_setup_link_82542(struct hw->fc.requested_mode &= ~e1000_fc_tx_pause; - if (mac->report_tx_early == 1) + if (mac->report_tx_early) hw->fc.requested_mode &= ~e1000_fc_rx_pause; /* @@ -335,7 +337,7 @@ static s32 e1000_setup_link_82542(struct hw->fc.current_mode = hw->fc.requested_mode; DEBUGOUT1("After fix-ups FlowControl is now = %x\n", - hw->fc.current_mode); + hw->fc.current_mode); /* Call the necessary subroutine to configure the link. */ ret_val = mac->ops.setup_physical_interface(hw); @@ -419,9 +421,8 @@ static int e1000_rar_set_82542(struct e1 * HW expects these in little endian so we reverse the byte order * from network order (big endian) to little endian */ - rar_low = ((u32) addr[0] | - ((u32) addr[1] << 8) | - ((u32) addr[2] << 16) | ((u32) addr[3] << 24)); + rar_low = ((u32) addr[0] | ((u32) addr[1] << 8) | + ((u32) addr[2] << 16) | ((u32) addr[3] << 24)); rar_high = ((u32) addr[4] | ((u32) addr[5] << 8)); @@ -431,6 +432,7 @@ static int e1000_rar_set_82542(struct e1 E1000_WRITE_REG_ARRAY(hw, E1000_RA, (index << 1), rar_low); E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((index << 1) + 1), rar_high); + return E1000_SUCCESS; } Modified: head/sys/dev/e1000/e1000_82543.c ============================================================================== --- head/sys/dev/e1000/e1000_82543.c Mon Aug 24 16:26:20 2015 (r287111) +++ head/sys/dev/e1000/e1000_82543.c Mon Aug 24 16:32:57 2015 (r287112) @@ -47,9 +47,9 @@ static s32 e1000_init_phy_params_82543( static s32 e1000_init_nvm_params_82543(struct e1000_hw *hw); static s32 e1000_init_mac_params_82543(struct e1000_hw *hw); static s32 e1000_read_phy_reg_82543(struct e1000_hw *hw, u32 offset, - u16 *data); + u16 *data); static s32 e1000_write_phy_reg_82543(struct e1000_hw *hw, u32 offset, - u16 data); + u16 data); static s32 e1000_phy_force_speed_duplex_82543(struct e1000_hw *hw); static s32 e1000_phy_hw_reset_82543(struct e1000_hw *hw); static s32 e1000_reset_hw_82543(struct e1000_hw *hw); @@ -62,7 +62,7 @@ static s32 e1000_check_for_fiber_link_8 static s32 e1000_led_on_82543(struct e1000_hw *hw); static s32 e1000_led_off_82543(struct e1000_hw *hw); static void e1000_write_vfta_82543(struct e1000_hw *hw, u32 offset, - u32 value); + u32 value); static void e1000_clear_hw_cntrs_82543(struct e1000_hw *hw); static s32 e1000_config_mac_to_phy_82543(struct e1000_hw *hw); static bool e1000_init_phy_disabled_82543(struct e1000_hw *hw); @@ -71,7 +71,7 @@ static s32 e1000_polarity_reversal_work static void e1000_raise_mdi_clk_82543(struct e1000_hw *hw, u32 *ctrl); static u16 e1000_shift_in_mdi_bits_82543(struct e1000_hw *hw); static void e1000_shift_out_mdi_bits_82543(struct e1000_hw *hw, u32 data, - u16 count); + u16 count); static bool e1000_tbi_compatibility_enabled_82543(struct e1000_hw *hw); static void e1000_set_tbi_sbp_82543(struct e1000_hw *hw, bool state); static s32 e1000_read_mac_addr_82543(struct e1000_hw *hw); @@ -89,34 +89,34 @@ static s32 e1000_init_phy_params_82543(s DEBUGFUNC("e1000_init_phy_params_82543"); if (hw->phy.media_type != e1000_media_type_copper) { - phy->type = e1000_phy_none; + phy->type = e1000_phy_none; goto out; } else { - phy->ops.power_up = e1000_power_up_phy_copper; - phy->ops.power_down = e1000_power_down_phy_copper; + phy->ops.power_up = e1000_power_up_phy_copper; + phy->ops.power_down = e1000_power_down_phy_copper; } - phy->addr = 1; - phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; - phy->reset_delay_us = 10000; - phy->type = e1000_phy_m88; + phy->addr = 1; + phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; + phy->reset_delay_us = 10000; + phy->type = e1000_phy_m88; /* Function Pointers */ - phy->ops.check_polarity = e1000_check_polarity_m88; - phy->ops.commit = e1000_phy_sw_reset_generic; - phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_82543; - phy->ops.get_cable_length = e1000_get_cable_length_m88; - phy->ops.get_cfg_done = e1000_get_cfg_done_generic; - phy->ops.read_reg = (hw->mac.type == e1000_82543) - ? e1000_read_phy_reg_82543 - : e1000_read_phy_reg_m88; - phy->ops.reset = (hw->mac.type == e1000_82543) - ? e1000_phy_hw_reset_82543 - : e1000_phy_hw_reset_generic; - phy->ops.write_reg = (hw->mac.type == e1000_82543) - ? e1000_write_phy_reg_82543 - : e1000_write_phy_reg_m88; - phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.check_polarity = e1000_check_polarity_m88; + phy->ops.commit = e1000_phy_sw_reset_generic; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_82543; + phy->ops.get_cable_length = e1000_get_cable_length_m88; + phy->ops.get_cfg_done = e1000_get_cfg_done_generic; + phy->ops.read_reg = (hw->mac.type == e1000_82543) + ? e1000_read_phy_reg_82543 + : e1000_read_phy_reg_m88; + phy->ops.reset = (hw->mac.type == e1000_82543) + ? e1000_phy_hw_reset_82543 + : e1000_phy_hw_reset_generic; + phy->ops.write_reg = (hw->mac.type == e1000_82543) + ? e1000_write_phy_reg_82543 + : e1000_write_phy_reg_m88; + phy->ops.get_info = e1000_get_phy_info_m88; /* * The external PHY of the 82543 can be in a funky state. @@ -170,18 +170,18 @@ static s32 e1000_init_nvm_params_82543(s DEBUGFUNC("e1000_init_nvm_params_82543"); - nvm->type = e1000_nvm_eeprom_microwire; - nvm->word_size = 64; - nvm->delay_usec = 50; - nvm->address_bits = 6; - nvm->opcode_bits = 3; + nvm->type = e1000_nvm_eeprom_microwire; + nvm->word_size = 64; + nvm->delay_usec = 50; + nvm->address_bits = 6; + nvm->opcode_bits = 3; /* Function Pointers */ - nvm->ops.read = e1000_read_nvm_microwire; - nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.read = e1000_read_nvm_microwire; + nvm->ops.update = e1000_update_nvm_checksum_generic; nvm->ops.valid_led_default = e1000_valid_led_default_generic; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; - nvm->ops.write = e1000_write_nvm_microwire; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.write = e1000_write_nvm_microwire; return E1000_SUCCESS; } @@ -226,19 +226,18 @@ static s32 e1000_init_mac_params_82543(s mac->ops.setup_link = e1000_setup_link_82543; /* physical interface setup */ mac->ops.setup_physical_interface = - (hw->phy.media_type == e1000_media_type_copper) - ? e1000_setup_copper_link_82543 - : e1000_setup_fiber_link_82543; + (hw->phy.media_type == e1000_media_type_copper) + ? e1000_setup_copper_link_82543 : e1000_setup_fiber_link_82543; /* check for link */ mac->ops.check_for_link = - (hw->phy.media_type == e1000_media_type_copper) - ? e1000_check_for_copper_link_82543 - : e1000_check_for_fiber_link_82543; + (hw->phy.media_type == e1000_media_type_copper) + ? e1000_check_for_copper_link_82543 + : e1000_check_for_fiber_link_82543; /* link info */ mac->ops.get_link_up_info = - (hw->phy.media_type == e1000_media_type_copper) - ? e1000_get_speed_and_duplex_copper_generic - : e1000_get_speed_and_duplex_fiber_serdes_generic; + (hw->phy.media_type == e1000_media_type_copper) + ? e1000_get_speed_and_duplex_copper_generic + : e1000_get_speed_and_duplex_fiber_serdes_generic; /* multicast address update */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic; /* writing VFTA */ @@ -295,8 +294,7 @@ static bool e1000_tbi_compatibility_enab goto out; } - state = (dev_spec->tbi_compatibility & TBI_COMPAT_ENABLED) - ? TRUE : FALSE; + state = !!(dev_spec->tbi_compatibility & TBI_COMPAT_ENABLED); out: return state; @@ -348,8 +346,7 @@ bool e1000_tbi_sbp_enabled_82543(struct goto out; } - state = (dev_spec->tbi_compatibility & TBI_SBP_ENABLED) - ? TRUE : FALSE; + state = !!(dev_spec->tbi_compatibility & TBI_SBP_ENABLED); out: return state; @@ -412,8 +409,8 @@ out: * Adjusts the statistic counters when a frame is accepted by TBI_ACCEPT **/ void e1000_tbi_adjust_stats_82543(struct e1000_hw *hw, - struct e1000_hw_stats *stats, u32 frame_len, - u8 *mac_addr, u32 max_frame_size) + struct e1000_hw_stats *stats, u32 frame_len, + u8 *mac_addr, u32 max_frame_size) { if (!(e1000_tbi_sbp_enabled_82543(hw))) goto out; @@ -425,12 +422,12 @@ void e1000_tbi_adjust_stats_82543(struct * counters overcount this packet as a CRC error and undercount * the packet as a good packet */ - /* This packet should not be counted as a CRC error. */ + /* This packet should not be counted as a CRC error. */ stats->crcerrs--; - /* This packet does count as a Good Packet Received. */ + /* This packet does count as a Good Packet Received. */ stats->gprc++; - /* Adjust the Good Octets received counters */ + /* Adjust the Good Octets received counters */ stats->gorc += frame_len; /* @@ -446,7 +443,7 @@ void e1000_tbi_adjust_stats_82543(struct stats->mprc++; /* - * In this case, the hardware has overcounted the number of + * In this case, the hardware has over counted the number of * oversize frames. */ if ((frame_len == max_frame_size) && (stats->roc > 0)) @@ -513,7 +510,7 @@ static s32 e1000_read_phy_reg_82543(stru * e1000_shift_out_mdi_bits routine five different times. The format * of an MII read instruction consists of a shift out of 14 bits and * is defined as follows: - * + * * followed by a shift in of 18 bits. This first two bits shifted in * are TurnAround bits used to avoid contention on the MDIO pin when a * READ operation is performed. These two bits are thrown away @@ -572,9 +569,9 @@ static s32 e1000_write_phy_reg_82543(str * . */ mdic = ((PHY_TURNAROUND) | (offset << 2) | (hw->phy.addr << 7) | - (PHY_OP_WRITE << 12) | (PHY_SOF << 14)); + (PHY_OP_WRITE << 12) | (PHY_SOF << 14)); mdic <<= 16; - mdic |= (u32) data; + mdic |= (u32)data; e1000_shift_out_mdi_bits_82543(hw, mdic, 32); @@ -631,7 +628,7 @@ static void e1000_lower_mdi_clk_82543(st *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 24 17:07:09 2015 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 253889C2D74; Mon, 24 Aug 2015 17:07:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D2EF793B; Mon, 24 Aug 2015 17:07:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 60DB525D37D1; Mon, 24 Aug 2015 17:07:05 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id F0FE4C76FD9; Mon, 24 Aug 2015 17:07:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id JHb3P4GW3v7c; Mon, 24 Aug 2015 17:07:03 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 1C943C76FD8; Mon, 24 Aug 2015 17:07:02 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r287111 - in head: bin/ls bin/ps contrib/libxo contrib/libxo/bin contrib/libxo/doc contrib/libxo/encoder contrib/libxo/encoder/cbor contrib/libxo/encoder/test contrib/libxo/libxo contri... From: "Bjoern A. Zeeb" In-Reply-To: <201508241626.t7OGQLGF017708@repo.freebsd.org> Date: Mon, 24 Aug 2015 17:07:01 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9E38562C-593D-4B35-8065-C01D1896528C@FreeBSD.org> References: <201508241626.t7OGQLGF017708@repo.freebsd.org> To: Marcel Moolenaar X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 24 Aug 2015 17:07:09 -0000 > On 24 Aug 2015, at 16:26 , Marcel Moolenaar = wrote: >=20 > Author: marcel > Date: Mon Aug 24 16:26:20 2015 > New Revision: 287111 > URL: https://svnweb.freebsd.org/changeset/base/287111 >=20 > Log: > Upgrade libxo to 0.4.5. >=20 > Local changes incorporated by 0.4.5: r284340 > Local changes retained: r276260, r282117 >=20 > Obtained from: https://github.com/Juniper/libxo arm* broke with a couple of those: In file included from = /scratch/tmp/bz/head.svn/contrib/libxo/libxo/libxo.c:73: /scratch/tmp/bz/head.svn/contrib/libxo/libxo/xo_wcwidth.h:76:11: error: = comparison of integers of different signs: 'wchar_t' (aka 'unsigned = int') and 'const int' [-Werror,-Wsign-compare] if (ucs < table[0].first || ucs > table[max].last) ~~~ ^ ~~~~~~~~~~~~~~ From owner-svn-src-head@freebsd.org Mon Aug 24 17:28:20 2015 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 37E3C9C141B; Mon, 24 Aug 2015 17:28:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 28AF1124B; Mon, 24 Aug 2015 17:28:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OHSK2E042211; Mon, 24 Aug 2015 17:28:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OHSKhL042210; Mon, 24 Aug 2015 17:28:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508241728.t7OHSKhL042210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 24 Aug 2015 17:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287113 - head/sys/arm64/arm64 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.20 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, 24 Aug 2015 17:28:20 -0000 Author: andrew Date: Mon Aug 24 17:28:19 2015 New Revision: 287113 URL: https://svnweb.freebsd.org/changeset/base/287113 Log: Check the frame pointer is within the kernel before accessing it. Modified: head/sys/arm64/arm64/unwind.c Modified: head/sys/arm64/arm64/unwind.c ============================================================================== --- head/sys/arm64/arm64/unwind.c Mon Aug 24 16:32:57 2015 (r287112) +++ head/sys/arm64/arm64/unwind.c Mon Aug 24 17:28:19 2015 (r287113) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include int unwind_frame(struct unwind_state *frame) @@ -39,7 +40,7 @@ unwind_frame(struct unwind_state *frame) uint64_t fp; fp = frame->fp; - if (fp == 0) + if (!INKERNEL(fp)) return (-1); frame->sp = fp + 0x10; From owner-svn-src-head@freebsd.org Mon Aug 24 17:28:33 2015 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 CFFF19C1478; Mon, 24 Aug 2015 17:28:33 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.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 8E73E1391; Mon, 24 Aug 2015 17:28:33 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from marcels-mbp.int.brkt.com (cerberus.brkt.com [208.185.168.138]) (authenticated bits=0) by mail.xcllnt.net (8.15.2/8.15.2) with ESMTPSA id t7OHSV7l060159 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 24 Aug 2015 10:28:32 -0700 (PDT) (envelope-from marcel@xcllnt.net) Subject: Re: svn commit: r287111 - in head: bin/ls bin/ps contrib/libxo contrib/libxo/bin contrib/libxo/doc contrib/libxo/encoder contrib/libxo/encoder/cbor contrib/libxo/encoder/test contrib/libxo/libxo contri... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_6DF34696-CE29-4F7E-BE36-833076CECD9C"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5.1 From: Marcel Moolenaar In-Reply-To: <9E38562C-593D-4B35-8065-C01D1896528C@FreeBSD.org> Date: Mon, 24 Aug 2015 10:28:24 -0700 Cc: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <57407212-EAFF-447B-B0DD-09D60B577358@xcllnt.net> References: <201508241626.t7OGQLGF017708@repo.freebsd.org> <9E38562C-593D-4B35-8065-C01D1896528C@FreeBSD.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 24 Aug 2015 17:28:33 -0000 --Apple-Mail=_6DF34696-CE29-4F7E-BE36-833076CECD9C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Aug 24, 2015, at 10:07 AM, Bjoern A. Zeeb wrote: >=20 >=20 >> On 24 Aug 2015, at 16:26 , Marcel Moolenaar = wrote: >>=20 >> Author: marcel >> Date: Mon Aug 24 16:26:20 2015 >> New Revision: 287111 >> URL: https://svnweb.freebsd.org/changeset/base/287111 >>=20 >> Log: >> Upgrade libxo to 0.4.5. >>=20 >> Local changes incorporated by 0.4.5: r284340 >> Local changes retained: r276260, r282117 >>=20 >> Obtained from: https://github.com/Juniper/libxo >=20 >=20 > arm* broke with a couple of those: >=20 > In file included from = /scratch/tmp/bz/head.svn/contrib/libxo/libxo/libxo.c:73: > /scratch/tmp/bz/head.svn/contrib/libxo/libxo/xo_wcwidth.h:76:11: = error: comparison of integers of different signs: 'wchar_t' (aka = 'unsigned int') and 'const int' [-Werror,-Wsign-compare] > if (ucs < table[0].first || ucs > table[max].last) > ~~~ ^ ~~~~~~~~~~~~~~ Ugh. Thanks, -- Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_6DF34696-CE29-4F7E-BE36-833076CECD9C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJV21Q5AAoJEIda8t8f0tjjdQgP/1lta9K4jRDGw9Q39Iead716 Opex6MKqPH3DLZLtnPSfq0ACzIrTzKaPlX71NatRZYnxkpK4LqrL0703mL4gifqc yzwENxb6OcERRXaDaRyQ8FGJRcANyMnBmFTeIUUCn7CTP3yiMusHPf+34icE+UrZ mE8C8eZmwR7MERXaXSvzcyOKbrPt3QOctwYdtpzi01nF51R8bIkmIeJNwAzn8CHk Ykdguqktb/z4fVurDddNaObzxHgH4phAVBxR+ONgyLVvpXlr7A5FSHDgOxAFkM5u v9oMGbJ7vyFVHPNJJNbGBH1eUW72XkUlxEN7PfEULGpop2O9xRvSun5ZFmcM9wTn oB17oyEXMHa7n4xELb0Z0LtkVCzC6JB63/7+lv4sb5/hxr3LfbHd6c/nRqqS5v3V x8VcQT5NV/vTPeJmwHPzlYyFrXStQaVMw0lVo89Z08jV10RwRZjOHDC+vf9A5bMR uyYfjwjNmehWlzZEFjuqhqLcf+Rp0k6qoHQua6tVy2r2KeYi27zNYbGEjqRe5oBZ W8M8IsnSNlEqPxz4bkftEF8LxxzsEBnIqImO/kOtVDI/kZ+X/TvjG/1zWUKQaffT zaE/mcGpK3rvMdF+saA0qxLpxacj/2xqfPIDhGus/G+xo0BUXlfiy9Mii3x5+9Lq ERi1tD2bdzjuJEgrlrJD =6Dux -----END PGP SIGNATURE----- --Apple-Mail=_6DF34696-CE29-4F7E-BE36-833076CECD9C-- From owner-svn-src-head@freebsd.org Mon Aug 24 17:58:12 2015 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 D3E3F9C208A; Mon, 24 Aug 2015 17:58:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C457C3F0; Mon, 24 Aug 2015 17:58:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OHwCM3054392; Mon, 24 Aug 2015 17:58:12 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OHwCdv054391; Mon, 24 Aug 2015 17:58:12 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508241758.t7OHwCdv054391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 24 Aug 2015 17:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287114 - head/contrib/libxo/libxo 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.20 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, 24 Aug 2015 17:58:12 -0000 Author: marcel Date: Mon Aug 24 17:58:11 2015 New Revision: 287114 URL: https://svnweb.freebsd.org/changeset/base/287114 Log: Fix build for architectures that define wchar_t as an unsigned int. Reported by: bz@ Modified: head/contrib/libxo/libxo/xo_wcwidth.h Modified: head/contrib/libxo/libxo/xo_wcwidth.h ============================================================================== --- head/contrib/libxo/libxo/xo_wcwidth.h Mon Aug 24 17:28:19 2015 (r287113) +++ head/contrib/libxo/libxo/xo_wcwidth.h Mon Aug 24 17:58:11 2015 (r287114) @@ -62,8 +62,8 @@ #include struct interval { - int first; - int last; + wchar_t first; + wchar_t last; }; /* auxiliary function for binary search in interval table */ From owner-svn-src-head@freebsd.org Mon Aug 24 18:57:33 2015 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 BEBF09C13DA; Mon, 24 Aug 2015 18:57:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 956DD17F; Mon, 24 Aug 2015 18:57:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OIvXEo078765; Mon, 24 Aug 2015 18:57:33 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OIvXu2078764; Mon, 24 Aug 2015 18:57:33 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201508241857.t7OIvXu2078764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 24 Aug 2015 18:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287115 - 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.20 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, 24 Aug 2015 18:57:33 -0000 Author: bz Date: Mon Aug 24 18:57:32 2015 New Revision: 287115 URL: https://svnweb.freebsd.org/changeset/base/287115 Log: When forking a child process with PMC_F_DESCENDANTS set in pmc_attach() in the parent, we will inherit the pmcids but cannot execute any operations on them in the child. The reason for this is that pmc_find_pmc() only tries to find the current process on the owners hash list, but given the child does not own the attachment, we cannot find it. Thus, in case the initial lookup fails, try to find the pmc_process state affiliated with the child process, lookup the pmc from there using the row index, and get the owner process from that pmc. Then continue as normal and lookup the pmc context of the owner (process). This allows us to call, e.g., pmc_start() in the child process before we start the work there, but to collect the accumulated results later in the parent. Sponsored by: DARPA,AFRL Obtained from: L41 Tested by: rwatson, L41 MFC after: 4 weeks Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D2052 Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon Aug 24 17:58:11 2015 (r287114) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon Aug 24 18:57:32 2015 (r287115) @@ -2538,13 +2538,35 @@ static int pmc_find_pmc(pmc_id_t pmcid, struct pmc **pmc) { - struct pmc *pm; + struct pmc *pm, *opm; struct pmc_owner *po; + struct pmc_process *pp; + KASSERT(PMC_ID_TO_ROWINDEX(pmcid) < md->pmd_npmc, + ("[pmc,%d] Illegal pmc index %d (max %d)", __LINE__, + PMC_ID_TO_ROWINDEX(pmcid), md->pmd_npmc)); PMCDBG1(PMC,FND,1, "find-pmc id=%d", pmcid); - if ((po = pmc_find_owner_descriptor(curthread->td_proc)) == NULL) - return ESRCH; + if ((po = pmc_find_owner_descriptor(curthread->td_proc)) == NULL) { + /* + * In case of PMC_F_DESCENDANTS child processes we will not find + * the current process in the owners hash list. Find the owner + * process first and from there lookup the po. + */ + if ((pp = pmc_find_process_descriptor(curthread->td_proc, + PMC_FLAG_NONE)) == NULL) { + return ESRCH; + } else { + opm = pp->pp_pmcs[PMC_ID_TO_ROWINDEX(pmcid)].pp_pmc; + if (opm == NULL) + return ESRCH; + if ((opm->pm_flags & (PMC_F_ATTACHED_TO_OWNER| + PMC_F_DESCENDANTS)) != (PMC_F_ATTACHED_TO_OWNER| + PMC_F_DESCENDANTS)) + return ESRCH; + po = opm->pm_owner; + } + } if ((pm = pmc_find_pmc_descriptor_in_process(po, pmcid)) == NULL) return EINVAL; From owner-svn-src-head@freebsd.org Mon Aug 24 19:09:56 2015 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 EB2B99C196F; Mon, 24 Aug 2015 19:09:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 DBE8ECE0; Mon, 24 Aug 2015 19:09:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OJ9uua083423; Mon, 24 Aug 2015 19:09:56 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OJ9u9W083422; Mon, 24 Aug 2015 19:09:56 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508241909.t7OJ9u9W083422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 24 Aug 2015 19:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287116 - head/sys/mips/mips 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.20 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, 24 Aug 2015 19:09:57 -0000 Author: adrian Date: Mon Aug 24 19:09:56 2015 New Revision: 287116 URL: https://svnweb.freebsd.org/changeset/base/287116 Log: Enable hardfloat for assembly generation. gcc versions later than 4.2 started erroring out on seeing hardware floating point references when soft-float was enabled. Reviewed by: imp Modified: head/sys/mips/mips/fp.S Modified: head/sys/mips/mips/fp.S ============================================================================== --- head/sys/mips/mips/fp.S Mon Aug 24 18:57:32 2015 (r287115) +++ head/sys/mips/mips/fp.S Mon Aug 24 19:09:56 2015 (r287116) @@ -76,6 +76,8 @@ #define COND_LESS 0x4 #define COND_SIGNAL 0x8 +.set hardfloat + /*---------------------------------------------------------------------------- * * MipsEmulateFP -- From owner-svn-src-head@freebsd.org Mon Aug 24 19:32:05 2015 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 4185F9C22FC; Mon, 24 Aug 2015 19:32:05 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2F6B71C1C; Mon, 24 Aug 2015 19:32:05 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OJW5Gn095336; Mon, 24 Aug 2015 19:32:05 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OJW3xu095329; Mon, 24 Aug 2015 19:32:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201508241932.t7OJW3xu095329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 24 Aug 2015 19:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287117 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ioat sys/modules sys/modules/ioat tools/tools/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.20 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, 24 Aug 2015 19:32:05 -0000 Author: cem Date: Mon Aug 24 19:32:03 2015 New Revision: 287117 URL: https://svnweb.freebsd.org/changeset/base/287117 Log: Import ioat(4) driver I/OAT is also referred to as Crystal Beach DMA and is a Platform Storage Extension (PSE) on some Intel server platforms. This driver currently supports DMA descriptors only and is part of a larger effort to upstream an interconnect between multiple systems using the Non-Transparent Bridge (NTB) PSE. For now, this driver is only built on AMD64 platforms. It may be ported to work on i386 later, if that is desired. The hardware is exclusive to x86. Further documentation on ioat(4), including API documentation and usage, can be found in the new manual page. Bring in a test tool, ioatcontrol(8), in tools/tools/ioat. The test tool is not hooked up to the build and is not intended for end users. Submitted by: jimharris, Carl Delsey Reviewed by: jimharris (reviewed my changes) Approved by: markj (mentor) Relnotes: yes Sponsored by: Intel Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3456 Added: head/share/man/man4/ioat.4 (contents, props changed) head/sys/dev/ioat/ head/sys/dev/ioat/ioat.c (contents, props changed) head/sys/dev/ioat/ioat.h (contents, props changed) head/sys/dev/ioat/ioat_hw.h (contents, props changed) head/sys/dev/ioat/ioat_internal.h (contents, props changed) head/sys/dev/ioat/ioat_test.c (contents, props changed) head/sys/dev/ioat/ioat_test.h (contents, props changed) head/sys/modules/ioat/ head/sys/modules/ioat/Makefile (contents, props changed) head/tools/tools/ioat/ head/tools/tools/ioat/Makefile (contents, props changed) head/tools/tools/ioat/ioatcontrol.8 (contents, props changed) head/tools/tools/ioat/ioatcontrol.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Aug 24 19:09:56 2015 (r287116) +++ head/share/man/man4/Makefile Mon Aug 24 19:32:03 2015 (r287117) @@ -207,6 +207,7 @@ MAN= aac.4 \ intpm.4 \ intro.4 \ ${_io.4} \ + ${_ioat.4} \ ip.4 \ ip6.4 \ ipfirewall.4 \ @@ -800,6 +801,7 @@ _xnb.4= xnb.4 .if ${MACHINE_CPUARCH} == "amd64" _if_ntb.4= if_ntb.4 +_ioat.4= ioat.4 _ntb.4= ntb.4 _ntb_hw.4= ntb_hw.4 _qlxge.4= qlxge.4 Added: head/share/man/man4/ioat.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ioat.4 Mon Aug 24 19:32:03 2015 (r287117) @@ -0,0 +1,153 @@ +.\" Copyright (c) 2015 EMC / Isilon Storage Division +.\" 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 AUTHORS 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 AUTHORS 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$ +.\" +.Dd August 24, 2015 +.Dt IOAT 4 +.Os +.Sh NAME +.Nm I/OAT +.Nd Intel I/O Acceleration Technology +.Sh SYNOPSIS +.Cd "device ioat" +In +.Xr loader.conf 5 : +.Pp +.Cd hw.ioat.force_legacy_interrupts=0 +.Pp +In +.Xr loader.conf 5 or +.Xr sysctl.conf 5 : +.Pp +.Cd hw.ioat.enable_ioat_test=0 +.Cd hw.ioat.debug_level=0 +(only critical errors; maximum of 3) +.Pp +.Ft typedef void +.Fn (*bus_dmaengine_callback_t) "void *arg" +.Pp +.Ft bus_dmaengine_t +.Fn ioat_get_dmaengine "uint32_t channel_index" +.Ft void +.Fn ioat_acquire "bus_dmaengine_t dmaengine" +.Ft void +.Fn ioat_release "bus_dmaengine_t dmaengine" +.Ft struct bus_dmadesc * +.Fo ioat_copy +.Fa "bus_dmaengine_t dmaengine" +.Fa "bus_addr_t dst" +.Fa "bus_addr_t src" +.Fa "bus_size_t len" +.Fa "bus_dmaengine_callback_t callback_fn" +.Fa "void *callback_arg" +.Fa "uint32_t flags" +.Fc +.Ft struct bus_dmadesc * +.Fo ioat_null +.Fa "bus_dmaengine_t dmaengine" +.Fa "bus_dmaengine_callback_t callback_fn" +.Fa "void *callback_arg" +.Fa "uint32_t flags" +.Fc +.Sh DESCRIPTION +The +.Nm +driver provides a kernel API to a variety of DMA engines on some Intel server +platforms. +.Pp +There is a number of DMA channels per CPU package. +(Typically 4 or 8.) +Each may be used independently. +Operations on a single channel proceed sequentially. +.Pp +Copy operations may be used to offload memory copies to the DMA engines. +.Pp +Null operations do nothing, but may be used to test the interrupt and callback +mechanism. +.Pp +All operations can optionally trigger an interrupt at completion with the +.Ar DMA_EN_INT +flag. +For example, a user might submit multiple operations to the same channel and +only enable an interrupt and callback for the last operation. +.Sh USAGE +A typical user will lookup the DMA engine object for a given channel with +.Fn ioat_get_dmaengine . +When the user wants to offload a copy, they will first +.Fn ioat_acquire +the +.Ar bus_dmaengine_t +object for exclusive access to enqueue operations on that channel. +Then, they will submit one or more operations using +.Fn ioat_copy +or +.Fn ioat_null . +Finally, they will +.Fn ioat_release +the +.Ar bus_dmaengine_t +to drop their exclusive access to the channel. +The routine they provided for the +.Fa callback_fn +argument will be invoked with the provided +.Fa callback_arg +when the operation is complete. +.Pp +For an example of usage, see +.Pa src/sys/dev/ioat/ioat_test.c . +.Sh FILES +.Bl -tag -compat +.It Pa /dev/ioat_test +test device for +.Xr ioatcontrol 8 +.El +.Sh SEE ALSO +.Xr ioatcontrol 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +driver was developed by +.An \&Jim Harris Aq Mt jimharris@FreeBSD.org , +and +.An \&Carl Delsey Aq Mt carl.r.delsey@intel.com . +This manual page was written by +.An \&Conrad Meyer Aq Mt cem@FreeBSD.org . +.Sh CAVEATS +Copy operation takes bus addresses as parameters, not virtual addresses. +.Pp +Copies larger than max transfer size (1MB) are not supported. +Future versions will likely support this by breaking up the transfer into +smaller sizes. +.Sh BUGS +The +.Nm +driver only supports copy and null operations at this time. +The driver does not yet support advanced DMA modes, such as XOR, that some +I/OAT devices support. Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Aug 24 19:09:56 2015 (r287116) +++ head/sys/amd64/conf/NOTES Mon Aug 24 19:32:03 2015 (r287117) @@ -553,6 +553,7 @@ device tpm device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG device aesni # AES-NI OpenCrypto module +device ioat # Intel I/OAT DMA engine # # Laptop/Notebook options: Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Aug 24 19:09:56 2015 (r287116) +++ head/sys/conf/files.amd64 Mon Aug 24 19:32:03 2015 (r287117) @@ -205,6 +205,8 @@ dev/if_ndis/if_ndis_pccard.c optional nd dev/if_ndis/if_ndis_pci.c optional ndis cardbus | ndis pci dev/if_ndis/if_ndis_usb.c optional ndis usb dev/io/iodev.c optional io +dev/ioat/ioat.c optional ioat pci +dev/ioat/ioat_test.c optional ioat pci dev/ipmi/ipmi.c optional ipmi dev/ipmi/ipmi_acpi.c optional ipmi acpi dev/ipmi/ipmi_isa.c optional ipmi isa Added: head/sys/dev/ioat/ioat.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ioat/ioat.c Mon Aug 24 19:32:03 2015 (r287117) @@ -0,0 +1,1009 @@ +/*- + * Copyright (C) 2012 Intel Corporation + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ioat.h" +#include "ioat_hw.h" +#include "ioat_internal.h" + +static int ioat_probe(device_t device); +static int ioat_attach(device_t device); +static int ioat_detach(device_t device); +static int ioat3_attach(device_t device); +static int ioat_map_pci_bar(struct ioat_softc *ioat); +static void ioat_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, + int error); +static int ioat_interrupt_setup(struct ioat_softc *ioat); +static void ioat_interrupt_handler(void *arg); +static void ioat_process_events(struct ioat_softc *ioat); +static inline uint32_t ioat_get_active(struct ioat_softc *ioat); +static inline uint32_t ioat_get_ring_space(struct ioat_softc *ioat); +static void ioat_free_ring_entry(struct ioat_softc *ioat, + struct ioat_descriptor *desc); +static struct ioat_descriptor * ioat_alloc_ring_entry(struct ioat_softc *ioat); +static int ioat_reserve_space_and_lock(struct ioat_softc *ioat, int num_descs); +static struct ioat_descriptor * ioat_get_ring_entry(struct ioat_softc *ioat, + uint32_t index); +static boolean_t resize_ring(struct ioat_softc *ioat, int order); +static void ioat_timer_callback(void *arg); +static void dump_descriptor(void *hw_desc); +static void ioat_submit_single(struct ioat_softc *ioat); +static void ioat_comp_update_map(void *arg, bus_dma_segment_t *seg, int nseg, + int error); +static int ioat_reset_hw(struct ioat_softc *ioat); +static void ioat_setup_sysctl(device_t device); + +MALLOC_DEFINE(M_IOAT, "ioat", "ioat driver memory allocations"); +SYSCTL_NODE(_hw, OID_AUTO, ioat, CTLFLAG_RD, 0, "ioat node"); + +static int g_force_legacy_interrupts; +SYSCTL_INT(_hw_ioat, OID_AUTO, force_legacy_interrupts, CTLFLAG_RDTUN, + &g_force_legacy_interrupts, 0, "Set to non-zero to force MSI-X disabled"); + +static int g_ioat_debug_level = 0; +SYSCTL_INT(_hw_ioat, OID_AUTO, debug_level, CTLFLAG_RWTUN, &g_ioat_debug_level, + 0, "Set log level (0-3) for ioat(4). Higher is more verbose."); + +/* + * OS <-> Driver interface structures + */ +static device_method_t ioat_pci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ioat_probe), + DEVMETHOD(device_attach, ioat_attach), + DEVMETHOD(device_detach, ioat_detach), + { 0, 0 } +}; + +static driver_t ioat_pci_driver = { + "ioat", + ioat_pci_methods, + sizeof(struct ioat_softc), +}; + +static devclass_t ioat_devclass; +DRIVER_MODULE(ioat, pci, ioat_pci_driver, ioat_devclass, 0, 0); + +/* + * Private data structures + */ +static struct ioat_softc *ioat_channel[IOAT_MAX_CHANNELS]; +static int ioat_channel_index = 0; +SYSCTL_INT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, &ioat_channel_index, 0, + "Number of IOAT channels attached"); + +static struct _pcsid +{ + u_int32_t type; + const char *desc; +} pci_ids[] = { + { 0x34308086, "TBG IOAT Ch0" }, + { 0x34318086, "TBG IOAT Ch1" }, + { 0x34328086, "TBG IOAT Ch2" }, + { 0x34338086, "TBG IOAT Ch3" }, + { 0x34298086, "TBG IOAT Ch4" }, + { 0x342a8086, "TBG IOAT Ch5" }, + { 0x342b8086, "TBG IOAT Ch6" }, + { 0x342c8086, "TBG IOAT Ch7" }, + + { 0x37108086, "JSF IOAT Ch0" }, + { 0x37118086, "JSF IOAT Ch1" }, + { 0x37128086, "JSF IOAT Ch2" }, + { 0x37138086, "JSF IOAT Ch3" }, + { 0x37148086, "JSF IOAT Ch4" }, + { 0x37158086, "JSF IOAT Ch5" }, + { 0x37168086, "JSF IOAT Ch6" }, + { 0x37178086, "JSF IOAT Ch7" }, + { 0x37188086, "JSF IOAT Ch0 (RAID)" }, + { 0x37198086, "JSF IOAT Ch1 (RAID)" }, + + { 0x3c208086, "SNB IOAT Ch0" }, + { 0x3c218086, "SNB IOAT Ch1" }, + { 0x3c228086, "SNB IOAT Ch2" }, + { 0x3c238086, "SNB IOAT Ch3" }, + { 0x3c248086, "SNB IOAT Ch4" }, + { 0x3c258086, "SNB IOAT Ch5" }, + { 0x3c268086, "SNB IOAT Ch6" }, + { 0x3c278086, "SNB IOAT Ch7" }, + { 0x3c2e8086, "SNB IOAT Ch0 (RAID)" }, + { 0x3c2f8086, "SNB IOAT Ch1 (RAID)" }, + + { 0x0e208086, "IVB IOAT Ch0" }, + { 0x0e218086, "IVB IOAT Ch1" }, + { 0x0e228086, "IVB IOAT Ch2" }, + { 0x0e238086, "IVB IOAT Ch3" }, + { 0x0e248086, "IVB IOAT Ch4" }, + { 0x0e258086, "IVB IOAT Ch5" }, + { 0x0e268086, "IVB IOAT Ch6" }, + { 0x0e278086, "IVB IOAT Ch7" }, + { 0x0e2e8086, "IVB IOAT Ch0 (RAID)" }, + { 0x0e2f8086, "IVB IOAT Ch1 (RAID)" }, + + { 0x2f208086, "HSW IOAT Ch0" }, + { 0x2f218086, "HSW IOAT Ch1" }, + { 0x2f228086, "HSW IOAT Ch2" }, + { 0x2f238086, "HSW IOAT Ch3" }, + { 0x2f248086, "HSW IOAT Ch4" }, + { 0x2f258086, "HSW IOAT Ch5" }, + { 0x2f268086, "HSW IOAT Ch6" }, + { 0x2f278086, "HSW IOAT Ch7" }, + { 0x2f2e8086, "HSW IOAT Ch0 (RAID)" }, + { 0x2f2f8086, "HSW IOAT Ch1 (RAID)" }, + + { 0x0c508086, "BWD IOAT Ch0" }, + { 0x0c518086, "BWD IOAT Ch1" }, + { 0x0c528086, "BWD IOAT Ch2" }, + { 0x0c538086, "BWD IOAT Ch3" }, + + { 0x6f508086, "BDXDE IOAT Ch0" }, + { 0x6f518086, "BDXDE IOAT Ch1" }, + { 0x6f528086, "BDXDE IOAT Ch2" }, + { 0x6f538086, "BDXDE IOAT Ch3" }, + + { 0x00000000, NULL } +}; + +/* + * OS <-> Driver linkage functions + */ +static int +ioat_probe(device_t device) +{ + struct _pcsid *ep; + u_int32_t type; + + type = pci_get_devid(device); + for (ep = pci_ids; ep->type; ep++) { + if (ep->type == type) { + device_set_desc(device, ep->desc); + return (0); + } + } + return (ENXIO); +} + +static int +ioat_attach(device_t device) +{ + struct ioat_softc *ioat; + int error; + + ioat = DEVICE2SOFTC(device); + ioat->device = device; + + error = ioat_map_pci_bar(ioat); + if (error != 0) + goto err; + + ioat->version = ioat_read_cbver(ioat); + ioat_interrupt_setup(ioat); + + if (ioat->version < IOAT_VER_3_0) { + error = ENODEV; + goto err; + } + + error = ioat3_attach(device); + if (error != 0) + goto err; + + error = pci_enable_busmaster(device); + if (error != 0) + goto err; + + ioat_channel[ioat_channel_index++] = ioat; + +err: + if (error != 0) + ioat_detach(device); + return (error); +} + +static int +ioat_detach(device_t device) +{ + struct ioat_softc *ioat; + uint32_t i; + + ioat = DEVICE2SOFTC(device); + callout_drain(&ioat->timer); + + pci_disable_busmaster(device); + + if (ioat->pci_resource != NULL) + bus_release_resource(device, SYS_RES_MEMORY, + ioat->pci_resource_id, ioat->pci_resource); + + if (ioat->ring != NULL) { + for (i = 0; i < (1 << ioat->ring_size_order); i++) + ioat_free_ring_entry(ioat, ioat->ring[i]); + free(ioat->ring, M_IOAT); + } + + if (ioat->comp_update != NULL) { + bus_dmamap_unload(ioat->comp_update_tag, ioat->comp_update_map); + bus_dmamem_free(ioat->comp_update_tag, ioat->comp_update, + ioat->comp_update_map); + bus_dma_tag_destroy(ioat->comp_update_tag); + } + + bus_dma_tag_destroy(ioat->hw_desc_tag); + + if (ioat->tag != NULL) + bus_teardown_intr(device, ioat->res, ioat->tag); + + if (ioat->res != NULL) + bus_release_resource(device, SYS_RES_IRQ, + rman_get_rid(ioat->res), ioat->res); + + pci_release_msi(device); + + return (0); +} + +static int +ioat3_selftest(struct ioat_softc *ioat) +{ + uint64_t status; + uint32_t chanerr; + int i; + + ioat_acquire(&ioat->dmaengine); + ioat_null(&ioat->dmaengine, NULL, NULL, 0); + ioat_release(&ioat->dmaengine); + + for (i = 0; i < 100; i++) { + DELAY(1); + status = ioat_get_chansts(ioat); + if (is_ioat_idle(status)) + return (0); + } + + chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); + ioat_log_message(0, "could not start channel: " + "status = %#jx error = %x\n", (uintmax_t)status, chanerr); + return (ENXIO); +} + +/* + * Initialize Hardware + */ +static int +ioat3_attach(device_t device) +{ + struct ioat_softc *ioat; + struct ioat_descriptor **ring; + struct ioat_descriptor *next; + struct ioat_dma_hw_descriptor *dma_hw_desc; + uint32_t capabilities; + int i, num_descriptors; + int error; + uint8_t xfercap; + + error = 0; + ioat = DEVICE2SOFTC(device); + capabilities = ioat_read_dmacapability(ioat); + + xfercap = ioat_read_xfercap(ioat); + + /* Only bits [4:0] are valid. */ + xfercap &= 0x1f; + ioat->max_xfer_size = 1 << xfercap; + + /* TODO: need to check DCA here if we ever do XOR/PQ */ + + mtx_init(&ioat->submit_lock, "ioat_submit", NULL, MTX_DEF); + mtx_init(&ioat->cleanup_lock, "ioat_process_events", NULL, MTX_DEF); + callout_init(&ioat->timer, CALLOUT_MPSAFE); + + ioat->is_resize_pending = FALSE; + ioat->is_completion_pending = FALSE; + ioat->is_reset_pending = FALSE; + ioat->is_channel_running = FALSE; + ioat->is_waiting_for_ack = FALSE; + + bus_dma_tag_create(bus_get_dma_tag(ioat->device), sizeof(uint64_t), 0x0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + sizeof(uint64_t), 1, sizeof(uint64_t), 0, NULL, NULL, + &ioat->comp_update_tag); + + error = bus_dmamem_alloc(ioat->comp_update_tag, + (void **)&ioat->comp_update, BUS_DMA_ZERO, &ioat->comp_update_map); + if (ioat->comp_update == NULL) + return (ENOMEM); + + error = bus_dmamap_load(ioat->comp_update_tag, ioat->comp_update_map, + ioat->comp_update, sizeof(uint64_t), ioat_comp_update_map, ioat, + 0); + if (error != 0) + return (error); + + ioat->ring_size_order = IOAT_MIN_ORDER; + + num_descriptors = 1 << ioat->ring_size_order; + + bus_dma_tag_create(bus_get_dma_tag(ioat->device), 0x40, 0x0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + sizeof(struct ioat_dma_hw_descriptor), 1, + sizeof(struct ioat_dma_hw_descriptor), 0, NULL, NULL, + &ioat->hw_desc_tag); + + ioat->ring = malloc(num_descriptors * sizeof(*ring), M_IOAT, + M_ZERO | M_NOWAIT); + if (ioat->ring == NULL) + return (ENOMEM); + + ring = ioat->ring; + for (i = 0; i < num_descriptors; i++) { + ring[i] = ioat_alloc_ring_entry(ioat); + if (ring[i] == NULL) + return (ENOMEM); + + ring[i]->id = i; + } + + for (i = 0; i < num_descriptors - 1; i++) { + next = ring[i + 1]; + dma_hw_desc = ring[i]->u.dma; + + dma_hw_desc->next = next->hw_desc_bus_addr; + } + + ring[i]->u.dma->next = ring[0]->hw_desc_bus_addr; + + ioat->head = 0; + ioat->tail = 0; + ioat->last_seen = 0; + + error = ioat_reset_hw(ioat); + if (error != 0) + return (error); + + ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); + ioat_write_chancmp(ioat, ioat->comp_update_bus_addr); + ioat_write_chainaddr(ioat, ring[0]->hw_desc_bus_addr); + + error = ioat3_selftest(ioat); + if (error != 0) + return (error); + + ioat_process_events(ioat); + ioat_setup_sysctl(device); + return (0); +} + +static int +ioat_map_pci_bar(struct ioat_softc *ioat) +{ + + ioat->pci_resource_id = PCIR_BAR(0); + ioat->pci_resource = bus_alloc_resource(ioat->device, SYS_RES_MEMORY, + &ioat->pci_resource_id, 0, ~0, 1, RF_ACTIVE); + + if (ioat->pci_resource == NULL) { + ioat_log_message(0, "unable to allocate pci resource\n"); + return (ENODEV); + } + + ioat->pci_bus_tag = rman_get_bustag(ioat->pci_resource); + ioat->pci_bus_handle = rman_get_bushandle(ioat->pci_resource); + return (0); +} + +static void +ioat_comp_update_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) +{ + struct ioat_softc *ioat = arg; + + ioat->comp_update_bus_addr = seg[0].ds_addr; +} + +static void +ioat_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + bus_addr_t *baddr; + + baddr = arg; + *baddr = segs->ds_addr; +} + +/* + * Interrupt setup and handlers + */ +static int +ioat_interrupt_setup(struct ioat_softc *ioat) +{ + uint32_t num_vectors; + int error; + boolean_t use_msix; + boolean_t force_legacy_interrupts; + + use_msix = FALSE; + force_legacy_interrupts = FALSE; + + if (!g_force_legacy_interrupts && pci_msix_count(ioat->device) >= 1) { + num_vectors = 1; + pci_alloc_msix(ioat->device, &num_vectors); + if (num_vectors == 1) + use_msix = TRUE; + } + + if (use_msix) { + ioat->rid = 1; + ioat->res = bus_alloc_resource_any(ioat->device, SYS_RES_IRQ, + &ioat->rid, RF_ACTIVE); + } else { + ioat->rid = 0; + ioat->res = bus_alloc_resource_any(ioat->device, SYS_RES_IRQ, + &ioat->rid, RF_SHAREABLE | RF_ACTIVE); + } + if (ioat->res == NULL) { + ioat_log_message(0, "bus_alloc_resource failed\n"); + return (ENOMEM); + } + + ioat->tag = NULL; + error = bus_setup_intr(ioat->device, ioat->res, INTR_MPSAFE | + INTR_TYPE_MISC, NULL, ioat_interrupt_handler, ioat, &ioat->tag); + if (error != 0) { + ioat_log_message(0, "bus_setup_intr failed\n"); + return (error); + } + + ioat_write_intrctrl(ioat, IOAT_INTRCTRL_MASTER_INT_EN); + return (0); +} + +static void +ioat_interrupt_handler(void *arg) +{ + struct ioat_softc *ioat = arg; + + ioat_process_events(ioat); +} + +static void +ioat_process_events(struct ioat_softc *ioat) +{ + struct ioat_descriptor *desc; + struct bus_dmadesc *dmadesc; + uint64_t comp_update, status; + uint32_t completed; + + mtx_lock(&ioat->cleanup_lock); + + completed = 0; + comp_update = *ioat->comp_update; + status = comp_update & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_MASK; + + ioat_log_message(3, "%s\n", __func__); + + if (status == ioat->last_seen) { + mtx_unlock(&ioat->cleanup_lock); + return; + } + + while (1) { + desc = ioat_get_ring_entry(ioat, ioat->tail); + dmadesc = &desc->bus_dmadesc; + ioat_log_message(3, "completing desc %d\n", ioat->tail); + + if (dmadesc->callback_fn) + (*dmadesc->callback_fn)(dmadesc->callback_arg); + + ioat->tail++; + if (desc->hw_desc_bus_addr == status) + break; + } + + ioat->last_seen = desc->hw_desc_bus_addr; + + if (ioat->head == ioat->tail) { + ioat->is_completion_pending = FALSE; + callout_reset(&ioat->timer, 5 * hz, ioat_timer_callback, ioat); + } + + ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); + mtx_unlock(&ioat->cleanup_lock); +} + +/* + * User API functions + */ +bus_dmaengine_t +ioat_get_dmaengine(uint32_t index) +{ + + if (index < ioat_channel_index) + return (&ioat_channel[index]->dmaengine); + return (NULL); +} + +void +ioat_acquire(bus_dmaengine_t dmaengine) +{ + struct ioat_softc *ioat; + + ioat = to_ioat_softc(dmaengine); + mtx_lock(&ioat->submit_lock); + ioat_log_message(3, "%s\n", __func__); +} + +void +ioat_release(bus_dmaengine_t dmaengine) +{ + struct ioat_softc *ioat; + + ioat_log_message(3, "%s\n", __func__); + ioat = to_ioat_softc(dmaengine); + ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, (uint16_t)ioat->head); + mtx_unlock(&ioat->submit_lock); +} + +struct bus_dmadesc * +ioat_null(bus_dmaengine_t dmaengine, bus_dmaengine_callback_t callback_fn, + void *callback_arg, uint32_t flags) +{ + struct ioat_softc *ioat; + struct ioat_descriptor *desc; + struct ioat_dma_hw_descriptor *hw_desc; + + KASSERT((flags & ~DMA_ALL_FLAGS) == 0, ("Unrecognized flag(s): %#x", + flags & ~DMA_ALL_FLAGS)); + + ioat = to_ioat_softc(dmaengine); + + if (ioat_reserve_space_and_lock(ioat, 1) != 0) + return (NULL); + + ioat_log_message(3, "%s\n", __func__); + + desc = ioat_get_ring_entry(ioat, ioat->head); + hw_desc = desc->u.dma; + + hw_desc->u.control_raw = 0; + hw_desc->u.control.null = 1; + hw_desc->u.control.completion_update = 1; + + if ((flags & DMA_INT_EN) != 0) + hw_desc->u.control.int_enable = 1; + + hw_desc->size = 8; + hw_desc->src_addr = 0; + hw_desc->dest_addr = 0; + + desc->bus_dmadesc.callback_fn = callback_fn; + desc->bus_dmadesc.callback_arg = callback_arg; + + ioat_submit_single(ioat); + return (&desc->bus_dmadesc); +} + +struct bus_dmadesc * +ioat_copy(bus_dmaengine_t dmaengine, bus_addr_t dst, + bus_addr_t src, bus_size_t len, bus_dmaengine_callback_t callback_fn, + void *callback_arg, uint32_t flags) +{ + struct ioat_descriptor *desc; + struct ioat_dma_hw_descriptor *hw_desc; + struct ioat_softc *ioat; + + KASSERT((flags & ~DMA_ALL_FLAGS) == 0, ("Unrecognized flag(s): %#x", + flags & ~DMA_ALL_FLAGS)); + + ioat = to_ioat_softc(dmaengine); + + if (len > ioat->max_xfer_size) { + ioat_log_message(0, "%s: max_xfer_size = %d, requested = %d\n", + __func__, ioat->max_xfer_size, (int)len); + return (NULL); + } + + if (ioat_reserve_space_and_lock(ioat, 1) != 0) + return (NULL); + + ioat_log_message(3, "%s\n", __func__); + + desc = ioat_get_ring_entry(ioat, ioat->head); + hw_desc = desc->u.dma; + + hw_desc->u.control_raw = 0; + hw_desc->u.control.completion_update = 1; + + if ((flags & DMA_INT_EN) != 0) + hw_desc->u.control.int_enable = 1; + + hw_desc->size = len; + hw_desc->src_addr = src; + hw_desc->dest_addr = dst; + + if (g_ioat_debug_level >= 3) + dump_descriptor(hw_desc); + + desc->bus_dmadesc.callback_fn = callback_fn; + desc->bus_dmadesc.callback_arg = callback_arg; + + ioat_submit_single(ioat); + return (&desc->bus_dmadesc); +} + +/* + * Ring Management + */ +static inline uint32_t +ioat_get_active(struct ioat_softc *ioat) +{ + + return ((ioat->head - ioat->tail) & ((1 << ioat->ring_size_order) - 1)); +} + +static inline uint32_t +ioat_get_ring_space(struct ioat_softc *ioat) +{ + + return ((1 << ioat->ring_size_order) - ioat_get_active(ioat) - 1); +} + +static struct ioat_descriptor * +ioat_alloc_ring_entry(struct ioat_softc *ioat) +{ + struct ioat_dma_hw_descriptor *hw_desc; + struct ioat_descriptor *desc; + + desc = malloc(sizeof(struct ioat_descriptor), M_IOAT, M_NOWAIT); + if (desc == NULL) + return (NULL); + + bus_dmamem_alloc(ioat->hw_desc_tag, (void **)&hw_desc, BUS_DMA_ZERO, + &ioat->hw_desc_map); + if (hw_desc == NULL) { + free(desc, M_IOAT); + return (NULL); + } + + bus_dmamap_load(ioat->hw_desc_tag, ioat->hw_desc_map, hw_desc, + sizeof(*hw_desc), ioat_dmamap_cb, &desc->hw_desc_bus_addr, 0); + + desc->u.dma = hw_desc; + return (desc); +} + +static void +ioat_free_ring_entry(struct ioat_softc *ioat, struct ioat_descriptor *desc) +{ + + if (desc == NULL) + return; + + if (desc->u.dma) + bus_dmamem_free(ioat->hw_desc_tag, desc->u.dma, + ioat->hw_desc_map); + free(desc, M_IOAT); +} + +static int +ioat_reserve_space_and_lock(struct ioat_softc *ioat, int num_descs) +{ + boolean_t retry; + + while (1) { + if (ioat_get_ring_space(ioat) >= num_descs) + return (0); + + mtx_lock(&ioat->cleanup_lock); + retry = resize_ring(ioat, ioat->ring_size_order + 1); + mtx_unlock(&ioat->cleanup_lock); + + if (!retry) + return (ENOMEM); + } +} + +static struct ioat_descriptor * +ioat_get_ring_entry(struct ioat_softc *ioat, uint32_t index) +{ + + return (ioat->ring[index % (1 << ioat->ring_size_order)]); +} + +static boolean_t +resize_ring(struct ioat_softc *ioat, int order) +{ + struct ioat_descriptor **ring; + struct ioat_descriptor *next; + struct ioat_dma_hw_descriptor *hw; + struct ioat_descriptor *ent; + uint32_t current_size, active, new_size, i, new_idx, current_idx; + uint32_t new_idx2; + + current_size = 1 << ioat->ring_size_order; + active = (ioat->head - ioat->tail) & (current_size - 1); + new_size = 1 << order; + + if (order > IOAT_MAX_ORDER) + return (FALSE); + + /* + * when shrinking, verify that we can hold the current active + * set in the new ring + */ + if (active >= new_size) + return (FALSE); + + /* allocate the array to hold the software ring */ + ring = malloc(new_size * sizeof(*ring), M_IOAT, M_ZERO | M_NOWAIT); + if (ring == NULL) + return (FALSE); + + ioat_log_message(2, "ring resize: new: %d old: %d\n", + new_size, current_size); + + /* allocate/trim descriptors as needed */ + if (new_size > current_size) { + /* copy current descriptors to the new ring */ + for (i = 0; i < current_size; i++) { + current_idx = (ioat->tail + i) & (current_size - 1); + new_idx = (ioat->tail + i) & (new_size - 1); + + ring[new_idx] = ioat->ring[current_idx]; + ring[new_idx]->id = new_idx; + } + + /* add new descriptors to the ring */ + for (i = current_size; i < new_size; i++) { + new_idx = (ioat->tail + i) & (new_size - 1); + + ring[new_idx] = ioat_alloc_ring_entry(ioat); + if (!ring[new_idx]) { + while (i--) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 24 19:43:29 2015 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 E3B359C2723; Mon, 24 Aug 2015 19:43:29 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: from mail-oi0-x22c.google.com (mail-oi0-x22c.google.com [IPv6:2607:f8b0:4003:c06::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 AADDF2EA; Mon, 24 Aug 2015 19:43:29 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: by oiew67 with SMTP id w67so87467682oie.2; Mon, 24 Aug 2015 12:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gVJS9O+/Z3Mb/PdCoobolVcWxYcr17DS91gfNc9VX9A=; b=0xMSuWK+3WlDcZ25d5gUml49E8hlBewC7X8on0JKBhULUurV//N1/sSZ3fEVbJVmka DMuEDpi38L8JplWHSsH9vFRLuv+ZgnAM7J+tp7fOkR/Dp0hy/BL2jeWpwhzhMRJNAb1g b8gcyEN/VjoVQ9CxKXvt8GpoSnSRlOgaBmOdAkEol/cdIe2tnM9jScZ8b1TUT3uJXYGb a3S6654mYAdKx96YaoNjqmNGSU+oSwAY6/zOpeZy69w68TPbhISTT7hJffcKX9VBBFpi YVXa6m2o8bYWJ+o0HHq/IxUvw0zhEX5mCwdW7MWiR6xtdxLSBnsBB80IKUJ+J9NPCIGH xkpg== MIME-Version: 1.0 X-Received: by 10.202.92.65 with SMTP id q62mr21520013oib.11.1440445408863; Mon, 24 Aug 2015 12:43:28 -0700 (PDT) Received: by 10.202.212.76 with HTTP; Mon, 24 Aug 2015 12:43:28 -0700 (PDT) In-Reply-To: <201508241932.t7OJW3xu095329@repo.freebsd.org> References: <201508241932.t7OJW3xu095329@repo.freebsd.org> Date: Mon, 24 Aug 2015 12:43:28 -0700 Message-ID: Subject: Re: svn commit: r287117 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ioat sys/modules sys/modules/ioat tools/tools/ioat From: Jim Harris 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-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 24 Aug 2015 19:43:30 -0000 On Mon, Aug 24, 2015 at 12:32 PM, Conrad E. Meyer wrote: > Author: cem > Date: Mon Aug 24 19:32:03 2015 > New Revision: 287117 > URL: https://svnweb.freebsd.org/changeset/base/287117 > > Log: > Import ioat(4) driver > > I/OAT is also referred to as Crystal Beach DMA and is a Platform Storage > Extension (PSE) on some Intel server platforms. > > This driver currently supports DMA descriptors only and is part of a > larger effort to upstream an interconnect between multiple systems using > the Non-Transparent Bridge (NTB) PSE. > > For now, this driver is only built on AMD64 platforms. It may be ported > to work on i386 later, if that is desired. The hardware is exclusive to > x86. > > Further documentation on ioat(4), including API documentation and usage, > can be found in the new manual page. > > Bring in a test tool, ioatcontrol(8), in tools/tools/ioat. The test > tool is not hooked up to the build and is not intended for end users. > > Submitted by: jimharris, Carl Delsey > Reviewed by: jimharris (reviewed my changes) > Approved by: markj (mentor) > Relnotes: yes > Sponsored by: Intel > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D3456 > > Thanks! From owner-svn-src-head@freebsd.org Mon Aug 24 20:18:19 2015 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 846619C03D7; Mon, 24 Aug 2015 20:18:19 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6714B1729; Mon, 24 Aug 2015 20:18:19 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from zeta.ixsystems.com (unknown [12.229.62.2]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 895E51EF9E; Mon, 24 Aug 2015 13:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1440447498; x=1440461898; bh=1u876pP6wjjO9MJLYnxqdHZpfdPKGThKincs43knaLo=; h=Reply-To:Subject:References:To:From:Date:In-Reply-To; b=QCtpypHCF8XCkT/Q9bZrCTp+mkYAX6AyxmKXa4U1ZyG9R9dxO0s4ucWSZ2MqO26AO T4XDqW6eN3TN9Jml039po7LwtAB1JDXr5FalYVVW+fIFjxa5OyevV55aiUaaqpXLyp U85geiELlF+tetTHXs0sHOhNVMGp/u/2N952mn5k= Reply-To: d@delphij.net Subject: Re: svn commit: r287117 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ioat sys/modules sys/modules/ioat tools/tools/ioat References: <201508241932.t7OJW3xu095329@repo.freebsd.org> To: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Xin Li Organization: The FreeBSD Project Message-ID: <55DB7C09.8010109@delphij.net> Date: Mon, 24 Aug 2015 13:18:17 -0700 MIME-Version: 1.0 In-Reply-To: <201508241932.t7OJW3xu095329@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tlgK07B6rpBqlNiMW6MtVjCbCJmoGV9Xl" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 24 Aug 2015 20:18:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tlgK07B6rpBqlNiMW6MtVjCbCJmoGV9Xl Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, On 08/24/15 12:32, Conrad E. Meyer wrote: > Author: cem > Date: Mon Aug 24 19:32:03 2015 > New Revision: 287117 > URL: https://svnweb.freebsd.org/changeset/base/287117 >=20 > Log: > Import ioat(4) driver >=20 > Added: > head/share/man/man4/ioat.4 (contents, props changed) > head/sys/dev/ioat/ > head/sys/dev/ioat/ioat.c (contents, props changed) > head/sys/dev/ioat/ioat.h (contents, props changed) > head/sys/dev/ioat/ioat_hw.h (contents, props changed) > head/sys/dev/ioat/ioat_internal.h (contents, props changed) > head/sys/dev/ioat/ioat_test.c (contents, props changed) > head/sys/dev/ioat/ioat_test.h (contents, props changed) > head/sys/modules/ioat/ > head/sys/modules/ioat/Makefile (contents, props changed) > head/tools/tools/ioat/ > head/tools/tools/ioat/Makefile (contents, props changed) > head/tools/tools/ioat/ioatcontrol.8 (contents, props changed) > head/tools/tools/ioat/ioatcontrol.c (contents, props changed) Thanks! Quick question -- why the ioatcontrol is not imported to e.g. usr.sbin instead? Cheers, --=20 Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die --tlgK07B6rpBqlNiMW6MtVjCbCJmoGV9Xl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.1.7 (FreeBSD) iQIcBAEBCgAGBQJV23wKAAoJEJW2GBstM+nsiq8P/1RsweWapoCVNHxTnk6WfJ3x c585/XC20s59ZmO8Sf3gd2sp0zOeijzrgqWGCCns0HBBsp47ty8aeBvWQ5LqetEo qE3k7dFsVuKlcHa/4BG6SDE2lDy8qmgr7IV8u2s3Y5187fT4zFR2zrytqByEEbpI q2LP0q6g5M5w7YIXeHVIUcXP4InKPWwkIkbBT723G+4dUzhy6zd7BDyHxqvZlKZe rOnpMFsmctzjQCAQvyWg0ZT6N3qQlNyYQLWdori32cyRNr1yM8MXOgIelBfg1nyJ /qSDydGqij/xjpcFxzAGnD77OyfmDm5QelNBlwc6sPut0SsNnUw5+Z+G2UwtksjQ 6yRlWzl9pyvLWWxjs+cJ8swnebMYIP2MPCLEx+gnfVWCqni4INuftD7kWXwBQw2t ADRnAJVobq1SG0ldEXgWia+jkzTwSMfk7AwuMoPFlvKi5sWbAJBUHX51bE/tTLn+ a4Ex7uVByZ10Bdrk00ZtC3hFbddxt3UxwaWr0ewomL2h0Y18nZx7c8lrbaFen5hQ +dBpGK/XOQniI3gb+7JDg/2zXK5gi2wYhuf2XbYgQAF7q8DmmesFbKbKfZe874Dl Rrm28UyFHD71Aink7A1TjsbG0LLdQ/+cnjrrqHUtkWre5ZqwaSzR2diGvj3poOSO sGqp/onEGmQIkcjHEcIX =FoNd -----END PGP SIGNATURE----- --tlgK07B6rpBqlNiMW6MtVjCbCJmoGV9Xl-- From owner-svn-src-head@freebsd.org Mon Aug 24 20:39:23 2015 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 07A519C0D44; Mon, 24 Aug 2015 20:39:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 ECE7A381; Mon, 24 Aug 2015 20:39:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OKdMrE020476; Mon, 24 Aug 2015 20:39:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OKdMlA020475; Mon, 24 Aug 2015 20:39:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201508242039.t7OKdMlA020475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 24 Aug 2015 20:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287118 - head/tools/tools/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.20 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, 24 Aug 2015 20:39:23 -0000 Author: cem Date: Mon Aug 24 20:39:22 2015 New Revision: 287118 URL: https://svnweb.freebsd.org/changeset/base/287118 Log: ioatcontrol(8): Fix build Tripped up by the FBSD SVN pre-commit hook! Approved by: markj (mentor) Sponsored by: EMC / Isilon Storage Division Modified: head/tools/tools/ioat/ioatcontrol.c Modified: head/tools/tools/ioat/ioatcontrol.c ============================================================================== --- head/tools/tools/ioat/ioatcontrol.c Mon Aug 24 19:32:03 2015 (r287117) +++ head/tools/tools/ioat/ioatcontrol.c Mon Aug 24 20:39:22 2015 (r287118) @@ -24,6 +24,7 @@ * SUCH DAMAGE. */ +#include __FBSDID("$FreeBSD$"); #include From owner-svn-src-head@freebsd.org Mon Aug 24 20:43:33 2015 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 683809C0F18; Mon, 24 Aug 2015 20:43:33 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-qg0-f44.google.com (mail-qg0-f44.google.com [209.85.192.44]) (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 291989B5; Mon, 24 Aug 2015 20:43:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by qgeg42 with SMTP id g42so94893340qge.1; Mon, 24 Aug 2015 13:43:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=cT80XPwwqu/a1gtkf4OYBRCZCqzzyiRLOXwV1XTX7u0=; b=mIZtXqFujZBzlcZdikJszF1xFDJE2EH9+3q1kVtgoaLlfebcip3M57FHibnTG4jqgf 8WvaTi0Qxrscr6AoltdIKksh0hM5r7AxNEHuz3b/mHJhKYVrbiXbH0TtaN3GJNaWwJWJ Y/4ovp42Wcyf1ZMNVT8AXxq8UBPTZOKk4mb3Q3287FZRB8Kn/9HUwzvHdGEMalKbLDu2 z1npu5+tPnFr7/45azYQsOmQ9CmjDLSRjELZxk51xbJCpVEB6KVgcUiDD2d3K0xaJxjZ rQj0hVkSw5V6fKzCIj/QELPVRAF1KH4Koh3+fFeKXj1rIEIZiaEZnxjRKfN9s5I8UXd5 hqAg== X-Received: by 10.140.239.15 with SMTP id k15mr61506100qhc.4.1440449006661; Mon, 24 Aug 2015 13:43:26 -0700 (PDT) Received: from mail-qk0-f172.google.com (mail-qk0-f172.google.com. [209.85.220.172]) by smtp.gmail.com with ESMTPSA id x136sm11975645qha.24.2015.08.24.13.43.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Aug 2015 13:43:26 -0700 (PDT) Received: by qkda128 with SMTP id a128so37824940qkd.3; Mon, 24 Aug 2015 13:43:25 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.170.159.198 with SMTP id a189mr826186ykd.46.1440449005841; Mon, 24 Aug 2015 13:43:25 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.37.48.134 with HTTP; Mon, 24 Aug 2015 13:43:25 -0700 (PDT) In-Reply-To: <55DB7C09.8010109@delphij.net> References: <201508241932.t7OJW3xu095329@repo.freebsd.org> <55DB7C09.8010109@delphij.net> Date: Mon, 24 Aug 2015 13:43:25 -0700 Message-ID: Subject: Re: svn commit: r287117 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ioat sys/modules sys/modules/ioat tools/tools/ioat From: Conrad Meyer To: Xin LI Cc: 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 24 Aug 2015 20:43:33 -0000 On Mon, Aug 24, 2015 at 1:18 PM, Xin Li wrote: > Hi, > > Quick question -- why the ioatcontrol is not imported to e.g. usr.sbin > instead? > > Cheers, > -- > Xin LI https://www.delphij.net/ Hi, The tool's name is a little misleading. It's not a general purpose tool =E2=80=94 it's really only useful to developers working on the driver.= I don't think it belongs in base. Thanks, Conrad From owner-svn-src-head@freebsd.org Mon Aug 24 21:41:06 2015 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 AE0479C27FA; Mon, 24 Aug 2015 21:41:06 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 9F044CAF; Mon, 24 Aug 2015 21:41:06 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7OLf6E8048027; Mon, 24 Aug 2015 21:41:06 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7OLf6wC048026; Mon, 24 Aug 2015 21:41:06 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508242141.t7OLf6wC048026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 24 Aug 2015 21:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287119 - head/sys/netpfil/pf 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.20 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, 24 Aug 2015 21:41:06 -0000 Author: loos Date: Mon Aug 24 21:41:05 2015 New Revision: 287119 URL: https://svnweb.freebsd.org/changeset/base/287119 Log: Reapply r196551 which was accidentally reverted by r223637 (update to OpenBSD pf 4.5). Fix argument ordering to memcpy as well as the size of the copy in the (theoretical) case that pfi_buffer_cnt should be greater than ~_max. This fix the failure when you hit the self table size and force it to be resized. MFC after: 3 days Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/netpfil/pf/pf_if.c Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Mon Aug 24 20:39:22 2015 (r287118) +++ head/sys/netpfil/pf/pf_if.c Mon Aug 24 21:41:05 2015 (r287119) @@ -581,7 +581,7 @@ pfi_address_add(struct sockaddr *sa, int __func__, V_pfi_buffer_cnt, PFI_BUFFER_MAX); return; } - memcpy(V_pfi_buffer, p, V_pfi_buffer_cnt * sizeof(*V_pfi_buffer)); + memcpy(p, V_pfi_buffer, V_pfi_buffer_max * sizeof(*V_pfi_buffer)); /* no need to zero buffer */ free(V_pfi_buffer, PFI_MTYPE); V_pfi_buffer = p; From owner-svn-src-head@freebsd.org Mon Aug 24 23:40:37 2015 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 397199C1484; Mon, 24 Aug 2015 23:40:37 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2A59816E9; Mon, 24 Aug 2015 23:40:37 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7ONebh5096040; Mon, 24 Aug 2015 23:40:37 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7ONeaY4096038; Mon, 24 Aug 2015 23:40:36 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201508242340.t7ONeaY4096038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 24 Aug 2015 23:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287120 - head/sys/net/altq 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.20 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, 24 Aug 2015 23:40:37 -0000 Author: loos Date: Mon Aug 24 23:40:36 2015 New Revision: 287120 URL: https://svnweb.freebsd.org/changeset/base/287120 Log: Fix the spelling of eri's name. Pointy hat to: loos MFC with: r287009 Modified: head/sys/net/altq/altq_codel.c head/sys/net/altq/altq_codel.h Modified: head/sys/net/altq/altq_codel.c ============================================================================== --- head/sys/net/altq/altq_codel.c Mon Aug 24 21:41:05 2015 (r287119) +++ head/sys/net/altq/altq_codel.c Mon Aug 24 23:40:36 2015 (r287120) @@ -1,7 +1,7 @@ /* * CoDel - The Controlled-Delay Active Queue Management algorithm * - * Copyright (C) 2013 Ermal Luci + * Copyright (C) 2013 Ermal Luçi * Copyright (C) 2011-2012 Kathleen Nichols * Copyright (C) 2011-2012 Van Jacobson * Copyright (C) 2012 Michael D. Taht Modified: head/sys/net/altq/altq_codel.h ============================================================================== --- head/sys/net/altq/altq_codel.h Mon Aug 24 21:41:05 2015 (r287119) +++ head/sys/net/altq/altq_codel.h Mon Aug 24 23:40:36 2015 (r287120) @@ -1,7 +1,7 @@ /* * CoDel - The Controlled-Delay Active Queue Management algorithm * - * Copyright (C) 2013 Ermal Luci + * Copyright (C) 2013 Ermal Luçi * Copyright (C) 2011-2012 Kathleen Nichols * Copyright (C) 2011-2012 Van Jacobson * Copyright (C) 2012 Michael D. Taht From owner-svn-src-head@freebsd.org Tue Aug 25 01:01:25 2015 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 EDFE19C1642; Tue, 25 Aug 2015 01:01:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 DEFAD1A42; Tue, 25 Aug 2015 01:01:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7P11PjF030140; Tue, 25 Aug 2015 01:01:25 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7P11PXi030139; Tue, 25 Aug 2015 01:01:25 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201508250101.t7P11PXi030139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 25 Aug 2015 01:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287121 - head/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.20 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, 25 Aug 2015 01:01:26 -0000 Author: alc Date: Tue Aug 25 01:01:25 2015 New Revision: 287121 URL: https://svnweb.freebsd.org/changeset/base/287121 Log: Testing whether a page is dirty does not require the page lock. Moreover, it may involve a pmap operation that iterates over the page's PV list, so unnecessarily holding the page lock is undesirable. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Mon Aug 24 23:40:36 2015 (r287120) +++ head/sys/vm/vm_pageout.c Tue Aug 25 01:01:25 2015 (r287121) @@ -415,10 +415,13 @@ more: ib = 0; break; } - vm_page_lock(p); vm_page_test_dirty(p); - if (p->dirty == 0 || - p->queue != PQ_INACTIVE || + if (p->dirty == 0) { + ib = 0; + break; + } + vm_page_lock(p); + if (p->queue != PQ_INACTIVE || p->hold_count != 0) { /* may be undergoing I/O */ vm_page_unlock(p); ib = 0; @@ -442,10 +445,11 @@ more: if ((p = vm_page_next(ps)) == NULL || vm_page_busied(p)) break; - vm_page_lock(p); vm_page_test_dirty(p); - if (p->dirty == 0 || - p->queue != PQ_INACTIVE || + if (p->dirty == 0) + break; + vm_page_lock(p); + if (p->queue != PQ_INACTIVE || p->hold_count != 0) { /* may be undergoing I/O */ vm_page_unlock(p); break; From owner-svn-src-head@freebsd.org Tue Aug 25 05:31:01 2015 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 93E9299D0E2; Tue, 25 Aug 2015 05:31:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 85186A10; Tue, 25 Aug 2015 05:31:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7P5V1AS042069; Tue, 25 Aug 2015 05:31:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7P5V1RO042068; Tue, 25 Aug 2015 05:31:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508250531.t7P5V1RO042068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 25 Aug 2015 05:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287123 - head/usr.bin/at 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.20 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, 25 Aug 2015 05:31:01 -0000 Author: delphij Date: Tue Aug 25 05:31:00 2015 New Revision: 287123 URL: https://svnweb.freebsd.org/changeset/base/287123 Log: Finish r89633 and completely remove the remaining of VERSION. PR: bin/202308 Submitted by: John Hein MFC after: 2 weeks Modified: head/usr.bin/at/Makefile.inc Modified: head/usr.bin/at/Makefile.inc ============================================================================== --- head/usr.bin/at/Makefile.inc Tue Aug 25 04:03:51 2015 (r287122) +++ head/usr.bin/at/Makefile.inc Tue Aug 25 05:31:00 2015 (r287123) @@ -1,4 +1,5 @@ -VERSION= 2.9 +# $FreeBSD$ + LOCKFILE = .lockfile ATSPOOL_DIR=/var/at/spool ATJOB_DIR=/var/at/jobs @@ -13,7 +14,7 @@ PERM_PATH=/var/at CFLAGS += -DATJOB_DIR=\"$(ATJOB_DIR)/\" \ -DLFILE=\"$(ATJOB_DIR)/$(LOCKFILE)\" \ -DLOADAVG_MX=$(LOADAVG_MX) -DATSPOOL_DIR=\"$(ATSPOOL_DIR)\" \ - -DVERSION=\"$(VERSION)\" -DDAEMON_UID=$(DAEMON_UID) -DDAEMON_GID=$(DAEMON_GID) \ + -DDAEMON_UID=$(DAEMON_UID) -DDAEMON_GID=$(DAEMON_GID) \ -DDEFAULT_BATCH_QUEUE=\'$(DEFAULT_BATCH_QUEUE)\' \ -DDEFAULT_AT_QUEUE=\'$(DEFAULT_AT_QUEUE)\' -DPERM_PATH=\"$(PERM_PATH)/\" From owner-svn-src-head@freebsd.org Tue Aug 25 06:13:00 2015 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 F0E7E99A3D5; Tue, 25 Aug 2015 06:13:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C7FC0EF9; Tue, 25 Aug 2015 06:13:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7P6D0Ig062767; Tue, 25 Aug 2015 06:13:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7P6D07S062766; Tue, 25 Aug 2015 06:13:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508250613.t7P6D07S062766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 25 Aug 2015 06:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287124 - head/sys/netinet6 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.20 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, 25 Aug 2015 06:13:01 -0000 Author: adrian Date: Tue Aug 25 06:12:59 2015 New Revision: 287124 URL: https://svnweb.freebsd.org/changeset/base/287124 Log: Call the new RSS hash calculation function to correctly calculate a hash based on the configured requirements for the protocol. Tested: * UDP IPv6 TX/RX testing, w/ RSS enabled, 82599 ixgbe(4) hardware Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Tue Aug 25 05:31:00 2015 (r287123) +++ head/sys/netinet6/udp6_usrreq.c Tue Aug 25 06:12:59 2015 (r287124) @@ -840,19 +840,36 @@ udp6_output(struct inpcb *inp, struct mb m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); } - /* - * XXX for now assume UDP is 2-tuple. - * Later on this may become configurable as 4-tuple; - * we should support that. - * - * XXX .. and we should likely cache this in the inpcb. - */ #ifdef RSS - m->m_pkthdr.flowid = rss_hash_ip6_2tuple(faddr, laddr); - M_HASHTYPE_SET(m, M_HASHTYPE_RSS_IPV6); + { + uint32_t hash_val, hash_type; + uint8_t pr; + + pr = inp->inp_socket->so_proto->pr_protocol; + /* + * Calculate an appropriate RSS hash for UDP and + * UDP Lite. + * + * The called function will take care of figuring out + * whether a 2-tuple or 4-tuple hash is required based + * on the currently configured scheme. + * + * Later later on connected socket values should be + * cached in the inpcb and reused, rather than constantly + * re-calculating it. + * + * UDP Lite is a different protocol number and will + * likely end up being hashed as a 2-tuple until + * RSS / NICs grow UDP Lite protocol awareness. + */ + if (rss_proto_software_hash_v6(faddr, laddr, fport, + inp->inp_lport, pr, &hash_val, &hash_type) == 0) { + m->m_pkthdr.flowid = hash_val; + M_HASHTYPE_SET(m, hash_type); + } + } #endif flags = 0; - #ifdef RSS /* * Don't override with the inp cached flowid. From owner-svn-src-head@freebsd.org Tue Aug 25 09:16:10 2015 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 0FADA99AE7A; Tue, 25 Aug 2015 09:16:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 008BACDF; Tue, 25 Aug 2015 09:16:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7P9G9hs037431; Tue, 25 Aug 2015 09:16:09 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7P9G9vu037430; Tue, 25 Aug 2015 09:16:09 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508250916.t7P9G9vu037430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 25 Aug 2015 09:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287125 - head/lib/libc/locale 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.20 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, 25 Aug 2015 09:16:10 -0000 Author: ed Date: Tue Aug 25 09:16:09 2015 New Revision: 287125 URL: https://svnweb.freebsd.org/changeset/base/287125 Log: Make UTF-8 parsing and generation more strict. - in mbrtowc() we need to disallow codepoints above 0x10ffff. - In wcrtomb() we need to disallow codepoints between 0xd800 and 0xdfff. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D3399 Modified: head/lib/libc/locale/utf8.c Modified: head/lib/libc/locale/utf8.c ============================================================================== --- head/lib/libc/locale/utf8.c Tue Aug 25 06:12:59 2015 (r287124) +++ head/lib/libc/locale/utf8.c Tue Aug 25 09:16:09 2015 (r287125) @@ -191,7 +191,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, errno = EILSEQ; return ((size_t)-1); } - if (wch >= 0xd800 && wch <= 0xdfff) { + if ((wch >= 0xd800 && wch <= 0xdfff) || wch > 0x10ffff) { /* * Malformed input; invalid code points. */ @@ -318,6 +318,10 @@ _UTF8_wcrtomb(char * __restrict s, wchar lead = 0xc0; len = 2; } else if ((wc & ~0xffff) == 0) { + if (wc >= 0xd800 && wc <= 0xdfff) { + errno = EILSEQ; + return ((size_t)-1); + } lead = 0xe0; len = 3; } else if (wc >= 0 && wc <= 0x10ffff) { From owner-svn-src-head@freebsd.org Tue Aug 25 14:49:12 2015 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 7C9BD99D648; Tue, 25 Aug 2015 14:49:12 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 534FB841; Tue, 25 Aug 2015 14:49:12 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PEnCaO075699; Tue, 25 Aug 2015 14:49:12 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PEnCKm075698; Tue, 25 Aug 2015 14:49:12 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201508251449.t7PEnCKm075698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 25 Aug 2015 14:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287127 - 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.20 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, 25 Aug 2015 14:49:12 -0000 Author: zbb Date: Tue Aug 25 14:49:11 2015 New Revision: 287127 URL: https://svnweb.freebsd.org/changeset/base/287127 Log: Leave hypervisor mode upon startup on ARMv7 If ARMv7 boots in HYP mode, switch to SVC32. Reviewed by: ian Submitted by: Wojciech Macek Jakub Palider Obtained from: Semihalf Sponsored by: Annapurna Labs Differential Revision: https://reviews.freebsd.org/D1810 Modified: head/sys/arm/arm/locore-v6.S Modified: head/sys/arm/arm/locore-v6.S ============================================================================== --- head/sys/arm/arm/locore-v6.S Tue Aug 25 14:39:40 2015 (r287126) +++ head/sys/arm/arm/locore-v6.S Tue Aug 25 14:49:11 2015 (r287127) @@ -45,12 +45,47 @@ __FBSDID("$FreeBSD$"); #define PTE1_SIZE L1_S_SIZE #endif +#if __ARM_ARCH >= 7 +#if defined(__ARM_ARCH_7VE__) || defined(__clang__) +/* + * HYP support is in bintuils >= 2.21 and gcc >= 4.9 defines __ARM_ARCH_7VE__ + * when enabled. llvm >= 3.6 supports it too. + */ +.arch_extension virt +#define MSR_ELR_HYP(regnum) msr elr_hyp, lr +#define ERET eret +#else +#define MSR_ELR_HYP(regnum) .word (0xe12ef300 | regnum) +#define ERET .word 0xe160006e +#endif +#endif /* __ARM_ARCH >= 7 */ + /* A small statically-allocated stack used only during initarm() and AP startup. */ #define INIT_ARM_STACK_SIZE 2048 .text .align 2 +#if __ARM_ARCH >= 7 +#define LEAVE_HYP \ + /* Leave HYP mode */ ;\ + mrs r0, cpsr ;\ + and r0, r0, #(PSR_MODE) /* Mode is in the low 5 bits of CPSR */ ;\ + teq r0, #(PSR_HYP32_MODE) /* Hyp Mode? */ ;\ + bne 1f ;\ + /* Ensure that IRQ, FIQ and Aborts will be disabled after eret */;\ + mrs r0, spsr ;\ + orr r0, r0, #(PSR_I | PSR_F | PSR_A) ;\ + msr spsr, r0 ;\ + /* Exit hypervisor mode */ ;\ + adr lr, 1f ;\ + MSR_ELR_HYP(14) ;\ + ERET ;\ +1: +#else +#define LEAVE_HYP +#endif /* __ARM_ARCH >= 7 */ + /* * On entry for FreeBSD boot ABI: * r0 - metadata pointer or 0 (boothowto on AT91's boot2) @@ -76,6 +111,8 @@ ASENTRY_NP(_start) mov r10, r2 /* Save meta data */ mov r11, r3 /* Future expansion */ + LEAVE_HYP + /* * Check whether data cache is enabled. If it is, then we know * current tags are valid (not power-on garbage values) and there @@ -401,6 +438,8 @@ ASENTRY_NP(mpentry) /* Make sure interrupts are disabled. */ cpsid ifa + LEAVE_HYP + /* Setup core, disable all caches. */ mrc CP15_SCTLR(r0) bic r0, #CPU_CONTROL_MMU_ENABLE From owner-svn-src-head@freebsd.org Tue Aug 25 15:27:34 2015 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 3F0E499A286; Tue, 25 Aug 2015 15:27:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2DBC39BA; Tue, 25 Aug 2015 15:27:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PFRYba096186; Tue, 25 Aug 2015 15:27:34 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PFRWaL096181; Tue, 25 Aug 2015 15:27:32 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508251527.t7PFRWaL096181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 25 Aug 2015 15:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287129 - in head: usr.bin/ypwhich usr.sbin/ypserv usr.sbin/ypserv/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.20 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, 25 Aug 2015 15:27:34 -0000 Author: araujo Date: Tue Aug 25 15:27:32 2015 New Revision: 287129 URL: https://svnweb.freebsd.org/changeset/base/287129 Log: Sync ypwhich(1) code with the OpenBSD version that is more modern. Update the BSD LICENSE and remove the 3rd clause. Reviewed by: rodrigc, kib, bapt Approved by: bapt (mentor) Obtained from: OpenBSD Differential Revision: D3249 Added: head/usr.sbin/ypserv/common/ head/usr.sbin/ypserv/common/yplib_host.c (contents, props changed) head/usr.sbin/ypserv/common/yplib_host.h (contents, props changed) Modified: head/usr.bin/ypwhich/Makefile head/usr.bin/ypwhich/ypwhich.c head/usr.sbin/ypserv/Makefile Modified: head/usr.bin/ypwhich/Makefile ============================================================================== --- head/usr.bin/ypwhich/Makefile Tue Aug 25 15:14:50 2015 (r287128) +++ head/usr.bin/ypwhich/Makefile Tue Aug 25 15:27:32 2015 (r287129) @@ -1,7 +1,13 @@ # from: @(#)Makefile 5.8 (Berkeley) 7/28/90 # $FreeBSD$ +YPSERV=${.CURDIR}/../../usr.sbin/ypserv/common +.PATH: ${YPSERV} + PROG= ypwhich +SRCS= yplib_host.c ypwhich.c + +CFLAGS+= -I${YPSERV} -I. WARNS?= 2 Modified: head/usr.bin/ypwhich/ypwhich.c ============================================================================== --- head/usr.bin/ypwhich/ypwhich.c Tue Aug 25 15:14:50 2015 (r287128) +++ head/usr.bin/ypwhich/ypwhich.c Tue Aug 25 15:27:32 2015 (r287129) @@ -1,5 +1,8 @@ +/* $OpenBSD: ypwhich.c,v 1.23 2015/02/08 23:40:35 deraadt Exp $ */ +/* $NetBSD: ypwhich.c,v 1.6 1996/05/13 02:43:48 thorpej Exp $ */ + /* - * Copyright (c) 1992/3 Theo de Raadt + * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,9 +13,6 @@ * 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. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -34,13 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include - #include - #include #include @@ -51,13 +45,12 @@ __FBSDID("$FreeBSD$"); #include #include -#define ERR_USAGE 1 /* bad arguments - display 'usage' message */ -#define ERR_NOSUCHHOST 2 /* no such host */ -#define ERR_NOBINDING 3 /* error from ypbind -- domain not bound */ -#define ERR_NOYPBIND 4 /* ypbind not running */ -#define ERR_NOMASTER 5 /* could not find master server */ +#include +#include +#include +#include -extern bool_t xdr_domainname(); +#include "yplib_host.h" static const struct ypalias { char *alias, *name; @@ -77,10 +70,11 @@ static const struct ypalias { static void usage(void) { - fprintf(stderr, "%s\n%s\n", - "usage: ypwhich [-d domain] [[-t] -m [mname] | host]", - " ypwhich -x"); - exit(ERR_USAGE); + fprintf(stderr, + "usage: ypwhich [-t] [-d domain] [[-h] host]\n" + " ypwhich [-t] [-d domain] [-h host] -m [mname]\n" + " ypwhich -x\n"); + exit(1); } @@ -88,26 +82,28 @@ usage(void) * Like yp_bind except can query a specific host */ static int -bind_host(char *dom, struct sockaddr_in *lsin) +bind_host(char *dom, struct sockaddr_in *sin) { struct hostent *hent = NULL; struct ypbind_resp ypbr; + struct in_addr ss_addr; struct timeval tv; CLIENT *client; int sock, r; - struct in_addr ss_addr; sock = RPC_ANYSOCK; tv.tv_sec = 15; tv.tv_usec = 0; - client = clntudp_create(lsin, YPBINDPROG, YPBINDVERS, tv, &sock); + client = clntudp_create(sin, YPBINDPROG, YPBINDVERS, tv, &sock); + if (client == NULL) { - warnx("can't clntudp_create: %s", yperr_string(YPERR_YPBIND)); + warnx("host is not bound to a ypmaster"); return (YPERR_YPBIND); } tv.tv_sec = 5; tv.tv_usec = 0; + r = clnt_call(client, YPBINDPROC_DOMAIN, (xdrproc_t)xdr_domainname, &dom, (xdrproc_t)xdr_ypbind_resp, &ypbr, tv); @@ -118,37 +114,41 @@ bind_host(char *dom, struct sockaddr_in } else { if (ypbr.ypbind_status != YPBIND_SUCC_VAL) { warnx("can't yp_bind: reason: %s", - ypbinderr_string(ypbr.ypbind_respbody.ypbind_error)); + yperr_string(ypbr.ypbind_status)); clnt_destroy(client); return (r); } } clnt_destroy(client); - ss_addr = ypbr.ypbind_respbody.ypbind_bindinfo.ypbind_binding_addr; - /*printf("%08x\n", ss_addr);*/ - hent = gethostbyaddr((char *)&ss_addr, sizeof(ss_addr), AF_INET); - if (hent) + memmove(&ss_addr.s_addr, &ypbr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr, + sizeof (ss_addr)); + + hent = gethostbyaddr((char *)&ss_addr.s_addr, sizeof(ss_addr.s_addr), + AF_INET); + if (hent != NULL) printf("%s\n", hent->h_name); else printf("%s\n", inet_ntoa(ss_addr)); + return (0); } int main(int argc, char *argv[]) { - char *domnam = NULL, *master; - char *map = NULL; + char *domain, *master, *map = NULL, *host = NULL; + int notrans = 0, mode = 0, c, r, i; struct ypmaplist *ypml, *y; + struct sockaddr_in sin; struct hostent *hent; - struct sockaddr_in lsin; - int notrans, mode; - int c, r; - u_int i; + CLIENT *client = NULL; - notrans = mode = 0; - while ((c = getopt(argc, argv, "xd:mt")) != -1) + yp_get_default_domain(&domain); + if (domain == NULL) + errx(1, "YP domain name not set"); + + while ((c = getopt(argc, argv, "xd:h:mt")) != -1) switch (c) { case 'x': for (i = 0; i < nitems(ypaliases); i++) @@ -156,44 +156,46 @@ main(int argc, char *argv[]) ypaliases[i].alias, ypaliases[i].name); exit(0); + case 'h': + host = optarg; + break; case 'd': - domnam = optarg; + domain = optarg; break; case 't': - notrans++; + notrans = 1; break; case 'm': - mode++; + mode = 1; break; default: usage(); } - - if (domnam == NULL) - yp_get_default_domain(&domnam); + argc -= optind; + argv += optind; if (mode == 0) { - switch (argc-optind) { + switch (argc) { case 0: - bzero(&lsin, sizeof lsin); - lsin.sin_family = AF_INET; - lsin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + memset(&sin, 0, sizeof sin); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - if (bind_host(domnam, &lsin)) - exit(ERR_NOBINDING); + if (bind_host(domain, &sin)) + exit(1); break; case 1: - bzero(&lsin, sizeof lsin); - lsin.sin_family = AF_INET; - if ((lsin.sin_addr.s_addr = inet_addr(argv[optind])) == INADDR_NONE) { - hent = gethostbyname(argv[optind]); - if (!hent) - errx(ERR_NOSUCHHOST, "host %s unknown", argv[optind]); - bcopy((char *)hent->h_addr_list[0], - (char *)&lsin.sin_addr, sizeof lsin.sin_addr); + bzero(&sin, sizeof sin); + sin.sin_family = AF_INET; + if (inet_aton(argv[0], &sin.sin_addr) == 0) { + hent = gethostbyname(argv[0]); + if (!hent) { + errx(1, "host %s unknown", + argv[0]); + } } - if (bind_host(domnam, &lsin)) - exit(ERR_NOBINDING); + if (bind_host(domain, &sin)) + exit(1); break; default: usage(); @@ -201,57 +203,75 @@ main(int argc, char *argv[]) exit(0); } - if (argc-optind > 1) + if (argc > 1) usage(); - if (argv[optind]) { - map = argv[optind]; + if (host != NULL) + client = yp_bind_host(host, YPPROG, YPVERS, 0, 1); + + if (argv[0]) { + map = argv[0]; if (notrans == 0) { for (i = 0; i < nitems(ypaliases); i++) if (strcmp(map, ypaliases[i].alias) == 0) map = ypaliases[i].name; } - r = yp_master(domnam, map, &master); + + if (host != NULL) + r = yp_master_host(client, domain, map, &master); + else + r = yp_master(domain, map, &master); + switch (r) { case 0: printf("%s\n", master); free(master); break; case YPERR_YPBIND: - errx(ERR_NOYPBIND, "not running ypbind"); + errx(1, "not running ypbind"); default: - errx(ERR_NOMASTER, "can't find master for map %s: reason: %s", - map, yperr_string(r)); + errx(1, "can't find master for map %s: reason: %s", + map, yperr_string(r)); } exit(0); } ypml = NULL; - r = yp_maplist(domnam, &ypml); + if (host != NULL) + r = yp_maplist_host(client, domain, &ypml); + else + r = yp_maplist(domain, &ypml); + + r = 0; switch (r) { case 0: - for (y = ypml; y;) { + for (y = ypml; y; ) { ypml = y; - r = yp_master(domnam, ypml->ypml_name, &master); + if (host != NULL) { + r = yp_master_host(client, + domain, ypml->map, &master); + } else { + r = yp_master(domain, ypml->map, &master); + } switch (r) { case 0: - printf("%s %s\n", ypml->ypml_name, master); + printf("%s %s\n", ypml->map, master); free(master); break; default: warnx("can't find the master of %s: reason: %s", - ypml->ypml_name, yperr_string(r)); + ypml->map, yperr_string(r)); break; } - y = ypml->ypml_next; + y = ypml->next; free(ypml); } break; case YPERR_YPBIND: - errx(ERR_NOYPBIND, "not running ypbind"); + errx(1, "not running ypbind"); default: - errx(ERR_NOMASTER, "can't get map list for domain %s: reason: %s", - domnam, yperr_string(r)); + errx(1, "can't get map list for domain %s: reason: %s", + domain, yperr_string(r)); } exit(0); } Modified: head/usr.sbin/ypserv/Makefile ============================================================================== --- head/usr.sbin/ypserv/Makefile Tue Aug 25 15:14:50 2015 (r287128) +++ head/usr.sbin/ypserv/Makefile Tue Aug 25 15:27:32 2015 (r287129) @@ -1,12 +1,14 @@ # $FreeBSD$ RPCDIR= ${.CURDIR}/../../include/rpcsvc -.PATH: ${RPCDIR} +.PATH: ${RPCDIR} \ + ${.CURDIR}/common PROG= ypserv MAN= ypserv.8 ypinit.8 SRCS= yp_svc.c yp_server.c yp_dblookup.c yp_dnslookup.c \ - ypxfr_clnt.c yp.h yp_main.c yp_error.c yp_access.c yp_svc_udp.c + ypxfr_clnt.c yp.h yp_main.c yp_error.c yp_access.c yp_svc_udp.c \ + yplib_host.c CFLAGS+= -DDB_CACHE -DTCP_WRAPPER -I. Added: head/usr.sbin/ypserv/common/yplib_host.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ypserv/common/yplib_host.c Tue Aug 25 15:27:32 2015 (r287129) @@ -0,0 +1,356 @@ +/* $OpenBSD: yplib_host.c,v 1.18 2015/01/16 06:40:22 deraadt Exp $ */ + +/* + * Copyright (c) 1992, 1993 Theo de Raadt + * 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 ``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 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 +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "yplib_host.h" + +extern int (*ypresp_allfn)(u_long, char *, int, char *, int, void *); +extern void *ypresp_data; +extern bool_t xdr_ypreq_key(), xdr_ypresp_val(); +extern bool_t xdr_ypresp_all_seq(); + +static int _yplib_host_timeout = 10; + +CLIENT * +yp_bind_host(char *server, u_long program, u_long version, u_short port, + int usetcp) +{ + struct sockaddr_in rsrv_sin; + static CLIENT *client; + struct hostent *h; + struct timeval tv; + int rsrv_sock; + + memset(&rsrv_sin, 0, sizeof rsrv_sin); + rsrv_sin.sin_len = sizeof rsrv_sin; + rsrv_sin.sin_family = AF_INET; + rsrv_sock = RPC_ANYSOCK; + if (port != 0) + rsrv_sin.sin_port = htons(port); + + if (*server >= '0' && *server <= '9') { + if (inet_aton(server, &rsrv_sin.sin_addr) == 0) { + errx(1, "inet_aton: invalid address %s.", + server); + } + } else { + h = gethostbyname(server); + if (h == NULL) { + errx(1, "gethostbyname: unknown host %s.", + server); + } + rsrv_sin.sin_addr.s_addr = *(u_int32_t *)h->h_addr; + } + + tv.tv_sec = 10; + tv.tv_usec = 0; + + if (usetcp) + client = clnttcp_create(&rsrv_sin, program, version, + &rsrv_sock, 0, 0); + else + client = clntudp_create(&rsrv_sin, program, version, tv, + &rsrv_sock); + + if (client == NULL) { + errx(1, "clntudp_create: no contact with host %s.", + server); + } + + return (client); +} + +CLIENT * +yp_bind_local(u_long program, u_long version) +{ + struct sockaddr_in rsrv_sin; + static CLIENT *client; + struct timeval tv; + int rsrv_sock; + + memset(&rsrv_sin, 0, sizeof rsrv_sin); + rsrv_sin.sin_len = sizeof rsrv_sin; + rsrv_sin.sin_family = AF_INET; + rsrv_sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + rsrv_sock = RPC_ANYSOCK; + + tv.tv_sec = 10; + tv.tv_usec = 0; + + client = clntudp_create(&rsrv_sin, program, version, tv, &rsrv_sock); + if (client == NULL) { + errx(1, "clntudp_create: no contact with localhost."); + } + + return (client); +} + +int +yp_match_host(CLIENT *client, char *indomain, char *inmap, const char *inkey, + int inkeylen, char **outval, int *outvallen) +{ + struct ypresp_val yprv; + struct ypreq_key yprk; + struct timeval tv; + int r; + + *outval = NULL; + *outvallen = 0; + + tv.tv_sec = _yplib_host_timeout; + tv.tv_usec = 0; + + yprk.domain = indomain; + yprk.map = inmap; + yprk.key.keydat_val = (char *)inkey; + yprk.key.keydat_len = inkeylen; + + memset(&yprv, 0, sizeof yprv); + + r = clnt_call(client, YPPROC_MATCH, + (xdrproc_t)xdr_ypreq_key, &yprk, + (xdrproc_t)xdr_ypresp_val, &yprv, tv); + if (r != RPC_SUCCESS) + clnt_perror(client, "yp_match_host: clnt_call"); + if ( !(r = ypprot_err(yprv.stat)) ) { + *outvallen = yprv.val.valdat_len; + *outval = malloc(*outvallen + 1); + memcpy(*outval, yprv.val.valdat_val, *outvallen); + (*outval)[*outvallen] = '\0'; + } + xdr_free((xdrproc_t)xdr_ypresp_val, (char *)&yprv); + + return (r); +} + +int +yp_first_host(CLIENT *client, char *indomain, char *inmap, char **outkey, + int *outkeylen, char **outval, int *outvallen) +{ + struct ypresp_key_val yprkv; + struct ypreq_nokey yprnk; + struct timeval tv; + int r; + + *outkey = *outval = NULL; + *outkeylen = *outvallen = 0; + + tv.tv_sec = _yplib_host_timeout; + tv.tv_usec = 0; + + yprnk.domain = indomain; + yprnk.map = inmap; + memset(&yprkv, 0, sizeof yprkv); + + r = clnt_call(client, YPPROC_FIRST, + (xdrproc_t)xdr_ypreq_nokey, &yprnk, + (xdrproc_t)xdr_ypresp_key_val, &yprkv, tv); + if (r != RPC_SUCCESS) + clnt_perror(client, "yp_first_host: clnt_call"); + if ( !(r = ypprot_err(yprkv.stat)) ) { + *outkeylen = yprkv.key.keydat_len; + *outkey = malloc(*outkeylen+1); + memcpy(*outkey, yprkv.key.keydat_val, *outkeylen); + (*outkey)[*outkeylen] = '\0'; + *outvallen = yprkv.val.valdat_len; + *outval = malloc(*outvallen+1); + memcpy(*outval, yprkv.val.valdat_val, *outvallen); + (*outval)[*outvallen] = '\0'; + } + xdr_free((xdrproc_t)xdr_ypresp_key_val, (char *)&yprkv); + + return (r); +} + +int +yp_next_host(CLIENT *client, char *indomain, char *inmap, char *inkey, + int inkeylen, char **outkey, int *outkeylen, char **outval, int *outvallen) +{ + struct ypresp_key_val yprkv; + struct ypreq_key yprk; + struct timeval tv; + int r; + + *outkey = *outval = NULL; + *outkeylen = *outvallen = 0; + + tv.tv_sec = _yplib_host_timeout; + tv.tv_usec = 0; + + yprk.domain = indomain; + yprk.map = inmap; + yprk.key.keydat_val = inkey; + yprk.key.keydat_len = inkeylen; + memset(&yprkv, 0, sizeof yprkv); + + r = clnt_call(client, YPPROC_NEXT, + (xdrproc_t)xdr_ypreq_key, &yprk, + (xdrproc_t)xdr_ypresp_key_val, &yprkv, tv); + if (r != RPC_SUCCESS) + clnt_perror(client, "yp_next_host: clnt_call"); + if ( !(r = ypprot_err(yprkv.stat)) ) { + *outkeylen = yprkv.key.keydat_len; + *outkey = malloc(*outkeylen+1); + memcpy(*outkey, yprkv.key.keydat_val, *outkeylen); + (*outkey)[*outkeylen] = '\0'; + *outvallen = yprkv.val.valdat_len; + *outval = malloc(*outvallen+1); + memcpy(*outval, yprkv.val.valdat_val, *outvallen); + (*outval)[*outvallen] = '\0'; + } + xdr_free((xdrproc_t)xdr_ypresp_key_val, (char *)&yprkv); + + return (r); +} + +int +yp_all_host(CLIENT *client, char *indomain, char *inmap, + struct ypall_callback *incallback) +{ + struct ypreq_nokey yprnk; + struct timeval tv; + u_long status; + + tv.tv_sec = _yplib_host_timeout; + tv.tv_usec = 0; + + yprnk.domain = indomain; + yprnk.map = inmap; + ypresp_allfn = incallback->foreach; + ypresp_data = (void *)incallback->data; + + (void) clnt_call(client, YPPROC_ALL, + (xdrproc_t)xdr_ypreq_nokey, &yprnk, + (xdrproc_t)xdr_ypresp_all_seq, &status, tv); + if (status != YP_FALSE) + return ypprot_err(status); + + return (0); +} + +int +yp_order_host(CLIENT *client, char *indomain, char *inmap, u_int32_t *outorder) +{ + struct ypresp_order ypro; + struct ypreq_nokey yprnk; + struct timeval tv; + int r; + + tv.tv_sec = _yplib_host_timeout; + tv.tv_usec = 0; + + yprnk.domain = indomain; + yprnk.map = inmap; + + memset(&ypro, 0, sizeof ypro); + + r = clnt_call(client, YPPROC_ORDER, + (xdrproc_t)xdr_ypreq_nokey, &yprnk, + (xdrproc_t)xdr_ypresp_order, &ypro, tv); + if (r != RPC_SUCCESS) + clnt_perror(client, "yp_order_host: clnt_call"); + *outorder = ypro.ordernum; + xdr_free((xdrproc_t)xdr_ypresp_order, (char *)&ypro); + + return ypprot_err(ypro.stat); +} + +int +yp_master_host(CLIENT *client, char *indomain, char *inmap, char **outname) +{ + struct ypresp_master yprm; + struct ypreq_nokey yprnk; + struct timeval tv; + int r; + + tv.tv_sec = _yplib_host_timeout; + tv.tv_usec = 0; + yprnk.domain = indomain; + yprnk.map = inmap; + + memset(&yprm, 0, sizeof yprm); + + r = clnt_call(client, YPPROC_MASTER, + (xdrproc_t)xdr_ypreq_nokey, &yprnk, + (xdrproc_t)xdr_ypresp_master, &yprm, tv); + if (r != RPC_SUCCESS) + clnt_perror(client, "yp_master: clnt_call"); + if (!(r = ypprot_err(yprm.stat))) + *outname = strdup(yprm.peer); + xdr_free((xdrproc_t)xdr_ypresp_master, (char *)&yprm); + + return (r); +} + +int +yp_maplist_host(CLIENT *client, char *indomain, struct ypmaplist **outmaplist) +{ + struct ypresp_maplist ypml; + struct timeval tv; + int r; + + tv.tv_sec = _yplib_host_timeout; + tv.tv_usec = 0; + + memset(&ypml, 0, sizeof ypml); + + r = clnt_call(client, YPPROC_MAPLIST, + (xdrproc_t)xdr_domainname, &indomain, + (xdrproc_t)xdr_ypresp_maplist, &ypml, tv); + if (r != RPC_SUCCESS) + clnt_perror(client, "yp_maplist: clnt_call"); + *outmaplist = ypml.maps; + /* NO: xdr_free(xdr_ypresp_maplist, &ypml);*/ + + return ypprot_err(ypml.stat); +} Added: head/usr.sbin/ypserv/common/yplib_host.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ypserv/common/yplib_host.h Tue Aug 25 15:27:32 2015 (r287129) @@ -0,0 +1,53 @@ +/* $OpenBSD: yplib_host.h,v 1.8 2003/06/02 04:12:38 deraadt Exp $ */ + +/* + * Copyright (c) 1992, 1993 Theo de Raadt + * 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 ``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 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$ + */ + +#ifndef _YPLIB_HOST_H_ +#define _YPLIB_HOST_H_ + +int yp_match_host(CLIENT *client, char *indomain, char *inmap, + const char *inkey, int inkeylen, char **outval, int *outvallen); +int yp_first_host(CLIENT *client, char *indomain, char *inmap, + char **outkey, int *outkeylen, char **outval, int *outvallen); +int yp_next_host(CLIENT *client, char *indomain, char *inmap, char *inkey, + int inkeylen, char **outkey, int *outkeylen, char **outval, + int *outvallen); +int yp_master_host(CLIENT *client, char *indomain, char *inmap, + char **outname); +int yp_order_host(CLIENT *client, char *indomain, char *inmap, + u_int32_t *outorder); +int yp_all_host(CLIENT *client, char *indomain, char *inmap, + struct ypall_callback *incallback); +int yp_maplist_host(CLIENT *client, char *indomain, + struct ypmaplist **outmaplist); +CLIENT *yp_bind_local(u_long program, u_long version); +CLIENT *yp_bind_host(char *server, u_long program, u_long version, + u_short port, int usetcp); + +#endif /* _YPLIB_HOST_H_ */ From owner-svn-src-head@freebsd.org Tue Aug 25 15:32:10 2015 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 592E999A5E5; Tue, 25 Aug 2015 15:32:10 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3D9BCEF4; Tue, 25 Aug 2015 15:32:10 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PFWA3n000117; Tue, 25 Aug 2015 15:32:10 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PFW9Wb000114; Tue, 25 Aug 2015 15:32:09 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508251532.t7PFW9Wb000114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 25 Aug 2015 15:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287130 - head/sbin/ipfw 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.20 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, 25 Aug 2015 15:32:10 -0000 Author: araujo Date: Tue Aug 25 15:32:08 2015 New Revision: 287130 URL: https://svnweb.freebsd.org/changeset/base/287130 Log: Code cleanup unused-but-set-variable spotted by gcc. Reviewed by: melifaro Approved by: bapt (mentor) Differential Revision: D3473 Modified: head/sbin/ipfw/ipfw2.c head/sbin/ipfw/nat.c head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue Aug 25 15:27:32 2015 (r287129) +++ head/sbin/ipfw/ipfw2.c Tue Aug 25 15:32:08 2015 (r287130) @@ -1308,14 +1308,12 @@ print_icmptypes(struct buf_pr *bp, ipfw_ static void print_dscp(struct buf_pr *bp, ipfw_insn_u32 *cmd) { - int i, c; + int i = 0; uint32_t *v; char sep= ' '; const char *code; bprintf(bp, " dscp"); - i = 0; - c = 0; v = cmd->d; while (i < 64) { if (*v & (1 << i)) { Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Tue Aug 25 15:27:32 2015 (r287129) +++ head/sbin/ipfw/nat.c Tue Aug 25 15:32:08 2015 (r287130) @@ -87,7 +87,7 @@ set_addr_dynamic(const char *ifn, struct struct ifa_msghdr *ifam; struct sockaddr_dl *sdl; struct sockaddr_in *sin; - int ifIndex, ifMTU; + int ifIndex; mib[0] = CTL_NET; mib[1] = PF_ROUTE; @@ -126,7 +126,6 @@ set_addr_dynamic(const char *ifn, struct if (strlen(ifn) == sdl->sdl_nlen && strncmp(ifn, sdl->sdl_data, sdl->sdl_nlen) == 0) { ifIndex = ifm->ifm_index; - ifMTU = ifm->ifm_data.ifi_mtu; break; } } @@ -635,14 +634,13 @@ nat_show_log(struct nat44_cfg_nat *n, vo static void nat_show_cfg(struct nat44_cfg_nat *n, void *arg) { - int i, cnt, flag, off; + int i, cnt, off; struct nat44_cfg_redir *t; struct nat44_cfg_spool *s; caddr_t buf; struct protoent *p; buf = (caddr_t)n; - flag = 1; off = sizeof(*n); printf("ipfw nat %s config", n->name); if (strlen(n->if_name) != 0) Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Tue Aug 25 15:27:32 2015 (r287129) +++ head/sbin/ipfw/tables.c Tue Aug 25 15:32:08 2015 (r287130) @@ -387,11 +387,9 @@ table_create(ipfw_obj_header *oh, int ac ipfw_xtable_info xi; int error, tcmd, val; uint32_t fset, fclear; - size_t sz; char *e, *p; char tbuf[128]; - sz = sizeof(tbuf); memset(&xi, 0, sizeof(xi)); while (ac > 0) { @@ -494,10 +492,7 @@ table_modify(ipfw_obj_header *oh, int ac { ipfw_xtable_info xi; int tcmd; - size_t sz; - char tbuf[128]; - sz = sizeof(tbuf); memset(&xi, 0, sizeof(xi)); while (ac > 0) { @@ -1449,14 +1444,13 @@ tentry_fill_value(ipfw_obj_header *oh, i uint8_t type, uint32_t vmask) { struct addrinfo hints, *res; - uint32_t a4, flag, val, vm; + uint32_t a4, flag, val; ipfw_table_value *v; uint32_t i; int dval; char *comma, *e, *etype, *n, *p; v = &tent->v.value; - vm = vmask; /* Compat layer: keep old behavior for legacy value types */ if (vmask == IPFW_VTYPE_LEGACY) { From owner-svn-src-head@freebsd.org Tue Aug 25 15:33:10 2015 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 4EABD99A6A1; Tue, 25 Aug 2015 15:33:10 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3EF39107F; Tue, 25 Aug 2015 15:33:10 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PFXAbf000219; Tue, 25 Aug 2015 15:33:10 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PFXAgk000218; Tue, 25 Aug 2015 15:33:10 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508251533.t7PFXAgk000218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 25 Aug 2015 15:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287131 - head/sbin/newfs 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.20 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, 25 Aug 2015 15:33:10 -0000 Author: araujo Date: Tue Aug 25 15:33:09 2015 New Revision: 287131 URL: https://svnweb.freebsd.org/changeset/base/287131 Log: Code cleanup unused-but-set-variable spotted by gcc. Approved by: bapt (mentor) Differential Revision: D3475 Modified: head/sbin/newfs/newfs.c Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Tue Aug 25 15:32:08 2015 (r287130) +++ head/sbin/newfs/newfs.c Tue Aug 25 15:33:09 2015 (r287131) @@ -130,7 +130,6 @@ main(int argc, char *argv[]) { struct partition *pp; struct disklabel *lp; - struct partition oldpartition; struct stat st; char *cp, *special; intmax_t reserved; @@ -362,7 +361,6 @@ main(int argc, char *argv[]) pp = &lp->d_partitions[RAW_PART]; else pp = &lp->d_partitions[*cp - 'a']; - oldpartition = *pp; if (pp->p_size == 0) errx(1, "%s: `%c' partition is unavailable", special, *cp); From owner-svn-src-head@freebsd.org Tue Aug 25 15:34:30 2015 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 8264399A7A1; Tue, 25 Aug 2015 15:34:30 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 59C35134C; Tue, 25 Aug 2015 15:34:30 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PFYUrb000413; Tue, 25 Aug 2015 15:34:30 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PFYTpi000410; Tue, 25 Aug 2015 15:34:29 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508251534.t7PFYTpi000410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 25 Aug 2015 15:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287132 - in head/sys/dev/xen: blkback netfront xenstore 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.20 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, 25 Aug 2015 15:34:30 -0000 Author: araujo Date: Tue Aug 25 15:34:28 2015 New Revision: 287132 URL: https://svnweb.freebsd.org/changeset/base/287132 Log: Code cleanup unused-but-set-variable spotted by gcc. Reviewed by: royger Approved by: bapt (mentor) Differential Revision: D3476 Modified: head/sys/dev/xen/blkback/blkback.c head/sys/dev/xen/netfront/netfront.c head/sys/dev/xen/xenstore/xenstore.c Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Tue Aug 25 15:33:09 2015 (r287131) +++ head/sys/dev/xen/blkback/blkback.c Tue Aug 25 15:34:28 2015 (r287132) @@ -2245,7 +2245,6 @@ xbb_dispatch_file(struct xbb_softc *xbb, struct xbb_file_data *file_data; u_int seg_idx; u_int nseg; - off_t sectors_sent; struct uio xuio; struct xbb_sg *xbb_sg; struct iovec *xiovec; @@ -2256,7 +2255,6 @@ xbb_dispatch_file(struct xbb_softc *xbb, int error; file_data = &xbb->backend.file; - sectors_sent = 0; error = 0; bzero(&xuio, sizeof(xuio)); Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Tue Aug 25 15:33:09 2015 (r287131) +++ head/sys/dev/xen/netfront/netfront.c Tue Aug 25 15:34:28 2015 (r287132) @@ -600,9 +600,6 @@ setup_device(device_t dev, struct netfro netif_tx_sring_t *txs; netif_rx_sring_t *rxs; int error; - struct ifnet *ifp; - - ifp = info->xn_ifp; info->tx_ring_ref = GRANT_REF_INVALID; info->rx_ring_ref = GRANT_REF_INVALID; Modified: head/sys/dev/xen/xenstore/xenstore.c ============================================================================== --- head/sys/dev/xen/xenstore/xenstore.c Tue Aug 25 15:33:09 2015 (r287131) +++ head/sys/dev/xen/xenstore/xenstore.c Tue Aug 25 15:34:28 2015 (r287132) @@ -1427,7 +1427,6 @@ xs_rm_tree(struct xs_transaction xbt, co char *cur_path; const char **dir; int error; - int empty; retry: root_path_sbuf = xs_join(base, node); @@ -1444,7 +1443,6 @@ retry: xbt = local_xbt; } - empty = 0; while (1) { u_int count; u_int i; From owner-svn-src-head@freebsd.org Tue Aug 25 16:27:53 2015 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 9DF5799EE05 for ; Tue, 25 Aug 2015 16:27:53 +0000 (UTC) (envelope-from s.tyshchenko@identika.pro) Received: from scale212.ru (scale212.ru [51.254.36.76]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2183D273 for ; Tue, 25 Aug 2015 16:27:52 +0000 (UTC) (envelope-from s.tyshchenko@identika.pro) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=scale212.ru; s=default; h=Content-Type:List-Unsubscribe:Message-ID:Sender:From:Date:MIME-Version:Subject:To; bh=3VXWAEjRDoq5Q+pJHF+RVJA0pUz5mSNMezxRNwmtnMs=; b=dBFoxa/VAzJ8iuc5NxyBa9GEzdnOqtqJQccOa5Q4NpbTif3xX0TwqTC9nqhULzoz17XmqawU2nzawYZOQrHesxkqYMBUs7A74Ws8lj4+Ias3GmxU3ElrIYeYT+ByenKlpxjbcrmrfXRoQ/Xm/WHu6nGVNJE9y/YXPOzcoQ8Ot5o=; Received: from root by scale212.ru with local (Exim 4.80) (envelope-from ) id 1ZUH4g-0006pM-RY for svn-src-head@freebsd.org; Tue, 25 Aug 2015 18:27:50 +0200 To: svn-src-head@freebsd.org Subject: For you MIME-Version: 1.0 Date: Tue, 25 Aug 2015 18:27:50 +0200 From: Sergey Tyshchenko Sender: s.tyshchenko@identika.pro Message-ID: <241801872.26531@scale212.ru> X-Priority: 3 X-Mailer: scale212.ru mailer. Ver. 1.1. Precedence: bulk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 25 Aug 2015 16:27:53 -0000 Zm9yIHlvdQ0KCQkJDQoNCgkJCQ0KCQkJwqANCg0KCQkJwqANCg0KCQkJwqANCg0KCQkJwqANCg0K CQkJDQoJCQ0KCQkNCgkJCQ0KCQkJDQoJCQkNCgkJCUhlbGxvLCBNeSBuYW1lIGlzIFNlcmdleSwg SSBwcm9wb3NlIHlvdSBjb29wZXJhdGlvbi4gV2UgYXJlIGEgY3JlYXRpdmUgY29tcGFueSBpbiB0 aGUgZGV2ZWxvcG1lbnQgYW5kIGNyZWF0aW9uIG9mIHVuaXF1ZSBwcm9kdWN0cyBmb3IgZGVjb3Jh dGlvbiAtIHRvIGRlc2lnbiBidWlsZGluZ3MgSURFTlRJS0EuUFJPLiBXZScncmUgc3BlY2lhbGl6 ZWQgb24gZGVjb3JhdGlvbiBvZiBzaG9wcywgcGV0cm9sIHN0YXRpb24sIGNhZmUsIGZhc3QgZm9v ZCByZXN0YXVyYW50cywgYW5kIHJldGFpbCBmcmFuY2hpc2VzLldlIGFyZSBpbnRlcmVzdGVkIGF0 IGxvbmctdGVybSBjb29wZXJhdGlvbiB3aXRoIHlvdS4gV2UgcHJvcG9zZSBhIGdvb2QgZW52aXJv bm1lbnQgdG8gd29yayB3aXRoIHBhcnRuZXJzLkV4YW1wbGVzIG9mIG91ciB3b3JrIGh0dHAgOmh0 dHA6Ly9pZGVudGlrYS5wcm8vY291bnRlcl9saW5rL2NvdW50ZXIucGhwP2NsaWNrPXByZXNlbnRh dGlvbl9lbkkgcHJvcG9zZSBZb3UgdG8gYmVjb21lIG91ciBwYXJ0bmVyIGluIHlvdXIgYXJlYS5M ZXQgdXMga25vdyBhYm91dCB5b3VyIGRlY2lzaW9uDQoJCQkNCg0KCQkJDQoJCQnCoA0KDQoJCQnC oA0KDQoJCQnCoA0KDQoJCQnCoA0KDQoJCQkNCgkJDQoJCQ0KCQkJDQoJCQkNCgkJCQ0KCQkJDQoJ CQkNCg0KCQkJDQoJCQnCoA0KDQoJCQnCoA0KDQoJCQnCoA0KDQoJCQnCoA0KDQoJCQkNCgkJDQoJ CQ0KCQkJDQoJCQkNCgkJCQ0KCQkJDQoJCQkNCg0KCQkJDQoJCQnCoA0KDQoJCQnCoA0KDQoJCQnC oA0KDQoJCQnCoA0KDQoJCQkNCgkJDQoJCQ0KCQkJDQoJCQkNCgkJCQ0KCQkJIEV4YW1wbGVzIG9m IG91ciB3b3JrIGh0dHAgOmh0dHA6Ly9pZGVudGlrYS5wcm8vY291bnRlcl9saW5rL2NvdW50ZXIu cGhwP2NsaWNrPXByZXNlbnRhdGlvbl9lbg0KCQkJDQoNCgkJCQ0KCQkJwqANCg0KCQkJwqANCg0K CQkJwqANCg0KCQkJwqANCg0KCQkJDQoJCQ0KCQkNCgkJCQ0KCQkJDQoJCQkNCgkJCVNlcmdleSBU eXNoY2hlbmtvQ0VPIHwgSURFTlRJS0EuUFJPVmliZXI6ICszODA1MDU1NjY5NjUgfCBXaGF0c0Fw cDogKzM4MDUwNTU2Njk2NVNreXBlOiB0LnNlcmdleS5tcy50eXNoY2hlbmtvQGlkZW50aWthLnBy byB8IHd3dy5pZGVudGlrYS5wcm8wMzA0MCB8IEdvbG9zaWl2c2t5aSBBdmUuIDcwIHwgb2ZmaWNl IDUwMiB8IEtpZXYgDQoJCQkNCg0KCQkJDQoJCQnCoA0KDQoJCQnCoA0KDQoJCQnCoA0KDQoJCQnC oA== From owner-svn-src-head@freebsd.org Tue Aug 25 16:43:33 2015 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 9446099A727; Tue, 25 Aug 2015 16:43:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7F600DB4; Tue, 25 Aug 2015 16:43:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PGhX0U033213; Tue, 25 Aug 2015 16:43:33 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PGhXLD033212; Tue, 25 Aug 2015 16:43:33 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508251643.t7PGhXLD033212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 25 Aug 2015 16:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287133 - head/sys/arm64/arm64 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.20 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, 25 Aug 2015 16:43:33 -0000 Author: andrew Date: Tue Aug 25 16:43:32 2015 New Revision: 287133 URL: https://svnweb.freebsd.org/changeset/base/287133 Log: Correctly update the address to write to after storing the stack pointer in the kernels setjmp function. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/support.S Modified: head/sys/arm64/arm64/support.S ============================================================================== --- head/sys/arm64/arm64/support.S Tue Aug 25 15:34:28 2015 (r287132) +++ head/sys/arm64/arm64/support.S Tue Aug 25 16:43:32 2015 (r287133) @@ -221,7 +221,7 @@ END(suswintr) ENTRY(setjmp) /* Store the stack pointer */ mov x8, sp - str x8, [x0] + str x8, [x0], #8 /* Store the general purpose registers and lr */ stp x19, x20, [x0], #16 From owner-svn-src-head@freebsd.org Tue Aug 25 16:49:11 2015 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 524C899A90A; Tue, 25 Aug 2015 16:49:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 42F9511F; Tue, 25 Aug 2015 16:49:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PGnBlu033946; Tue, 25 Aug 2015 16:49:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PGnBhR033945; Tue, 25 Aug 2015 16:49:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508251649.t7PGnBhR033945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 25 Aug 2015 16:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287134 - head/sys/arm64/arm64 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.20 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, 25 Aug 2015 16:49:11 -0000 Author: andrew Date: Tue Aug 25 16:49:10 2015 New Revision: 287134 URL: https://svnweb.freebsd.org/changeset/base/287134 Log: Call into kdb on a data abort when it's enabled. This is needed to correctly handle trying to access an invalid address in the debugger. While here document that the breakpoint handler is supposed to fall through to the following case. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Tue Aug 25 16:43:32 2015 (r287133) +++ head/sys/arm64/arm64/trap.c Tue Aug 25 16:49:10 2015 (r287134) @@ -155,6 +155,13 @@ data_abort(struct trapframe *frame, uint uint64_t far; int error, sig, ucode; +#ifdef KDB + if (kdb_active) { + kdb_reenter(); + return; + } +#endif + td = curthread; pcb = td->td_pcb; @@ -221,6 +228,11 @@ data_abort(struct trapframe *frame, uint frame->tf_elr = pcb->pcb_onfault; return; } +#ifdef KDB + if (debugger_on_panic || kdb_active) + if (kdb_trap(ESR_ELx_EXCEPTION(esr), 0, frame)) + return; +#endif panic("vm_fault failed: %lx", frame->tf_elr); } } @@ -293,6 +305,7 @@ do_el1h_sync(struct trapframe *frame) break; } #endif + /* FALLTHROUGH */ case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: #ifdef KDB From owner-svn-src-head@freebsd.org Tue Aug 25 16:50:26 2015 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 7BFCA99A980; Tue, 25 Aug 2015 16:50:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6D012625; Tue, 25 Aug 2015 16:50:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PGoQBR036589; Tue, 25 Aug 2015 16:50:26 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PGoQEm036588; Tue, 25 Aug 2015 16:50:26 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508251650.t7PGoQEm036588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 25 Aug 2015 16:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287135 - head/sys/arm64/arm64 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.20 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, 25 Aug 2015 16:50:26 -0000 Author: andrew Date: Tue Aug 25 16:50:25 2015 New Revision: 287135 URL: https://svnweb.freebsd.org/changeset/base/287135 Log: Use nitems to count the number of items in a static array. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/db_interface.c Modified: head/sys/arm64/arm64/db_interface.c ============================================================================== --- head/sys/arm64/arm64/db_interface.c Tue Aug 25 16:49:10 2015 (r287134) +++ head/sys/arm64/arm64/db_interface.c Tue Aug 25 16:50:25 2015 (r287135) @@ -100,7 +100,7 @@ struct db_variable db_regs[] = { { "sp", DB_OFFSET(tf_sp), db_frame }, }; -struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]); +struct db_variable *db_eregs = db_regs + nitems(db_regs); void db_show_mdpcpu(struct pcpu *pc) From owner-svn-src-head@freebsd.org Tue Aug 25 17:02:29 2015 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 297D799AE04; Tue, 25 Aug 2015 17:02:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 00878CB9; Tue, 25 Aug 2015 17:02:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PH2SMG042871; Tue, 25 Aug 2015 17:02:28 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PH2S2n042870; Tue, 25 Aug 2015 17:02:28 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508251702.t7PH2S2n042870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 25 Aug 2015 17:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287136 - head/sys/arm64/arm64 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.20 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, 25 Aug 2015 17:02:29 -0000 Author: andrew Date: Tue Aug 25 17:02:28 2015 New Revision: 287136 URL: https://svnweb.freebsd.org/changeset/base/287136 Log: Use kdb_jmpbuf and setjmp to handle accessing invalid addresses in the debugger memory access functions. This allows us to correctly reenter into the debugger on failure. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/db_interface.c Modified: head/sys/arm64/arm64/db_interface.c ============================================================================== --- head/sys/arm64/arm64/db_interface.c Tue Aug 25 16:50:25 2015 (r287135) +++ head/sys/arm64/arm64/db_interface.c Tue Aug 25 17:02:28 2015 (r287136) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include static int @@ -107,37 +108,28 @@ db_show_mdpcpu(struct pcpu *pc) { } -static int -db_validate_address(vm_offset_t addr) -{ - struct proc *p = curproc; - struct pmap *pmap; - - if (!p || !p->p_vmspace || !p->p_vmspace->vm_map.pmap || - addr >= VM_MAXUSER_ADDRESS) - pmap = pmap_kernel(); - else - pmap = p->p_vmspace->vm_map.pmap; - - return (pmap_extract(pmap, addr) != 0); -} - /* * Read bytes from kernel address space for debugger. */ int db_read_bytes(vm_offset_t addr, size_t size, char *data) { - const char *src = (const char *)addr; - - while (size-- > 0) { - if (db_validate_address((vm_offset_t)src)) { - db_printf("address %p is invalid\n", src); - return (-1); - } - *data++ = *src++; + jmp_buf jb; + void *prev_jb; + const char *src; + int ret; + + prev_jb = kdb_jmpbuf(jb); + ret = setjmp(jb); + + if (ret == 0) { + src = (const char *)addr; + while (size-- > 0) + *data++ = *src++; } - return (0); + (void)kdb_jmpbuf(prev_jb); + + return (ret); } /* @@ -146,21 +138,25 @@ db_read_bytes(vm_offset_t addr, size_t s int db_write_bytes(vm_offset_t addr, size_t size, char *data) { + jmp_buf jb; + void *prev_jb; char *dst; + int ret; - dst = (char *)addr; - while (size-- > 0) { - if (db_validate_address((vm_offset_t)dst)) { - db_printf("address %p is invalid\n", dst); - return (-1); - } - *dst++ = *data++; + prev_jb = kdb_jmpbuf(jb); + ret = setjmp(jb); + if (ret == 0) { + dst = (char *)addr; + while (size-- > 0) + *dst++ = *data++; + + dsb(ish); + + /* Clean D-cache and invalidate I-cache */ + cpu_dcache_wb_range(addr, (vm_size_t)size); + cpu_icache_sync_range(addr, (vm_size_t)size); } - dsb(ish); - - /* Clean D-cache and invalidate I-cache */ - cpu_dcache_wb_range(addr, (vm_size_t)size); - cpu_icache_sync_range(addr, (vm_size_t)size); + (void)kdb_jmpbuf(prev_jb); - return (0); + return (ret); } From owner-svn-src-head@freebsd.org Tue Aug 25 17:11:50 2015 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 8174B9C2187; Tue, 25 Aug 2015 17:11:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 58AFB227; Tue, 25 Aug 2015 17:11:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PHBoAJ047643; Tue, 25 Aug 2015 17:11:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PHBoDl047642; Tue, 25 Aug 2015 17:11:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508251711.t7PHBoDl047642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 25 Aug 2015 17:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287137 - head/share/mk 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.20 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, 25 Aug 2015 17:11:50 -0000 Author: imp Date: Tue Aug 25 17:11:49 2015 New Revision: 287137 URL: https://svnweb.freebsd.org/changeset/base/287137 Log: Add softfp to MACHINE_CPU more often when we're compiling for soft float targets. It is added for booke on powerpc and all arm with hf in the string. Also add arm to all arm builds and armv6 to armv6 and newer builds. PR: 202641 Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Tue Aug 25 17:02:28 2015 (r287136) +++ head/share/mk/bsd.cpu.mk Tue Aug 25 17:11:49 2015 (r287137) @@ -150,6 +150,7 @@ _CPUCFLAGS = -mcpu=ultrasparc3 # unordered list to make it easy for client makefiles to test for the # presence of a CPU feature. +########## i386 . if ${MACHINE_CPUARCH} == "i386" . if ${CPUTYPE} == "bdver4" MACHINE_CPU = xop avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 @@ -218,6 +219,7 @@ MACHINE_CPU = 3dnow mmx MACHINE_CPU = mmx . endif MACHINE_CPU += i486 +########## amd64 . elif ${MACHINE_CPUARCH} == "amd64" . if ${CPUTYPE} == "bdver4" MACHINE_CPU = xop avx2 avx sse42 sse41 ssse3 sse4a sse3 @@ -253,10 +255,12 @@ MACHINE_CPU = ssse3 sse3 MACHINE_CPU = sse3 . endif MACHINE_CPU += amd64 sse2 sse mmx +########## powerpc . elif ${MACHINE_ARCH} == "powerpc" . if ${CPUTYPE} == "e500" -MACHINE_CPU = booke +MACHINE_CPU = booke softfp . endif +########## sparc64 . elif ${MACHINE_ARCH} == "sparc64" . if ${CPUTYPE} == "v9" MACHINE_CPU = v9 @@ -272,11 +276,21 @@ MACHINE_CPU = v9 ultrasparc ultrasparc3 CFLAGS += -G0 .endif +########## arm +.if ${MACHINE_CPUARCH} == "arm" +MACHINE_CPU += arm +. if ${MACHINE_ARCH:Marmv6*} != "" +MACHINE_CPU += armv6 +. endif +. if ${MACHINE_ARCH:M*hf} == "" +MACHINE_CPU += softfp +. endif .if ${MACHINE_ARCH} == "armv6" # Needs to be CFLAGS not _CPUCFLAGS because it's needed for the ABI # not a nice optimization. CFLAGS += -mfloat-abi=softfp .endif +.endif # NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk From owner-svn-src-head@freebsd.org Tue Aug 25 17:39:04 2015 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 8AB4E9C2D6C; Tue, 25 Aug 2015 17:39:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7B857797; Tue, 25 Aug 2015 17:39:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PHd4R1059021; Tue, 25 Aug 2015 17:39:04 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PHd4VI059018; Tue, 25 Aug 2015 17:39:04 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201508251739.t7PHd4VI059018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 25 Aug 2015 17:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287138 - in head: sys/dev/ioat tools/tools/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.20 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, 25 Aug 2015 17:39:04 -0000 Author: cem Date: Tue Aug 25 17:39:03 2015 New Revision: 287138 URL: https://svnweb.freebsd.org/changeset/base/287138 Log: ioat(4): Minor style cleanups Suggested by: ngie Reviewed by: jimharris Approved by: markj (mentor) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3481 Modified: head/sys/dev/ioat/ioat.c head/tools/tools/ioat/Makefile Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Tue Aug 25 17:11:49 2015 (r287137) +++ head/sys/dev/ioat/ioat.c Tue Aug 25 17:39:03 2015 (r287138) @@ -798,7 +798,7 @@ resize_ring(struct ioat_softc *ioat, int new_idx = (ioat->tail + i) & (new_size - 1); ring[new_idx] = ioat_alloc_ring_entry(ioat); - if (!ring[new_idx]) { + if (ring[new_idx] == NULL) { while (i--) { new_idx2 = (ioat->tail + i) & (new_size - 1); Modified: head/tools/tools/ioat/Makefile ============================================================================== --- head/tools/tools/ioat/Makefile Tue Aug 25 17:11:49 2015 (r287137) +++ head/tools/tools/ioat/Makefile Tue Aug 25 17:39:03 2015 (r287138) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG= ioatcontrol -SRCS= ioatcontrol.c MAN= ioatcontrol.8 CFLAGS+= -I${.CURDIR:H:H:H}/sys/dev/ioat WARNS?= 6 From owner-svn-src-head@freebsd.org Tue Aug 25 20:48:38 2015 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 C673D99A655; Tue, 25 Aug 2015 20:48:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 AA893872; Tue, 25 Aug 2015 20:48:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PKmcZ6050936; Tue, 25 Aug 2015 20:48:38 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PKmbKS050933; Tue, 25 Aug 2015 20:48:37 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508252048.t7PKmbKS050933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 25 Aug 2015 20:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287143 - head/crypto/openssh 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.20 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, 25 Aug 2015 20:48:39 -0000 Author: delphij Date: Tue Aug 25 20:48:37 2015 New Revision: 287143 URL: https://svnweb.freebsd.org/changeset/base/287143 Log: Fix OpenSSH multiple vulnerabilities by backporting three changes from OpenSSH-portable master. Git revisions: 45b0eb752c94954a6de046bfaaf129e518ad4b5b 5e75f5198769056089fb06c4d738ab0e5abc66f7 d4697fe9a28dab7255c60433e4dd23cf7fce8a8b Reviewed by: des Security: FreeBSD-SA-15:22.openssh Modified: head/crypto/openssh/monitor.c head/crypto/openssh/monitor_wrap.c head/crypto/openssh/mux.c Modified: head/crypto/openssh/monitor.c ============================================================================== --- head/crypto/openssh/monitor.c Tue Aug 25 20:14:50 2015 (r287142) +++ head/crypto/openssh/monitor.c Tue Aug 25 20:48:37 2015 (r287143) @@ -1027,9 +1027,7 @@ extern KbdintDevice sshpam_device; int mm_answer_pam_init_ctx(int sock, Buffer *m) { - debug3("%s", __func__); - authctxt->user = buffer_get_string(m, NULL); sshpam_ctxt = (sshpam_device.init_ctx)(authctxt); sshpam_authok = NULL; buffer_clear(m); @@ -1111,14 +1109,16 @@ mm_answer_pam_respond(int sock, Buffer * int mm_answer_pam_free_ctx(int sock, Buffer *m) { + int r = sshpam_authok != NULL && sshpam_authok == sshpam_ctxt; debug3("%s", __func__); (sshpam_device.free_ctx)(sshpam_ctxt); + sshpam_ctxt = sshpam_authok = NULL; buffer_clear(m); mm_request_send(sock, MONITOR_ANS_PAM_FREE_CTX, m); auth_method = "keyboard-interactive"; auth_submethod = "pam"; - return (sshpam_authok == sshpam_ctxt); + return r; } #endif Modified: head/crypto/openssh/monitor_wrap.c ============================================================================== --- head/crypto/openssh/monitor_wrap.c Tue Aug 25 20:14:50 2015 (r287142) +++ head/crypto/openssh/monitor_wrap.c Tue Aug 25 20:48:37 2015 (r287143) @@ -820,7 +820,6 @@ mm_sshpam_init_ctx(Authctxt *authctxt) debug3("%s", __func__); buffer_init(&m); - buffer_put_cstring(&m, authctxt->user); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_INIT_CTX, &m); debug3("%s: waiting for MONITOR_ANS_PAM_INIT_CTX", __func__); mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PAM_INIT_CTX, &m); Modified: head/crypto/openssh/mux.c ============================================================================== --- head/crypto/openssh/mux.c Tue Aug 25 20:14:50 2015 (r287142) +++ head/crypto/openssh/mux.c Tue Aug 25 20:48:37 2015 (r287143) @@ -635,7 +635,8 @@ process_mux_open_fwd(u_int rid, Channel u_int lport, cport; int i, ret = 0, freefwd = 1; - fwd.listen_host = fwd.connect_host = NULL; + memset(&fwd, 0, sizeof(fwd)); + if (buffer_get_int_ret(&ftype, m) != 0 || (fwd.listen_host = buffer_get_string_ret(m, NULL)) == NULL || buffer_get_int_ret(&lport, m) != 0 || @@ -785,7 +786,8 @@ process_mux_close_fwd(u_int rid, Channel int i, listen_port, ret = 0; u_int lport, cport; - fwd.listen_host = fwd.connect_host = NULL; + memset(&fwd, 0, sizeof(fwd)); + if (buffer_get_int_ret(&ftype, m) != 0 || (fwd.listen_host = buffer_get_string_ret(m, NULL)) == NULL || buffer_get_int_ret(&lport, m) != 0 || From owner-svn-src-head@freebsd.org Tue Aug 25 21:55:17 2015 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 61E3A9C310F; Tue, 25 Aug 2015 21:55:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 359DBF0A; Tue, 25 Aug 2015 21:55:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PLtHNq079743; Tue, 25 Aug 2015 21:55:17 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PLtGQM079740; Tue, 25 Aug 2015 21:55:16 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201508252155.t7PLtGQM079740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 25 Aug 2015 21:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287148 - in head/bin/sh: . tests/builtins 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.20 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, 25 Aug 2015 21:55:17 -0000 Author: jilles Date: Tue Aug 25 21:55:15 2015 New Revision: 287148 URL: https://svnweb.freebsd.org/changeset/base/287148 Log: sh: Fix out of bounds read when there is no ] after a [:class:]. The initial check for a matching ] was incorrect if a ] may be consumed by a [:class:]. The subsequent loop assumed that there must be a ]. Remove the initial check and make the loop cope with a missing ]. Found with afl-fuzz. MFC after: 1 week Added: head/bin/sh/tests/builtins/case20.0 (contents, props changed) Modified: head/bin/sh/expand.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Tue Aug 25 20:49:05 2015 (r287147) +++ head/bin/sh/expand.c Tue Aug 25 21:55:15 2015 (r287148) @@ -1464,21 +1464,11 @@ patmatch(const char *pattern, const char bt_q = q; break; case '[': { - const char *endp; + const char *savep, *saveq; int invert, found; wchar_t chr; - endp = p; - if (*endp == '!' || *endp == '^') - endp++; - do { - while (*endp == CTLQUOTEMARK) - endp++; - if (*endp == 0) - goto dft; /* no matching ] */ - if (*endp == CTLESC) - endp++; - } while (*++endp != ']'); + savep = p, saveq = q; invert = 0; if (*p == '!' || *p == '^') { invert++; @@ -1497,6 +1487,11 @@ patmatch(const char *pattern, const char chr = (unsigned char)*q++; c = *p++; do { + if (c == '\0') { + p = savep, q = saveq; + c = '['; + goto dft; + } if (c == CTLQUOTEMARK) continue; if (c == '[' && *p == ':') { Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Tue Aug 25 20:49:05 2015 (r287147) +++ head/bin/sh/tests/builtins/Makefile Tue Aug 25 21:55:15 2015 (r287148) @@ -39,6 +39,7 @@ FILES+= case16.0 FILES+= case17.0 FILES+= case18.0 FILES+= case19.0 +FILES+= case20.0 FILES+= cd1.0 FILES+= cd2.0 FILES+= cd3.0 Added: head/bin/sh/tests/builtins/case20.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/case20.0 Tue Aug 25 21:55:15 2015 (r287148) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +# Shells do not agree about what this pattern should match, but it is +# certain that it must not crash and the missing close bracket must not +# be simply ignored. + +case B in +[[:alpha:]) echo bad ;; +esac From owner-svn-src-head@freebsd.org Wed Aug 26 02:47:12 2015 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 A0DF899AB2E; Wed, 26 Aug 2015 02:47:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 91F5AC19; Wed, 26 Aug 2015 02:47:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7Q2lCRV000178; Wed, 26 Aug 2015 02:47:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7Q2lC1D000177; Wed, 26 Aug 2015 02:47:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508260247.t7Q2lC1D000177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 26 Aug 2015 02:47:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287150 - head/gnu/usr.bin/binutils 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.20 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, 26 Aug 2015 02:47:12 -0000 Author: imp Date: Wed Aug 26 02:47:11 2015 New Revision: 287150 URL: https://svnweb.freebsd.org/changeset/base/287150 Log: Drop a .WAIT into the list. Items later in the list than this depend on items earlier. Enable parallel builds. Modified: head/gnu/usr.bin/binutils/Makefile Modified: head/gnu/usr.bin/binutils/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/Makefile Wed Aug 26 01:41:55 2015 (r287149) +++ head/gnu/usr.bin/binutils/Makefile Wed Aug 26 02:47:11 2015 (r287150) @@ -7,6 +7,7 @@ SUBDIR= doc\ libbfd \ libopcodes \ libbinutils \ + .WAIT \ as \ ld \ ${_objcopy} \ @@ -16,4 +17,9 @@ SUBDIR= doc\ _objcopy= objcopy .endif + +.if !make(install) +SUBDIR_PARALLEL= +.endif + .include From owner-svn-src-head@freebsd.org Wed Aug 26 03:32:48 2015 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 B481D9C2E58; Wed, 26 Aug 2015 03:32:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A4528D97; Wed, 26 Aug 2015 03:32:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7Q3WmeY021757; Wed, 26 Aug 2015 03:32:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7Q3WmXr021756; Wed, 26 Aug 2015 03:32:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201508260332.t7Q3WmXr021756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 26 Aug 2015 03:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287151 - head/sys/dev/filemon 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.20 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, 26 Aug 2015 03:32:48 -0000 Author: bdrewery Date: Wed Aug 26 03:32:47 2015 New Revision: 287151 URL: https://svnweb.freebsd.org/changeset/base/287151 Log: Move common locking for filemon_inuse and struct filemon* to filemon_pid_check(). This keeps the lock for the filemon_inuse list held only while reading the list. Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Wed Aug 26 02:47:11 2015 (r287150) +++ head/sys/dev/filemon/filemon_wrapper.c Wed Aug 26 03:32:47 2015 (r287151) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2011, David E. O'Brien. * Copyright (c) 2009-2011, Juniper Networks, Inc. + * Copyright (c) 2015, EMC Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -86,17 +87,21 @@ filemon_pid_check(struct proc *p) { struct filemon *filemon; + filemon_lock_read(); sx_slock(&proctree_lock); while (p != initproc) { TAILQ_FOREACH(filemon, &filemons_inuse, link) { if (p->p_pid == filemon->pid) { sx_sunlock(&proctree_lock); + filemon_filemon_lock(filemon); + filemon_unlock_read(); return (filemon); } } p = proc_realparent(p); } sx_sunlock(&proctree_lock); + filemon_unlock_read(); return (NULL); } @@ -138,13 +143,7 @@ filemon_wrapper_chdir(struct thread *td, struct filemon *filemon; if ((ret = sys_chdir(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -157,9 +156,6 @@ filemon_wrapper_chdir(struct thread *td, /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -177,13 +173,7 @@ filemon_wrapper_execve(struct thread *td copyinstr(uap->fname, fname, sizeof(fname), &done); if ((ret = sys_execve(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "E %d %s\n", curproc->p_pid, fname); @@ -193,9 +183,6 @@ filemon_wrapper_execve(struct thread *td /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -215,13 +202,7 @@ filemon_wrapper_freebsd32_execve(struct copyinstr(uap->fname, fname, sizeof(fname), &done); if ((ret = freebsd32_execve(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "E %d %s\n", curproc->p_pid, fname); @@ -231,9 +212,6 @@ filemon_wrapper_freebsd32_execve(struct /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -248,13 +226,7 @@ filemon_wrapper_fork(struct thread *td, struct filemon *filemon; if ((ret = sys_fork(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "F %d %ld\n", curproc->p_pid, (long)curthread->td_retval[0]); @@ -264,9 +236,6 @@ filemon_wrapper_fork(struct thread *td, /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -281,13 +250,7 @@ filemon_wrapper_open(struct thread *td, struct filemon *filemon; if ((ret = sys_open(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -313,9 +276,6 @@ filemon_wrapper_open(struct thread *td, /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -330,13 +290,7 @@ filemon_wrapper_openat(struct thread *td struct filemon *filemon; if ((ret = sys_openat(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -375,9 +329,6 @@ filemon_wrapper_openat(struct thread *td /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -392,13 +343,7 @@ filemon_wrapper_rename(struct thread *td struct filemon *filemon; if ((ret = sys_rename(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - copyinstr(uap->from, filemon->fname1, sizeof(filemon->fname1), &done); copyinstr(uap->to, filemon->fname2, @@ -413,9 +358,6 @@ filemon_wrapper_rename(struct thread *td /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -430,13 +372,7 @@ filemon_wrapper_link(struct thread *td, struct filemon *filemon; if ((ret = sys_link(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); copyinstr(uap->link, filemon->fname2, @@ -451,9 +387,6 @@ filemon_wrapper_link(struct thread *td, /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -468,13 +401,7 @@ filemon_wrapper_symlink(struct thread *t struct filemon *filemon; if ((ret = sys_symlink(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); copyinstr(uap->link, filemon->fname2, @@ -489,9 +416,6 @@ filemon_wrapper_symlink(struct thread *t /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -507,13 +431,7 @@ filemon_wrapper_linkat(struct thread *td struct filemon *filemon; if ((ret = sys_linkat(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - copyinstr(uap->path1, filemon->fname1, sizeof(filemon->fname1), &done); copyinstr(uap->path2, filemon->fname2, @@ -528,9 +446,6 @@ filemon_wrapper_linkat(struct thread *td /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -546,13 +461,7 @@ filemon_wrapper_stat(struct thread *td, struct filemon *filemon; if ((ret = sys_stat(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -565,9 +474,6 @@ filemon_wrapper_stat(struct thread *td, /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -584,13 +490,7 @@ filemon_wrapper_freebsd32_stat(struct th struct filemon *filemon; if ((ret = freebsd32_stat(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -603,9 +503,6 @@ filemon_wrapper_freebsd32_stat(struct th /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -622,13 +519,7 @@ filemon_wrapper_sys_exit(struct thread * /* Get timestamp before locking. */ getmicrotime(&now); - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "X %d %d\n", curproc->p_pid, uap->rval); @@ -649,9 +540,6 @@ filemon_wrapper_sys_exit(struct thread * filemon_filemon_unlock(filemon); } - /* Release the read lock. */ - filemon_unlock_read(); - sys_sys_exit(td, uap); } @@ -664,13 +552,7 @@ filemon_wrapper_unlink(struct thread *td struct filemon *filemon; if ((ret = sys_unlink(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -683,9 +565,6 @@ filemon_wrapper_unlink(struct thread *td /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); @@ -699,13 +578,7 @@ filemon_wrapper_vfork(struct thread *td, struct filemon *filemon; if ((ret = sys_vfork(td, uap)) == 0) { - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - if ((filemon = filemon_pid_check(curproc)) != NULL) { - /* Lock the found filemon structure. */ - filemon_filemon_lock(filemon); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "F %d %ld\n", curproc->p_pid, (long)curthread->td_retval[0]); @@ -715,9 +588,6 @@ filemon_wrapper_vfork(struct thread *td, /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); } - - /* Release the read lock. */ - filemon_unlock_read(); } return (ret); From owner-svn-src-head@freebsd.org Wed Aug 26 03:33:35 2015 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 198D49C0009; Wed, 26 Aug 2015 03:33:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 0A6FAEEC; Wed, 26 Aug 2015 03:33:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7Q3XYjm021853; Wed, 26 Aug 2015 03:33:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7Q3XYth021852; Wed, 26 Aug 2015 03:33:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201508260333.t7Q3XYth021852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 26 Aug 2015 03:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287152 - head/sys/dev/filemon 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.20 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, 26 Aug 2015 03:33:35 -0000 Author: bdrewery Date: Wed Aug 26 03:33:34 2015 New Revision: 287152 URL: https://svnweb.freebsd.org/changeset/base/287152 Log: Remove unneeded inuse list locking in filemon_comment(). Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Wed Aug 26 03:32:47 2015 (r287151) +++ head/sys/dev/filemon/filemon_wrapper.c Wed Aug 26 03:33:34 2015 (r287152) @@ -114,9 +114,6 @@ filemon_comment(struct filemon *filemon) /* Load timestamp before locking. Less accurate but less contention. */ getmicrotime(&now); - /* Grab a read lock on the filemon inuse list. */ - filemon_lock_read(); - /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); @@ -129,9 +126,6 @@ filemon_comment(struct filemon *filemon) /* Unlock the found filemon structure. */ filemon_filemon_unlock(filemon); - - /* Release the read lock. */ - filemon_unlock_read(); } static int From owner-svn-src-head@freebsd.org Wed Aug 26 03:37:18 2015 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 E57809C01A2; Wed, 26 Aug 2015 03:37:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D651810AF; Wed, 26 Aug 2015 03:37:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7Q3bIBp022047; Wed, 26 Aug 2015 03:37:18 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7Q3bI2x022046; Wed, 26 Aug 2015 03:37:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201508260337.t7Q3bI2x022046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 26 Aug 2015 03:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287153 - head/sys/dev/filemon 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.20 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, 26 Aug 2015 03:37:19 -0000 Author: bdrewery Date: Wed Aug 26 03:37:18 2015 New Revision: 287153 URL: https://svnweb.freebsd.org/changeset/base/287153 Log: Avoid taking proctree_lock and searching parents in wrappers if not needed. This should help the case where filemon is loaded but not in use. Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Wed Aug 26 03:33:34 2015 (r287152) +++ head/sys/dev/filemon/filemon_wrapper.c Wed Aug 26 03:37:18 2015 (r287153) @@ -88,6 +88,10 @@ filemon_pid_check(struct proc *p) struct filemon *filemon; filemon_lock_read(); + if (TAILQ_EMPTY(&filemons_inuse)) { + filemon_unlock_read(); + return (NULL); + } sx_slock(&proctree_lock); while (p != initproc) { TAILQ_FOREACH(filemon, &filemons_inuse, link) { From owner-svn-src-head@freebsd.org Wed Aug 26 03:37:34 2015 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 06FAB9C01E6; Wed, 26 Aug 2015 03:37:34 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 EBE1111F7; Wed, 26 Aug 2015 03:37:33 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7Q3bXB1022101; Wed, 26 Aug 2015 03:37:33 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7Q3bXro022100; Wed, 26 Aug 2015 03:37:33 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508260337.t7Q3bXro022100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 26 Aug 2015 03:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287154 - head/sys/powerpc/mpc85xx 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.20 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, 26 Aug 2015 03:37:34 -0000 Author: jhibbits Date: Wed Aug 26 03:37:33 2015 New Revision: 287154 URL: https://svnweb.freebsd.org/changeset/base/287154 Log: The Freescale qoriq PCIe controller is compatible with mpc85xx. Add the compatible checks. Obtained from: Semihalf (partial) Sponsored by: Alex Perez/Inertial Computing Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Wed Aug 26 03:37:18 2015 (r287153) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Wed Aug 26 03:37:33 2015 (r287154) @@ -182,7 +182,10 @@ fsl_pcib_probe(device_t dev) if (!(ofw_bus_is_compatible(dev, "fsl,mpc8540-pci") || ofw_bus_is_compatible(dev, "fsl,mpc8540-pcie") || - ofw_bus_is_compatible(dev, "fsl,mpc8548-pcie"))) + ofw_bus_is_compatible(dev, "fsl,mpc8548-pcie") || + ofw_bus_is_compatible(dev, "fsl,p5020-pcie") || + ofw_bus_is_compatible(dev, "fsl,qoriq-pcie-v2.2") || + ofw_bus_is_compatible(dev, "fsl,qoriq-pcie"))) return (ENXIO); device_set_desc(dev, "Freescale Integrated PCI/PCI-E Controller"); From owner-svn-src-head@freebsd.org Wed Aug 26 03:44:49 2015 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 6163F9C0537; Wed, 26 Aug 2015 03:44:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 519021792; Wed, 26 Aug 2015 03:44:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7Q3inEs026024; Wed, 26 Aug 2015 03:44:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7Q3imhG026022; Wed, 26 Aug 2015 03:44:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201508260344.t7Q3imhG026022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 26 Aug 2015 03:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287155 - head/sys/dev/filemon 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.20 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, 26 Aug 2015 03:44:49 -0000 Author: bdrewery Date: Wed Aug 26 03:44:48 2015 New Revision: 287155 URL: https://svnweb.freebsd.org/changeset/base/287155 Log: Fix filemon locking races. Convert filemon_lock and struct filemon* lock to sx(9), rather than a self-rolled reader-writer lock, and hold it for the entire time needed. At least filemon_lock_write() was not checking for active readers when it would successfully return with the write lock "held". This led to a race with reading entries from filemon_inuse as they were removed. This could be seen with QUEUE_MACRO_DEBUG enabled, causing -1 to be read as an entry rather than a valid struct filemon*. Fixing filemon_lock_write() to check readers was insufficient to fix the races. sx(9) was used as the lock could be held while taking proctree_lock and sleeping in fo_write. Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_lock.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Wed Aug 26 03:37:33 2015 (r287154) +++ head/sys/dev/filemon/filemon.c Wed Aug 26 03:44:48 2015 (r287155) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2011, David E. O'Brien. * Copyright (c) 2009-2011, Juniper Networks, Inc. + * Copyright (c) 2015, EMC Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,12 +40,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -85,12 +88,8 @@ MALLOC_DEFINE(M_FILEMON, "filemon", "Fil struct filemon { TAILQ_ENTRY(filemon) link; /* Link into the in-use list. */ - struct mtx mtx; /* Lock mutex for this filemon. */ - struct cv cv; /* Lock condition variable for this - filemon. */ + struct sx lock; /* Lock mutex for this filemon. */ struct file *fp; /* Output file pointer. */ - struct thread *locker; /* Ptr to the thread locking this - filemon. */ pid_t pid; /* The process ID being monitored. */ char fname1[MAXPATHLEN]; /* Temporary filename buffer. */ char fname2[MAXPATHLEN]; /* Temporary filename buffer. */ @@ -99,11 +98,7 @@ struct filemon { static TAILQ_HEAD(, filemon) filemons_inuse = TAILQ_HEAD_INITIALIZER(filemons_inuse); static TAILQ_HEAD(, filemon) filemons_free = TAILQ_HEAD_INITIALIZER(filemons_free); -static int n_readers = 0; -static struct mtx access_mtx; -static struct cv access_cv; -static struct thread *access_owner = NULL; -static struct thread *access_requester = NULL; +static struct sx access_lock; static struct cdev *filemon_dev; @@ -203,8 +198,7 @@ filemon_open(struct cdev *dev, int oflag filemon->fp = NULL; - mtx_init(&filemon->mtx, "filemon", "filemon", MTX_DEF); - cv_init(&filemon->cv, "filemon"); + sx_init(&filemon->lock, "filemon"); } filemon->pid = curproc->p_pid; @@ -234,8 +228,7 @@ filemon_close(struct cdev *dev __unused, static void filemon_load(void *dummy __unused) { - mtx_init(&access_mtx, "filemon", "filemon", MTX_DEF); - cv_init(&access_cv, "filemon"); + sx_init(&access_lock, "filemons_inuse"); /* Install the syscall wrappers. */ filemon_wrapper_install(); @@ -270,14 +263,12 @@ filemon_unload(void) filemon_lock_write(); while ((filemon = TAILQ_FIRST(&filemons_free)) != NULL) { TAILQ_REMOVE(&filemons_free, filemon, link); - mtx_destroy(&filemon->mtx); - cv_destroy(&filemon->cv); + sx_destroy(&filemon->lock); free(filemon, M_FILEMON); } filemon_unlock_write(); - mtx_destroy(&access_mtx); - cv_destroy(&access_cv); + sx_destroy(&access_lock); } return (error); Modified: head/sys/dev/filemon/filemon_lock.c ============================================================================== --- head/sys/dev/filemon/filemon_lock.c Wed Aug 26 03:37:33 2015 (r287154) +++ head/sys/dev/filemon/filemon_lock.c Wed Aug 26 03:44:48 2015 (r287155) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2009-2011, Juniper Networks, Inc. + * Copyright (c) 2015, EMC Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,96 +28,44 @@ #include __FBSDID("$FreeBSD$"); -static void +static __inline void filemon_filemon_lock(struct filemon *filemon) { - mtx_lock(&filemon->mtx); - while (filemon->locker != NULL && filemon->locker != curthread) - cv_wait(&filemon->cv, &filemon->mtx); - - filemon->locker = curthread; - - mtx_unlock(&filemon->mtx); + sx_xlock(&filemon->lock); } -static void +static __inline void filemon_filemon_unlock(struct filemon *filemon) { - mtx_lock(&filemon->mtx); - - if (filemon->locker == curthread) - filemon->locker = NULL; - /* Wake up threads waiting. */ - cv_broadcast(&filemon->cv); - - mtx_unlock(&filemon->mtx); + sx_xunlock(&filemon->lock); } -static void +static __inline void filemon_lock_read(void) { - mtx_lock(&access_mtx); - - while (access_owner != NULL || access_requester != NULL) - cv_wait(&access_cv, &access_mtx); - - n_readers++; - /* Wake up threads waiting. */ - cv_broadcast(&access_cv); - - mtx_unlock(&access_mtx); + sx_slock(&access_lock); } -static void +static __inline void filemon_unlock_read(void) { - mtx_lock(&access_mtx); - - if (n_readers > 0) - n_readers--; - - /* Wake up a thread waiting. */ - cv_broadcast(&access_cv); - mtx_unlock(&access_mtx); + sx_sunlock(&access_lock); } -static void +static __inline void filemon_lock_write(void) { - mtx_lock(&access_mtx); - while (access_owner != curthread) { - if (access_owner == NULL && - (access_requester == NULL || - access_requester == curthread)) { - access_owner = curthread; - access_requester = NULL; - } else { - if (access_requester == NULL) - access_requester = curthread; - - cv_wait(&access_cv, &access_mtx); - } - } - - mtx_unlock(&access_mtx); + sx_xlock(&access_lock); } -static void +static __inline void filemon_unlock_write(void) { - mtx_lock(&access_mtx); - - /* Sanity check that the current thread actually has the write lock. */ - if (access_owner == curthread) - access_owner = NULL; - - /* Wake up a thread waiting. */ - cv_broadcast(&access_cv); - mtx_unlock(&access_mtx); + sx_xunlock(&access_lock); } From owner-svn-src-head@freebsd.org Wed Aug 26 07:24:00 2015 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 835339C3400; Wed, 26 Aug 2015 07:24:00 +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 4916ED89; Wed, 26 Aug 2015 07:24:00 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (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 614801FE023; Wed, 26 Aug 2015 09:23:58 +0200 (CEST) Subject: Re: svn commit: r286880 - head/sys/kern To: Julien Charbon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Baldwin References: <201508181015.t7IAFAex055889@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <55DD69E5.4090904@selasky.org> Date: Wed, 26 Aug 2015 09:25:25 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <201508181015.t7IAFAex055889@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.20 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, 26 Aug 2015 07:24:00 -0000 On 08/18/15 12:15, Julien Charbon wrote: > Author: jch > Date: Tue Aug 18 10:15:09 2015 > New Revision: 286880 > URL: https://svnweb.freebsd.org/changeset/base/286880 > > Log: > callout_stop() should return 0 (fail) when the callout is currently > being serviced and indeed unstoppable. > > A scenario to reproduce this case is: > > - the callout is being serviced and at same time, > - callout_reset() is called on this callout that sets > the CALLOUT_PENDING flag and at same time, > - callout_stop() is called on this callout and returns 1 (success) > even if the callout is indeed currently running and unstoppable. > > This issue was caught up while making r284245 (D2763) workaround, and > was discussed at BSDCan 2015. Once applied the r284245 workaround > is not needed anymore and will be reverted. > > Differential Revision: https://reviews.freebsd.org/D3078 > Reviewed by: jhb > Sponsored by: Verisign, Inc. > > Modified: > head/sys/kern/kern_timeout.c > > Modified: head/sys/kern/kern_timeout.c > ============================================================================== > --- head/sys/kern/kern_timeout.c Tue Aug 18 10:07:03 2015 (r286879) > +++ head/sys/kern/kern_timeout.c Tue Aug 18 10:15:09 2015 (r286880) > @@ -1150,7 +1150,7 @@ _callout_stop_safe(struct callout *c, in > struct callout_cpu *cc, *old_cc; > struct lock_class *class; > int direct, sq_locked, use_lock; > - int not_on_a_list; > + int not_on_a_list, not_running; > > if (safe) > WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock, > @@ -1378,8 +1378,15 @@ again: > } > } > callout_cc_del(c, cc); > + > + /* > + * If we are asked to stop a callout which is currently in progress > + * and indeed impossible to stop then return 0. > + */ > + not_running = !(cc_exec_curr(cc, direct) == c); > + > CC_UNLOCK(cc); > - return (1); > + return (not_running); > } > > void > > Hi, I think this patch is incomplete and can break the return value for non-MPSAFE callouts. I think the correct statement should check the value of "use_lock" too: not_running = !(cc_exec_curr(cc, direct) == c && use_lock == 0); Because if the callback process waits for lock "c_lock" in the callback process then we have above "cc_exec_curr(cc, direct) == c" is satisfied too, and non-MPSAFE callouts are always cancelable, via cc_exec_cancel(cc, direct) = true; > class->lc_lock(c_lock, lock_status); > /* > * The callout may have been cancelled > * while we switched locks. > */ > if (cc_exec_cancel(cc, direct)) { > class->lc_unlock(c_lock); > goto skip; > } > /* The callout cannot be stopped now. */ > cc_exec_cancel(cc, direct) = true; --HPS From owner-svn-src-head@freebsd.org Wed Aug 26 08:11:09 2015 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 CC4E69C2B25; Wed, 26 Aug 2015 08:11:09 +0000 (UTC) (envelope-from hp@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 17A4BA14; Wed, 26 Aug 2015 08:11:09 +0000 (UTC) (envelope-from hp@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (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 D7C6B1FE023; Wed, 26 Aug 2015 10:11:00 +0200 (CEST) Subject: Re: svn commit: r286880 - head/sys/kern To: Julien Charbon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Baldwin References: <201508181015.t7IAFAex055889@repo.freebsd.org> <55DD69E5.4090904@selasky.org> From: Hans Petter Selasky Message-ID: <55DD74EB.30601@selasky.org> Date: Wed, 26 Aug 2015 10:12:27 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55DD69E5.4090904@selasky.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.20 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, 26 Aug 2015 08:11:09 -0000 On 08/26/15 09:25, Hans Petter Selasky wrote: > On 08/18/15 12:15, Julien Charbon wrote: >> Author: jch >> Date: Tue Aug 18 10:15:09 2015 >> New Revision: 286880 >> URL: https://svnweb.freebsd.org/changeset/base/286880 >> >> Log: >> callout_stop() should return 0 (fail) when the callout is currently >> being serviced and indeed unstoppable. >> >> A scenario to reproduce this case is: >> >> - the callout is being serviced and at same time, >> - callout_reset() is called on this callout that sets >> the CALLOUT_PENDING flag and at same time, >> - callout_stop() is called on this callout and returns 1 (success) >> even if the callout is indeed currently running and unstoppable. >> >> This issue was caught up while making r284245 (D2763) workaround, and >> was discussed at BSDCan 2015. Once applied the r284245 workaround >> is not needed anymore and will be reverted. >> >> Differential Revision: https://reviews.freebsd.org/D3078 >> Reviewed by: jhb >> Sponsored by: Verisign, Inc. >> >> Modified: >> head/sys/kern/kern_timeout.c >> >> Modified: head/sys/kern/kern_timeout.c >> ============================================================================== >> >> --- head/sys/kern/kern_timeout.c Tue Aug 18 10:07:03 2015 (r286879) >> +++ head/sys/kern/kern_timeout.c Tue Aug 18 10:15:09 2015 (r286880) >> @@ -1150,7 +1150,7 @@ _callout_stop_safe(struct callout *c, in >> struct callout_cpu *cc, *old_cc; >> struct lock_class *class; >> int direct, sq_locked, use_lock; >> - int not_on_a_list; >> + int not_on_a_list, not_running; >> >> if (safe) >> WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock, >> @@ -1378,8 +1378,15 @@ again: >> } >> } >> callout_cc_del(c, cc); >> + >> + /* >> + * If we are asked to stop a callout which is currently in progress >> + * and indeed impossible to stop then return 0. >> + */ >> + not_running = !(cc_exec_curr(cc, direct) == c); >> + >> CC_UNLOCK(cc); >> - return (1); >> + return (not_running); >> } >> >> void >> >> > > Hi, > > I think this patch is incomplete and can break the return value for > non-MPSAFE callouts. I think the correct statement should check the > value of "use_lock" too: > > not_running = !(cc_exec_curr(cc, direct) == c && use_lock == 0); > > Because if the callback process waits for lock "c_lock" in the callback > process then we have above "cc_exec_curr(cc, direct) == c" is satisfied > too, and non-MPSAFE callouts are always cancelable, via > cc_exec_cancel(cc, direct) = true; > >> class->lc_lock(c_lock, lock_status); >> /* >> * The callout may have been cancelled >> * while we switched locks. >> */ >> if (cc_exec_cancel(cc, direct)) { >> class->lc_unlock(c_lock); >> goto skip; >> } >> /* The callout cannot be stopped now. */ >> cc_exec_cancel(cc, direct) = true; > > --HPS > Hi, I'm sorry to say, but I think this change should be backed out as it changes the behaviour of the callout API. The old code was correct. The issues should be fixed in the TCP stack instead, like suggested by D1563 and also r284245. This patch introduces new behaviour to the callout_stop() function, which is contradicting "man 9 callout" and _not_ documented anywhere! Reading "man 9 callout" in 11-current: > The callout_reset() and callout_schedule() function families schedule a > future function invocation for callout c. If c already has a pending > callout, it is cancelled before the new invocation is scheduled. callout_reset() causes a _new_ callout invocation and it is logical that the return value of callout_stop() reflect operations on the _new_ callout invocation and not the previous one. > The function callout_stop() cancels a callout c if it is currently pend- > ing. If the callout is pending, then callout_stop() returns a non-zero > value. If the callout is not set, has already been serviced, or is cur- > rently being serviced, then zero will be returned. If the callout has an > associated lock, then that lock must be held when this function is > called. If there are two callout invocations that callout_stop() needs to handle, it should be called twice. The correct way is: callout_reset(); callout_stop(); callout_drain(); For the TCP stack's matter, it should be: callout_reset(); callout_stop(); /* cancel _new_ callout invocation */ callout_stop(); /* check for any pending callout invokation */ Remember there are other OS'es out there using our TCP/IP stack which do not have an identical callout subsystem. --HPS From owner-svn-src-head@freebsd.org Wed Aug 26 10:32:24 2015 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 AB1319C38F4; Wed, 26 Aug 2015 10:32:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 99060D09; Wed, 26 Aug 2015 10:32:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QAWOqk093435; Wed, 26 Aug 2015 10:32:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QAWOD8093434; Wed, 26 Aug 2015 10:32:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508261032.t7QAWOD8093434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 26 Aug 2015 10:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287160 - head/sys/arm64/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.20 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, 26 Aug 2015 10:32:24 -0000 Author: andrew Date: Wed Aug 26 10:32:23 2015 New Revision: 287160 URL: https://svnweb.freebsd.org/changeset/base/287160 Log: Add a above the virtio section. Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Aug 26 09:27:44 2015 (r287159) +++ head/sys/arm64/conf/GENERIC Wed Aug 26 10:32:23 2015 (r287160) @@ -84,6 +84,7 @@ options WITNESS # Enable checks to de options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +# VirtIO support device virtio device virtio_mmio device virtio_blk From owner-svn-src-head@freebsd.org Wed Aug 26 10:54:14 2015 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 E63A69C20FE; Wed, 26 Aug 2015 10:54:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D72649E1; Wed, 26 Aug 2015 10:54:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QAsEot001956; Wed, 26 Aug 2015 10:54:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QAsECn001955; Wed, 26 Aug 2015 10:54:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508261054.t7QAsECn001955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 26 Aug 2015 10:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287161 - head/sys/dev/mmc/host 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.20 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, 26 Aug 2015 10:54:15 -0000 Author: andrew Date: Wed Aug 26 10:54:14 2015 New Revision: 287161 URL: https://svnweb.freebsd.org/changeset/base/287161 Log: Only access the Samsung registers when targeting Samsung hardware. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Wed Aug 26 10:32:23 2015 (r287160) +++ head/sys/dev/mmc/host/dwmmc.c Wed Aug 26 10:54:14 2015 (r287161) @@ -582,7 +582,7 @@ dwmmc_attach(device_t dev) if ((sc->hwtype & HWTYPE_MASK) == HWTYPE_ROCKCHIP) { sc->use_pio = 1; sc->pwren_inverted = 1; - } else { + } else if ((sc->hwtype & HWTYPE_MASK) == HWTYPE_EXYNOS) { WRITE4(sc, EMMCP_MPSBEGIN0, 0); WRITE4(sc, EMMCP_SEND0, 0); WRITE4(sc, EMMCP_CTRL0, (MPSCTRL_SECURE_READ_BIT | From owner-svn-src-head@freebsd.org Wed Aug 26 11:36:25 2015 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 53F739C3676; Wed, 26 Aug 2015 11:36:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2A5DAE1C; Wed, 26 Aug 2015 11:36:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QBaPMJ018176; Wed, 26 Aug 2015 11:36:25 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QBaOCD018173; Wed, 26 Aug 2015 11:36:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508261136.t7QBaOCD018173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 26 Aug 2015 11:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287162 - in head/sys: arm64/conf 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.20 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, 26 Aug 2015 11:36:25 -0000 Author: andrew Date: Wed Aug 26 11:36:23 2015 New Revision: 287162 URL: https://svnweb.freebsd.org/changeset/base/287162 Log: Add an option to select which SoCs we are building for. It is intended to be used with any SoC specific drivers, for example a ThunderX nic driver would use something like the following in files.arm64: arm64/cavium/thunder_nic.c optional soc_cavm_thunderx thndr_nic Reviewed by: imp Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D3479 Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 head/sys/conf/options.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Aug 26 10:54:14 2015 (r287161) +++ head/sys/arm64/conf/GENERIC Wed Aug 26 11:36:23 2015 (r287162) @@ -84,6 +84,9 @@ options WITNESS # Enable checks to de options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +# SoC support +options SOC_CAVM_THUNDERX + # VirtIO support device virtio device virtio_mmio @@ -92,7 +95,6 @@ device vtnet # Bus drivers device pci -device thunder_pci # Ethernet NICs device em # Intel PRO/1000 Gigabit Ethernet Family Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Aug 26 10:54:14 2015 (r287161) +++ head/sys/conf/files.arm64 Wed Aug 26 11:36:23 2015 (r287162) @@ -50,9 +50,9 @@ arm64/arm64/uma_machdep.c standard arm64/arm64/unwind.c optional ddb | kdtrace_hooks | stack arm64/arm64/vfp.c standard arm64/arm64/vm_machdep.c standard -arm64/cavium/thunder_pcie.c optional thunder_pci fdt -arm64/cavium/thunder_pcie_pem.c optional thunder_pci -arm64/cavium/thunder_pcie_common.c optional thunder_pci +arm64/cavium/thunder_pcie.c optional soc_cavm_thunderx pci fdt +arm64/cavium/thunder_pcie_pem.c optional soc_cavm_thunderx pci +arm64/cavium/thunder_pcie_common.c optional soc_cavm_thunderx pci crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb dev/acpica/acpi_if.m optional acpi Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Wed Aug 26 10:54:14 2015 (r287161) +++ head/sys/conf/options.arm64 Wed Aug 26 11:36:23 2015 (r287162) @@ -5,3 +5,6 @@ SOCDEV_PA opt_global.h SOCDEV_VA opt_global.h THUNDERX_PASS_1_1_ERRATA opt_global.h VFP opt_global.h + +# SoC Support +SOC_CAVM_THUNDERX opt_soc.h From owner-svn-src-head@freebsd.org Wed Aug 26 11:54:40 2015 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 E997A9C3DDE; Wed, 26 Aug 2015 11:54:40 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 DA99519FC; Wed, 26 Aug 2015 11:54:40 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QBsemD026197; Wed, 26 Aug 2015 11:54:40 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QBseWV026196; Wed, 26 Aug 2015 11:54:40 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201508261154.t7QBseWV026196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Wed, 26 Aug 2015 11:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287163 - head/usr.bin/script 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.20 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, 26 Aug 2015 11:54:41 -0000 Author: pluknet Date: Wed Aug 26 11:54:40 2015 New Revision: 287163 URL: https://svnweb.freebsd.org/changeset/base/287163 Log: Fix SEE ALSO. The history mechanism applies to csh. Sponsored by: Nginx, Inc. Modified: head/usr.bin/script/script.1 Modified: head/usr.bin/script/script.1 ============================================================================== --- head/usr.bin/script/script.1 Wed Aug 26 11:36:23 2015 (r287162) +++ head/usr.bin/script/script.1 Wed Aug 26 11:54:40 2015 (r287163) @@ -164,13 +164,13 @@ is assumed. .Pq Most shells set this variable automatically . .El .Sh SEE ALSO -.Xr csh 1 , -.Xr filemon 4 +.Xr csh 1 .Po for the .Em history mechanism -.Pc . +.Pc , +.Xr filemon 4 .Sh HISTORY The .Nm From owner-svn-src-head@freebsd.org Wed Aug 26 12:32:47 2015 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 0A84399A919; Wed, 26 Aug 2015 12:32:47 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D5DFD76A; Wed, 26 Aug 2015 12:32:46 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QCWk9t042334; Wed, 26 Aug 2015 12:32:46 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QCWkFL042333; Wed, 26 Aug 2015 12:32:46 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201508261232.t7QCWkFL042333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 26 Aug 2015 12:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287164 - head/sys/arm64/arm64 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.20 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, 26 Aug 2015 12:32:47 -0000 Author: zbb Date: Wed Aug 26 12:32:46 2015 New Revision: 287164 URL: https://svnweb.freebsd.org/changeset/base/287164 Log: Fix race condition in its_cmd_send() its_cmd_send() can be called by multiple CPUs simultaneously. After the command is pushed to ITS command ring the completion status is polled using global pointer to the next free ring slot. Use copied pointer and provide correct locking to avoid spurious pointer value when concurrent access occurs. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3436 Modified: head/sys/arm64/arm64/gic_v3_its.c Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Wed Aug 26 11:54:40 2015 (r287163) +++ head/sys/arm64/arm64/gic_v3_its.c Wed Aug 26 12:32:46 2015 (r287164) @@ -1311,16 +1311,16 @@ its_cmd_wait_completion(struct gic_v3_it static int its_cmd_send(struct gic_v3_its_softc *sc, struct its_cmd_desc *desc) { - struct its_cmd *cmd, *cmd_sync; + struct its_cmd *cmd, *cmd_sync, *cmd_write; struct its_col col_sync; struct its_cmd_desc desc_sync; uint64_t target, cwriter; mtx_lock_spin(&sc->its_spin_mtx); cmd = its_cmd_alloc_locked(sc); - mtx_unlock_spin(&sc->its_spin_mtx); if (cmd == NULL) { device_printf(sc->dev, "could not allocate ITS command\n"); + mtx_unlock_spin(&sc->its_spin_mtx); return (EBUSY); } @@ -1328,9 +1328,7 @@ its_cmd_send(struct gic_v3_its_softc *sc its_cmd_sync(sc, cmd); if (target != ITS_TARGET_NONE) { - mtx_lock_spin(&sc->its_spin_mtx); cmd_sync = its_cmd_alloc_locked(sc); - mtx_unlock_spin(&sc->its_spin_mtx); if (cmd_sync == NULL) goto end; desc_sync.cmd_type = ITS_CMD_SYNC; @@ -1341,12 +1339,12 @@ its_cmd_send(struct gic_v3_its_softc *sc } end: /* Update GITS_CWRITER */ - mtx_lock_spin(&sc->its_spin_mtx); cwriter = its_cmd_cwriter_offset(sc, sc->its_cmdq_write); gic_its_write(sc, 8, GITS_CWRITER, cwriter); + cmd_write = sc->its_cmdq_write; mtx_unlock_spin(&sc->its_spin_mtx); - its_cmd_wait_completion(sc, cmd, sc->its_cmdq_write); + its_cmd_wait_completion(sc, cmd, cmd_write); return (0); } From owner-svn-src-head@freebsd.org Wed Aug 26 13:23:57 2015 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 6C0809C3B50; Wed, 26 Aug 2015 13:23:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5C879FA9; Wed, 26 Aug 2015 13:23:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QDNvlE062626; Wed, 26 Aug 2015 13:23:57 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QDNv0v062625; Wed, 26 Aug 2015 13:23:57 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508261323.t7QDNv0v062625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 26 Aug 2015 13:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287165 - head/sys/dev/drm2/i915 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.20 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, 26 Aug 2015 13:23:57 -0000 Author: bapt Date: Wed Aug 26 13:23:56 2015 New Revision: 287165 URL: https://svnweb.freebsd.org/changeset/base/287165 Log: Reduce diff on i915_dma.c against linux 3.8.13 No functional changes Discussed with: dumbbell Reviewed by: dumbbell Modified: head/sys/dev/drm2/i915/i915_dma.c Modified: head/sys/dev/drm2/i915/i915_dma.c ============================================================================== --- head/sys/dev/drm2/i915/i915_dma.c Wed Aug 26 12:32:46 2015 (r287164) +++ head/sys/dev/drm2/i915/i915_dma.c Wed Aug 26 13:23:56 2015 (r287165) @@ -1,6 +1,6 @@ /* i915_dma.c -- DMA support for the I915 -*- linux-c -*- */ -/*- +/* * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -47,6 +47,12 @@ __FBSDID("$FreeBSD$"); #define ADVANCE_LP_RING() \ intel_ring_advance(LP_RING(dev_priv)) +/** + * Lock test for when it's just for synchronization of ring access. + * + * In that case, we don't need to do it when GEM is initialized as nobody else + * has access to the ring. + */ #define RING_LOCK_TEST_WITH_RETURN(dev, file) do { \ if (LP_RING(dev->dev_private)->obj == NULL) \ LOCK_TEST_WITH_RETURN(dev, file); \ @@ -179,7 +185,6 @@ static int i915_dma_cleanup(struct drm_d drm_i915_private_t *dev_priv = dev->dev_private; int i; - /* Make sure interrupts are disabled here because the uninstall ioctl * may not have been called from userspace and after dev_private * is freed, it's too late. @@ -208,7 +213,7 @@ static int i915_initialize(struct drm_de master_priv->sarea = drm_getsarea(dev); if (master_priv->sarea) { master_priv->sarea_priv = (drm_i915_sarea_t *) - ((u8 *)master_priv->sarea->handle + init->sarea_priv_offset); + ((u8 *)master_priv->sarea->handle + init->sarea_priv_offset); } else { DRM_DEBUG_DRIVER("sarea not found assuming DRI2 userspace\n"); } @@ -309,7 +314,7 @@ static int i915_dma_init(struct drm_devi * instruction detected will be given a size of zero, which is a * signal to abort the rest of the buffer. */ -static int do_validate_cmd(int cmd) +static int validate_cmd(int cmd) { switch (((cmd >> 29) & 0x7)) { case 0x0: @@ -367,17 +372,7 @@ static int do_validate_cmd(int cmd) return 0; } -static int validate_cmd(int cmd) -{ - int ret = do_validate_cmd(cmd); - -/* printk("validate_cmd( %x ): %d\n", cmd, ret); */ - - return ret; -} - -static int i915_emit_cmds(struct drm_device *dev, int __user *buffer, - int dwords) +static int i915_emit_cmds(struct drm_device * dev, int *buffer, int dwords) { drm_i915_private_t *dev_priv = dev->dev_private; int i; @@ -429,14 +424,15 @@ int i915_emit_box(struct drm_device * de } int -i915_emit_box_p(struct drm_device *dev, struct drm_clip_rect *box, - int DR1, int DR4) +i915_emit_box_p(struct drm_device *dev, + struct drm_clip_rect *box, + int DR1, int DR4) { - drm_i915_private_t *dev_priv = dev->dev_private; + struct drm_i915_private *dev_priv = dev->dev_private; int ret; - if (box->y2 <= box->y1 || box->x2 <= box->x1 || box->y2 <= 0 || - box->x2 <= 0) { + if (box->y2 <= box->y1 || box->x2 <= box->x1 || + box->y2 <= 0 || box->x2 <= 0) { DRM_ERROR("Bad box %d,%d..%d,%d\n", box->x1, box->y1, box->x2, box->y2); return -EINVAL; @@ -444,8 +440,8 @@ i915_emit_box_p(struct drm_device *dev, if (INTEL_INFO(dev)->gen >= 4) { ret = BEGIN_LP_RING(4); - if (ret != 0) - return (ret); + if (ret) + return ret; OUT_RING(GFX_OP_DRAWRECT_INFO_I965); OUT_RING((box->x1 & 0xffff) | (box->y1 << 16)); @@ -453,8 +449,8 @@ i915_emit_box_p(struct drm_device *dev, OUT_RING(DR4); } else { ret = BEGIN_LP_RING(6); - if (ret != 0) - return (ret); + if (ret) + return ret; OUT_RING(GFX_OP_DRAWRECT_INFO); OUT_RING(DR1); @@ -492,7 +488,9 @@ static void i915_emit_breadcrumb(struct } static int i915_dispatch_cmdbuffer(struct drm_device * dev, - drm_i915_cmdbuffer_t * cmd, struct drm_clip_rect *cliprects, void *cmdbuf) + drm_i915_cmdbuffer_t *cmd, + struct drm_clip_rect *cliprects, + void *cmdbuf) { int nbox = cmd->num_cliprects; int i = 0, count, ret; @@ -523,11 +521,11 @@ static int i915_dispatch_cmdbuffer(struc return 0; } -static int -i915_dispatch_batchbuffer(struct drm_device * dev, - drm_i915_batchbuffer_t * batch, struct drm_clip_rect *cliprects) +static int i915_dispatch_batchbuffer(struct drm_device * dev, + drm_i915_batchbuffer_t * batch, + struct drm_clip_rect *cliprects) { - drm_i915_private_t *dev_priv = dev->dev_private; + struct drm_i915_private *dev_priv = dev->dev_private; int nbox = batch->num_cliprects; int i, count, ret; @@ -542,7 +540,6 @@ i915_dispatch_batchbuffer(struct drm_dev i915_kernel_lost_context(dev); count = nbox ? nbox : 1; - for (i = 0; i < count; i++) { if (i < nbox) { int ret = i915_emit_box_p(dev, &cliprects[i], @@ -553,8 +550,8 @@ i915_dispatch_batchbuffer(struct drm_dev if (!IS_I830(dev) && !IS_845G(dev)) { ret = BEGIN_LP_RING(2); - if (ret != 0) - return (ret); + if (ret) + return ret; if (INTEL_INFO(dev)->gen >= 4) { OUT_RING(MI_BATCH_BUFFER_START | (2 << 6) | @@ -566,8 +563,8 @@ i915_dispatch_batchbuffer(struct drm_dev } } else { ret = BEGIN_LP_RING(4); - if (ret != 0) - return (ret); + if (ret) + return ret; OUT_RING(MI_BATCH_BUFFER); OUT_RING(batch->start | MI_BATCH_NON_SECURE); @@ -602,6 +599,7 @@ static int i915_dispatch_flip(struct drm ret = BEGIN_LP_RING(10); if (ret) return ret; + OUT_RING(MI_FLUSH | MI_READ_FLUSH); OUT_RING(0); @@ -635,8 +633,7 @@ static int i915_dispatch_flip(struct drm return 0; } -static int -i915_quiescent(struct drm_device *dev) +static int i915_quiescent(struct drm_device *dev) { struct intel_ring_buffer *ring = LP_RING(dev->dev_private); @@ -644,8 +641,8 @@ i915_quiescent(struct drm_device *dev) return (intel_wait_ring_idle(ring)); } -static int -i915_flush_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) +static int i915_flush_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv) { int ret; @@ -1132,7 +1129,7 @@ i915_load_modeset_init(struct drm_device intel_modeset_init(dev); ret = i915_gem_init(dev); - if (ret != 0) + if (ret) goto cleanup_gem_stolen; intel_modeset_gem_init(dev); @@ -1152,7 +1149,7 @@ i915_load_modeset_init(struct drm_device /* We're off and running w/KMS */ dev_priv->mm.suspended = 0; - return (0); + return 0; cleanup_gem: DRM_LOCK(dev); @@ -1339,8 +1336,18 @@ intel_teardown_mchbar(struct drm_device } } -int -i915_driver_load(struct drm_device *dev, unsigned long flags) +/** + * i915_driver_load - setup chip and create an initial config + * @dev: DRM device + * @flags: startup flags + * + * The driver load routine has to do several things: + * - drive output discovery via intel_modeset_init() + * - initialize the memory manager + * - allocate initial config memory + * - setup the DRM framebuffer with the allocated memory + */ +int i915_driver_load(struct drm_device *dev, unsigned long flags) { struct drm_i915_private *dev_priv = dev->dev_private; const struct intel_device_info *info; @@ -1475,8 +1482,7 @@ out_gem_unload: return (ret); } -int -i915_driver_unload(struct drm_device *dev) +int i915_driver_unload(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; int ret; @@ -1546,11 +1552,10 @@ i915_driver_unload(struct drm_device *de mtx_destroy(&dev_priv->rps_lock); free(dev->dev_private, DRM_MEM_DRIVER); - return (0); + return 0; } -int -i915_driver_open(struct drm_device *dev, struct drm_file *file_priv) +int i915_driver_open(struct drm_device *dev, struct drm_file *file) { struct drm_i915_file_private *i915_file_priv; @@ -1559,19 +1564,35 @@ i915_driver_open(struct drm_device *dev, mtx_init(&i915_file_priv->mm.lck, "915fp", NULL, MTX_DEF); INIT_LIST_HEAD(&i915_file_priv->mm.request_list); - file_priv->driver_priv = i915_file_priv; + file->driver_priv = i915_file_priv; drm_gem_names_init(&i915_file_priv->context_idr); - return (0); + return 0; } -void -i915_driver_lastclose(struct drm_device * dev) +/** + * i915_driver_lastclose - clean up after all DRM clients have exited + * @dev: DRM device + * + * Take care of cleaning up after all DRM clients have exited. In the + * mode setting case, we want to restore the kernel's initial mode (just + * in case the last client left us in a bad state). + * + * Additionally, in the non-mode setting case, we'll tear down the GTT + * and DMA structures, since the kernel won't be using them, and clea + * up any GEM state. + */ +void i915_driver_lastclose(struct drm_device * dev) { drm_i915_private_t *dev_priv = dev->dev_private; - if (!dev_priv || drm_core_check_feature(dev, DRIVER_MODESET)) { + /* On gen6+ we refuse to init without kms enabled, but then the drm core + * goes right around and calls lastclose. Check for this and don't clean + * up anything. */ + if (!dev_priv) + return; + if (drm_core_check_feature(dev, DRIVER_MODESET)) { #if 1 KIB_NOTYET(); #else @@ -1580,13 +1601,14 @@ i915_driver_lastclose(struct drm_device #endif return; } + i915_gem_lastclose(dev); + i915_dma_cleanup(dev); } void i915_driver_preclose(struct drm_device * dev, struct drm_file *file_priv) { - i915_gem_context_close(dev, file_priv); i915_gem_release(dev, file_priv); } From owner-svn-src-head@freebsd.org Wed Aug 26 16:32:14 2015 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 BC9E29C33D2 for ; Wed, 26 Aug 2015 16:32:14 +0000 (UTC) (envelope-from julien@jch.io) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) (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 60098A83 for ; Wed, 26 Aug 2015 16:32:14 +0000 (UTC) (envelope-from julien@jch.io) Received: by wicja10 with SMTP id ja10so49874052wic.1 for ; Wed, 26 Aug 2015 09:32:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=qIe0fgVsML0e8pBiOJn9CPWTAgqET9nNdC/I0JAWfO0=; b=fQGNpOKUys73fHyGeUNctnLScpU0FaGeYtTUDfHB4nOe2fO9oD03JhKSwL3aEMRXji FM7WYb0Lg0PFCPPennDJ6W00BqaF8zne2y7py+3MfW/b94hDI2g5XNkDN+6XhKecIVeJ jRhOkpveDQy/Pdn1sKC1WfWb71P9y+zy8vsj1kl97FaYAY2OofCWIN94k5nGPVYRgsdv 74ZEtmXRHm9/CmOTnuDi7EuaJ3PLgr8yqZ0+WH3lNzx5wDekG2Gux8xu+cjYvtNQMkEB oddOnZz9dCv60Epxneh0oBkQ+mXadGKndyyMzrICdPS6c84r9gsZupsrqY8mTjF2QQpm 5Fpw== X-Gm-Message-State: ALoCoQnHBnzT7R6aFWTWr7LYsJxNJRl3GRleo/FHdtCP2DaJdYHmxzBHuxL5j/P57qxpY2sWsI2o X-Received: by 10.180.101.164 with SMTP id fh4mr5289472wib.25.1440606727256; Wed, 26 Aug 2015 09:32:07 -0700 (PDT) Received: from fri2pmaresca-l1.vcorp.ad.vrsn.com ([217.30.88.7]) by smtp.googlemail.com with ESMTPSA id y13sm4631923wjq.26.2015.08.26.09.32.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2015 09:32:06 -0700 (PDT) Subject: Re: svn commit: r286880 - head/sys/kern To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Baldwin References: <201508181015.t7IAFAex055889@repo.freebsd.org> <55DD69E5.4090904@selasky.org> From: Julien Charbon Message-ID: <55DDE9FF.3020705@freebsd.org> Date: Wed, 26 Aug 2015 18:31:59 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55DD69E5.4090904@selasky.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sVp8OSs2S8XEkQVM2w1JquIHOlmb6Xjm1" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 26 Aug 2015 16:32:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sVp8OSs2S8XEkQVM2w1JquIHOlmb6Xjm1 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Hans, On 26/08/15 09:25, Hans Petter Selasky wrote: > On 08/18/15 12:15, Julien Charbon wrote: >> Author: jch >> Date: Tue Aug 18 10:15:09 2015 >> New Revision: 286880 >> URL: https://svnweb.freebsd.org/changeset/base/286880 >> >> Log: >> callout_stop() should return 0 (fail) when the callout is currently= >> being serviced and indeed unstoppable. >> >> A scenario to reproduce this case is: >> >> - the callout is being serviced and at same time, >> - callout_reset() is called on this callout that sets >> the CALLOUT_PENDING flag and at same time, >> - callout_stop() is called on this callout and returns 1 (success) >> even if the callout is indeed currently running and unstoppable. >> >> This issue was caught up while making r284245 (D2763) workaround, a= nd >> was discussed at BSDCan 2015. Once applied the r284245 workaround >> is not needed anymore and will be reverted. >> >> Differential Revision: https://reviews.freebsd.org/D3078 >> Reviewed by: jhb >> Sponsored by: Verisign, Inc. >> >> Modified: >> head/sys/kern/kern_timeout.c >> >> Modified: head/sys/kern/kern_timeout.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/kern/kern_timeout.c Tue Aug 18 10:07:03 2015 (r2868= 79) >> +++ head/sys/kern/kern_timeout.c Tue Aug 18 10:15:09 2015 (r2868= 80) >> @@ -1150,7 +1150,7 @@ _callout_stop_safe(struct callout *c, in >> struct callout_cpu *cc, *old_cc; >> struct lock_class *class; >> int direct, sq_locked, use_lock; >> - int not_on_a_list; >> + int not_on_a_list, not_running; >> >> if (safe) >> WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock, >> @@ -1378,8 +1378,15 @@ again: >> } >> } >> callout_cc_del(c, cc); >> + >> + /* >> + * If we are asked to stop a callout which is currently in progre= ss >> + * and indeed impossible to stop then return 0. >> + */ >> + not_running =3D !(cc_exec_curr(cc, direct) =3D=3D c); >> + >> CC_UNLOCK(cc); >> - return (1); >> + return (not_running); >> } >> >> void >=20 > I think this patch is incomplete and can break the return value for > non-MPSAFE callouts. I think the correct statement should check the > value of "use_lock" too: >=20 > not_running =3D !(cc_exec_curr(cc, direct) =3D=3D c && use_lock =3D= =3D 0); >=20 > Because if the callback process waits for lock "c_lock" in the callback= > process then we have above "cc_exec_curr(cc, direct) =3D=3D c" is satis= fied > too, and non-MPSAFE callouts are always cancelable, via > cc_exec_cancel(cc, direct) =3D true; Hum, interesting let me double check that. -- Julien --sVp8OSs2S8XEkQVM2w1JquIHOlmb6Xjm1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJV3eoEAAoJEKVlQ5Je6dhxrnkH/3U43xxFECX8nd6l8PHlUhAF DwBvlKviCZ7fxnmUEEN8o1U/TC52E2hQYPVlONTmGkbEkOI7bppXOPeT8tcIJ38F u1uqwx1ArnG8T8Vne5puvB28Ij1SwyIarhkR4XUEAmYdp7IUrE5dIOhVeuVOTzSZ P3xoxrjMKfxaNtY+c7bDPuGbhzGFZiGK+ljsSltjxVKgPyXiKERyz3t51AYWJkMX npfn6iNLHkr3SePj03MzIL8e7aXtzCEiJSzENQDEdl+QlhuqYBv6TO1FGfMr/gP/ pAL2qoHpn84zuKsp9D+D4g7giW44Gd19RLx+DQxFLNSy3q9JMv1wr5cnc8Dq8ls= =cd2B -----END PGP SIGNATURE----- --sVp8OSs2S8XEkQVM2w1JquIHOlmb6Xjm1-- From owner-svn-src-head@freebsd.org Wed Aug 26 16:36:42 2015 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 43B9E9C35AB; Wed, 26 Aug 2015 16:36:42 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3479D1164; Wed, 26 Aug 2015 16:36:42 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QGagov041883; Wed, 26 Aug 2015 16:36:42 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QGag96041882; Wed, 26 Aug 2015 16:36:42 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201508261636.t7QGag96041882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Wed, 26 Aug 2015 16:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287166 - 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.20 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, 26 Aug 2015 16:36:42 -0000 Author: gnn Date: Wed Aug 26 16:36:41 2015 New Revision: 287166 URL: https://svnweb.freebsd.org/changeset/base/287166 Log: Summary: Add the interactivity equations to the header comment for our interactivity calculation routine. Suggested by: rwatson Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Aug 26 13:23:56 2015 (r287165) +++ head/sys/kern/sched_ule.c Wed Aug 26 16:36:41 2015 (r287166) @@ -1450,6 +1450,21 @@ sched_initticks(void *dummy) * a [0, 100] integer. This is the voluntary sleep time of a process, which * differs from the cpu usage because it does not account for time spent * waiting on a run-queue. Would be prettier if we had floating point. + * + * When a thread's sleep time is greater than its run time the + * calculation is: + * + * scaling factor + * interactivity score = --------------------- + * sleep time / run time + * + * + * When a thread's run time is greater than its sleep time the + * calculation is: + * + * scaling factor + * interactivity score = --------------------- + scaling factor + * run time / sleep time */ static int sched_interact_score(struct thread *td) From owner-svn-src-head@freebsd.org Wed Aug 26 17:10:44 2015 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 2EBD89C3237; Wed, 26 Aug 2015 17:10:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 1FC07A42; Wed, 26 Aug 2015 17:10:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QHAhJo054841; Wed, 26 Aug 2015 17:10:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QHAhc7054840; Wed, 26 Aug 2015 17:10:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508261710.t7QHAhc7054840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 26 Aug 2015 17:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287167 - head/share/mk 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.20 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, 26 Aug 2015 17:10:44 -0000 Author: imp Date: Wed Aug 26 17:10:43 2015 New Revision: 287167 URL: https://svnweb.freebsd.org/changeset/base/287167 Log: After consultations with the arm community, don't define softfp for armv6. It's too ambiguous. We do use the softfp ABI for the moment on armv6, but we allow floating point register use (and the compilers will generate it). This is too ambiguous to use it as a decider for which algorithms to use on the platform. Err on the side of caution and not define it. Submitted by: ian@ Reviewed by: andrew@ Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Wed Aug 26 16:36:41 2015 (r287166) +++ head/share/mk/bsd.cpu.mk Wed Aug 26 17:10:43 2015 (r287167) @@ -282,7 +282,11 @@ MACHINE_CPU += arm . if ${MACHINE_ARCH:Marmv6*} != "" MACHINE_CPU += armv6 . endif -. if ${MACHINE_ARCH:M*hf} == "" +# armv6 is a hybrid. It uses the softfp ABI, but doesn't emulate +# floating point in the general case, so don't define softfp for +# it at this time. arm and armeb are pure softfp, so define it +# for them. +. if ${MACHINE_ARCH:Marmv6*} == "" MACHINE_CPU += softfp . endif .if ${MACHINE_ARCH} == "armv6" From owner-svn-src-head@freebsd.org Wed Aug 26 17:13:52 2015 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 8D5839C333A; Wed, 26 Aug 2015 17:13:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7A49FDAD; Wed, 26 Aug 2015 17:13:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QHDqeN058629; Wed, 26 Aug 2015 17:13:52 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QHDmGu058612; Wed, 26 Aug 2015 17:13:48 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201508261713.t7QHDmGu058612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 26 Aug 2015 17:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287168 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... 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.20 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, 26 Aug 2015 17:13:52 -0000 Author: jkim Date: Wed Aug 26 17:13:47 2015 New Revision: 287168 URL: https://svnweb.freebsd.org/changeset/base/287168 Log: Merge ACPICA 20150818. Modified: head/sys/conf/files head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/debugger/dbconvert.c head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbfileio.c head/sys/contrib/dev/acpica/components/debugger/dbhistry.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbobject.c head/sys/contrib/dev/acpica/components/debugger/dbstats.c head/sys/contrib/dev/acpica/components/debugger/dbtest.c head/sys/contrib/dev/acpica/components/debugger/dbutils.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c head/sys/contrib/dev/acpica/components/disassembler/dmnames.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c head/sys/contrib/dev/acpica/components/disassembler/dmutils.c head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c head/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/executer/exconfig.c head/sys/contrib/dev/acpica/components/executer/exdump.c head/sys/contrib/dev/acpica/components/executer/exresnte.c head/sys/contrib/dev/acpica/components/executer/exresolv.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/components/namespace/nseval.c head/sys/contrib/dev/acpica/components/namespace/nsload.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/resources/rsdump.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbfind.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/utilities/utfileio.c head/sys/contrib/dev/acpica/components/utilities/utinit.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/components/utilities/utnonansi.c head/sys/contrib/dev/acpica/components/utilities/utxface.c head/sys/contrib/dev/acpica/components/utilities/utxfinit.c head/sys/contrib/dev/acpica/include/acbuffer.h head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actables.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/dev/acpica/Osd/OsdDebug.c head/usr.sbin/acpi/acpidb/acpidb.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Aug 26 17:10:43 2015 (r287167) +++ head/sys/conf/files Wed Aug 26 17:13:47 2015 (r287168) @@ -401,7 +401,7 @@ contrib/dev/acpica/components/parser/psx contrib/dev/acpica/components/resources/rsaddr.c optional acpi contrib/dev/acpica/components/resources/rscalc.c optional acpi contrib/dev/acpica/components/resources/rscreate.c optional acpi -contrib/dev/acpica/components/resources/rsdump.c optional acpi +contrib/dev/acpica/components/resources/rsdump.c optional acpi acpi_debug contrib/dev/acpica/components/resources/rsdumpinfo.c optional acpi contrib/dev/acpica/components/resources/rsinfo.c optional acpi contrib/dev/acpica/components/resources/rsio.c optional acpi Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Aug 26 17:10:43 2015 (r287167) +++ head/sys/contrib/dev/acpica/changes.txt Wed Aug 26 17:13:47 2015 (r287168) @@ -1,4 +1,90 @@ ---------------------------------------- +18 August 2015. Summary of changes for version 20150818: + +This release is available at https://acpica.org/downloads + +1) ACPICA kernel-resident subsystem: + +Fix a regression for AcpiGetTableByIndex interface causing it to fail. Lv +Zheng. ACPICA BZ 1186. + +Completed development to ensure that the ACPICA Disassembler and Debugger +are fully standalone components of ACPICA. Removed cross-component +dependences. Lv Zheng. + +The max-number-of-AML-loops is now runtime configurable (previously was +compile-time only). This is essentially a loop timeout to force-abort +infinite AML loops. ACPCIA BZ 1192. + +Debugger: Cleanup output to dump ACPI names and namepaths without any +trailing underscores. Lv Zheng. ACPICA BZ 1135. + +Removed unnecessary conditional compilations across the Debugger and +Disassembler components where entire modules could be left uncompiled. + +The aapits test is deprecated and has been removed from the ACPICA git +tree. The test has never been completed and has not been maintained, thus +becoming rather useless. ACPICA BZ 1015, 794. + +A batch of small changes to close bugzilla and other reports: +- Remove duplicate code for _PLD processing. ACPICA BZ 1176. +- Correctly cleanup after a ACPI table load failure. ACPICA BZ 1185. +- iASL: Support POSIX yacc again in makefile. Jung-uk Kim. +- ACPI table support: general cleanup and simplification. Lv Zheng, Bob +Moore. +- ACPI table support: fix for a buffer read overrun in AcpiTbFindTable. +ACPICA BZ 1184. +- Enhance parameter validation for DataTableRegion and LoadTable ASL/AML +operators. +- Debugger: Split debugger initialization/termination interfaces. Lv +Zheng. +- AcpiExec: Emit OemTableId for SSDTs during the load phase for table +identification. +- AcpiExec: Add debug message during _REG method phase during table +load/init. +- AcpiNames: Fix a regression where some output was missing and no longer +emitted. +- Debugger: General cleanup and simplification. Lv Zheng. +- Disassembler: Cleanup use of several global option variables. Lv Zheng. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 101.3K Code, 27.7K Data, 129.0K Total + Debug Version: 198.6K Code, 80.9K Data, 279.5K Total + Previous Release: + Non-Debug Version: 100.9K Code, 24.5K Data, 125.4K Total + Debug Version: 197.8K Code, 81.5K Data, 279.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +AcpiExec: Fixed a problem where any more than 32 ACPI tables in the XSDT +were not handled properly and caused load errors. Now, properly invoke +and use the ACPICA auto-reallocate mechanism for ACPI table data +structures. ACPICA BZ 1188 + +AcpiNames: Add command-line wildcard support for ACPI table files. ACPICA +BZ 1190. + +AcpiExec and AcpiNames: Add -l option to load ACPI tables only. For +AcpiExec, this means that no control methods (like _REG/_INI/_STA) are +executed during initialization. ACPICA BZ 1187, 1189. + +iASL/Disassembler: Implemented a prototype "listing" mode that emits AML +that corresponds to each disassembled ASL statement, to simplify +debugging. ACPICA BZ 1191. + +Debugger: Add option to the "objects" command to display a summary of the +current namespace objects (Object type and count). This is displayed if +the command is entered with no arguments. + +AcpiNames: Add -x option to specify debug level, similar to AcpiExec. + +---------------------------------------- 17 July 2015. Summary of changes for version 20150717: 1) ACPICA kernel-resident subsystem: Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Wed Aug 26 17:10:43 2015 (r287167) +++ head/sys/contrib/dev/acpica/common/adisasm.c Wed Aug 26 17:13:47 2015 (r287168) @@ -133,7 +133,7 @@ AcpiDsMethodDataInitArgs ( static ACPI_TABLE_DESC LocalTables[1]; -ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; +static ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; /******************************************************************************* @@ -187,7 +187,6 @@ AdInitialize ( AcpiGbl_RootTableList.CurrentTableCount = 0; AcpiGbl_RootTableList.Tables = LocalTables; - AcpiGbl_PreviousOp = NULL; return (Status); } @@ -317,7 +316,7 @@ AdAmlDisassemble ( return (Status); } - if (!AcpiGbl_DbOpt_Disasm) + if (!AcpiGbl_DmOpt_Disasm) { return (AE_OK); } @@ -506,7 +505,7 @@ AdAmlDisassemble ( /* Optional displays */ - if (AcpiGbl_DbOpt_Disasm) + if (AcpiGbl_DmOpt_Disasm) { /* This is the real disassembly */ @@ -742,7 +741,7 @@ AdDisplayTables ( return (AE_NOT_EXIST); } - if (!AcpiGbl_DbOpt_Verbose) + if (!AcpiGbl_DmOpt_Listing) { AdCreateTableHeader (Filename, Table); } @@ -750,7 +749,7 @@ AdDisplayTables ( AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UINT32_MAX); MpEmitMappingInfo (); - if (AcpiGbl_DbOpt_Verbose) + if (AcpiGbl_DmOpt_Listing) { AcpiOsPrintf ("\n\nTable Header:\n"); AcpiUtDebugDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER), Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Wed Aug 26 17:10:43 2015 (r287167) +++ head/sys/contrib/dev/acpica/common/dmtable.c Wed Aug 26 17:13:47 2015 (r287168) @@ -702,7 +702,7 @@ AcpiDmLineHeader2 ( * SubtableLength - Length of this sub-descriptor * Info - Info table for this ACPI table * - * RETURN: None + * RETURN: Status * * DESCRIPTION: Display ACPI table contents by walking the Info table. * Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Aug 26 17:10:43 2015 (r287167) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Aug 26 17:13:47 2015 (r287168) @@ -192,6 +192,7 @@ Usage ( ACPI_OPTION ("-e ", "Include ACPI table(s) for external symbol resolution"); ACPI_OPTION ("-fe ", "Specify external symbol declaration file"); ACPI_OPTION ("-in", "Ignore NoOp opcodes"); + ACPI_OPTION ("-l", "Disassemble to mixed ASL and AML code"); ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file"); printf ("\nDebug Options:\n"); @@ -298,6 +299,8 @@ AslInitialize ( UINT32 i; + AcpiGbl_DmOpt_Verbose = FALSE; + for (i = 0; i < ASL_NUM_FILES; i++) { Gbl_Files[i].Handle = NULL; Modified: head/sys/contrib/dev/acpica/compiler/asloperands.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloperands.c Wed Aug 26 17:10:43 2015 (r287167) +++ head/sys/contrib/dev/acpica/compiler/asloperands.c Wed Aug 26 17:13:47 2015 (r287168) @@ -932,13 +932,13 @@ OpnDoDefinitionBlock ( if (Child->Asl.Value.String) { Gbl_TableSignature = Child->Asl.Value.String; - if (strlen (Gbl_TableSignature) != 4) + if (strlen (Gbl_TableSignature) != ACPI_NAME_SIZE) { AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child, - "Length not exactly 4"); + "Length is not exactly 4"); } - for (i = 0; i < 4; i++) + for (i = 0; i < ACPI_NAME_SIZE; i++) { if (!isalnum ((int) Gbl_TableSignature[i])) { Modified: head/sys/contrib/dev/acpica/compiler/asloptions.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloptions.c Wed Aug 26 17:10:43 2015 (r287167) +++ head/sys/contrib/dev/acpica/compiler/asloptions.c Wed Aug 26 17:13:47 2015 (r287168) @@ -286,11 +286,6 @@ AslDoOptions ( AcpiGbl_CstyleDisassembly = FALSE; break; - case 'v': - - AcpiGbl_DbOpt_Verbose = TRUE; - break; - default: printf ("Unknown option: -d%s\n", AcpiGbl_Optarg); @@ -445,6 +440,7 @@ AslDoOptions ( /* Produce listing file (Mixed source/aml) */ Gbl_ListingFlag = TRUE; + AcpiGbl_DmOpt_Listing = TRUE; break; case 'i': Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstartup.c Wed Aug 26 17:10:43 2015 (r287167) +++ head/sys/contrib/dev/acpica/compiler/aslstartup.c Wed Aug 26 17:13:47 2015 (r287168) @@ -253,7 +253,7 @@ AslDoDisassembly ( /* This is where the disassembly happens */ - AcpiGbl_DbOpt_Disasm = TRUE; + AcpiGbl_DmOpt_Disasm = TRUE; Status = AdAmlDisassemble (AslToFile, Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_OutputFilenamePrefix, &Gbl_Files[ASL_FILE_INPUT].Filename); Modified: head/sys/contrib/dev/acpica/components/debugger/dbcmds.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbcmds.c Wed Aug 26 17:10:43 2015 (r287167) +++ head/sys/contrib/dev/acpica/components/debugger/dbcmds.c Wed Aug 26 17:13:47 2015 (r287168) @@ -49,7 +49,6 @@ #include #include -#ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbcmds") @@ -88,6 +87,7 @@ AcpiDbDoOneSleepState ( static char *AcpiDbTraceMethodName = NULL; + /******************************************************************************* * * FUNCTION: AcpiDbConvertToNode @@ -140,7 +140,8 @@ AcpiDbConvertToNode ( Node = AcpiDbLocalNsLookup (InString); if (!Node) { - AcpiOsPrintf ("Could not find [%s] in namespace, defaulting to root node\n", + AcpiOsPrintf ( + "Could not find [%s] in namespace, defaulting to root node\n", InString); Node = AcpiGbl_RootNode; } @@ -203,7 +204,7 @@ AcpiDbSleep ( * * PARAMETERS: SleepState - Desired sleep state (0-5) * - * RETURN: Status + * RETURN: None * * DESCRIPTION: Simulate a sleep/wake sequence * @@ -340,7 +341,8 @@ AcpiDbDisplayTableInfo ( /* Header */ - AcpiOsPrintf ("Idx ID Status Type TableHeader (Sig, Address, Length)\n"); + AcpiOsPrintf ("Idx ID Status Type " + "TableHeader (Sig, Address, Length, Misc)\n"); /* Walk the entire root table list */ @@ -499,7 +501,8 @@ AcpiDbSendNotify ( else { AcpiOsPrintf ( - "Named object [%4.4s] Type %s, must be Device/Thermal/Processor type\n", + "Named object [%4.4s] Type %s, " + "must be Device/Thermal/Processor type\n", AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)); } } @@ -532,8 +535,7 @@ AcpiDbDisplayInterfaces ( if (!ActionArg) { - (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, - ACPI_WAIT_FOREVER); + (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); NextInterface = AcpiGbl_SupportedInterfaces; while (NextInterface) @@ -542,6 +544,7 @@ AcpiDbDisplayInterfaces ( { AcpiOsPrintf ("%s\n", NextInterface->Name); } + NextInterface = NextInterface->Next; } @@ -647,7 +650,8 @@ AcpiDbDisplayTemplate ( if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could not convert Buffer to a resource list: %s, %s\n", + AcpiOsPrintf ( + "Could not convert Buffer to a resource list: %s, %s\n", BufferArg, AcpiFormatException (Status)); goto DumpBuffer; } @@ -708,7 +712,8 @@ AcpiDmCompareAmlResources ( if (Aml1BufferLength != Aml2BufferLength) { AcpiOsPrintf ( - "**** Buffer length mismatch in converted AML: Original %X, New %X ****\n", + "**** Buffer length mismatch in converted " + "AML: Original %X, New %X ****\n", Aml1BufferLength, Aml2BufferLength); } @@ -732,7 +737,8 @@ AcpiDmCompareAmlResources ( if (Aml1Length != Aml2Length) { AcpiOsPrintf ( - "**** Length mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X Len1 %X, Len2 %X ****\n", + "**** Length mismatch in descriptor [%.2X] type %2.2X, " + "Offset %8.8X Len1 %X, Len2 %X ****\n", Count, ResourceType, Offset, Aml1Length, Aml2Length); } @@ -741,7 +747,8 @@ AcpiDmCompareAmlResources ( else if (memcmp (Aml1, Aml2, Aml1Length)) { AcpiOsPrintf ( - "**** Data mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X ****\n", + "**** Data mismatch in descriptor [%.2X] type %2.2X, " + "Offset %8.8X ****\n", Count, ResourceType, Offset); for (i = 0; i < Aml1Length; i++) @@ -749,7 +756,8 @@ AcpiDmCompareAmlResources ( if (Aml1[i] != Aml2[i]) { AcpiOsPrintf ( - "Mismatch at byte offset %.2X: is %2.2X, should be %2.2X\n", + "Mismatch at byte offset %.2X: is %2.2X, " + "should be %2.2X\n", i, Aml2[i], Aml1[i]); } } @@ -914,10 +922,15 @@ AcpiDbDeviceResources ( /* Get handles to the resource methods for this device */ - (void) AcpiGetHandle (Node, METHOD_NAME__PRT, ACPI_CAST_PTR (ACPI_HANDLE, &PrtNode)); - (void) AcpiGetHandle (Node, METHOD_NAME__CRS, ACPI_CAST_PTR (ACPI_HANDLE, &CrsNode)); - (void) AcpiGetHandle (Node, METHOD_NAME__PRS, ACPI_CAST_PTR (ACPI_HANDLE, &PrsNode)); - (void) AcpiGetHandle (Node, METHOD_NAME__AEI, ACPI_CAST_PTR (ACPI_HANDLE, &AeiNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__PRT, + ACPI_CAST_PTR (ACPI_HANDLE, &PrtNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__CRS, + ACPI_CAST_PTR (ACPI_HANDLE, &CrsNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__PRS, + ACPI_CAST_PTR (ACPI_HANDLE, &PrsNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__AEI, + ACPI_CAST_PTR (ACPI_HANDLE, &AeiNode)); + if (!PrtNode && !CrsNode && !PrsNode && !AeiNode) { goto Cleanup; /* Nothing to do */ @@ -1071,7 +1084,8 @@ GetPrs: goto GetAei; } - AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer)); + AcpiRsDumpResourceList (ACPI_CAST_PTR ( + ACPI_RESOURCE, AcpiGbl_DbBuffer)); } @@ -1104,7 +1118,8 @@ GetAei: goto Cleanup; } - AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer)); + AcpiRsDumpResourceList (ACPI_CAST_PTR ( + ACPI_RESOURCE, AcpiGbl_DbBuffer)); } @@ -1143,7 +1158,7 @@ AcpiDbDisplayResources ( if (!ObjectArg || (!strcmp (ObjectArg, "*"))) { (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL); + ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL); } else { @@ -1154,7 +1169,8 @@ AcpiDbDisplayResources ( { if (Node->Type != ACPI_TYPE_DEVICE) { - AcpiOsPrintf ("%4.4s: Name is not a device object (%s)\n", + AcpiOsPrintf ( + "%4.4s: Name is not a device object (%s)\n", Node->Name.Ascii, AcpiUtGetTypeName (Node->Type)); } else @@ -1219,6 +1235,19 @@ AcpiDbGenerateGpe ( (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber); } + +/******************************************************************************* + * + * FUNCTION: AcpiDbGenerateSci + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Simulate an SCI -- just call the SCI dispatch. + * + ******************************************************************************/ + void AcpiDbGenerateSci ( void) @@ -1259,10 +1288,12 @@ AcpiDbTrace ( { AcpiUtStrupr (EnableArg); } + if (OnceArg) { AcpiUtStrupr (OnceArg); } + if (MethodArg) { if (AcpiDbTraceMethodName) @@ -1270,14 +1301,18 @@ AcpiDbTrace ( ACPI_FREE (AcpiDbTraceMethodName); AcpiDbTraceMethodName = NULL; } + AcpiDbTraceMethodName = ACPI_ALLOCATE (strlen (MethodArg) + 1); if (!AcpiDbTraceMethodName) { - AcpiOsPrintf ("Failed to allocate method name (%s)\n", MethodArg); + AcpiOsPrintf ("Failed to allocate method name (%s)\n", + MethodArg); return; } + strcpy (AcpiDbTraceMethodName, MethodArg); } + if (!strcmp (EnableArg, "ENABLE") || !strcmp (EnableArg, "METHOD") || !strcmp (EnableArg, "OPCODE")) @@ -1298,10 +1333,12 @@ AcpiDbTrace ( } Flags = ACPI_TRACE_ENABLED; + if (!strcmp (EnableArg, "OPCODE")) { Flags |= ACPI_TRACE_OPCODE; } + if (OnceArg && !strcmp (OnceArg, "ONCE")) { Flags |= ACPI_TRACE_ONESHOT; @@ -1309,7 +1346,5 @@ AcpiDbTrace ( } (void) AcpiDebugTrace (AcpiDbTraceMethodName, - DebugLevel, DebugLayer, Flags); + DebugLevel, DebugLayer, Flags); } - -#endif /* ACPI_DEBUGGER */ Modified: head/sys/contrib/dev/acpica/components/debugger/dbconvert.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbconvert.c Wed Aug 26 17:10:43 2015 (r287167) +++ head/sys/contrib/dev/acpica/components/debugger/dbconvert.c Wed Aug 26 17:13:47 2015 (r287168) @@ -45,7 +45,6 @@ #include #include -#ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbconvert") @@ -528,5 +527,3 @@ AcpiDbDumpPldBuffer ( ACPI_FREE (PldInfo); ACPI_FREE (NewBuffer); } - -#endif /* ACPI_DEBUGGER */ Modified: head/sys/contrib/dev/acpica/components/debugger/dbdisply.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbdisply.c Wed Aug 26 17:10:43 2015 (r287167) +++ head/sys/contrib/dev/acpica/components/debugger/dbdisply.c Wed Aug 26 17:13:47 2015 (r287168) @@ -51,8 +51,6 @@ #include -#ifdef ACPI_DEBUGGER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbdisply") @@ -242,7 +240,8 @@ AcpiDbDecodeAndDisplayObject ( ObjPtr = AcpiDbGetPointer (Target); if (!AcpiOsReadable (ObjPtr, 16)) { - AcpiOsPrintf ("Address %p is invalid in this address space\n", + AcpiOsPrintf ( + "Address %p is invalid in this address space\n", ObjPtr); return; } @@ -258,7 +257,8 @@ AcpiDbDecodeAndDisplayObject ( if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_NAMESPACE_NODE))) { AcpiOsPrintf ( - "Cannot read entire Named object at address %p\n", ObjPtr); + "Cannot read entire Named object at address %p\n", + ObjPtr); return; } @@ -271,13 +271,14 @@ AcpiDbDecodeAndDisplayObject ( if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT))) { - AcpiOsPrintf ("Cannot read entire ACPI object at address %p\n", + AcpiOsPrintf ( + "Cannot read entire ACPI object at address %p\n", ObjPtr); return; } - AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display, - ACPI_UINT32_MAX); + AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), + Display, ACPI_UINT32_MAX); AcpiExDumpObjectDescriptor (ObjPtr, 1); break; @@ -288,12 +289,13 @@ AcpiDbDecodeAndDisplayObject ( if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT))) { AcpiOsPrintf ( - "Cannot read entire Parser object at address %p\n", ObjPtr); + "Cannot read entire Parser object at address %p\n", + ObjPtr); return; } - AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display, - ACPI_UINT32_MAX); + AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), + Display, ACPI_UINT32_MAX); AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr); break; @@ -332,7 +334,7 @@ AcpiDbDecodeAndDisplayObject ( DumpNode: /* Now dump the NS node */ - Status = AcpiGetName (Node, ACPI_FULL_PATHNAME, &RetBuf); + Status = AcpiGetName (Node, ACPI_FULL_PATHNAME_NO_TRAILING, &RetBuf); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not convert name to pathname\n"); @@ -365,8 +367,8 @@ DumpNode: return; } - AcpiUtDebugDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT), - Display, ACPI_UINT32_MAX); + AcpiUtDebugDumpBuffer ((void *) ObjDesc, + sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX); AcpiExDumpObjectDescriptor (ObjDesc, 1); } } @@ -587,7 +589,7 @@ AcpiDbDisplayResults ( } AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n", - AcpiUtGetNodeName (Node), ResultCount); + AcpiUtGetNodeName (Node), ResultCount); /* From the top element of result stack */ @@ -599,11 +601,13 @@ AcpiDbDisplayResults ( ObjDesc = Frame->Results.ObjDesc[Index]; AcpiOsPrintf ("Result%u: ", i); AcpiDbDisplayInternalObject (ObjDesc, WalkState); + if (Index == 0) { Frame = Frame->Results.Next; Index = ACPI_RESULTS_FRAME_OBJ_NUM; } + Index--; } } @@ -642,7 +646,6 @@ AcpiDbDisplayCallingTree ( while (WalkState) { Node = WalkState->MethodNode; - AcpiOsPrintf (" [%4.4s]\n", AcpiUtGetNodeName (Node)); WalkState = WalkState->Next; @@ -710,14 +713,17 @@ AcpiDbDisplayObjectType ( { AcpiOsPrintf ("HID: %s\n", Info->HardwareId.String); } + if (Info->Valid & ACPI_VALID_UID) { AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String); } + if (Info->Valid & ACPI_VALID_SUB) { AcpiOsPrintf ("SUB: %s\n", Info->SubsystemId.String); } + if (Info->Valid & ACPI_VALID_CID) { for (i = 0; i < Info->CompatibleIdList.Count; i++) @@ -842,7 +848,8 @@ AcpiDbDisplayGpes ( GpeBlock = GpeXruptInfo->GpeBlockListHead; while (GpeBlock) { - Status = AcpiGetName (GpeBlock->Node, ACPI_FULL_PATHNAME, &RetBuf); + Status = AcpiGetName (GpeBlock->Node, + ACPI_FULL_PATHNAME_NO_TRAILING, &RetBuf); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not convert name to pathname\n"); @@ -857,13 +864,16 @@ AcpiDbDisplayGpes ( GpeType = "GPE Block Device"; } - AcpiOsPrintf ("\nBlock %u - Info %p DeviceNode %p [%s] - %s\n", + AcpiOsPrintf ( + "\nBlock %u - Info %p DeviceNode %p [%s] - %s\n", Block, GpeBlock, GpeBlock->Node, Buffer, GpeType); - AcpiOsPrintf (" Registers: %u (%u GPEs)\n", + AcpiOsPrintf ( + " Registers: %u (%u GPEs)\n", GpeBlock->RegisterCount, GpeBlock->GpeCount); - AcpiOsPrintf (" GPE range: 0x%X to 0x%X on interrupt %u\n", + AcpiOsPrintf ( + " GPE range: 0x%X to 0x%X on interrupt %u\n", GpeBlock->BlockBaseNumber, GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1), GpeXruptInfo->InterruptNumber); @@ -871,8 +881,10 @@ AcpiDbDisplayGpes ( AcpiOsPrintf ( " RegisterInfo: %p Status %8.8X%8.8X Enable %8.8X%8.8X\n", GpeBlock->RegisterInfo, - ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->StatusAddress.Address), - ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->EnableAddress.Address)); + ACPI_FORMAT_UINT64 ( + GpeBlock->RegisterInfo->StatusAddress.Address), + ACPI_FORMAT_UINT64 ( + GpeBlock->RegisterInfo->EnableAddress.Address)); AcpiOsPrintf (" EventInfo: %p\n", GpeBlock->EventInfo); @@ -883,14 +895,18 @@ AcpiDbDisplayGpes ( GpeRegisterInfo = &GpeBlock->RegisterInfo[i]; AcpiOsPrintf ( - " Reg %u: (GPE %.2X-%.2X) RunEnable %2.2X WakeEnable %2.2X" + " Reg %u: (GPE %.2X-%.2X) " + "RunEnable %2.2X WakeEnable %2.2X" " Status %8.8X%8.8X Enable %8.8X%8.8X\n", i, GpeRegisterInfo->BaseGpeNumber, - GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1), + GpeRegisterInfo->BaseGpeNumber + + (ACPI_GPE_REGISTER_WIDTH - 1), GpeRegisterInfo->EnableForRun, GpeRegisterInfo->EnableForWake, - ACPI_FORMAT_UINT64 (GpeRegisterInfo->StatusAddress.Address), - ACPI_FORMAT_UINT64 (GpeRegisterInfo->EnableAddress.Address)); + ACPI_FORMAT_UINT64 ( + GpeRegisterInfo->StatusAddress.Address), + ACPI_FORMAT_UINT64 ( + GpeRegisterInfo->EnableAddress.Address)); /* Now look at the individual GPEs in this byte register */ @@ -958,7 +974,9 @@ AcpiDbDisplayGpes ( Count++; Notify = Notify->Next; } - AcpiOsPrintf ("Implicit Notify on %u devices", Count); + + AcpiOsPrintf ("Implicit Notify on %u devices", + Count); break; case ACPI_GPE_DISPATCH_RAW_HANDLER: @@ -976,9 +994,11 @@ AcpiDbDisplayGpes ( AcpiOsPrintf (")\n"); } } + Block++; GpeBlock = GpeBlock->Next; } + GpeXruptInfo = GpeXruptInfo->Next; } } @@ -1024,12 +1044,15 @@ AcpiDbDisplayHandlers ( while (HandlerObj) { - if (AcpiGbl_SpaceIdList[i] == HandlerObj->AddressSpace.SpaceId) + if (AcpiGbl_SpaceIdList[i] == + HandlerObj->AddressSpace.SpaceId) { AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, (HandlerObj->AddressSpace.HandlerFlags & - ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User", + ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? + "Default" : "User", HandlerObj->AddressSpace.Handler); + goto FoundHandler; } @@ -1054,7 +1077,8 @@ AcpiDbDisplayHandlers ( "User-defined ID", HandlerObj->AddressSpace.SpaceId); AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, (HandlerObj->AddressSpace.HandlerFlags & - ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User", + ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? + "Default" : "User", HandlerObj->AddressSpace.Handler); } @@ -1090,7 +1114,9 @@ AcpiDbDisplayHandlers ( for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_HandlerList); i++) { - AcpiOsPrintf (ACPI_HANDLER_NAME_STRING, AcpiGbl_HandlerList[i].Name); + AcpiOsPrintf (ACPI_HANDLER_NAME_STRING, + AcpiGbl_HandlerList[i].Name); + if (AcpiGbl_HandlerList[i].Handler) { AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User", @@ -1108,8 +1134,8 @@ AcpiDbDisplayHandlers ( AcpiOsPrintf ("\nOperation Region Handlers for specific devices:\n"); (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers, - NULL, NULL, NULL); + ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers, + NULL, NULL, NULL); } @@ -1173,5 +1199,3 @@ AcpiDbDisplayNonRootHandlers ( ACPI_FREE (Pathname); return (AE_OK); } - -#endif /* ACPI_DEBUGGER */ Modified: head/sys/contrib/dev/acpica/components/debugger/dbexec.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbexec.c Wed Aug 26 17:10:43 2015 (r287167) +++ head/sys/contrib/dev/acpica/components/debugger/dbexec.c Wed Aug 26 17:13:47 2015 (r287168) @@ -46,7 +46,6 @@ #include #include -#ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbexec") @@ -213,7 +212,8 @@ AcpiDbExecuteMethod ( if (Status == AE_BUFFER_OVERFLOW) { ACPI_ERROR ((AE_INFO, - "Possible overflow of internal debugger buffer (size 0x%X needed 0x%X)", + "Possible overflow of internal debugger " + "buffer (size 0x%X needed 0x%X)", ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length)); } } @@ -380,10 +380,11 @@ AcpiDbExecutionWalk ( Status = AcpiEvaluateObject (Node, NULL, NULL, &ReturnObj); - AcpiOsPrintf ("Evaluation of [%4.4s] returned %s\n", AcpiUtGetNodeName (Node), - AcpiFormatException (Status)); - AcpiGbl_MethodExecuting = FALSE; + AcpiOsPrintf ("Evaluation of [%4.4s] returned %s\n", + AcpiUtGetNodeName (Node), + AcpiFormatException (Status)); + AcpiGbl_MethodExecuting = FALSE; return (AE_OK); } @@ -394,6 +395,7 @@ AcpiDbExecutionWalk ( * * PARAMETERS: Name - Name of method to execute * Args - Parameters to the method + * Types - * Flags - single step/no single step * * RETURN: None @@ -414,7 +416,6 @@ AcpiDbExecute ( ACPI_BUFFER ReturnObj; char *NameString; - #ifdef ACPI_DEBUG_OUTPUT UINT32 PreviousAllocations; UINT32 Allocations; @@ -428,7 +429,7 @@ AcpiDbExecute ( if (*Name == '*') { (void) AcpiWalkNamespace (ACPI_TYPE_METHOD, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL, NULL); + ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL, NULL); return; } else @@ -464,7 +465,8 @@ AcpiDbExecute ( &AcpiGbl_DbMethodInfo.Method); if (ACPI_SUCCESS (Status)) { - Status = AcpiDbExecuteMethod (&AcpiGbl_DbMethodInfo, &ReturnObj); + Status = AcpiDbExecuteMethod (&AcpiGbl_DbMethodInfo, + &ReturnObj); } ACPI_FREE (NameString); } @@ -485,15 +487,17 @@ AcpiDbExecute ( if (Allocations > 0) { - AcpiOsPrintf ("0x%X Outstanding allocations after evaluation of %s\n", - Allocations, AcpiGbl_DbMethodInfo.Pathname); + AcpiOsPrintf ( + "0x%X Outstanding allocations after evaluation of %s\n", + Allocations, AcpiGbl_DbMethodInfo.Pathname); } #endif if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Evaluation of %s failed with status %s\n", - AcpiGbl_DbMethodInfo.Pathname, AcpiFormatException (Status)); + AcpiGbl_DbMethodInfo.Pathname, + AcpiFormatException (Status)); } else { @@ -502,15 +506,18 @@ AcpiDbExecute ( if (ReturnObj.Length) { AcpiOsPrintf ( - "Evaluation of %s returned object %p, external buffer length %X\n", + "Evaluation of %s returned object %p, " + "external buffer length %X\n", AcpiGbl_DbMethodInfo.Pathname, ReturnObj.Pointer, (UINT32) ReturnObj.Length); + AcpiDbDumpExternalObject (ReturnObj.Pointer, 1); /* Dump a _PLD buffer if present */ if (ACPI_COMPARE_NAME ((ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, - AcpiGbl_DbMethodInfo.Method)->Name.Ascii), METHOD_NAME__PLD)) + AcpiGbl_DbMethodInfo.Method)->Name.Ascii), + METHOD_NAME__PLD)) { AcpiDbDumpPldBuffer (ReturnObj.Pointer); } @@ -563,8 +570,10 @@ AcpiDbMethodThread ( if (Info->InitArgs) { - AcpiDbUint32ToHexString (Info->NumCreated, Info->IndexOfThreadStr); - AcpiDbUint32ToHexString ((UINT32) AcpiOsGetThreadId (), Info->IdOfThreadStr); + AcpiDbUint32ToHexString (Info->NumCreated, + Info->IndexOfThreadStr); + AcpiDbUint32ToHexString ((UINT32) AcpiOsGetThreadId (), + Info->IdOfThreadStr); } if (Info->Threads && (Info->NumCreated < Info->NumThreads)) @@ -599,7 +608,8 @@ AcpiDbMethodThread ( #if 0 if ((i % 100) == 0) { - AcpiOsPrintf ("%u loops, Thread 0x%x\n", i, AcpiOsGetThreadId ()); + AcpiOsPrintf ("%u loops, Thread 0x%x\n", + i, AcpiOsGetThreadId ()); } if (ReturnObj.Length) @@ -614,7 +624,8 @@ AcpiDbMethodThread ( /* Signal our completion */ Allow = 0; - (void) AcpiOsWaitSemaphore (Info->ThreadCompleteGate, 1, ACPI_WAIT_FOREVER); + (void) AcpiOsWaitSemaphore (Info->ThreadCompleteGate, + 1, ACPI_WAIT_FOREVER); Info->NumCompleted++; if (Info->NumCompleted == Info->NumThreads) @@ -630,7 +641,8 @@ AcpiDbMethodThread ( Status = AcpiOsSignalSemaphore (Info->MainThreadGate, 1); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could not signal debugger thread sync semaphore, %s\n", + AcpiOsPrintf ( + "Could not signal debugger thread sync semaphore, %s\n", AcpiFormatException (Status)); } } @@ -686,7 +698,8 @@ AcpiDbCreateExecutionThreads ( Status = AcpiOsCreateSemaphore (1, 0, &MainThreadGate); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could not create semaphore for synchronization with the main thread, %s\n", + AcpiOsPrintf ("Could not create semaphore for " + "synchronization with the main thread, %s\n", AcpiFormatException (Status)); return; } @@ -698,8 +711,10 @@ AcpiDbCreateExecutionThreads ( Status = AcpiOsCreateSemaphore (1, 1, &ThreadCompleteGate); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could not create semaphore for synchronization between the created threads, %s\n", + AcpiOsPrintf ("Could not create semaphore for " + "synchronization between the created threads, %s\n", AcpiFormatException (Status)); + (void) AcpiOsDeleteSemaphore (MainThreadGate); return; } @@ -707,8 +722,10 @@ AcpiDbCreateExecutionThreads ( Status = AcpiOsCreateSemaphore (1, 1, &InfoGate); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could not create semaphore for synchronization of AcpiGbl_DbMethodInfo, %s\n", + AcpiOsPrintf ("Could not create semaphore for " + "synchronization of AcpiGbl_DbMethodInfo, %s\n", AcpiFormatException (Status)); + (void) AcpiOsDeleteSemaphore (ThreadCompleteGate); (void) AcpiOsDeleteSemaphore (MainThreadGate); return; @@ -720,6 +737,7 @@ AcpiDbCreateExecutionThreads ( AcpiGbl_DbMethodInfo.NumThreads = NumThreads; Size = sizeof (ACPI_THREAD_ID) * AcpiGbl_DbMethodInfo.NumThreads; + AcpiGbl_DbMethodInfo.Threads = AcpiOsAllocate (Size); if (AcpiGbl_DbMethodInfo.Threads == NULL) { @@ -807,5 +825,3 @@ CleanupAndExit: AcpiOsFree (AcpiGbl_DbMethodInfo.Threads); AcpiGbl_DbMethodInfo.Threads = NULL; } - -#endif /* ACPI_DEBUGGER */ Modified: head/sys/contrib/dev/acpica/components/debugger/dbfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbfileio.c Wed Aug 26 17:10:43 2015 (r287167) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Aug 26 18:09:19 2015 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 323119C2510; Wed, 26 Aug 2015 18:09:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 22C3AA52; Wed, 26 Aug 2015 18:09:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QI9J0H079234; Wed, 26 Aug 2015 18:09:19 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QI9Irr079232; Wed, 26 Aug 2015 18:09:18 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508261809.t7QI9Irr079232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 26 Aug 2015 18:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287169 - in head/sys: arm64/conf 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.20 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, 26 Aug 2015 18:09:19 -0000 Author: andrew Date: Wed Aug 26 18:09:17 2015 New Revision: 287169 URL: https://svnweb.freebsd.org/changeset/base/287169 Log: Add the SOC_HISI_HI6220 option. This will be used to enable drivers for the HiSilicon hi6220 SoC used in the HiKey 96boards board. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/conf/GENERIC head/sys/conf/options.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Aug 26 17:13:47 2015 (r287168) +++ head/sys/arm64/conf/GENERIC Wed Aug 26 18:09:17 2015 (r287169) @@ -86,6 +86,7 @@ options MALLOC_DEBUG_MAXZONES=8 # Separ # SoC support options SOC_CAVM_THUNDERX +options SOC_HISI_HI6220 # VirtIO support device virtio Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Wed Aug 26 17:13:47 2015 (r287168) +++ head/sys/conf/options.arm64 Wed Aug 26 18:09:17 2015 (r287169) @@ -8,3 +8,4 @@ VFP opt_global.h # SoC Support SOC_CAVM_THUNDERX opt_soc.h +SOC_HISI_HI6220 opt_soc.h From owner-svn-src-head@freebsd.org Wed Aug 26 18:14:26 2015 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 5C7E59C2769 for ; Wed, 26 Aug 2015 18:14:26 +0000 (UTC) (envelope-from julien@jch.io) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) (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 E8B149E for ; Wed, 26 Aug 2015 18:14:25 +0000 (UTC) (envelope-from julien@jch.io) Received: by wicja10 with SMTP id ja10so52354460wic.1 for ; Wed, 26 Aug 2015 11:14:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=3M9wN0G1mHbEmAr6jIOJEqlFUkfeHTzKK64zPat+QeA=; b=aQWdQpLNdXhlPGK0fWpey4zJyWzEB2DQdmiOnFL/OP9Cfgx2kGiGFab83v1/IVGwdV r49xUxEgWi/SUIz7PbLdSVBstRSju11k8H5DZPXZOfcuLHgtf2vDwAfsfXPUPchrvAKM XHbJUfaICsjvfvTbrr+iIkJkV2O8rypK899OZFspVHdB6IOCFSJtO7hZuOFtMrW/L8kB v3/RKu/Daf3EmbTB9G1Gw2YeGZXqCuQGbD/K4dGZExaWQ+LMPv0fyILVqlJnYNCXbX3R GtU5yinDKHXRHFIUHhnnITCyPmqoepKqRr7UvPtFoH6dbuxH3J8Cp6+/GP85AksxIDMS qqQw== X-Gm-Message-State: ALoCoQl1FLdZp6Mn/pxuNv/gyvG3vlc2PlGjf807EvgpE20zApFE6+rGFHXG3JByMMEP0p8AkRta X-Received: by 10.194.93.166 with SMTP id cv6mr61239741wjb.63.1440612863765; Wed, 26 Aug 2015 11:14:23 -0700 (PDT) Received: from fri2pmaresca-l1.vcorp.ad.vrsn.com ([217.30.88.7]) by smtp.googlemail.com with ESMTPSA id gv1sm8769765wib.15.2015.08.26.11.14.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2015 11:14:23 -0700 (PDT) Subject: Re: svn commit: r286880 - head/sys/kern To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Baldwin References: <201508181015.t7IAFAex055889@repo.freebsd.org> <55DD69E5.4090904@selasky.org> <55DD74EB.30601@selasky.org> From: Julien Charbon X-Enigmail-Draft-Status: N1110 Message-ID: <55DE01F7.8040508@freebsd.org> Date: Wed, 26 Aug 2015 20:14:15 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55DD74EB.30601@selasky.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="TItrp25ijAVjbKfgsMecOF3872ljK8LVM" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 26 Aug 2015 18:14:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --TItrp25ijAVjbKfgsMecOF3872ljK8LVM Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Hans, On 26/08/15 10:12, Hans Petter Selasky wrote: > On 08/26/15 09:25, Hans Petter Selasky wrote: >> On 08/18/15 12:15, Julien Charbon wrote: >>> Author: jch >>> Date: Tue Aug 18 10:15:09 2015 >>> New Revision: 286880 >>> URL: https://svnweb.freebsd.org/changeset/base/286880 >>> >>> Log: >>> callout_stop() should return 0 (fail) when the callout is currentl= y >>> being serviced and indeed unstoppable. >>> >>> A scenario to reproduce this case is: >>> >>> - the callout is being serviced and at same time, >>> - callout_reset() is called on this callout that sets >>> the CALLOUT_PENDING flag and at same time, >>> - callout_stop() is called on this callout and returns 1 (success)= >>> even if the callout is indeed currently running and unstoppable.= >>> >>> This issue was caught up while making r284245 (D2763) workaround, = and >>> was discussed at BSDCan 2015. Once applied the r284245 workaround= >>> is not needed anymore and will be reverted. >>> >>> Differential Revision: https://reviews.freebsd.org/D3078 >>> Reviewed by: jhb >>> Sponsored by: Verisign, Inc. >>> >>> Modified: >>> head/sys/kern/kern_timeout.c >>> >>> Modified: head/sys/kern/kern_timeout.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/kern/kern_timeout.c Tue Aug 18 10:07:03 2015 =20 >>> (r286879) >>> +++ head/sys/kern/kern_timeout.c Tue Aug 18 10:15:09 2015 =20 >>> (r286880) >>> @@ -1150,7 +1150,7 @@ _callout_stop_safe(struct callout *c, in >>> struct callout_cpu *cc, *old_cc; >>> struct lock_class *class; >>> int direct, sq_locked, use_lock; >>> - int not_on_a_list; >>> + int not_on_a_list, not_running; >>> >>> if (safe) >>> WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock, >>> @@ -1378,8 +1378,15 @@ again: >>> } >>> } >>> callout_cc_del(c, cc); >>> + >>> + /* >>> + * If we are asked to stop a callout which is currently in progr= ess >>> + * and indeed impossible to stop then return 0. >>> + */ >>> + not_running =3D !(cc_exec_curr(cc, direct) =3D=3D c); >>> + >>> CC_UNLOCK(cc); >>> - return (1); >>> + return (not_running); >>> } >>> >>> void >=20 > I'm sorry to say, but I think this change should be backed out as it > changes the behaviour of the callout API. The old code was correct. The= > issues should be fixed in the TCP stack instead, like suggested by D156= 3 > and also r284245. >=20 > This patch introduces new behaviour to the callout_stop() function, > which is contradicting "man 9 callout" and _not_ documented anywhere! >=20 > Reading "man 9 callout" in 11-current: >=20 >> The callout_reset() and callout_schedule() function families >> schedule a >> future function invocation for callout c. If c already has a >> pending >> callout, it is cancelled before the new invocation is scheduled. >=20 > callout_reset() causes a _new_ callout invocation and it is logical tha= t > the return value of callout_stop() reflect operations on the _new_ > callout invocation and not the previous one. >=20 >> The function callout_stop() cancels a callout c if it is >> currently pend- >> ing. If the callout is pending, then callout_stop() returns a >> non-zero >> value. If the callout is not set, has already been serviced, or >> is cur- >> rently being serviced, then zero will be returned. If the >> callout has an >> associated lock, then that lock must be held when this function i= s >> called. >=20 > If there are two callout invocations that callout_stop() needs to > handle, it should be called twice. >=20 > The correct way is: >=20 > callout_reset(); > callout_stop(); > callout_drain(); >=20 > For the TCP stack's matter, it should be: >=20 > callout_reset(); > callout_stop(); /* cancel _new_ callout invocation */ > callout_stop(); /* check for any pending callout invokation */ First thank for your time. I indeed agree with your analysis and I am not opposed to back out this change. The border between bug or feature can indeed be thin; below why I was more on "bug" side: o Pro "It is a feature": - This behavior is here since the beginning and nobody ever complains (Big one) o Pro "It is a bug": - Having callout_stop() returning 1 (success) while having the callout currently being serviced is counter intuitive. - You cannot call callout_stop() twice to address this case: callout_reset(); callout_stop(); /* cancel _new_ callout invocation */ callout_stop(); /* check for any pending callout invokation */ Because the second callout_stop() will always return 0 (Fail). In details: If the callout is currently being serviced (without r286880 i.e. the classical behavior): callout_reset() returns 0 (Fail) (PENDING flag set) callout_stop() returns 1 (Success) (PENDING flag removed) callout_stop() returns 0 (Always fail because not PENDING flag) In mpsafe mode, the only way a callout_stop() can return 1 (Success) is with the PENDING flags set. The way I found to address this case is with= : fail_reset =3D !callout_reset(); fail_stop =3D !callout_stop(); if (fail_reset || fail_stop) { /* Callout not stopped */ } This is what I did in r284245: https://svnweb.freebsd.org/base/head/sys/netinet/tcp_timer.c?r1=3D284245&= r2=3D284244&pathrev=3D284245 And it felt wrong to me because callout_reset() and callout_stop() calls can be far away. o Pro "it is 'neither'" (i.e. API unclear by design): In this case the same callout is indeed _both_ pending and currently being serviced. According to man page callout(9): (As you already notic= ed) If the callout is pending, then callout_stop() returns a non-zero ^^^^^^^^^^^^^^^^^^ value. Conclusion: It is a feature! And just after: If the callout is not set, has already been serviced, or is currently being serviced, then zero will be returned. ^^^^^^^^^^^^^^^^^^^^^^^^ Conclusion: It is a bug! Obviously, no indication about the case where the callout is indeed _both_ pending and currently being serviced. > Remember there are other OS'es out there using our TCP/IP stack which > do not have an identical callout subsystem. I was not aware of that. As I said, I am not opposed to back out this change, callout(9) API in mpsafe mode is a already complex/subtle API, it won't change too much the current complexity. Let say that if nobody screams until Friday 8/28, I will put back r284245 and revert this change _and_ I will make this case clear in the man page. -- Julien --TItrp25ijAVjbKfgsMecOF3872ljK8LVM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJV3gH9AAoJEKVlQ5Je6dhxEGsIAOargp57PbbzfYCq9JoawFSR 4Pdzxan0KQNibvxIRoy6g3taTh4+g8AsXrJkdCuafsXJ31vnHjWRje03CpMHx6O1 ynjwF8h1QgWvnbRqzfHP0dWVAVAbOtSAROEutGzHWc3T7a0lLbPpznOkh81w6OMH 7BLY/laGZXKU55UsHnRBxoWS2/FRwJdjVuBaJ4Y4n0fXmtLPrtDLC4BVGIfMI9Zz h8XTNipNLjx/7NEDAGvLQ1IgHcUpgBMhPrJ5MnxcYxdJONZZb02QWnHODsWgm5/8 RHsO9lFyrnxjZJsBtRxjyQdH3FqGS5+LQVOkiI/JnF9gB9xgnI42uS0gk6+f6b8= =uzsn -----END PGP SIGNATURE----- --TItrp25ijAVjbKfgsMecOF3872ljK8LVM-- From owner-svn-src-head@freebsd.org Wed Aug 26 18:23:00 2015 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 59CD39C2AC1; Wed, 26 Aug 2015 18:23:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4AF29B19; Wed, 26 Aug 2015 18:23:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QIN0EA087731; Wed, 26 Aug 2015 18:23:00 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QIN0ar087730; Wed, 26 Aug 2015 18:23:00 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201508261823.t7QIN0ar087730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 26 Aug 2015 18:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287170 - 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.20 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, 26 Aug 2015 18:23:00 -0000 Author: jkim Date: Wed Aug 26 18:22:59 2015 New Revision: 287170 URL: https://svnweb.freebsd.org/changeset/base/287170 Log: Belatedly add entries for libugidfw.so.4 to catch up with r284745. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Aug 26 18:09:17 2015 (r287169) +++ head/ObsoleteFiles.inc Wed Aug 26 18:22:59 2015 (r287170) @@ -55,6 +55,9 @@ OLD_FILES+=usr/share/man/man4/dtrace-pro OLD_FILES+=usr/share/man/man4/dtrace-sched.4.gz OLD_FILES+=usr/share/man/man4/dtrace-tcp.4.gz OLD_FILES+=usr/share/man/man4/dtrace-udp.4.gz +# 20150624 +OLD_LIBS+=usr/lib/libugidfw.so.4 +OLD_LIBS+=usr/lib32/libugidfw.so.4 # 20150604: Move nvlist man pages to section 9. OLD_FILES+=usr/share/man/man3/libnv.3.gz OLD_FILES+=usr/share/man/man3/nvlist.3.gz From owner-svn-src-head@freebsd.org Wed Aug 26 18:30:27 2015 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 406AC9C2D14; Wed, 26 Aug 2015 18:30:27 +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 00CBCE74; Wed, 26 Aug 2015 18:30:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (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 A6D781FE023; Wed, 26 Aug 2015 20:30:23 +0200 (CEST) Subject: Re: svn commit: r286880 - head/sys/kern To: Julien Charbon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Baldwin , Adrian Chadd References: <201508181015.t7IAFAex055889@repo.freebsd.org> <55DD69E5.4090904@selasky.org> <55DD74EB.30601@selasky.org> <55DE01F7.8040508@freebsd.org> From: Hans Petter Selasky Message-ID: <55DE0615.5050303@selasky.org> Date: Wed, 26 Aug 2015 20:31:49 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55DE01F7.8040508@freebsd.org> 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.20 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, 26 Aug 2015 18:30:27 -0000 On 08/26/15 20:14, Julien Charbon wrote: > Let say that if nobody screams until Friday 8/28, I will put back > r284245 and revert this change_and_ I will make this case clear in the > man page. Hi, If you can update the manual page about this special case for MPSAFE callouts only I presume, then its totally fine. Then I can update my projects/hps_head to follow that new change, which now is a bit broken. You might also want to check existing MPSAFE consumers in the kernel, if this API change makes any difference. I was thinking if user-space TCP might be affected by this. CC'ing Adrian. --HPS From owner-svn-src-head@freebsd.org Wed Aug 26 21:17:49 2015 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 BC3A49C2770; Wed, 26 Aug 2015 21:17:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 AC9CFF19; Wed, 26 Aug 2015 21:17:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QLHn2A059284; Wed, 26 Aug 2015 21:17:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QLHnCE059282; Wed, 26 Aug 2015 21:17:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508262117.t7QLHnCE059282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 26 Aug 2015 21:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287171 - head/sys/dev/drm2/i915 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.20 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, 26 Aug 2015 21:17:49 -0000 Author: bapt Date: Wed Aug 26 21:17:48 2015 New Revision: 287171 URL: https://svnweb.freebsd.org/changeset/base/287171 Log: Synchronize i915_reg.h with linux 3.8.13 version Keep a couple of old macros that will be removed lated when the rest of the code will be updated to 3.8.13 equivalent. Chase the renamed macros Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D3487 Modified: head/sys/dev/drm2/i915/i915_reg.h head/sys/dev/drm2/i915/intel_ddi.c head/sys/dev/drm2/i915/intel_display.c head/sys/dev/drm2/i915/intel_pm.c Modified: head/sys/dev/drm2/i915/i915_reg.h ============================================================================== --- head/sys/dev/drm2/i915/i915_reg.h Wed Aug 26 18:22:59 2015 (r287170) +++ head/sys/dev/drm2/i915/i915_reg.h Wed Aug 26 21:17:48 2015 (r287171) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #define _I915_REG_H_ #define _PIPE(pipe, a, b) ((a) + (pipe)*((b)-(a))) +#define _TRANSCODER(tran, a, b) ((a) + (tran)*((b)-(a))) #define _PORT(port, a, b) ((a) + (port)*((b)-(a))) @@ -43,6 +44,14 @@ __FBSDID("$FreeBSD$"); */ #define INTEL_GMCH_CTRL 0x52 #define INTEL_GMCH_VGA_DISABLE (1 << 1) +#define SNB_GMCH_CTRL 0x50 +#define SNB_GMCH_GGMS_SHIFT 8 /* GTT Graphics Memory Size */ +#define SNB_GMCH_GGMS_MASK 0x3 +#define SNB_GMCH_GMS_SHIFT 3 /* Graphics Mode Select */ +#define SNB_GMCH_GMS_MASK 0x1f +#define IVB_GMCH_GMS_SHIFT 4 +#define IVB_GMCH_GMS_MASK 0xf + /* PCI config space */ @@ -108,7 +117,6 @@ __FBSDID("$FreeBSD$"); #define GEN6_GRDOM_MEDIA (1 << 2) #define GEN6_GRDOM_BLT (1 << 3) -/* PPGTT stuff */ #define GEN6_GTT_ADDR_ENCODE(addr) ((addr) | (((addr) >> 28) & 0xff0)) #define GEN6_PDE_VALID (1 << 0) @@ -213,6 +221,13 @@ __FBSDID("$FreeBSD$"); #define MI_DISPLAY_FLIP MI_INSTR(0x14, 2) #define MI_DISPLAY_FLIP_I915 MI_INSTR(0x14, 1) #define MI_DISPLAY_FLIP_PLANE(n) ((n) << 20) +/* IVB has funny definitions for which plane to flip. */ +#define MI_DISPLAY_FLIP_IVB_PLANE_A (0 << 19) +#define MI_DISPLAY_FLIP_IVB_PLANE_B (1 << 19) +#define MI_DISPLAY_FLIP_IVB_SPRITE_A (2 << 19) +#define MI_DISPLAY_FLIP_IVB_SPRITE_B (3 << 19) +#define MI_DISPLAY_FLIP_IVB_PLANE_C (4 << 19) +#define MI_DISPLAY_FLIP_IVB_SPRITE_C (5 << 19) #define MI_ARB_ON_OFF MI_INSTR(0x08, 0) #define MI_ARB_ENABLE (1<<0) #define MI_ARB_DISABLE (0<<0) @@ -236,11 +251,18 @@ __FBSDID("$FreeBSD$"); */ #define MI_LOAD_REGISTER_IMM(x) MI_INSTR(0x22, 2*x-1) #define MI_FLUSH_DW MI_INSTR(0x26, 1) /* for GEN6 */ -#define MI_INVALIDATE_TLB (1<<18) -#define MI_INVALIDATE_BSD (1<<7) +#define MI_FLUSH_DW_STORE_INDEX (1<<21) +#define MI_INVALIDATE_TLB (1<<18) +#define MI_FLUSH_DW_OP_STOREDW (1<<14) +#define MI_INVALIDATE_BSD (1<<7) +#define MI_FLUSH_DW_USE_GTT (1<<2) +#define MI_FLUSH_DW_USE_PPGTT (0<<2) #define MI_BATCH_BUFFER MI_INSTR(0x30, 1) -#define MI_BATCH_NON_SECURE (1) -#define MI_BATCH_NON_SECURE_I965 (1<<8) +#define MI_BATCH_NON_SECURE (1) +/* for snb/ivb/vlv this also means "batch in ppgtt" when ppgtt is enabled. */ +#define MI_BATCH_NON_SECURE_I965 (1<<8) +#define MI_BATCH_PPGTT_HSW (1<<8) +#define MI_BATCH_NON_SECURE_HSW (1<<13) #define MI_BATCH_BUFFER_START MI_INSTR(0x31, 0) #define MI_BATCH_GTT (2<<6) /* aliased with (1<<7) on gen4 */ #define MI_SEMAPHORE_MBOX MI_INSTR(0x16, 1) /* gen6+ */ @@ -298,6 +320,7 @@ __FBSDID("$FreeBSD$"); #define DISPLAY_PLANE_B (1<<20) #define GFX_OP_PIPE_CONTROL(len) ((0x3<<29)|(0x3<<27)|(0x2<<24)|(len-2)) #define PIPE_CONTROL_CS_STALL (1<<20) +#define PIPE_CONTROL_TLB_INVALIDATE (1<<18) #define PIPE_CONTROL_QW_WRITE (1<<14) #define PIPE_CONTROL_DEPTH_STALL (1<<13) #define PIPE_CONTROL_WRITE_FLUSH (1<<12) @@ -363,6 +386,7 @@ __FBSDID("$FreeBSD$"); #define DPIO_PLL_MODESEL_SHIFT 24 /* 3 bits */ #define DPIO_BIAS_CURRENT_CTL_SHIFT 21 /* 3 bits, always 0x7 */ #define DPIO_PLL_REFCLK_SEL_SHIFT 16 /* 2 bits */ +#define DPIO_PLL_REFCLK_SEL_MASK 3 #define DPIO_DRIVER_CTL_SHIFT 12 /* always set to 0x8 */ #define DPIO_CLK_BIAS_CTL_SHIFT 8 /* always set to 0x5 */ #define _DPIO_REFSFR_B 0x8034 @@ -378,6 +402,9 @@ __FBSDID("$FreeBSD$"); #define DPIO_FASTCLK_DISABLE 0x8100 +#define DPIO_DATA_CHANNEL1 0x8220 +#define DPIO_DATA_CHANNEL2 0x8420 + /* * Fence registers */ @@ -444,6 +471,7 @@ __FBSDID("$FreeBSD$"); #define RING_ACTHD(base) ((base)+0x74) #define RING_NOPID(base) ((base)+0x94) #define RING_IMR(base) ((base)+0xa8) +#define RING_TIMESTAMP(base) ((base)+0x358) #define TAIL_ADDR 0x001FFFF8 #define HEAD_WRAP_COUNT 0xFFE00000 #define HEAD_WRAP_ONE 0x00200000 @@ -472,6 +500,11 @@ __FBSDID("$FreeBSD$"); #define IPEIR_I965 0x02064 #define IPEHR_I965 0x02068 #define INSTDONE_I965 0x0206c +#define GEN7_INSTDONE_1 0x0206c +#define GEN7_SC_INSTDONE 0x07100 +#define GEN7_SAMPLER_INSTDONE 0x0e160 +#define GEN7_ROW_INSTDONE 0x0e164 +#define I915_NUM_INSTDONE_REG 4 #define RING_IPEIR(base) ((base)+0x64) #define RING_IPEHR(base) ((base)+0x68) #define RING_INSTDONE(base) ((base)+0x6c) @@ -494,12 +527,17 @@ __FBSDID("$FreeBSD$"); #define DMA_FADD_I8XX 0x020d0 #define ERROR_GEN6 0x040a0 +#define GEN7_ERR_INT 0x44040 +#define ERR_INT_MMIO_UNCLAIMED (1<<13) + +#define DERRMR 0x44050 /* GM45+ chicken bits -- debug workaround bits that may be required * for various sorts of correct behavior. The top 16 bits of each are * the enables for writing to the corresponding low bit. */ #define _3D_CHICKEN 0x02084 +#define _3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB (1 << 10) #define _3D_CHICKEN2 0x0208c /* Disables pipelining of read flushes past the SF-WIZ interface. * Required on all Ironlake steppings according to the B-Spec, but the @@ -507,11 +545,17 @@ __FBSDID("$FreeBSD$"); */ # define _3D_CHICKEN2_WM_READ_PIPELINED (1 << 14) #define _3D_CHICKEN3 0x02090 -#define _3D_CHICKEN_SF_DISABLE_FASTCLIP_CULL (1 << 5) +#define _3D_CHICKEN_SF_DISABLE_OBJEND_CULL (1 << 10) +#define _3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL (1 << 5) #define MI_MODE 0x0209c # define VS_TIMER_DISPATCH (1 << 6) # define MI_FLUSH_ENABLE (1 << 12) +# define ASYNC_FLIP_PERF_DISABLE (1 << 14) + +#define GEN6_GT_MODE 0x20d0 +#define GEN6_GT_MODE_HI (1 << 9) +#define GEN6_TD_FOUR_ROW_DISPATCH_DISABLE (1 << 5) #define GFX_MODE 0x02520 #define GFX_MODE_GEN7 0x0229c @@ -523,11 +567,15 @@ __FBSDID("$FreeBSD$"); #define GFX_PSMI_GRANULARITY (1<<10) #define GFX_PPGTT_ENABLE (1<<9) +#define VLV_DISPLAY_BASE 0x180000 + #define SCPD0 0x0209c /* 915+ only */ #define IER 0x020a0 #define IIR 0x020a4 #define IMR 0x020a8 #define ISR 0x020ac +#define VLV_GUNIT_CLOCK_GATE 0x182060 +#define GCFG_DIS (1<<8) #define VLV_IIR_RW 0x182084 #define VLV_IER 0x1820a0 #define VLV_IIR 0x1820a4 @@ -642,6 +690,7 @@ __FBSDID("$FreeBSD$"); #define MI_ARB_DISPLAY_PRIORITY_B_A (1 << 0) /* display B > display A */ #define CACHE_MODE_0 0x02120 /* 915+ only */ +#define CM0_PIPELINED_RENDER_FLUSH_DISABLE (1<<8) #define CM0_IZ_OPT_DISABLE (1<<6) #define CM0_ZR_OPT_DISABLE (1<<5) #define CM0_STC_EVICT_DISABLE_LRA_SNB (1<<5) @@ -651,6 +700,8 @@ __FBSDID("$FreeBSD$"); #define CM0_RC_OP_FLUSH_DISABLE (1<<0) #define BB_ADDR 0x02140 /* 8 bytes */ #define GFX_FLSH_CNTL 0x02170 /* 915+ only */ +#define GFX_FLSH_CNTL_GEN6 0x101008 +#define GFX_FLSH_CNTL_EN (1<<0) #define ECOSKPD 0x021d0 #define ECO_GATING_CX_ONLY (1<<3) #define ECO_FLIP_DONE (1<<0) @@ -685,6 +736,10 @@ __FBSDID("$FreeBSD$"); #define GEN6_BLITTER_FBC_NOTIFY (1<<3) #define GEN6_BSD_SLEEP_PSMI_CONTROL 0x12050 +#define GEN6_BSD_SLEEP_MSG_DISABLE (1 << 0) +#define GEN6_BSD_SLEEP_FLUSH_DISABLE (1 << 2) +#define GEN6_BSD_SLEEP_INDICATOR (1 << 3) +#define GEN6_BSD_GO_INDICATOR (1 << 4) #define GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_MODIFY_MASK (1 << 16) #define GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_DISABLE (1 << 0) #define GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_ENABLE 0 @@ -907,6 +962,7 @@ __FBSDID("$FreeBSD$"); #define DPLL_P2_CLOCK_DIV_MASK 0x03000000 /* i915 */ #define DPLL_FPA01_P1_POST_DIV_MASK 0x00ff0000 /* i915 */ #define DPLL_FPA01_P1_POST_DIV_MASK_PINEVIEW 0x00ff8000 /* Pineview */ +#define DPLL_LOCK_VLV (1<<15) #define DPLL_INTEGRATED_CLOCK_VLV (1<<13) #define SRX_INDEX 0x3c4 @@ -1452,6 +1508,10 @@ __FBSDID("$FreeBSD$"); #define DDRMPLL1 0X12c20 #define PEG_BAND_GAP_DATA 0x14d68 +#define GEN6_GT_THREAD_STATUS_REG 0x13805c +#define GEN6_GT_THREAD_STATUS_CORE_MASK 0x7 +#define GEN6_GT_THREAD_STATUS_CORE_MASK_HSW (0x7 | (0x07 << 16)) + #define GEN6_GT_PERF_STATUS 0x145948 #define GEN6_RP_STATE_LIMITS 0x145994 #define GEN6_RP_STATE_CAP 0x145998 @@ -1485,6 +1545,14 @@ __FBSDID("$FreeBSD$"); GEN7_CXT_EXTENDED_SIZE(ctx_reg) + \ GEN7_CXT_GT1_SIZE(ctx_reg) + \ GEN7_CXT_VFSTATE_SIZE(ctx_reg)) +#define HSW_CXT_POWER_SIZE(ctx_reg) ((ctx_reg >> 26) & 0x3f) +#define HSW_CXT_RING_SIZE(ctx_reg) ((ctx_reg >> 23) & 0x7) +#define HSW_CXT_RENDER_SIZE(ctx_reg) ((ctx_reg >> 15) & 0xff) +#define HSW_CXT_TOTAL_SIZE(ctx_reg) (HSW_CXT_POWER_SIZE(ctx_reg) + \ + HSW_CXT_RING_SIZE(ctx_reg) + \ + HSW_CXT_RENDER_SIZE(ctx_reg) + \ + GEN7_CXT_VFSTATE_SIZE(ctx_reg)) + /* * Overlay regs @@ -1527,23 +1595,46 @@ __FBSDID("$FreeBSD$"); #define _VSYNCSHIFT_B 0x61028 -#define HTOTAL(pipe) _PIPE(pipe, _HTOTAL_A, _HTOTAL_B) -#define HBLANK(pipe) _PIPE(pipe, _HBLANK_A, _HBLANK_B) -#define HSYNC(pipe) _PIPE(pipe, _HSYNC_A, _HSYNC_B) -#define VTOTAL(pipe) _PIPE(pipe, _VTOTAL_A, _VTOTAL_B) -#define VBLANK(pipe) _PIPE(pipe, _VBLANK_A, _VBLANK_B) -#define VSYNC(pipe) _PIPE(pipe, _VSYNC_A, _VSYNC_B) +#define HTOTAL(trans) _TRANSCODER(trans, _HTOTAL_A, _HTOTAL_B) +#define HBLANK(trans) _TRANSCODER(trans, _HBLANK_A, _HBLANK_B) +#define HSYNC(trans) _TRANSCODER(trans, _HSYNC_A, _HSYNC_B) +#define VTOTAL(trans) _TRANSCODER(trans, _VTOTAL_A, _VTOTAL_B) +#define VBLANK(trans) _TRANSCODER(trans, _VBLANK_A, _VBLANK_B) +#define VSYNC(trans) _TRANSCODER(trans, _VSYNC_A, _VSYNC_B) #define BCLRPAT(pipe) _PIPE(pipe, _BCLRPAT_A, _BCLRPAT_B) -#define VSYNCSHIFT(pipe) _PIPE(pipe, _VSYNCSHIFT_A, _VSYNCSHIFT_B) +#define VSYNCSHIFT(trans) _TRANSCODER(trans, _VSYNCSHIFT_A, _VSYNCSHIFT_B) /* VGA port control */ #define ADPA 0x61100 +#define PCH_ADPA 0xe1100 +#define VLV_ADPA (VLV_DISPLAY_BASE + ADPA) + #define ADPA_DAC_ENABLE (1<<31) #define ADPA_DAC_DISABLE 0 #define ADPA_PIPE_SELECT_MASK (1<<30) #define ADPA_PIPE_A_SELECT 0 #define ADPA_PIPE_B_SELECT (1<<30) #define ADPA_PIPE_SELECT(pipe) ((pipe) << 30) +/* CPT uses bits 29:30 for pch transcoder select */ +#define ADPA_CRT_HOTPLUG_MASK 0x03ff0000 /* bit 25-16 */ +#define ADPA_CRT_HOTPLUG_MONITOR_NONE (0<<24) +#define ADPA_CRT_HOTPLUG_MONITOR_MASK (3<<24) +#define ADPA_CRT_HOTPLUG_MONITOR_COLOR (3<<24) +#define ADPA_CRT_HOTPLUG_MONITOR_MONO (2<<24) +#define ADPA_CRT_HOTPLUG_ENABLE (1<<23) +#define ADPA_CRT_HOTPLUG_PERIOD_64 (0<<22) +#define ADPA_CRT_HOTPLUG_PERIOD_128 (1<<22) +#define ADPA_CRT_HOTPLUG_WARMUP_5MS (0<<21) +#define ADPA_CRT_HOTPLUG_WARMUP_10MS (1<<21) +#define ADPA_CRT_HOTPLUG_SAMPLE_2S (0<<20) +#define ADPA_CRT_HOTPLUG_SAMPLE_4S (1<<20) +#define ADPA_CRT_HOTPLUG_VOLTAGE_40 (0<<18) +#define ADPA_CRT_HOTPLUG_VOLTAGE_50 (1<<18) +#define ADPA_CRT_HOTPLUG_VOLTAGE_60 (2<<18) +#define ADPA_CRT_HOTPLUG_VOLTAGE_70 (3<<18) +#define ADPA_CRT_HOTPLUG_VOLREF_325MV (0<<17) +#define ADPA_CRT_HOTPLUG_VOLREF_475MV (1<<17) +#define ADPA_CRT_HOTPLUG_FORCE_TRIGGER (1<<16) #define ADPA_USE_VGA_HVPOLARITY (1<<15) #define ADPA_SETS_HVPOLARITY 0 #define ADPA_VSYNC_CNTL_DISABLE (1<<11) @@ -1590,12 +1681,23 @@ __FBSDID("$FreeBSD$"); #define CRT_HOTPLUG_DETECT_VOLTAGE_475MV (1 << 2) #define PORT_HOTPLUG_STAT 0x61114 +/* HDMI/DP bits are gen4+ */ #define HDMIB_HOTPLUG_INT_STATUS (1 << 29) #define DPB_HOTPLUG_INT_STATUS (1 << 29) #define HDMIC_HOTPLUG_INT_STATUS (1 << 28) #define DPC_HOTPLUG_INT_STATUS (1 << 28) #define HDMID_HOTPLUG_INT_STATUS (1 << 27) #define DPD_HOTPLUG_INT_STATUS (1 << 27) +/* HDMI bits are shared with the DP bits */ +/* +#define HDMIB_HOTPLUG_LIVE_STATUS (1 << 29) +#define HDMIC_HOTPLUG_LIVE_STATUS (1 << 28) +#define HDMID_HOTPLUG_LIVE_STATUS (1 << 27) +#define HDMID_HOTPLUG_INT_STATUS (3 << 21) +#define HDMIC_HOTPLUG_INT_STATUS (3 << 19) +#define HDMIB_HOTPLUG_INT_STATUS (3 << 17) +*/ +/* CRT/TV common between gen3+ */ #define CRT_HOTPLUG_INT_STATUS (1 << 11) #define TV_HOTPLUG_INT_STATUS (1 << 10) #define CRT_HOTPLUG_MONITOR_MASK (3 << 8) @@ -1604,6 +1706,13 @@ __FBSDID("$FreeBSD$"); #define CRT_HOTPLUG_MONITOR_NONE (0 << 8) #define SDVOC_HOTPLUG_INT_STATUS (1 << 7) #define SDVOB_HOTPLUG_INT_STATUS (1 << 6) +/* SDVO is different across gen3/4 */ +#define SDVOC_HOTPLUG_INT_STATUS_G4X (1 << 3) +#define SDVOB_HOTPLUG_INT_STATUS_G4X (1 << 2) +#define SDVOC_HOTPLUG_INT_STATUS_I965 (3 << 4) +#define SDVOB_HOTPLUG_INT_STATUS_I965 (3 << 2) +#define SDVOC_HOTPLUG_INT_STATUS_I915 (1 << 7) +#define SDVOB_HOTPLUG_INT_STATUS_I915 (1 << 6) /* SDVO port control */ #define SDVOB 0x61140 @@ -1728,6 +1837,10 @@ __FBSDID("$FreeBSD$"); /* Video Data Island Packet control */ #define VIDEO_DIP_DATA 0x61178 +/* Read the description of VIDEO_DIP_DATA (before Haswel) or VIDEO_DIP_ECC + * (Haswell and newer) to see which VIDEO_DIP_DATA byte corresponds to each byte + * of the infoframe structure specified by CEA-861. */ +#define VIDEO_DIP_DATA_SIZE 32 #define VIDEO_DIP_CTL 0x61170 /* Pre HSW: */ #define VIDEO_DIP_ENABLE (1 << 31) @@ -1735,19 +1848,25 @@ __FBSDID("$FreeBSD$"); #define VIDEO_DIP_PORT_C (2 << 29) #define VIDEO_DIP_PORT_D (3 << 29) #define VIDEO_DIP_PORT_MASK (3 << 29) +#define VIDEO_DIP_ENABLE_GCP (1 << 25) #define VIDEO_DIP_ENABLE_AVI (1 << 21) #define VIDEO_DIP_ENABLE_VENDOR (2 << 21) +#define VIDEO_DIP_ENABLE_GAMUT (4 << 21) #define VIDEO_DIP_ENABLE_SPD (8 << 21) -#define VIDEO_DIP_SELECT_MASK (3 << 19) #define VIDEO_DIP_SELECT_AVI (0 << 19) #define VIDEO_DIP_SELECT_VENDOR (1 << 19) #define VIDEO_DIP_SELECT_SPD (3 << 19) +#define VIDEO_DIP_SELECT_MASK (3 << 19) #define VIDEO_DIP_FREQ_ONCE (0 << 16) #define VIDEO_DIP_FREQ_VSYNC (1 << 16) #define VIDEO_DIP_FREQ_2VSYNC (2 << 16) #define VIDEO_DIP_FREQ_MASK (3 << 16) /* HSW and later: */ +#define VIDEO_DIP_ENABLE_VSC_HSW (1 << 20) +#define VIDEO_DIP_ENABLE_GCP_HSW (1 << 16) #define VIDEO_DIP_ENABLE_AVI_HSW (1 << 12) +#define VIDEO_DIP_ENABLE_VS_HSW (1 << 8) +#define VIDEO_DIP_ENABLE_GMP_HSW (1 << 4) #define VIDEO_DIP_ENABLE_SPD_HSW (1 << 0) /* Panel power sequencing */ @@ -1819,18 +1938,35 @@ __FBSDID("$FreeBSD$"); #define PFIT_AUTO_RATIOS 0x61238 /* Backlight control */ -#define BLC_PWM_CTL 0x61254 -#define BACKLIGHT_MODULATION_FREQ_SHIFT (17) #define BLC_PWM_CTL2 0x61250 /* 965+ only */ -#define BLM_COMBINATION_MODE (1 << 30) +#define BLM_PWM_ENABLE (1 << 31) +#define BLM_COMBINATION_MODE (1 << 30) /* gen4 only */ +#define BLM_PIPE_SELECT (1 << 29) +#define BLM_PIPE_SELECT_IVB (3 << 29) +#define BLM_PIPE_A (0 << 29) +#define BLM_PIPE_B (1 << 29) +#define BLM_PIPE_C (2 << 29) /* ivb + */ +#define BLM_PIPE(pipe) ((pipe) << 29) +#define BLM_POLARITY_I965 (1 << 28) /* gen4 only */ +#define BLM_PHASE_IN_INTERUPT_STATUS (1 << 26) +#define BLM_PHASE_IN_ENABLE (1 << 25) +#define BLM_PHASE_IN_INTERUPT_ENABL (1 << 24) +#define BLM_PHASE_IN_TIME_BASE_SHIFT (16) +#define BLM_PHASE_IN_TIME_BASE_MASK (0xff << 16) +#define BLM_PHASE_IN_COUNT_SHIFT (8) +#define BLM_PHASE_IN_COUNT_MASK (0xff << 8) +#define BLM_PHASE_IN_INCR_SHIFT (0) +#define BLM_PHASE_IN_INCR_MASK (0xff << 0) +#define BLC_PWM_CTL 0x61254 /* * This is the most significant 15 bits of the number of backlight cycles in a * complete cycle of the modulated backlight control. * * The actual value is this field multiplied by two. */ -#define BACKLIGHT_MODULATION_FREQ_MASK (0x7fff << 17) -#define BLM_LEGACY_MODE (1 << 16) +#define BACKLIGHT_MODULATION_FREQ_SHIFT (17) +#define BACKLIGHT_MODULATION_FREQ_MASK (0x7fff << 17) +#define BLM_LEGACY_MODE (1 << 16) /* gen2 only */ /* * This is the number of cycles out of the backlight modulation cycle for which * the backlight is on. @@ -1840,9 +1976,24 @@ __FBSDID("$FreeBSD$"); */ #define BACKLIGHT_DUTY_CYCLE_SHIFT (0) #define BACKLIGHT_DUTY_CYCLE_MASK (0xffff) +#define BACKLIGHT_DUTY_CYCLE_MASK_PNV (0xfffe) +#define BLM_POLARITY_PNV (1 << 0) /* pnv only */ #define BLC_HIST_CTL 0x61260 +/* New registers for PCH-split platforms. Safe where new bits show up, the + * register layout machtes with gen4 BLC_PWM_CTL[12]. */ +#define BLC_PWM_CPU_CTL2 0x48250 +#define BLC_PWM_CPU_CTL 0x48254 + +/* PCH CTL1 is totally different, all but the below bits are reserved. CTL2 is + * like the normal CTL from gen4 and earlier. Hooray for confusing naming. */ +#define BLC_PWM_PCH_CTL1 0xc8250 +#define BLM_PCH_PWM_ENABLE (1 << 31) +#define BLM_PCH_OVERRIDE_ENABLE (1 << 30) +#define BLM_PCH_POLARITY (1 << 29) +#define BLC_PWM_PCH_CTL2 0xc8254 + /* TV port control */ #define TV_CTL 0x68000 /** Enables the TV encoder */ @@ -2530,6 +2681,7 @@ __FBSDID("$FreeBSD$"); #define PIPECONF_GAMMA (1<<24) #define PIPECONF_FORCE_BORDER (1<<25) #define PIPECONF_INTERLACE_MASK (7 << 21) +#define PIPECONF_INTERLACE_MASK_HSW (3 << 21) /* Note that pre-gen3 does not support interlaced display directly. Panel * fitting must be disabled on pre-ilk for interlaced. */ #define PIPECONF_PROGRESSIVE (0 << 21) @@ -2600,20 +2752,20 @@ __FBSDID("$FreeBSD$"); #define PIPE_12BPC (3 << 5) #define PIPESRC(pipe) _PIPE(pipe, _PIPEASRC, _PIPEBSRC) -#define PIPECONF(pipe) _PIPE(pipe, _PIPEACONF, _PIPEBCONF) +#define PIPECONF(tran) _TRANSCODER(tran, _PIPEACONF, _PIPEBCONF) #define PIPEDSL(pipe) _PIPE(pipe, _PIPEADSL, _PIPEBDSL) #define PIPEFRAME(pipe) _PIPE(pipe, _PIPEAFRAMEHIGH, _PIPEBFRAMEHIGH) #define PIPEFRAMEPIXEL(pipe) _PIPE(pipe, _PIPEAFRAMEPIXEL, _PIPEBFRAMEPIXEL) #define PIPESTAT(pipe) _PIPE(pipe, _PIPEASTAT, _PIPEBSTAT) #define VLV_DPFLIPSTAT 0x70028 -#define PIPEB_LINE_COMPARE_STATUS (1<<29) +#define PIPEB_LINE_COMPARE_INT_EN (1<<29) #define PIPEB_HLINE_INT_EN (1<<28) #define PIPEB_VBLANK_INT_EN (1<<27) #define SPRITED_FLIPDONE_INT_EN (1<<26) #define SPRITEC_FLIPDONE_INT_EN (1<<25) #define PLANEB_FLIPDONE_INT_EN (1<<24) -#define PIPEA_LINE_COMPARE_STATUS (1<<21) +#define PIPEA_LINE_COMPARE_INT_EN (1<<21) #define PIPEA_HLINE_INT_EN (1<<20) #define PIPEA_VBLANK_INT_EN (1<<19) #define SPRITEB_FLIPDONE_INT_EN (1<<18) @@ -2887,12 +3039,19 @@ __FBSDID("$FreeBSD$"); #define DISPPLANE_GAMMA_ENABLE (1<<30) #define DISPPLANE_GAMMA_DISABLE 0 #define DISPPLANE_PIXFORMAT_MASK (0xf<<26) +#define DISPPLANE_YUV422 (0x0<<26) #define DISPPLANE_8BPP (0x2<<26) -#define DISPPLANE_15_16BPP (0x4<<26) -#define DISPPLANE_16BPP (0x5<<26) -#define DISPPLANE_32BPP_NO_ALPHA (0x6<<26) -#define DISPPLANE_32BPP (0x7<<26) -#define DISPPLANE_32BPP_30BIT_NO_ALPHA (0xa<<26) +#define DISPPLANE_BGRA555 (0x3<<26) +#define DISPPLANE_BGRX555 (0x4<<26) +#define DISPPLANE_BGRX565 (0x5<<26) +#define DISPPLANE_BGRX888 (0x6<<26) +#define DISPPLANE_BGRA888 (0x7<<26) +#define DISPPLANE_RGBX101010 (0x8<<26) +#define DISPPLANE_RGBA101010 (0x9<<26) +#define DISPPLANE_BGRX101010 (0xa<<26) +#define DISPPLANE_RGBX161616 (0xc<<26) +#define DISPPLANE_RGBX888 (0xe<<26) +#define DISPPLANE_RGBA888 (0xf<<26) #define DISPPLANE_STEREO_ENABLE (1<<25) #define DISPPLANE_STEREO_DISABLE 0 #define DISPPLANE_SEL_PIPE_SHIFT 24 @@ -2913,6 +3072,8 @@ __FBSDID("$FreeBSD$"); #define _DSPASIZE 0x70190 #define _DSPASURF 0x7019C /* 965+ only */ #define _DSPATILEOFF 0x701A4 /* 965+ only */ +#define _DSPAOFFSET 0x701A4 /* HSW */ +#define _DSPASURFLIVE 0x701AC #define DSPCNTR(plane) _PIPE(plane, _DSPACNTR, _DSPBCNTR) #define DSPADDR(plane) _PIPE(plane, _DSPAADDR, _DSPBADDR) @@ -2921,13 +3082,16 @@ __FBSDID("$FreeBSD$"); #define DSPSIZE(plane) _PIPE(plane, _DSPASIZE, _DSPBSIZE) #define DSPSURF(plane) _PIPE(plane, _DSPASURF, _DSPBSURF) #define DSPTILEOFF(plane) _PIPE(plane, _DSPATILEOFF, _DSPBTILEOFF) +#define DSPLINOFF(plane) DSPADDR(plane) +#define DSPOFFSET(plane) _PIPE(plane, _DSPAOFFSET, _DSPBOFFSET) +#define DSPSURFLIVE(plane) _PIPE(plane, _DSPASURFLIVE, _DSPBSURFLIVE) /* Display/Sprite base address macros */ #define DISP_BASEADDR_MASK (0xfffff000) #define I915_LO_DISPBASE(val) (val & ~DISP_BASEADDR_MASK) #define I915_HI_DISPBASE(val) (val & DISP_BASEADDR_MASK) #define I915_MODIFY_DISPBASE(reg, gfx_addr) \ - (I915_WRITE(reg, gfx_addr | I915_LO_DISPBASE(I915_READ(reg)))) + (I915_WRITE((reg), (gfx_addr) | I915_LO_DISPBASE(I915_READ(reg)))) /* VBIOS flags */ #define SWF00 0x71410 @@ -2966,6 +3130,8 @@ __FBSDID("$FreeBSD$"); #define _DSPBSIZE 0x71190 #define _DSPBSURF 0x7119C #define _DSPBTILEOFF 0x711A4 +#define _DSPBOFFSET 0x711A4 +#define _DSPBSURFLIVE 0x711AC /* Sprite A control */ #define _DVSACNTR 0x72180 @@ -3031,6 +3197,7 @@ __FBSDID("$FreeBSD$"); #define DVSTILEOFF(pipe) _PIPE(pipe, _DVSATILEOFF, _DVSBTILEOFF) #define DVSKEYVAL(pipe) _PIPE(pipe, _DVSAKEYVAL, _DVSBKEYVAL) #define DVSKEYMSK(pipe) _PIPE(pipe, _DVSAKEYMSK, _DVSBKEYMSK) +#define DVSSURFLIVE(pipe) _PIPE(pipe, _DVSASURFLIVE, _DVSBSURFLIVE) #define _SPRA_CTL 0x70280 #define SPRITE_ENABLE (1<<31) @@ -3065,6 +3232,8 @@ __FBSDID("$FreeBSD$"); #define _SPRA_SURF 0x7029c #define _SPRA_KEYMAX 0x702a0 #define _SPRA_TILEOFF 0x702a4 +#define _SPRA_OFFSET 0x702a4 +#define _SPRA_SURFLIVE 0x702ac #define _SPRA_SCALE 0x70304 #define SPRITE_SCALE_ENABLE (1<<31) #define SPRITE_FILTER_MASK (3<<29) @@ -3085,6 +3254,8 @@ __FBSDID("$FreeBSD$"); #define _SPRB_SURF 0x7129c #define _SPRB_KEYMAX 0x712a0 #define _SPRB_TILEOFF 0x712a4 +#define _SPRB_OFFSET 0x712a4 +#define _SPRB_SURFLIVE 0x712ac #define _SPRB_SCALE 0x71304 #define _SPRB_GAMC 0x71400 @@ -3098,8 +3269,10 @@ __FBSDID("$FreeBSD$"); #define SPRSURF(pipe) _PIPE(pipe, _SPRA_SURF, _SPRB_SURF) #define SPRKEYMAX(pipe) _PIPE(pipe, _SPRA_KEYMAX, _SPRB_KEYMAX) #define SPRTILEOFF(pipe) _PIPE(pipe, _SPRA_TILEOFF, _SPRB_TILEOFF) +#define SPROFFSET(pipe) _PIPE(pipe, _SPRA_OFFSET, _SPRB_OFFSET) #define SPRSCALE(pipe) _PIPE(pipe, _SPRA_SCALE, _SPRB_SCALE) #define SPRGAMC(pipe) _PIPE(pipe, _SPRA_GAMC, _SPRB_GAMC) +#define SPRSURFLIVE(pipe) _PIPE(pipe, _SPRA_SURFLIVE, _SPRB_SURFLIVE) /* VBIOS regs */ #define VGACNTRL 0x71400 @@ -3189,20 +3362,22 @@ __FBSDID("$FreeBSD$"); #define _PIPEB_LINK_M2 0x61048 #define _PIPEB_LINK_N2 0x6104c -#define PIPE_DATA_M1(pipe) _PIPE(pipe, _PIPEA_DATA_M1, _PIPEB_DATA_M1) -#define PIPE_DATA_N1(pipe) _PIPE(pipe, _PIPEA_DATA_N1, _PIPEB_DATA_N1) -#define PIPE_DATA_M2(pipe) _PIPE(pipe, _PIPEA_DATA_M2, _PIPEB_DATA_M2) -#define PIPE_DATA_N2(pipe) _PIPE(pipe, _PIPEA_DATA_N2, _PIPEB_DATA_N2) -#define PIPE_LINK_M1(pipe) _PIPE(pipe, _PIPEA_LINK_M1, _PIPEB_LINK_M1) -#define PIPE_LINK_N1(pipe) _PIPE(pipe, _PIPEA_LINK_N1, _PIPEB_LINK_N1) -#define PIPE_LINK_M2(pipe) _PIPE(pipe, _PIPEA_LINK_M2, _PIPEB_LINK_M2) -#define PIPE_LINK_N2(pipe) _PIPE(pipe, _PIPEA_LINK_N2, _PIPEB_LINK_N2) +#define PIPE_DATA_M1(tran) _TRANSCODER(tran, _PIPEA_DATA_M1, _PIPEB_DATA_M1) +#define PIPE_DATA_N1(tran) _TRANSCODER(tran, _PIPEA_DATA_N1, _PIPEB_DATA_N1) +#define PIPE_DATA_M2(tran) _TRANSCODER(tran, _PIPEA_DATA_M2, _PIPEB_DATA_M2) +#define PIPE_DATA_N2(tran) _TRANSCODER(tran, _PIPEA_DATA_N2, _PIPEB_DATA_N2) +#define PIPE_LINK_M1(tran) _TRANSCODER(tran, _PIPEA_LINK_M1, _PIPEB_LINK_M1) +#define PIPE_LINK_N1(tran) _TRANSCODER(tran, _PIPEA_LINK_N1, _PIPEB_LINK_N1) +#define PIPE_LINK_M2(tran) _TRANSCODER(tran, _PIPEA_LINK_M2, _PIPEB_LINK_M2) +#define PIPE_LINK_N2(tran) _TRANSCODER(tran, _PIPEA_LINK_N2, _PIPEB_LINK_N2) /* CPU panel fitter */ /* IVB+ has 3 fitters, 0 is 7x5 capable, the other two only 3x3 */ #define _PFA_CTL_1 0x68080 #define _PFB_CTL_1 0x68880 #define PF_ENABLE (1<<31) +#define PF_PIPE_SEL_MASK_IVB (3<<29) +#define PF_PIPE_SEL_IVB(pipe) ((pipe)<<29) #define PF_FILTER_MASK (3<<23) #define PF_FILTER_PROGRAMMED (0<<23) #define PF_FILTER_MED_3x3 (1<<23) @@ -3321,6 +3496,13 @@ __FBSDID("$FreeBSD$"); #define ILK_DPFC_DIS1 (1<<8) #define ILK_DPFC_DIS2 (1<<9) +#define ILK_DSPCLK_GATE_D 0x42020 +#define ILK_VRHUNIT_CLOCK_GATE_DISABLE (1 << 28) +#define ILK_DPFCUNIT_CLOCK_GATE_DISABLE (1 << 9) +#define ILK_DPFCRUNIT_CLOCK_GATE_DISABLE (1 << 8) +#define ILK_DPFDUNIT_CLOCK_GATE_ENABLE (1 << 7) +#define ILK_DPARBUNIT_CLOCK_GATE_ENABLE (1 << 5) + #define IVB_CHICKEN3 0x4200c # define CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE (1 << 5) # define CHICKEN3_DGMG_DONE_FIX_DISABLE (1 << 2) @@ -3335,17 +3517,24 @@ __FBSDID("$FreeBSD$"); #define GEN7_L3CNTLREG1 0xB01C #define GEN7_WA_FOR_GEN7_L3_CONTROL 0x3C4FFF8C +#define GEN7_L3AGDIS (1<<19) #define GEN7_L3_CHICKEN_MODE_REGISTER 0xB030 #define GEN7_WA_L3_CHICKEN_MODE 0x20000000 +#define GEN7_L3SQCREG4 0xb034 +#define L3SQ_URB_READ_CAM_MATCH_DISABLE (1<<27) + /* WaCatErrorRejectionIssue */ #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG 0x9030 #define GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB (1<<11) +#define HSW_FUSE_STRAP 0x42014 +#define HSW_CDCLK_LIMIT (1 << 24) + /* PCH */ -/* south display engine interrupt */ +/* south display engine interrupt: IBX */ #define SDE_AUDIO_POWER_D (1 << 27) #define SDE_AUDIO_POWER_C (1 << 26) #define SDE_AUDIO_POWER_B (1 << 25) @@ -3381,15 +3570,44 @@ __FBSDID("$FreeBSD$"); #define SDE_TRANSA_CRC_ERR (1 << 1) #define SDE_TRANSA_FIFO_UNDER (1 << 0) #define SDE_TRANS_MASK (0x3f) -/* CPT */ -#define SDE_CRT_HOTPLUG_CPT (1 << 19) + +/* south display engine interrupt: CPT/PPT */ +#define SDE_AUDIO_POWER_D_CPT (1 << 31) +#define SDE_AUDIO_POWER_C_CPT (1 << 30) +#define SDE_AUDIO_POWER_B_CPT (1 << 29) +#define SDE_AUDIO_POWER_SHIFT_CPT 29 +#define SDE_AUDIO_POWER_MASK_CPT (7 << 29) +#define SDE_AUXD_CPT (1 << 27) +#define SDE_AUXC_CPT (1 << 26) +#define SDE_AUXB_CPT (1 << 25) +#define SDE_AUX_MASK_CPT (7 << 25) #define SDE_PORTD_HOTPLUG_CPT (1 << 23) #define SDE_PORTC_HOTPLUG_CPT (1 << 22) #define SDE_PORTB_HOTPLUG_CPT (1 << 21) +#define SDE_CRT_HOTPLUG_CPT (1 << 19) #define SDE_HOTPLUG_MASK_CPT (SDE_CRT_HOTPLUG_CPT | \ SDE_PORTD_HOTPLUG_CPT | \ SDE_PORTC_HOTPLUG_CPT | \ SDE_PORTB_HOTPLUG_CPT) +#define SDE_GMBUS_CPT (1 << 17) +#define SDE_AUDIO_CP_REQ_C_CPT (1 << 10) +#define SDE_AUDIO_CP_CHG_C_CPT (1 << 9) +#define SDE_FDI_RXC_CPT (1 << 8) +#define SDE_AUDIO_CP_REQ_B_CPT (1 << 6) +#define SDE_AUDIO_CP_CHG_B_CPT (1 << 5) +#define SDE_FDI_RXB_CPT (1 << 4) +#define SDE_AUDIO_CP_REQ_A_CPT (1 << 2) +#define SDE_AUDIO_CP_CHG_A_CPT (1 << 1) +#define SDE_FDI_RXA_CPT (1 << 0) +#define SDE_AUDIO_CP_REQ_CPT (SDE_AUDIO_CP_REQ_C_CPT | \ + SDE_AUDIO_CP_REQ_B_CPT | \ + SDE_AUDIO_CP_REQ_A_CPT) +#define SDE_AUDIO_CP_CHG_CPT (SDE_AUDIO_CP_CHG_C_CPT | \ + SDE_AUDIO_CP_CHG_B_CPT | \ + SDE_AUDIO_CP_CHG_A_CPT) +#define SDE_FDI_MASK_CPT (SDE_FDI_RXC_CPT | \ + SDE_FDI_RXB_CPT | \ + SDE_FDI_RXA_CPT) #define SDEISR 0xc4000 #define SDEIMR 0xc4004 @@ -3654,18 +3872,27 @@ __FBSDID("$FreeBSD$"); #define TRANS_6BPC (2<<5) #define TRANS_12BPC (3<<5) -#define _TRANSA_CHICKEN2 0xf0064 -#define _TRANSB_CHICKEN2 0xf1064 -#define TRANS_CHICKEN2(pipe) _PIPE(pipe, _TRANSA_CHICKEN2, _TRANSB_CHICKEN2) +#define _TRANSA_CHICKEN1 0xf0060 +#define _TRANSB_CHICKEN1 0xf1060 +#define TRANS_CHICKEN1(pipe) _PIPE(pipe, _TRANSA_CHICKEN1, _TRANSB_CHICKEN1) +#define TRANS_CHICKEN1_DP0UNIT_GC_DISABLE (1<<4) +#define _TRANSA_CHICKEN2 0xf0064 +#define _TRANSB_CHICKEN2 0xf1064 +#define TRANS_CHICKEN2(pipe) _PIPE(pipe, _TRANSA_CHICKEN2, _TRANSB_CHICKEN2) #define TRANS_AUTOTRAIN_GEN_STALL_DIS (1<<31) +#define TRANS_CHICKEN2_TIMING_OVERRIDE (1<<31) +#define TRANS_CHICKEN2_FDI_POLARITY_REVERSED (1<<29) #define SOUTH_CHICKEN1 0xc2000 #define FDIA_PHASE_SYNC_SHIFT_OVR 19 #define FDIA_PHASE_SYNC_SHIFT_EN 18 -#define FDI_PHASE_SYNC_OVR(pipe) (1<<(FDIA_PHASE_SYNC_SHIFT_OVR - ((pipe) * 2))) -#define FDI_PHASE_SYNC_EN(pipe) (1<<(FDIA_PHASE_SYNC_SHIFT_EN - ((pipe) * 2))) +#define FDI_PHASE_SYNC_OVR(pipe) (1<<(FDIA_PHASE_SYNC_SHIFT_OVR - ((pipe) * 2))) +#define FDI_PHASE_SYNC_EN(pipe) (1<<(FDIA_PHASE_SYNC_SHIFT_EN - ((pipe) * 2))) +#define FDI_BC_BIFURCATION_SELECT (1 << 12) #define SOUTH_CHICKEN2 0xc2004 -#define DPLS_EDP_PPS_FIX_DIS (1<<0) +#define FDI_MPHY_IOSFSB_RESET_STATUS (1<<13) +#define FDI_MPHY_IOSFSB_RESET_CTL (1<<12) +#define DPLS_EDP_PPS_FIX_DIS (1<<0) #define _FDI_RXA_CHICKEN 0xc200c #define _FDI_RXB_CHICKEN 0xc2010 @@ -3675,6 +3902,7 @@ __FBSDID("$FreeBSD$"); #define SOUTH_DSPCLK_GATE_D 0xc2020 #define PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29) +#define PCH_LP_PARTITION_LEVEL_DISABLE (1<<12) /* CPU: FDI_TX */ #define _FDI_TXA_CTL 0x60100 @@ -3726,20 +3954,22 @@ __FBSDID("$FreeBSD$"); #define FDI_LINK_TRAIN_AUTO (1<<10) #define FDI_SCRAMBLING_ENABLE (0<<7) #define FDI_SCRAMBLING_DISABLE (1<<7) + /* FDI_RX, FDI_X is hard-wired to Transcoder_X */ #define _FDI_RXA_CTL 0xf000c #define _FDI_RXB_CTL 0xf100c #define FDI_RX_CTL(pipe) _PIPE(pipe, _FDI_RXA_CTL, _FDI_RXB_CTL) #define FDI_RX_ENABLE (1<<31) /* train, dp width same as FDI_TX */ -#define FDI_FS_ERRC_ENABLE (1<<27) -#define FDI_FE_ERRC_ENABLE (1<<26) +#define FDI_FS_ERRC_ENABLE (1<<27) +#define FDI_FE_ERRC_ENABLE (1<<26) #define FDI_DP_PORT_WIDTH_X8 (7<<19) +#define FDI_RX_POLARITY_REVERSED_LPT (1<<16) #define FDI_8BPC (0<<16) #define FDI_10BPC (1<<16) #define FDI_6BPC (2<<16) #define FDI_12BPC (3<<16) -#define FDI_LINK_REVERSE_OVERWRITE (1<<15) +#define FDI_RX_LINK_REVERSAL_OVERRIDE (1<<15) #define FDI_DMI_LINK_REVERSE_MASK (1<<14) #define FDI_RX_PLL_ENABLE (1<<13) #define FDI_FS_ERR_CORRECT_ENABLE (1<<11) @@ -3759,13 +3989,21 @@ __FBSDID("$FreeBSD$"); #define FDI_PORT_WIDTH_2X_LPT (1<<19) #define FDI_PORT_WIDTH_1X_LPT (0<<19) -#define _FDI_RXA_MISC 0xf0010 -#define _FDI_RXB_MISC 0xf1010 +#define _FDI_RXA_MISC 0xf0010 +#define _FDI_RXB_MISC 0xf1010 +#define FDI_RX_PWRDN_LANE1_MASK (3<<26) +#define FDI_RX_PWRDN_LANE1_VAL(x) ((x)<<26) +#define FDI_RX_PWRDN_LANE0_MASK (3<<24) +#define FDI_RX_PWRDN_LANE0_VAL(x) ((x)<<24) +#define FDI_RX_TP1_TO_TP2_48 (2<<20) +#define FDI_RX_TP1_TO_TP2_64 (3<<20) +#define FDI_RX_FDI_DELAY_90 (0x90<<0) +#define FDI_RX_MISC(pipe) _PIPE(pipe, _FDI_RXA_MISC, _FDI_RXB_MISC) + #define _FDI_RXA_TUSIZE1 0xf0030 #define _FDI_RXA_TUSIZE2 0xf0038 #define _FDI_RXB_TUSIZE1 0xf1030 #define _FDI_RXB_TUSIZE2 0xf1038 -#define FDI_RX_MISC(pipe) _PIPE(pipe, _FDI_RXA_MISC, _FDI_RXB_MISC) #define FDI_RX_TUSIZE1(pipe) _PIPE(pipe, _FDI_RXA_TUSIZE1, _FDI_RXB_TUSIZE1) #define FDI_RX_TUSIZE2(pipe) _PIPE(pipe, _FDI_RXA_TUSIZE2, _FDI_RXB_TUSIZE2) @@ -3849,6 +4087,19 @@ __FBSDID("$FreeBSD$"); #define PCH_LVDS 0xe1180 #define LVDS_DETECTED (1 << 1) +/* vlv has 2 sets of panel control regs. */ +#define PIPEA_PP_STATUS 0x61200 +#define PIPEA_PP_CONTROL 0x61204 +#define PIPEA_PP_ON_DELAYS 0x61208 +#define PIPEA_PP_OFF_DELAYS 0x6120c +#define PIPEA_PP_DIVISOR 0x61210 + +#define PIPEB_PP_STATUS 0x61300 +#define PIPEB_PP_CONTROL 0x61304 +#define PIPEB_PP_ON_DELAYS 0x61308 +#define PIPEB_PP_OFF_DELAYS 0x6130c +#define PIPEB_PP_DIVISOR 0x61310 + #define BLC_PWM_CPU_CTL2 0x48250 #define PWM_ENABLE (1 << 31) #define PWM_PIPE_A (0 << 29) @@ -3886,6 +4137,11 @@ __FBSDID("$FreeBSD$"); #define PANEL_LIGHT_ON_DELAY_SHIFT 0 #define PCH_PP_OFF_DELAYS 0xc720c +#define PANEL_POWER_PORT_SELECT_MASK (0x3 << 30) +#define PANEL_POWER_PORT_LVDS (0 << 30) +#define PANEL_POWER_PORT_DP_A (1 << 30) +#define PANEL_POWER_PORT_DP_C (2 << 30) +#define PANEL_POWER_PORT_DP_D (3 << 30) #define PANEL_POWER_DOWN_DELAY_MASK (0x1fff0000) #define PANEL_POWER_DOWN_DELAY_SHIFT 16 #define PANEL_LIGHT_OFF_DELAY_MASK (0x1fff) @@ -3927,11 +4183,13 @@ __FBSDID("$FreeBSD$"); #define PORT_TRANS_C_SEL_CPT (2<<29) #define PORT_TRANS_SEL_MASK (3<<29) #define PORT_TRANS_SEL_CPT(pipe) ((pipe) << 29) +#define PORT_TO_PIPE(val) (((val) & (1<<30)) >> 30) +#define PORT_TO_PIPE_CPT(val) (((val) & PORT_TRANS_SEL_MASK) >> 29) #define TRANS_DP_CTL_A 0xe0300 #define TRANS_DP_CTL_B 0xe1300 #define TRANS_DP_CTL_C 0xe2300 -#define TRANS_DP_CTL(pipe) (TRANS_DP_CTL_A + (pipe) * 0x01000) +#define TRANS_DP_CTL(pipe) _PIPE(pipe, TRANS_DP_CTL_A, TRANS_DP_CTL_B) #define TRANS_DP_OUTPUT_ENABLE (1<<31) #define TRANS_DP_PORT_SEL_B (0<<29) #define TRANS_DP_PORT_SEL_C (1<<29) @@ -3986,8 +4244,11 @@ __FBSDID("$FreeBSD$"); #define FORCEWAKE 0xA18C #define FORCEWAKE_VLV 0x1300b0 #define FORCEWAKE_ACK_VLV 0x1300b4 +#define FORCEWAKE_ACK_HSW 0x130044 #define FORCEWAKE_ACK 0x130090 #define FORCEWAKE_MT 0xa188 /* multi-threaded */ +#define FORCEWAKE_KERNEL 0x1 +#define FORCEWAKE_USER 0x2 #define FORCEWAKE_MT_ACK 0x130040 #define ECOBUS 0xa180 #define FORCEWAKE_MT_ENABLE (1<<5) @@ -4006,10 +4267,15 @@ __FBSDID("$FreeBSD$"); # define GEN6_CSUNIT_CLOCK_GATE_DISABLE (1 << 7) #define GEN6_UCGCTL2 0x9404 +# define GEN7_VDSUNIT_CLOCK_GATE_DISABLE (1 << 30) +# define GEN7_TDLUNIT_CLOCK_GATE_DISABLE (1 << 22) # define GEN6_RCZUNIT_CLOCK_GATE_DISABLE (1 << 13) # define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12) # define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11) +#define GEN7_UCGCTL4 0x940c +#define GEN7_L3BANK2X_CLOCK_GATE_DISABLE (1<<25) + #define GEN6_RPNSWREQ 0xA008 #define GEN6_TURBO_DISABLE (1<<31) #define GEN6_FREQUENCY(x) ((x)<<25) @@ -4028,7 +4294,9 @@ __FBSDID("$FreeBSD$"); #define GEN6_RP_INTERRUPT_LIMITS 0xA014 #define GEN6_RPSTAT1 0xA01C #define GEN6_CAGF_SHIFT 8 +#define HSW_CAGF_SHIFT 7 #define GEN6_CAGF_MASK (0x7f << GEN6_CAGF_SHIFT) +#define HSW_CAGF_MASK (0x7f << HSW_CAGF_SHIFT) #define GEN6_RP_CONTROL 0xA024 #define GEN6_RP_MEDIA_TURBO (1<<11) #define GEN6_RP_MEDIA_MODE_MASK (3<<9) @@ -4041,6 +4309,7 @@ __FBSDID("$FreeBSD$"); #define GEN6_RP_UP_IDLE_MIN (0x1<<3) #define GEN6_RP_UP_BUSY_AVG (0x2<<3) #define GEN6_RP_UP_BUSY_CONT (0x4<<3) +#define GEN7_RP_DOWN_IDLE_AVG (0x2<<0) #define GEN6_RP_DOWN_IDLE_CONT (0x1<<0) #define GEN6_RP_UP_THRESHOLD 0xA02C #define GEN6_RP_DOWN_THRESHOLD 0xA030 @@ -4080,7 +4349,7 @@ __FBSDID("$FreeBSD$"); #define GEN6_PM_RP_DOWN_THRESHOLD (1<<4) #define GEN6_PM_RP_UP_EI_EXPIRED (1<<2) #define GEN6_PM_RP_DOWN_EI_EXPIRED (1<<1) -#define GEN6_PM_DEFERRED_EVENTS (GEN6_PM_RP_UP_THRESHOLD | \ +#define GEN6_PM_DEFERRED_EVENTS (GEN6_PM_RP_UP_THRESHOLD | \ GEN6_PM_RP_DOWN_THRESHOLD | \ GEN6_PM_RP_DOWN_TIMEOUT) @@ -4094,6 +4363,10 @@ __FBSDID("$FreeBSD$"); #define GEN6_READ_OC_PARAMS 0xc #define GEN6_PCODE_WRITE_MIN_FREQ_TABLE 0x8 #define GEN6_PCODE_READ_MIN_FREQ_TABLE 0x9 +#define GEN6_PCODE_WRITE_RC6VIDS 0x4 +#define GEN6_PCODE_READ_RC6VIDS 0x5 +#define GEN6_ENCODE_RC6_VID(mv) (((mv) - 245) / 5) +#define GEN6_DECODE_RC6_VID(vids) (((vids) * 5) + 245) #define GEN6_PCODE_DATA 0x138128 #define GEN6_PCODE_FREQ_IA_RATIO_SHIFT 8 @@ -4105,6 +4378,35 @@ __FBSDID("$FreeBSD$"); #define GEN6_RC6 3 #define GEN6_RC7 4 +#define GEN7_MISCCPCTL (0x9424) +#define GEN7_DOP_CLOCK_GATE_ENABLE (1<<0) + +/* IVYBRIDGE DPF */ +#define GEN7_L3CDERRST1 0xB008 /* L3CD Error Status 1 */ +#define GEN7_L3CDERRST1_ROW_MASK (0x7ff<<14) +#define GEN7_PARITY_ERROR_VALID (1<<13) +#define GEN7_L3CDERRST1_BANK_MASK (3<<11) +#define GEN7_L3CDERRST1_SUBBANK_MASK (7<<8) +#define GEN7_PARITY_ERROR_ROW(reg) \ + ((reg & GEN7_L3CDERRST1_ROW_MASK) >> 14) +#define GEN7_PARITY_ERROR_BANK(reg) \ + ((reg & GEN7_L3CDERRST1_BANK_MASK) >> 11) +#define GEN7_PARITY_ERROR_SUBBANK(reg) \ + ((reg & GEN7_L3CDERRST1_SUBBANK_MASK) >> 8) +#define GEN7_L3CDERRST1_ENABLE (1<<7) + +#define GEN7_L3LOG_BASE 0xB070 +#define GEN7_L3LOG_SIZE 0x80 + +#define GEN7_HALF_SLICE_CHICKEN1 0xe100 /* IVB GT1 + VLV */ +#define GEN7_HALF_SLICE_CHICKEN1_GT2 0xf100 +#define GEN7_MAX_PS_THREAD_DEP (8<<12) +#define GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE (1<<3) + +#define GEN7_ROW_CHICKEN2 0xe4f4 +#define GEN7_ROW_CHICKEN2_GT2 0xf4f4 +#define DOP_CLOCK_GATING_DISABLE (1<<0) + #define G4X_AUD_VID_DID 0x62020 #define INTEL_AUDIO_DEVCL 0x808629FB #define INTEL_AUDIO_DEVBLC 0x80862801 @@ -4118,7 +4420,15 @@ __FBSDID("$FreeBSD$"); #define G4X_HDMIW_HDMIEDID 0x6210C #define IBX_HDMIW_HDMIEDID_A 0xE2050 +#define IBX_HDMIW_HDMIEDID_B 0xE2150 +#define IBX_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \ + IBX_HDMIW_HDMIEDID_A, \ + IBX_HDMIW_HDMIEDID_B) #define IBX_AUD_CNTL_ST_A 0xE20B4 +#define IBX_AUD_CNTL_ST_B 0xE21B4 +#define IBX_AUD_CNTL_ST(pipe) _PIPE(pipe, \ + IBX_AUD_CNTL_ST_A, \ + IBX_AUD_CNTL_ST_B) #define IBX_ELD_BUFFER_SIZE (0x1f << 10) #define IBX_ELD_ADDRESS (0x1f << 5) #define IBX_ELD_ACK (1 << 4) @@ -4127,7 +4437,15 @@ __FBSDID("$FreeBSD$"); #define IBX_CP_READYB (1 << 1) #define CPT_HDMIW_HDMIEDID_A 0xE5050 +#define CPT_HDMIW_HDMIEDID_B 0xE5150 +#define CPT_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \ + CPT_HDMIW_HDMIEDID_A, \ + CPT_HDMIW_HDMIEDID_B) #define CPT_AUD_CNTL_ST_A 0xE50B4 +#define CPT_AUD_CNTL_ST_B 0xE51B4 +#define CPT_AUD_CNTL_ST(pipe) _PIPE(pipe, \ + CPT_AUD_CNTL_ST_A, \ + CPT_AUD_CNTL_ST_B) #define CPT_AUD_CNTRL_ST2 0xE50C0 /* These are the 4 32-bit write offset registers for each stream @@ -4137,7 +4455,15 @@ __FBSDID("$FreeBSD$"); #define GEN7_SO_WRITE_OFFSET(n) (0x5280 + (n) * 4) #define IBX_AUD_CONFIG_A 0xe2000 +#define IBX_AUD_CONFIG_B 0xe2100 +#define IBX_AUD_CFG(pipe) _PIPE(pipe, \ + IBX_AUD_CONFIG_A, \ + IBX_AUD_CONFIG_B) #define CPT_AUD_CONFIG_A 0xe5000 +#define CPT_AUD_CONFIG_B 0xe5100 +#define CPT_AUD_CFG(pipe) _PIPE(pipe, \ + CPT_AUD_CONFIG_A, \ + CPT_AUD_CONFIG_B) #define AUD_CONFIG_N_VALUE_INDEX (1 << 29) #define AUD_CONFIG_N_PROG_ENABLE (1 << 28) #define AUD_CONFIG_UPPER_N_SHIFT 20 @@ -4148,164 +4474,232 @@ __FBSDID("$FreeBSD$"); #define AUD_CONFIG_PIXEL_CLOCK_HDMI (0xf << 16) #define AUD_CONFIG_DISABLE_NCTS (1 << 3) +/* HSW Audio */ +#define HSW_AUD_CONFIG_A 0x65000 /* Audio Configuration Transcoder A */ +#define HSW_AUD_CONFIG_B 0x65100 /* Audio Configuration Transcoder B */ +#define HSW_AUD_CFG(pipe) _PIPE(pipe, \ + HSW_AUD_CONFIG_A, \ + HSW_AUD_CONFIG_B) + +#define HSW_AUD_MISC_CTRL_A 0x65010 /* Audio Misc Control Convert 1 */ +#define HSW_AUD_MISC_CTRL_B 0x65110 /* Audio Misc Control Convert 2 */ +#define HSW_AUD_MISC_CTRL(pipe) _PIPE(pipe, \ + HSW_AUD_MISC_CTRL_A, \ + HSW_AUD_MISC_CTRL_B) + +#define HSW_AUD_DIP_ELD_CTRL_ST_A 0x650b4 /* Audio DIP and ELD Control State Transcoder A */ +#define HSW_AUD_DIP_ELD_CTRL_ST_B 0x651b4 /* Audio DIP and ELD Control State Transcoder B */ +#define HSW_AUD_DIP_ELD_CTRL(pipe) _PIPE(pipe, \ + HSW_AUD_DIP_ELD_CTRL_ST_A, \ + HSW_AUD_DIP_ELD_CTRL_ST_B) + +/* Audio Digital Converter */ +#define HSW_AUD_DIG_CNVT_1 0x65080 /* Audio Converter 1 */ +#define HSW_AUD_DIG_CNVT_2 0x65180 /* Audio Converter 1 */ +#define AUD_DIG_CNVT(pipe) _PIPE(pipe, \ + HSW_AUD_DIG_CNVT_1, \ + HSW_AUD_DIG_CNVT_2) +#define DIP_PORT_SEL_MASK 0x3 + +#define HSW_AUD_EDID_DATA_A 0x65050 +#define HSW_AUD_EDID_DATA_B 0x65150 +#define HSW_AUD_EDID_DATA(pipe) _PIPE(pipe, \ + HSW_AUD_EDID_DATA_A, \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Aug 26 21:31:05 2015 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 10A569C2D63; Wed, 26 Aug 2015 21:31:05 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 DC25918BA; Wed, 26 Aug 2015 21:31:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QLV4wb066626; Wed, 26 Aug 2015 21:31:04 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QLV4IP066625; Wed, 26 Aug 2015 21:31:04 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508262131.t7QLV4IP066625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 26 Aug 2015 21:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287172 - head/sys/dev/drm2 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.20 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, 26 Aug 2015 21:31:05 -0000 Author: bapt Date: Wed Aug 26 21:31:04 2015 New Revision: 287172 URL: https://svnweb.freebsd.org/changeset/base/287172 Log: Add more DRM_* debug macros from linux 3.8.13 Modified: head/sys/dev/drm2/drmP.h Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Wed Aug 26 21:17:48 2015 (r287171) +++ head/sys/dev/drm2/drmP.h Wed Aug 26 21:31:04 2015 (r287172) @@ -204,18 +204,43 @@ struct drm_device; __func__ , ##__VA_ARGS__); \ } while (0) -#define DRM_DEBUG_KMS(fmt, ...) do { \ +#define DRM_DEBUG_DRIVER(fmt, ...) do { \ if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ printf("[" DRM_NAME ":KMS:pid%d:%s] " fmt, DRM_CURRENTPID,\ __func__ , ##__VA_ARGS__); \ } while (0) -#define DRM_DEBUG_DRIVER(fmt, ...) do { \ +#define DRM_DEBUG_KMS(fmt, ...) do { \ if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ printf("[" DRM_NAME ":KMS:pid%d:%s] " fmt, DRM_CURRENTPID,\ __func__ , ##__VA_ARGS__); \ } while (0) +#define DRM_LOG(fmt, args...) do { \ + if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ + printf("[" DRM_NAME "]:pid%d:%s]" fmt, DRM_CURRENTPID,\ + __func__ , ##__VA_ARGS__); \ +} while (0) + +#define DRM_LOG_KMS(fmt, args...) do { \ + if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ + printf("[" DRM_NAME "]:KMS:pid%d:%s]" fmt, DRM_CURRENTPID,\ + __func__ , ##__VA_ARGS__); \ +} while (0) + +#define DRM_LOG_MODE(fmt, args...) do { \ + if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ + printf("[" DRM_NAME "]:pid%d:%s]" fmt, DRM_CURRENTPID,\ + __func__ , ##__VA_ARGS__); \ +} while (0) + +#define DRM_LOG_DRIVER(fmt, args...) do { \ + if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ + printf("[" DRM_NAME "]:KMS:pid%d:%s]" fmt, DRM_CURRENTPID,\ + __func__ , ##__VA_ARGS__); \ +} while (0) + + /*@}*/ /***********************************************************************/ From owner-svn-src-head@freebsd.org Wed Aug 26 21:33:44 2015 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 CC3159C2E72; Wed, 26 Aug 2015 21:33:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 B0E661CCC; Wed, 26 Aug 2015 21:33:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QLXibe067559; Wed, 26 Aug 2015 21:33:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QLXiU6067558; Wed, 26 Aug 2015 21:33:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508262133.t7QLXiU6067558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 26 Aug 2015 21:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287173 - head/sys/dev/drm2/i915 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.20 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, 26 Aug 2015 21:33:44 -0000 Author: bapt Date: Wed Aug 26 21:33:43 2015 New Revision: 287173 URL: https://svnweb.freebsd.org/changeset/base/287173 Log: Reduce diff with linux 3.8.13 on i915_drv.c While here update the list of devices id to match the one in linux 3.8.13 Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D3489 Modified: head/sys/dev/drm2/i915/i915_drv.c Modified: head/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- head/sys/dev/drm2/i915/i915_drv.c Wed Aug 26 21:31:04 2015 (r287172) +++ head/sys/dev/drm2/i915/i915_drv.c Wed Aug 26 21:33:43 2015 (r287173) @@ -47,6 +47,11 @@ static drm_pci_id_list_t i915_pciidlist[ i915_PCI_IDS }; +#define INTEL_VGA_DEVICE(id, info_) { \ + .device = id, \ + .info = info_, \ +} + static const struct intel_device_info intel_i830_info = { .gen = 2, .is_mobile = 1, .cursor_needs_physical = 1, .has_overlay = 1, .overlay_needs_physical = 1, @@ -181,7 +186,6 @@ static const struct intel_device_info in .has_pch_split = 1, }; -#if 0 static const struct intel_device_info intel_valleyview_m_info = { .gen = 7, .is_mobile = 1, .need_gfx_hws = 1, .has_hotplug = 1, @@ -199,7 +203,6 @@ static const struct intel_device_info in .has_blt_ring = 1, .is_valleyview = 1, }; -#endif static const struct intel_device_info intel_haswell_d_info = { .is_haswell = 1, .gen = 7, @@ -221,42 +224,37 @@ static const struct intel_device_info in .not_supported = 1, }; -#define INTEL_VGA_DEVICE(id, info_) { \ - .device = id, \ - .info = info_, \ -} - static const struct intel_gfx_device_id { int device; const struct intel_device_info *info; -} pciidlist[] = { /* aka */ - INTEL_VGA_DEVICE(0x3577, &intel_i830_info), - INTEL_VGA_DEVICE(0x2562, &intel_845g_info), - INTEL_VGA_DEVICE(0x3582, &intel_i85x_info), +} pciidlist[] = { /* aka */ + INTEL_VGA_DEVICE(0x3577, &intel_i830_info), /* I830_M */ + INTEL_VGA_DEVICE(0x2562, &intel_845g_info), /* 845_G */ + INTEL_VGA_DEVICE(0x3582, &intel_i85x_info), /* I855_GM */ INTEL_VGA_DEVICE(0x358e, &intel_i85x_info), - INTEL_VGA_DEVICE(0x2572, &intel_i865g_info), - INTEL_VGA_DEVICE(0x2582, &intel_i915g_info), - INTEL_VGA_DEVICE(0x258a, &intel_i915g_info), - INTEL_VGA_DEVICE(0x2592, &intel_i915gm_info), - INTEL_VGA_DEVICE(0x2772, &intel_i945g_info), - INTEL_VGA_DEVICE(0x27a2, &intel_i945gm_info), - INTEL_VGA_DEVICE(0x27ae, &intel_i945gm_info), - INTEL_VGA_DEVICE(0x2972, &intel_i965g_info), - INTEL_VGA_DEVICE(0x2982, &intel_i965g_info), - INTEL_VGA_DEVICE(0x2992, &intel_i965g_info), - INTEL_VGA_DEVICE(0x29a2, &intel_i965g_info), - INTEL_VGA_DEVICE(0x29b2, &intel_g33_info), - INTEL_VGA_DEVICE(0x29c2, &intel_g33_info), - INTEL_VGA_DEVICE(0x29d2, &intel_g33_info), - INTEL_VGA_DEVICE(0x2a02, &intel_i965gm_info), - INTEL_VGA_DEVICE(0x2a12, &intel_i965gm_info), - INTEL_VGA_DEVICE(0x2a42, &intel_gm45_info), - INTEL_VGA_DEVICE(0x2e02, &intel_g45_info), - INTEL_VGA_DEVICE(0x2e12, &intel_g45_info), - INTEL_VGA_DEVICE(0x2e22, &intel_g45_info), - INTEL_VGA_DEVICE(0x2e32, &intel_g45_info), - INTEL_VGA_DEVICE(0x2e42, &intel_g45_info), - INTEL_VGA_DEVICE(0x2e92, &intel_g45_info), + INTEL_VGA_DEVICE(0x2572, &intel_i865g_info), /* I865_G */ + INTEL_VGA_DEVICE(0x2582, &intel_i915g_info), /* I915_G */ + INTEL_VGA_DEVICE(0x258a, &intel_i915g_info), /* E7221_G */ + INTEL_VGA_DEVICE(0x2592, &intel_i915gm_info), /* I915_GM */ + INTEL_VGA_DEVICE(0x2772, &intel_i945g_info), /* I945_G */ + INTEL_VGA_DEVICE(0x27a2, &intel_i945gm_info), /* I945_GM */ + INTEL_VGA_DEVICE(0x27ae, &intel_i945gm_info), /* I945_GME */ + INTEL_VGA_DEVICE(0x2972, &intel_i965g_info), /* I946_GZ */ + INTEL_VGA_DEVICE(0x2982, &intel_i965g_info), /* G35_G */ + INTEL_VGA_DEVICE(0x2992, &intel_i965g_info), /* I965_Q */ + INTEL_VGA_DEVICE(0x29a2, &intel_i965g_info), /* I965_G */ + INTEL_VGA_DEVICE(0x29b2, &intel_g33_info), /* Q35_G */ + INTEL_VGA_DEVICE(0x29c2, &intel_g33_info), /* G33_G */ + INTEL_VGA_DEVICE(0x29d2, &intel_g33_info), /* Q33_G */ + INTEL_VGA_DEVICE(0x2a02, &intel_i965gm_info), /* I965_GM */ + INTEL_VGA_DEVICE(0x2a12, &intel_i965gm_info), /* I965_GME */ + INTEL_VGA_DEVICE(0x2a42, &intel_gm45_info), /* GM45_G */ + INTEL_VGA_DEVICE(0x2e02, &intel_g45_info), /* IGD_E_G */ + INTEL_VGA_DEVICE(0x2e12, &intel_g45_info), /* Q45_G */ + INTEL_VGA_DEVICE(0x2e22, &intel_g45_info), /* G45_G */ + INTEL_VGA_DEVICE(0x2e32, &intel_g45_info), /* G41_G */ + INTEL_VGA_DEVICE(0x2e42, &intel_g45_info), /* B43_G */ + INTEL_VGA_DEVICE(0x2e92, &intel_g45_info), /* B43_G.1 */ INTEL_VGA_DEVICE(0xa001, &intel_pineview_info), INTEL_VGA_DEVICE(0xa011, &intel_pineview_info), INTEL_VGA_DEVICE(0x0042, &intel_ironlake_d_info), @@ -276,11 +274,43 @@ static const struct intel_gfx_device_id INTEL_VGA_DEVICE(0x016a, &intel_ivybridge_d_info), /* GT2 server */ INTEL_VGA_DEVICE(0x0402, &intel_haswell_d_info), /* GT1 desktop */ INTEL_VGA_DEVICE(0x0412, &intel_haswell_d_info), /* GT2 desktop */ + INTEL_VGA_DEVICE(0x0422, &intel_haswell_d_info), /* GT2 desktop */ INTEL_VGA_DEVICE(0x040a, &intel_haswell_d_info), /* GT1 server */ INTEL_VGA_DEVICE(0x041a, &intel_haswell_d_info), /* GT2 server */ + INTEL_VGA_DEVICE(0x042a, &intel_haswell_d_info), /* GT2 server */ INTEL_VGA_DEVICE(0x0406, &intel_haswell_m_info), /* GT1 mobile */ INTEL_VGA_DEVICE(0x0416, &intel_haswell_m_info), /* GT2 mobile */ - INTEL_VGA_DEVICE(0x0c16, &intel_haswell_d_info), /* SDV */ + INTEL_VGA_DEVICE(0x0426, &intel_haswell_m_info), /* GT2 mobile */ + INTEL_VGA_DEVICE(0x0C02, &intel_haswell_d_info), /* SDV GT1 desktop */ + INTEL_VGA_DEVICE(0x0C12, &intel_haswell_d_info), /* SDV GT2 desktop */ + INTEL_VGA_DEVICE(0x0C22, &intel_haswell_d_info), /* SDV GT2 desktop */ + INTEL_VGA_DEVICE(0x0C0A, &intel_haswell_d_info), /* SDV GT1 server */ + INTEL_VGA_DEVICE(0x0C1A, &intel_haswell_d_info), /* SDV GT2 server */ + INTEL_VGA_DEVICE(0x0C2A, &intel_haswell_d_info), /* SDV GT2 server */ + INTEL_VGA_DEVICE(0x0C06, &intel_haswell_m_info), /* SDV GT1 mobile */ + INTEL_VGA_DEVICE(0x0C16, &intel_haswell_m_info), /* SDV GT2 mobile */ + INTEL_VGA_DEVICE(0x0C26, &intel_haswell_m_info), /* SDV GT2 mobile */ + INTEL_VGA_DEVICE(0x0A02, &intel_haswell_d_info), /* ULT GT1 desktop */ + INTEL_VGA_DEVICE(0x0A12, &intel_haswell_d_info), /* ULT GT2 desktop */ + INTEL_VGA_DEVICE(0x0A22, &intel_haswell_d_info), /* ULT GT2 desktop */ + INTEL_VGA_DEVICE(0x0A0A, &intel_haswell_d_info), /* ULT GT1 server */ + INTEL_VGA_DEVICE(0x0A1A, &intel_haswell_d_info), /* ULT GT2 server */ + INTEL_VGA_DEVICE(0x0A2A, &intel_haswell_d_info), /* ULT GT2 server */ + INTEL_VGA_DEVICE(0x0A06, &intel_haswell_m_info), /* ULT GT1 mobile */ + INTEL_VGA_DEVICE(0x0A16, &intel_haswell_m_info), /* ULT GT2 mobile */ + INTEL_VGA_DEVICE(0x0A26, &intel_haswell_m_info), /* ULT GT2 mobile */ + INTEL_VGA_DEVICE(0x0D02, &intel_haswell_d_info), /* CRW GT1 desktop */ + INTEL_VGA_DEVICE(0x0D12, &intel_haswell_d_info), /* CRW GT2 desktop */ + INTEL_VGA_DEVICE(0x0D22, &intel_haswell_d_info), /* CRW GT2 desktop */ + INTEL_VGA_DEVICE(0x0D0A, &intel_haswell_d_info), /* CRW GT1 server */ + INTEL_VGA_DEVICE(0x0D1A, &intel_haswell_d_info), /* CRW GT2 server */ + INTEL_VGA_DEVICE(0x0D2A, &intel_haswell_d_info), /* CRW GT2 server */ + INTEL_VGA_DEVICE(0x0D06, &intel_haswell_m_info), /* CRW GT1 mobile */ + INTEL_VGA_DEVICE(0x0D16, &intel_haswell_m_info), /* CRW GT2 mobile */ + INTEL_VGA_DEVICE(0x0D26, &intel_haswell_m_info), /* CRW GT2 mobile */ + INTEL_VGA_DEVICE(0x0f30, &intel_valleyview_m_info), + INTEL_VGA_DEVICE(0x0157, &intel_valleyview_m_info), + INTEL_VGA_DEVICE(0x0155, &intel_valleyview_d_info), {0, 0} }; @@ -288,10 +318,8 @@ static int i915_enable_unsupported; static int i915_drm_freeze(struct drm_device *dev) { - struct drm_i915_private *dev_priv; - int error; + struct drm_i915_private *dev_priv = dev->dev_private; - dev_priv = dev->dev_private; drm_kms_helper_poll_disable(dev); #if 0 @@ -300,11 +328,11 @@ static int i915_drm_freeze(struct drm_de /* If KMS is active, we do the leavevt stuff here */ if (drm_core_check_feature(dev, DRIVER_MODESET)) { - error = i915_gem_idle(dev); + int error = i915_gem_idle(dev); if (error) { device_printf(dev->dev, - "GEM idle failed, resume might fail\n"); - return (error); + "GEM idle failed, resume might fail\n"); + return error; } drm_irq_uninstall(dev); } @@ -319,8 +347,7 @@ static int i915_drm_freeze(struct drm_de return 0; } -static int -i915_suspend(device_t kdev) +static int i915_suspend(device_t kdev) { struct drm_device *dev; int error; @@ -385,8 +412,7 @@ static int i915_drm_thaw(struct drm_devi return error; } -static int -i915_resume(device_t kdev) +static int i915_resume(device_t kdev) { struct drm_device *dev; int ret; @@ -725,8 +751,7 @@ void vlv_force_wake_put(struct drm_i915_ POSTING_READ(FORCEWAKE_VLV); } -static int -i8xx_do_reset(struct drm_device *dev) +static int i8xx_do_reset(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; int onems; @@ -761,8 +786,7 @@ i8xx_do_reset(struct drm_device *dev) return 0; } -static int -i965_reset_complete(struct drm_device *dev) +static int i965_reset_complete(struct drm_device *dev) { u8 gdrst; @@ -770,8 +794,7 @@ i965_reset_complete(struct drm_device *d return (gdrst & GRDOM_RESET_ENABLE) == 0; } -static int -i965_do_reset(struct drm_device *dev) +static int i965_do_reset(struct drm_device *dev) { int ret; u8 gdrst; @@ -793,18 +816,16 @@ i965_do_reset(struct drm_device *dev) gdrst = pci_read_config(dev->dev, I965_GDRST, 1); pci_write_config(dev->dev, I965_GDRST, gdrst | GRDOM_MEDIA | GRDOM_RESET_ENABLE, 1); - - return wait_for(i965_reset_complete(dev), 500); + + return wait_for(i965_reset_complete(dev), 500); } -static int -ironlake_do_reset(struct drm_device *dev) +static int ironlake_do_reset(struct drm_device *dev) { - struct drm_i915_private *dev_priv; + struct drm_i915_private *dev_priv = dev->dev_private; u32 gdrst; int ret; - dev_priv = dev->dev_private; gdrst = I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR); I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, gdrst | GRDOM_RENDER | GRDOM_RESET_ENABLE); @@ -816,16 +837,13 @@ ironlake_do_reset(struct drm_device *dev gdrst = I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR); I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, gdrst | GRDOM_MEDIA | GRDOM_RESET_ENABLE); - return wait_for(I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR) & 0x1, 500); + return wait_for(I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR) & 0x1, 500); } -static int -gen6_do_reset(struct drm_device *dev) +static int gen6_do_reset(struct drm_device *dev) { - struct drm_i915_private *dev_priv; - int ret; - - dev_priv = dev->dev_private; + struct drm_i915_private *dev_priv = dev->dev_private; + int ret; /* Hold gt_lock across reset to prevent any register access * with forcewake not set correctly @@ -858,8 +876,7 @@ gen6_do_reset(struct drm_device *dev) return (ret); } -int -intel_gpu_reset(struct drm_device *dev) +int intel_gpu_reset(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; int ret = -ENODEV; @@ -894,13 +911,28 @@ intel_gpu_reset(struct drm_device *dev) return ret; } +/** + * i915_reset - reset chip after a hang + * @dev: drm device to reset + * + * Reset the chip. Useful if a hang is detected. Returns zero on successful + * reset or otherwise an error code. + * + * Procedure is fairly simple: + * - reset the chip using the reset reg + * - re-init context state + * - re-init hardware status page + * - re-init ring buffer + * - re-init interrupt state + * - re-init display + */ int i915_reset(struct drm_device *dev) { drm_i915_private_t *dev_priv = dev->dev_private; int ret; if (!i915_try_reset) - return (0); + return 0; if (!sx_try_xlock(&dev->dev_struct_lock)) return (-EBUSY); @@ -919,11 +951,25 @@ int i915_reset(struct drm_device *dev) if (ret) { DRM_ERROR("Failed to reset chip.\n"); DRM_UNLOCK(dev); - return (ret); + return ret; } + /* Ok, now get things going again... */ + + /* + * Everything depends on having the GTT running, so we need to start + * there. Fortunately we don't need to do this unless we reset the + * chip at a PCI level. + * + * Next we need to restore the context, but we don't use those + * yet either... + * + * Ring buffer needs to be re-initialized in the KMS case, or if X + * was running at the time of the reset (i.e. we weren't VT + * switched away). + */ if (drm_core_check_feature(dev, DRIVER_MODESET) || - !dev_priv->mm.suspended) { + !dev_priv->mm.suspended) { struct intel_ring_buffer *ring; int i; @@ -937,6 +983,11 @@ int i915_reset(struct drm_device *dev) i915_gem_context_init(dev); i915_gem_init_ppgtt(dev); + /* + * It would make sense to re-init all the other hw state, at + * least the rps/rc6/emon init done within modeset_init_hw. For + * some unknown reason, this blows up my ilk, so don't. + */ DRM_UNLOCK(dev); if (drm_core_check_feature(dev, DRIVER_MODESET)) @@ -944,10 +995,11 @@ int i915_reset(struct drm_device *dev) drm_irq_uninstall(dev); drm_irq_install(dev); - } else + } else { DRM_UNLOCK(dev); + } - return (0); + return 0; } /* We give fast paths for the really cool registers */ From owner-svn-src-head@freebsd.org Wed Aug 26 21:35:18 2015 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 4A9B49C3010; Wed, 26 Aug 2015 21:35:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3ADDA1E3B; Wed, 26 Aug 2015 21:35:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QLZIat067681; Wed, 26 Aug 2015 21:35:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QLZGs7067675; Wed, 26 Aug 2015 21:35:16 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508262135.t7QLZGs7067675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 26 Aug 2015 21:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287174 - head/sys/dev/drm2/i915 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.20 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, 26 Aug 2015 21:35:18 -0000 Author: bapt Date: Wed Aug 26 21:35:16 2015 New Revision: 287174 URL: https://svnweb.freebsd.org/changeset/base/287174 Log: Reduce diff against linux 3.8 Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D3492 Modified: head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/i915/i915_gem_context.c head/sys/dev/drm2/i915/i915_gem_execbuffer.c head/sys/dev/drm2/i915/i915_gem_gtt.c head/sys/dev/drm2/i915/i915_gem_tiling.c Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Wed Aug 26 21:33:43 2015 (r287173) +++ head/sys/dev/drm2/i915/i915_gem.c Wed Aug 26 21:35:16 2015 (r287174) @@ -1,4 +1,4 @@ -/*- +/* * Copyright © 2008 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a @@ -203,11 +203,10 @@ int i915_mutex_lock_interruptible(struct return 0; } -static bool +static inline bool i915_gem_object_is_inactive(struct drm_i915_gem_object *obj) { - - return !obj->active; + return obj->gtt_space && !obj->active; } int @@ -1239,9 +1238,17 @@ i915_gem_set_domain_ioctl(struct drm_dev uint32_t write_domain = args->write_domain; int ret; - if ((write_domain & I915_GEM_GPU_DOMAINS) != 0 || - (read_domains & I915_GEM_GPU_DOMAINS) != 0 || - (write_domain != 0 && read_domains != write_domain)) + /* Only handle setting domains to types used by the CPU. */ + if (write_domain & I915_GEM_GPU_DOMAINS) + return -EINVAL; + + if (read_domains & I915_GEM_GPU_DOMAINS) + return -EINVAL; + + /* Having something in the write domain implies it's in the read + * domain, and only that read domain. Enforce that in the request. + */ + if (write_domain != 0 && read_domains != write_domain) return -EINVAL; ret = i915_mutex_lock_interruptible(dev); @@ -1686,13 +1693,11 @@ i915_gem_get_unfenced_gtt_alignment(stru uint32_t size, int tiling_mode) { - if (tiling_mode == I915_TILING_NONE) - return 4096; - /* * Minimum alignment is 4k (GTT page size) for sane hw. */ - if (INTEL_INFO(dev)->gen >= 4 || IS_G33(dev)) + if (INTEL_INFO(dev)->gen >= 4 || IS_G33(dev) || + tiling_mode == I915_TILING_NONE) return 4096; /* Previous hardware however needs to be aligned to a power-of-two @@ -3155,7 +3160,7 @@ i915_gem_object_set_to_gtt_domain(struct ret = i915_gem_object_flush_gpu_write_domain(obj); if (ret) - return (ret); + return ret; if (obj->pending_gpu_write || write) { ret = i915_gem_object_wait_rendering(obj); @@ -3366,6 +3371,12 @@ i915_gem_object_finish_gpu(struct drm_i9 return 0; } +/** + * Moves a single object to the CPU read, and possibly write domain. + * + * This function returns when the move is complete, including waiting on + * flushes to occur. + */ int i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj, bool write) { @@ -3644,7 +3655,6 @@ int i915_gem_throttle_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - return i915_gem_ring_throttle(dev, file_priv); } @@ -4101,6 +4111,10 @@ i915_gem_unload(struct drm_device *dev) EVENTHANDLER_DEREGISTER(vm_lowmem, dev_priv->mm.i915_lowmem); } +/* + * Create a physically contiguous memory object for this object + * e.g. for cursor + overlay regs + */ static int i915_gem_init_phys_object(struct drm_device *dev, int id, int size, int align) { Modified: head/sys/dev/drm2/i915/i915_gem_context.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_context.c Wed Aug 26 21:33:43 2015 (r287173) +++ head/sys/dev/drm2/i915/i915_gem_context.c Wed Aug 26 21:35:16 2015 (r287174) @@ -302,7 +302,7 @@ void i915_gem_context_fini(struct drm_de do_destroy(dev_priv->rings[RCS].default_context); } -static int context_idr_cleanup(uint32_t id, void *p, void *data) +static int context_idr_cleanup(int id, void *p, void *data) { struct i915_hw_context *ctx = p; Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_execbuffer.c Wed Aug 26 21:33:43 2015 (r287173) +++ head/sys/dev/drm2/i915/i915_gem_execbuffer.c Wed Aug 26 21:35:16 2015 (r287174) @@ -405,10 +405,7 @@ i915_gem_execbuffer_relocate_entry(struc if (ret) return ret; - /* - * Map the page containing the relocation we're going - * to perform. - */ + /* Map the page containing the relocation we're going to perform. */ reloc->offset += obj->gtt_offset; reloc_page = pmap_mapdev_attr(dev->agp->base + (reloc->offset & ~PAGE_MASK), PAGE_SIZE, PAT_WRITE_COMBINING); @@ -436,7 +433,7 @@ i915_gem_execbuffer_relocate_entry(struc static int i915_gem_execbuffer_relocate_object(struct drm_i915_gem_object *obj, - struct eb_objects *eb) + struct eb_objects *eb) { #define N_RELOC(x) ((x) / sizeof(struct drm_i915_gem_relocation_entry)) struct drm_i915_gem_relocation_entry stack_reloc[N_RELOC(512)]; @@ -459,7 +456,7 @@ i915_gem_execbuffer_relocate_object(stru do { u64 offset = r->presumed_offset; - + ret = i915_gem_execbuffer_relocate_entry(obj, eb, r); if (ret) return ret; @@ -475,13 +472,15 @@ i915_gem_execbuffer_relocate_object(stru r++; } while (--count); } + + return 0; #undef N_RELOC - return (0); } static int i915_gem_execbuffer_relocate_object_slow(struct drm_i915_gem_object *obj, - struct eb_objects *eb, struct drm_i915_gem_relocation_entry *relocs) + struct eb_objects *eb, + struct drm_i915_gem_relocation_entry *relocs) { const struct drm_i915_gem_exec_object2 *entry = obj->exec_entry; int i, ret; @@ -520,11 +519,12 @@ i915_gem_execbuffer_relocate(struct drm_ list_for_each_entry(obj, objects, exec_list) { ret = i915_gem_execbuffer_relocate_object(obj, eb); - if (ret != 0) + if (ret) break; } vm_fault_enable_pagefaults(pflags); - return (ret); + + return ret; } #define __EXEC_OBJECT_HAS_FENCE (1<<31) @@ -583,9 +583,9 @@ i915_gem_execbuffer_reserve(struct intel { drm_i915_private_t *dev_priv; struct drm_i915_gem_object *obj; - int ret, retry; - bool has_fenced_gpu_access = INTEL_INFO(ring->dev)->gen < 4; struct list_head ordered_objects; + bool has_fenced_gpu_access = INTEL_INFO(ring->dev)->gen < 4; + int ret, retry; dev_priv = ring->dev->dev_private; INIT_LIST_HEAD(&ordered_objects); @@ -619,12 +619,11 @@ i915_gem_execbuffer_reserve(struct intel * * 1a. Unbind all objects that do not match the GTT constraints for * the execbuffer (fenceable, mappable, alignment etc). - * 1b. Increment pin count for already bound objects and obtain - * a fence register if required. + * 1b. Increment pin count for already bound objects. * 2. Bind new objects. * 3. Decrement pin count. * - * This avoid unnecessary unbinding of later objects in order to makr + * This avoid unnecessary unbinding of later objects in order to make * room for the earlier objects *unless* we need to defragment. */ retry = 0; @@ -735,9 +734,12 @@ err: static int i915_gem_execbuffer_relocate_slow(struct drm_device *dev, - struct drm_file *file, struct intel_ring_buffer *ring, - struct list_head *objects, struct eb_objects *eb, - struct drm_i915_gem_exec_object2 *exec, int count) + struct drm_file *file, + struct intel_ring_buffer *ring, + struct list_head *objects, + struct eb_objects *eb, + struct drm_i915_gem_exec_object2 *exec, + int count) { struct drm_i915_gem_relocation_entry *reloc; struct drm_i915_gem_object *obj; @@ -812,7 +814,7 @@ i915_gem_execbuffer_relocate_slow(struct list_for_each_entry(obj, objects, exec_list) { int offset = obj->exec_entry - exec; ret = i915_gem_execbuffer_relocate_object_slow(obj, eb, - reloc + reloc_offset[offset]); + reloc + reloc_offset[offset]); if (ret) goto err; } @@ -1210,7 +1212,7 @@ i915_gem_do_execbuffer(struct drm_device if (args->num_cliprects != 0) { if (ring != &dev_priv->rings[RCS]) { - DRM_DEBUG("clip rectangles are only valid with the render ring\n"); + DRM_DEBUG("clip rectangles are only valid with the render ring\n"); ret = -EINVAL; goto pre_struct_lock_err; } @@ -1256,6 +1258,7 @@ i915_gem_do_execbuffer(struct drm_device INIT_LIST_HEAD(&objects); for (i = 0; i < args->buffer_count; i++) { struct drm_i915_gem_object *obj; + obj = to_intel_bo(drm_gem_object_lookup(dev, file, exec[i].handle)); if (&obj->base == NULL) { @@ -1294,7 +1297,9 @@ i915_gem_do_execbuffer(struct drm_device if (ret) { if (ret == -EFAULT) { ret = i915_gem_execbuffer_relocate_slow(dev, file, ring, - &objects, eb, exec, args->buffer_count); + &objects, eb, + exec, + args->buffer_count); DRM_LOCK_ASSERT(dev); } if (ret) @@ -1368,17 +1373,18 @@ i915_gem_do_execbuffer(struct drm_device if (cliprects) { for (i = 0; i < args->num_cliprects; i++) { ret = i915_emit_box_p(dev, &cliprects[i], - args->DR1, args->DR4); + args->DR1, args->DR4); if (ret) goto err; - ret = ring->dispatch_execbuffer(ring, exec_start, - exec_len); + ret = ring->dispatch_execbuffer(ring, + exec_start, exec_len); if (ret) goto err; } } else { - ret = ring->dispatch_execbuffer(ring, exec_start, exec_len); + ret = ring->dispatch_execbuffer(ring, + exec_start, exec_len); if (ret) goto err; } @@ -1391,8 +1397,9 @@ err: while (!list_empty(&objects)) { struct drm_i915_gem_object *obj; - obj = list_first_entry(&objects, struct drm_i915_gem_object, - exec_list); + obj = list_first_entry(&objects, + struct drm_i915_gem_object, + exec_list); list_del_init(&obj->exec_list); drm_gem_object_unreference(&obj->base); } @@ -1520,7 +1527,7 @@ i915_gem_execbuffer2(struct drm_device * DRM_DEBUG("copy %d exec entries failed %d\n", args->buffer_count, ret); free(exec2_list, DRM_I915_GEM); - return (ret); + return -EFAULT; } ret = i915_gem_do_execbuffer(dev, data, file, args, exec2_list); Modified: head/sys/dev/drm2/i915/i915_gem_gtt.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_gtt.c Wed Aug 26 21:33:43 2015 (r287173) +++ head/sys/dev/drm2/i915/i915_gem_gtt.c Wed Aug 26 21:35:16 2015 (r287174) @@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$"); #include /* PPGTT support for Sandybdrige/Gen6 and later */ -static void -i915_ppgtt_clear_range(struct i915_hw_ppgtt *ppgtt, - unsigned first_entry, unsigned num_entries) +static void i915_ppgtt_clear_range(struct i915_hw_ppgtt *ppgtt, + unsigned first_entry, + unsigned num_entries) { uint32_t *pt_vaddr; uint32_t scratch_pte; @@ -71,20 +71,17 @@ i915_ppgtt_clear_range(struct i915_hw_pp } -int -i915_gem_init_aliasing_ppgtt(struct drm_device *dev) +int i915_gem_init_aliasing_ppgtt(struct drm_device *dev) { - struct drm_i915_private *dev_priv; + struct drm_i915_private *dev_priv = dev->dev_private; struct i915_hw_ppgtt *ppgtt; - u_int first_pd_entry_in_global_pt, i; + unsigned first_pd_entry_in_global_pt; + int i; - dev_priv = dev->dev_private; - /* - * ppgtt PDEs reside in the global gtt pagetable, which has 512*1024 + /* ppgtt PDEs reside in the global gtt pagetable, which has 512*1024 * entries. For aliasing ppgtt support we just steal them at the end for - * now. - */ + * now. */ first_pd_entry_in_global_pt = 512 * 1024 - I915_PPGTT_PD_ENTRIES; ppgtt = malloc(sizeof(*ppgtt), DRM_I915_GEM, M_WAITOK | M_ZERO); @@ -152,9 +149,9 @@ i915_ppgtt_insert_pages(struct i915_hw_p } } -void -i915_ppgtt_bind_object(struct i915_hw_ppgtt *ppgtt, - struct drm_i915_gem_object *obj, enum i915_cache_level cache_level) +void i915_ppgtt_bind_object(struct i915_hw_ppgtt *ppgtt, + struct drm_i915_gem_object *obj, + enum i915_cache_level cache_level) { struct drm_device *dev; struct drm_i915_private *dev_priv; @@ -185,22 +182,23 @@ i915_ppgtt_bind_object(struct i915_hw_pp void i915_ppgtt_unbind_object(struct i915_hw_ppgtt *ppgtt, struct drm_i915_gem_object *obj) { - i915_ppgtt_clear_range(ppgtt, obj->gtt_space->start >> PAGE_SHIFT, - obj->base.size >> PAGE_SHIFT); + i915_ppgtt_clear_range(ppgtt, + obj->gtt_space->start >> PAGE_SHIFT, + obj->base.size >> PAGE_SHIFT); } void i915_gem_init_ppgtt(struct drm_device *dev) { - drm_i915_private_t *dev_priv; - struct i915_hw_ppgtt *ppgtt; - uint32_t pd_offset, pd_entry; - vm_paddr_t pt_addr; + drm_i915_private_t *dev_priv = dev->dev_private; + uint32_t pd_offset; struct intel_ring_buffer *ring; - u_int first_pd_entry_in_global_pt, i; + struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt; + u_int first_pd_entry_in_global_pt; + vm_paddr_t pt_addr; + uint32_t pd_entry; + int i; - dev_priv = dev->dev_private; - ppgtt = dev_priv->mm.aliasing_ppgtt; - if (ppgtt == NULL) + if (!dev_priv->mm.aliasing_ppgtt) return; first_pd_entry_in_global_pt = 512 * 1024 - I915_PPGTT_PD_ENTRIES; @@ -244,6 +242,28 @@ void i915_gem_init_ppgtt(struct drm_devi } } +static bool do_idling(struct drm_i915_private *dev_priv) +{ + bool ret = dev_priv->mm.interruptible; + + if (dev_priv->mm.gtt.do_idle_maps) { + dev_priv->mm.interruptible = false; + if (i915_gpu_idle(dev_priv->dev)) { + DRM_ERROR("Couldn't idle GPU\n"); + /* Wait a bit, in hopes it avoids the hang */ + DELAY(10); + } + } + + return ret; +} + +static void undo_idling(struct drm_i915_private *dev_priv, bool interruptible) +{ + if (dev_priv->mm.gtt.do_idle_maps) + dev_priv->mm.interruptible = interruptible; +} + void i915_gem_cleanup_aliasing_ppgtt(struct drm_device *dev) { @@ -293,42 +313,14 @@ cache_level_to_agp_type(struct drm_devic } } -static bool -do_idling(struct drm_i915_private *dev_priv) -{ - bool ret = dev_priv->mm.interruptible; - - if (dev_priv->mm.gtt.do_idle_maps) { - dev_priv->mm.interruptible = false; - if (i915_gpu_idle(dev_priv->dev)) { - DRM_ERROR("Couldn't idle GPU\n"); - /* Wait a bit, in hopes it avoids the hang */ - DELAY(10); - } - } - - return ret; -} - -static void -undo_idling(struct drm_i915_private *dev_priv, bool interruptible) -{ - - if (dev_priv->mm.gtt.do_idle_maps) - dev_priv->mm.interruptible = interruptible; -} - -void -i915_gem_restore_gtt_mappings(struct drm_device *dev) +void i915_gem_restore_gtt_mappings(struct drm_device *dev) { - struct drm_i915_private *dev_priv; + struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_gem_object *obj; - dev_priv = dev->dev_private; - /* First fill our portion of the GTT with scratch pages */ intel_gtt_clear_range(dev_priv->mm.gtt_start / PAGE_SIZE, - (dev_priv->mm.gtt_end - dev_priv->mm.gtt_start) / PAGE_SIZE); + (dev_priv->mm.gtt_end - dev_priv->mm.gtt_start) / PAGE_SIZE); list_for_each_entry(obj, &dev_priv->mm.gtt_list, gtt_list) { i915_gem_clflush_object(obj); @@ -338,11 +330,10 @@ i915_gem_restore_gtt_mappings(struct drm intel_gtt_chipset_flush(); } -int -i915_gem_gtt_prepare_object(struct drm_i915_gem_object *obj) +int i915_gem_gtt_prepare_object(struct drm_i915_gem_object *obj) { - return (0); + return 0; } void @@ -363,8 +354,7 @@ i915_gem_gtt_bind_object(struct drm_i915 obj->has_global_gtt_mapping = 1; } -void -i915_gem_gtt_unbind_object(struct drm_i915_gem_object *obj) +void i915_gem_gtt_unbind_object(struct drm_i915_gem_object *obj) { intel_gtt_clear_range(obj->gtt_space->start >> PAGE_SHIFT, @@ -373,24 +363,21 @@ i915_gem_gtt_unbind_object(struct drm_i9 obj->has_global_gtt_mapping = 0; } -void -i915_gem_gtt_finish_object(struct drm_i915_gem_object *obj) +void i915_gem_gtt_finish_object(struct drm_i915_gem_object *obj) { struct drm_device *dev = obj->base.dev; struct drm_i915_private *dev_priv = dev->dev_private; bool interruptible; - dev = obj->base.dev; - dev_priv = dev->dev_private; - interruptible = do_idling(dev_priv); undo_idling(dev_priv, interruptible); } -int -i915_gem_init_global_gtt(struct drm_device *dev, unsigned long start, - unsigned long mappable_end, unsigned long end) +int i915_gem_init_global_gtt(struct drm_device *dev, + unsigned long start, + unsigned long mappable_end, + unsigned long end) { drm_i915_private_t *dev_priv; unsigned long mappable; Modified: head/sys/dev/drm2/i915/i915_gem_tiling.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_tiling.c Wed Aug 26 21:33:43 2015 (r287173) +++ head/sys/dev/drm2/i915/i915_gem_tiling.c Wed Aug 26 21:35:16 2015 (r287174) @@ -209,7 +209,7 @@ i915_tiling_ok(struct drm_device *dev, i /* Linear is always fine */ if (tiling_mode == I915_TILING_NONE) - return (true); + return true; if (IS_GEN2(dev) || (tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev))) @@ -222,35 +222,35 @@ i915_tiling_ok(struct drm_device *dev, i /* i965 stores the end address of the gtt mapping in the fence * reg, so dont bother to check the size */ if (stride / 128 > I965_FENCE_MAX_PITCH_VAL) - return (false); + return false; } else { if (stride > 8192) - return (false); + return false; if (IS_GEN3(dev)) { if (size > I830_FENCE_MAX_SIZE_VAL << 20) - return (false); + return false; } else { if (size > I830_FENCE_MAX_SIZE_VAL << 19) - return (false); + return false; } } /* 965+ just needs multiples of tile width */ if (INTEL_INFO(dev)->gen >= 4) { if (stride & (tile_width - 1)) - return (false); - return (true); + return false; + return true; } /* Pre-965 needs power of two tile widths */ if (stride < tile_width) - return (false); + return false; if (stride & (stride - 1)) - return (false); + return false; - return (true); + return true; } /* Is the current GTT allocation valid for the change in tiling? */ @@ -260,17 +260,17 @@ i915_gem_object_fence_ok(struct drm_i915 u32 size; if (tiling_mode == I915_TILING_NONE) - return (true); + return true; if (INTEL_INFO(obj->base.dev)->gen >= 4) - return (true); + return true; if (INTEL_INFO(obj->base.dev)->gen == 3) { if (obj->gtt_offset & ~I915_FENCE_START_MASK) - return (false); + return false; } else { if (obj->gtt_offset & ~I830_FENCE_START_MASK) - return (false); + return false; } /* @@ -286,12 +286,12 @@ i915_gem_object_fence_ok(struct drm_i915 size <<= 1; if (obj->gtt_space->size != size) - return (false); + return false; if (obj->gtt_offset & (size - 1)) - return (false); + return false; - return (true); + return true; } /** @@ -305,9 +305,8 @@ i915_gem_set_tiling(struct drm_device *d struct drm_i915_gem_set_tiling *args = data; drm_i915_private_t *dev_priv = dev->dev_private; struct drm_i915_gem_object *obj; - int ret; + int ret = 0; - ret = 0; obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle)); if (&obj->base == NULL) return -ENOENT; @@ -370,15 +369,15 @@ i915_gem_set_tiling(struct drm_device *d obj->map_and_fenceable = obj->gtt_space == NULL || - (obj->gtt_offset + obj->base.size <= - dev_priv->mm.gtt_mappable_end && - i915_gem_object_fence_ok(obj, args->tiling_mode)); + (obj->gtt_offset + obj->base.size <= dev_priv->mm.gtt_mappable_end && + i915_gem_object_fence_ok(obj, args->tiling_mode)); /* Rebind if we need a change of alignment */ if (!obj->map_and_fenceable) { - uint32_t unfenced_alignment = - i915_gem_get_unfenced_gtt_alignment(dev, - obj->base.size, args->tiling_mode); + u32 unfenced_alignment = + i915_gem_get_unfenced_gtt_alignment(dev, + obj->base.size, + args->tiling_mode); if (obj->gtt_offset & (unfenced_alignment - 1)) ret = i915_gem_object_unbind(obj); } @@ -388,7 +387,6 @@ i915_gem_set_tiling(struct drm_device *d obj->fenced_gpu_access || obj->fence_reg != I915_FENCE_REG_NONE; - obj->tiling_mode = args->tiling_mode; obj->stride = args->stride; @@ -402,7 +400,7 @@ i915_gem_set_tiling(struct drm_device *d drm_gem_object_unreference(&obj->base); DRM_UNLOCK(dev); - return (ret); + return ret; } /** From owner-svn-src-head@freebsd.org Wed Aug 26 21:53:18 2015 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 4D3B59C3555; Wed, 26 Aug 2015 21:53:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 D5C019B2; Wed, 26 Aug 2015 21:53:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t7QLrBnD013212 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 27 Aug 2015 00:53:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t7QLrBnD013212 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t7QLrBll013211; Thu, 27 Aug 2015 00:53:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 27 Aug 2015 00:53:11 +0300 From: Konstantin Belousov To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287174 - head/sys/dev/drm2/i915 Message-ID: <20150826215311.GF2072@kib.kiev.ua> References: <201508262135.t7QLZGs7067675@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201508262135.t7QLZGs7067675@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 26 Aug 2015 21:53:18 -0000 On Wed, Aug 26, 2015 at 09:35:16PM +0000, Baptiste Daroussin wrote: > -static bool > +static inline bool > i915_gem_object_is_inactive(struct drm_i915_gem_object *obj) > { > - > - return !obj->active; > + return obj->gtt_space && !obj->active; Why is this correct ? From owner-svn-src-head@freebsd.org Wed Aug 26 22:00:41 2015 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 A90999C374D; Wed, 26 Aug 2015 22:00:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 9A310E64; Wed, 26 Aug 2015 22:00:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QM0fSx076525; Wed, 26 Aug 2015 22:00:41 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QM0fej076524; Wed, 26 Aug 2015 22:00:41 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508262200.t7QM0fej076524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 26 Aug 2015 22:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287175 - head/sys/dev/drm2/i915 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.20 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, 26 Aug 2015 22:00:41 -0000 Author: bapt Date: Wed Aug 26 22:00:40 2015 New Revision: 287175 URL: https://svnweb.freebsd.org/changeset/base/287175 Log: backout a change that should not have crept in Modified: head/sys/dev/drm2/i915/i915_gem_context.c Modified: head/sys/dev/drm2/i915/i915_gem_context.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_context.c Wed Aug 26 21:35:16 2015 (r287174) +++ head/sys/dev/drm2/i915/i915_gem_context.c Wed Aug 26 22:00:40 2015 (r287175) @@ -302,7 +302,7 @@ void i915_gem_context_fini(struct drm_de do_destroy(dev_priv->rings[RCS].default_context); } -static int context_idr_cleanup(int id, void *p, void *data) +static int context_idr_cleanup(uint32_t id, void *p, void *data) { struct i915_hw_context *ctx = p; From owner-svn-src-head@freebsd.org Wed Aug 26 22:07:34 2015 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 B4B8D9C3979; Wed, 26 Aug 2015 22:07:34 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::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 424E71E6; Wed, 26 Aug 2015 22:07:34 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wicne3 with SMTP id ne3so57573392wic.0; Wed, 26 Aug 2015 15:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=jC47RIqujXg52zFZk2oSGHah10U6OhlpiIrrp4uRw3M=; b=szw8OJvw1QOeVGWM4/56EchkFEVaQnNFGhWaeIsOveA0qOsQ2ng3lK/KVanApu/4vd o3FtbtUmXDusn+NP4WeqjjWpRbeOlBtcY421kTjAsWBQF8/lTxIUtXd0xvRcle1hl0gj mkbvE7KW6LZMR5WHbwJ2IYJs11qhs87AbEn9pbEN5A2X9kDdi7KOD6n1rCjIC6er/KIT GV40Dc9rc/ugndR6PmYHZ8qHWhOTbIDXwfS1y9o96XtQLOi30k15k+NyALgSw5bwtESd WVLG8iDyJXmDDolUMdfvsXkIwXawbdHvoJlOF4PxDr+E7O/vjf4l0JsSeH5IRF16CSjz 5PpQ== X-Received: by 10.180.231.40 with SMTP id td8mr6878416wic.9.1440626852762; Wed, 26 Aug 2015 15:07:32 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id bi6sm83737wjc.25.2015.08.26.15.07.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2015 15:07:32 -0700 (PDT) Sender: Baptiste Daroussin Date: Thu, 27 Aug 2015 00:07:30 +0200 From: Baptiste Daroussin To: Konstantin Belousov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r287174 - head/sys/dev/drm2/i915 Message-ID: <20150826220730.GQ93486@ivaldir.etoilebsd.net> References: <201508262135.t7QLZGs7067675@repo.freebsd.org> <20150826215311.GF2072@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HAv5+T9jbwMPl6Kw" Content-Disposition: inline In-Reply-To: <20150826215311.GF2072@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 26 Aug 2015 22:07:34 -0000 --HAv5+T9jbwMPl6Kw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 27, 2015 at 12:53:11AM +0300, Konstantin Belousov wrote: > On Wed, Aug 26, 2015 at 09:35:16PM +0000, Baptiste Daroussin wrote: > > -static bool > > +static inline bool > > i915_gem_object_is_inactive(struct drm_i915_gem_object *obj) > > { > > - > > - return !obj->active; > > + return obj->gtt_space && !obj->active; > Why is this correct ? Sorry this change is a mistake and was not supposed to be added with reduction of the diff. I'm backing it out for now. Best regards, Bapt --HAv5+T9jbwMPl6Kw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlXeOKIACgkQ8kTtMUmk6EzubQCfeMVF/gp0pTkZ5ATzL2eG9xB0 rAcAnREEOG+ArTIHyrvKrljveChbxmpm =V7hl -----END PGP SIGNATURE----- --HAv5+T9jbwMPl6Kw-- From owner-svn-src-head@freebsd.org Wed Aug 26 22:08:26 2015 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 A05D09C3A02; Wed, 26 Aug 2015 22:08:26 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (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 6808F37F; Wed, 26 Aug 2015 22:08:26 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from 141.7.19.93.rev.sfr.net ([93.19.7.141] helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZUiro-000DSO-I6; Thu, 27 Aug 2015 00:08:24 +0200 Subject: Re: svn commit: r287174 - head/sys/dev/drm2/i915 To: Konstantin Belousov , Baptiste Daroussin References: <201508262135.t7QLZGs7067675@repo.freebsd.org> <20150826215311.GF2072@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= X-Enigmail-Draft-Status: N1110 Message-ID: <55DE38D3.9000802@FreeBSD.org> Date: Thu, 27 Aug 2015 00:08:19 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150826215311.GF2072@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="JX8oBuanCh7H3WFBEfOSPOQuAmjTVFtmt" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 26 Aug 2015 22:08:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --JX8oBuanCh7H3WFBEfOSPOQuAmjTVFtmt Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 26.08.2015 23:53, Konstantin Belousov wrote: > On Wed, Aug 26, 2015 at 09:35:16PM +0000, Baptiste Daroussin wrote: >> -static bool >> +static inline bool >> i915_gem_object_is_inactive(struct drm_i915_gem_object *obj) >> { >> - >> - return !obj->active; >> + return obj->gtt_space && !obj->active; > > Why is this correct ? obj->gtt_space is NULL when the object is not mapped in the global GTT. This check was added in 6c085a728cf000ac1865d66f8c9b52935558b328 ("drm/i915: Track unbound pages"), first released in Linux 3.7. But now that I think of it again, it may not be correct with the current driver (and only correct in the context of a 3.8-era driver). Baptiste, could you please revert that part? --=20 Jean-S=E9bastien P=E9dron --JX8oBuanCh7H3WFBEfOSPOQuAmjTVFtmt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJV3jjYXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMWpUQAIDrMeaZpbm2sHif6Hos2rVE 2hIsVuNGyfq+SINnJgMLM2azhHy43iRpLmhpa9cNirWGQ2yqVmYnXsEsQib507ak D+SWkesp9Rq1Ov3FwMNLr1kFefkBpzsDNf/O986xXvnwn69i9/tScfwTvBNMjLGx lpAlIuW8GN848hO3R/zBk6XRlvNfa0hwC5A2xWv2oZBmLO1gYlhn8HHdpUSlv40U KGmTnbt3PaatCvxiXPXsE0oZNnqKQEUeLmfiPO2kaN5YxhNiVbRRvVhOyghFBlhU KpEbRPOtXDeS6V7PEGGgnX7eceOJOr6aW6jBFcWOUksexgUngZRQFbP7hLRXiDyS g64w7MJZFIVROJ3aX35TX3MYSRDq1FzXYWwJ0hGzaLIp86zCS+EQZ06m9y0C8xjU bW0ZCCBJ9VB7Wtuf6fh6Cd+KbWJ2bIWVNkJkYJPQvmUoSOeZHNnq1SRDBmiTD3BN B2k5r/dwILsi3VT0w0/C7sxOVfmTGUyDHvPTQbZsJedHoSgxqsgWW6aXglDbYCQV ZfFYjUluv8uNF7H6zO2iiLbvqyStIEhSlGbFXF24+2/3vWgip548xQcuHotezaal ALL5jKw3DMtDwFCy40Az1oV2OzESHbP9vH9NSdXBQP+ngySkZWRfUAZ54bF2VaVb s+XWyATdI6wUmgOzJ+9o =6eac -----END PGP SIGNATURE----- --JX8oBuanCh7H3WFBEfOSPOQuAmjTVFtmt-- From owner-svn-src-head@freebsd.org Wed Aug 26 22:09:13 2015 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 9C2A09C3A5D; Wed, 26 Aug 2015 22:09:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8D413762; Wed, 26 Aug 2015 22:09:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QM9DwN079992; Wed, 26 Aug 2015 22:09:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QM9DUo079991; Wed, 26 Aug 2015 22:09:13 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508262209.t7QM9DUo079991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 26 Aug 2015 22:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287176 - head/sys/dev/drm2/i915 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.20 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, 26 Aug 2015 22:09:13 -0000 Author: bapt Date: Wed Aug 26 22:09:12 2015 New Revision: 287176 URL: https://svnweb.freebsd.org/changeset/base/287176 Log: Back out a change which should not have been committed yet Modified: head/sys/dev/drm2/i915/i915_gem.c Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Wed Aug 26 22:00:40 2015 (r287175) +++ head/sys/dev/drm2/i915/i915_gem.c Wed Aug 26 22:09:12 2015 (r287176) @@ -206,7 +206,7 @@ int i915_mutex_lock_interruptible(struct static inline bool i915_gem_object_is_inactive(struct drm_i915_gem_object *obj) { - return obj->gtt_space && !obj->active; + return !obj->active; } int From owner-svn-src-head@freebsd.org Wed Aug 26 22:19:55 2015 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 5E0E69C3DC4; Wed, 26 Aug 2015 22:19:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4ED15C0F; Wed, 26 Aug 2015 22:19:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QMJtud084525; Wed, 26 Aug 2015 22:19:55 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QMJsB9084521; Wed, 26 Aug 2015 22:19:54 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508262219.t7QMJsB9084521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 26 Aug 2015 22:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287177 - head/sys/dev/drm2/i915 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.20 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, 26 Aug 2015 22:19:55 -0000 Author: bapt Date: Wed Aug 26 22:19:53 2015 New Revision: 287177 URL: https://svnweb.freebsd.org/changeset/base/287177 Log: Merge i915_emit_box_p and i915_emit_box as done in linux 3.8 Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D3495 Modified: head/sys/dev/drm2/i915/i915_dma.c head/sys/dev/drm2/i915/i915_drv.h head/sys/dev/drm2/i915/i915_gem_execbuffer.c Modified: head/sys/dev/drm2/i915/i915_dma.c ============================================================================== --- head/sys/dev/drm2/i915/i915_dma.c Wed Aug 26 22:09:12 2015 (r287176) +++ head/sys/dev/drm2/i915/i915_dma.c Wed Aug 26 22:19:53 2015 (r287177) @@ -410,21 +410,8 @@ static int i915_emit_cmds(struct drm_dev return 0; } -int i915_emit_box(struct drm_device * dev, - struct drm_clip_rect *boxes, - int i, int DR1, int DR4) -{ - struct drm_clip_rect box; - - if (DRM_COPY_FROM_USER_UNCHECKED(&box, &boxes[i], sizeof(box))) { - return -EFAULT; - } - - return (i915_emit_box_p(dev, &box, DR1, DR4)); -} - int -i915_emit_box_p(struct drm_device *dev, +i915_emit_box(struct drm_device *dev, struct drm_clip_rect *box, int DR1, int DR4) { @@ -506,8 +493,8 @@ static int i915_dispatch_cmdbuffer(struc for (i = 0; i < count; i++) { if (i < nbox) { - ret = i915_emit_box_p(dev, &cmd->cliprects[i], - cmd->DR1, cmd->DR4); + ret = i915_emit_box(dev, &cliprects[i], + cmd->DR1, cmd->DR4); if (ret) return ret; } @@ -542,8 +529,8 @@ static int i915_dispatch_batchbuffer(str count = nbox ? nbox : 1; for (i = 0; i < count; i++) { if (i < nbox) { - int ret = i915_emit_box_p(dev, &cliprects[i], - batch->DR1, batch->DR4); + ret = i915_emit_box(dev, &cliprects[i], + batch->DR1, batch->DR4); if (ret) return ret; } Modified: head/sys/dev/drm2/i915/i915_drv.h ============================================================================== --- head/sys/dev/drm2/i915/i915_drv.h Wed Aug 26 22:09:12 2015 (r287176) +++ head/sys/dev/drm2/i915/i915_drv.h Wed Aug 26 22:19:53 2015 (r287177) @@ -1120,11 +1120,8 @@ extern int i915_driver_device_is_agp(str extern long i915_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); extern int i915_emit_box(struct drm_device *dev, - struct drm_clip_rect __user *boxes, - int i, int DR1, int DR4); -int i915_emit_box_p(struct drm_device *dev, struct drm_clip_rect *box, - int DR1, int DR4); - + struct drm_clip_rect *box, + int DR1, int DR4); unsigned long i915_chipset_val(struct drm_i915_private *dev_priv); unsigned long i915_mch_val(struct drm_i915_private *dev_priv); void i915_update_gfx_val(struct drm_i915_private *dev_priv); Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_execbuffer.c Wed Aug 26 22:09:12 2015 (r287176) +++ head/sys/dev/drm2/i915/i915_gem_execbuffer.c Wed Aug 26 22:19:53 2015 (r287177) @@ -1372,7 +1372,7 @@ i915_gem_do_execbuffer(struct drm_device if (cliprects) { for (i = 0; i < args->num_cliprects; i++) { - ret = i915_emit_box_p(dev, &cliprects[i], + ret = i915_emit_box(dev, &cliprects[i], args->DR1, args->DR4); if (ret) goto err; From owner-svn-src-head@freebsd.org Wed Aug 26 22:50:54 2015 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 0CF1F9C39A8; Wed, 26 Aug 2015 22:50:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D8422DAE; Wed, 26 Aug 2015 22:50:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QMorJn097152; Wed, 26 Aug 2015 22:50:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QMorfm097151; Wed, 26 Aug 2015 22:50:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201508262250.t7QMorfm097151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 26 Aug 2015 22:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287178 - head/usr.bin/sockstat 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.20 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, 26 Aug 2015 22:50:54 -0000 Author: tuexen Date: Wed Aug 26 22:50:53 2015 New Revision: 287178 URL: https://svnweb.freebsd.org/changeset/base/287178 Log: Print the status on the first line of a socket description, not at the last one. This doesn't matter for TCP, but it does for the upcoming SCTP support. PR: 201585 MFC after: 3 weeks Modified: head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Wed Aug 26 22:19:53 2015 (r287177) +++ head/usr.bin/sockstat/sockstat.c Wed Aug 26 22:50:53 2015 (r287178) @@ -911,7 +911,7 @@ static void displaysock(struct sock *s, int pos) { void *p; - int hash; + int hash, first; struct addr *laddr, *faddr; struct sock *s_tmp; @@ -924,6 +924,7 @@ displaysock(struct sock *s, int pos) pos += xprintf("6 "); laddr = s->laddr; faddr = s->faddr; + first = 1; while (laddr != NULL || faddr != NULL) { while (pos < 36) pos += xprintf(" "); @@ -975,6 +976,14 @@ displaysock(struct sock *s, int pos) default: abort(); } + if (first && opt_s && s->proto == IPPROTO_TCP) { + while (pos < 80) + pos += xprintf(" "); + if (s->state >= 0 && s->state < TCP_NSTATES) + pos += xprintf("%s", tcpstates[s->state]); + else + pos += xprintf("?"); + } if (laddr != NULL) laddr = laddr->next; if (faddr != NULL) @@ -983,15 +992,9 @@ displaysock(struct sock *s, int pos) xprintf("\n"); pos = 0; } + first = 0; } - if (opt_s && s->proto == IPPROTO_TCP) { - while (pos < 80) - pos += xprintf(" "); - if (s->state >= 0 && s->state < TCP_NSTATES) - pos += xprintf("%s", tcpstates[s->state]); - else - pos += xprintf("?"); - } + xprintf("\n"); } static void @@ -1036,7 +1039,6 @@ display(void) pos += xprintf(" "); pos += xprintf("%d ", xf->xf_fd); displaysock(s, pos); - xprintf("\n"); } } if (opt_j >= 0) @@ -1051,7 +1053,6 @@ display(void) pos += xprintf("%-8s %-10s %-5s %-2s ", "?", "?", "?", "?"); displaysock(s, pos); - xprintf("\n"); } } } From owner-svn-src-head@freebsd.org Wed Aug 26 22:52:19 2015 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 1177E9C3AD1; Wed, 26 Aug 2015 22:52:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 02627FD2; Wed, 26 Aug 2015 22:52:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QMqIB8000999; Wed, 26 Aug 2015 22:52:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QMqIBV000998; Wed, 26 Aug 2015 22:52:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201508262252.t7QMqIBV000998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 26 Aug 2015 22:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287179 - head/usr.bin/sockstat 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.20 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, 26 Aug 2015 22:52:19 -0000 Author: tuexen Date: Wed Aug 26 22:52:18 2015 New Revision: 287179 URL: https://svnweb.freebsd.org/changeset/base/287179 Log: Remove a variable which is set but never used. PR: 201585 MFC after: 3 weeks Modified: head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Wed Aug 26 22:50:53 2015 (r287178) +++ head/usr.bin/sockstat/sockstat.c Wed Aug 26 22:52:18 2015 (r287179) @@ -542,9 +542,9 @@ gather_inet(int proto) const char *varname, *protoname; size_t len, bufsize; void *buf; - int hash, retry, state, vflag; + int hash, retry, vflag; - state = vflag = 0; + vflag = 0; if (opt_4) vflag |= INP_IPV4; if (opt_6) @@ -609,7 +609,6 @@ gather_inet(int proto) inp = &xtp->xt_inp; so = &xtp->xt_socket; protoname = xtp->xt_tp.t_flags & TF_TOE ? "toe" : "tcp"; - state = xtp->xt_tp.t_state; break; case IPPROTO_UDP: case IPPROTO_DIVERT: From owner-svn-src-head@freebsd.org Wed Aug 26 23:28:11 2015 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 4E1F29C3607; Wed, 26 Aug 2015 23:28:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3E5D9CA; Wed, 26 Aug 2015 23:28:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QNSBm9013895; Wed, 26 Aug 2015 23:28:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QNSBYE013894; Wed, 26 Aug 2015 23:28:11 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508262328.t7QNSBYE013894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 26 Aug 2015 23:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287181 - head/lib/libc/string 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.20 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, 26 Aug 2015 23:28:11 -0000 Author: delphij Date: Wed Aug 26 23:28:10 2015 New Revision: 287181 URL: https://svnweb.freebsd.org/changeset/base/287181 Log: Replace strndup with OpenBSD's implementation. MFC after: 2 weeks Modified: head/lib/libc/string/strndup.c Modified: head/lib/libc/string/strndup.c ============================================================================== --- head/lib/libc/string/strndup.c Wed Aug 26 22:59:58 2015 (r287180) +++ head/lib/libc/string/strndup.c Wed Aug 26 23:28:10 2015 (r287181) @@ -1,32 +1,19 @@ -/* $NetBSD: strndup.c,v 1.3 2007/01/14 23:41:24 cbiere Exp $ */ +/* $OpenBSD: strndup.c,v 1.1 2010/05/18 22:24:55 tedu Exp $ */ /* - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2010 Todd C. Miller * - * 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. - * 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. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include @@ -37,15 +24,17 @@ __FBSDID("$FreeBSD$"); #include char * -strndup(const char *str, size_t n) +strndup(const char *str, size_t maxlen) { - size_t len; char *copy; + size_t len; + + len = strnlen(str, maxlen); + copy = malloc(len + 1); + if (copy != NULL) { + (void)memcpy(copy, str, len); + copy[len] = '\0'; + } - len = strnlen(str, n); - if ((copy = malloc(len + 1)) == NULL) - return (NULL); - memcpy(copy, str, len); - copy[len] = '\0'; - return (copy); + return copy; } From owner-svn-src-head@freebsd.org Wed Aug 26 23:45:07 2015 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 1721B9C3CBB; Wed, 26 Aug 2015 23:45:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 07C4DD04; Wed, 26 Aug 2015 23:45:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QNj6Um021892; Wed, 26 Aug 2015 23:45:06 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QNj6EO021890; Wed, 26 Aug 2015 23:45:06 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201508262345.t7QNj6EO021890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 26 Aug 2015 23:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287182 - head/usr.bin/sockstat 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.20 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, 26 Aug 2015 23:45:07 -0000 Author: tuexen Date: Wed Aug 26 23:45:06 2015 New Revision: 287182 URL: https://svnweb.freebsd.org/changeset/base/287182 Log: Add SCTP support. PR: 201585 MFC after: 3 weeks Modified: head/usr.bin/sockstat/sockstat.1 head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.1 ============================================================================== --- head/usr.bin/sockstat/sockstat.1 Wed Aug 26 23:28:10 2015 (r287181) +++ head/usr.bin/sockstat/sockstat.1 Wed Aug 26 23:45:06 2015 (r287182) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2015 +.Dd August 27, 2015 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -85,7 +85,7 @@ as they are defined in .Xr protocols 5 . .It Fl s Display the protocol state, if applicable. -This is currently only implemented for TCP. +This is currently only implemented for SCTP and TCP. .It Fl u Show .Dv AF_LOCAL Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Wed Aug 26 23:28:10 2015 (r287181) +++ head/usr.bin/sockstat/sockstat.c Wed Aug 26 23:45:06 2015 (r287182) @@ -332,6 +332,12 @@ gather_sctp(void) sock->socket = xinpcb->socket; sock->proto = IPPROTO_SCTP; sock->protoname = "sctp"; + if (xinpcb->flags & SCTP_PCB_FLAGS_UNBOUND) + sock->state = SCTP_CLOSED; + else if (xinpcb->maxqlen == 0) + sock->state = SCTP_BOUND; + else + sock->state = SCTP_LISTEN; if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) { sock->family = AF_INET6; sock->vflag = INP_IPV6; @@ -421,6 +427,7 @@ gather_sctp(void) sock->socket = xinpcb->socket; sock->proto = IPPROTO_SCTP; sock->protoname = "sctp"; + sock->state = (int)xstcb->state; if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) { sock->family = AF_INET6; sock->vflag = INP_IPV6; @@ -906,6 +913,46 @@ check_ports(struct sock *s) return (0); } +static const char * +sctp_state(int state) +{ + switch (state) { + case SCTP_CLOSED: + return "CLOSED"; + break; + case SCTP_BOUND: + return "BOUND"; + break; + case SCTP_LISTEN: + return "LISTEN"; + break; + case SCTP_COOKIE_WAIT: + return "COOKIE_WAIT"; + break; + case SCTP_COOKIE_ECHOED: + return "COOKIE_ECHOED"; + break; + case SCTP_ESTABLISHED: + return "ESTABLISHED"; + break; + case SCTP_SHUTDOWN_SENT: + return "SHUTDOWN_SENT"; + break; + case SCTP_SHUTDOWN_RECEIVED: + return "SHUTDOWN_RECEIVED"; + break; + case SCTP_SHUTDOWN_ACK_SENT: + return "SHUTDOWN_ACK_SENT"; + break; + case SCTP_SHUTDOWN_PENDING: + return "SHUTDOWN_PENDING"; + break; + default: + return "UNKNOWN"; + break; + } +} + static void displaysock(struct sock *s, int pos) { @@ -975,13 +1022,22 @@ displaysock(struct sock *s, int pos) default: abort(); } - if (first && opt_s && s->proto == IPPROTO_TCP) { + if (first && opt_s && + (s->proto == IPPROTO_SCTP || s->proto == IPPROTO_TCP)) { while (pos < 80) pos += xprintf(" "); - if (s->state >= 0 && s->state < TCP_NSTATES) - pos += xprintf("%s", tcpstates[s->state]); - else - pos += xprintf("?"); + switch (s->proto) { + case IPPROTO_SCTP: + pos += xprintf("%s", sctp_state(s->state)); + break; + case IPPROTO_TCP: + if (s->state >= 0 && s->state < TCP_NSTATES) + pos += + xprintf("%s", tcpstates[s->state]); + else + pos += xprintf("?"); + break; + } } if (laddr != NULL) laddr = laddr->next; From owner-svn-src-head@freebsd.org Wed Aug 26 23:58:04 2015 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 307929C32CB; Wed, 26 Aug 2015 23:58:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 216DA622; Wed, 26 Aug 2015 23:58:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7QNw4Pq026177; Wed, 26 Aug 2015 23:58:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7QNw3kX026176; Wed, 26 Aug 2015 23:58:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508262358.t7QNw3kX026176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 26 Aug 2015 23:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287183 - 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.20 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, 26 Aug 2015 23:58:04 -0000 Author: imp Date: Wed Aug 26 23:58:03 2015 New Revision: 287183 URL: https://svnweb.freebsd.org/changeset/base/287183 Log: When the kernel is compiled with INVARIANTS, export that as debug.invariants. Differential Revision: https://reviews.freebsd.org/D3488 MFC after: 3 days Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Wed Aug 26 23:45:06 2015 (r287182) +++ head/sys/kern/init_main.c Wed Aug 26 23:58:03 2015 (r287183) @@ -117,6 +117,15 @@ int bootverbose = BOOTVERBOSE; SYSCTL_INT(_debug, OID_AUTO, bootverbose, CTLFLAG_RW, &bootverbose, 0, "Control the output of verbose kernel messages"); +/* Want to avoid defining INVARIANTS if not already defined */ +#ifdef INVARIANTS +static int invariants = 1; +#else +static int invariants = 0; +#endif +SYSCTL_INT(_debug, OID_AUTO, invariants, CTLFLAG_RD, &invariants, 0, + "Kernel compiled with invariants"); + /* * This ensures that there is at least one entry so that the sysinit_set * symbol is not undefined. A sybsystem ID of SI_SUB_DUMMY is never From owner-svn-src-head@freebsd.org Thu Aug 27 00:24:11 2015 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 F22AD9C3ACB; Thu, 27 Aug 2015 00:24:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 393BA10B9; Thu, 27 Aug 2015 00:24:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 54FB025D387C; Thu, 27 Aug 2015 00:24:02 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 8E203C770AB; Thu, 27 Aug 2015 00:24:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Rl6w3SrK655m; Thu, 27 Aug 2015 00:24:00 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:3ce0:e321:a7ff:4040] (unknown [IPv6:fde9:577b:c1a9:4410:3ce0:e321:a7ff:4040]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 20617C77037; Thu, 27 Aug 2015 00:24:00 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r287174 - head/sys/dev/drm2/i915 From: "Bjoern A. Zeeb" In-Reply-To: <201508262135.t7QLZGs7067675@repo.freebsd.org> Date: Thu, 27 Aug 2015 00:23:41 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3BBAA5F5-D6D2-48E0-9C28-1D12520BA7C7@FreeBSD.org> References: <201508262135.t7QLZGs7067675@repo.freebsd.org> To: Baptiste Daroussin X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 27 Aug 2015 00:24:12 -0000 > On 26 Aug 2015, at 21:35 , Baptiste Daroussin = wrote: >=20 > Author: bapt > Date: Wed Aug 26 21:35:16 2015 > New Revision: 287174 > URL: https://svnweb.freebsd.org/changeset/base/287174 >=20 > Log: > Reduce diff against linux 3.8 >=20 > Reviewed by: dumbbell > Differential Revision: https://reviews.freebsd.org/D3492 >=20 > Modified: > head/sys/dev/drm2/i915/i915_gem.c > head/sys/dev/drm2/i915/i915_gem_context.c > head/sys/dev/drm2/i915/i915_gem_execbuffer.c > head/sys/dev/drm2/i915/i915_gem_gtt.c > head/sys/dev/drm2/i915/i915_gem_tiling.c Not sure I got the right commit but I see these on = powerpc.{GENERIC,LINT}64 in various instances: /scratch/tmp/bz/head.svn/sys/dev/drm2/drmP.h:222:17: error: __VA_ARGS__ = can only appear in the expansion of a C99 variadic macro From owner-svn-src-head@freebsd.org Thu Aug 27 00:33:32 2015 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 64C539C3DC7; Thu, 27 Aug 2015 00:33:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F1C614F3; Thu, 27 Aug 2015 00:33:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 0041C25D387C; Thu, 27 Aug 2015 00:33:29 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 8E91EC770AA; Thu, 27 Aug 2015 00:33:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id LX9Gs6P_OkGx; Thu, 27 Aug 2015 00:33:27 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:3ce0:e321:a7ff:4040] (unknown [IPv6:fde9:577b:c1a9:4410:3ce0:e321:a7ff:4040]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id C15DAC77037; Thu, 27 Aug 2015 00:33:26 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r287174 - head/sys/dev/drm2/i915 From: "Bjoern A. Zeeb" In-Reply-To: <3BBAA5F5-D6D2-48E0-9C28-1D12520BA7C7@FreeBSD.org> Date: Thu, 27 Aug 2015 00:32:55 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0C6FDDFB-A5FC-44C8-918E-CE2B206EE469@FreeBSD.org> References: <201508262135.t7QLZGs7067675@repo.freebsd.org> <3BBAA5F5-D6D2-48E0-9C28-1D12520BA7C7@FreeBSD.org> To: Baptiste Daroussin X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 27 Aug 2015 00:33:32 -0000 > On 27 Aug 2015, at 00:23 , Bjoern A. Zeeb wrote: >=20 >=20 >> On 26 Aug 2015, at 21:35 , Baptiste Daroussin = wrote: >>=20 >> Author: bapt >> Date: Wed Aug 26 21:35:16 2015 >> New Revision: 287174 >> URL: https://svnweb.freebsd.org/changeset/base/287174 >>=20 >> Log: >> Reduce diff against linux 3.8 >>=20 >> Reviewed by: dumbbell >> Differential Revision: https://reviews.freebsd.org/D3492 >>=20 >> Modified: >> head/sys/dev/drm2/i915/i915_gem.c >> head/sys/dev/drm2/i915/i915_gem_context.c >> head/sys/dev/drm2/i915/i915_gem_execbuffer.c >> head/sys/dev/drm2/i915/i915_gem_gtt.c >> head/sys/dev/drm2/i915/i915_gem_tiling.c >=20 > Not sure I got the right commit but I see these on = powerpc.{GENERIC,LINT}64 in various instances: r 287172 probably >=20 > /scratch/tmp/bz/head.svn/sys/dev/drm2/drmP.h:222:17: error: = __VA_ARGS__ can only appear in the expansion of a C99 variadic macro From owner-svn-src-head@freebsd.org Thu Aug 27 01:52:46 2015 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 37AA49C2E47; Thu, 27 Aug 2015 01:52:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 24C92940; Thu, 27 Aug 2015 01:52:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R1qkGV074550; Thu, 27 Aug 2015 01:52:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R1qks4074549; Thu, 27 Aug 2015 01:52:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508270152.t7R1qks4074549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 27 Aug 2015 01:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287185 - head/share/mk 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.20 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, 27 Aug 2015 01:52:46 -0000 Author: imp Date: Thu Aug 27 01:52:45 2015 New Revision: 287185 URL: https://svnweb.freebsd.org/changeset/base/287185 Log: For each FOO in FILESLISTS, append the value of FOO.yes, sort, and remove duplicates. Modified: head/share/mk/bsd.files.mk Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Thu Aug 27 01:02:01 2015 (r287184) +++ head/share/mk/bsd.files.mk Thu Aug 27 01:52:45 2015 (r287185) @@ -10,6 +10,9 @@ ____: FILESGROUPS?= FILES .for group in ${FILESGROUPS} +# Add in foo.yes and remove duplicates from all the groups +${${group}}:= ${${group}} ${${group}.yes} +${${group}}:= ${${group}:O:u} buildfiles: ${${group}} .endfor From owner-svn-src-head@freebsd.org Thu Aug 27 01:55:01 2015 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 6CBB09C308A; Thu, 27 Aug 2015 01:55:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5D9C7AAE; Thu, 27 Aug 2015 01:55:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R1t1T1074720; Thu, 27 Aug 2015 01:55:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R1t1AI074719; Thu, 27 Aug 2015 01:55:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508270155.t7R1t1AI074719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 27 Aug 2015 01:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287186 - head/share/mk 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.20 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, 27 Aug 2015 01:55:01 -0000 Author: imp Date: Thu Aug 27 01:55:00 2015 New Revision: 287186 URL: https://svnweb.freebsd.org/changeset/base/287186 Log: Automatically append SUBDIR.yes to the SUBDIR variable, and remove duplicates. We cannot sort SUBDIR because many Makefiles have .WAIT in the list which is strongly ordering. Rather than try to second guess when to sort and when to not sort depending on .WAIT being in the list, just remove duplicates. Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Thu Aug 27 01:52:45 2015 (r287185) +++ head/share/mk/bsd.subdir.mk Thu Aug 27 01:55:00 2015 (r287186) @@ -16,7 +16,8 @@ # # SUBDIR A list of subdirectories that should be built as well. # Each of the targets will execute the same target in the -# subdirectories. +# subdirectories. SUBDIR.yes is automatically appeneded +# to this list. # # +++ targets +++ # @@ -43,6 +44,11 @@ _SUBDIR: .endif .if !target(_SUBDIR) +.if defined(SUBDIR) +SUBDIR:=${SUBDIR} ${SUBDIR.yes} +SUBDIR:=${SUBDIR:u} +.endif + DISTRIBUTION?= base .if !target(distribute) distribute: .MAKE From owner-svn-src-head@freebsd.org Thu Aug 27 02:59:49 2015 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 7FF5E9C368D; Thu, 27 Aug 2015 02:59:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 574AB13BD; Thu, 27 Aug 2015 02:59:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R2xnXc099245; Thu, 27 Aug 2015 02:59:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R2xnLJ099244; Thu, 27 Aug 2015 02:59:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508270259.t7R2xnLJ099244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 27 Aug 2015 02:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287187 - head/share/mk 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.20 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, 27 Aug 2015 02:59:49 -0000 Author: imp Date: Thu Aug 27 02:59:48 2015 New Revision: 287187 URL: https://svnweb.freebsd.org/changeset/base/287187 Log: Make sys.mk more compatible with fmake by refraining from using :U modifiers. Differential Revision: https://reviews.freebsd.org/D3228 Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Thu Aug 27 01:55:00 2015 (r287186) +++ head/share/mk/sys.mk Thu Aug 27 02:59:48 2015 (r287187) @@ -33,16 +33,23 @@ __DEFAULT_DEPENDENT_OPTIONS= \ # early include for customization # see local.sys.mk below -.-include +# Not included when building in fmake compatibility mode (still needed +# for older system support) +.if defined(.PARSEDIR) +.sinclude .if ${MK_META_MODE} == "yes" -.-include -.elif ${MK_META_FILES} == "yes" && ${.MAKEFLAGS:U:M-B} == "" +.sinclude +.elif ${MK_META_FILES} == "yes" && defined(.MAKEFLAGS) +.if ${.MAKEFLAGS:M-B} == "" .MAKE.MODE= meta verbose .endif +.endif .if ${MK_AUTO_OBJ} == "yes" # This needs to be done early - before .PATH is computed -.-include +.sinclude +.endif + .endif # If the special target .POSIX appears (without prerequisites or @@ -362,7 +369,7 @@ __MAKE_CONF?=/etc/make.conf .endif # late include for customization -.-include +.sinclude .if defined(__MAKE_SHELL) && !empty(__MAKE_SHELL) SHELL= ${__MAKE_SHELL} @@ -379,11 +386,12 @@ SHELL= ${__MAKE_SHELL} # when running target scripts, this is a problem for many makefiles here. # So define a shell that will do what FreeBSD expects. .ifndef WITHOUT_SHELL_ERRCTL +__MAKE_SHELL?=/bin/sh .SHELL: name=sh \ quiet="set -" echo="set -v" filter="set -" \ hasErrCtl=yes check="set -e" ignore="set +e" \ echoFlag=v errFlag=e \ - path=${__MAKE_SHELL:U/bin/sh} + path=${__MAKE_SHELL} .endif .include From owner-svn-src-head@freebsd.org Thu Aug 27 03:13:13 2015 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 4C2D89C3E65; Thu, 27 Aug 2015 03:13:13 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 26A03635; Thu, 27 Aug 2015 03:13:12 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from coconut.local (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 1E651564AA; Wed, 26 Aug 2015 22:13:06 -0500 (CDT) Subject: Re: svn commit: r287006 - head/share/mk To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201508211951.t7LJpKwo056435@repo.freebsd.org> From: Eric van Gyzen Message-ID: <55DE803C.3050504@FreeBSD.org> Date: Wed, 26 Aug 2015 22:13:00 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201508211951.t7LJpKwo056435@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.20 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, 27 Aug 2015 03:13:13 -0000 On 8/21/15 2:51 PM, Warner Losh wrote: > Author: imp > Date: Fri Aug 21 19:51:19 2015 > New Revision: 287006 > URL: https://svnweb.freebsd.org/changeset/base/287006 > > Log: > Document CFLAGS_NO_SIMD. > > Modified: > head/share/mk/bsd.README > Thank you. Eric From owner-svn-src-head@freebsd.org Thu Aug 27 03:44:06 2015 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 E85279C28DD; Thu, 27 Aug 2015 03:44:06 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D93CA114E; Thu, 27 Aug 2015 03:44:06 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R3i6kY020407; Thu, 27 Aug 2015 03:44:06 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R3i6VA020406; Thu, 27 Aug 2015 03:44:06 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508270344.t7R3i6VA020406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 27 Aug 2015 03:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287188 - head/sys/powerpc/powerpc 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.20 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, 27 Aug 2015 03:44:07 -0000 Author: jhibbits Date: Thu Aug 27 03:44:06 2015 New Revision: 287188 URL: https://svnweb.freebsd.org/changeset/base/287188 Log: Use the macro definition for EXC_PGM_TRAP, instead of the magic number. Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Thu Aug 27 02:59:48 2015 (r287187) +++ head/sys/powerpc/powerpc/trap.c Thu Aug 27 03:44:06 2015 (r287188) @@ -815,7 +815,7 @@ db_trap_glue(struct trapframe *frame) && (frame->exc == EXC_TRC || frame->exc == EXC_RUNMODETRC #ifdef AIM || (frame->exc == EXC_PGM - && (frame->srr1 & 0x20000)) + && (frame->srr1 & EXC_PGM_TRAP)) #else || (frame->exc == EXC_DEBUG) #endif @@ -827,7 +827,7 @@ db_trap_glue(struct trapframe *frame) if (*(uint32_t *)frame->srr0 == EXC_DTRACE) return (0); #ifdef AIM - if (type == EXC_PGM && (frame->srr1 & 0x20000)) { + if (type == EXC_PGM && (frame->srr1 & EXC_PGM_TRAP)) { #else if (frame->cpu.booke.esr & ESR_PTR) { #endif From owner-svn-src-head@freebsd.org Thu Aug 27 03:47:57 2015 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 9C11F9C2A8D; Thu, 27 Aug 2015 03:47:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8C55D149D; Thu, 27 Aug 2015 03:47:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R3lvRG020603; Thu, 27 Aug 2015 03:47:57 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R3lukE020600; Thu, 27 Aug 2015 03:47:56 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508270347.t7R3lukE020600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 27 Aug 2015 03:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287189 - in head/sys: conf dev/mmc powerpc/mpc85xx 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.20 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, 27 Aug 2015 03:47:57 -0000 Author: jhibbits Date: Thu Aug 27 03:47:56 2015 New Revision: 287189 URL: https://svnweb.freebsd.org/changeset/base/287189 Log: Fix freescale sdhc driver, and add it to the files list. Also, add it to the mmc DRIVER_MODULE attachment list. Modified: head/sys/conf/files.powerpc head/sys/dev/mmc/mmc.c head/sys/powerpc/mpc85xx/fsl_sdhc.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Thu Aug 27 03:44:06 2015 (r287188) +++ head/sys/conf/files.powerpc Thu Aug 27 03:47:56 2015 (r287189) @@ -133,6 +133,7 @@ powerpc/mikrotik/platform_rb.c optional powerpc/mpc85xx/atpic.c optional mpc85xx isa powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 fdt powerpc/mpc85xx/ds1553_core.c optional ds1553 +powerpc/mpc85xx/fsl_sdhc.c optional mpc85xx sdhc powerpc/mpc85xx/i2c.c optional iicbus fdt powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Thu Aug 27 03:44:06 2015 (r287188) +++ head/sys/dev/mmc/mmc.c Thu Aug 27 03:47:56 2015 (r287189) @@ -1818,6 +1818,7 @@ DRIVER_MODULE(mmc, aml8726_sdxc, mmc_dri DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, sdhci_fsl, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/powerpc/mpc85xx/fsl_sdhc.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_sdhc.c Thu Aug 27 03:44:06 2015 (r287188) +++ head/sys/powerpc/mpc85xx/fsl_sdhc.c Thu Aug 27 03:47:56 2015 (r287189) @@ -117,14 +117,14 @@ static device_method_t fsl_sdhc_methods[ /* kobj_class definition */ static driver_t fsl_sdhc_driver = { - "sdhci", + "sdhci_fsl", fsl_sdhc_methods, sizeof(struct fsl_sdhc_softc) }; static devclass_t fsl_sdhc_devclass; -DRIVER_MODULE(sdhci, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0); +DRIVER_MODULE(sdhci_fsl, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0); /***************************************************************************** @@ -481,7 +481,7 @@ static void finalize_request(struct fsl_sdhc_softc *sc) { - DPRINTF("finishing request %x\n", sc->request); + DPRINTF("finishing request %p\n", sc->request); sc->request->done(sc->request); sc->request = NULL; @@ -982,7 +982,6 @@ dump_registers(struct fsl_sdhc_softc *sc { printf("PRSSTAT = 0x%08x\n", read4(sc, SDHC_PRSSTAT)); printf("PROCTL = 0x%08x\n", read4(sc, SDHC_PROCTL)); - printf("PMUXCR = 0x%08x\n", ccsr_read4(OCP85XX_PMUXCR)); printf("HOSTCAPBLT = 0x%08x\n", read4(sc, SDHC_HOSTCAPBLT)); printf("IRQSTAT = 0x%08x\n", read4(sc, SDHC_IRQSTAT)); printf("IRQSTATEN = 0x%08x\n", read4(sc, SDHC_IRQSTATEN)); @@ -990,7 +989,6 @@ dump_registers(struct fsl_sdhc_softc *sc printf("WML = 0x%08x\n", read4(sc, SDHC_WML)); printf("DSADDR = 0x%08x\n", read4(sc, SDHC_DSADDR)); printf("XFERTYP = 0x%08x\n", read4(sc, SDHC_XFERTYP)); - printf("ECMCR = 0x%08x\n", ccsr_read4(OCP85XX_ECMCR)); printf("DCR = 0x%08x\n", read4(sc, SDHC_DCR)); } #endif From owner-svn-src-head@freebsd.org Thu Aug 27 04:25:28 2015 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 3F8419C3855; Thu, 27 Aug 2015 04:25:28 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2CAAA329; Thu, 27 Aug 2015 04:25:28 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R4PSPF036753; Thu, 27 Aug 2015 04:25:28 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R4PSFH036752; Thu, 27 Aug 2015 04:25:28 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508270425.t7R4PSFH036752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Thu, 27 Aug 2015 04:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287190 - 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.20 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, 27 Aug 2015 04:25:28 -0000 Author: marcel Date: Thu Aug 27 04:25:27 2015 New Revision: 287190 URL: https://svnweb.freebsd.org/changeset/base/287190 Log: An error of -1 from parse_mount() indicates that the specification was invalid. Don't trigger a mount failure (which by default means a panic), but instead just move on to the next directive in the configuration. This typically has us ask for the root mount. PR: 163245 Modified: head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Thu Aug 27 03:47:56 2015 (r287189) +++ head/sys/kern/vfs_mountroot.c Thu Aug 27 04:25:27 2015 (r287190) @@ -791,6 +791,11 @@ retry: break; default: error = parse_mount(&conf); + if (error == -1) { + printf("mountroot: invalid file system " + "specification.\n"); + error = 0; + } break; } if (error < 0) From owner-svn-src-head@freebsd.org Thu Aug 27 05:27:19 2015 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 0ED4F9C4A46; Thu, 27 Aug 2015 05:27:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 F4128AE9; Thu, 27 Aug 2015 05:27:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R5RIOZ061026; Thu, 27 Aug 2015 05:27:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R5RIA8061025; Thu, 27 Aug 2015 05:27:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508270527.t7R5RIA8061025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 27 Aug 2015 05:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287191 - head/sys/dev/drm2 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.20 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, 27 Aug 2015 05:27:19 -0000 Author: bapt Date: Thu Aug 27 05:27:18 2015 New Revision: 287191 URL: https://svnweb.freebsd.org/changeset/base/287191 Log: Fix typo in new macros Modified: head/sys/dev/drm2/drmP.h Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Thu Aug 27 04:25:27 2015 (r287190) +++ head/sys/dev/drm2/drmP.h Thu Aug 27 05:27:18 2015 (r287191) @@ -216,21 +216,21 @@ struct drm_device; __func__ , ##__VA_ARGS__); \ } while (0) -#define DRM_LOG(fmt, args...) do { \ +#define DRM_LOG(fmt, args, ...) do { \ if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ printf("[" DRM_NAME "]:pid%d:%s]" fmt, DRM_CURRENTPID,\ __func__ , ##__VA_ARGS__); \ } while (0) -#define DRM_LOG_KMS(fmt, args...) do { \ +#define DRM_LOG_KMS(fmt, args, ...) do { \ if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ printf("[" DRM_NAME "]:KMS:pid%d:%s]" fmt, DRM_CURRENTPID,\ __func__ , ##__VA_ARGS__); \ } while (0) -#define DRM_LOG_MODE(fmt, args...) do { \ +#define DRM_LOG_MODE(fmt, args, ...) do { \ if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ - printf("[" DRM_NAME "]:pid%d:%s]" fmt, DRM_CURRENTPID,\ + printf("[" DRM_NAME "]:pid%d:%s]" fmt, DRM_CURRENTPID, \ __func__ , ##__VA_ARGS__); \ } while (0) From owner-svn-src-head@freebsd.org Thu Aug 27 05:39:33 2015 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 9300C9C4DAF; Thu, 27 Aug 2015 05:39:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 841DBFCA; Thu, 27 Aug 2015 05:39:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R5dXfH065196; Thu, 27 Aug 2015 05:39:33 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R5dXQh065195; Thu, 27 Aug 2015 05:39:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508270539.t7R5dXQh065195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 27 Aug 2015 05:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287192 - head/sys/dev/drm2 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.20 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, 27 Aug 2015 05:39:33 -0000 Author: bapt Date: Thu Aug 27 05:39:32 2015 New Revision: 287192 URL: https://svnweb.freebsd.org/changeset/base/287192 Log: More fixes to the new macros Modified: head/sys/dev/drm2/drmP.h Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Thu Aug 27 05:27:18 2015 (r287191) +++ head/sys/dev/drm2/drmP.h Thu Aug 27 05:39:32 2015 (r287192) @@ -216,25 +216,25 @@ struct drm_device; __func__ , ##__VA_ARGS__); \ } while (0) -#define DRM_LOG(fmt, args, ...) do { \ +#define DRM_LOG(fmt, ...) do { \ if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ - printf("[" DRM_NAME "]:pid%d:%s]" fmt, DRM_CURRENTPID,\ + printf("[" DRM_NAME "]:pid%d:%s]" fmt, DRM_CURRENTPID, \ __func__ , ##__VA_ARGS__); \ } while (0) -#define DRM_LOG_KMS(fmt, args, ...) do { \ +#define DRM_LOG_KMS(fmt, ...) do { \ if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ printf("[" DRM_NAME "]:KMS:pid%d:%s]" fmt, DRM_CURRENTPID,\ __func__ , ##__VA_ARGS__); \ } while (0) -#define DRM_LOG_MODE(fmt, args, ...) do { \ +#define DRM_LOG_MODE(fmt, ...) do { \ if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ printf("[" DRM_NAME "]:pid%d:%s]" fmt, DRM_CURRENTPID, \ __func__ , ##__VA_ARGS__); \ } while (0) -#define DRM_LOG_DRIVER(fmt, args...) do { \ +#define DRM_LOG_DRIVER(fmt, ...) do { \ if ((drm_debug & DRM_DEBUGBITS_KMS) != 0) \ printf("[" DRM_NAME "]:KMS:pid%d:%s]" fmt, DRM_CURRENTPID,\ __func__ , ##__VA_ARGS__); \ From owner-svn-src-head@freebsd.org Thu Aug 27 06:28:43 2015 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 D94469C3298; Thu, 27 Aug 2015 06:28:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 CA7CB8B8; Thu, 27 Aug 2015 06:28:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R6ShOY085487; Thu, 27 Aug 2015 06:28:43 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R6ShaZ085486; Thu, 27 Aug 2015 06:28:43 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508270628.t7R6ShaZ085486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 27 Aug 2015 06:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287193 - head/usr.sbin/pkg 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.20 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, 27 Aug 2015 06:28:43 -0000 Author: delphij Date: Thu Aug 27 06:28:42 2015 New Revision: 287193 URL: https://svnweb.freebsd.org/changeset/base/287193 Log: Plug a possible memory leak. MFC after: 2 weeks Modified: head/usr.sbin/pkg/dns_utils.c Modified: head/usr.sbin/pkg/dns_utils.c ============================================================================== --- head/usr.sbin/pkg/dns_utils.c Thu Aug 27 05:39:32 2015 (r287192) +++ head/usr.sbin/pkg/dns_utils.c Thu Aug 27 06:28:42 2015 (r287193) @@ -84,7 +84,6 @@ compute_weight(struct dns_srvinfo **d, i int i, j, totalweight; int *chosen; - chosen = malloc(sizeof(int) * (last - first + 1)); totalweight = 0; for (i = 0; i <= last; i++) @@ -93,6 +92,8 @@ compute_weight(struct dns_srvinfo **d, i if (totalweight == 0) return; + chosen = malloc(sizeof(int) * (last - first + 1)); + for (i = 0; i <= last; i++) { for (;;) { chosen[i] = random() % (d[i]->weight * 100 / totalweight); From owner-svn-src-head@freebsd.org Thu Aug 27 07:53:59 2015 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 3EDCC9C4F7B; Thu, 27 Aug 2015 07:53:59 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2F17739D; Thu, 27 Aug 2015 07:53:59 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R7rxeS021734; Thu, 27 Aug 2015 07:53:59 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R7rxjn021733; Thu, 27 Aug 2015 07:53:59 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201508270753.t7R7rxjn021733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 27 Aug 2015 07:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287195 - head/sys/netpfil/ipfw 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.20 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, 27 Aug 2015 07:53:59 -0000 Author: melifaro Date: Thu Aug 27 07:53:58 2015 New Revision: 287195 URL: https://svnweb.freebsd.org/changeset/base/287195 Log: Fix packets/bytes accounting on i386. Spotted by: julian Modified: head/sys/netpfil/ipfw/ip_fw_private.h Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Thu Aug 27 07:43:29 2015 (r287194) +++ head/sys/netpfil/ipfw/ip_fw_private.h Thu Aug 27 07:53:58 2015 (r287195) @@ -256,7 +256,7 @@ struct ip_fw { ipfw_insn cmd[1]; /* storage for commands */ }; -#define IPFW_RULE_CNTR_SIZE (2 * sizeof(counter_u64_t)) +#define IPFW_RULE_CNTR_SIZE (2 * sizeof(uint64_t)) #endif From owner-svn-src-head@freebsd.org Thu Aug 27 08:15:33 2015 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 7DB639C2BC2; Thu, 27 Aug 2015 08:15:33 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6C9861105; Thu, 27 Aug 2015 08:15:33 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R8FXHw029897; Thu, 27 Aug 2015 08:15:33 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R8FXek029896; Thu, 27 Aug 2015 08:15:33 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201508270815.t7R8FXek029896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Thu, 27 Aug 2015 08:15:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287196 - 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.20 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, 27 Aug 2015 08:15:33 -0000 Author: jch Date: Thu Aug 27 08:15:32 2015 New Revision: 287196 URL: https://svnweb.freebsd.org/changeset/base/287196 Log: In callout_stop(), if a callout is both pending and currently being serviced return 0 (fail) but it is applicable only mpsafe callouts. Thanks to hselasky for finding this. Differential Revision: https://reviews.freebsd.org/D3078 (Updated) Submitted by: hselasky Reviewed by: jch Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Thu Aug 27 07:53:58 2015 (r287195) +++ head/sys/kern/kern_timeout.c Thu Aug 27 08:15:32 2015 (r287196) @@ -1379,11 +1379,13 @@ again: } callout_cc_del(c, cc); - /* - * If we are asked to stop a callout which is currently in progress - * and indeed impossible to stop then return 0. - */ - not_running = !(cc_exec_curr(cc, direct) == c); + if (!use_lock) { + /* + * If we are asked to stop a callout which is currently in progress + * and indeed impossible to stop then return 0. + */ + not_running = !(cc_exec_curr(cc, direct) == c); + } CC_UNLOCK(cc); return (not_running); From owner-svn-src-head@freebsd.org Thu Aug 27 08:17:55 2015 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 24BE39C2CA9 for ; Thu, 27 Aug 2015 08:17:55 +0000 (UTC) (envelope-from julien@jch.io) Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com [209.85.220.171]) (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 D7769129C for ; Thu, 27 Aug 2015 08:17:54 +0000 (UTC) (envelope-from julien@jch.io) Received: by qkda128 with SMTP id a128so6280227qkd.3 for ; Thu, 27 Aug 2015 01:17:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=JX3t/0O9JaDNI2XECs0rLkvBlCzznMHztpGIubM9QxU=; b=V8xLsFCmq4g64pX41MlvHcSkzXcZDbn5P1+vfWRtRJ02+OsgMnr4XYwFb4dzP/ED8J cHF7sOiRiUWFhU/uSra1TG0Z/ZoqjliWMHvMrAqPd42dAl5Z9PKKFC/8vO8Ak0ptb7Aj qQXy7YO1+Bojvl0soffg+lWKnOMqNfCiXZPPLT3EsceVeYmV/5ZgqBR/Gokkl1CWZtSl oleCfR9/Xc5Ro4iHdlwlR8nbXrU9d7+X0r1lKfIyIETRHpc288ED1V8XgB+wXdLtEoB7 Vaoe+lqCpnn5HGZ5WizeabIDPGrFkWeJ5481IJpDwHPXXjeRKEUGBF6rtf2Fn2k821QE I1NQ== X-Gm-Message-State: ALoCoQl4UHXAdrmnKbqCbivj92FFhqB3+94cWZ2znPY235ULI9Cj1hEvAoUkTMjetNPIDmxg/VFL X-Received: by 10.55.41.10 with SMTP id p10mr4523258qkh.28.1440663473638; Thu, 27 Aug 2015 01:17:53 -0700 (PDT) Received: from FRI2JCHARBON-M1.local (h87.s239.verisign.com. [216.168.239.87]) by smtp.googlemail.com with ESMTPSA id 124sm848720qhr.36.2015.08.27.01.17.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2015 01:17:52 -0700 (PDT) Subject: Re: svn commit: r286880 - head/sys/kern To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Baldwin References: <201508181015.t7IAFAex055889@repo.freebsd.org> <55DD69E5.4090904@selasky.org> <55DDE9FF.3020705@freebsd.org> From: Julien Charbon X-Enigmail-Draft-Status: N1110 Message-ID: <55DEC7A2.1050808@freebsd.org> Date: Thu, 27 Aug 2015 10:17:38 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55DDE9FF.3020705@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qGtiUEH0RGUTqXWLtKpNHUkFQHUk750Jr" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 27 Aug 2015 08:17:55 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qGtiUEH0RGUTqXWLtKpNHUkFQHUk750Jr Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Hans, On 26/08/15 18:31, Julien Charbon wrote: > On 26/08/15 09:25, Hans Petter Selasky wrote: >> On 08/18/15 12:15, Julien Charbon wrote: >>> Author: jch >>> Date: Tue Aug 18 10:15:09 2015 >>> New Revision: 286880 >>> URL: https://svnweb.freebsd.org/changeset/base/286880 >>> >>> Log: >>> callout_stop() should return 0 (fail) when the callout is currentl= y >>> being serviced and indeed unstoppable. >>> >>> A scenario to reproduce this case is: >>> >>> - the callout is being serviced and at same time, >>> - callout_reset() is called on this callout that sets >>> the CALLOUT_PENDING flag and at same time, >>> - callout_stop() is called on this callout and returns 1 (success)= >>> even if the callout is indeed currently running and unstoppable.= >>> >>> This issue was caught up while making r284245 (D2763) workaround, = and >>> was discussed at BSDCan 2015. Once applied the r284245 workaround= >>> is not needed anymore and will be reverted. >>> >>> Differential Revision: https://reviews.freebsd.org/D3078 >>> Reviewed by: jhb >>> Sponsored by: Verisign, Inc. >>> >>> Modified: >>> head/sys/kern/kern_timeout.c >>> >>> Modified: head/sys/kern/kern_timeout.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/kern/kern_timeout.c Tue Aug 18 10:07:03 2015 (r286= 879) >>> +++ head/sys/kern/kern_timeout.c Tue Aug 18 10:15:09 2015 (r286= 880) >>> @@ -1150,7 +1150,7 @@ _callout_stop_safe(struct callout *c, in >>> struct callout_cpu *cc, *old_cc; >>> struct lock_class *class; >>> int direct, sq_locked, use_lock; >>> - int not_on_a_list; >>> + int not_on_a_list, not_running; >>> >>> if (safe) >>> WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock, >>> @@ -1378,8 +1378,15 @@ again: >>> } >>> } >>> callout_cc_del(c, cc); >>> + >>> + /* >>> + * If we are asked to stop a callout which is currently in progr= ess >>> + * and indeed impossible to stop then return 0. >>> + */ >>> + not_running =3D !(cc_exec_curr(cc, direct) =3D=3D c); >>> + >>> CC_UNLOCK(cc); >>> - return (1); >>> + return (not_running); >>> } >>> >>> void >> >> I think this patch is incomplete and can break the return value for >> non-MPSAFE callouts. I think the correct statement should check the >> value of "use_lock" too: >> >> not_running =3D !(cc_exec_curr(cc, direct) =3D=3D c && use_lock =3D= =3D 0); >> >> Because if the callback process waits for lock "c_lock" in the callbac= k >> process then we have above "cc_exec_curr(cc, direct) =3D=3D c" is sati= sfied >> too, and non-MPSAFE callouts are always cancelable, via >> cc_exec_cancel(cc, direct) =3D true; >=20 > Hum, interesting let me double check that. After checking the non-mpsafe callout cases, you are completely right, this test makes sense only in mpsafe callout case. Fixed in r287196: https://svnweb.freebsd.org/base?view=3Drevision&revision=3D287196 Thanks a lot for your time. -- Julien --qGtiUEH0RGUTqXWLtKpNHUkFQHUk750Jr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJV3seuAAoJEKVlQ5Je6dhxDpwH/37Z4WzUVDiFmRhy3VWMUFze A4NPC2+wFWZZXsO5djBQtOyOD10aiZ7vNbkLWdy2aZ0/HbqIrMiDSYVPjQDoilU2 1Fkwy04PuvPGRMCG8bAUjW/MMXrAtKNAe2MsTWraVTcR0b1gHQ103txSyMPiVvL2 8zLa+2prHY2xkjFLjG4HYGo7y6phjzh8hSlsBKuwZmgLhEJn60CWq1b6iba2eL0I NZnTwfVbi7wyFUvRbvmWYbKrA2QyMt1heMV3YRyf2OkqGw6tVE9KQQzHHBYKht+q vr3HSx7ZDdXWs7Hn+EwNjisrhgZcPwwOcoXzaxuOQUu5fTnlflmC7GMmjMH83uc= =jp9c -----END PGP SIGNATURE----- --qGtiUEH0RGUTqXWLtKpNHUkFQHUk750Jr-- From owner-svn-src-head@freebsd.org Thu Aug 27 08:38:39 2015 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 0B0519C34BB; Thu, 27 Aug 2015 08:38:39 +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 40A751CA2; Thu, 27 Aug 2015 08:38:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (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 A8D101FE023; Thu, 27 Aug 2015 10:38:29 +0200 (CEST) Subject: Re: svn commit: r286880 - head/sys/kern To: Julien Charbon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Baldwin References: <201508181015.t7IAFAex055889@repo.freebsd.org> <55DD69E5.4090904@selasky.org> <55DDE9FF.3020705@freebsd.org> <55DEC7A2.1050808@freebsd.org> From: Hans Petter Selasky Message-ID: <55DECCDC.7040902@selasky.org> Date: Thu, 27 Aug 2015 10:39:56 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55DEC7A2.1050808@freebsd.org> 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.20 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, 27 Aug 2015 08:38:39 -0000 Hi Julien, On 08/27/15 10:17, Julien Charbon wrote: > > Hi Hans, > > > After checking the non-mpsafe callout cases, you are completely right, > this test makes sense only in mpsafe callout case. > > Fixed in r287196: > > https://svnweb.freebsd.org/base?view=revision&revision=287196 > > Thanks a lot for your time. Possibly you'll need to add an: else not_running = 1; To restore the old behaviour for non-MPSAFE callouts, because the variable is not initialized at top of the function. --HPS From owner-svn-src-head@freebsd.org Thu Aug 27 08:56:41 2015 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 C25A39C3B4C; Thu, 27 Aug 2015 08:56:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 AB18B67A; Thu, 27 Aug 2015 08:56:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R8ufnE046088; Thu, 27 Aug 2015 08:56:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R8ue0q046082; Thu, 27 Aug 2015 08:56:40 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201508270856.t7R8ue0q046082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 27 Aug 2015 08:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287197 - in head: etc etc/rc.d sys/dev/ath sys/dev/ath/ath_rate/sample sys/dev/bwi sys/dev/bwn sys/dev/if_ndis sys/dev/ipw sys/dev/iwi sys/dev/iwm sys/dev/iwn sys/dev/malo sys/dev/mwl ... 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.20 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, 27 Aug 2015 08:56:41 -0000 Author: glebius Date: Thu Aug 27 08:56:39 2015 New Revision: 287197 URL: https://svnweb.freebsd.org/changeset/base/287197 Log: Replay r286410. Change KPI of how device drivers that provide wireless connectivity interact with the net80211 stack. Historical background: originally wireless devices created an interface, just like Ethernet devices do. Name of an interface matched the name of the driver that created. Later, wlan(4) layer was introduced, and the wlanX interfaces become the actual interface, leaving original ones as "a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer and a driver became a mix of methods that pass a pointer to struct ifnet as identifier and methods that pass pointer to struct ieee80211com. From user point of view, the parent interface just hangs on in the ifconfig list, and user can't do anything useful with it. Now, the struct ifnet goes away. The struct ieee80211com is the only KPI between a device driver and net80211. Details: - The struct ieee80211com is embedded into drivers softc. - Packets are sent via new ic_transmit method, which is very much like the previous if_transmit. - Bringing parent up/down is done via new ic_parent method, which notifies driver about any changes: number of wlan(4) interfaces, number of them in promisc or allmulti state. - Device specific ioctls (if any) are received on new ic_ioctl method. - Packets/errors accounting are done by the stack. In certain cases, when driver experiences errors and can not attribute them to any specific interface, driver updates ic_oerrors or ic_ierrors counters. Details on interface configuration with new world order: - A sequence of commands needed to bring up wireless DOESN"T change. - /etc/rc.conf parameters DON'T change. - List of devices that can be used to create wlan(4) interfaces is now provided by net.wlan.devices sysctl. Most drivers in this change were converted by me, except of wpi(4), that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing changes to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann, Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in testing. Reviewed by: adrian Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/etc/network.subr head/etc/rc.d/netif head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/ath_rate/sample/sample.h head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_beacon.c head/sys/dev/ath/if_ath_debug.h head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tdma.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx_edma.c head/sys/dev/ath/if_athvar.h head/sys/dev/bwi/bwimac.c head/sys/dev/bwi/bwiphy.c head/sys/dev/bwi/bwirf.c head/sys/dev/bwi/if_bwi.c head/sys/dev/bwi/if_bwivar.h head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwnvar.h head/sys/dev/if_ndis/if_ndis.c head/sys/dev/if_ndis/if_ndisvar.h head/sys/dev/ipw/if_ipw.c head/sys/dev/ipw/if_ipwvar.h head/sys/dev/iwi/if_iwi.c head/sys/dev/iwi/if_iwivar.h head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_mac_ctxt.c head/sys/dev/iwm/if_iwm_phy_ctxt.c head/sys/dev/iwm/if_iwm_power.c head/sys/dev/iwm/if_iwm_scan.c head/sys/dev/iwm/if_iwmvar.h head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h head/sys/dev/malo/if_malo.c head/sys/dev/malo/if_malo.h head/sys/dev/mwl/if_mwl.c head/sys/dev/mwl/if_mwl_pci.c head/sys/dev/mwl/if_mwlvar.h head/sys/dev/ral/if_ral_pci.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2560var.h head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2661var.h head/sys/dev/ral/rt2860.c head/sys/dev/ral/rt2860var.h head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_rumvar.h head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runvar.h head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_uathvar.h head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_upgtvar.h head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_uralvar.h head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/dev/usb/wlan/if_urtwvar.h head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/usb/wlan/if_zydreg.h head/sys/dev/wi/if_wi.c head/sys/dev/wi/if_wi_macio.c head/sys/dev/wi/if_wi_pccard.c head/sys/dev/wi/if_wi_pci.c head/sys/dev/wi/if_wivar.h head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h head/sys/dev/wtap/if_wtap.c head/sys/dev/wtap/if_wtapvar.h head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ddb.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_power.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_regdomain.c head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_var.h head/tools/tools/iwn/iwnstats/main.c Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Thu Aug 27 08:15:32 2015 (r287196) +++ head/etc/network.subr Thu Aug 27 08:56:39 2015 (r287197) @@ -1249,6 +1249,89 @@ ifscript_down() fi } +# wlan_up +# Create IEEE802.11 interfaces. +# +wlan_up() +{ + local _list _iflist parent child_wlans child create_args debug_flags + _list= + _iflist=$* + + # Parse wlans_$parent="$child ..." + for parent in `set | sed -nE 's/wlans_([a-z]+[0-9]+)=.*/\1/p'`; do + child_wlans=`get_if_var $parent wlans_IF` + for child in ${child_wlans}; do + create_args="wlandev $parent `get_if_var $child create_args_IF`" + debug_flags="`get_if_var $child wlandebug_IF`" + case $_iflist in + ""|$child|$child\ *|*\ $child\ *|*\ $child) ;; + *) continue ;; + esac + # Skip if ${child} already exists. + if ${IFCONFIG_CMD} $child > /dev/null 2>&1; then + continue + fi + if expr $child : 'wlan[0-9][0-9]*$' >/dev/null 2>&1; then + ${IFCONFIG_CMD} $child create ${create_args} && cfg=0 + if [ $? -eq 0 ]; then + _list="$_list $child" + fi + if [ -n "${debug_flags}" ]; then + wlandebug -i $child ${debug_flags} + fi + else + i=`${IFCONFIG_CMD} wlan create ${create_args}` + # XXXGL: wlandebug should accept any name + if [ -n "${debug_flags}" ]; then + wlandebug -i $i ${debug_flags} + fi + ${IFCONFIG_CMD} $i name $child && cfg=0 + if [ $? -eq 0 ]; then + _list="$_list $child" + fi + fi + done + done + if [ -n "${_list# }" ]; then + echo "Created wlan(4) interfaces: ${_list# }." + fi + debug "Created wlan(4)s: ${_list# }" +} + +# wlan_down +# Destroy IEEE802.11 interfaces. +# +wlan_down() +{ + local _list _iflist parent child_wlans child + _list= + _iflist=$* + + # Parse wlans_$parent="$child ..." + for parent in `set | sed -nE 's/wlans_([a-z]+[0-9]+)=.*/\1/p'`; do + child_wlans=`get_if_var $parent wlans_IF` + for child in ${child_wlans}; do + case $_iflist in + ""|$child|$child\ *|*\ $child\ *|*\ $child) ;; + *) continue ;; + esac + # Skip if ${child} doesn't exists. + if ! ${IFCONFIG_CMD} $child > /dev/null 2>&1; then + continue + fi + ${IFCONFIG_CMD} -n ${child} destroy + if [ $? -eq 0 ]; then + _list="$_list $child" + fi + done + done + if [ -n "${_list# }" ]; then + echo "Destroyed wlan(4) interfaces: ${_list# }." + fi + debug "Destroyed wlan(4)s: ${_list# }" +} + # clone_up # Create cloneable interfaces. # @@ -1398,6 +1481,9 @@ clone_down() # Create and configure child interfaces. Return 0 if child # interfaces are created. # +# XXXGL: the wlan code in this functions is superseded by wlan_up(), +# and will go away soon. +# childif_create() { local cfg child child_vlans child_wlans create_args debug_flags ifn i Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Thu Aug 27 08:15:32 2015 (r287196) +++ head/etc/rc.d/netif Thu Aug 27 08:56:39 2015 (r287197) @@ -37,6 +37,8 @@ name="netif" rcvar="${name}_enable" start_cmd="netif_start" stop_cmd="netif_stop" +wlanup_cmd="wlan_up" +wlandown_cmd="wlan_down" cloneup_cmd="clone_up" clonedown_cmd="clone_down" clear_cmd="doclear" @@ -65,6 +67,9 @@ netif_start() trap : 2 fi + # Create IEEE802.11 interface + wlan_up $cmdifn + # Create cloned interfaces clone_up $cmdifn @@ -91,12 +96,14 @@ netif_start() netif_stop() { _clone_down=1 + _wlan_down=1 netif_stop0 $* } doclear() { _clone_down= + _wlan_down= netif_stop0 $* } @@ -111,6 +118,11 @@ netif_stop0() # Deconfigure the interface(s) netif_common ifn_stop $cmdifn + # Destroy wlan interfaces + if [ -n "$_wlan_down" ]; then + wlan_down $cmdifn + fi + # Destroy cloned interfaces if [ -n "$_clone_down" ]; then clone_down $cmdifn Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Thu Aug 27 08:15:32 2015 (r287196) +++ head/sys/dev/ath/ath_rate/sample/sample.c Thu Aug 27 08:56:39 2015 (r287197) @@ -488,8 +488,7 @@ ath_rate_findrate(struct ath_softc *sc, #define RATE(ix) (DOT11RATE(ix) / 2) struct sample_node *sn = ATH_NODE_SAMPLE(an); struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc); - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; const HAL_RATE_TABLE *rt = sc->sc_currates; const int size_bin = size_to_bin(frameLen); int rix, mrr, best_rix, change_rates; @@ -856,8 +855,7 @@ ath_rate_tx_complete(struct ath_softc *s const struct ath_rc_series *rc, const struct ath_tx_status *ts, int frame_size, int nframes, int nbad) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct sample_node *sn = ATH_NODE_SAMPLE(an); int final_rix, short_tries, long_tries; const HAL_RATE_TABLE *rt = sc->sc_currates; @@ -1303,8 +1301,7 @@ static int ath_rate_sysctl_stats(SYSCTL_HANDLER_ARGS) { struct ath_softc *sc = arg1; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; int error, v; v = 0; Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Thu Aug 27 08:15:32 2015 (r287196) +++ head/sys/dev/ath/ath_rate/sample/sample.h Thu Aug 27 08:56:39 2015 (r287197) @@ -134,8 +134,7 @@ static unsigned calc_usecs_unicast_packe int long_retries, int is_ht40) { const HAL_RATE_TABLE *rt = sc->sc_currates; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; int rts, cts; unsigned t_slot = 20; Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Aug 27 08:15:32 2015 (r287196) +++ head/sys/dev/ath/if_ath.c Thu Aug 27 08:56:39 2015 (r287197) @@ -151,15 +151,14 @@ static struct ieee80211vap *ath_vap_crea const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN]); static void ath_vap_delete(struct ieee80211vap *); -static void ath_init(void *); -static void ath_stop_locked(struct ifnet *); -static void ath_stop(struct ifnet *); +static int ath_init(struct ath_softc *); +static void ath_stop(struct ath_softc *); static int ath_reset_vap(struct ieee80211vap *, u_long); -static int ath_transmit(struct ifnet *ifp, struct mbuf *m); -static void ath_qflush(struct ifnet *ifp); +static int ath_transmit(struct ieee80211com *, struct mbuf *); static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); -static int ath_ioctl(struct ifnet *, u_long, caddr_t); +static int ath_ioctl(struct ieee80211com *, u_long, void *); +static void ath_parent(struct ieee80211com *); static void ath_fatal_proc(void *, int); static void ath_bmiss_vap(struct ieee80211vap *); static void ath_bmiss_proc(void *, int); @@ -571,34 +570,19 @@ ath_fetch_mac_kenv(struct ath_softc *sc, int ath_attach(u_int16_t devid, struct ath_softc *sc) { - struct ifnet *ifp; - struct ieee80211com *ic; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = NULL; HAL_STATUS status; int error = 0, i; u_int wmodes; - uint8_t macaddr[IEEE80211_ADDR_LEN]; int rx_chainmask, tx_chainmask; HAL_OPS_CONFIG ah_config; DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); - CURVNET_SET(vnet0); - ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); - if (ifp == NULL) { - device_printf(sc->sc_dev, "can not if_alloc()\n"); - error = ENOSPC; - CURVNET_RESTORE(); - goto bad; - } - ic = ifp->if_l2com; ic->ic_softc = sc; ic->ic_name = device_get_nameunit(sc->sc_dev); - if_initname(ifp, device_get_name(sc->sc_dev), - device_get_unit(sc->sc_dev)); - CURVNET_RESTORE(); - /* * Configure the initial configuration data. * @@ -732,8 +716,8 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_tq = taskqueue_create("ath_taskq", M_NOWAIT, taskqueue_thread_enqueue, &sc->sc_tq); - taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, - "%s taskq", ifp->if_xname); + taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->sc_dev)); TASK_INIT(&sc->sc_rxtask, 0, sc->sc_rx.recv_tasklet, sc); TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc); @@ -876,17 +860,6 @@ ath_attach(u_int16_t devid, struct ath_s ath_led_config(sc); ath_hal_setledstate(ah, HAL_LED_INIT); - ifp->if_softc = sc; - ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; - ifp->if_transmit = ath_transmit; - ifp->if_qflush = ath_qflush; - ifp->if_ioctl = ath_ioctl; - ifp->if_init = ath_init; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); - ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; - IFQ_SET_READY(&ifp->if_snd); - - ic->ic_ifp = ifp; /* XXX not right but it's not used anywhere important */ ic->ic_phytype = IEEE80211_T_OFDM; ic->ic_opmode = IEEE80211_M_STA; @@ -1208,11 +1181,11 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_hasveol = ath_hal_hasveol(ah); /* get mac address from kenv first, then hardware */ - if (ath_fetch_mac_kenv(sc, macaddr) == 0) { + if (ath_fetch_mac_kenv(sc, ic->ic_macaddr) == 0) { /* Tell the HAL now about the new MAC */ - ath_hal_setmac(ah, macaddr); + ath_hal_setmac(ah, ic->ic_macaddr); } else { - ath_hal_getmac(ah, macaddr); + ath_hal_getmac(ah, ic->ic_macaddr); } if (sc->sc_hasbmask) @@ -1221,12 +1194,15 @@ ath_attach(u_int16_t devid, struct ath_s /* NB: used to size node table key mapping array */ ic->ic_max_keyix = sc->sc_keymax; /* call MI attach routine. */ - ieee80211_ifattach(ic, macaddr); + ieee80211_ifattach(ic); ic->ic_setregdomain = ath_setregdomain; ic->ic_getradiocaps = ath_getradiocaps; sc->sc_opmode = HAL_M_STA; /* override default methods */ + ic->ic_ioctl = ath_ioctl; + ic->ic_parent = ath_parent; + ic->ic_transmit = ath_transmit; ic->ic_newassoc = ath_newassoc; ic->ic_updateslot = ath_updateslot; ic->ic_wme.wme_update = ath_wme_update; @@ -1322,16 +1298,6 @@ bad2: bad: if (ah) ath_hal_detach(ah); - - /* - * To work around scoping issues with CURVNET_SET/CURVNET_RESTORE.. - */ - if (ifp != NULL && ifp->if_vnet) { - CURVNET_SET(ifp->if_vnet); - if_free(ifp); - CURVNET_RESTORE(); - } else if (ifp != NULL) - if_free(ifp); sc->sc_invalid = 1; return error; } @@ -1339,10 +1305,6 @@ bad: int ath_detach(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - - DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", - __func__, ifp->if_flags); /* * NB: the order of these is important: @@ -1367,14 +1329,14 @@ ath_detach(struct ath_softc *sc) ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); ath_power_setpower(sc, HAL_PM_AWAKE); - ATH_UNLOCK(sc); /* * Stop things cleanly. */ - ath_stop(ifp); + ath_stop(sc); + ATH_UNLOCK(sc); - ieee80211_ifdetach(ifp->if_l2com); + ieee80211_ifdetach(&sc->sc_ic); taskqueue_free(sc->sc_tq); #ifdef ATH_TX99_DIAG if (sc->sc_tx99 != NULL) @@ -1394,10 +1356,6 @@ ath_detach(struct ath_softc *sc) ath_tx_cleanup(sc); ath_hal_detach(sc->sc_ah); /* NB: sets chip in full sleep */ - CURVNET_SET(ifp->if_vnet); - if_free(ifp); - CURVNET_RESTORE(); - return 0; } @@ -1581,8 +1539,7 @@ ath_vap_create(struct ieee80211com *ic, vap = &avp->av_vap; /* XXX can't hold mutex across if_alloc */ ATH_UNLOCK(sc); - error = ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, - bssid, mac); + error = ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid); ATH_LOCK(sc); if (error != 0) { device_printf(sc->sc_dev, "%s: error %d creating vap\n", @@ -1716,7 +1673,8 @@ ath_vap_create(struct ieee80211com *ic, ATH_UNLOCK(sc); /* complete setup */ - ieee80211_vap_attach(vap, ath_media_change, ieee80211_media_status); + ieee80211_vap_attach(vap, ath_media_change, ieee80211_media_status, + mac); return vap; bad2: reclaim_address(sc, mac); @@ -1731,7 +1689,6 @@ static void ath_vap_delete(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; - struct ifnet *ifp = ic->ic_ifp; struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; struct ath_vap *avp = ATH_VAP(vap); @@ -1741,7 +1698,7 @@ ath_vap_delete(struct ieee80211vap *vap) ATH_UNLOCK(sc); DPRINTF(sc, ATH_DEBUG_RESET, "%s: called\n", __func__); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (sc->sc_running) { /* * Quiesce the hardware while we remove the vap. In * particular we need to reclaim all references to @@ -1770,7 +1727,7 @@ ath_vap_delete(struct ieee80211vap *vap) * may be being scheduled between sw->hw txq. Tsk. * * TODO: figure out why a new node gets allocated somewhere around - * here (after the ath_tx_swq() call; and after an ath_stop_locked() + * here (after the ath_tx_swq() call; and after an ath_stop() * call!) */ @@ -1824,7 +1781,7 @@ ath_vap_delete(struct ieee80211vap *vap) #endif free(avp, M_80211_VAP); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (sc->sc_running) { /* * Restart rx+tx machines if still running (RUNNING will * be reset if we just destroyed the last vap). @@ -1851,13 +1808,9 @@ ath_vap_delete(struct ieee80211vap *vap) void ath_suspend(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - - DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", - __func__, ifp->if_flags); + struct ieee80211com *ic = &sc->sc_ic; - sc->sc_resume_up = (ifp->if_flags & IFF_UP) != 0; + sc->sc_resume_up = ic->ic_nrunning != 0; ieee80211_suspend_all(ic); /* @@ -1898,8 +1851,7 @@ ath_suspend(struct ath_softc *sc) static void ath_reset_keycache(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; int i; @@ -1941,15 +1893,10 @@ ath_update_chainmasks(struct ath_softc * void ath_resume(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; - DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", - __func__, ifp->if_flags); - - /* Re-enable PCIe, re-enable the PCIe bus */ ath_hal_enablepcie(ah, 0, 0); /* @@ -2015,12 +1962,10 @@ ath_resume(struct ath_softc *sc) void ath_shutdown(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - - DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", - __func__, ifp->if_flags); - ath_stop(ifp); + ATH_LOCK(sc); + ath_stop(sc); + ATH_UNLOCK(sc); /* NB: no point powering down chip as we're about to reboot */ } @@ -2031,7 +1976,6 @@ void ath_intr(void *arg) { struct ath_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; struct ath_hal *ah = sc->sc_ah; HAL_INT status = 0; uint32_t txqs; @@ -2070,12 +2014,11 @@ ath_intr(void *arg) ath_power_set_power_state(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); - if ((ifp->if_flags & IFF_UP) == 0 || - (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + if (sc->sc_ic.ic_nrunning == 0 && sc->sc_running == 0) { HAL_INT status; - DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags 0x%x\n", - __func__, ifp->if_flags); + DPRINTF(sc, ATH_DEBUG_ANY, "%s: ic_nrunning %d sc_running %d\n", + __func__, sc->sc_ic.ic_nrunning, sc->sc_running); ath_hal_getisr(ah, &status); /* clear ISR */ ath_hal_intrset(ah, 0); /* disable further intr's */ ATH_PCU_UNLOCK(sc); @@ -2157,7 +2100,7 @@ ath_intr(void *arg) #ifdef IEEE80211_SUPPORT_TDMA if (sc->sc_tdma) { if (sc->sc_tdmaswba == 0) { - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); ath_tdma_beacon_send(sc, vap); @@ -2313,7 +2256,6 @@ static void ath_fatal_proc(void *arg, int pending) { struct ath_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; u_int32_t *state; u_int32_t len; void *sp; @@ -2334,7 +2276,7 @@ ath_fatal_proc(void *arg, int pending) "0x%08x 0x%08x 0x%08x, 0x%08x 0x%08x 0x%08x\n", state[0], state[1] , state[2], state[3], state[4], state[5]); } - ath_reset(ifp, ATH_RESET_NOLOSS); + ath_reset(sc, ATH_RESET_NOLOSS); } static void @@ -2418,7 +2360,6 @@ static void ath_bmiss_proc(void *arg, int pending) { struct ath_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; uint32_t hangs; DPRINTF(sc, ATH_DEBUG_ANY, "%s: pending %u\n", __func__, pending); @@ -2436,12 +2377,12 @@ ath_bmiss_proc(void *arg, int pending) * to clear. */ if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0) { - ath_reset(ifp, ATH_RESET_NOLOSS); + ath_reset(sc, ATH_RESET_NOLOSS); device_printf(sc->sc_dev, "bb hang detected (0x%x), resetting\n", hangs); } else { - ath_reset(ifp, ATH_RESET_NOLOSS); - ieee80211_beacon_miss(ifp->if_l2com); + ath_reset(sc, ATH_RESET_NOLOSS); + ieee80211_beacon_miss(&sc->sc_ic); } /* Force a beacon resync, in case they've drifted */ @@ -2461,8 +2402,7 @@ ath_bmiss_proc(void *arg, int pending) static void ath_settkipmic(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; if ((ic->ic_cryptocaps & IEEE80211_CRYPTO_TKIP) && !sc->sc_wmetkipmic) { if (ic->ic_flags & IEEE80211_F_WME) { @@ -2475,19 +2415,15 @@ ath_settkipmic(struct ath_softc *sc) } } -static void -ath_init(void *arg) +static int +ath_init(struct ath_softc *sc) { - struct ath_softc *sc = (struct ath_softc *) arg; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; - DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags 0x%x\n", - __func__, ifp->if_flags); + ATH_LOCK_ASSERT(sc); - ATH_LOCK(sc); /* * Force the sleep state awake. */ @@ -2499,7 +2435,7 @@ ath_init(void *arg) * Stop anything previously setup. This is safe * whether this is the first time through or not. */ - ath_stop_locked(ifp); + ath_stop(sc); /* * The basic interface to setting the hardware in a good @@ -2517,8 +2453,7 @@ ath_init(void *arg) &status)) { device_printf(sc->sc_dev, "unable to reset hardware; hal status %u\n", status); - ATH_UNLOCK(sc); - return; + return (ENODEV); } ATH_RX_LOCK(sc); @@ -2576,8 +2511,7 @@ ath_init(void *arg) if (ath_startrecv(sc) != 0) { device_printf(sc->sc_dev, "unable to start recv logic\n"); ath_power_restore_power_state(sc); - ATH_UNLOCK(sc); - return; + return (ENODEV); } /* @@ -2625,30 +2559,20 @@ ath_init(void *arg) DPRINTF(sc, ATH_DEBUG_RESET, "%s: imask=0x%x\n", __func__, sc->sc_imask); - ifp->if_drv_flags |= IFF_DRV_RUNNING; + sc->sc_running = 1; callout_reset(&sc->sc_wd_ch, hz, ath_watchdog, sc); ath_hal_intrset(ah, sc->sc_imask); ath_power_restore_power_state(sc); - ATH_UNLOCK(sc); -#ifdef ATH_TX99_DIAG - if (sc->sc_tx99 != NULL) - sc->sc_tx99->start(sc->sc_tx99); - else -#endif - ieee80211_start_all(ic); /* start all vap's */ + return (0); } static void -ath_stop_locked(struct ifnet *ifp) +ath_stop(struct ath_softc *sc) { - struct ath_softc *sc = ifp->if_softc; struct ath_hal *ah = sc->sc_ah; - DPRINTF(sc, ATH_DEBUG_ANY, "%s: invalid %u if_flags 0x%x\n", - __func__, sc->sc_invalid, ifp->if_flags); - ATH_LOCK_ASSERT(sc); /* @@ -2656,7 +2580,7 @@ ath_stop_locked(struct ifnet *ifp) */ ath_power_set_power_state(sc, HAL_PM_AWAKE); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (sc->sc_running) { /* * Shutdown the hardware and driver: * reset 802.11 state machine @@ -2678,7 +2602,7 @@ ath_stop_locked(struct ifnet *ifp) #endif callout_stop(&sc->sc_wd_ch); sc->sc_wd_timer = 0; - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + sc->sc_running = 0; if (!sc->sc_invalid) { if (sc->sc_softled) { callout_stop(&sc->sc_ledtimer); @@ -2826,20 +2750,6 @@ ath_reset_grablock(struct ath_softc *sc, #undef MAX_RESET_ITERATIONS /* - * XXX TODO: write ath_reset_releaselock - */ - -static void -ath_stop(struct ifnet *ifp) -{ - struct ath_softc *sc = ifp->if_softc; - - ATH_LOCK(sc); - ath_stop_locked(ifp); - ATH_UNLOCK(sc); -} - -/* * Reset the hardware w/o losing operational state. This is * basically a more efficient way of doing ath_stop, ath_init, * followed by state transitions to the current 802.11 @@ -2847,10 +2757,9 @@ ath_stop(struct ifnet *ifp) * to reset or reload hardware state. */ int -ath_reset(struct ifnet *ifp, ATH_RESET_TYPE reset_type) +ath_reset(struct ath_softc *sc, ATH_RESET_TYPE reset_type) { - struct ieee80211com *ic = ifp->if_l2com; - struct ath_softc *sc = ic->ic_softc; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; int i; @@ -3012,15 +2921,6 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T } } - /* - * This may have been set during an ath_start() call which - * set this once it detected a concurrent TX was going on. - * So, clear it. - */ - IF_LOCK(&ifp->if_snd); - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); - ATH_LOCK(sc); ath_power_restore_power_state(sc); ATH_UNLOCK(sc); @@ -3042,7 +2942,6 @@ static int ath_reset_vap(struct ieee80211vap *vap, u_long cmd) { struct ieee80211com *ic = vap->iv_ic; - struct ifnet *ifp = ic->ic_ifp; struct ath_softc *sc = ic->ic_softc; struct ath_hal *ah = sc->sc_ah; @@ -3058,7 +2957,7 @@ ath_reset_vap(struct ieee80211vap *vap, return 0; } /* XXX? Full or NOLOSS? */ - return ath_reset(ifp, ATH_RESET_FULL); + return ath_reset(sc, ATH_RESET_FULL); } struct ath_buf * @@ -3218,24 +3117,12 @@ ath_getbuf(struct ath_softc *sc, ath_buf bf = _ath_getbuf_locked(sc, ATH_BUFTYPE_NORMAL); ATH_TXBUF_UNLOCK(sc); if (bf == NULL) { - struct ifnet *ifp = sc->sc_ifp; - DPRINTF(sc, ATH_DEBUG_XMIT, "%s: stop queue\n", __func__); sc->sc_stats.ast_tx_qstop++; - IF_LOCK(&ifp->if_snd); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); } return bf; } -static void -ath_qflush(struct ifnet *ifp) -{ - - /* XXX TODO */ -} - /* * Transmit a single frame. * @@ -3243,9 +3130,8 @@ ath_qflush(struct ifnet *ifp) * fails, so don't free the node reference here. */ static int -ath_transmit(struct ifnet *ifp, struct mbuf *m) +ath_transmit(struct ieee80211com *ic, struct mbuf *m) { - struct ieee80211com *ic = ifp->if_l2com; struct ath_softc *sc = ic->ic_softc; struct ieee80211_node *ni; struct mbuf *next; @@ -3261,10 +3147,7 @@ ath_transmit(struct ifnet *ifp, struct m DPRINTF(sc, ATH_DEBUG_XMIT, "%s: sc_inreset_cnt > 0; bailing\n", __func__); ATH_PCU_UNLOCK(sc); - IF_LOCK(&ifp->if_snd); sc->sc_stats.ast_tx_qstop++; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: OACTIVE, finish"); return (ENOBUFS); /* XXX should be EINVAL or? */ } @@ -3304,8 +3187,6 @@ ath_transmit(struct ifnet *ifp, struct m if ((!(m->m_flags & M_EAPOL)) && (ATH_NODE(ni)->an_swq_depth > sc->sc_txq_node_maxdepth)) { sc->sc_stats.ast_tx_nodeq_overflow++; - m_freem(m); - m = NULL; retval = ENOBUFS; goto finish; } @@ -3329,8 +3210,6 @@ ath_transmit(struct ifnet *ifp, struct m if ((!(m->m_flags & M_EAPOL)) && (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree)) { sc->sc_stats.ast_tx_nobuf++; - m_freem(m); - m = NULL; retval = ENOBUFS; goto finish; } @@ -3358,11 +3237,6 @@ ath_transmit(struct ifnet *ifp, struct m * above. */ sc->sc_stats.ast_tx_nobuf++; - IF_LOCK(&ifp->if_snd); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IF_UNLOCK(&ifp->if_snd); - m_freem(m); - m = NULL; retval = ENOBUFS; goto finish; } @@ -3384,8 +3258,13 @@ ath_transmit(struct ifnet *ifp, struct m DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of txfrag buffers\n", __func__); sc->sc_stats.ast_tx_nofrag++; - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + /* + * XXXGL: is mbuf valid after ath_txfrag_setup? If yes, + * we shouldn't free it but return back. + */ ath_freetx(m); + m = NULL; goto bad; } @@ -3427,12 +3306,6 @@ ath_transmit(struct ifnet *ifp, struct m } } - /* - * Bump the ifp output counter. - * - * XXX should use atomics? - */ - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); nextfrag: /* * Pass the frame to the h/w for transmission. @@ -3452,7 +3325,7 @@ nextfrag: next = m->m_nextpkt; if (ath_tx_start(sc, ni, bf, m)) { bad: - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); reclaim: bf->bf_m = NULL; bf->bf_node = NULL; @@ -3576,32 +3449,41 @@ ath_update_promisc(struct ieee80211com * static void ath_update_mcast_hw(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = &sc->sc_ic; u_int32_t mfilt[2]; /* calculate and install multicast filter */ - if ((ifp->if_flags & IFF_ALLMULTI) == 0) { + if (ic->ic_allmulti == 0) { + struct ieee80211vap *vap; + struct ifnet *ifp; struct ifmultiaddr *ifma; + /* * Merge multicast addresses to form the hardware filter. */ mfilt[0] = mfilt[1] = 0; - if_maddr_rlock(ifp); /* XXX need some fiddling to remove? */ - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - caddr_t dl; - u_int32_t val; - u_int8_t pos; - - /* calculate XOR of eight 6bit values */ - dl = LLADDR((struct sockaddr_dl *) ifma->ifma_addr); - val = LE_READ_4(dl + 0); - pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; - val = LE_READ_4(dl + 3); - pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; - pos &= 0x3f; - mfilt[pos / 32] |= (1 << (pos % 32)); + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + ifp = vap->iv_ifp; + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + caddr_t dl; + uint32_t val; + uint8_t pos; + + /* calculate XOR of eight 6bit values */ + dl = LLADDR((struct sockaddr_dl *) + ifma->ifma_addr); + val = LE_READ_4(dl + 0); + pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ + val; + val = LE_READ_4(dl + 3); + pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ + val; + pos &= 0x3f; + mfilt[pos / 32] |= (1 << (pos % 32)); + } + if_maddr_runlock(ifp); } - if_maddr_runlock(ifp); } else mfilt[0] = mfilt[1] = ~0; @@ -3634,7 +3516,7 @@ ath_update_mcast(struct ieee80211com *ic void ath_mode_init(struct ath_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; u_int32_t rfilt; @@ -3645,15 +3527,8 @@ ath_mode_init(struct ath_softc *sc) /* configure operational mode */ ath_hal_setopmode(ah); - DPRINTF(sc, ATH_DEBUG_STATE | ATH_DEBUG_MODE, - "%s: ah=%p, ifp=%p, if_addr=%p\n", - __func__, - ah, - ifp, - (ifp == NULL) ? NULL : ifp->if_addr); - /* handle any link-level address change */ - ath_hal_setmac(ah, IF_LLADDR(ifp)); + ath_hal_setmac(ah, ic->ic_macaddr); /* calculate and install multicast filter */ ath_update_mcast_hw(sc); @@ -3665,7 +3540,7 @@ ath_mode_init(struct ath_softc *sc) void ath_setslottime(struct ath_softc *sc) { - struct ieee80211com *ic = sc->sc_ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; u_int usec; @@ -3749,12 +3624,11 @@ static void ath_reset_proc(void *arg, int pending) { struct ath_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; #if 0 device_printf(sc->sc_dev, "%s: resetting\n", __func__); #endif - ath_reset(ifp, ATH_RESET_NOLOSS); + ath_reset(sc, ATH_RESET_NOLOSS); } /* @@ -3764,7 +3638,6 @@ static void ath_bstuck_proc(void *arg, int pending) { struct ath_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; uint32_t hangs = 0; if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0) @@ -3782,7 +3655,7 @@ ath_bstuck_proc(void *arg, int pending) * This assumes that there's no simultaneous channel mode change * occuring. */ - ath_reset(ifp, ATH_RESET_NOLOSS); + ath_reset(sc, ATH_RESET_NOLOSS); } static void @@ -4344,8 +4217,7 @@ ath_txq_update(struct ath_softc *sc, int { #define ATH_EXPONENT_TO_VALUE(v) ((1<sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; struct ath_txq *txq = sc->sc_ac2q[ac]; struct wmeParams *wmep = &ic->ic_wme.wme_chanParams.cap_wmeParams[ac]; struct ath_hal *ah = sc->sc_ah; @@ -4469,8 +4341,7 @@ ath_tx_update_stats(struct ath_softc *sc struct ath_buf *bf) { struct ieee80211_node *ni = bf->bf_node; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = &sc->sc_ic; int sr, lr, pri; if (ts->ts_status == 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Aug 27 08:58:04 2015 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 241CC9C3BC4; Thu, 27 Aug 2015 08:58:04 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 14DF3844; Thu, 27 Aug 2015 08:58:04 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R8w3pV046190; Thu, 27 Aug 2015 08:58:03 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R8w30Q046189; Thu, 27 Aug 2015 08:58:03 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201508270858.t7R8w30Q046189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Thu, 27 Aug 2015 08:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287198 - 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.20 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, 27 Aug 2015 08:58:04 -0000 Author: jch Date: Thu Aug 27 08:58:03 2015 New Revision: 287198 URL: https://svnweb.freebsd.org/changeset/base/287198 Log: In callout_stop(), do not forget to initialize not_running variable. Thanks to hselasky for noticing that. Differential Revision: https://reviews.freebsd.org/D3078 (Updated) Submitted by: hselasky Pointy hat to: jch Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Thu Aug 27 08:56:39 2015 (r287197) +++ head/sys/kern/kern_timeout.c Thu Aug 27 08:58:03 2015 (r287198) @@ -1385,7 +1385,8 @@ again: * and indeed impossible to stop then return 0. */ not_running = !(cc_exec_curr(cc, direct) == c); - } + } else + not_running = 1; CC_UNLOCK(cc); return (not_running); From owner-svn-src-head@freebsd.org Thu Aug 27 09:01:33 2015 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 640549C3FC4 for ; Thu, 27 Aug 2015 09:01:33 +0000 (UTC) (envelope-from julien@jch.io) Received: from mail-qg0-f52.google.com (mail-qg0-f52.google.com [209.85.192.52]) (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 1A811BF6 for ; Thu, 27 Aug 2015 09:01:32 +0000 (UTC) (envelope-from julien@jch.io) Received: by qgj62 with SMTP id 62so7044912qgj.2 for ; Thu, 27 Aug 2015 02:01:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=Hiwx4ePXnV0gdmAO4g3NcVbkop0yrkrPwcgT0UJLSuI=; b=mqKvVLAzzzhvEP9UzDiXeXuhk6cJinu/R11liXURC0CFEJrEhIhuqHaD6GwP3JfRz8 fXySUixvmDWUgiUv1a0mf5NkfqEG2+sAiqx6P2dEVjH35TxPF5DTX1vxE1YGYg8IhaV0 rhJx23URX5l6bioa693dAKvlyT+MHyiFNVBk4w8ECiKXB7dU1TKjMP5pg/Pf1hTicllv A3Sr8ANfDfDVdMzszjqGeoQ3FtreVtdQ+NlGBxzVs9fWHnDMId3hHEDF5BvDRq9iZ9am ExurxboloFZm1r0wgbM/CjOdPXcHTq7WXmeoTj9ilDdfmaV0pbBLz7VzhQdf9tfSU/oL +lWQ== X-Gm-Message-State: ALoCoQnqQNrBNEbgBPo5q9iMMMMRpk9rQsnKIknM2nHN4SCEHK5iz59BzE0oMhTT3PUjQJ8z5eTy X-Received: by 10.140.194.17 with SMTP id p17mr5042316qha.62.1440666085860; Thu, 27 Aug 2015 02:01:25 -0700 (PDT) Received: from FRI2JCHARBON-M1.local (h87.s239.verisign.com. [216.168.239.87]) by smtp.googlemail.com with ESMTPSA id t69sm914697qki.11.2015.08.27.02.01.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2015 02:01:25 -0700 (PDT) Subject: Re: svn commit: r286880 - head/sys/kern To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Baldwin , Adrian Chadd References: <201508181015.t7IAFAex055889@repo.freebsd.org> <55DD69E5.4090904@selasky.org> <55DD74EB.30601@selasky.org> <55DE01F7.8040508@freebsd.org> <55DE0615.5050303@selasky.org> From: Julien Charbon X-Enigmail-Draft-Status: N1110 Message-ID: <55DED1E3.3090004@freebsd.org> Date: Thu, 27 Aug 2015 11:01:23 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55DE0615.5050303@selasky.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4R9tPBdsfipjFOhLP6q0450aqq7PicPxq" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 27 Aug 2015 09:01:33 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4R9tPBdsfipjFOhLP6q0450aqq7PicPxq Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Hans, On 26/08/15 20:31, Hans Petter Selasky wrote: > On 08/26/15 20:14, Julien Charbon wrote: >> Let say that if nobody screams until Friday 8/28, I will put back >> r284245 and revert this change_and_ I will make this case clear in th= e >> man page. >=20 > If you can update the manual page about this special case for MPSAFE > callouts only I presume, then its totally fine. Good idea, I am going to update the callout(9) man page to make clear that in mpsafe case if a callout is pending and currently being serviced callout_stop() returns 0 (fail). > Then I can update my projects/hps_head to follow that new change, > which now is a bit broken. You might also want to check existing > MPSAFE consumers in the kernel, if this API change makes any > difference. I checked all the mpsafe callouts that check callout_stop() return value (actually only a few are testing callout_stop() return value), and none relies on the old behavior (i.e. before r286880). > I was thinking if user-space TCP might be affected by this. CC'ing Adri= an. Interesting. -- Julien --4R9tPBdsfipjFOhLP6q0450aqq7PicPxq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJV3tHjAAoJEKVlQ5Je6dhxubYH/A4MsY+FJnJAzbwqiOF2Hub1 mIKHGurrsBTbIsv3E3rOyBFDdu7cK0vMulwmbNWSLzoyviCK14FMIn+LCkhYEKTl NMrXbVR1wSfP7DcrOM1JvqV+PyKRjhyAKPrhTfHlR7SwfTxypFof8d+1c9JvyWY+ SAqSqqNUIEBr4qf+ksVFWKm6qv3a0wZjnVUwtkGSjBQgTtvjKUUvM7SUv8cV6HJV 0y4a9pP/06nwXV08TQ2pZv9Ew8x8IDQ6LvAr2uKLOEIGKXXcF+wyc4HZE3sZx3cv md7jOOAwsTOon9FpwWsLkEQbb7Xhi/w4Xw412/hzJQ0449xzyCV4NF8519Pq3hQ= =khMM -----END PGP SIGNATURE----- --4R9tPBdsfipjFOhLP6q0450aqq7PicPxq-- From owner-svn-src-head@freebsd.org Thu Aug 27 10:43:36 2015 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 099009C23DD; Thu, 27 Aug 2015 10:43:36 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 EEB2F860; Thu, 27 Aug 2015 10:43:35 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RAhZOV091855; Thu, 27 Aug 2015 10:43:35 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RAhZSF091854; Thu, 27 Aug 2015 10:43:35 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201508271043.t7RAhZSF091854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Thu, 27 Aug 2015 10:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287200 - 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.20 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, 27 Aug 2015 10:43:36 -0000 Author: jch Date: Thu Aug 27 10:43:35 2015 New Revision: 287200 URL: https://svnweb.freebsd.org/changeset/base/287200 Log: Silent a compilation warning on callout_stop() Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Thu Aug 27 09:06:14 2015 (r287199) +++ head/sys/kern/kern_timeout.c Thu Aug 27 10:43:35 2015 (r287200) @@ -1150,7 +1150,8 @@ _callout_stop_safe(struct callout *c, in struct callout_cpu *cc, *old_cc; struct lock_class *class; int direct, sq_locked, use_lock; - int not_on_a_list, not_running; + int not_on_a_list; + int not_running = 1; if (safe) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock, @@ -1385,8 +1386,7 @@ again: * and indeed impossible to stop then return 0. */ not_running = !(cc_exec_curr(cc, direct) == c); - } else - not_running = 1; + } CC_UNLOCK(cc); return (not_running); From owner-svn-src-head@freebsd.org Thu Aug 27 10:49:51 2015 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 EF2A29C2560; Thu, 27 Aug 2015 10:49:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 66B2EA8F; Thu, 27 Aug 2015 10:49:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t7RAnkjj001738 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 27 Aug 2015 13:49:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t7RAnkjj001738 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t7RAnknD001737; Thu, 27 Aug 2015 13:49:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 27 Aug 2015 13:49:46 +0300 From: Konstantin Belousov To: Julien Charbon Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Baldwin Subject: Re: svn commit: r286880 - head/sys/kern Message-ID: <20150827104946.GH2072@kib.kiev.ua> References: <201508181015.t7IAFAex055889@repo.freebsd.org> <55DD69E5.4090904@selasky.org> <55DD74EB.30601@selasky.org> <55DE01F7.8040508@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55DE01F7.8040508@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 27 Aug 2015 10:49:52 -0000 On Wed, Aug 26, 2015 at 08:14:15PM +0200, Julien Charbon wrote: > As I said, I am not opposed to back out this change, callout(9) API in > mpsafe mode is a already complex/subtle API, it won't change too much > the current complexity. > > Let say that if nobody screams until Friday 8/28, I will put back > r284245 and revert this change _and_ I will make this case clear in the > man page. [Replying to a random message in the whole set of conversations] There is one more case, besides TCP timers, which is equially, of not more, critical and sensitive WRT to the callout_stop(). Look at the sys/kern/subr_sleepqueue.c:sleepq_check_timeout(). Stray return of the false result from callout_stop() causes creation of the non-killable processes: the callout fired, we missed the wakeup and went to sleep by manually doing the context switch. Such thread cannot be woken up. I suspect that your fix is a better approach than my attempt to look at something similar at PR 200992 (may be not). From owner-svn-src-head@freebsd.org Thu Aug 27 13:08:46 2015 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 8849F9C4581; Thu, 27 Aug 2015 13:08:46 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 591C1973; Thu, 27 Aug 2015 13:08:46 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RD8kHP049586; Thu, 27 Aug 2015 13:08:46 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RD8k1q049585; Thu, 27 Aug 2015 13:08:46 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508271308.t7RD8k1q049585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 27 Aug 2015 13:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287202 - head/sys/dev/mmc/host 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.20 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, 27 Aug 2015 13:08:46 -0000 Author: andrew Date: Thu Aug 27 13:08:45 2015 New Revision: 287202 URL: https://svnweb.freebsd.org/changeset/base/287202 Log: Allow us to select the transfer count. This allows us to work with hardware that seems to only work with a single block at a time. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Thu Aug 27 11:21:34 2015 (r287201) +++ head/sys/dev/mmc/host/dwmmc.c Thu Aug 27 13:08:45 2015 (r287202) @@ -111,8 +111,8 @@ struct idmac_desc { uint32_t des3; /* buf2 phys addr or next descr */ }; -#define DESC_COUNT 256 -#define DESC_SIZE (sizeof(struct idmac_desc) * DESC_COUNT) +#define DESC_MAX 256 +#define DESC_SIZE (sizeof(struct idmac_desc) * DESC_MAX) #define DEF_MSIZE 0x2 /* Burst size of multiple transaction */ struct dwmmc_softc { @@ -130,6 +130,7 @@ struct dwmmc_softc { uint32_t use_auto_stop; uint32_t use_pio; uint32_t pwren_inverted; + u_int desc_count; bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; @@ -283,10 +284,10 @@ dma_setup(struct dwmmc_softc *sc) return (1); } - for (idx = 0; idx < DESC_COUNT; idx++) { + for (idx = 0; idx < sc->desc_count; idx++) { sc->desc_ring[idx].des0 = DES0_CH; sc->desc_ring[idx].des1 = 0; - nidx = (idx + 1) % DESC_COUNT; + nidx = (idx + 1) % sc->desc_count; sc->desc_ring[idx].des3 = sc->desc_ring_paddr + \ (nidx * sizeof(struct idmac_desc)); } @@ -297,8 +298,8 @@ dma_setup(struct dwmmc_softc *sc) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - DESC_COUNT*MMC_SECTOR_SIZE, /* maxsize */ - DESC_COUNT, /* nsegments */ + sc->desc_count * MMC_SECTOR_SIZE, /* maxsize */ + sc->desc_count, /* nsegments */ MMC_SECTOR_SIZE, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ @@ -578,6 +579,7 @@ dwmmc_attach(device_t dev) sc->use_pio = 0; sc->pwren_inverted = 0; + sc->desc_count = DESC_MAX; if ((sc->hwtype & HWTYPE_MASK) == HWTYPE_ROCKCHIP) { sc->use_pio = 1; @@ -1131,7 +1133,7 @@ dwmmc_read_ivar(device_t bus, device_t c *(int *)result = sc->host.caps; break; case MMCBR_IVAR_MAX_DATA: - *(int *)result = DESC_COUNT; + *(int *)result = sc->desc_count; } return (0); } From owner-svn-src-head@freebsd.org Thu Aug 27 14:00:17 2015 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 92FDA9C2C3F; Thu, 27 Aug 2015 14:00:17 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8409B15D4; Thu, 27 Aug 2015 14:00:17 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RE0Hks071301; Thu, 27 Aug 2015 14:00:17 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RE0HiA071300; Thu, 27 Aug 2015 14:00:17 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201508271400.t7RE0HiA071300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Thu, 27 Aug 2015 14:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287204 - head/usr.bin/vi/catalog 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.20 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, 27 Aug 2015 14:00:17 -0000 Author: kan Date: Thu Aug 27 14:00:16 2015 New Revision: 287204 URL: https://svnweb.freebsd.org/changeset/base/287204 Log: Unbreak nvi message catalog generation for 8 bit locales. Feeding any file encoded in 8 bit locales such as KOI8-RU to sort utility running under UTF-8 locale produces astonishing result of recoding the output to UTF-8. To counter that, just run sort under 'C' locale for now. Modified: head/usr.bin/vi/catalog/Makefile Modified: head/usr.bin/vi/catalog/Makefile ============================================================================== --- head/usr.bin/vi/catalog/Makefile Thu Aug 27 13:17:05 2015 (r287203) +++ head/usr.bin/vi/catalog/Makefile Thu Aug 27 14:00:16 2015 (r287204) @@ -32,9 +32,9 @@ CAT+= $c.UTF-8 .for c in ${CAT} ${c}: ${c}.base - @echo "... $c"; \ + echo "... $c"; \ rm -f $c; \ - sort -u ${.ALLSRC} | \ + env LANG=C sort -u ${.ALLSRC} | \ awk '{ \ if ($$1 == 1) { \ print "\nMESSAGE NUMBER 1 IS NOT LEGAL"; \ @@ -44,7 +44,7 @@ ${c}: ${c}.base print "DUPLICATE MESSAGE NUMBER " $$1; \ exit 1; \ } \ - print $0; \ + print $$0; \ }' | \ sed -e '1s/^/$$set 1~$$quote "~/; 1y/~/\n/' | \ gencat $c /dev/stdin; \ From owner-svn-src-head@freebsd.org Thu Aug 27 14:00:24 2015 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 25F0C9C2C6B; Thu, 27 Aug 2015 14:00:24 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 F27A117DC; Thu, 27 Aug 2015 14:00:23 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RE0NXk071390; Thu, 27 Aug 2015 14:00:23 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RE0Nbc071389; Thu, 27 Aug 2015 14:00:23 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201508271400.t7RE0Nbc071389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Thu, 27 Aug 2015 14:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287206 - 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.20 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, 27 Aug 2015 14:00:24 -0000 Author: kan Date: Thu Aug 27 14:00:23 2015 New Revision: 287206 URL: https://svnweb.freebsd.org/changeset/base/287206 Log: Repair sys/cdefs.h enough to be usable with GCC 5.x The __alloc_size and __alloc_align need to be defined to nothingness for lint, but the existing check is deficient and allows attributes with working __has_attrubute() to slip through. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Thu Aug 27 14:00:20 2015 (r287205) +++ head/sys/sys/cdefs.h Thu Aug 27 14:00:23 2015 (r287206) @@ -39,7 +39,6 @@ /* * Testing against Clang-specific extensions. */ - #ifndef __has_attribute #define __has_attribute(x) 0 #endif @@ -212,6 +211,8 @@ #define __unused #define __packed #define __aligned(x) +#define __alloc_align(x) +#define __alloc_size(x) #define __section(x) #define __weak_symbol #else @@ -236,6 +237,16 @@ #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #endif +#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) +#define __alloc_size(x) __attribute__((__alloc_size__(x))) +#else +#define __alloc_size(x) +#endif +#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9) +#define __alloc_align(x) __attribute__((__alloc_align__(x))) +#else +#define __alloc_align(x) +#endif #endif /* lint */ #if !__GNUC_PREREQ__(2, 95) @@ -371,24 +382,12 @@ #define __returns_twice #endif -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) -#define __alloc_size(x) __attribute__((__alloc_size__(x))) -#else -#define __alloc_size(x) -#endif - #if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ__(4, 6) #define __unreachable() __builtin_unreachable() #else #define __unreachable() ((void)0) #endif -#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9) -#define __alloc_align(x) __attribute__((__alloc_align__(x))) -#else -#define __alloc_align(x) -#endif - /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ #if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) #define __func__ NULL From owner-svn-src-head@freebsd.org Thu Aug 27 14:00:21 2015 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 32ED09C2C50; Thu, 27 Aug 2015 14:00:21 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 0A2D117CB; Thu, 27 Aug 2015 14:00:21 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RE0KYd071347; Thu, 27 Aug 2015 14:00:20 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RE0KNC071346; Thu, 27 Aug 2015 14:00:20 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201508271400.t7RE0KNC071346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Thu, 27 Aug 2015 14:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287205 - head/contrib/ncurses/ncurses/base 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.20 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, 27 Aug 2015 14:00:21 -0000 Author: kan Date: Thu Aug 27 14:00:20 2015 New Revision: 287205 URL: https://svnweb.freebsd.org/changeset/base/287205 Log: Make ncurses build with GCC 5.0 and up Merge the end result of two upstream changes: Original fix from 20141206: + modify MKlib_gen.sh to work around change in development version of gcc introduced here: https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html (reports by Marcus Shawcroft, Maohui Lei). Later fixed in different manner in 20150725: + use alternate workaround for gcc 5.x feature (adapted from patch by Mikhail Peselnik). Modified: head/contrib/ncurses/ncurses/base/MKlib_gen.sh Modified: head/contrib/ncurses/ncurses/base/MKlib_gen.sh ============================================================================== --- head/contrib/ncurses/ncurses/base/MKlib_gen.sh Thu Aug 27 14:00:16 2015 (r287204) +++ head/contrib/ncurses/ncurses/base/MKlib_gen.sh Thu Aug 27 14:00:20 2015 (r287205) @@ -2,10 +2,10 @@ # # MKlib_gen.sh -- generate sources from curses.h macro definitions # -# ($Id: MKlib_gen.sh,v 1.46 2011/06/04 19:14:08 tom Exp $) +# ($Id: MKlib_gen.sh,v 1.50 2015/08/07 00:48:24 tom Exp $) # ############################################################################## -# Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. # +# Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -66,6 +66,23 @@ preprocessor="$1 -DNCURSES_INTERNALS -I. AWK="$2" USE="$3" +# A patch discussed here: +# https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html +# introduces spurious #line markers into the preprocessor output. The result +# appears in gcc 5.0 and (with modification) in 5.1, making it necessary to +# determine if we are using gcc, and if so, what version because the proposed +# solution uses a nonstandard option. +PRG=`echo "$1" | $AWK '{ sub(/^[[:space:]]*/,""); sub(/[[:space:]].*$/, ""); print; }' || exit 0` +FSF=`"$PRG" --version 2>/dev/null || exit 0 | fgrep "Free Software Foundation" | head -n 1` +ALL=`"$PRG" -dumpversion 2>/dev/null || exit 0` +ONE=`echo "$ALL" | sed -e 's/\..*$//'` +if test -n "$FSF" && test -n "$ALL" && test -n "$ONE" ; then + if test $ONE -ge 5 ; then + echo ".. adding -P option to work around $PRG $ALL" >&2 + preprocessor="$preprocessor -P" + fi +fi + PID=$$ ED1=sed1_${PID}.sed ED2=sed2_${PID}.sed From owner-svn-src-head@freebsd.org Thu Aug 27 14:06:42 2015 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 351E89C303B; Thu, 27 Aug 2015 14:06:42 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (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 BFDB31DD7; Thu, 27 Aug 2015 14:06:41 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wicgk12 with SMTP id gk12so9877973wic.1; Thu, 27 Aug 2015 07:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=1pDvwtmrBa8faf+3U4nEMeLZx0Xa0A2uJmpPh9lrmqQ=; b=d55OcoqQXM0h8jI4tdNLoo1jUuw8eac9ZLQ/+tCHdYJmE9VKaXv2rcpz1TgTuBLBaE Z5BaQeL30KVSPJxSQX7AWIlXik5wbgvo3gLI2BL2NwDW/BeMXlFdh7joc6gRdJWvk6aY 2xWRr2fkiOpw+e3NniPwNers10litqa7qC4aeo4b6pzFdd37IJtMlNDVWwArWJpepD36 tAeWu8tQ3v4nFBUxI+jTCSfPG33E70JV0uJU1H6C+dVsqkhuTt8PyB/DaTKQK33dlreU WQtxK5Btn3VBL09X3NAu81Oa0QbussYNiVwRqPsBKZAHImKxXJx95ywsD51/OeZyhc2q PubQ== X-Received: by 10.194.204.163 with SMTP id kz3mr5477279wjc.28.1440684400115; Thu, 27 Aug 2015 07:06:40 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id nb10sm3796247wic.11.2015.08.27.07.06.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2015 07:06:38 -0700 (PDT) Sender: Baptiste Daroussin Date: Thu, 27 Aug 2015 16:06:37 +0200 From: Baptiste Daroussin To: Alexander Kabaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287204 - head/usr.bin/vi/catalog Message-ID: <20150827140636.GS93486@ivaldir.etoilebsd.net> References: <201508271400.t7RE0HiA071300@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NAmHCRPXNp23hR9r" Content-Disposition: inline In-Reply-To: <201508271400.t7RE0HiA071300@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 27 Aug 2015 14:06:42 -0000 --NAmHCRPXNp23hR9r Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 27, 2015 at 02:00:17PM +0000, Alexander Kabaev wrote: > Author: kan > Date: Thu Aug 27 14:00:16 2015 > New Revision: 287204 > URL: https://svnweb.freebsd.org/changeset/base/287204 >=20 > Log: > Unbreak nvi message catalog generation for 8 bit locales. > =20 > Feeding any file encoded in 8 bit locales such as KOI8-RU > to sort utility running under UTF-8 locale produces astonishing > result of recoding the output to UTF-8. To counter that, just > run sort under 'C' locale for now. That is because FreeBSD is missing multibyte collation support. and it solv= ed by using LC_COLLATE=3DC which is enforced by login.conf in head. Best regards, Bapt --NAmHCRPXNp23hR9r Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlXfGWwACgkQ8kTtMUmk6EwviQCcCND9szHnFh1m5zaoBKU7fd8Y /BsAoKZFDplBIQnt0SORj17uECTgiKR9 =oI7M -----END PGP SIGNATURE----- --NAmHCRPXNp23hR9r-- From owner-svn-src-head@freebsd.org Thu Aug 27 15:03:36 2015 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 2F63F9C44E5; Thu, 27 Aug 2015 15:03:36 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 209EB1CD0; Thu, 27 Aug 2015 15:03:36 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RF3aYj098908; Thu, 27 Aug 2015 15:03:36 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RF3ZYr098906; Thu, 27 Aug 2015 15:03:35 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201508271503.t7RF3ZYr098906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Thu, 27 Aug 2015 15:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287208 - in head/kerberos5: . lib/libhdb 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.20 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, 27 Aug 2015 15:03:36 -0000 Author: ume Date: Thu Aug 27 15:03:34 2015 New Revision: 287208 URL: https://svnweb.freebsd.org/changeset/base/287208 Log: Make it buildable with WITH_OPENLDAP, again. MFC after: 1 week Modified: head/kerberos5/Makefile.inc head/kerberos5/lib/libhdb/Makefile Modified: head/kerberos5/Makefile.inc ============================================================================== --- head/kerberos5/Makefile.inc Thu Aug 27 14:07:28 2015 (r287207) +++ head/kerberos5/Makefile.inc Thu Aug 27 15:03:34 2015 (r287208) @@ -13,7 +13,8 @@ OPENLDAPBASE?= /usr/local LDAPLDADD= -lldap -llber LDAPDPADD= ${LDAPLDADD:C;^-l(.*)$;${OPENLDAPBASE}/lib/lib\1.a;} LDAPCFLAGS= -I${OPENLDAPBASE}/include -DOPENLDAP=1 -DLDAP_DEPRECATED=1 -LDAPLDFLAGS= -L${OPENLDAPBASE}/lib -Wl,-rpath,${OPENLDAPBASE}/lib +LDAPLDFLAGS= -L${OPENLDAPBASE}/lib -rpath ${OPENLDAPBASE}/lib +LDFLAGS+= ${LDAPLDFLAGS} .endif .if defined(SRCS) Modified: head/kerberos5/lib/libhdb/Makefile ============================================================================== --- head/kerberos5/lib/libhdb/Makefile Thu Aug 27 14:07:28 2015 (r287207) +++ head/kerberos5/lib/libhdb/Makefile Thu Aug 27 15:03:34 2015 (r287208) @@ -1,9 +1,10 @@ # $FreeBSD$ LIB= hdb -LDFLAGS= -Wl,--no-undefined +LDFLAGS= -Wl,--no-undefined ${LDAPLDFLAGS} VERSION_MAP= ${KRB5DIR}/lib/hdb/version-script.map LIBADD= asn1 com_err krb5 roken sqlite3 +LDADD= ${LDAPLDADD} DPADD= ${LDAPDPADD} MAN= HDB.3 hdb_entry_ex.3 From owner-svn-src-head@freebsd.org Thu Aug 27 15:16:43 2015 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 7D75A9C48BE; Thu, 27 Aug 2015 15:16:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 6CC57393; Thu, 27 Aug 2015 15:16:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RFGh6f003415; Thu, 27 Aug 2015 15:16:43 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RFGgmM003410; Thu, 27 Aug 2015 15:16:42 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508271516.t7RFGgmM003410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 27 Aug 2015 15:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287209 - in head: share/man/man4 sys/compat/cloudabi sys/kern sys/sys usr.bin/procstat 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.20 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, 27 Aug 2015 15:16:43 -0000 Author: ed Date: Thu Aug 27 15:16:41 2015 New Revision: 287209 URL: https://svnweb.freebsd.org/changeset/base/287209 Log: Decompose linkat()/renameat() rights to source and target. To make it easier to understand how Capsicum interacts with linkat() and renameat(), rename the rights to CAP_{LINK,RENAME}AT_{SOURCE,TARGET}. This also addresses a shortcoming in Capsicum, where it isn't possible to disable linking to files stored in a directory. Creating hardlinks essentially makes it possible to access files with additional rights. Reviewed by: rwatson, wblock Differential Revision: https://reviews.freebsd.org/D3411 Modified: head/share/man/man4/rights.4 head/sys/compat/cloudabi/cloudabi_fd.c head/sys/kern/vfs_syscalls.c head/sys/sys/capsicum.h head/usr.bin/procstat/procstat_files.c Modified: head/share/man/man4/rights.4 ============================================================================== --- head/share/man/man4/rights.4 Thu Aug 27 15:03:34 2015 (r287208) +++ head/share/man/man4/rights.4 Thu Aug 27 15:16:41 2015 (r287209) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2015 +.Dd August 27, 2015 .Dt RIGHTS 4 .Os .Sh NAME @@ -71,7 +71,7 @@ The family of functions should be used to manage the structure. .Sh RIGHTS The following rights may be specified in a rights mask: -.Bl -tag -width CAP_EXTATTR_DELETE +.Bl -tag -width CAP_RENAMEAT_SOURCE .It Dv CAP_ACCEPT Permit .Xr accept 2 @@ -328,12 +328,28 @@ argument is non-NULL). .Dv CAP_EVENT is also required on file descriptors that will be monitored using .Xr kevent 2 . -.It Dv CAP_LINKAT +.It Dv CAP_LINKAT_SOURCE Permit .Xr linkat 2 -and -.Xr renameat 2 -on the destination directory descriptor. +on the source directory descriptor. +This right includes the +.Dv CAP_LOOKUP +right. +.Pp +Warning: +.Dv CAP_LINKAT_SOURCE +makes it possible to link files in a directory for which file +descriptors exist that have additional rights. +For example, +a file stored in a directory that does not allow +.Dv CAP_READ +may be linked in another directory that does allow +.Dv CAP_READ , +thereby granting read access to a file that is otherwise unreadable. +.It Dv CAP_LINKAT_TARGET +Permit +.Xr linkat 2 +on the target directory descriptor. This right includes the .Dv CAP_LOOKUP right. @@ -474,10 +490,28 @@ is also required) and related system cal .It Dv CAP_RECV An alias to .Dv CAP_READ . -.It Dv CAP_RENAMEAT +.It Dv CAP_RENAMEAT_SOURCE Permit -.Xr renameat 2 . -This right is required on the source directory descriptor. +.Xr renameat 2 +on the source directory descriptor. +This right includes the +.Dv CAP_LOOKUP +right. +.Pp +Warning: +.Dv CAP_RENAMEAT_SOURCE +makes it possible to move files to a directory for which file +descriptors exist that have additional rights. +For example, +a file stored in a directory that does not allow +.Dv CAP_READ +may be moved to another directory that does allow +.Dv CAP_READ , +thereby granting read access to a file that is otherwise unreadable. +.It Dv CAP_RENAMEAT_TARGET +Permit +.Xr renameat 2 +on the target directory descriptor. This right includes the .Dv CAP_LOOKUP right. Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Thu Aug 27 15:03:34 2015 (r287208) +++ head/sys/compat/cloudabi/cloudabi_fd.c Thu Aug 27 15:16:41 2015 (r287209) @@ -56,13 +56,13 @@ __FBSDID("$FreeBSD$"); MAPPING(CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY, CAP_MKDIRAT) \ MAPPING(CLOUDABI_RIGHT_FILE_CREATE_FILE, CAP_CREATE) \ MAPPING(CLOUDABI_RIGHT_FILE_CREATE_FIFO, CAP_MKFIFOAT) \ - MAPPING(CLOUDABI_RIGHT_FILE_LINK_SOURCE, CAP_LOOKUP) \ - MAPPING(CLOUDABI_RIGHT_FILE_LINK_TARGET, CAP_LINKAT) \ + MAPPING(CLOUDABI_RIGHT_FILE_LINK_SOURCE, CAP_LINKAT_SOURCE) \ + MAPPING(CLOUDABI_RIGHT_FILE_LINK_TARGET, CAP_LINKAT_TARGET) \ MAPPING(CLOUDABI_RIGHT_FILE_OPEN, CAP_LOOKUP) \ MAPPING(CLOUDABI_RIGHT_FILE_READDIR, CAP_READ) \ MAPPING(CLOUDABI_RIGHT_FILE_READLINK, CAP_LOOKUP) \ - MAPPING(CLOUDABI_RIGHT_FILE_RENAME_SOURCE, CAP_RENAMEAT) \ - MAPPING(CLOUDABI_RIGHT_FILE_RENAME_TARGET, CAP_LINKAT) \ + MAPPING(CLOUDABI_RIGHT_FILE_RENAME_SOURCE, CAP_RENAMEAT_SOURCE) \ + MAPPING(CLOUDABI_RIGHT_FILE_RENAME_TARGET, CAP_RENAMEAT_TARGET) \ MAPPING(CLOUDABI_RIGHT_FILE_STAT_FGET, CAP_FSTAT) \ MAPPING(CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE, CAP_FTRUNCATE) \ MAPPING(CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES, CAP_FUTIMES) \ Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Aug 27 15:03:34 2015 (r287208) +++ head/sys/kern/vfs_syscalls.c Thu Aug 27 15:16:41 2015 (r287209) @@ -1441,7 +1441,8 @@ kern_linkat(struct thread *td, int fd1, again: bwillwrite(); - NDINIT_AT(&nd, LOOKUP, follow | AUDITVNODE1, segflg, path1, fd1, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, segflg, path1, fd1, + cap_rights_init(&rights, CAP_LINKAT_SOURCE), td); if ((error = namei(&nd)) != 0) return (error); @@ -1451,9 +1452,9 @@ again: vrele(vp); return (EPERM); /* POSIX */ } - NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE2 | - NOCACHE, segflg, path2, fd2, cap_rights_init(&rights, CAP_LINKAT), - td); + NDINIT_ATRIGHTS(&nd, CREATE, + LOCKPARENT | SAVENAME | AUDITVNODE2 | NOCACHE, segflg, path2, fd2, + cap_rights_init(&rights, CAP_LINKAT_TARGET), td); if ((error = namei(&nd)) == 0) { if (nd.ni_vp != NULL) { NDFREE(&nd, NDF_ONLY_PNBUF); @@ -3461,10 +3462,11 @@ again: #ifdef MAC NDINIT_ATRIGHTS(&fromnd, DELETE, LOCKPARENT | LOCKLEAF | SAVESTART | AUDITVNODE1, pathseg, old, oldfd, - cap_rights_init(&rights, CAP_RENAMEAT), td); + cap_rights_init(&rights, CAP_RENAMEAT_SOURCE), td); #else NDINIT_ATRIGHTS(&fromnd, DELETE, WANTPARENT | SAVESTART | AUDITVNODE1, - pathseg, old, oldfd, cap_rights_init(&rights, CAP_RENAMEAT), td); + pathseg, old, oldfd, + cap_rights_init(&rights, CAP_RENAMEAT_SOURCE), td); #endif if ((error = namei(&fromnd)) != 0) @@ -3479,7 +3481,7 @@ again: fvp = fromnd.ni_vp; NDINIT_ATRIGHTS(&tond, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART | AUDITVNODE2, pathseg, new, newfd, - cap_rights_init(&rights, CAP_LINKAT), td); + cap_rights_init(&rights, CAP_RENAMEAT_TARGET), td); if (fromnd.ni_vp->v_type == VDIR) tond.ni_cnd.cn_flags |= WILLBEDIR; if ((error = namei(&tond)) != 0) { Modified: head/sys/sys/capsicum.h ============================================================================== --- head/sys/sys/capsicum.h Thu Aug 27 15:03:34 2015 (r287208) +++ head/sys/sys/capsicum.h Thu Aug 27 15:16:41 2015 (r287209) @@ -150,16 +150,16 @@ #define CAP_FUTIMES CAPRIGHT(0, 0x0000000000200000ULL) /* Allows for futimens(2), futimes(2), futimesat(2) and utimensat(2). */ #define CAP_FUTIMESAT (CAP_FUTIMES | CAP_LOOKUP) -/* Allows for linkat(2) and renameat(2) (destination directory descriptor). */ -#define CAP_LINKAT (CAP_LOOKUP | 0x0000000000400000ULL) +/* Allows for linkat(2) (target directory descriptor). */ +#define CAP_LINKAT_TARGET (CAP_LOOKUP | 0x0000000000400000ULL) /* Allows for mkdirat(2). */ #define CAP_MKDIRAT (CAP_LOOKUP | 0x0000000000800000ULL) /* Allows for mkfifoat(2). */ #define CAP_MKFIFOAT (CAP_LOOKUP | 0x0000000001000000ULL) /* Allows for mknodat(2). */ #define CAP_MKNODAT (CAP_LOOKUP | 0x0000000002000000ULL) -/* Allows for renameat(2). */ -#define CAP_RENAMEAT (CAP_LOOKUP | 0x0000000004000000ULL) +/* Allows for renameat(2) (source directory descriptor). */ +#define CAP_RENAMEAT_SOURCE (CAP_LOOKUP | 0x0000000004000000ULL) /* Allows for symlinkat(2). */ #define CAP_SYMLINKAT (CAP_LOOKUP | 0x0000000008000000ULL) /* @@ -197,6 +197,11 @@ /* Allows for connectat(2) on a directory descriptor. */ #define CAP_CONNECTAT (CAP_LOOKUP | 0x0000010000000000ULL) +/* Allows for linkat(2) (source directory descriptor). */ +#define CAP_LINKAT_SOURCE (CAP_LOOKUP | 0x0000020000000000ULL) +/* Allows for renameat(2) (target directory descriptor). */ +#define CAP_RENAMEAT_TARGET (CAP_LOOKUP | 0x0000040000000000ULL) + #define CAP_SOCK_CLIENT \ (CAP_CONNECT | CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT | \ CAP_PEELOFF | CAP_RECV | CAP_SEND | CAP_SETSOCKOPT | CAP_SHUTDOWN) @@ -206,10 +211,10 @@ CAP_SETSOCKOPT | CAP_SHUTDOWN) /* All used bits for index 0. */ -#define CAP_ALL0 CAPRIGHT(0, 0x000001FFFFFFFFFFULL) +#define CAP_ALL0 CAPRIGHT(0, 0x000007FFFFFFFFFFULL) /* Available bits for index 0. */ -#define CAP_UNUSED0_42 CAPRIGHT(0, 0x0000020000000000ULL) +#define CAP_UNUSED0_44 CAPRIGHT(0, 0x0000080000000000ULL) /* ... */ #define CAP_UNUSED0_57 CAPRIGHT(0, 0x0100000000000000ULL) Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Thu Aug 27 15:03:34 2015 (r287208) +++ head/usr.bin/procstat/procstat_files.c Thu Aug 27 15:16:41 2015 (r287209) @@ -158,11 +158,13 @@ static struct cap_desc { { CAP_FSTAT, "fs" }, { CAP_FSTATFS, "sf" }, { CAP_FUTIMES, "fu" }, - { CAP_LINKAT, "li" }, + { CAP_LINKAT_SOURCE, "ls" }, + { CAP_LINKAT_TARGET, "lt" }, { CAP_MKDIRAT, "md" }, { CAP_MKFIFOAT, "mf" }, { CAP_MKNODAT, "mn" }, - { CAP_RENAMEAT, "rn" }, + { CAP_RENAMEAT_SOURCE, "rs" }, + { CAP_RENAMEAT_TARGET, "rt" }, { CAP_SYMLINKAT, "sl" }, { CAP_UNLINKAT, "un" }, From owner-svn-src-head@freebsd.org Thu Aug 27 15:27:43 2015 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 526429C4C74; Thu, 27 Aug 2015 15:27:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 36F58DC1; Thu, 27 Aug 2015 15:27:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RFRhMa007631; Thu, 27 Aug 2015 15:27:43 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RFRgdK007626; Thu, 27 Aug 2015 15:27:42 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201508271527.t7RFRgdK007626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 27 Aug 2015 15:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287211 - in head/sys: netinet netinet6 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.20 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, 27 Aug 2015 15:27:43 -0000 Author: bz Date: Thu Aug 27 15:27:41 2015 New Revision: 287211 URL: https://svnweb.freebsd.org/changeset/base/287211 Log: get_inpcbinfo() and get_pcblist() are UDP local functions and do not do what one would expect by name. Prefix them with "udp_" to at least obviously limit the scope. This is a non-functional change. Reviewed by: gnn, rwatson MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3505 Modified: head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Aug 27 15:21:58 2015 (r287210) +++ head/sys/netinet/udp_usrreq.c Thu Aug 27 15:27:41 2015 (r287211) @@ -520,7 +520,7 @@ udp_input(struct mbuf **mp, int *offp, i } } - pcbinfo = get_inpcbinfo(proto); + pcbinfo = udp_get_inpcbinfo(proto); if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || in_broadcast(ip->ip_dst, ifp)) { struct inpcb *last; @@ -528,7 +528,7 @@ udp_input(struct mbuf **mp, int *offp, i struct ip_moptions *imo; INP_INFO_RLOCK(pcbinfo); - pcblist = get_pcblist(proto); + pcblist = udp_get_pcblist(proto); last = NULL; LIST_FOREACH(inp, pcblist, inp_list) { if (inp->inp_lport != uh->uh_dport) @@ -1243,7 +1243,7 @@ udp_output(struct inpcb *inp, struct mbu * XXXRW: Check that hash locking update here is correct. */ pr = inp->inp_socket->so_proto->pr_protocol; - pcbinfo = get_inpcbinfo(pr); + pcbinfo = udp_get_inpcbinfo(pr); sin = (struct sockaddr_in *)addr; if (sin != NULL && (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { @@ -1678,7 +1678,7 @@ udp_abort(struct socket *so) struct inpcb *inp; struct inpcbinfo *pcbinfo; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_abort: inp == NULL")); INP_WLOCK(inp); @@ -1699,7 +1699,7 @@ udp_attach(struct socket *so, int proto, struct inpcbinfo *pcbinfo; int error; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp == NULL, ("udp_attach: inp != NULL")); error = soreserve(so, udp_sendspace, udp_recvspace); @@ -1760,7 +1760,7 @@ udp_bind(struct socket *so, struct socka struct inpcbinfo *pcbinfo; int error; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_bind: inp == NULL")); INP_WLOCK(inp); @@ -1777,7 +1777,7 @@ udp_close(struct socket *so) struct inpcb *inp; struct inpcbinfo *pcbinfo; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_close: inp == NULL")); INP_WLOCK(inp); @@ -1799,7 +1799,7 @@ udp_connect(struct socket *so, struct so struct sockaddr_in *sin; int error; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_connect: inp == NULL")); INP_WLOCK(inp); @@ -1829,7 +1829,7 @@ udp_detach(struct socket *so) struct inpcbinfo *pcbinfo; struct udpcb *up; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_detach: inp == NULL")); KASSERT(inp->inp_faddr.s_addr == INADDR_ANY, @@ -1851,7 +1851,7 @@ udp_disconnect(struct socket *so) struct inpcb *inp; struct inpcbinfo *pcbinfo; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_disconnect: inp == NULL")); INP_WLOCK(inp); Modified: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Thu Aug 27 15:21:58 2015 (r287210) +++ head/sys/netinet/udp_var.h Thu Aug 27 15:27:41 2015 (r287211) @@ -150,13 +150,13 @@ VNET_DECLARE(int, udp_blackhole); extern int udp_log_in_vain; static __inline struct inpcbinfo * -get_inpcbinfo(int protocol) +udp_get_inpcbinfo(int protocol) { return (protocol == IPPROTO_UDP) ? &V_udbinfo : &V_ulitecbinfo; } static __inline struct inpcbhead * -get_pcblist(int protocol) +udp_get_pcblist(int protocol) { return (protocol == IPPROTO_UDP) ? &V_udb : &V_ulitecb; } Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Aug 27 15:21:58 2015 (r287210) +++ head/sys/netinet6/udp6_usrreq.c Thu Aug 27 15:27:41 2015 (r287211) @@ -282,7 +282,7 @@ udp6_input(struct mbuf **mp, int *offp, init_sin6(&fromsa, m); fromsa.sin6_port = uh->uh_sport; - pcbinfo = get_inpcbinfo(nxt); + pcbinfo = udp_get_inpcbinfo(nxt); if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { struct inpcb *last; struct inpcbhead *pcblist; @@ -304,7 +304,7 @@ udp6_input(struct mbuf **mp, int *offp, * here. We need udphdr for IPsec processing so we do that * later. */ - pcblist = get_pcblist(nxt); + pcblist = udp_get_pcblist(nxt); last = NULL; LIST_FOREACH(inp, pcblist, inp_list) { if ((inp->inp_vflag & INP_IPV6) == 0) @@ -908,7 +908,7 @@ udp6_abort(struct socket *so) struct inpcb *inp; struct inpcbinfo *pcbinfo; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp6_abort: inp == NULL")); @@ -940,7 +940,7 @@ udp6_attach(struct socket *so, int proto struct inpcbinfo *pcbinfo; int error; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp == NULL, ("udp6_attach: inp != NULL")); @@ -988,7 +988,7 @@ udp6_bind(struct socket *so, struct sock struct inpcbinfo *pcbinfo; int error; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp6_bind: inp == NULL")); @@ -1032,7 +1032,7 @@ udp6_close(struct socket *so) struct inpcb *inp; struct inpcbinfo *pcbinfo; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp6_close: inp == NULL")); @@ -1064,7 +1064,7 @@ udp6_connect(struct socket *so, struct s struct sockaddr_in6 *sin6; int error; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); sin6 = (struct sockaddr_in6 *)nam; KASSERT(inp != NULL, ("udp6_connect: inp == NULL")); @@ -1126,7 +1126,7 @@ udp6_detach(struct socket *so) struct inpcbinfo *pcbinfo; struct udpcb *up; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp6_detach: inp == NULL")); @@ -1147,7 +1147,7 @@ udp6_disconnect(struct socket *so) struct inpcbinfo *pcbinfo; int error; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp6_disconnect: inp == NULL")); @@ -1188,7 +1188,7 @@ udp6_send(struct socket *so, int flags, struct inpcbinfo *pcbinfo; int error = 0; - pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp6_send: inp == NULL")); From owner-svn-src-head@freebsd.org Thu Aug 27 16:04:45 2015 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 3343F9C39DF for ; Thu, 27 Aug 2015 16:04:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm43-vm4.bullet.mail.bf1.yahoo.com (nm43-vm4.bullet.mail.bf1.yahoo.com [216.109.114.223]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBBDC9B for ; Thu, 27 Aug 2015 16:04:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1440691476; bh=1W5onbuGuQkeLsQWZ/NWzN5arfjOsgV6nPRahUfrMxU=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=ayowMrBUAbCi1B1Rio4iSIrtdAK3DD5cth4jL02sbLj8K2AeCZrID+fxAb/rxxsn3TLNNO4IHORCCZhcbs8lgIqBIRKMSB5/s235D836a6q5axQT+q7uOlZgEDq0pwgqhYrw2NFK+6TrqWIjgzZLASmBy3KxU0KMtTkbWgKebdI+QoU2c8bFq2dPJ9FwITUgL8jQ6AT1rTeuTy1Qybc4P9sA0HpFr76BlVyVCtiHsuEhwRdXvMfYrQlLRerbCilo+HHIR49xhkkoJb/5cUJXaKNWI3kXFbFwFkYs9JXNaVL+iRc7/3ttdoiidPcy6b4FiOSsd8uPcKVzzgq1/fBL1Q== Received: from [98.139.215.142] by nm43.bullet.mail.bf1.yahoo.com with NNFMP; 27 Aug 2015 16:04:36 -0000 Received: from [98.139.211.199] by tm13.bullet.mail.bf1.yahoo.com with NNFMP; 27 Aug 2015 16:04:36 -0000 Received: from [127.0.0.1] by smtp208.mail.bf1.yahoo.com with NNFMP; 27 Aug 2015 16:04:36 -0000 X-Yahoo-Newman-Id: 939715.79942.bm@smtp208.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Mr4muu4VM1nMsZb7M72j6MGA.Vs9ZSl6aQiMv0Ri5uY_XeC 7xJiyLqRPhAQBeg.9M0sihW1dWJSe84PqjyNy_UJ4Iz2aZsPdSyG5oraLQEm k7QHCJKWoT9tyjLZVx4acNr2JzDjRj7pDY2F9GbhCCOAjMFieIpO9XmqFTg. dM.wgHBWcRTNAN1odrRyXRGWyGFipIBIzZiqDJBhhc61H2AepFk1MWGd6BV8 FWw7RGaSF8xfGkrOBJEbWoO4iZDTHwr6WLYpEPfYJAkvJvh5hsYQ5vlsQLZP DtQm_hvPkY2MDN3.lkR84KYmsKqKTRh8toEYAkiMPL.zNEJBVCoOCqtbQRmO pXcgCtLF9_0qgrv8mUvKHO6k_xupuaChxE6gwViToG9Q7clRBCkeIlh_TGYB Iz.rGRAZTELQm7zbWrYjTrmcJVH6BP3mez0cyzx7EXUgceYB92HZyLv1NaAS tBpuFPEyfIu7_H6stwkTy3F6aJLvKQaHYamMWSEXY_HLdKLFC2wFrpRGOWMv oqpF8UlENtx5Luoqb.75eG956b1fzpdX8 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r287206 - head/sys/sys To: Alexander Kabaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201508271400.t7RE0Nbc071389@repo.freebsd.org> From: Pedro Giffuni Message-ID: <55DF3519.1000106@FreeBSD.org> Date: Thu, 27 Aug 2015 11:04:41 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201508271400.t7RE0Nbc071389@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.20 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, 27 Aug 2015 16:04:45 -0000 Hello kan; On 08/27/15 09:00, Alexander Kabaev wrote: > Author: kan > Date: Thu Aug 27 14:00:23 2015 > New Revision: 287206 > URL: https://svnweb.freebsd.org/changeset/base/287206 > > Log: > Repair sys/cdefs.h enough to be usable with GCC 5.x > > The __alloc_size and __alloc_align need to be defined to > nothingness for lint, but the existing check is deficient > and allows attributes with working __has_attrubute() to > slip through. > AFAICT GCC hasn't added __has_attribute(), but if they did recently that is great news. > Modified: > head/sys/sys/cdefs.h > .. > #if !__GNUC_PREREQ__(2, 95) > @@ -371,24 +382,12 @@ > #define __returns_twice > #endif > > -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) > -#define __alloc_size(x) __attribute__((__alloc_size__(x))) > -#else > -#define __alloc_size(x) > -#endif > - This surely got through in GCC's case through the __GNUC_PREREQ__. Of course gcc 4.2 has neither attribute but clang has alloc_size so I wonder why it hasn't affected the lint builds. Just curiosity, the change is OK but it will be getting ugly if we have to add all the new attributes in the !lint section. Regards, Pedro. From owner-svn-src-head@freebsd.org Thu Aug 27 16:18:23 2015 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 5C5E59C3EF2; Thu, 27 Aug 2015 16:18:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4D151981; Thu, 27 Aug 2015 16:18:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RGINEo027801; Thu, 27 Aug 2015 16:18:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RGINpl027800; Thu, 27 Aug 2015 16:18:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508271618.t7RGINpl027800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 27 Aug 2015 16:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287212 - head/sys/dev/mmc/host 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.20 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, 27 Aug 2015 16:18:23 -0000 Author: andrew Date: Thu Aug 27 16:18:22 2015 New Revision: 287212 URL: https://svnweb.freebsd.org/changeset/base/287212 Log: Allow the fifo-depth and num-slots to be missing. For the former we read the value from the hardware, for the latter assume a single slot. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Thu Aug 27 15:27:41 2015 (r287211) +++ head/sys/dev/mmc/host/dwmmc.c Thu Aug 27 16:18:22 2015 (r287212) @@ -466,16 +466,17 @@ parse_fdt(struct dwmmc_softc *sc) return (ENXIO); /* fifo-depth */ - if ((len = OF_getproplen(node, "fifo-depth")) <= 0) - return (ENXIO); - OF_getencprop(node, "fifo-depth", dts_value, len); - sc->fifo_depth = dts_value[0]; + if ((len = OF_getproplen(node, "fifo-depth")) > 0) { + OF_getencprop(node, "fifo-depth", dts_value, len); + sc->fifo_depth = dts_value[0]; + } /* num-slots */ - if ((len = OF_getproplen(node, "num-slots")) <= 0) - return (ENXIO); - OF_getencprop(node, "num-slots", dts_value, len); - sc->num_slots = dts_value[0]; + sc->num_slots = 1; + if ((len = OF_getproplen(node, "num-slots")) > 0) { + OF_getencprop(node, "num-slots", dts_value, len); + sc->num_slots = dts_value[0]; + } /* * We need some platform-specific code to know @@ -610,6 +611,13 @@ dwmmc_attach(device_t dev) dwmmc_setup_bus(sc, sc->host.f_min); + if (sc->fifo_depth == 0) { + sc->fifo_depth = 1 + + ((READ4(sc, SDMMC_FIFOTH) >> SDMMC_FIFOTH_RXWMARK_S) & 0xfff); + device_printf(dev, "No fifo-depth, using FIFOTH %x\n", + sc->fifo_depth); + } + if (!sc->use_pio) { if (dma_setup(sc)) return (ENXIO); From owner-svn-src-head@freebsd.org Thu Aug 27 16:24:31 2015 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 B7C819C411E; Thu, 27 Aug 2015 16:24:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A8C16E81; Thu, 27 Aug 2015 16:24:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RGOVqL031699; Thu, 27 Aug 2015 16:24:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RGOV3l031698; Thu, 27 Aug 2015 16:24:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508271624.t7RGOV3l031698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 27 Aug 2015 16:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287213 - head/sys/dev/mmc/host 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.20 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, 27 Aug 2015 16:24:31 -0000 Author: andrew Date: Thu Aug 27 16:24:30 2015 New Revision: 287213 URL: https://svnweb.freebsd.org/changeset/base/287213 Log: Limit the speed to the bus frequency. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Thu Aug 27 16:18:22 2015 (r287212) +++ head/sys/dev/mmc/host/dwmmc.c Thu Aug 27 16:24:30 2015 (r287213) @@ -651,7 +651,7 @@ dwmmc_attach(device_t dev) WRITE4(sc, SDMMC_CTRL, SDMMC_CTRL_INT_ENABLE); sc->host.f_min = 400000; - sc->host.f_max = 200000000; + sc->host.f_max = min(200000000, sc->bus_hz); sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; sc->host.caps = MMC_CAP_4_BIT_DATA; From owner-svn-src-head@freebsd.org Thu Aug 27 16:27:52 2015 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 B9D4B9C424D; Thu, 27 Aug 2015 16:27:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 AABB418A; Thu, 27 Aug 2015 16:27:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RGRqgo031871; Thu, 27 Aug 2015 16:27:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RGRqLM031870; Thu, 27 Aug 2015 16:27:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508271627.t7RGRqLM031870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 27 Aug 2015 16:27:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287214 - head/sys/dev/mmc/host 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.20 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, 27 Aug 2015 16:27:52 -0000 Author: andrew Date: Thu Aug 27 16:27:51 2015 New Revision: 287214 URL: https://svnweb.freebsd.org/changeset/base/287214 Log: There is no need to get the bus tag or handle. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Thu Aug 27 16:24:30 2015 (r287213) +++ head/sys/dev/mmc/host/dwmmc.c Thu Aug 27 16:27:51 2015 (r287214) @@ -117,8 +117,6 @@ struct idmac_desc { struct dwmmc_softc { struct resource *res[2]; - bus_space_tag_t bst; - bus_space_handle_t bsh; device_t dev; void *intr_cookie; struct mmc_host host; @@ -563,10 +561,6 @@ dwmmc_attach(device_t dev) return (ENXIO); } - /* Memory interface */ - sc->bst = rman_get_bustag(sc->res[0]); - sc->bsh = rman_get_bushandle(sc->res[0]); - /* Setup interrupt handler. */ error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_NET | INTR_MPSAFE, NULL, dwmmc_intr, sc, &sc->intr_cookie); From owner-svn-src-head@freebsd.org Thu Aug 27 16:28:21 2015 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 3DBFA9C42C8 for ; Thu, 27 Aug 2015 16:28:21 +0000 (UTC) (envelope-from julien@jch.io) Received: from mail-qk0-f169.google.com (mail-qk0-f169.google.com [209.85.220.169]) (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 F033139C for ; Thu, 27 Aug 2015 16:28:20 +0000 (UTC) (envelope-from julien@jch.io) Received: by qkfh127 with SMTP id h127so13336165qkf.1 for ; Thu, 27 Aug 2015 09:28:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=IR4EwaeRQY5W/I2jyuIwuNTNbsCvxfoeeqjWGveDMqY=; b=LBGN5H3gSlKrm7FQZPWhndbKWAg5p6wXpuSYKBpkJZonNwYhGvCcw9ym5H6/9GUI7k LxW56lzptdrZHjRhtEJL6KTWkGvPqT3+GDO1OsbRRc1/n8/Nl5D0SdsIDYH+KGngsKQS zLAXD+39uXZtsSkjBLC0IA7JD3I5UDQ9oaoQwzFXuJTWonwcyB5DNKaVoCEUbhdvxN3A FIMe/ZiCPqfTH8xge0Toiqu7kFn9fuup34m9Fgu/yospZu/M5hqUTYU4OCkLn2dQaAsY 3BhmAsww/8l6PkTohyXGx0oMABLR1K7U7rqIYNbB1x46lIWpIDBlcdoMfNZh710yqbx2 yZYg== X-Gm-Message-State: ALoCoQnhGplt57o/IL4PF0oEcTunHzGhSdTZBWtXo8jtCA8ogypj+LywNvHxAcFe5NBCQDCqnoMX X-Received: by 10.55.25.39 with SMTP id k39mr8011991qkh.3.1440692894590; Thu, 27 Aug 2015 09:28:14 -0700 (PDT) Received: from FRI2JCHARBON-M1.local (h87.s239.verisign.com. [216.168.239.87]) by smtp.googlemail.com with ESMTPSA id s90sm1516267qki.46.2015.08.27.09.28.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2015 09:28:13 -0700 (PDT) Subject: Re: svn commit: r286880 - head/sys/kern To: Konstantin Belousov References: <201508181015.t7IAFAex055889@repo.freebsd.org> <55DD69E5.4090904@selasky.org> <55DD74EB.30601@selasky.org> <55DE01F7.8040508@freebsd.org> <20150827104946.GH2072@kib.kiev.ua> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin From: Julien Charbon X-Enigmail-Draft-Status: N1110 Message-ID: <55DF3A93.8080507@freebsd.org> Date: Thu, 27 Aug 2015 18:28:03 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150827104946.GH2072@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SVS6NPqis9EGM4UjCbJLup9A4J7fHAD6T" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 27 Aug 2015 16:28:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SVS6NPqis9EGM4UjCbJLup9A4J7fHAD6T Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Konstantin, On 27/08/15 12:49, Konstantin Belousov wrote: > On Wed, Aug 26, 2015 at 08:14:15PM +0200, Julien Charbon wrote: >> As I said, I am not opposed to back out this change, callout(9) API i= n >> mpsafe mode is a already complex/subtle API, it won't change too much >> the current complexity. >> >> Let say that if nobody screams until Friday 8/28, I will put back >> r284245 and revert this change _and_ I will make this case clear in th= e >> man page. >=20 > [Replying to a random message in the whole set of conversations] >=20 > There is one more case, besides TCP timers, which is equially, of not > more, critical and sensitive WRT to the callout_stop(). Look at the > sys/kern/subr_sleepqueue.c:sleepq_check_timeout(). Stray return of > the false result from callout_stop() causes creation of the non-killabl= e > processes: the callout fired, we missed the wakeup and went to sleep > by manually doing the context switch. Such thread cannot be woken up. >=20 > I suspect that your fix is a better approach than my attempt to look > at something similar at PR 200992 (may be not). This change (r286880) won't improve the PR 200992: r286880 only addresses a case where callout_stop() returns 1 instead of 0. Thus the only thing that can do r286880 to PR 200992: - Don't change anything the issues - Worsen the issue Sorry to kill your hope of a simple and elegant fix for PR 200992. -- Julien --SVS6NPqis9EGM4UjCbJLup9A4J7fHAD6T Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJV3zqZAAoJEKVlQ5Je6dhx8VIIAOHAgwFW0zb381yUbXDkyPmV EldTc+OgznnnB3MblbC0kyxBOI+rxgo1S0cOldzMNtiK+Cf2YYQDsRp6rwgu8aVg CgGsGAMXAsA3BCJvHzjb57JOOBRMVJ5Q5+qjpRykzOkDeaX9UXiF6m/XmKx79DMM 5+mDWz6GlJlnTRZN/iZrQAR2PdBR0ebpw2egSE+EXPmcwa5DApRY06hvSbTUNfYs XVblS7HYmCGzQw5Dz2VsSDoBXV3jrbYrrSZepIA/s9SB+ez0XbfKBQT8XAYXJg6g OJSn+0Ef+jgFRcGC+4h9RMUAga2MJH+EwjAr+l+Mq2OwI8Q5LKpQenkPC75z1B4= =HDgT -----END PGP SIGNATURE----- --SVS6NPqis9EGM4UjCbJLup9A4J7fHAD6T-- From owner-svn-src-head@freebsd.org Thu Aug 27 17:16:21 2015 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 F29159C35F3; Thu, 27 Aug 2015 17:16:20 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D6E40FCB; Thu, 27 Aug 2015 17:16:20 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RHGKKY053224; Thu, 27 Aug 2015 17:16:20 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RHGJuF053217; Thu, 27 Aug 2015 17:16:19 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201508271716.t7RHGJuF053217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Thu, 27 Aug 2015 17:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287216 - in head/kerberos5: . libexec/digest-service libexec/kdc usr.bin/kpasswd usr.sbin/iprop-log 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.20 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, 27 Aug 2015 17:16:21 -0000 Author: ume Date: Thu Aug 27 17:16:18 2015 New Revision: 287216 URL: https://svnweb.freebsd.org/changeset/base/287216 Log: Move setting of LDFLAGS to the modules which require it actually, as other kerberos5 modules do so. Modified: head/kerberos5/Makefile.inc head/kerberos5/libexec/digest-service/Makefile head/kerberos5/libexec/kdc/Makefile head/kerberos5/usr.bin/kpasswd/Makefile head/kerberos5/usr.sbin/iprop-log/Makefile Modified: head/kerberos5/Makefile.inc ============================================================================== --- head/kerberos5/Makefile.inc Thu Aug 27 16:36:39 2015 (r287215) +++ head/kerberos5/Makefile.inc Thu Aug 27 17:16:18 2015 (r287216) @@ -14,7 +14,6 @@ LDAPLDADD= -lldap -llber LDAPDPADD= ${LDAPLDADD:C;^-l(.*)$;${OPENLDAPBASE}/lib/lib\1.a;} LDAPCFLAGS= -I${OPENLDAPBASE}/include -DOPENLDAP=1 -DLDAP_DEPRECATED=1 LDAPLDFLAGS= -L${OPENLDAPBASE}/lib -rpath ${OPENLDAPBASE}/lib -LDFLAGS+= ${LDAPLDFLAGS} .endif .if defined(SRCS) Modified: head/kerberos5/libexec/digest-service/Makefile ============================================================================== --- head/kerberos5/libexec/digest-service/Makefile Thu Aug 27 16:36:39 2015 (r287215) +++ head/kerberos5/libexec/digest-service/Makefile Thu Aug 27 17:16:18 2015 (r287216) @@ -9,6 +9,7 @@ CFLAGS+= -I${KRB5DIR}/kdc \ -I${KRB5DIR}/lib/wind \ -I${KRB5DIR}/lib/roken LIBADD= hdb kdc heimipcs krb5 roken asn1 crypto vers heimntlm +LDFLAGS=${LDAPLDFLAGS} .include Modified: head/kerberos5/libexec/kdc/Makefile ============================================================================== --- head/kerberos5/libexec/kdc/Makefile Thu Aug 27 16:36:39 2015 (r287215) +++ head/kerberos5/libexec/kdc/Makefile Thu Aug 27 17:16:18 2015 (r287216) @@ -11,6 +11,7 @@ SRCS= config.c \ CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ -I${KRB5DIR}/kdc ${LDAPCFLAGS} LIBADD= kdc hdb krb5 roken crypt vers +LDFLAGS=${LDAPLDFLAGS} .include Modified: head/kerberos5/usr.bin/kpasswd/Makefile ============================================================================== --- head/kerberos5/usr.bin/kpasswd/Makefile Thu Aug 27 16:36:39 2015 (r287215) +++ head/kerberos5/usr.bin/kpasswd/Makefile Thu Aug 27 17:16:18 2015 (r287216) @@ -3,6 +3,7 @@ PROG= kpasswd CFLAGS+=-I${KRB5DIR}/lib/roken LIBADD= hdb krb5 roken vers crypto +LDFLAGS=${LDAPLDFLAGS} .include Modified: head/kerberos5/usr.sbin/iprop-log/Makefile ============================================================================== --- head/kerberos5/usr.sbin/iprop-log/Makefile Thu Aug 27 16:36:39 2015 (r287215) +++ head/kerberos5/usr.sbin/iprop-log/Makefile Thu Aug 27 17:16:18 2015 (r287216) @@ -9,6 +9,7 @@ CFLAGS+= -I${KRB5DIR}/lib/kadm5 \ -I${KRB5DIR}/lib/sl \ -I. LIBADD= kadm5srv hdb krb5 roken edit sl vers +LDFLAGS=${LDAPLDFLAGS} iprop-commands.h: iprop-commands.in ${SLC} ${.ALLSRC:M*.in} From owner-svn-src-head@freebsd.org Thu Aug 27 17:19:24 2015 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 811A59C370B; Thu, 27 Aug 2015 17:19:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 EE0611287; Thu, 27 Aug 2015 17:19:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t7RHJJva093184 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 27 Aug 2015 20:19:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t7RHJJva093184 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t7RHJJKO093183; Thu, 27 Aug 2015 20:19:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 27 Aug 2015 20:19:18 +0300 From: Konstantin Belousov To: Julien Charbon Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r286880 - head/sys/kern Message-ID: <20150827171918.GM2072@kib.kiev.ua> References: <201508181015.t7IAFAex055889@repo.freebsd.org> <55DD69E5.4090904@selasky.org> <55DD74EB.30601@selasky.org> <55DE01F7.8040508@freebsd.org> <20150827104946.GH2072@kib.kiev.ua> <55DF3A93.8080507@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55DF3A93.8080507@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 27 Aug 2015 17:19:24 -0000 On Thu, Aug 27, 2015 at 06:28:03PM +0200, Julien Charbon wrote: > > Hi Konstantin, > > On 27/08/15 12:49, Konstantin Belousov wrote: > > On Wed, Aug 26, 2015 at 08:14:15PM +0200, Julien Charbon wrote: > >> As I said, I am not opposed to back out this change, callout(9) API in > >> mpsafe mode is a already complex/subtle API, it won't change too much > >> the current complexity. > >> > >> Let say that if nobody screams until Friday 8/28, I will put back > >> r284245 and revert this change _and_ I will make this case clear in the > >> man page. > > > > [Replying to a random message in the whole set of conversations] > > > > There is one more case, besides TCP timers, which is equially, of not > > more, critical and sensitive WRT to the callout_stop(). Look at the > > sys/kern/subr_sleepqueue.c:sleepq_check_timeout(). Stray return of > > the false result from callout_stop() causes creation of the non-killable > > processes: the callout fired, we missed the wakeup and went to sleep > > by manually doing the context switch. Such thread cannot be woken up. > > > > I suspect that your fix is a better approach than my attempt to look > > at something similar at PR 200992 (may be not). > > This change (r286880) won't improve the PR 200992: > > r286880 only addresses a case where callout_stop() returns 1 instead of > 0. Thus the only thing that can do r286880 to PR 200992: > > - Don't change anything the issues > - Worsen the issue > > Sorry to kill your hope of a simple and elegant fix for PR 200992. Well, not that I am frustrated much. Thank you for taking a look. Did you read the patch attached to the PR ? From owner-svn-src-head@freebsd.org Thu Aug 27 17:41:12 2015 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 C4A6C9C3EC3; Thu, 27 Aug 2015 17:41:12 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c: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 52BBB142; Thu, 27 Aug 2015 17:41:12 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by wicge2 with SMTP id ge2so283244wic.0; Thu, 27 Aug 2015 10:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=V2sMI9QqtRc349SNoScCxUDRvj1pXHZz/NgJfYXO3xc=; b=ubxwSF+bzmZ+PuHl+vR9kHYJ/V2ZeUHjqB898NVAwRIddsMelg8Hme3egYVyOMQlYH oYSjSWAOT3yynWwq+/luOIeMiEsDtgshn2WcCK1nI8P8XIGTHS81jAperkp/hm11/6UX okDK8TvWBNeSDg/nYFHT5L+fKNFVcsbqwkSY9oBuppRzJRyysJmPK/8V0x9JnctFep7d XayTXRX6RLY4d/CZspYeQFvNHcl5lD+L3dG0DKA6fYXBsNiNqMG35PSeYi3bGy1wQyJR xeqI0ZDgPD7qp4TU2eKJhhyu+fgzoK9d7m7+pRYT+KvrH0jGp3QfnMz3ujvsj5pZzDef T4Gg== MIME-Version: 1.0 X-Received: by 10.194.85.163 with SMTP id i3mr6314862wjz.75.1440697269814; Thu, 27 Aug 2015 10:41:09 -0700 (PDT) Received: by 10.28.92.130 with HTTP; Thu, 27 Aug 2015 10:41:09 -0700 (PDT) In-Reply-To: <55DF3519.1000106@FreeBSD.org> References: <201508271400.t7RE0Nbc071389@repo.freebsd.org> <55DF3519.1000106@FreeBSD.org> Date: Thu, 27 Aug 2015 13:41:09 -0400 Message-ID: Subject: Re: svn commit: r287206 - head/sys/sys From: Alexander Kabaev To: Pedro Giffuni 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.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 27 Aug 2015 17:41:13 -0000 On Thu, Aug 27, 2015 at 12:04 PM, Pedro Giffuni wrote: > Hello kan; > > On 08/27/15 09:00, Alexander Kabaev wrote: > >> Author: kan >> Date: Thu Aug 27 14:00:23 2015 >> New Revision: 287206 >> URL: https://svnweb.freebsd.org/changeset/base/287206 >> >> Log: >> Repair sys/cdefs.h enough to be usable with GCC 5.x >> >> The __alloc_size and __alloc_align need to be defined to >> nothingness for lint, but the existing check is deficient >> and allows attributes with working __has_attrubute() to >> slip through. >> >> > AFAICT GCC hasn't added __has_attribute(), but if they did recently > that is great news. > > Actually I do not know if they did and I do not think it even matters that much. The existing conditional is not working for lint and I had to shuffle it under bigger '#ifdef lint' protection. Nor is the condition even well formed enough to work with any recent GCC and using __has_attribute in naked form is a mistake: % cat t.c #if __has_attribute(alloc_size) # error Has attribute #endif % mips-portbld-freebsd11.0-gcc --version mips-portbld-freebsd11.0-gcc (FreeBSD Ports Collection for mips) 5.2.0 Copyright (C) 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. % mips-portbld-freebsd11.0-gcc -E t.c # 1 "t.c" # 1 "" # 1 "" # 1 "t.c" t.c:2:3: error: #error Has attribute # error Has attribute ^ % gcc48 --version gcc48 (FreeBSD Ports Collection) 4.8.5 Copyright (C) 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. % gcc48 -E t.c # 1 "t.c" # 1 "" # 1 "" # 1 "t.c" t.c:1:20: error: missing binary operator before token "(" #if __has_attribute(alloc_size) > Modified: >> head/sys/sys/cdefs.h >> >> .. > > > #if !__GNUC_PREREQ__(2, 95) >> @@ -371,24 +382,12 @@ >> #define __returns_twice >> #endif >> >> -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) >> -#define __alloc_size(x) __attribute__((__alloc_size__(x))) >> -#else >> -#define __alloc_size(x) >> -#endif >> - >> > > This surely got through in GCC's case through the __GNUC_PREREQ__. > Of course gcc 4.2 has neither attribute but clang has alloc_size > so I wonder why it hasn't affected the lint builds. > > Just curiosity, the change is OK but it will be getting ugly if we > have to add all the new attributes in the !lint section. > > Regards, > > Pedro. > clang in tree does not have the slightest idea about the alloc_size attribute, and that is why it worked, as demonstrated by the test below: % cc --version FreeBSD clang version 3.6.1 (tags/RELEASE_361/final 237755) 20150525 Target: x86_64-unknown-freebsd11.0 Thread model: posix % cc -E t.c # 1 "t.c" # 1 "" 1 # 1 "" 3 # 311 "" 3 # 1 "" 1 # 1 "" 2 # 1 "t.c" 2 The original change to cdefs.h appears to be plain wrong. -- Alexander Kabaev From owner-svn-src-head@freebsd.org Thu Aug 27 18:11:01 2015 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 243849C295A; Thu, 27 Aug 2015 18:11:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 12CD31046; Thu, 27 Aug 2015 18:11:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RIB0k9077003; Thu, 27 Aug 2015 18:11:00 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RIB0xl077002; Thu, 27 Aug 2015 18:11:00 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508271811.t7RIB0xl077002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 27 Aug 2015 18:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287217 - head/usr.sbin/syslogd 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.20 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, 27 Aug 2015 18:11:01 -0000 Author: delphij Date: Thu Aug 27 18:11:00 2015 New Revision: 287217 URL: https://svnweb.freebsd.org/changeset/base/287217 Log: die() would never return, mark it as so. MFC after: 2 weeks Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Thu Aug 27 17:16:18 2015 (r287216) +++ head/usr.sbin/syslogd/syslogd.c Thu Aug 27 18:11:00 2015 (r287217) @@ -324,7 +324,7 @@ static const char *cvthname(struct socka static void deadq_enter(pid_t, const char *); static int deadq_remove(pid_t); static int decode(const char *, const CODE *); -static void die(int); +static void die(int) __dead2; static void dodie(int); static void dofsync(void); static void domark(int); From owner-svn-src-head@freebsd.org Thu Aug 27 19:12:43 2015 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 C76399C3ECA; Thu, 27 Aug 2015 19:12:43 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 B8393DA3; Thu, 27 Aug 2015 19:12:43 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RJChHb002384; Thu, 27 Aug 2015 19:12:43 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RJChXx002383; Thu, 27 Aug 2015 19:12:43 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201508271912.t7RJChXx002383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Thu, 27 Aug 2015 19:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287218 - head/usr.bin/netstat 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.20 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, 27 Aug 2015 19:12:43 -0000 Author: jmg Date: Thu Aug 27 19:12:42 2015 New Revision: 287218 URL: https://svnweb.freebsd.org/changeset/base/287218 Log: add documentation for timers that silby added in r197244, almost 6 years ago... Modified: head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Thu Aug 27 18:11:00 2015 (r287217) +++ head/usr.bin/netstat/netstat.1 Thu Aug 27 19:12:42 2015 (r287218) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd April 7, 2015 +.Dd August 27, 2015 .Dt NETSTAT 1 .Os .Sh NAME @@ -217,6 +217,12 @@ queue. .It Li S-BCNT Ta Send buffer byte count. .It Li R-BMAX Ta Maximum bytes that can be used in the receive buffer. .It Li S-BMAX Ta Maximum bytes that can be used in the send buffer. +.It Li rexmt Ta Time, in seconds, to fire Retransmit Timer, or 0 if not armed. +.It Li persist Ta Time, in seconds, to fire Retransmit Persistence, or 0 if not armed. +.It Li keep Ta Time, in seconds, to fire Keep Alive, or 0 if not armed. +.It Li 2msl Ta Time, in seconds, to fire 2*msl TIME_WAIT Timer, or 0 if not armed. +.It Li delack Ta Time, in seconds, to fire Delayed ACK Timer, or 0 if not armed. +.It Li rcvtime Ta Time, in seconds, since last packet received. .El .It Fl f Ar protocol_family Filter by From owner-svn-src-head@freebsd.org Thu Aug 27 20:38:46 2015 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 3C19C9C3C28; Thu, 27 Aug 2015 20:38:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 1398F1A82; Thu, 27 Aug 2015 20:38:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RKcjdQ035619; Thu, 27 Aug 2015 20:38:45 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RKcjmS035618; Thu, 27 Aug 2015 20:38:45 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201508272038.t7RKcjmS035618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 27 Aug 2015 20:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287219 - head/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.20 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, 27 Aug 2015 20:38:46 -0000 Author: alc Date: Thu Aug 27 20:38:45 2015 New Revision: 287219 URL: https://svnweb.freebsd.org/changeset/base/287219 Log: In vm_pageout_scan(), simplify the logic for determining if a page can be paged out and apply some nearby style fixes. In collaboration with: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation, EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Aug 27 19:12:42 2015 (r287218) +++ head/sys/vm/vm_pageout.c Thu Aug 27 20:38:45 2015 (r287219) @@ -1029,10 +1029,9 @@ vm_pageout_scan(struct vm_domain *vmd, i struct vm_pagequeue *pq; vm_object_t object; long min_scan; - int act_delta, addl_page_shortage, deficit, maxscan, page_shortage; - int vnodes_skipped = 0; - int maxlaunder, scan_tick, scanned; - boolean_t queues_locked; + int act_delta, addl_page_shortage, deficit, error, maxlaunder, maxscan; + int page_shortage, scan_tick, scanned, vnodes_skipped; + boolean_t pageout_ok, queues_locked; /* * If we need to reclaim memory ask kernel caches to return @@ -1086,6 +1085,8 @@ vm_pageout_scan(struct vm_domain *vmd, i if (pass > 1) maxlaunder = 10000; + vnodes_skipped = 0; + /* * Start scanning the inactive queue for pages we can move to the * cache or free. The scan will stop when the target is reached or @@ -1265,23 +1266,22 @@ vm_pageout_scan(struct vm_domain *vmd, i * pressure where there are insufficient clean pages * on the inactive queue, we may have to go all out. */ - int swap_pageouts_ok; - int error; - if ((object->type != OBJT_SWAP) && (object->type != OBJT_DEFAULT)) { - swap_pageouts_ok = 1; - } else { - swap_pageouts_ok = !(defer_swap_pageouts || disable_swap_pageouts); - swap_pageouts_ok |= (!disable_swap_pageouts && defer_swap_pageouts && - vm_page_count_min()); - - } + if (object->type != OBJT_SWAP && + object->type != OBJT_DEFAULT) + pageout_ok = TRUE; + else if (disable_swap_pageouts) + pageout_ok = FALSE; + else if (defer_swap_pageouts) + pageout_ok = vm_page_count_min(); + else + pageout_ok = TRUE; /* * We don't bother paging objects that are "dead". * Those objects are in a "rundown" state. */ - if (!swap_pageouts_ok || (object->flags & OBJ_DEAD)) { + if (!pageout_ok || (object->flags & OBJ_DEAD) != 0) { vm_pagequeue_lock(pq); vm_page_unlock(m); VM_OBJECT_WUNLOCK(object); From owner-svn-src-head@freebsd.org Thu Aug 27 20:52:42 2015 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 B04DC9C4197; Thu, 27 Aug 2015 20:52:42 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 9B6BC663; Thu, 27 Aug 2015 20:52:42 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RKqgxg043730; Thu, 27 Aug 2015 20:52:42 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RKqgwU043729; Thu, 27 Aug 2015 20:52:42 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201508272052.t7RKqgwU043729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Thu, 27 Aug 2015 20:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287220 - head/etc/rc.d 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.20 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, 27 Aug 2015 20:52:42 -0000 Author: peter Date: Thu Aug 27 20:52:41 2015 New Revision: 287220 URL: https://svnweb.freebsd.org/changeset/base/287220 Log: Fix a conversion error in rc.d/jail Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Thu Aug 27 20:38:45 2015 (r287219) +++ head/etc/rc.d/jail Thu Aug 27 20:52:41 2015 (r287220) @@ -238,7 +238,7 @@ parse_options() eval : \${jail_${_j}_mount_enable:=${jail_mount_enable:-NO}} if checkyesno jail_${_j}_mount_enable; then - echo " allow.mount;" >> $_conf + echo " allow.mount;" fi extract_var $_j set_hostname_allow allow.set_hostname YN NO From owner-svn-src-head@freebsd.org Thu Aug 27 21:16:01 2015 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 888B39C4892 for ; Thu, 27 Aug 2015 21:16:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm18-vm0.bullet.mail.bf1.yahoo.com (nm18-vm0.bullet.mail.bf1.yahoo.com [98.139.213.138]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A80C12F2 for ; Thu, 27 Aug 2015 21:16:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1440710154; bh=RWLk1injvQpKmV0d4APHD0mFOxy9/DSVp9TvmKwPFuY=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=HU3QyeZVmtWYEvsSFztlLH43G1xOxt3eR1OK0IrIDvwlVWcoA+lxGSTC/ZzEFxVOlVMUQkY5acnnnK6vGoOcUnOkgUo8YnHOH70PKN8z5aD0+Uav4Y2o6pZSuu0iZAXKuOIKb69Kfns+5quG9aIbW/S9QVT8e/Le82wMKwh38oxaGNXPXoxAqRmPdETOV30hLh/UbGADkhZC4fFwOka5rGY96NiaMDFUhbn2NKluV3mWHw4tnKmw+67yqjwUs4hNj7Arl9K/3oNL80i//x+iHoFLk788TbuPXzgPERBYPQZqs/Vv9ZCKaCsK6lSQ2sfmfEjcAZPF1UqATAk2NdOh1A== Received: from [98.139.170.180] by nm18.bullet.mail.bf1.yahoo.com with NNFMP; 27 Aug 2015 21:15:54 -0000 Received: from [98.139.211.203] by tm23.bullet.mail.bf1.yahoo.com with NNFMP; 27 Aug 2015 21:15:54 -0000 Received: from [127.0.0.1] by smtp212.mail.bf1.yahoo.com with NNFMP; 27 Aug 2015 21:15:54 -0000 X-Yahoo-Newman-Id: 320776.95142.bm@smtp212.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: bItXhFMVM1l7KIQsg77QTHd8d0o4A15ZsVWTzXOT5AZ1mau rKtNrEfVcaPO4z_Lk1Sd.qIrN_liVh8EwMZIiGD0wLlxSX.KmSNLgTqoxqaf 5.VCtfOKZI0Yt2F0w9UABra21f4qTZ7Qvg41V3k.y7zqxPcSTAYfe9rCAfVR cNmLtaT2NFwcPNOge2hXrb9136KQpNC2t9wSN41YSmVRjy_P12P45IGyNEkA 6A6UXXg3MTInH54tP0.2EpKCartQnBnFSL2p0x1Qi1A7BQpM1K6tLMH0wIvZ v3Rm7fwi8rfjIbKDFnDua2uK45LnX1qYFzdhB3XzhSuida3voUqLu8hS65lz R4MU9tronGh_8_jljYT63ANQHOvRfCes_1oRb5eHP9hAscMkklEXbz5uHKay Us2AIhsEmfMvPtFcQsVh1djWbTutNWc5teFhERe_d.uHtH.UtFylYnj5zsqO jABeVj0UXZqYHL0G_jLGFcNsYX66sM1MWDaBvX_rpIJR7dvkZSmDf8ZiMVV7 PdTtEmXZZKCULSEK0lzVhoMltVYWZ26PA X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r287206 - head/sys/sys To: Alexander Kabaev References: <201508271400.t7RE0Nbc071389@repo.freebsd.org> <55DF3519.1000106@FreeBSD.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <55DF7E0E.6030007@FreeBSD.org> Date: Thu, 27 Aug 2015 16:15:58 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: 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.20 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, 27 Aug 2015 21:16:01 -0000 On 08/27/15 12:41, Alexander Kabaev wrote: ... > The existing conditional is not working for lint and I had to shuffle it > under bigger > '#ifdef lint' protection. And other BSDs are just getting rid of lint. I have no opinion on that though. > ... Nor is the condition even well formed enough > to work with any > recent GCC and using __has_attribute in naked form is a mistake: > > % cat t.c > #if __has_attribute(alloc_size) > # error Has attribute > #endif > We are not really using __has_attribute() in it's naked form: we are following the official clang procedure: http://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros In cdefs.h that corresponds to lines 42-44. ... > % mips-portbld-freebsd11.0-gcc --version > mips-portbld-freebsd11.0-gcc (FreeBSD Ports Collection for mips) 5.2.0 > Copyright (C) 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. > > % mips-portbld-freebsd11.0-gcc -E t.c > # 1 "t.c" > # 1 "" > # 1 "" > # 1 "t.c" > t.c:2:3: error: #error Has attribute > # error Has attribute > ^ > > % gcc48 --version > gcc48 (FreeBSD Ports Collection) 4.8.5 > Copyright (C) 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. > > % gcc48 -E t.c > # 1 "t.c" > # 1 "" > # 1 "" > # 1 "t.c" > t.c:1:20: error: missing binary operator before token "(" > #if __has_attribute(alloc_size) > > Modified: > head/sys/sys/cdefs.h > > .. > > > #if !__GNUC_PREREQ__(2, 95) > @@ -371,24 +382,12 @@ > #define __returns_twice > #endif > > -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) > -#define __alloc_size(x) __attribute__((__alloc_size__(x))) > -#else > -#define __alloc_size(x) > -#endif > - > > > This surely got through in GCC's case through the __GNUC_PREREQ__. > Of course gcc 4.2 has neither attribute but clang has alloc_size > so I wonder why it hasn't affected the lint builds. > > Just curiosity, the change is OK but it will be getting ugly if we > have to add all the new attributes in the !lint section. > > Regards, > > Pedro. > > > clang in tree does not have the slightest idea about the alloc_size > attribute, and that is why it worked, as demonstrated by the test below: > Ugh yes, it appears it's unsupported still. I though I had seen a bug report with a patch but I can't find it anymore. Grepping it in contrib doesn't show anything. ... > The original change to cdefs.h appears to be plain wrong. > Not really, it may appear some day. Pedro. From owner-svn-src-head@freebsd.org Thu Aug 27 21:16:25 2015 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 EBB8C9C48D2; Thu, 27 Aug 2015 21:16:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C3F6B1477; Thu, 27 Aug 2015 21:16:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RLGPdr052179; Thu, 27 Aug 2015 21:16:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RLGP2u052178; Thu, 27 Aug 2015 21:16:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508272116.t7RLGP2u052178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 27 Aug 2015 21:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287221 - head/sys/cam/ctl 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.20 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, 27 Aug 2015 21:16:26 -0000 Author: mav Date: Thu Aug 27 21:16:24 2015 New Revision: 287221 URL: https://svnweb.freebsd.org/changeset/base/287221 Log: Fix type bug introduced at r286811. Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Aug 27 20:52:41 2015 (r287220) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Aug 27 21:16:24 2015 (r287221) @@ -1861,8 +1861,8 @@ ctl_be_block_open_dev(struct ctl_be_bloc struct cdev *dev; struct cdevsw *devsw; char *value; - int error, atomic, maxio, unmap; - off_t ps, pss, po, pos, us, uss, uo, uos, tmp; + int error, atomic, maxio, unmap, tmp; + off_t ps, pss, po, pos, us, uss, uo, uos, otmp; params = &be_lun->params; @@ -1928,21 +1928,19 @@ ctl_be_block_open_dev(struct ctl_be_bloc snprintf(req->error_str, sizeof(req->error_str), "requested blocksize %u is not an even " "multiple of backing device blocksize %u", - params->blocksize_bytes, - be_lun->blocksize); + params->blocksize_bytes, tmp); return (EINVAL); } } else if (params->blocksize_bytes != 0) { snprintf(req->error_str, sizeof(req->error_str), "requested blocksize %u < backing device " - "blocksize %u", params->blocksize_bytes, - be_lun->blocksize); + "blocksize %u", params->blocksize_bytes, tmp); return (EINVAL); } else be_lun->blocksize = tmp; - error = devsw->d_ioctl(dev, DIOCGMEDIASIZE, (caddr_t)&tmp, FREAD, + error = devsw->d_ioctl(dev, DIOCGMEDIASIZE, (caddr_t)&otmp, FREAD, curthread); if (error) { snprintf(req->error_str, sizeof(req->error_str), @@ -1953,18 +1951,18 @@ ctl_be_block_open_dev(struct ctl_be_bloc } if (params->lun_size_bytes != 0) { - if (params->lun_size_bytes > tmp) { + if (params->lun_size_bytes > otmp) { snprintf(req->error_str, sizeof(req->error_str), "requested LUN size %ju > backing device " "size %ju", (uintmax_t)params->lun_size_bytes, - (uintmax_t)be_lun->size_bytes); + (uintmax_t)otmp); return (EINVAL); } be_lun->size_bytes = params->lun_size_bytes; } else - be_lun->size_bytes = tmp; + be_lun->size_bytes = otmp; error = devsw->d_ioctl(dev, DIOCGSTRIPESIZE, (caddr_t)&ps, FREAD, curthread); From owner-svn-src-head@freebsd.org Thu Aug 27 21:27:49 2015 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 DC3549C4D3D; Thu, 27 Aug 2015 21:27:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 CBE751D91; Thu, 27 Aug 2015 21:27:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RLRndQ056295; Thu, 27 Aug 2015 21:27:49 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RLRmlO056289; Thu, 27 Aug 2015 21:27:48 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201508272127.t7RLRmlO056289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 27 Aug 2015 21:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287222 - in head: . sbin/pfctl share/man/man5 sys/net sys/netpfil/pf 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.20 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, 27 Aug 2015 21:27:50 -0000 Author: kp Date: Thu Aug 27 21:27:47 2015 New Revision: 287222 URL: https://svnweb.freebsd.org/changeset/base/287222 Log: pf: Remove support for 'scrub fragment crop|drop-ovl' The crop/drop-ovl fragment scrub modes are not very useful and likely to confuse users into making poor choices. It's also a fairly large amount of complex code, so just remove the support altogether. Users who have 'scrub fragment crop|drop-ovl' in their pf configuration will be implicitly converted to 'scrub fragment reassemble'. Reviewed by: gnn, eri Relnotes: yes Differential Revision: https://reviews.freebsd.org/D3466 Modified: head/UPDATING head/sbin/pfctl/parse.y head/sbin/pfctl/pfctl_parser.c head/share/man/man5/pf.conf.5 head/sys/net/pfvar.h head/sys/netpfil/pf/pf_norm.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Aug 27 21:16:24 2015 (r287221) +++ head/UPDATING Thu Aug 27 21:27:47 2015 (r287222) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150827: + pf no longer supports 'scrub fragment crop' or 'scrub fragment drop-ovl' + These configurations are now automatically interpreted as + 'scrub fragment reassemble'. + 20150817: Kernel-loadable modules for the random(4) device are back. To use them, the kernel must have Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Thu Aug 27 21:16:24 2015 (r287221) +++ head/sbin/pfctl/parse.y Thu Aug 27 21:27:47 2015 (r287222) @@ -1197,8 +1197,8 @@ scrub_opt : NODF { ; fragcache : FRAGMENT REASSEMBLE { $$ = 0; /* default */ } - | FRAGMENT FRAGCROP { $$ = PFRULE_FRAGCROP; } - | FRAGMENT FRAGDROP { $$ = PFRULE_FRAGDROP; } + | FRAGMENT FRAGCROP { $$ = 0; } + | FRAGMENT FRAGDROP { $$ = 0; } ; antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { Modified: head/sbin/pfctl/pfctl_parser.c ============================================================================== --- head/sbin/pfctl/pfctl_parser.c Thu Aug 27 21:16:24 2015 (r287221) +++ head/sbin/pfctl/pfctl_parser.c Thu Aug 27 21:27:47 2015 (r287222) @@ -990,12 +990,7 @@ print_rule(struct pf_rule *r, const char if (r->rule_flag & PFRULE_REASSEMBLE_TCP) printf(" reassemble tcp"); - if (r->rule_flag & PFRULE_FRAGDROP) - printf(" fragment drop-ovl"); - else if (r->rule_flag & PFRULE_FRAGCROP) - printf(" fragment crop"); - else - printf(" fragment reassemble"); + printf(" fragment reassemble"); } if (r->label[0]) printf(" label \"%s\"", r->label); Modified: head/share/man/man5/pf.conf.5 ============================================================================== --- head/share/man/man5/pf.conf.5 Thu Aug 27 21:16:24 2015 (r287221) +++ head/share/man/man5/pf.conf.5 Thu Aug 27 21:27:47 2015 (r287222) @@ -666,33 +666,6 @@ packet, and only the completed packet is The advantage is that filter rules have to deal only with complete packets, and can ignore fragments. The drawback of caching fragments is the additional memory cost. -But the full reassembly method is the only method that currently works -with NAT. -This is the default behavior of a -.Ar scrub -rule if no fragmentation modifier is supplied. -.It Ar fragment crop -The default fragment reassembly method is expensive, hence the option -to crop is provided. -In this case, -.Xr pf 4 -will track the fragments and cache a small range descriptor. -Duplicate fragments are dropped and overlaps are cropped. -Thus data will only occur once on the wire with ambiguities resolving to -the first occurrence. -Unlike the -.Ar fragment reassemble -modifier, fragments are not buffered, they are passed as soon as they -are received. -The -.Ar fragment crop -reassembly mechanism does not yet work with NAT. -.It Ar fragment drop-ovl -This option is similar to the -.Ar fragment crop -modifier except that all overlapping or duplicate fragments will be -dropped, and all further corresponding fragments will be -dropped as well. .It Ar reassemble tcp Statefully normalizes TCP connections. .Ar scrub reassemble tcp @@ -2987,8 +2960,7 @@ state-opt = ( "max" number | "no-sy "overload" "\*(Lt" string "\*(Gt" [ "flush" ] | "if-bound" | "floating" ) -fragmentation = [ "fragment reassemble" | "fragment crop" | - "fragment drop-ovl" ] +fragmentation = [ "fragment reassemble" ] timeout-list = timeout [ [ "," ] timeout-list ] timeout = ( "tcp.first" | "tcp.opening" | "tcp.established" | Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Thu Aug 27 21:16:24 2015 (r287221) +++ head/sys/net/pfvar.h Thu Aug 27 21:27:47 2015 (r287222) @@ -598,8 +598,6 @@ struct pf_rule { /* scrub flags */ #define PFRULE_NODF 0x0100 -#define PFRULE_FRAGCROP 0x0200 /* non-buffering frag cache */ -#define PFRULE_FRAGDROP 0x0400 /* drop funny fragments */ #define PFRULE_RANDOMID 0x0800 #define PFRULE_REASSEMBLE_TCP 0x1000 #define PFRULE_SET_TOS 0x2000 Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Thu Aug 27 21:16:24 2015 (r287221) +++ head/sys/netpfil/pf/pf_norm.c Thu Aug 27 21:27:47 2015 (r287222) @@ -88,12 +88,6 @@ struct pf_fragment { RB_ENTRY(pf_fragment) fr_entry; TAILQ_ENTRY(pf_fragment) frag_next; - uint8_t fr_flags; /* status flags */ -#define PFFRAG_SEENLAST 0x0001 /* Seen the last fragment for this */ -#define PFFRAG_NOBUFFER 0x0002 /* Non-buffering fragment cache */ -#define PFFRAG_DROP 0x0004 /* Drop all fragments */ -#define BUFFER_FRAGMENTS(fr) (!((fr)->fr_flags & PFFRAG_NOBUFFER)) - uint16_t fr_max; /* fragment data max */ uint32_t fr_timeout; uint16_t fr_maxlen; /* maximum length of single fragment */ TAILQ_HEAD(pf_fragq, pf_frent) fr_queue; @@ -123,13 +117,9 @@ TAILQ_HEAD(pf_fragqueue, pf_fragment); TAILQ_HEAD(pf_cachequeue, pf_fragment); static VNET_DEFINE(struct pf_fragqueue, pf_fragqueue); #define V_pf_fragqueue VNET(pf_fragqueue) -static VNET_DEFINE(struct pf_cachequeue, pf_cachequeue); -#define V_pf_cachequeue VNET(pf_cachequeue) RB_HEAD(pf_frag_tree, pf_fragment); static VNET_DEFINE(struct pf_frag_tree, pf_frag_tree); #define V_pf_frag_tree VNET(pf_frag_tree) -static VNET_DEFINE(struct pf_frag_tree, pf_cache_tree); -#define V_pf_cache_tree VNET(pf_cache_tree) static int pf_frag_compare(struct pf_fragment *, struct pf_fragment *); static RB_PROTOTYPE(pf_frag_tree, pf_fragment, fr_entry, pf_frag_compare); @@ -150,8 +140,6 @@ static struct mbuf *pf_join_fragment(str #ifdef INET static void pf_scrub_ip(struct mbuf **, uint32_t, uint8_t, uint8_t); static int pf_reassemble(struct mbuf **, struct ip *, int, u_short *); -static struct mbuf *pf_fragcache(struct mbuf **, struct ip*, - struct pf_fragment **, int, int, int *); #endif /* INET */ #ifdef INET6 static int pf_reassemble6(struct mbuf **, struct ip6_hdr *, @@ -197,7 +185,6 @@ pf_normalize_init(void) uma_zone_set_warning(V_pf_frent_z, "PF frag entries limit reached"); TAILQ_INIT(&V_pf_fragqueue); - TAILQ_INIT(&V_pf_cachequeue); } void @@ -236,8 +223,6 @@ pf_purge_expired_fragments(void) PF_FRAG_LOCK(); while ((frag = TAILQ_LAST(&V_pf_fragqueue, pf_fragqueue)) != NULL) { - KASSERT((BUFFER_FRAGMENTS(frag)), - ("BUFFER_FRAGMENTS(frag) == 0: %s", __FUNCTION__)); if (frag->fr_timeout > expire) break; @@ -245,19 +230,6 @@ pf_purge_expired_fragments(void) pf_free_fragment(frag); } - while ((frag = TAILQ_LAST(&V_pf_cachequeue, pf_cachequeue)) != NULL) { - KASSERT((!BUFFER_FRAGMENTS(frag)), - ("BUFFER_FRAGMENTS(frag) != 0: %s", __FUNCTION__)); - if (frag->fr_timeout > expire) - break; - - DPFPRINTF(("expiring %d(%p)\n", frag->fr_id, frag)); - pf_free_fragment(frag); - KASSERT((TAILQ_EMPTY(&V_pf_cachequeue) || - TAILQ_LAST(&V_pf_cachequeue, pf_cachequeue) != frag), - ("!(TAILQ_EMPTY() || TAILQ_LAST() == farg): %s", - __FUNCTION__)); - } PF_FRAG_UNLOCK(); } @@ -267,7 +239,7 @@ pf_purge_expired_fragments(void) static void pf_flush_fragments(void) { - struct pf_fragment *frag, *cache; + struct pf_fragment *frag; int goal; PF_FRAG_ASSERT(); @@ -278,10 +250,7 @@ pf_flush_fragments(void) frag = TAILQ_LAST(&V_pf_fragqueue, pf_fragqueue); if (frag) pf_free_fragment(frag); - cache = TAILQ_LAST(&V_pf_cachequeue, pf_cachequeue); - if (cache) - pf_free_fragment(cache); - if (frag == NULL && cache == NULL) + else break; } } @@ -295,27 +264,12 @@ pf_free_fragment(struct pf_fragment *fra PF_FRAG_ASSERT(); /* Free all fragments */ - if (BUFFER_FRAGMENTS(frag)) { - for (frent = TAILQ_FIRST(&frag->fr_queue); frent; - frent = TAILQ_FIRST(&frag->fr_queue)) { - TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); - - m_freem(frent->fe_m); - uma_zfree(V_pf_frent_z, frent); - } - } else { - for (frent = TAILQ_FIRST(&frag->fr_queue); frent; - frent = TAILQ_FIRST(&frag->fr_queue)) { - TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); - - KASSERT((TAILQ_EMPTY(&frag->fr_queue) || - TAILQ_FIRST(&frag->fr_queue)->fe_off > - frent->fe_len), - ("! (TAILQ_EMPTY() || TAILQ_FIRST()->fe_off >" - " frent->fe_len): %s", __func__)); + for (frent = TAILQ_FIRST(&frag->fr_queue); frent; + frent = TAILQ_FIRST(&frag->fr_queue)) { + TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); - uma_zfree(V_pf_frent_z, frent); - } + m_freem(frent->fe_m); + uma_zfree(V_pf_frent_z, frent); } pf_remove_fragment(frag); @@ -332,13 +286,8 @@ pf_find_fragment(struct pf_fragment_cmp if (frag != NULL) { /* XXX Are we sure we want to update the timeout? */ frag->fr_timeout = time_uptime; - if (BUFFER_FRAGMENTS(frag)) { - TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next); - TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next); - } else { - TAILQ_REMOVE(&V_pf_cachequeue, frag, frag_next); - TAILQ_INSERT_HEAD(&V_pf_cachequeue, frag, frag_next); - } + TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next); + TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next); } return (frag); @@ -351,15 +300,9 @@ pf_remove_fragment(struct pf_fragment *f PF_FRAG_ASSERT(); - if (BUFFER_FRAGMENTS(frag)) { - RB_REMOVE(pf_frag_tree, &V_pf_frag_tree, frag); - TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next); - uma_zfree(V_pf_frag_z, frag); - } else { - RB_REMOVE(pf_frag_tree, &V_pf_cache_tree, frag); - TAILQ_REMOVE(&V_pf_cachequeue, frag, frag_next); - uma_zfree(V_pf_frag_z, frag); - } + RB_REMOVE(pf_frag_tree, &V_pf_frag_tree, frag); + TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next); + uma_zfree(V_pf_frag_z, frag); } static struct pf_frent * @@ -431,7 +374,6 @@ pf_fillup_fragment(struct pf_fragment_cm } *(struct pf_fragment_cmp *)frag = *key; - frag->fr_flags = 0; frag->fr_timeout = time_second; frag->fr_maxlen = frent->fe_len; TAILQ_INIT(&frag->fr_queue); @@ -782,312 +724,6 @@ fail: } #endif /* INET6 */ -#ifdef INET -static struct mbuf * -pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, - int drop, int *nomem) -{ - struct mbuf *m = *m0; - struct pf_frent *frp, *fra, *cur = NULL; - int ip_len = ntohs(h->ip_len) - (h->ip_hl << 2); - u_int16_t off = ntohs(h->ip_off) << 3; - u_int16_t max = ip_len + off; - int hosed = 0; - - PF_FRAG_ASSERT(); - KASSERT((*frag == NULL || !BUFFER_FRAGMENTS(*frag)), - ("!(*frag == NULL || !BUFFER_FRAGMENTS(*frag)): %s", __FUNCTION__)); - - /* Create a new range queue for this packet */ - if (*frag == NULL) { - *frag = uma_zalloc(V_pf_frag_z, M_NOWAIT); - if (*frag == NULL) { - pf_flush_fragments(); - *frag = uma_zalloc(V_pf_frag_z, M_NOWAIT); - if (*frag == NULL) - goto no_mem; - } - - /* Get an entry for the queue */ - cur = uma_zalloc(V_pf_frent_z, M_NOWAIT); - if (cur == NULL) { - uma_zfree(V_pf_frag_z, *frag); - *frag = NULL; - goto no_mem; - } - - (*frag)->fr_flags = PFFRAG_NOBUFFER; - (*frag)->fr_max = 0; - (*frag)->fr_src.v4 = h->ip_src; - (*frag)->fr_dst.v4 = h->ip_dst; - (*frag)->fr_af = AF_INET; - (*frag)->fr_proto = h->ip_p; - (*frag)->fr_id = h->ip_id; - (*frag)->fr_timeout = time_uptime; - - cur->fe_off = off; - cur->fe_len = max; /* TODO: fe_len = max - off ? */ - TAILQ_INIT(&(*frag)->fr_queue); - TAILQ_INSERT_HEAD(&(*frag)->fr_queue, cur, fr_next); - - RB_INSERT(pf_frag_tree, &V_pf_cache_tree, *frag); - TAILQ_INSERT_HEAD(&V_pf_cachequeue, *frag, frag_next); - - DPFPRINTF(("fragcache[%d]: new %d-%d\n", h->ip_id, off, max)); - - goto pass; - } - - /* - * Find a fragment after the current one: - * - off contains the real shifted offset. - */ - frp = NULL; - TAILQ_FOREACH(fra, &(*frag)->fr_queue, fr_next) { - if (fra->fe_off > off) - break; - frp = fra; - } - - KASSERT((frp != NULL || fra != NULL), - ("!(frp != NULL || fra != NULL): %s", __FUNCTION__)); - - if (frp != NULL) { - int precut; - - precut = frp->fe_len - off; - if (precut >= ip_len) { - /* Fragment is entirely a duplicate */ - DPFPRINTF(("fragcache[%d]: dead (%d-%d) %d-%d\n", - h->ip_id, frp->fe_off, frp->fe_len, off, max)); - goto drop_fragment; - } - if (precut == 0) { - /* They are adjacent. Fixup cache entry */ - DPFPRINTF(("fragcache[%d]: adjacent (%d-%d) %d-%d\n", - h->ip_id, frp->fe_off, frp->fe_len, off, max)); - frp->fe_len = max; - } else if (precut > 0) { - /* The first part of this payload overlaps with a - * fragment that has already been passed. - * Need to trim off the first part of the payload. - * But to do so easily, we need to create another - * mbuf to throw the original header into. - */ - - DPFPRINTF(("fragcache[%d]: chop %d (%d-%d) %d-%d\n", - h->ip_id, precut, frp->fe_off, frp->fe_len, off, - max)); - - off += precut; - max -= precut; - /* Update the previous frag to encompass this one */ - frp->fe_len = max; - - if (!drop) { - /* XXX Optimization opportunity - * This is a very heavy way to trim the payload. - * we could do it much faster by diddling mbuf - * internals but that would be even less legible - * than this mbuf magic. For my next trick, - * I'll pull a rabbit out of my laptop. - */ - *m0 = m_dup(m, M_NOWAIT); - if (*m0 == NULL) - goto no_mem; - /* From KAME Project : We have missed this! */ - m_adj(*m0, (h->ip_hl << 2) - - (*m0)->m_pkthdr.len); - - KASSERT(((*m0)->m_next == NULL), - ("(*m0)->m_next != NULL: %s", - __FUNCTION__)); - m_adj(m, precut + (h->ip_hl << 2)); - m_cat(*m0, m); - m = *m0; - if (m->m_flags & M_PKTHDR) { - int plen = 0; - struct mbuf *t; - for (t = m; t; t = t->m_next) - plen += t->m_len; - m->m_pkthdr.len = plen; - } - - - h = mtod(m, struct ip *); - - KASSERT(((int)m->m_len == - ntohs(h->ip_len) - precut), - ("m->m_len != ntohs(h->ip_len) - precut: %s", - __FUNCTION__)); - h->ip_off = htons(ntohs(h->ip_off) + - (precut >> 3)); - h->ip_len = htons(ntohs(h->ip_len) - precut); - } else { - hosed++; - } - } else { - /* There is a gap between fragments */ - - DPFPRINTF(("fragcache[%d]: gap %d (%d-%d) %d-%d\n", - h->ip_id, -precut, frp->fe_off, frp->fe_len, off, - max)); - - cur = uma_zalloc(V_pf_frent_z, M_NOWAIT); - if (cur == NULL) - goto no_mem; - - cur->fe_off = off; - cur->fe_len = max; - TAILQ_INSERT_AFTER(&(*frag)->fr_queue, frp, cur, fr_next); - } - } - - if (fra != NULL) { - int aftercut; - int merge = 0; - - aftercut = max - fra->fe_off; - if (aftercut == 0) { - /* Adjacent fragments */ - DPFPRINTF(("fragcache[%d]: adjacent %d-%d (%d-%d)\n", - h->ip_id, off, max, fra->fe_off, fra->fe_len)); - fra->fe_off = off; - merge = 1; - } else if (aftercut > 0) { - /* Need to chop off the tail of this fragment */ - DPFPRINTF(("fragcache[%d]: chop %d %d-%d (%d-%d)\n", - h->ip_id, aftercut, off, max, fra->fe_off, - fra->fe_len)); - fra->fe_off = off; - max -= aftercut; - - merge = 1; - - if (!drop) { - m_adj(m, -aftercut); - if (m->m_flags & M_PKTHDR) { - int plen = 0; - struct mbuf *t; - for (t = m; t; t = t->m_next) - plen += t->m_len; - m->m_pkthdr.len = plen; - } - h = mtod(m, struct ip *); - KASSERT(((int)m->m_len == ntohs(h->ip_len) - aftercut), - ("m->m_len != ntohs(h->ip_len) - aftercut: %s", - __FUNCTION__)); - h->ip_len = htons(ntohs(h->ip_len) - aftercut); - } else { - hosed++; - } - } else if (frp == NULL) { - /* There is a gap between fragments */ - DPFPRINTF(("fragcache[%d]: gap %d %d-%d (%d-%d)\n", - h->ip_id, -aftercut, off, max, fra->fe_off, - fra->fe_len)); - - cur = uma_zalloc(V_pf_frent_z, M_NOWAIT); - if (cur == NULL) - goto no_mem; - - cur->fe_off = off; - cur->fe_len = max; - TAILQ_INSERT_HEAD(&(*frag)->fr_queue, cur, fr_next); - } - - - /* Need to glue together two separate fragment descriptors */ - if (merge) { - if (cur && fra->fe_off <= cur->fe_len) { - /* Need to merge in a previous 'cur' */ - DPFPRINTF(("fragcache[%d]: adjacent(merge " - "%d-%d) %d-%d (%d-%d)\n", - h->ip_id, cur->fe_off, cur->fe_len, off, - max, fra->fe_off, fra->fe_len)); - fra->fe_off = cur->fe_off; - TAILQ_REMOVE(&(*frag)->fr_queue, cur, fr_next); - uma_zfree(V_pf_frent_z, cur); - cur = NULL; - - } else if (frp && fra->fe_off <= frp->fe_len) { - /* Need to merge in a modified 'frp' */ - KASSERT((cur == NULL), ("cur != NULL: %s", - __FUNCTION__)); - DPFPRINTF(("fragcache[%d]: adjacent(merge " - "%d-%d) %d-%d (%d-%d)\n", - h->ip_id, frp->fe_off, frp->fe_len, off, - max, fra->fe_off, fra->fe_len)); - fra->fe_off = frp->fe_off; - TAILQ_REMOVE(&(*frag)->fr_queue, frp, fr_next); - uma_zfree(V_pf_frent_z, frp); - frp = NULL; - - } - } - } - - if (hosed) { - /* - * We must keep tracking the overall fragment even when - * we're going to drop it anyway so that we know when to - * free the overall descriptor. Thus we drop the frag late. - */ - goto drop_fragment; - } - - - pass: - /* Update maximum data size */ - if ((*frag)->fr_max < max) - (*frag)->fr_max = max; - - /* This is the last segment */ - if (!mff) - (*frag)->fr_flags |= PFFRAG_SEENLAST; - - /* Check if we are completely reassembled */ - if (((*frag)->fr_flags & PFFRAG_SEENLAST) && - TAILQ_FIRST(&(*frag)->fr_queue)->fe_off == 0 && - TAILQ_FIRST(&(*frag)->fr_queue)->fe_len == (*frag)->fr_max) { - /* Remove from fragment queue */ - DPFPRINTF(("fragcache[%d]: done 0-%d\n", h->ip_id, - (*frag)->fr_max)); - pf_free_fragment(*frag); - *frag = NULL; - } - - return (m); - - no_mem: - *nomem = 1; - - /* Still need to pay attention to !IP_MF */ - if (!mff && *frag != NULL) - (*frag)->fr_flags |= PFFRAG_SEENLAST; - - m_freem(m); - return (NULL); - - drop_fragment: - - /* Still need to pay attention to !IP_MF */ - if (!mff && *frag != NULL) - (*frag)->fr_flags |= PFFRAG_SEENLAST; - - if (drop) { - /* This fragment has been deemed bad. Don't reass */ - if (((*frag)->fr_flags & PFFRAG_DROP) == 0) - DPFPRINTF(("fragcache[%d]: dropping overall fragment\n", - h->ip_id)); - (*frag)->fr_flags |= PFFRAG_DROP; - } - - m_freem(m); - return (NULL); -} -#endif /* INET */ - #ifdef INET6 int pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag) @@ -1169,8 +805,6 @@ pf_normalize_ip(struct mbuf **m0, int di { struct mbuf *m = *m0; struct pf_rule *r; - struct pf_fragment *frag = NULL; - struct pf_fragment_cmp key; struct ip *h = mtod(m, struct ip *); int mff = (ntohs(h->ip_off) & IP_MF); int hlen = h->ip_hl << 2; @@ -1217,11 +851,15 @@ pf_normalize_ip(struct mbuf **m0, int di } /* Check for illegal packets */ - if (hlen < (int)sizeof(struct ip)) + if (hlen < (int)sizeof(struct ip)) { + REASON_SET(reason, PFRES_NORM); goto drop; + } - if (hlen > ntohs(h->ip_len)) + if (hlen > ntohs(h->ip_len)) { + REASON_SET(reason, PFRES_NORM); goto drop; + } /* Clear IP_DF if the rule uses the no-df option */ if (r->rule_flag & PFRULE_NODF && h->ip_off & htons(IP_DF)) { @@ -1260,82 +898,21 @@ pf_normalize_ip(struct mbuf **m0, int di } max = fragoff + ip_len; - if ((r->rule_flag & (PFRULE_FRAGCROP|PFRULE_FRAGDROP)) == 0) { - - /* Fully buffer all of the fragments */ - PF_FRAG_LOCK(); - - pf_ip2key(h, dir, &key); - frag = pf_find_fragment(&key, &V_pf_frag_tree); - - /* Check if we saw the last fragment already */ - if (frag != NULL && (frag->fr_flags & PFFRAG_SEENLAST) && - max > frag->fr_max) - goto bad; - - /* Might return a completely reassembled mbuf, or NULL */ - DPFPRINTF(("reass frag %d @ %d-%d\n", h->ip_id, fragoff, max)); - verdict = pf_reassemble(m0, h, dir, reason); - PF_FRAG_UNLOCK(); - - if (verdict != PF_PASS) - return (PF_DROP); - - m = *m0; - if (m == NULL) - return (PF_DROP); - - h = mtod(m, struct ip *); - } else { - /* non-buffering fragment cache (drops or masks overlaps) */ - int nomem = 0; - - if (dir == PF_OUT && pd->pf_mtag && - pd->pf_mtag->flags & PF_TAG_FRAGCACHE) { - /* - * Already passed the fragment cache in the - * input direction. If we continued, it would - * appear to be a dup and would be dropped. - */ - goto fragment_pass; - } - - PF_FRAG_LOCK(); - pf_ip2key(h, dir, &key); - frag = pf_find_fragment(&key, &V_pf_cache_tree); - - /* Check if we saw the last fragment already */ - if (frag != NULL && (frag->fr_flags & PFFRAG_SEENLAST) && - max > frag->fr_max) { - if (r->rule_flag & PFRULE_FRAGDROP) - frag->fr_flags |= PFFRAG_DROP; - goto bad; - } + /* Fully buffer all of the fragments + * Might return a completely reassembled mbuf, or NULL */ + PF_FRAG_LOCK(); + DPFPRINTF(("reass frag %d @ %d-%d\n", h->ip_id, fragoff, max)); + verdict = pf_reassemble(m0, h, dir, reason); + PF_FRAG_UNLOCK(); - *m0 = m = pf_fragcache(m0, h, &frag, mff, - (r->rule_flag & PFRULE_FRAGDROP) ? 1 : 0, &nomem); - PF_FRAG_UNLOCK(); - if (m == NULL) { - if (nomem) - goto no_mem; - goto drop; - } + if (verdict != PF_PASS) + return (PF_DROP); - if (dir == PF_IN) { - /* Use mtag from copied and trimmed mbuf chain. */ - pd->pf_mtag = pf_get_mtag(m); - if (pd->pf_mtag == NULL) { - m_freem(m); - *m0 = NULL; - goto no_mem; - } - pd->pf_mtag->flags |= PF_TAG_FRAGCACHE; - } + m = *m0; + if (m == NULL) + return (PF_DROP); - if (frag != NULL && (frag->fr_flags & PFFRAG_DROP)) - goto drop; - goto fragment_pass; - } + h = mtod(m, struct ip *); no_fragment: /* At this point, only IP_DF is allowed in ip_off */ @@ -1346,39 +923,14 @@ pf_normalize_ip(struct mbuf **m0, int di h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_off, h->ip_off, 0); } - /* not missing a return here */ - - fragment_pass: pf_scrub_ip(&m, r->rule_flag, r->min_ttl, r->set_tos); - if ((r->rule_flag & (PFRULE_FRAGCROP|PFRULE_FRAGDROP)) == 0) - pd->flags |= PFDESC_IP_REAS; return (PF_PASS); - no_mem: - REASON_SET(reason, PFRES_MEMORY); - if (r != NULL && r->log) - PFLOG_PACKET(kif, m, AF_INET, dir, *reason, r, NULL, NULL, pd, - 1); - return (PF_DROP); - - drop: - REASON_SET(reason, PFRES_NORM); - if (r != NULL && r->log) - PFLOG_PACKET(kif, m, AF_INET, dir, *reason, r, NULL, NULL, pd, - 1); - return (PF_DROP); - bad: DPFPRINTF(("dropping bad fragment\n")); - - /* Free associated fragments */ - if (frag != NULL) { - pf_free_fragment(frag); - PF_FRAG_UNLOCK(); - } - REASON_SET(reason, PFRES_FRAG); + drop: if (r != NULL && r->log) PFLOG_PACKET(kif, m, AF_INET, dir, *reason, r, NULL, NULL, pd, 1); From owner-svn-src-head@freebsd.org Thu Aug 27 21:34:18 2015 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 739099C4FDE for ; Thu, 27 Aug 2015 21:34:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm8-vm0.bullet.mail.bf1.yahoo.com (nm8-vm0.bullet.mail.bf1.yahoo.com [98.139.213.95]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 280F536C for ; Thu, 27 Aug 2015 21:34:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1440711250; bh=A2+2tqXvjorR8OVWHwGI9fVIYiVADGcq4laGN4mNo6c=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=ev2i1vnib6axyW/Um3b9IxDx479rt7DQzp5HQTM6C6FIBdg88ScvCjNKUIsyh1IUMbKVmI4DSUJzN/a28q0sri92nzjnWuwfsqeCZm3v1s/dGvj1KF5vql5Z34Il0dlxKXvESmJsXgyYrGV9s35/UkiAHIhd8tzTMchuvEJBtz2zVYFDrt/lWbfDNbA6He4ysCtJSAQXiDH+gmB15qOHUiYa2+5qwnS+ucg0wpp/ql7alzKKIQo7PaA8my9SYjUl4tLOTvdecP9pp2MA7fggyaW4o1S886P91IKytlQOzy3UpnE2aythEqj0sAcZncLY6OQ8y1dQYop1OLTT+2rv6w== Received: from [66.196.81.174] by nm8.bullet.mail.bf1.yahoo.com with NNFMP; 27 Aug 2015 21:34:10 -0000 Received: from [98.139.211.160] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 27 Aug 2015 21:34:10 -0000 Received: from [127.0.0.1] by smtp217.mail.bf1.yahoo.com with NNFMP; 27 Aug 2015 21:34:10 -0000 X-Yahoo-Newman-Id: 998856.79569.bm@smtp217.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: _eWkHzQVM1ndSzsR1mQtaWPXlnWzIq4t0wFGLl0030AMpD1 tbW2KTS7ml_x0D.BI2_hHF6X_S_6Yr7hfeg.b_OeMz90n_YkjddMplMJPLF2 abfpq7iW9jHD1KVi9YT8GcqvXAiaVbjM6AX8MhtVM5_pH_1UDor6159sy_Nj tA_P5R6sb7YL3yQ4NgmXeYag2vutJ4KePo3YGRirRbh9Shm9AwgtBGURF7.n POO3JAjtJJXe78TfJTbYAPHMn17ThYURQ6UM68uEnn2WKof.p5GLs9ZAjsmR A.faDb7nFipHktUu8_Y8VMtiwM5NYu4Sd5fV0Mtqc1r.RuVSAzolPQcMsHtB WZrgI.6mlLvdVHUayVSWmBdEAhupXVUApegE89aeKB2PhU7vxMTQXB00QkbK MAwOJ9OZX4lDHL.i1El.IfCF.ZyMKuriD4fub0eufIaLXZ_Nnw7JlODOmawT DUAJ33QLs83p_r3ChIyOMO4X_J7sDtQAIwuJsh2PR6R3IaGvRbtqWN.farEj bCf8P4YLuuDttIno_K5nyKvY6KUWU3Ld1 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r287206 - head/sys/sys To: Alexander Kabaev References: <201508271400.t7RE0Nbc071389@repo.freebsd.org> <55DF3519.1000106@FreeBSD.org> <55DF7E0E.6030007@FreeBSD.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <55DF8257.2070904@FreeBSD.org> Date: Thu, 27 Aug 2015 16:34:15 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55DF7E0E.6030007@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.20 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, 27 Aug 2015 21:34:18 -0000 On 08/27/15 16:15, Pedro Giffuni wrote: > ... > ... > >> The original change to cdefs.h appears to be plain wrong. >> > > Not really, it may appear some day. > I take that back, there is something wrong: #ifndef __has_feature #define __has_feature(x) (0) #endif #if __has_attribute(alloc_size) #error Has attribute #endif $ cc -E attr-text.c # 1 "attr-text.c" # 1 "" # 1 "" # 1 "attr-text.c" attr-text.c:5:20: error: missing binary operator before token "(" $ cc --version cc (GCC) 4.2.1 20070831 patched [FreeBSD] Copyright (C) 2007 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. Pedro. From owner-svn-src-head@freebsd.org Thu Aug 27 22:42:03 2015 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 1C2019C47F2; Thu, 27 Aug 2015 22:42:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 0AAA49F9; Thu, 27 Aug 2015 22:42:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RMg2Th088989; Thu, 27 Aug 2015 22:42:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RMg2Wf088988; Thu, 27 Aug 2015 22:42:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508272242.t7RMg2Wf088988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 27 Aug 2015 22:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287224 - head/share/mk 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.20 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, 27 Aug 2015 22:42:03 -0000 Author: imp Date: Thu Aug 27 22:42:02 2015 New Revision: 287224 URL: https://svnweb.freebsd.org/changeset/base/287224 Log: Document bsd.endian.mk. Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Thu Aug 27 21:52:09 2015 (r287223) +++ head/share/mk/bsd.README Thu Aug 27 22:42:02 2015 (r287224) @@ -21,6 +21,7 @@ bsd.compiler.mk - defined based on curr bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) bsd.dep.mk - handle Makefile dependencies bsd.doc.mk - building troff system documents +bsd.endian.mk - TARGET_ENDIAN=1234(little) or 4321 (big) for target bsd.files.mk - install of general purpose files bsd.incs.mk - install of include files bsd.info.mk - building GNU Info hypertext system (deprecated) From owner-svn-src-head@freebsd.org Thu Aug 27 23:33:42 2015 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 6ECA89C37BC; Thu, 27 Aug 2015 23:33:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5C0171D74; Thu, 27 Aug 2015 23:33:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RNXgmZ009550; Thu, 27 Aug 2015 23:33:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RNXdH5009539; Thu, 27 Aug 2015 23:33:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508272333.t7RNXdH5009539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 27 Aug 2015 23:33:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287225 - in head: share/man/man4 share/man/man9 sys/conf sys/dev/ow sys/modules sys/modules/ow sys/modules/ow/ow sys/modules/ow/ow_temp sys/modules/ow/owc 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.20 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, 27 Aug 2015 23:33:42 -0000 Author: imp Date: Thu Aug 27 23:33:38 2015 New Revision: 287225 URL: https://svnweb.freebsd.org/changeset/base/287225 Log: New 1-Wire bus implementation. 1-Wire controller is abstracted, though only gpiobus configured via FDT is supported. Bus enumeration is supported. Devices are created for each device found. 1-Wire temperature controllers are supported, but other drivers could be written. Temperatures are polled and reported via a sysctl. Errors are reported via sysctl counters. Mis-wired bus detection is included for more trouble shooting. See ow(4), owc(4) and ow_temp(4) for details of what's supported and known issues. This has been tested on Raspberry Pi-B, Pi2 and Beagle Bone Black with up to 7 devices. Differential Revision: https://reviews.freebsd.org/D2956 Relnotes: yes MFC after: 2 weeks Reviewed by: loos@ (with many insightful comments) Added: head/share/man/man4/ow.4 (contents, props changed) head/share/man/man4/ow_temp.4 (contents, props changed) head/share/man/man4/owc.4 (contents, props changed) head/share/man/man9/owll.9 (contents, props changed) head/share/man/man9/own.9 (contents, props changed) head/sys/dev/ow/ head/sys/dev/ow/README.txt (contents, props changed) head/sys/dev/ow/ow.c (contents, props changed) head/sys/dev/ow/ow.h (contents, props changed) head/sys/dev/ow/ow_temp.c (contents, props changed) head/sys/dev/ow/owc_gpiobus.c (contents, props changed) head/sys/dev/ow/owll.h (contents, props changed) head/sys/dev/ow/owll_if.m (contents, props changed) head/sys/dev/ow/own.h (contents, props changed) head/sys/dev/ow/own_if.m (contents, props changed) head/sys/modules/ow/ head/sys/modules/ow/Makefile (contents, props changed) head/sys/modules/ow/ow/ head/sys/modules/ow/ow/Makefile (contents, props changed) head/sys/modules/ow/ow_temp/ head/sys/modules/ow/ow_temp/Makefile (contents, props changed) head/sys/modules/ow/owc/ head/sys/modules/ow/owc/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man9/Makefile head/sys/conf/files head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Aug 27 22:42:02 2015 (r287224) +++ head/share/man/man4/Makefile Thu Aug 27 23:33:38 2015 (r287225) @@ -379,6 +379,9 @@ MAN= aac.4 \ oce.4 \ ohci.4 \ orm.4 \ + ow.4 \ + ow_temp.4 \ + owc.4 \ ${_padlock.4} \ pass.4 \ patm.4 \ @@ -667,6 +670,7 @@ MLINKS+=nge.4 if_nge.4 MLINKS+=${_ntb.4} ${_if_ntb.4} \ ${_ntb.4} ${_ntb_hw.4} MLINKS+=${_nxge.4} ${_if_nxge.4} +MLINKS+=ow.4 onewire.4 MLINKS+=patm.4 if_patm.4 MLINKS+=pccbb.4 cbb.4 MLINKS+=pcm.4 snd.4 \ Added: head/share/man/man4/ow.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ow.4 Thu Aug 27 23:33:38 2015 (r287225) @@ -0,0 +1,60 @@ +.\" +.\" Copyright (c) 2015 M. Warner Losh +.\" 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. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" 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$ +.\" +.Dd July 20, 2015 +.Dt OW 4 +.Os +.Sh NAME +.Nm ow +.Nd Dallas Semiconductor 1-Wire bus +.Sh SYNOPSIS +.Cd device ow +.Sh DESCRIPTION +The +.Nm +module implements the Dallas Semiconductor 1-Wire bus. +It attaches to the +.Xr owc 4 +driver, which implements the low-level signaling of the +1-Wire bus. +.Sh SEE ALSO +.Xr ow_temp 4 , +.Xr owc 4 , +.Xr owll 9 , +.Xr own 9 +.Sh LEGAL +.Tn 1-Wire +is a registered trademark of Maxim Integrated Products, Inc. +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were written by +.An Warner Losh . Added: head/share/man/man4/ow_temp.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ow_temp.4 Thu Aug 27 23:33:38 2015 (r287225) @@ -0,0 +1,155 @@ +.\" +.\" Copyright (c) 2015 M. Warner Losh +.\" 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. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" 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$ +.\" +.Dd July 20, 2015 +.Dt OW_TEMP 4 +.Os +.Sh NAME +.Nm ow_temp +.Nd Dallas Semiconductor 1-Wire Temperature sensor +.Sh SYNOPSIS +.Cd device ow_temp +.Sh DESCRIPTION +The +.Nm +module supports many of the 1-Wire temperature sensors. +.Pp +The sensor is read periodically and the results returned via a +.Xr sysctl 3 +as described below. +.Sh HARDWARE +These temperature sensors are supported by the +.Nm +driver: +.Bl -tag -width MAX31820 -compact +.It DS1820 +1-Wire Digital Thermometer +.It DS18S20 +High-Precision 1-Wire Digital Thermometer +.It DS18B20 +Programmable Resolution 1-Wire Digital Thermometer +.It DS1822 +Econo 1-Wire Digital Thermometer +.It DS1825 +Programmable Resolution 1-Wire Digital Thermometer with 4-bit ID +.It MAX31820 +1-Wire, Parasite-Power, Ambient Temperature Sensor +.El +.Pp +The driver supports Family codes 0x10, 0x22, 0x28, and 0x3b. +.Sh SYSCTL +The +.Nm +driver reports data via +.Xr sysctl 8 +entries in the device's node in the +.Xr sysctl 8 +tree: +.Bl -tag -width xxxxxxxxxx +.It temperature +The last temperature read, in milli-Kelvin. +.It badcrc +The number of CRC errors in reading the temperature form the +device. +Some CRC errors are to be expected. +High rates of CRC errors, however, generally indicate a noisy +environment, cabling issues, or too many devices on the bus. +.It badread +The number of times a non-CRC error was encountered reading the temperature +from the card. +This type of error is very rare. +.It reading_interval +The time, in ticks, between successive reads of the sensor. +.It parasite +This item is non-zero when the device is connected using its parasitic +power mode. +It can also indicate a wiring error. +.El +.Pp +Temperatures are reported in milli-Kelvin, even though the absolute +accuracy is around 0.2 degrees for the good devices and around 1 +degree for cheaper devices. +The devices report in steps of 0.0625 degrees. +The driver preserves the precision of the device's measurements +in its +.Xr sysctl 8 +reports. +These devices often have a much higher relative accuracy and +repeatability than their absolute accuracy. +This makes them well suited for control loops that strive for +stability and become possible if the full precision is preserved. +.Sh SEE ALSO +.Xr ow 4 , +.Xr owc 4 , +.Xr sysctl 8 , +.Xr owll 9 , +.Xr own 9 +.Sh LEGAL +.Tn 1-Wire +is a registered trademark of Maxim Integrated Products, Inc. +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were written by +.An Warner Losh . +.Sh BUGS +The parasitic mode of the devices does not work. +It requires support from the +.Xr owc 4 +driver that is unimplemented. +.Pp +The ID bits from the +.Em DS1825 +are not recognized or reported. +.Pp +The type of the device is not reported via +.Xr sysctl 8 . +.Pp +Alarm mode is not supported. +It is not possible to set the low and high alarm temperatures. +.Pp +There is no way to write to the EEPROM. +.Pp +.Dq Convert Temperature +requests are sent directly to the device. +There is no way to use the broadcast ability of the 1-Wire bus to do +all the conversions in parallel. +.Pp +It is not possible to set the precision on those devices that support +it. +.Pp +The time to convert is fixed at 1 second, even though some devices are +faster. +.Pp +There is no character device to supply a stream of readings to a +program. +Programs interested in the temperature must poll the sysctl to get the +temperature. Added: head/share/man/man4/owc.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/owc.4 Thu Aug 27 23:33:38 2015 (r287225) @@ -0,0 +1,95 @@ +.\" +.\" Copyright (c) 2015 M. Warner Losh +.\" 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. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" 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$ +.\" +.Dd July 20, 2015 +.Dt OWC 4 +.Os +.Sh NAME +.Nm owc +.Nd Dallas Semiconductor 1-Wire Controller +.Sh SYNOPSIS +.Cd device owc +.Sh DESCRIPTION +The +.Nm +module implements Dallas Semiconductor 1-Wire signaling. +It attaches the +.Xr ow 4 +driver 1-Wire bus protocol. +The +.Nm +device implements the Link Layer of the 1-Wire bus protocol stack. +.Pp +Bit banging a pin on a +.Xr gpiobus 4 +is the only supported controller. +Both standard and overdrive transfer timings are implemented. +Strong pull-up functionality needed to support parasitic mode is not +implemented. +.Pp +To enable 1-Wire for FDT systems requires modifying the DTS for your +board to add something like: +.Bd -literal +/ { + ... + onewire { + compatible = "w1-gpio"; + gpios = <&gpio 4 1>; + }; + ... +}; +.Ed +.Pp +The gpios property describes the GPIO pin the 1-Wire bus is connected +to. +For more details about the +.Va gpios +property, please consult +.Pa /usr/src/sys/boot/fdt/dts/bindings-gpio.txt . +.Sh SEE ALSO +.Xr gpiobus 4 , +.Xr ow 4 , +.Xr ow_temp 4 , +.Xr owll 9 , +.Xr own 9 +.Sh LEGAL +.Tn 1-Wire +is a registered trademark of Maxim Integrated Products, Inc. +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were written by +.An Warner Losh . +.Sh CAVEATS +The gpio driver implements timing by busy waiting, which can cause a +high load on slower systems. +.Sh BUGS +Overdrive mode has not actually been tested. Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Aug 27 22:42:02 2015 (r287224) +++ head/share/man/man9/Makefile Thu Aug 27 23:33:38 2015 (r287225) @@ -190,6 +190,8 @@ MAN= accept_filter.9 \ netisr.9 \ nv.9 \ osd.9 \ + owll.9 \ + own.9 \ panic.9 \ pbuf.9 \ PCBGROUP.9 \ Added: head/share/man/man9/owll.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/owll.9 Thu Aug 27 23:33:38 2015 (r287225) @@ -0,0 +1,93 @@ +.\" +.\" Copyright (c) 2015 M. Warner Losh +.\" 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. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" 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$ +.\" +.Dd July 20, 2015 +.Dt OWLL 9 +.Os +.Sh NAME +.Nm owll +.Nm OWLL_WRITE_ONE, +.Nm OWLL_WRITE_ZERO, +.Nm OWLL_READ_DATA, +.Nm OWLL_REASET_AND_PRESENCE +.Nd Dallas Semiconductor 1-Wire Link Layer Interface +.Sh SYNOPSIS +.Ft int +.Fn OWLL_WRITE_ONE "device_t lldev" "struct ow_timing *timing" +.Ft int +.Fn OWLL_WRITE_ZERO "device_t lldev" "struct ow_timing *timing" +.Ft int +.Fn OWLL_READ_DATA "device_t lldev" "struct ow_timing *timing" "int *bit" +.Ft int +.Fn OWLL_RESET_AND_PRESENCE "device_t lldev" "struct ow_timing *timing" "int *bit" +.Sh DESCRIPTION +The +.Nm +interface provides access to the link layer of the Dallas +Semiconductor 1-Wire from upper layers of the protocol. +.Pp +.Fn OWLL_WRITE_ONE +and +.Fn OWLL_WRITE_ZERO +writes a one bitor a zero bit respectively on the 1-Wire bus. +.Pp +.Fn OWLL_READ_DATA +reads one bit from the 1-Wire bus. +This is often referred to as a +.Dq Read Time Slot +in the 1-Wire device data sheets. +.Pp +The +.Fn OWLL_RESET_AND_PRESENCE +function starts a reset sequence and detects if any device(s) are +present on the bus. +This is the beginning of all 1-Wire transactions. +.Sh NOTES +This interface is intended to be used only by the +.Xr ow 4 +device to talk to the low-level bus. +By convention, the device that implements this interface is called +.Xr owc 4 . +Only devices that implement +.Xr own 9 +should call these interfaces. +.Sh SEE ALSO +.Xr ow 4 , +.Xr owc 4 , +.Xr own 9 +.Sh LEGAL +.Tn 1-Wire +is a registered trademark of Maxim Integrated Products, Inc. +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were written by +.An Warner Losh . Added: head/share/man/man9/own.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/own.9 Thu Aug 27 23:33:38 2015 (r287225) @@ -0,0 +1,230 @@ +.\" +.\" Copyright (c) 2015 M. Warner Losh +.\" 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. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" 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$ +.\" +.Dd July 20, 2015 +.Dt OWN 9 +.Os +.Sh NAME +.Nm own , +.Nm own_send_command , +.Nm own_commmand_wait , +.Nm own_self_command , +.Nm own_acquire_bus , +.Nm own crc , +.Nm own_release_bus , +.Nm OWN_ACQUIRE_BUS , +.Nm OWN_CRC , +.Nm OWN_RELEASE_BUS , +.Nm OWN_SEND_COMMAND +.Nd Dallas Semiconductor 1-Wire Network and Transport Interface +.Sh SYNOPSIS +.In sys/bus.h +.In dev/ow/own.h +.Ft int +.Fn own_send_command "device_t pdev" "struct ow_cmd *cmd" +.Ft int +.Fn own_command_wait "device_t pdev" "struct ow_cmd *cmd" +.Ft int +.Fn own_self_command "device_t pdev" "struct ow_cmd *cmd" "uint8_t xpt_cmd" +.Ft int +.Fn own_acquire_bus "device_t pdev" "int how" +.Ft int +.Fn own_release_bus "device_t pdev" +.Ft int +.Fn own_crc "device_t pdev" "uint8_t *buffer" "size_t len" +.Ft int +.Fn OWN_SEND_COMMAND "device_t ndev" "device_t pdev" "struct ow_cmd *cmd" +.Ft int +.Fn OWN_ACQUIRE_BUS "device_t ndev" "device_t pdev" "int how" +.Ft void +.Fn OWN_RELEASE_BUS "device_t ndev" "device_t pdev" +.Ft uint8_t +.Fn OWN_CRC "device_t ndev" "device_t pdev" "uint8_t *buffer" "size_t len" +.Sh DESCRIPTION +The +.Nm +interface defines three sets of functions for interacting with 1-Wire +devices: +sending commands, +reserving the bus, +and +ensuring data integrity. +Wrappers are provided for the raw +.Nm OWN +.Xr kobj 9 +interfaces and should be used for improved safety over the +.Xr kobj 9 +ones. +.Ss Bus Commands +The 1-Wire bus defines different layers of access to the devices on +the bus. +The +.Nm +functions provide access to the network and transport layers. +The network layer designates the next command as being either for all +devices on the bus, or for a specific device. +The network layer also specifies the speed used by the link layer. +.Pp +.Vt "struct ow_cmd" +encapsulates network access, speed, and timing information. +It specifies the commands to send and whether or not to read data. +Its members are: +.Bl -tag -width ".Va xxxx" +.It Va flags +Flags controlling the interpretation of the structure. +These flags are defined in +.In dev/ow/ow.h : +.Bl -tag -width indent +.It OW_FLAG_OVERDRIVE +Send +.Va xpt_cmd +bytes and read +.Va xpt_read +bytes at overdrive speed. +.It OW_FLAG_READ_BIT +Interpret +.Va xpt_read_len +to be in bits to be read after +.Va xpt_cmd +rather than bytes. +.El +.It Va rom_cmd +ROM command bytes to send. +.It Va rom_len +Number of ROM command bytes to send. +.It Va rom_read_len +Number of bytes to read after sending the ROM command. +.It Va rom_read +Buffer for bytes read after the ROM command. +.It Va xpt_cmd +Transport command to send. +.It Va xpt_len +Length of the transport command bytes to send. +Specify 0 for no transport command. +.It Va xpt_read_len +Number of bytes to read after +.Va xpt_cmd +bytes are sent. +If the +.Dv OW_FLAG_READ_BIT +bit is set in +.Va flags , +then it is the number of bits to read. +Bits read are packed into bytes. +.It Va xpt_read +Buffer for data read. +.El +.Pp +.Fn own_command_wait +acquires the 1-Wire bus, waiting if necessary, +sends the command, +and +then releases the bus. +.Fn own_send_command +sends the command without bus reservation. +.Fa pdev +is the client device (the presentation layer device) sending the command. +The +.Fa cmd +argument describes the transaction to send to the 1-Wire bus. +.Pp +.Fn own_self_command +fills in +.Fa cmd +with a MATCH_ROM ROM command, the ROM address of +.Fa pdev +and the +.Fa xpt_cmd +as a convenient way to create directed commands. +.Ss Bus Reservation +The 1-Wire system includes an advisory lock for the bus that +presentation layer devices can use to coordinate access. +Locking is purely advisory at this time. +.Pp +.Fn own_acquire_bus +reserves the bus. +It waits indefinitely if the +.Fa how +argument is +.Dv OWN_WAIT +and returns the error +.Dv EWOULDBLOCK +if passed +.Dv OWN_DONTWAIT +when the bus is owned by another client. +.Pp +.Fn own_release_bus +releases the bus. +.Ss Data Integrity +.Fn own_crc +computes the 1-Wire standard CRC function over the data +passed in +.Fa buffer +and +.Fa len +and returns the result. +.Ss Notes +The 1-Wire standard (Maxim AN937) defines layers that are akin to ISO +networking layers. +The lowest relevant layer, the link layer, defines the polling windows +and the timing of the signaling of different modes. +The network layer is built on top of the link layer +and is used to address devices in a unicast or multicast manner. +The transport layer defines commands and responses from the devices. +The presentation layer is composed of the device specific commands and +actions used to control the specific 1-Wire devices on bus. +.Pp +These interfaces are implemented by the +.Xr ow 4 +device. +Presentation layer devices (children of the newbus +.Xr ow 4 +device) should only call the functions described here. +The functionality provided by the +.Xr owc 4 +device (specifically the +.Xr owll 9 +interface) should only be called by the +.Xr ow 4 +driver. +.Sh SEE ALSO +.Xr ow 4 , +.Xr owc 4 , +.Xr owll 9 +.Pa http://pdfserv.maximintegrated.com/en/an/AN937.pdf +.Sh LEGAL +.Tn 1-Wire +is a registered trademark of Maxim Integrated Products, Inc. +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were written by +.An Warner Losh . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Aug 27 22:42:02 2015 (r287224) +++ head/sys/conf/files Thu Aug 27 23:33:38 2015 (r287225) @@ -2088,6 +2088,13 @@ dev/ofw/ofw_iicbus.c optional fdt iicbu dev/ofw/ofwbus.c optional fdt dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt +dev/ow/ow.c optional ow \ + dependency "owll_if.h" \ + dependency "own_if.h" +dev/ow/owll_if.m optional ow +dev/ow/own_if.m optional ow +dev/ow/ow_temp.c optional ow_temp +dev/ow/owc_gpiobus.c optional owc gpio dev/patm/if_patm.c optional patm pci dev/patm/if_patm_attach.c optional patm pci dev/patm/if_patm_intr.c optional patm pci Added: head/sys/dev/ow/README.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ow/README.txt Thu Aug 27 23:33:38 2015 (r287225) @@ -0,0 +1,19 @@ +Quick Design Document for 1-wire bus + +In new bus terms, 1-wire devices are attached to 1-wire buses (ow) +which are attached to a one wire bridge (owc). + +The implementation follows the terminology used in the Maxim AN927 +Application note which defines the 1-wire bus as implemented for the +iButton product. This is considered to be the canonical definition of +the 1-wire bus. This means that the 1-wire bridge will implement the +owll(9) interface. ow is one wire. ll is for Link Level to mirror the ISO +stack terminology used by AN927. The 1-wire bus is implemented in the ow(4) +device, which implements the own(9) interface (n for network, the layer +described in the AN927). The presentation layer and above is the +responsibility of the client device drivers to implement. + +Client drivers may only call the own(9) interface. The ow(4) driver +calls the owll(9) interface and implements the own(9). + +$FreeBSD$ Added: head/sys/dev/ow/ow.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ow/ow.c Thu Aug 27 23:33:38 2015 (r287225) @@ -0,0 +1,639 @@ +/*- + * Copyright (c) 2015 M. Warner Losh + * 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 unmodified, 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 ``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 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 +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +/* + * lldev - link level device + * ndev - network / transport device (this module) + * pdev - presentation device (children of this module) + */ + +typedef int ow_enum_fn(device_t, device_t); +typedef int ow_found_fn(device_t, romid_t); + +struct ow_softc +{ + device_t dev; /* Newbus driver back pointer */ + struct mtx mtx; /* bus mutex */ + device_t owner; /* bus owner, if != NULL */ +}; + +struct ow_devinfo +{ + romid_t romid; +}; + +static int ow_acquire_bus(device_t ndev, device_t pdev, int how); +static void ow_release_bus(device_t ndev, device_t pdev); + +#define OW_LOCK(_sc) mtx_lock(&(_sc)->mtx) +#define OW_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) +#define OW_LOCK_DESTROY(_sc) mtx_destroy(&_sc->mtx) +#define OW_ASSERT_LOCKED(_sc) mtx_assert(&_sc->mtx, MA_OWNED) +#define OW_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->mtx, MA_NOTOWNED) + +static MALLOC_DEFINE(M_OW, "ow", "House keeping data for 1wire bus"); + +static struct ow_timing timing_regular = { + .t_slot = 60, /* 60 to 120 */ + .t_low0 = 60, /* really 60 to 120 */ + .t_low1 = 1, /* really 1 to 15 */ + .t_release = 45, /* <= 45us */ + .t_rec = 1, /* at least 1us */ + .t_rdv = 15, /* 15us */ + .t_rstl = 480, /* 480us or more */ + .t_rsth = 480, /* 480us or more */ + .t_pdl = 60, /* 60us to 240us */ + .t_pdh = 60, /* 15us to 60us */ + .t_lowr = 1, /* 1us */ +}; + +/* NB: Untested */ +static struct ow_timing timing_overdrive = { + .t_slot = 11, /* 6us to 16us */ + .t_low0 = 6, /* really 6 to 16 */ + .t_low1 = 1, /* really 1 to 2 */ + .t_release = 4, /* <= 4us */ + .t_rec = 1, /* at least 1us */ + .t_rdv = 2, /* 2us */ + .t_rstl = 48, /* 48us to 80us */ + .t_rsth = 48, /* 48us or more */ + .t_pdl = 8, /* 8us to 24us */ + .t_pdh = 2, /* 2us to 6us */ + .t_lowr = 1, /* 1us */ +}; + +static void +ow_send_byte(device_t lldev, struct ow_timing *t, uint8_t byte) +{ + int i; + + for (i = 0; i < 8; i++) + if (byte & (1 << i)) + OWLL_WRITE_ONE(lldev, t); + else + OWLL_WRITE_ZERO(lldev, t); +} + +static void +ow_read_byte(device_t lldev, struct ow_timing *t, uint8_t *bytep) +{ + int i; + uint8_t byte = 0; + int bit; + + for (i = 0; i < 8; i++) { + OWLL_READ_DATA(lldev, t, &bit); + byte |= bit << i; + } + *bytep = byte; +} + +static int +ow_send_command(device_t ndev, device_t pdev, struct ow_cmd *cmd) +{ + int present, i, bit, tries; + device_t lldev; + struct ow_timing *t; + + lldev = device_get_parent(ndev); + + /* + * Retry the reset a couple of times before giving up. + */ + tries = 4; + do { + OWLL_RESET_AND_PRESENCE(lldev, &timing_regular, &present); + if (present == 1) + device_printf(ndev, "Reset said no device on bus?.\n"); + } while (present == 1 && tries-- > 0); + if (present == 1) { + device_printf(ndev, "Reset said the device wasn't there.\n"); + return ENOENT; /* No devices acked the RESET */ + } + if (present == -1) { + device_printf(ndev, "Reset discovered bus wired wrong.\n"); + return ENOENT; + } + + for (i = 0; i < cmd->rom_len; i++) + ow_send_byte(lldev, &timing_regular, cmd->rom_cmd[i]); + for (i = 0; i < cmd->rom_read_len; i++) + ow_read_byte(lldev, &timing_regular, cmd->rom_read + i); + if (cmd->xpt_len) { + /* + * Per AN937, the reset pulse and ROM level are always + * done with the regular timings. Certain ROM commands + * put the device into overdrive mode for the remainder + * of the data transfer, which is why we have to pass the + * timings here. Commands that need to be handled like this + * are expected to be flagged by the client. + */ + t = (cmd->flags & OW_FLAG_OVERDRIVE) ? + &timing_overdrive : &timing_regular; + for (i = 0; i < cmd->xpt_len; i++) + ow_send_byte(lldev, t, cmd->xpt_cmd[i]); + if (cmd->flags & OW_FLAG_READ_BIT) { + memset(cmd->xpt_read, 0, (cmd->xpt_read_len + 7) / 8); + for (i = 0; i < cmd->xpt_read_len; i++) { + OWLL_READ_DATA(lldev, t, &bit); + cmd->xpt_read[i / 8] |= bit << (i % 8); + } + } else { + for (i = 0; i < cmd->xpt_read_len; i++) + ow_read_byte(lldev, t, cmd->xpt_read + i); + } + } + return 0; +} + +static int +ow_search_rom(device_t lldev, device_t dev) +{ + struct ow_cmd cmd; + + memset(&cmd, 0, sizeof(cmd)); + cmd.rom_cmd[0] = SEARCH_ROM; + cmd.rom_len = 1; + return ow_send_command(lldev, dev, &cmd); +} + +#if 0 +static int +ow_alarm_search(device_t lldev, device_t dev) +{ + struct ow_cmd cmd; + + memset(&cmd, 0, sizeof(cmd)); + cmd.rom_cmd[0] = ALARM_SEARCH; + cmd.rom_len = 1; + return ow_send_command(lldev, dev, &cmd); +} +#endif + +static int +ow_add_child(device_t dev, romid_t romid) +{ + struct ow_devinfo *di; + device_t child; + + di = malloc(sizeof(*di), M_OW, M_WAITOK); + di->romid = romid; + child = device_add_child(dev, NULL, -1); + if (child == NULL) { + free(di, M_OW); + return ENOMEM; + } + device_set_ivars(child, di); + return (0); +} + +static device_t +ow_child_by_romid(device_t dev, romid_t romid) +{ + device_t *children, retval, child; + int nkid, i; + struct ow_devinfo *di; + + if (device_get_children(dev, &children, &nkid) != 0) + return (NULL); + retval = NULL; + for (i = 0; i < nkid; i++) { + child = children[i]; + di = device_get_ivars(child); + if (di->romid == romid) { + retval = child; + break; + } + } + free(children, M_TEMP); + + return (retval); +} + +/* + * CRC generator table -- taken from AN937 DOW CRC LOOKUP FUNCTION Table 2 + */ +const uint8_t ow_crc_table[] = { + 0, 94, 188, 226, 97, 63, 221, 131, 194, 156, 126, 32, 163, 253, 31, 65, + 157, 195, 33, 127, 252, 162, 64, 30, 95, 1, 227, 189, 62, 96, 130, 220, + 35, 125, 159, 193, 66, 28, 254, 160, 225, 191, 93, 3, 128, 222, 60, 98, + 190, 224, 2, 92, 223, 129, 99, 61, 124, 34, 192, 158, 29, 67, 161, 255, + 70, 24, 250, 164, 39, 121, 155, 197, 132, 218, 56, 102, 229, 187, 89, 7, + 219, 133,103, 57, 186, 228, 6, 88, 25, 71, 165, 251, 120, 38, 196, 154, + 101, 59, 217, 135, 4, 90, 184, 230, 167, 249, 27, 69, 198, 152, 122, 36, + 248, 166, 68, 26, 153, 199, 37, 123, 58, 100, 134, 216, 91, 5, 231, 185, + 140,210, 48, 110, 237, 179, 81, 15, 78, 16, 242, 172, 47, 113,147, 205, + 17, 79, 173, 243, 112, 46, 204, 146, 211,141, 111, 49, 178, 236, 14, 80, + 175, 241, 19, 77, 206, 144, 114, 44, 109, 51, 209, 143, 12, 82,176, 238, + 50, 108, 142, 208, 83, 13, 239, 177, 240, 174, 76, 18, 145, 207, 45, 115, + 202, 148, 118, 40, 171, 245, 23, 73, 8, 86, 180, 234, 105, 55, 213, 139, + 87, 9, 235, 181, 54, 104, 138, 212, 149, 203, 41, 119, 244, 170, 72, 22, + 233, 183, 85, 11, 136, 214, 52, 106, 43, 117, 151, 201, 74, 20, 246, 168, + 116, 42, 200, 150, 21, 75, 169, 247, 182, 232, 10, 84, 215, 137, 107, 53 +}; + +/* + * Converted from DO_CRC page 131 ANN937 + */ +static uint8_t +ow_crc(device_t ndev, device_t pdev, uint8_t *buffer, size_t len) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Aug 27 23:46:46 2015 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 0CD219C3BC7; Thu, 27 Aug 2015 23:46:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E6B17638; Thu, 27 Aug 2015 23:46:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7RNkjvF014003; Thu, 27 Aug 2015 23:46:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7RNkg6C013955; Thu, 27 Aug 2015 23:46:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508272346.t7RNkg6C013955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 27 Aug 2015 23:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287227 - in head: lib/libstand share/mk sys/boot/efi sys/boot/ficl sys/boot/i386 sys/boot/libstand32 sys/boot/pc98 sys/boot/userboot/ficl sys/boot/userboot/libstand sys/boot/zfs 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.20 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, 27 Aug 2015 23:46:46 -0000 Author: imp Date: Thu Aug 27 23:46:42 2015 New Revision: 287227 URL: https://svnweb.freebsd.org/changeset/base/287227 Log: Use CFLAGS_NO_SIMD in preference to varying lists of -mno-xxxx flags. Go ahead and defined -D_STANDALONE for all targets (only strictly needed for some architecture, but harmless on those it isn't required for). Also add -msoft-float to all architectures uniformly rather that higgley piggley like it is today. Differential Revision: https://reviews.freebsd.org/D3496 Added: head/share/mk/bsd.stand.mk (contents, props changed) Modified: head/lib/libstand/Makefile head/sys/boot/efi/Makefile.inc head/sys/boot/ficl/Makefile head/sys/boot/i386/Makefile.inc head/sys/boot/libstand32/Makefile head/sys/boot/pc98/Makefile.inc head/sys/boot/userboot/ficl/Makefile head/sys/boot/userboot/libstand/Makefile head/sys/boot/zfs/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Thu Aug 27 23:46:11 2015 (r287226) +++ head/lib/libstand/Makefile Thu Aug 27 23:46:42 2015 (r287227) @@ -21,34 +21,8 @@ MAN= libstand.3 WARNS?= 0 -CFLAGS+= -ffreestanding -Wformat CFLAGS+= -I${LIBSTAND_SRC} -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -.endif -.if ${MACHINE_CPUARCH} == "i386" -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -.endif -.if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -fPIC -mno-red-zone -.endif -.if ${MACHINE} == "pc98" -CFLAGS+= -Os -.endif -.if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG -.endif -.if ${MACHINE_CPUARCH} == "arm" -CFLAGS+= -msoft-float -D_STANDALONE -.endif -.if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -D_STANDALONE -mgeneral-regs-only -.endif -.if ${MACHINE_CPUARCH} == "mips" -CFLAGS+= -G0 -fno-pic -mno-abicalls -.endif - # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ @@ -168,4 +142,5 @@ SRCS+= pkgfs.c SRCS+= nandfs.c .endif +.include .include Added: head/share/mk/bsd.stand.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/bsd.stand.mk Thu Aug 27 23:46:42 2015 (r287227) @@ -0,0 +1,24 @@ +# $FreeBSD$ +# +# Common definitons for programs building in the stand-alone environment +# and/or using libstand. +# + +CFLAGS+= -ffreestanding -Wformat +CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float -D_STANDALONE + +.if ${MACHINE_CPUARCH} == "i386" +CFLAGS.gcc+= -mpreferred-stack-boundary=2 +.endif +.if ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -fPIC -mno-red-zone +.endif +.if ${MACHINE} == "pc98" +CFLAGS+= -Os +.endif +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -mgeneral-regs-only +.endif +.if ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -G0 -fno-pic -mno-abicalls +.endif Modified: head/sys/boot/efi/Makefile.inc ============================================================================== --- head/sys/boot/efi/Makefile.inc Thu Aug 27 23:46:11 2015 (r287226) +++ head/sys/boot/efi/Makefile.inc Thu Aug 27 23:46:42 2015 (r287227) @@ -4,19 +4,18 @@ BINDIR?= /boot .if ${MACHINE_CPUARCH} == "i386" CFLAGS+= -march=i386 +CFLAGS+= -mno-aes .endif # Options used when building app-specific efi components # See conf/kern.mk for the correct set of these -CFLAGS+= -ffreestanding -Wformat -msoft-float +CFLAGS+= -ffreestanding -Wformat -msoft-float ${CFLAGS_NO_SIMD} LDFLAGS+= -nostdlib .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -fshort-wchar CFLAGS+= -mno-red-zone -CFLAGS+= -mno-mmx -mno-sse -CFLAGS.clang+= -mno-aes -mno-avx +CFLAGS+= -mno-aes .endif - .include "../Makefile.inc" Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Thu Aug 27 23:46:11 2015 (r287226) +++ head/sys/boot/ficl/Makefile Thu Aug 27 23:46:42 2015 (r287227) @@ -15,30 +15,14 @@ BASE_SRCS= dict.c ficl.c fileaccess.c fl SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o -CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || \ (${MACHINE_CPUARCH} == "amd64" && defined(FICL32)) CFLAGS+= -march=i386 -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -.endif -.if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -mno-red-zone -.endif -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -.endif -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" -CFLAGS+= -msoft-float -.endif -.if ${MACHINE} == "pc98" -CFLAGS+= -Os -DPC98 -.endif -.if ${MACHINE_CPUARCH} == "mips" -CFLAGS+= -G0 -fno-pic -mno-abicalls .endif .if HAVE_PNP CFLAGS+= -DHAVE_PNP .endif +.include .ifmake testmain CFLAGS+= -DTESTMAIN -D_TESTMAIN SRCS+= testmain.c Modified: head/sys/boot/i386/Makefile.inc ============================================================================== --- head/sys/boot/i386/Makefile.inc Thu Aug 27 23:46:11 2015 (r287226) +++ head/sys/boot/i386/Makefile.inc Thu Aug 27 23:46:42 2015 (r287227) @@ -7,7 +7,7 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 CFLAGS+= -march=i386 -ffreestanding CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float LDFLAGS+= -nostdlib .if ${MACHINE_CPUARCH} == "amd64" Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Thu Aug 27 23:46:11 2015 (r287226) +++ head/sys/boot/libstand32/Makefile Thu Aug 27 23:46:42 2015 (r287227) @@ -22,29 +22,6 @@ NO_PIC= WARNS?= 0 -CFLAGS+= -ffreestanding -Wformat -CFLAGS+= -I${LIBSTAND_SRC} - -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -.endif -.if ${MACHINE} == "pc98" -CFLAGS+= -Os -.endif -.if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG -.endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -I. -.endif -.if ${MACHINE_CPUARCH} == "arm" -CFLAGS+= -msoft-float -D_STANDALONE -.endif -.if ${MACHINE_CPUARCH} == "mips" -CFLAGS+= -G0 -fno-pic -mno-abicalls -.endif - # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ @@ -164,6 +141,7 @@ SRCS+= pkgfs.c SRCS+= nandfs.c .endif +.include .include .if ${MACHINE_CPUARCH} == "amd64" Modified: head/sys/boot/pc98/Makefile.inc ============================================================================== --- head/sys/boot/pc98/Makefile.inc Thu Aug 27 23:46:11 2015 (r287226) +++ head/sys/boot/pc98/Makefile.inc Thu Aug 27 23:46:42 2015 (r287227) @@ -7,7 +7,7 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 CFLAGS+= -march=i386 -ffreestanding CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float CFLAGS+= -Os -DPC98 LDFLAGS+= -nostdlib Modified: head/sys/boot/userboot/ficl/Makefile ============================================================================== --- head/sys/boot/userboot/ficl/Makefile Thu Aug 27 23:46:11 2015 (r287226) +++ head/sys/boot/userboot/ficl/Makefile Thu Aug 27 23:46:42 2015 (r287227) @@ -10,24 +10,10 @@ BASE_SRCS= dict.c ficl.c fileaccess.c fl SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o -CFLAGS+= -ffreestanding -fPIC -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -#CFLAGS+= -march=i386 -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -.endif -.if ${MACHINE_CPUARCH} == "i386" -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= -mno-sse3 -.endif -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" -CFLAGS+= -msoft-float -.endif -.if ${MACHINE} == "pc98" -CFLAGS+= -Os -DPC98 -.endif .if HAVE_PNP CFLAGS+= -DHAVE_PNP .endif +.include .ifmake testmain CFLAGS+= -DTESTMAIN -D_TESTMAIN SRCS+= testmain.c Modified: head/sys/boot/userboot/libstand/Makefile ============================================================================== --- head/sys/boot/userboot/libstand/Makefile Thu Aug 27 23:46:11 2015 (r287226) +++ head/sys/boot/userboot/libstand/Makefile Thu Aug 27 23:46:42 2015 (r287227) @@ -22,26 +22,6 @@ NO_PIC= WARNS?= 0 -CFLAGS+= -ffreestanding -Wformat -fPIC -CFLAGS+= -I${LIBSTAND_SRC} - -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -.endif -.if ${MACHINE_CPUARCH} == "i386" -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= -mno-sse3 -.endif -.if ${MACHINE} == "pc98" -CFLAGS+= -Os -.endif -.if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG -.endif -.if ${MACHINE_CPUARCH} == "arm" -CFLAGS+= -msoft-float -D_STANDALONE -.endif - # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ @@ -152,4 +132,5 @@ SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipf SRCS+= dosfs.c ext2fs.c SRCS+= splitfs.c +.include .include Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Thu Aug 27 23:46:11 2015 (r287226) +++ head/sys/boot/zfs/Makefile Thu Aug 27 23:46:42 2015 (r287227) @@ -10,14 +10,8 @@ CFLAGS+= -I${.CURDIR}/../common -I${.CUR CFLAGS+= -I${.CURDIR}/../../../lib/libstand CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs -CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -march=i386 -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -.endif -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" -CFLAGS+= -msoft-float .endif .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 @@ -31,6 +25,7 @@ machine: ln -sf ${.CURDIR}/../../i386/include machine .endif +.include .include .if ${MACHINE_CPUARCH} == "amd64" From owner-svn-src-head@freebsd.org Fri Aug 28 00:13:00 2015 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 6A40F9C4942; Fri, 28 Aug 2015 00:13:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5B65D1C28; Fri, 28 Aug 2015 00:13:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S0D0p9026275; Fri, 28 Aug 2015 00:13:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S0D0qw026274; Fri, 28 Aug 2015 00:13:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508280013.t7S0D0qw026274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 28 Aug 2015 00:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287232 - head/share/man/man9 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.20 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, 28 Aug 2015 00:13:00 -0000 Author: markj Date: Fri Aug 28 00:12:59 2015 New Revision: 287232 URL: https://svnweb.freebsd.org/changeset/base/287232 Log: nv.h lives in sys/ as of r279439. Modified: head/share/man/man9/nv.9 Modified: head/share/man/man9/nv.9 ============================================================================== --- head/share/man/man9/nv.9 Fri Aug 28 00:06:31 2015 (r287231) +++ head/share/man/man9/nv.9 Fri Aug 28 00:12:59 2015 (r287232) @@ -60,7 +60,7 @@ .Sh LIBRARY .Lb libnv .Sh SYNOPSIS -.In nv.h +.In sys/nv.h .Ft "nvlist_t *" .Fn nvlist_create "int flags" .Ft void From owner-svn-src-head@freebsd.org Fri Aug 28 00:17:22 2015 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 803E49C4A4D; Fri, 28 Aug 2015 00:17:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7119A1DEB; Fri, 28 Aug 2015 00:17:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S0HMVI026571; Fri, 28 Aug 2015 00:17:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S0HMje026570; Fri, 28 Aug 2015 00:17:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508280017.t7S0HMje026570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 28 Aug 2015 00:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287233 - head/sys/amd64/amd64 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.20 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, 28 Aug 2015 00:17:22 -0000 Author: markj Date: Fri Aug 28 00:17:21 2015 New Revision: 287233 URL: https://svnweb.freebsd.org/changeset/base/287233 Log: Remove an unneeded instruction. MFC after: 1 week Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Fri Aug 28 00:12:59 2015 (r287232) +++ head/sys/amd64/amd64/exception.S Fri Aug 28 00:17:21 2015 (r287233) @@ -225,7 +225,6 @@ alltraps_pushregs_no_rdi: movq $calltrap,dtrace_invop_calltrap_addr(%rip) /* Jump to the code hooked in by DTrace. */ - movq dtrace_invop_jump_addr,%rax jmpq *dtrace_invop_jump_addr #endif .globl calltrap From owner-svn-src-head@freebsd.org Fri Aug 28 00:38:19 2015 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 65C3B9C305A; Fri, 28 Aug 2015 00:38:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 534428B9; Fri, 28 Aug 2015 00:38:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S0cJmI034797; Fri, 28 Aug 2015 00:38:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S0cJ7G034796; Fri, 28 Aug 2015 00:38:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508280038.t7S0cJ7G034796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 28 Aug 2015 00:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287234 - head/cddl/contrib/opensolaris/tools/ctf/cvt 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.20 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, 28 Aug 2015 00:38:19 -0000 Author: markj Date: Fri Aug 28 00:38:18 2015 New Revision: 287234 URL: https://svnweb.freebsd.org/changeset/base/287234 Log: Re-apply r274569. It was reverted in r276848 since that appeared to fix some ctfmerge crashes that started to occur on i386 weeks after r274569 was committed. Some later investigation indicated that the crashes were caused by malformed CTF info that led to a stack overflow. The issue with CTF info in i386 kernels seems to have been resolved by r261246, which updated libdwarf and libelf. r274569 fixes a bug which caused duplicate types to appear in the kernel's CTF info. This duplication generally does not cause problems when using DTrace, but makes it easier to hit the limit of 2^15 - 1 distinct type definitions in a CTF container. MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Fri Aug 28 00:17:21 2015 (r287233) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Fri Aug 28 00:38:18 2015 (r287234) @@ -349,7 +349,7 @@ equiv_node(tdesc_t *ctdp, tdesc_t *mtdp, int (*equiv)(tdesc_t *, tdesc_t *, equiv_data_t *); int mapping; - if (ctdp->t_emark > ed->ed_clear_mark || + if (ctdp->t_emark > ed->ed_clear_mark && mtdp->t_emark > ed->ed_clear_mark) return (ctdp->t_emark == mtdp->t_emark); From owner-svn-src-head@freebsd.org Fri Aug 28 00:44:18 2015 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 99C3A9C328C; Fri, 28 Aug 2015 00:44:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7DB3BC90; Fri, 28 Aug 2015 00:44:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S0iIlG038700; Fri, 28 Aug 2015 00:44:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S0iIBY038698; Fri, 28 Aug 2015 00:44:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508280044.t7S0iIBY038698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 28 Aug 2015 00:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287235 - 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.20 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, 28 Aug 2015 00:44:18 -0000 Author: markj Date: Fri Aug 28 00:44:17 2015 New Revision: 287235 URL: https://svnweb.freebsd.org/changeset/base/287235 Log: Remove weighted page handling from vm_page_advise(). This was added in r51337 as part of the implementation of madvise(MADV_DONTNEED). Its objective was to ensure that the page daemon would eventually reclaim other unreferenced pages (i.e., unreferenced pages not touched by madvise()) from the active queue. Now that the pagedaemon performs steady scanning of the active page queue, this weighted handling is unnecessary. Instead, always "cache" clean pages by moving them to the head of the inactive page queue. This simplifies the implementation of vm_page_advise() and eliminates the fragmentation that resulted from the distribution of pages among multiple queues. Suggested by: alc Reviewed by: alc Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3401 Modified: head/sys/sys/pcpu.h head/sys/vm/vm_page.c Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Fri Aug 28 00:38:18 2015 (r287234) +++ head/sys/sys/pcpu.h Fri Aug 28 00:44:17 2015 (r287235) @@ -162,7 +162,7 @@ struct pcpu { long pc_cp_time[CPUSTATES]; /* statclock ticks */ struct device *pc_device; void *pc_netisr; /* netisr SWI cookie */ - int pc_dnweight; /* vm_page_dontneed() */ + int pc_unused1; /* unused field */ int pc_domain; /* Memory domain. */ struct rm_queue pc_rm_queue; /* rmlock list of trackers */ uintptr_t pc_dynamic; /* Dynamic per-cpu data area */ Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Aug 28 00:38:18 2015 (r287234) +++ head/sys/vm/vm_page.c Fri Aug 28 00:44:17 2015 (r287235) @@ -2542,19 +2542,26 @@ _vm_page_deactivate(vm_page_t m, int ath struct vm_pagequeue *pq; int queue; - vm_page_lock_assert(m, MA_OWNED); + vm_page_assert_locked(m); /* - * Ignore if already inactive. + * Ignore if the page is already inactive, unless it is unlikely to be + * reactivated. */ - if ((queue = m->queue) == PQ_INACTIVE) + if ((queue = m->queue) == PQ_INACTIVE && !athead) return; if (m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0) { - if (queue != PQ_NONE) - vm_page_dequeue(m); - m->flags &= ~PG_WINATCFLS; pq = &vm_phys_domain(m)->vmd_pagequeues[PQ_INACTIVE]; - vm_pagequeue_lock(pq); + /* Avoid multiple acquisitions of the inactive queue lock. */ + if (queue == PQ_INACTIVE) { + vm_pagequeue_lock(pq); + vm_page_dequeue_locked(m); + } else { + if (queue != PQ_NONE) + vm_page_dequeue(m); + m->flags &= ~PG_WINATCFLS; + vm_pagequeue_lock(pq); + } m->queue = PQ_INACTIVE; if (athead) TAILQ_INSERT_HEAD(&pq->pq_pl, m, plinks.q); @@ -2729,34 +2736,18 @@ vm_page_cache(vm_page_t m) /* * vm_page_advise * - * Cache, deactivate, or do nothing as appropriate. This routine - * is used by madvise(). - * - * Generally speaking we want to move the page into the cache so - * it gets reused quickly. However, this can result in a silly syndrome - * due to the page recycling too quickly. Small objects will not be - * fully cached. On the other hand, if we move the page to the inactive - * queue we wind up with a problem whereby very large objects - * unnecessarily blow away our inactive and cache queues. - * - * The solution is to move the pages based on a fixed weighting. We - * either leave them alone, deactivate them, or move them to the cache, - * where moving them to the cache has the highest weighting. - * By forcing some pages into other queues we eventually force the - * system to balance the queues, potentially recovering other unrelated - * space from active. The idea is to not force this to happen too - * often. + * Deactivate or do nothing, as appropriate. This routine is used + * by madvise() and vop_stdadvise(). * * The object and page must be locked. */ void vm_page_advise(vm_page_t m, int advice) { - int dnw, head; vm_page_assert_locked(m); VM_OBJECT_ASSERT_WLOCKED(m->object); - if (advice == MADV_FREE) { + if (advice == MADV_FREE) /* * Mark the page clean. This will allow the page to be freed * up by the system. However, such pages are often reused @@ -2767,24 +2758,12 @@ vm_page_advise(vm_page_t m, int advice) * nor do we try to put it in the cache (which would cause a * page fault on reuse). * - * But we do make the page is freeable as we can without + * But we do make the page as freeable as we can without * actually taking the step of unmapping it. */ m->dirty = 0; - m->act_count = 0; - } else if (advice != MADV_DONTNEED) + else if (advice != MADV_DONTNEED) return; - dnw = PCPU_GET(dnweight); - PCPU_INC(dnweight); - - /* - * Occasionally leave the page alone. - */ - if ((dnw & 0x01F0) == 0 || m->queue == PQ_INACTIVE) { - if (m->act_count >= ACT_INIT) - --m->act_count; - return; - } /* * Clear any references to the page. Otherwise, the page daemon will @@ -2795,20 +2774,12 @@ vm_page_advise(vm_page_t m, int advice) if (advice != MADV_FREE && m->dirty == 0 && pmap_is_modified(m)) vm_page_dirty(m); - if (m->dirty || (dnw & 0x0070) == 0) { - /* - * Deactivate the page 3 times out of 32. - */ - head = 0; - } else { - /* - * Cache the page 28 times out of every 32. Note that - * the page is deactivated instead of cached, but placed - * at the head of the queue instead of the tail. - */ - head = 1; - } - _vm_page_deactivate(m, head); + /* + * Place clean pages at 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. + */ + _vm_page_deactivate(m, m->dirty == 0); } /* From owner-svn-src-head@freebsd.org Fri Aug 28 00:44:59 2015 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 CBC129C330A; Fri, 28 Aug 2015 00:44:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 BCA48DEB; Fri, 28 Aug 2015 00:44:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S0ixCw038767; Fri, 28 Aug 2015 00:44:59 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S0ixfW038766; Fri, 28 Aug 2015 00:44:59 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508280044.t7S0ixfW038766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 28 Aug 2015 00:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287236 - head/bin/df 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.20 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, 28 Aug 2015 00:44:59 -0000 Author: delphij Date: Fri Aug 28 00:44:58 2015 New Revision: 287236 URL: https://svnweb.freebsd.org/changeset/base/287236 Log: Use exit() instead of return in main(). MFC after: 2 weeks Modified: head/bin/df/df.c Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Fri Aug 28 00:44:17 2015 (r287235) +++ head/bin/df/df.c Fri Aug 28 00:44:58 2015 (r287236) @@ -311,7 +311,7 @@ main(int argc, char *argv[]) xo_close_container("storage-system-information"); xo_finish(); - return (rv); + exit(rv); } static char * From owner-svn-src-head@freebsd.org Fri Aug 28 00:49:31 2015 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 966839C34B6; Fri, 28 Aug 2015 00:49:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 87774C9; Fri, 28 Aug 2015 00:49:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S0nVco039068; Fri, 28 Aug 2015 00:49:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S0nV2U039067; Fri, 28 Aug 2015 00:49:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508280049.t7S0nV2U039067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 28 Aug 2015 00:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287237 - head/bin/rm 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.20 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, 28 Aug 2015 00:49:31 -0000 Author: delphij Date: Fri Aug 28 00:49:30 2015 New Revision: 287237 URL: https://svnweb.freebsd.org/changeset/base/287237 Log: Respect locale settings. MFC after: 2 weeks Modified: head/bin/rm/rm.c Modified: head/bin/rm/rm.c ============================================================================== --- head/bin/rm/rm.c Fri Aug 28 00:44:58 2015 (r287236) +++ head/bin/rm/rm.c Fri Aug 28 00:49:30 2015 (r287237) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -86,6 +87,8 @@ main(int argc, char *argv[]) int ch; char *p; + (void)setlocale(LC_ALL, ""); + /* * Test for the special case where the utility is called as * "unlink", for which the functionality provided is greatly From owner-svn-src-head@freebsd.org Fri Aug 28 01:32:43 2015 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 038939C45CA; Fri, 28 Aug 2015 01:32:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E87D282E; Fri, 28 Aug 2015 01:32:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S1Wg8j059052; Fri, 28 Aug 2015 01:32:42 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S1Wg7n059051; Fri, 28 Aug 2015 01:32:42 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201508280132.t7S1Wg7n059051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 28 Aug 2015 01:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287238 - head/sys/dev/msk 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.20 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, 28 Aug 2015 01:32:43 -0000 Author: yongari Date: Fri Aug 28 01:32:42 2015 New Revision: 287238 URL: https://svnweb.freebsd.org/changeset/base/287238 Log: Set DMA alignment constraint of status, TX and RX LEs(List Elements in Marvell terms) to 32768. 32768 looks overkill but it will ensure correct DMAed update. This change addresses occasional watchdog timeouts reported on 10.2-RELEASE. Tested by: Johann Hugo MFC after: 2 weeks Modified: head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Fri Aug 28 00:49:30 2015 (r287237) +++ head/sys/dev/msk/if_mskreg.h Fri Aug 28 01:32:42 2015 (r287238) @@ -2175,13 +2175,8 @@ #define MSK_ADDR_LO(x) ((uint64_t) (x) & 0xffffffffUL) #define MSK_ADDR_HI(x) ((uint64_t) (x) >> 32) -/* - * At first I guessed 8 bytes, the size of a single descriptor, would be - * required alignment constraints. But, it seems that Yukon II have 4096 - * bytes boundary alignment constraints. - */ -#define MSK_RING_ALIGN 4096 -#define MSK_STAT_ALIGN 4096 +#define MSK_RING_ALIGN 32768 +#define MSK_STAT_ALIGN 32768 /* Rx descriptor data structure */ struct msk_rx_desc { From owner-svn-src-head@freebsd.org Fri Aug 28 02:29:32 2015 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 0263A9C3923; Fri, 28 Aug 2015 02:29:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E7A611187; Fri, 28 Aug 2015 02:29:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S2TVYb079587; Fri, 28 Aug 2015 02:29:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S2TVkj079586; Fri, 28 Aug 2015 02:29:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508280229.t7S2TVkj079586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2015 02:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287239 - head/sys/dev/ow 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.20 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, 28 Aug 2015 02:29:32 -0000 Author: imp Date: Fri Aug 28 02:29:31 2015 New Revision: 287239 URL: https://svnweb.freebsd.org/changeset/base/287239 Log: Simply to appease gcc's warnings. Modified: head/sys/dev/ow/ow.c Modified: head/sys/dev/ow/ow.c ============================================================================== --- head/sys/dev/ow/ow.c Fri Aug 28 01:32:42 2015 (r287238) +++ head/sys/dev/ow/ow.c Fri Aug 28 02:29:31 2015 (r287239) @@ -491,7 +491,7 @@ ow_child_location_str(device_t dev, devi size_t buflen) { - snprintf(buf, buflen, ""); + *buf = '\0'; return (0); } From owner-svn-src-head@freebsd.org Fri Aug 28 03:03:11 2015 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 E97D39C45B4; Fri, 28 Aug 2015 03:03:10 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D97742DE; Fri, 28 Aug 2015 03:03:10 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S33AgB096354; Fri, 28 Aug 2015 03:03:10 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S33AeW096349; Fri, 28 Aug 2015 03:03:10 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508280303.t7S33AeW096349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 28 Aug 2015 03:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287240 - in head/sys/powerpc: booke 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.20 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, 28 Aug 2015 03:03:11 -0000 Author: jhibbits Date: Fri Aug 28 03:03:09 2015 New Revision: 287240 URL: https://svnweb.freebsd.org/changeset/base/287240 Log: Extend pmap to support e500mc and e5500. As part of this, clean up tlb1_init(), since bootinfo is always NULL here just eliminate the loop altogether. Also, fix a bug in mmu_booke_mapdev_attr() where it's possible to map a larger immediately following a smaller page, causing the mappings to overlap. Instead, break up the new mapping into smaller chunks. The downside to this is that it uses more precious TLB1 entries, which, on smaller chips (e500v2) it could cause problems with TLB1 being out of space (e500v2 only has 16 TLB1 entries). Obtained from: Semihalf (partial) Sponsored by: Alex Perez/Inertial Computing Modified: head/sys/powerpc/booke/pmap.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/tlb.h Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri Aug 28 02:29:31 2015 (r287239) +++ head/sys/powerpc/booke/pmap.c Fri Aug 28 03:03:09 2015 (r287240) @@ -178,15 +178,17 @@ static volatile pmap_t tidbusy[MAXCPU][T uint32_t tlb0_entries; uint32_t tlb0_ways; uint32_t tlb0_entries_per_way; +uint32_t tlb1_entries; #define TLB0_ENTRIES (tlb0_entries) #define TLB0_WAYS (tlb0_ways) #define TLB0_ENTRIES_PER_WAY (tlb0_entries_per_way) -#define TLB1_ENTRIES 16 +#define TLB1_ENTRIES (tlb1_entries) +#define TLB1_MAXENTRIES 64 /* In-ram copy of the TLB1 */ -static tlb_entry_t tlb1[TLB1_ENTRIES]; +static tlb_entry_t tlb1[TLB1_MAXENTRIES]; /* Next free entry in the TLB1 */ static unsigned int tlb1_idx; @@ -495,6 +497,16 @@ tlb0_get_tlbconf(void) tlb0_entries_per_way = tlb0_entries / tlb0_ways; } +/* Return number of entries in TLB1. */ +static __inline void +tlb1_get_tlbconf(void) +{ + uint32_t tlb1_cfg; + + tlb1_cfg = mfspr(SPR_TLB1CFG); + tlb1_entries = tlb1_cfg & TLBCFG_NENTRY_MASK; +} + /* Initialize pool of kva ptbl buffers. */ static void ptbl_init(void) @@ -1224,7 +1236,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf("fill in phys_avail:\n"); for (i = 0, j = 0; i < availmem_regions_sz; i++, j += 2) { - debugf(" region: 0x%08x - 0x%08x (0x%08x)\n", + debugf(" region: 0x%jx - 0x%jx (0x%jx)\n", availmem_regions[i].mr_start, availmem_regions[i].mr_start + availmem_regions[i].mr_size, @@ -2803,6 +2815,11 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd do { sz = 1 << (ilog2(size) & ~1); + if (va % sz != 0) { + do { + sz >>= 1; + } while (va % sz != 0); + } if (bootverbose) printf("Wiring VA=%x to PA=%llx (size=%x), " "using TLB1[%d]\n", va, pa, sz, tlb1_idx); @@ -3042,8 +3059,21 @@ tlb1_write_entry(unsigned int idx) __asm __volatile("isync"); mtspr(SPR_MAS3, tlb1[idx].mas3); __asm __volatile("isync"); - mtspr(SPR_MAS7, tlb1[idx].mas7); - __asm __volatile("isync; tlbwe; isync; msync"); + switch ((mfpvr() >> 16) & 0xFFFF) { + case FSL_E500mc: + case FSL_E5500: + mtspr(SPR_MAS8, 0); + __asm __volatile("isync"); + /* FALLTHROUGH */ + case FSL_E500v2: + mtspr(SPR_MAS7, tlb1[idx].mas7); + __asm __volatile("isync"); + break; + default: + break; + } + + __asm __volatile("tlbwe; isync; msync"); //debugf("tlb1_write_entry: e\n"); } @@ -3210,42 +3240,34 @@ tlb1_init() { uint32_t mas0, mas1, mas2, mas3, mas7; uint32_t tsz; - u_int i; + int i; - if (bootinfo != NULL && bootinfo[0] != 1) { - tlb1_idx = *((uint16_t *)(bootinfo + 8)); - } else - tlb1_idx = 1; + tlb1_idx = 1; - /* The first entry/entries are used to map the kernel. */ - for (i = 0; i < tlb1_idx; i++) { - mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(i); - mtspr(SPR_MAS0, mas0); - __asm __volatile("isync; tlbre"); - - mas1 = mfspr(SPR_MAS1); - if ((mas1 & MAS1_VALID) == 0) - continue; + tlb1_get_tlbconf(); - mas2 = mfspr(SPR_MAS2); - mas3 = mfspr(SPR_MAS3); - mas7 = mfspr(SPR_MAS7); + mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(0); + mtspr(SPR_MAS0, mas0); + __asm __volatile("isync; tlbre"); - tlb1[i].mas1 = mas1; - tlb1[i].mas2 = mfspr(SPR_MAS2); - tlb1[i].mas3 = mas3; - tlb1[i].mas7 = mas7; - tlb1[i].virt = mas2 & MAS2_EPN_MASK; - tlb1[i].phys = ((vm_paddr_t)(mas7 & MAS7_RPN) << 32) | - (mas3 & MAS3_RPN); - - if (i == 0) - kernload = tlb1[i].phys; - - tsz = (mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; - tlb1[i].size = (tsz > 0) ? tsize2size(tsz) : 0; - kernsize += tlb1[i].size; - } + mas1 = mfspr(SPR_MAS1); + mas2 = mfspr(SPR_MAS2); + mas3 = mfspr(SPR_MAS3); + mas7 = mfspr(SPR_MAS7); + + tlb1[0].mas1 = mas1; + tlb1[0].mas2 = mfspr(SPR_MAS2); + tlb1[0].mas3 = mas3; + tlb1[0].mas7 = mas7; + tlb1[0].virt = mas2 & MAS2_EPN_MASK; + tlb1[0].phys = ((vm_paddr_t)(mas7 & MAS7_RPN) << 32) | + (mas3 & MAS3_RPN); + + kernload = tlb1[0].phys; + + tsz = (mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; + tlb1[0].size = (tsz > 0) ? tsize2size(tsz) : 0; + kernsize += tlb1[0].size; #ifdef SMP bp_ntlb1s = tlb1_idx; Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Fri Aug 28 02:29:31 2015 (r287239) +++ head/sys/powerpc/booke/trap_subr.S Fri Aug 28 03:03:09 2015 (r287240) @@ -605,6 +605,9 @@ search_failed: mtspr SPR_MAS3, %r23 isync + bl zero_mas7 + bl zero_mas8 + tlbwe msync isync @@ -714,6 +717,10 @@ tlb_fill_entry: mtspr SPR_MAS7, %r23 isync + mflr %r21 + bl zero_mas8 + mtlr %r21 + tlbwe isync msync Modified: head/sys/powerpc/include/tlb.h ============================================================================== --- head/sys/powerpc/include/tlb.h Fri Aug 28 02:29:31 2015 (r287239) +++ head/sys/powerpc/include/tlb.h Fri Aug 28 03:03:09 2015 (r287240) @@ -34,7 +34,7 @@ /* PowerPC E500 MAS registers */ #define MAS0_TLBSEL(x) ((x << 28) & 0x10000000) -#define MAS0_ESEL(x) ((x << 16) & 0x000F0000) +#define MAS0_ESEL(x) ((x << 16) & 0x003F0000) #define MAS0_TLBSEL1 0x10000000 #define MAS0_TLBSEL0 0x00000000 From owner-svn-src-head@freebsd.org Fri Aug 28 04:32:44 2015 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 204E99C23B5; Fri, 28 Aug 2015 04:32:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 0F568B5; Fri, 28 Aug 2015 04:32:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S4Wh7q034106; Fri, 28 Aug 2015 04:32:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S4WhBm034105; Fri, 28 Aug 2015 04:32:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508280432.t7S4WhBm034105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2015 04:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287241 - head/gnu/usr.bin/binutils 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.20 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, 28 Aug 2015 04:32:44 -0000 Author: imp Date: Fri Aug 28 04:32:43 2015 New Revision: 287241 URL: https://svnweb.freebsd.org/changeset/base/287241 Log: Add another .WAIT since sometimes we lose the race. Modified: head/gnu/usr.bin/binutils/Makefile Modified: head/gnu/usr.bin/binutils/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/Makefile Fri Aug 28 03:03:09 2015 (r287240) +++ head/gnu/usr.bin/binutils/Makefile Fri Aug 28 04:32:43 2015 (r287241) @@ -5,6 +5,7 @@ SUBDIR= doc\ libiberty \ libbfd \ + .WAIT \ libopcodes \ libbinutils \ .WAIT \ From owner-svn-src-head@freebsd.org Fri Aug 28 04:43:12 2015 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 ED7289C2729; Fri, 28 Aug 2015 04:43:12 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id E1EE58BB; Fri, 28 Aug 2015 04:43:12 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id E1411171B; Fri, 28 Aug 2015 04:43:12 +0000 (UTC) Date: Fri, 28 Aug 2015 04:43:12 +0000 From: Alexey Dokuchaev To: Xin LI Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287236 - head/bin/df Message-ID: <20150828044312.GA88538@FreeBSD.org> References: <201508280044.t7S0ixfW038766@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201508280044.t7S0ixfW038766@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 04:43:13 -0000 On Fri, Aug 28, 2015 at 12:44:59AM +0000, Xin LI wrote: > New Revision: 287236 > URL: https://svnweb.freebsd.org/changeset/base/287236 > > Log: > Use exit() instead of return in main(). Because?.. ./danfe From owner-svn-src-head@freebsd.org Fri Aug 28 04:45:05 2015 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 60E869C27E9; Fri, 28 Aug 2015 04:45:05 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 55120A14; Fri, 28 Aug 2015 04:45:05 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 54796185C; Fri, 28 Aug 2015 04:45:05 +0000 (UTC) Date: Fri, 28 Aug 2015 04:45:05 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287241 - head/gnu/usr.bin/binutils Message-ID: <20150828044505.GB88538@FreeBSD.org> References: <201508280432.t7S4WhBm034105@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201508280432.t7S4WhBm034105@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 04:45:05 -0000 On Fri, Aug 28, 2015 at 04:32:43AM +0000, Warner Losh wrote: > New Revision: 287241 > URL: https://svnweb.freebsd.org/changeset/base/287241 > > Log: > Add another .WAIT since sometimes we lose the race. Is there a way to actually correctly specify dependencies between targets instead? ./danfe From owner-svn-src-head@freebsd.org Fri Aug 28 04:48:07 2015 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 3C2139C2885 for ; Fri, 28 Aug 2015 04:48:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-f42.google.com (mail-qg0-f42.google.com [209.85.192.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 F34E2BCC for ; Fri, 28 Aug 2015 04:48:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qgeb6 with SMTP id b6so23515008qge.3 for ; Thu, 27 Aug 2015 21:48:00 -0700 (PDT) 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:date :message-id:subject:from:to:cc:content-type; bh=yvl9MIO0YxrW6OCk9JNQNo75q1CmsYVxTD+RHvbCwYg=; b=BfF4eew9DrV4aoKMZgZWPQnwJJ5dlQK8Lhn6iUV3gFxJRepzBD/EDovhEJ/bMCbVMQ lVVzMh7Re16Ta3xGWksiBJjIa7emSOgkfne/DZI9ybhLMGOn5MkPC4F1NMjBzn7dE4LE kN3FwFrTxvblYAoXPuzemsBbhvP3fb/fBAJC/Dchxe6wmiQP3eHZHVhTHjPd0FmkuTP6 oMHCow8qppxyZhOPZlmKAUoxG0xOXszATHl1G/R282EPrWZET+KD1unZI+wfc2hcbgNr 0bZ7rdzEls922H3wwCfPnXFBNUi8aj+cSlHci1f+AeJvAXsk8R8KxpZ9AQTYkoW3RrqF GQRw== X-Gm-Message-State: ALoCoQl/+IgsAtv9QhXm9ioUdxXnwtdqjfrciq8OGgca6rwp1lMmC0cTj1ui2HfPvwI1MgEoh61E MIME-Version: 1.0 X-Received: by 10.140.145.83 with SMTP id 80mr13280775qhr.74.1440737280362; Thu, 27 Aug 2015 21:48:00 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.140.91.52 with HTTP; Thu, 27 Aug 2015 21:48:00 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20150828044505.GB88538@FreeBSD.org> References: <201508280432.t7S4WhBm034105@repo.freebsd.org> <20150828044505.GB88538@FreeBSD.org> Date: Thu, 27 Aug 2015 22:48:00 -0600 X-Google-Sender-Auth: _0aWoOlDq5h1W2lDfV3dK42BD-k Message-ID: Subject: Re: svn commit: r287241 - head/gnu/usr.bin/binutils From: Warner Losh To: Alexey Dokuchaev Cc: Warner Losh , src-committers , "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.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 04:48:07 -0000 Yes. This fix was easy. That fix is a little harder, so I pushed this inquickly while I do the harder fix after a good night's sleep (it isn't that much harder, but it's been a long day). Warner On Thu, Aug 27, 2015 at 10:45 PM, Alexey Dokuchaev wrote: > On Fri, Aug 28, 2015 at 04:32:43AM +0000, Warner Losh wrote: > > New Revision: 287241 > > URL: https://svnweb.freebsd.org/changeset/base/287241 > > > > Log: > > Add another .WAIT since sometimes we lose the race. > > Is there a way to actually correctly specify dependencies between targets > instead? > > ./danfe > From owner-svn-src-head@freebsd.org Fri Aug 28 04:59:28 2015 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 E58499C2C04; Fri, 28 Aug 2015 04:59:28 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D6EB7F6A; Fri, 28 Aug 2015 04:59:28 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id D609E1B64; Fri, 28 Aug 2015 04:59:28 +0000 (UTC) Date: Fri, 28 Aug 2015 04:59:28 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r287241 - head/gnu/usr.bin/binutils Message-ID: <20150828045928.GA95533@FreeBSD.org> References: <201508280432.t7S4WhBm034105@repo.freebsd.org> <20150828044505.GB88538@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 04:59:29 -0000 On Thu, Aug 27, 2015 at 10:48:00PM -0600, Warner Losh wrote: > Yes. This fix was easy. That fix is a little harder, so I pushed this > inquickly while I do the harder fix after a good night's sleep (it isn't > that much harder, but it's been a long day). Awesome to hear that, thanks Warner and have a good sleep. :) ./danfe From owner-svn-src-head@freebsd.org Fri Aug 28 05:00:22 2015 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 9321E9C2C60 for ; Fri, 28 Aug 2015 05:00:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk0-f169.google.com (mail-qk0-f169.google.com [209.85.220.169]) (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 522571106 for ; Fri, 28 Aug 2015 05:00:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qkfh127 with SMTP id h127so22913425qkf.1 for ; Thu, 27 Aug 2015 22:00:21 -0700 (PDT) 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:date :message-id:subject:from:to:cc:content-type; bh=o9MkeYmtM7XdrW8x2Xy3TezqGIsO6QDLlpdmJP1chMQ=; b=NA1A/4/5zMUDg2zFnBKN023MqhpVzN57AsmCyS3M+xutQMl4XtQCGsMb8UymDooX3C eQZH40uom6WSUaoJs2uUTz1tqXUaC0qBTvUxGX0fZ4UBiKRjhanaIp9r4bsPLrsgaT5j zfJhGhjVzQnq5yWqA9Um8KuZWnRiEQgLkRAOypJWYtm3ZlhQmk6zz2GL9JOXCFfugdaT AELmur4gXN5LjnpYINaKOjABp0/QYwxjGB/DGSeisJHjzJ401jd82zpSh8kBgxs8+HM5 kXIbeSwKMBsbEEv2OKcadPIGRnmgalepbLlaIkinL6wticW1LbIytU9826lwfnoQ78ZI W9hQ== X-Gm-Message-State: ALoCoQl4OevjFOajepIxQlakQqrMCLOGlLvV5T5rwJxK523gzIMRnZUEbL5nuJLk0hvEh3OiWBP3 MIME-Version: 1.0 X-Received: by 10.55.201.198 with SMTP id m67mr12715832qkl.35.1440738020871; Thu, 27 Aug 2015 22:00:20 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.140.91.52 with HTTP; Thu, 27 Aug 2015 22:00:20 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20150828045928.GA95533@FreeBSD.org> References: <201508280432.t7S4WhBm034105@repo.freebsd.org> <20150828044505.GB88538@FreeBSD.org> <20150828045928.GA95533@FreeBSD.org> Date: Thu, 27 Aug 2015 23:00:20 -0600 X-Google-Sender-Auth: FneEW-MyzmkSAlKkLpK3ByG1J1U Message-ID: Subject: Re: svn commit: r287241 - head/gnu/usr.bin/binutils From: Warner Losh To: Alexey Dokuchaev Cc: Warner Losh , src-committers , "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.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 05:00:22 -0000 I have something I'm testing now, but it's tricky enough that I want to look at it again in the morning... Warner On Thu, Aug 27, 2015 at 10:59 PM, Alexey Dokuchaev wrote: > On Thu, Aug 27, 2015 at 10:48:00PM -0600, Warner Losh wrote: > > Yes. This fix was easy. That fix is a little harder, so I pushed this > > inquickly while I do the harder fix after a good night's sleep (it isn't > > that much harder, but it's been a long day). > > Awesome to hear that, thanks Warner and have a good sleep. :) > > ./danfe > From owner-svn-src-head@freebsd.org Fri Aug 28 05:20:32 2015 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 5F49D9C34A3; Fri, 28 Aug 2015 05:20:32 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4FCFA1B37; Fri, 28 Aug 2015 05:20:32 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S5KWBv056542; Fri, 28 Aug 2015 05:20:32 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S5KWPP056541; Fri, 28 Aug 2015 05:20:32 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508280520.t7S5KWPP056541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 28 Aug 2015 05:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287242 - head/sys/powerpc/powerpc 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.20 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, 28 Aug 2015 05:20:32 -0000 Author: jhibbits Date: Fri Aug 28 05:20:31 2015 New Revision: 287242 URL: https://svnweb.freebsd.org/changeset/base/287242 Log: Fix text alignment. mcsr was indented one too many spaces. Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Fri Aug 28 04:32:43 2015 (r287241) +++ head/sys/powerpc/powerpc/trap.c Fri Aug 28 05:20:31 2015 (r287242) @@ -429,7 +429,7 @@ printtrap(u_int vector, struct trapframe printf(" msssr0 = 0x%lx\n", (u_long)mfspr(SPR_MSSSR0)); #elif defined(BOOKE) - printf(" mcsr = 0x%lx\n", (u_long)mfspr(SPR_MCSR)); + printf(" mcsr = 0x%lx\n", (u_long)mfspr(SPR_MCSR)); #endif break; } From owner-svn-src-head@freebsd.org Fri Aug 28 05:25:29 2015 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 76E5A9C362D; Fri, 28 Aug 2015 05:25:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::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 343481EB3; Fri, 28 Aug 2015 05:25:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qkbm65 with SMTP id m65so22929622qkb.2; Thu, 27 Aug 2015 22:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=eIt4PiVUzhUs1wGLSQpcYJVeQMRJA0K07UBeOiC9eZs=; b=Oc01si2EXuJDwUZkgSK7j2baFxPQH37RVcdJf1vu36NVMSeEUt0uRMVQ2ANF7VC69N CS7suS85Tuj3pI3ZIgwIWjbBGrg11/M5qIZ548TvrvNy5ONcFVqveByvyaUeNdUCEFbm uY8aHA3URgPvSCW+95SA6b55rSWkC+bx0ZmEY5NQVZEbigNrRoncHhwGoVHb/sMvohqD wYdZJ4ythtW0V1UZs9RZ8yGs8kHB4gsUtgwQOb2cEOj3DSXG+1yovU7Vd/nVq68Ltu2/ o1MeKtVGZHrLXnghw9W4n5TFKuAWwH419V7CqkqTAh9Zya02oVSjM+NISYcX+SdknwoI J39w== MIME-Version: 1.0 X-Received: by 10.55.53.4 with SMTP id c4mr12414612qka.1.1440739528248; Thu, 27 Aug 2015 22:25:28 -0700 (PDT) Received: by 10.140.94.33 with HTTP; Thu, 27 Aug 2015 22:25:28 -0700 (PDT) In-Reply-To: <20150828044312.GA88538@FreeBSD.org> References: <201508280044.t7S0ixfW038766@repo.freebsd.org> <20150828044312.GA88538@FreeBSD.org> Date: Thu, 27 Aug 2015 22:25:28 -0700 Message-ID: Subject: Re: svn commit: r287236 - head/bin/df From: NGie Cooper To: Alexey Dokuchaev Cc: Xin LI , "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.20 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, 28 Aug 2015 05:25:29 -0000 On Thu, Aug 27, 2015 at 9:43 PM, Alexey Dokuchaev wrote: > On Fri, Aug 28, 2015 at 12:44:59AM +0000, Xin LI wrote: >> New Revision: 287236 >> URL: https://svnweb.freebsd.org/changeset/base/287236 >> >> Log: >> Use exit() instead of return in main(). > > Because?.. Probably because of libxo... From owner-svn-src-head@freebsd.org Fri Aug 28 05:58:18 2015 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 546919C414D; Fri, 28 Aug 2015 05:58:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 38D7B178; Fri, 28 Aug 2015 05:58:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S5wIkF079248; Fri, 28 Aug 2015 05:58:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S5wH0t079239; Fri, 28 Aug 2015 05:58:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508280558.t7S5wH0t079239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 28 Aug 2015 05:58:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287245 - in head/sys: net netinet netinet6 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.20 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, 28 Aug 2015 05:58:18 -0000 Author: adrian Date: Fri Aug 28 05:58:16 2015 New Revision: 287245 URL: https://svnweb.freebsd.org/changeset/base/287245 Log: Replace the printf()s with optional rate limited debugging for RSS. Submitted by: Tiwei Bie Differential Revision: https://reviews.freebsd.org/D3471 Modified: head/sys/net/rss_config.c head/sys/net/rss_config.h head/sys/netinet/in_rss.c head/sys/netinet6/in6_rss.c Modified: head/sys/net/rss_config.c ============================================================================== --- head/sys/net/rss_config.c Fri Aug 28 05:29:52 2015 (r287244) +++ head/sys/net/rss_config.c Fri Aug 28 05:58:16 2015 (r287245) @@ -152,6 +152,15 @@ SYSCTL_INT(_net_inet_rss, OID_AUTO, base __DECONST(int *, &rss_basecpu), 0, "RSS base CPU"); /* + * Print verbose debugging messages. + * 0 - disable + * non-zero - enable + */ +int rss_debug = 0; +SYSCTL_INT(_net_inet_rss, OID_AUTO, debug, CTLFLAG_RWTUN, &rss_debug, 0, + "RSS debug level"); + +/* * RSS secret key, intended to prevent attacks on load-balancing. Its * effectiveness may be limited by algorithm choice and available entropy * during the boot. @@ -194,8 +203,8 @@ rss_init(__unused void *arg) break; default: - printf("%s: invalid RSS hashalgo %u, coercing to %u", - __func__, rss_hashalgo, RSS_HASH_TOEPLITZ); + RSS_DEBUG("invalid RSS hashalgo %u, coercing to %u\n", + rss_hashalgo, RSS_HASH_TOEPLITZ); rss_hashalgo = RSS_HASH_TOEPLITZ; } @@ -229,8 +238,8 @@ rss_init(__unused void *arg) * ones. */ if (rss_bits == 0 || rss_bits > RSS_MAXBITS) { - printf("%s: RSS bits %u not valid, coercing to %u", - __func__, rss_bits, RSS_MAXBITS); + RSS_DEBUG("RSS bits %u not valid, coercing to %u\n", + rss_bits, RSS_MAXBITS); rss_bits = RSS_MAXBITS; } @@ -241,9 +250,8 @@ rss_init(__unused void *arg) */ rss_buckets = (1 << rss_bits); if (rss_buckets < rss_ncpus) - printf("%s: WARNING: rss_buckets (%u) less than " - "rss_ncpus (%u)\n", __func__, rss_buckets, - rss_ncpus); + RSS_DEBUG("WARNING: rss_buckets (%u) less than " + "rss_ncpus (%u)\n", rss_buckets, rss_ncpus); rss_mask = rss_buckets - 1; } else { rss_bits = 0; Modified: head/sys/net/rss_config.h ============================================================================== --- head/sys/net/rss_config.h Fri Aug 28 05:29:52 2015 (r287244) +++ head/sys/net/rss_config.h Fri Aug 28 05:58:16 2015 (r287245) @@ -93,6 +93,21 @@ #define RSS_HASH_PKT_EGRESS 1 /* + * Rate limited debugging routines. + */ +#define RSS_DEBUG(format, ...) do { \ + if (rss_debug) { \ + static struct timeval lastfail; \ + static int curfail; \ + if (ppsratecheck(&lastfail, &curfail, 5)) \ + printf("RSS (%s:%u): " format, __func__, __LINE__,\ + ##__VA_ARGS__); \ + } \ +} while (0) + +extern int rss_debug; + +/* * Device driver interfaces to query RSS properties that must be programmed * into hardware. */ Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Fri Aug 28 05:29:52 2015 (r287244) +++ head/sys/netinet/in_rss.c Fri Aug 28 05:58:16 2015 (r287245) @@ -147,7 +147,7 @@ rss_proto_software_hash_v4(struct in_add } /* No configured available hashtypes! */ - printf("%s: no available hashtypes!\n", __func__); + RSS_DEBUG("no available hashtypes!\n"); return (-1); } @@ -183,7 +183,7 @@ rss_mbuf_software_hash_v4(const struct m * XXX For now this only handles hashing on incoming mbufs. */ if (dir != RSS_HASH_PKT_INGRESS) { - printf("%s: called on EGRESS packet!\n", __func__); + RSS_DEBUG("called on EGRESS packet!\n"); return (-1); } @@ -192,11 +192,11 @@ rss_mbuf_software_hash_v4(const struct m * to have an IPv4 header in it. */ if (m->m_pkthdr.len < (sizeof(struct ip))) { - printf("%s: short mbuf pkthdr\n", __func__); + RSS_DEBUG("short mbuf pkthdr\n"); return (-1); } if (m->m_len < (sizeof(struct ip))) { - printf("%s: short mbuf len\n", __func__); + RSS_DEBUG("short mbuf len\n"); return (-1); } @@ -280,7 +280,7 @@ rss_mbuf_software_hash_v4(const struct m (proto == IPPROTO_TCP) && (is_frag == 0)) { if (m->m_len < iphlen + sizeof(struct tcphdr)) { - printf("%s: short TCP frame?\n", __func__); + RSS_DEBUG("short TCP frame?\n"); return (-1); } th = (const struct tcphdr *)((c_caddr_t)ip + iphlen); @@ -295,7 +295,7 @@ rss_mbuf_software_hash_v4(const struct m (is_frag == 0)) { uh = (const struct udphdr *)((c_caddr_t)ip + iphlen); if (m->m_len < iphlen + sizeof(struct udphdr)) { - printf("%s: short UDP frame?\n", __func__); + RSS_DEBUG("short UDP frame?\n"); return (-1); } return rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst, @@ -313,7 +313,7 @@ rss_mbuf_software_hash_v4(const struct m hashval, hashtype); } else { - printf("%s: no available hashtypes!\n", __func__); + RSS_DEBUG("no available hashtypes!\n"); return (-1); } } Modified: head/sys/netinet6/in6_rss.c ============================================================================== --- head/sys/netinet6/in6_rss.c Fri Aug 28 05:29:52 2015 (r287244) +++ head/sys/netinet6/in6_rss.c Fri Aug 28 05:58:16 2015 (r287245) @@ -147,6 +147,6 @@ rss_proto_software_hash_v6(const struct } /* No configured available hashtypes! */ - printf("%s: no available hashtypes!\n", __func__); + RSS_DEBUG("no available hashtypes!\n"); return (-1); } From owner-svn-src-head@freebsd.org Fri Aug 28 06:04:58 2015 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 513AD9C43BE; Fri, 28 Aug 2015 06:04:58 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 3F1DF825; Fri, 28 Aug 2015 06:04:58 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 3E4801968; Fri, 28 Aug 2015 06:04:58 +0000 (UTC) Date: Fri, 28 Aug 2015 06:04:58 +0000 From: Alexey Dokuchaev To: NGie Cooper Cc: Xin LI , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r287236 - head/bin/df Message-ID: <20150828060458.GA20642@FreeBSD.org> References: <201508280044.t7S0ixfW038766@repo.freebsd.org> <20150828044312.GA88538@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 06:04:58 -0000 On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote: > On Thu, Aug 27, 2015 at 9:43 PM, Alexey Dokuchaev wrote: > > On Fri, Aug 28, 2015 at 12:44:59AM +0000, Xin LI wrote: > >> New Revision: 287236 > >> URL: https://svnweb.freebsd.org/changeset/base/287236 > >> > >> Log: > >> Use exit() instead of return in main(). > > > > Because?.. > > Probably because of libxo... I'm just wondering how hard is it to write sensible commit logs. :( ./danfe From owner-svn-src-head@freebsd.org Fri Aug 28 06:32:24 2015 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 1DE269C4ED6; Fri, 28 Aug 2015 06:32:24 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (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 094B18FB; Fri, 28 Aug 2015 06:32:23 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPSA id 7A870E8A4; Thu, 27 Aug 2015 23:32:22 -0700 (PDT) Date: Thu, 27 Aug 2015 23:32:22 -0700 From: hiren panchasara To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287235 - in head/sys: sys vm Message-ID: <20150828063222.GO82991@strugglingcoder.info> References: <201508280044.t7S0iIBY038698@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wxNrNKeE/ptr8Zbn" Content-Disposition: inline In-Reply-To: <201508280044.t7S0iIBY038698@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 06:32:24 -0000 --wxNrNKeE/ptr8Zbn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 08/28/15 at 12:44P, Mark Johnston wrote: > Author: markj > Date: Fri Aug 28 00:44:17 2015 > New Revision: 287235 > URL: https://svnweb.freebsd.org/changeset/base/287235 >=20 > Log: > Remove weighted page handling from vm_page_advise(). > =20 > This was added in r51337 as part of the implementation of > madvise(MADV_DONTNEED). Its objective was to ensure that the page daem= on > would eventually reclaim other unreferenced pages (i.e., unreferenced p= ages > not touched by madvise()) from the active queue. > =20 > Now that the pagedaemon performs steady scanning of the active page que= ue, > this weighted handling is unnecessary. Instead, always "cache" clean p= ages > by moving them to the head of the inactive page queue. This simplifies= the > implementation of vm_page_advise() and eliminates the fragmentation that > resulted from the distribution of pages among multiple queues. > =20 > Suggested by: alc > Reviewed by: alc > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D3401 Nice work! Can this be mfc'd to 10? Cheers, Hiren --wxNrNKeE/ptr8Zbn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJV4AB2XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lvvcH+gJhwJiuyC3FJeOtKGrlHM0s fcDgrxzq2VXMPSnzEeNr5VKIEDIPo56KG/2PhQEj0hg8Yy9vcDDvx4ZX5brZjFwv Xvg+LfO3PA2Ywb6FOGJwy1AH12RQ4GLAx1wrm545LLlI33c/5ipH+hSXrzx2vO4t 1lHzprODHD16c5ofsxx3x095hIB2Xu+ktqnH2VqaFTwQXJihJy2sOwPPquUXN7RP NNADLJEa/lKXLIiKF5yKoINbqVuzCN8H7U7e5jp+Oays8/KOsDjxea3E5s/5jI2T MnO8UbDp1f1gWUkBLV21pSdXEbe2gE2UCxI+S+g6YO6CxcBXodjag024IhjNZVg= =5ZOc -----END PGP SIGNATURE----- --wxNrNKeE/ptr8Zbn-- From owner-svn-src-head@freebsd.org Fri Aug 28 06:41:41 2015 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 C9C469C31E0; Fri, 28 Aug 2015 06:41:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 B7E1DC49; Fri, 28 Aug 2015 06:41:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S6ffrD006774; Fri, 28 Aug 2015 06:41:41 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S6ff0e006773; Fri, 28 Aug 2015 06:41:41 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508280641.t7S6ff0e006773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 28 Aug 2015 06:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287247 - head/lib/libgeom 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.20 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, 28 Aug 2015 06:41:41 -0000 Author: delphij Date: Fri Aug 28 06:41:40 2015 New Revision: 287247 URL: https://svnweb.freebsd.org/changeset/base/287247 Log: Plug memory leaks when running out of memory. Reported by: clang scan-build MFC after: 2 weeks Modified: head/lib/libgeom/geom_xml2tree.c Modified: head/lib/libgeom/geom_xml2tree.c ============================================================================== --- head/lib/libgeom/geom_xml2tree.c Fri Aug 28 06:07:30 2015 (r287246) +++ head/lib/libgeom/geom_xml2tree.c Fri Aug 28 06:41:40 2015 (r287247) @@ -275,15 +275,17 @@ EndElement(void *userData, const char *n XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); + free(p); return; } gc->lg_name = strdup(name); if (gc->lg_name == NULL) { - free(gc); mt->error = errno; XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); + free(gc); + free(p); return; } gc->lg_val = p; From owner-svn-src-head@freebsd.org Fri Aug 28 07:30:31 2015 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 BDBA99C4835; Fri, 28 Aug 2015 07:30:31 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by mx1.freebsd.org (Postfix) with ESMTP id 97FB16B7; Fri, 28 Aug 2015 07:30:30 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ppp118-210-47-210.lns20.adl2.internode.on.net (HELO midget.dons.net.au) ([118.210.47.210]) by ipmail07.adl2.internode.on.net with ESMTP; 28 Aug 2015 16:55:17 +0930 Received: from macbook-pro.dons.net.au (MacBook-Pro.dons.net.au [10.0.2.26]) (authenticated bits=0) by midget.dons.net.au (8.15.1/8.14.9) with ESMTPSA id t7S7Ow4T079038 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Aug 2015 16:55:03 +0930 (CST) (envelope-from darius@dons.net.au) Subject: Re: svn commit: r287236 - head/bin/df Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: text/plain; charset=us-ascii From: "O'Connor, Daniel" In-Reply-To: <20150828060458.GA20642@FreeBSD.org> Date: Fri, 28 Aug 2015 16:54:58 +0930 Cc: NGie Cooper , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI Content-Transfer-Encoding: quoted-printable Message-Id: References: <201508280044.t7S0ixfW038766@repo.freebsd.org> <20150828044312.GA88538@FreeBSD.org> <20150828060458.GA20642@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.2104) X-Spam-Score: -4.238 () ALL_TRUSTED,BAYES_00,RP_MATCHES_RCVD X-Scanned-By: MIMEDefang 2.75 on 10.0.2.1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 07:30:31 -0000 > On 28 Aug 2015, at 15:34, Alexey Dokuchaev wrote: > On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote: >> On Thu, Aug 27, 2015 at 9:43 PM, Alexey Dokuchaev = wrote: >>> On Fri, Aug 28, 2015 at 12:44:59AM +0000, Xin LI wrote: >>>> New Revision: 287236 >>>> URL: https://svnweb.freebsd.org/changeset/base/287236 >>>>=20 >>>> Log: >>>> Use exit() instead of return in main(). >>>=20 >>> Because?.. >>=20 >> Probably because of libxo... >=20 > I'm just wondering how hard is it to write sensible commit logs. :( To put it in a hopefully more helpful way.. Please write why your change is doing something, not what it is doing. Saying what it is doing is OK if it's really hairy, but 99% of the time = that isn't the case. Assuming this is a libxo thing the commit log should have been something = like.. "Use exit out of main otherwise libxo will not flush properly" (or something similar) Although it would be surprising if libxo required you to use exit().. -- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-head@freebsd.org Fri Aug 28 07:48:08 2015 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 D30C79C311C; Fri, 28 Aug 2015 07:48:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) (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 A106921A; Fri, 28 Aug 2015 07:48:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pacdd16 with SMTP id dd16so54286126pac.2; Fri, 28 Aug 2015 00:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=oIREIwSRd67/z63XXNSSnVvuzfGKQgeq3s5ihFGN47E=; b=XvEl4kF7FyaZSMWq3TQx5zHMkvWQOIUAZgN6l0tzeP6TpnNbSfxTX9KORQh2w5vFqC ubPHjRHNBxLpzYgaK5rN18vrx1jwuy8cPkLZ/mkUHbHdjPIb2SkO5oLb/ImTwbR86n/t AadC6LWkuzN+DvEF2AE5bFhe4kZVBbaPhlGma2+zBDbQWtBml5nF1Ios3F/3/S7agV/a v7m/0VSVzvYq/c/4pLxwz9zK8Vgs/3iXLTjHBmJj1rP19fp6xydyAuvD0L5nyBYeJFd0 hgGhj1h9RiSt5MoJAOAafb62PoCWAwyOjohOujng6psuo2PkjZq/jKO1KS/xdML7zGv8 mvyw== X-Received: by 10.66.248.72 with SMTP id yk8mr13072674pac.112.1440748088207; Fri, 28 Aug 2015 00:48:08 -0700 (PDT) Received: from [192.168.20.10] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id hv3sm4727448pbb.83.2015.08.28.00.48.07 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Aug 2015 00:48:07 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r287236 - head/bin/df From: Garrett Cooper X-Mailer: iPhone Mail (12H321) In-Reply-To: Date: Fri, 28 Aug 2015 00:48:07 -0700 Cc: Alexey Dokuchaev , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI Content-Transfer-Encoding: quoted-printable Message-Id: References: <201508280044.t7S0ixfW038766@repo.freebsd.org> <20150828044312.GA88538@FreeBSD.org> <20150828060458.GA20642@FreeBSD.org> To: "O'Connor, Daniel" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 07:48:08 -0000 > On Aug 28, 2015, at 00:24, O'Connor, Daniel wrote: >=20 >> On 28 Aug 2015, at 15:34, Alexey Dokuchaev wrote: >>> On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote: >>>> On Thu, Aug 27, 2015 at 9:43 PM, Alexey Dokuchaev w= rote: >>>>> On Fri, Aug 28, 2015 at 12:44:59AM +0000, Xin LI wrote: >>>>> New Revision: 287236 >>>>> URL: https://svnweb.freebsd.org/changeset/base/287236 >>>>>=20 >>>>> Log: >>>>> Use exit() instead of return in main(). >>>>=20 >>>> Because?.. >>>=20 >>> Probably because of libxo... >>=20 >> I'm just wondering how hard is it to write sensible commit logs. :( >=20 > To put it in a hopefully more helpful way.. > Please write why your change is doing something, not what it is doing. >=20 > Saying what it is doing is OK if it's really hairy, but 99% of the time th= at isn't the case. >=20 > Assuming this is a libxo thing the commit log should have been something l= ike.. > "Use exit out of main otherwise libxo will not flush properly" > (or something similar) >=20 > Although it would be surprising if libxo required you to use exit().. Libxo (iirc) doesn't install atexit handlers, which means that you need to u= se exit (or a reason facsimile) in order for it to flush its file streams. This is unintuitive though. I wish it did the right thing as part of initial= izing the streams..= From owner-svn-src-head@freebsd.org Fri Aug 28 08:36:48 2015 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 A80FB9C4916; Fri, 28 Aug 2015 08:36:48 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 87F2699C; Fri, 28 Aug 2015 08:36:48 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from Xins-MBP.home.us.delphij.net (c-71-202-112-39.hsd1.ca.comcast.net [71.202.112.39]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 72D6C1D336; Fri, 28 Aug 2015 01:36:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1440751007; x=1440765407; bh=uwu4U7Xp3YBLPEGvR+A4vLk23j1bDIJTQ14Sqp3xHSE=; h=Subject:To:References:Cc:From:Date:In-Reply-To; b=0LjZMzrBWwb2LEcPplVReNpqDtksPmDy5k9Q/hTJ1edqJHsl+nMKxCYz/0CWlrq2k rMbrTt8YxHg3ygY0ydkPTk75XFlBmzXEklcpBOsJxhAz8EEN/nLgHBDMeLhECmTAD6 0vYbax51BFuhw6Mdlr3/lWac7xnED4L7959K0Bw8= Subject: Re: svn commit: r287236 - head/bin/df To: Alexey Dokuchaev , Xin LI References: <201508280044.t7S0ixfW038766@repo.freebsd.org> <20150828044312.GA88538@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Xin Li X-Enigmail-Draft-Status: N1110 Message-ID: <55E01D9A.2090805@delphij.net> Date: Fri, 28 Aug 2015 01:36:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150828044312.GA88538@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GR834R286OcfDwOPMBJXse9QHJBOp5Eop" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 08:36:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --GR834R286OcfDwOPMBJXse9QHJBOp5Eop Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/27/15 21:43, Alexey Dokuchaev wrote: > On Fri, Aug 28, 2015 at 12:44:59AM +0000, Xin LI wrote: >> New Revision: 287236 >> URL: https://svnweb.freebsd.org/changeset/base/287236 >> >> Log: >> Use exit() instead of return in main(). >=20 > Because?.. Because the explicit exit() have a subtle difference from returning from main(), and that could confuse static analyzers. I thought it was obvious and too much for trivial changes like this. Let me try again: C standard defines that when main() returns to the startup code, the latter is required by the standard to call exit() with main()'s return value, should main() be defined to return a type compatible with int. On FreeBSD, this is done by lib/csu/${ARCH}/crt1.c. Note, however, that return'ing from a C function means the stack contents, for example, variables defined in function scope, are discarded. Therefore, if, let's say one defined a pointer in the function scope, like: void *p; And then later assign a block of memory allocated from heap to it: p =3D malloc(size); Since p is in function scope, upon return, it's gone. If there is no other pointers that referenced the memory block referenced by p, the memory block is _technically_ leaked. This does not matter in practice because exit() or returning from main are both the points of termination, and the kernel would then reclaim all memory pages that belongs to the process. However, doing exit() makes it more explicit that this is the point of no returns, actually, it hints the compiler or a static analyzer to do the right thing without needing to make main() a special case. Cheers, --GR834R286OcfDwOPMBJXse9QHJBOp5Eop Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJV4B2dAAoJEJW2GBstM+nsfo0P/jEEO5rpHeyocrC55L7gVDUk Zd/5IrjM1kX3Fj9xLTvUHiUvcdgw7QzWoQ3YD+F5toX9Z0kklQ6e+b7sHyXyj/vb IVy2XgBAPwj5rLh5X9/2cK9CgZiI5CuLQER1AyYfxx2S1MKg2yLcnhRtz13M95fw IoN0tPhCspJob8IlYcXfEwNx5ZwiwThLU4Nv2p/x18Tus9I4tY/mJM17X/yEp3ih 5otK6tB+qqCiiTPwACXhUwTuAqTIyoq8jKRX7Dw9ZpfBPHFgI/793Lo2s6RJKQRW U06sJUGDRwhf3XZ488/d1JzYu5zerk5p0AK6L0qyho6SamEPEOLyLJHc119GKRfU I4SeQKJ0RmML7+1XHzoRIoL66vAjmpk7SNZ3o2sSB/MzRAaNw17HBjAyRDtIFuXX PaHrj/xJBkjemjKY7CtzIUnFW8/V14EHSdDMgzpliUscgCGrx5UdLiWMBO4Bbb8q db8TCtxCZzfqngBCowoIlXkw9uRdMNvgHgX9zHvjuoNOxj8RLb7h5rT4HSsJL6JC f+8i+M89dBKUhNzgPcB+Dx8T6UxmjDRej6xMYFpZ1xdeKtsBoxriz0Qu86Cichf5 y2QFmfQ8URLUobMsANHXVNTP01Y/TAkDixzjuQBX4gbWW1Ffip4zhT+j7RicY5No piR8BgAwvTetamipVk6J =l7pV -----END PGP SIGNATURE----- --GR834R286OcfDwOPMBJXse9QHJBOp5Eop-- From owner-svn-src-head@freebsd.org Fri Aug 28 09:26:44 2015 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 014FF9C3F11 for ; Fri, 28 Aug 2015 09:26:44 +0000 (UTC) (envelope-from julien@jch.io) Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) (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 B1C6E2BF for ; Fri, 28 Aug 2015 09:26:43 +0000 (UTC) (envelope-from julien@jch.io) Received: by qkfh127 with SMTP id h127so2423544qkf.2 for ; Fri, 28 Aug 2015 02:26:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=aGyAnI41FwfL3Awd0HWSeVJHePlyilYeY9maJKnIC2M=; b=XswTKCaO3MuE7pB150spgahMK/f1xFVtLud6J+W1+UVxLDc1V6z0B0/82IIM4Ewvl8 Vg52bt6E1C5BM2GsE+OdiCG6N/Ic+sXKRUm1ZWmNpLYGJ/vqMYIsCOdxg6DroaiWFrDL cFeoJng7yJU1pNZpDbhnTmTQhgJEACnEc1lh87t3dAxPSuM4Ndmn5N3irGv+Wu3WePZG NtvyAQDpUmBeMlnPcaybFl1DS5goziE5AB/rsdck0AaCoPVq/RVXEtdZYtzi2S/mKm5H yTkSOjztvtNhlwmIWBMdvpL5ZAgt8J39Mzw+TtHQXm/HfspmQZd00efqlMkaKTL75bSc o4Zw== X-Gm-Message-State: ALoCoQkWjwx6WFHkbDrPPoWf9Y3ye0+QPme8R+qMeZmbskJPaD26f44MGdSJONAwIqAfJKqw7EgO X-Received: by 10.55.25.94 with SMTP id k91mr13380767qkh.51.1440752926387; Fri, 28 Aug 2015 02:08:46 -0700 (PDT) Received: from res1tvegesna-l2.vcorp.ad.vrsn.com (h87.s239.verisign.com. [216.168.239.87]) by smtp.googlemail.com with ESMTPSA id t23sm2986972qkt.18.2015.08.28.02.08.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2015 02:08:45 -0700 (PDT) Subject: Re: svn commit: r286880 - head/sys/kern To: Konstantin Belousov References: <201508181015.t7IAFAex055889@repo.freebsd.org> <55DD69E5.4090904@selasky.org> <55DD74EB.30601@selasky.org> <55DE01F7.8040508@freebsd.org> <20150827104946.GH2072@kib.kiev.ua> <55DF3A93.8080507@freebsd.org> <20150827171918.GM2072@kib.kiev.ua> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin From: Julien Charbon X-Enigmail-Draft-Status: N1110 Message-ID: <55E02515.1010705@freebsd.org> Date: Fri, 28 Aug 2015 11:08:37 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150827171918.GM2072@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gVdgJKUhUhxHTrEfWuBxdan5WD5HD4iKr" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 09:26:44 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gVdgJKUhUhxHTrEfWuBxdan5WD5HD4iKr Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Konstantin, On 27/08/15 19:19, Konstantin Belousov wrote: > On Thu, Aug 27, 2015 at 06:28:03PM +0200, Julien Charbon wrote: >> On 27/08/15 12:49, Konstantin Belousov wrote: >>> On Wed, Aug 26, 2015 at 08:14:15PM +0200, Julien Charbon wrote: >>>> As I said, I am not opposed to back out this change, callout(9) API= in >>>> mpsafe mode is a already complex/subtle API, it won't change too muc= h >>>> the current complexity. >>>> >>>> Let say that if nobody screams until Friday 8/28, I will put back >>>> r284245 and revert this change _and_ I will make this case clear in = the >>>> man page. >>> >>> [Replying to a random message in the whole set of conversations] >>> >>> There is one more case, besides TCP timers, which is equially, of not= >>> more, critical and sensitive WRT to the callout_stop(). Look at the >>> sys/kern/subr_sleepqueue.c:sleepq_check_timeout(). Stray return of >>> the false result from callout_stop() causes creation of the non-killa= ble >>> processes: the callout fired, we missed the wakeup and went to sleep= >>> by manually doing the context switch. Such thread cannot be woken up= =2E >>> >>> I suspect that your fix is a better approach than my attempt to look >>> at something similar at PR 200992 (may be not). >> >> This change (r286880) won't improve the PR 200992: >> >> r286880 only addresses a case where callout_stop() returns 1 instead = of >> 0. Thus the only thing that can do r286880 to PR 200992: >> >> - Don't change anything the issues >> - Worsen the issue >> >> Sorry to kill your hope of a simple and elegant fix for PR 200992. >=20 > Well, not that I am frustrated much. Thank you for taking a look. > Did you read the patch attached to the PR ? Right, I read it from here: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D157915&action=3Ddif= f And I am not confident enough to say if it is the right way go. I became knowledgeable on callout calls from TCP timers (D2079 and D2763), but that's it. I would propose rrs (as he introduced the 'not_on_a_list' logic) and jhb for reviewing your patch. And unlike me (D3078), don't underestimate the callout complexity in mpsafe mode. :) -- Julien --gVdgJKUhUhxHTrEfWuBxdan5WD5HD4iKr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJV4CUaAAoJEKVlQ5Je6dhxT2oIANsQTSZddyiNnTKS3DOv0un+ QWtRcKQenHlqZratYMCqqpsrBTHFhe2Fsr9JaJBJr5FWOLeKSCbpkQEpMqaLak3U TeYLY4vZpF3R+Jk1KcJ/Ph8h7wQ+2thSvv9txuWPwsvQMJ+G91R5L5yny3SQq+Bx D82PgawpqjaqQLho50VFtDgyVrlLEv4up0wrRZFR/XL4h6lCWeVd4b4IjEnlXwvT L0C+ALo6ClVfbp6W0K5c+ODV7h+ePCWb+luj5MbU81LleNEsOh2EyToDNw2Z6d3i 9tA8beNcudbQ7Ogdvy8W/wgVt13wphH2a7mOyo1159aEoYDMQx6JUXhTRliQzsc= =142B -----END PGP SIGNATURE----- --gVdgJKUhUhxHTrEfWuBxdan5WD5HD4iKr-- From owner-svn-src-head@freebsd.org Fri Aug 28 09:38:19 2015 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 B64C69C4461; Fri, 28 Aug 2015 09:38:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 A7C17988; Fri, 28 Aug 2015 09:38:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S9cJ0Y089187; Fri, 28 Aug 2015 09:38:19 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S9cJGx089186; Fri, 28 Aug 2015 09:38:19 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201508280938.t7S9cJGx089186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 28 Aug 2015 09:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287249 - head/sys/netinet6 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.20 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, 28 Aug 2015 09:38:19 -0000 Author: bz Date: Fri Aug 28 09:38:18 2015 New Revision: 287249 URL: https://svnweb.freebsd.org/changeset/base/287249 Log: remove a left-over after r220463 empty #ifdef INET check. MFC after: 1 week Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Fri Aug 28 07:31:19 2015 (r287248) +++ head/sys/netinet6/udp6_usrreq.c Fri Aug 28 09:38:18 2015 (r287249) @@ -1243,8 +1243,6 @@ udp6_send(struct socket *so, int flags, INP_HASH_WLOCK(pcbinfo); error = udp6_output(inp, m, addr, control, td); INP_HASH_WUNLOCK(pcbinfo); -#ifdef INET -#endif INP_WUNLOCK(inp); return (error); From owner-svn-src-head@freebsd.org Fri Aug 28 10:34:38 2015 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 825899C20D4; Fri, 28 Aug 2015 10:34:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 737BFE90; Fri, 28 Aug 2015 10:34:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SAYcam014197; Fri, 28 Aug 2015 10:34:38 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SAYcNG014196; Fri, 28 Aug 2015 10:34:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508281034.t7SAYcNG014196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 28 Aug 2015 10:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287250 - head/sys/dev/mmc/host 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.20 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, 28 Aug 2015 10:34:38 -0000 Author: andrew Date: Fri Aug 28 10:34:37 2015 New Revision: 287250 URL: https://svnweb.freebsd.org/changeset/base/287250 Log: Only check for the bus frequency if it has not already been set, for example through a driver running as a subclass of this. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Fri Aug 28 09:38:18 2015 (r287249) +++ head/sys/dev/mmc/host/dwmmc.c Fri Aug 28 10:34:37 2015 (r287250) @@ -481,10 +481,12 @@ parse_fdt(struct dwmmc_softc *sc) * what the clock is supplied for our device. * For now rely on the value specified in FDT. */ - if ((len = OF_getproplen(node, "bus-frequency")) <= 0) - return (ENXIO); - OF_getencprop(node, "bus-frequency", dts_value, len); - sc->bus_hz = dts_value[0]; + if (sc->bus_hz == 0) { + if ((len = OF_getproplen(node, "bus-frequency")) <= 0) + return (ENXIO); + OF_getencprop(node, "bus-frequency", dts_value, len); + sc->bus_hz = dts_value[0]; + } /* * Platform-specific stuff From owner-svn-src-head@freebsd.org Fri Aug 28 12:48:30 2015 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 1EB959C4086; Fri, 28 Aug 2015 12:48:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id DAFE91A70; Fri, 28 Aug 2015 12:48:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id EAD911A2243; Fri, 28 Aug 2015 22:17:57 +1000 (AEST) Date: Fri, 28 Aug 2015 22:17:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Xin LI cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287217 - head/usr.sbin/syslogd In-Reply-To: <201508271811.t7RIB0xl077002@repo.freebsd.org> Message-ID: <20150828215109.G1227@besplex.bde.org> References: <201508271811.t7RIB0xl077002@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=L4TgOLn8 c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=JJXoQN_ZqqusbX7kRnQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 12:48:30 -0000 On Thu, 27 Aug 2015, Xin LI wrote: > Log: > die() would never return, mark it as so. Why? (Except to add a style bug.) > Modified: head/usr.sbin/syslogd/syslogd.c > ============================================================================== > --- head/usr.sbin/syslogd/syslogd.c Thu Aug 27 17:16:18 2015 (r287216) > +++ head/usr.sbin/syslogd/syslogd.c Thu Aug 27 18:11:00 2015 (r287217) > @@ -324,7 +324,7 @@ static const char *cvthname(struct socka > static void deadq_enter(pid_t, const char *); > static int deadq_remove(pid_t); > static int decode(const char *, const CODE *); > -static void die(int); > +static void die(int) __dead2; Since the function is static, it is very easy for the compiler to see that it doesn't return. Even gcc-4.2.1 does this by default, since -O implies -funit-at-a-time for gcc-4.2.1. For clang, there is no way to prevent this (except possibly -O0) since, since -fno-unit-at-a-time is broken in clang. Several other functions in the same file are still missing this style bug: - usage(). The style bug is clearly documented for usage() by its absence in style(9) and in most files that have usage(). Howvever, about 30 declarations of usage() in /usr/src have the style bug. - timedout(). This is a signal handler, so doesn't really need it. This is broken signal handler. It carefully uses _exit() so as to not use stdio in a signal handler, but defeats this by also using errx(). Bruce From owner-svn-src-head@freebsd.org Fri Aug 28 13:25:21 2015 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 0A6BB9C31C1 for ; Fri, 28 Aug 2015 13:25:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk0-f179.google.com (mail-qk0-f179.google.com [209.85.220.179]) (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 BE2DB112E for ; Fri, 28 Aug 2015 13:25:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qkbm65 with SMTP id m65so27804969qkb.2 for ; Fri, 28 Aug 2015 06:25:14 -0700 (PDT) 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:date :message-id:subject:from:to:cc:content-type; bh=jZmxynMNpriK64nKHmLX0nDOPtGFtqE6cEMkaixcq90=; b=N5SCfmdPZgX4zyTD0SkrUZknJYpzr+NnsOnneiasXMhhnOl8cd1FwRtJvXTwZHhg8A yYUInQic5Z8Rq2gaD3gzkktHjaUKHyyzyesjRoWwYWl8lvQbQdkvOjxExt26EJ7wFKpL GHxDOlG9+/pplFMKTGU8s0mAyG44OkiL+yLcSC2kZPeGIUNB7Qr4pLwcMHkKgA0rZXIG vy0/Z5eGdqylHfmRLAyg64vNG7yBWo35ZNDphPNmnNd61BVBYzWZp+rQthrUfo7P7kCU X+pdzna4gg8ZGUtoz4JqAqQFi5tfDxPj9VhDUnQ87OpjjSzkmdzBoyjh9x1yeCZJjSdM Sg9Q== X-Gm-Message-State: ALoCoQllz4pnDEhJmNZeMqydH4uVgetOSz+vkggS5INXPxq9ftTKJ4nE9WYc78g6RZ+pF1jCW6PB MIME-Version: 1.0 X-Received: by 10.55.201.198 with SMTP id m67mr15786271qkl.35.1440768314535; Fri, 28 Aug 2015 06:25:14 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.140.91.52 with HTTP; Fri, 28 Aug 2015 06:25:14 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201508280044.t7S0ixfW038766@repo.freebsd.org> <20150828044312.GA88538@FreeBSD.org> <20150828060458.GA20642@FreeBSD.org> Date: Fri, 28 Aug 2015 07:25:14 -0600 X-Google-Sender-Auth: 2N2DnkUBxd5fm32UA3wPhWZM4Ko Message-ID: Subject: Re: svn commit: r287236 - head/bin/df From: Warner Losh To: Garrett Cooper Cc: "O'Connor, Daniel" , Alexey Dokuchaev , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 13:25:21 -0000 On Fri, Aug 28, 2015 at 1:48 AM, Garrett Cooper wrote: > > Libxo (iirc) doesn't install atexit handlers, which means that you need to > use exit (or a reason facsimile) in order for it to flush its file streams. > > This is unintuitive though. I wish it did the right thing as part of > initializing the streams.. > Ummm, stdio streams are flushed if you return from main() too. If it has internal buffered data it hasn't delivered to stdio yet and hasn't installed atexit handlers, how on earth can it flush anything when you call exit(). Warner From owner-svn-src-head@freebsd.org Fri Aug 28 13:45:12 2015 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 EA0069C3D40; Fri, 28 Aug 2015 13:45:12 +0000 (UTC) (envelope-from lifanov@mail.lifanov.com) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (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 D1A08901; Fri, 28 Aug 2015 13:45:12 +0000 (UTC) (envelope-from lifanov@mail.lifanov.com) Received: by mail.lifanov.com (Postfix, from userid 58) id 0F7281F73FF; Fri, 28 Aug 2015 09:45:05 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail.lifanov.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.1 Received: from [127.0.0.1] (vnat004.nandomedia.com [166.108.31.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id 707221C65CE; Fri, 28 Aug 2015 09:45:04 -0400 (EDT) Subject: Re: svn commit: r287227 - in head: lib/libstand share/mk sys/boot/efi sys/boot/ficl sys/boot/i386 sys/boot/libstand32 sys/boot/pc98 sys/boot/userboot/ficl sys/boot/userboot/libstand sys/boot/zfs To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201508272346.t7RNkg6C013955@repo.freebsd.org> From: Nikolai Lifanov Message-ID: <55E065DD.1060501@mail.lifanov.com> Date: Fri, 28 Aug 2015 09:45:01 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201508272346.t7RNkg6C013955@repo.freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 13:45:13 -0000 On 08/27/15 19:46, Warner Losh wrote: > Author: imp > Date: Thu Aug 27 23:46:42 2015 > New Revision: 287227 > URL: https://svnweb.freebsd.org/changeset/base/287227 > > Log: > Use CFLAGS_NO_SIMD in preference to varying lists of -mno-xxxx flags. > Go ahead and defined -D_STANDALONE for all targets (only strictly > needed for some architecture, but harmless on those it isn't required > for). Also add -msoft-float to all architectures uniformly rather > that higgley piggley like it is today. > > Differential Revision: https://reviews.freebsd.org/D3496 > > Added: > head/share/mk/bsd.stand.mk (contents, props changed) > Modified: > head/lib/libstand/Makefile > head/sys/boot/efi/Makefile.inc > head/sys/boot/ficl/Makefile > head/sys/boot/i386/Makefile.inc > head/sys/boot/libstand32/Makefile > head/sys/boot/pc98/Makefile.inc > head/sys/boot/userboot/ficl/Makefile > head/sys/boot/userboot/libstand/Makefile > head/sys/boot/zfs/Makefile > Hi! I get this on amd64 after this commit: --- sys.all__D --- ld: i386:x86-64 architecture of input file `/usr/obj/usr/src/sys/boot/i386/gptboot/../../libstand32/libstand.a(qdivrem.o)' is incompatible with i386 output *** [gptboot.out] Error code 1 - Nikolai Lifanov From owner-svn-src-head@freebsd.org Fri Aug 28 13:57:31 2015 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 56DA79C42BA; Fri, 28 Aug 2015 13:57:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 47E42109F; Fri, 28 Aug 2015 13:57:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SDvV9N098201; Fri, 28 Aug 2015 13:57:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SDvVbu098200; Fri, 28 Aug 2015 13:57:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508281357.t7SDvVbu098200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2015 13:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287253 - head/sys/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.20 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, 28 Aug 2015 13:57:31 -0000 Author: imp Date: Fri Aug 28 13:57:30 2015 New Revision: 287253 URL: https://svnweb.freebsd.org/changeset/base/287253 Log: Fix cleaning of files generated from .m sources. Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Fri Aug 28 12:02:40 2015 (r287252) +++ head/sys/conf/kmod.mk Fri Aug 28 13:57:30 2015 (r287253) @@ -360,11 +360,9 @@ __MPATH!=find ${SYSDIR:tA}/ -name \*_if. _MPATH=${__MPATH:H:O:u} .endif .PATH.m: ${_MPATH} -.for _s in ${SRCS:M*_if.[ch]} -.if eixsts(${_s:R}.m}) -CLEANFILES+= ${_s} -.endif -.endfor # _s +.for _i in ${SRCS:M*_if.[ch]} +CLEANFILES+= ${_i} +.endfor # _i .m.c: ${SYSDIR}/tools/makeobjops.awk ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c From owner-svn-src-head@freebsd.org Fri Aug 28 14:02:42 2015 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 2E3559C4627 for ; Fri, 28 Aug 2015 14:02:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-f52.google.com (mail-qg0-f52.google.com [209.85.192.52]) (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 E2DA21771 for ; Fri, 28 Aug 2015 14:02:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qgeb6 with SMTP id b6so29597089qge.3 for ; Fri, 28 Aug 2015 07:02:35 -0700 (PDT) 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:date :message-id:subject:from:to:cc:content-type; bh=aP6HHm/rNOjlkIg2ELUoYz8uOPKHWiJKFiny2Bfr0kg=; b=QkSRikZgxn7GW4JjSuDvTwStSD9gJTtmkqh6qJ/12puIxMcB9dueb5/RPGJCOWzzSj OOqRXsIvdgXrVKgn5buz95j9DgGpZ2yaAgF/Csiacq8/TS1qctodmH2gZtiTLrbVud2B EmZLRlM2JFI+PfKXov7emJ6dPYA+8Mqgpajlyj3zfJkMcJTBglQ/ZPYq2FmtDFTWIXmg j63t40lHdxvRyxtTEhIWHFjrQwiVUYdNM6+GRIeK1RhhHf1yjS7cckCmcUq/Oi9KKuuY 10Jyxr50lL/2AlqOq+Es9VCZNHuqODq6j2slFrMzBDiOqVHoGMmofAOQotDa5+Qs7lB0 xt7g== X-Gm-Message-State: ALoCoQkndAUuezTYSgvX5UvZRIVKpVJ3Gs2IlKoJG1LLiHeIBVMNWj9QINf3ig15IbOqmKVERdU4 MIME-Version: 1.0 X-Received: by 10.140.233.14 with SMTP id e14mr17612344qhc.20.1440770554962; Fri, 28 Aug 2015 07:02:34 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.140.91.52 with HTTP; Fri, 28 Aug 2015 07:02:34 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <55E065DD.1060501@mail.lifanov.com> References: <201508272346.t7RNkg6C013955@repo.freebsd.org> <55E065DD.1060501@mail.lifanov.com> Date: Fri, 28 Aug 2015 08:02:34 -0600 X-Google-Sender-Auth: cegAO7yPBWYoc0cWlovmljqFUD4 Message-ID: Subject: Re: svn commit: r287227 - in head: lib/libstand share/mk sys/boot/efi sys/boot/ficl sys/boot/i386 sys/boot/libstand32 sys/boot/pc98 sys/boot/userboot/ficl sys/boot/userboot/libstand sys/boot/zfs From: Warner Losh To: Nikolai Lifanov Cc: Warner Losh , src-committers , "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.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 14:02:42 -0000 I'm testing a fix now. Not sure why I didn't see it until now. Warner On Fri, Aug 28, 2015 at 7:45 AM, Nikolai Lifanov wrote: > On 08/27/15 19:46, Warner Losh wrote: > > Author: imp > > Date: Thu Aug 27 23:46:42 2015 > > New Revision: 287227 > > URL: https://svnweb.freebsd.org/changeset/base/287227 > > > > Log: > > Use CFLAGS_NO_SIMD in preference to varying lists of -mno-xxxx flags. > > Go ahead and defined -D_STANDALONE for all targets (only strictly > > needed for some architecture, but harmless on those it isn't required > > for). Also add -msoft-float to all architectures uniformly rather > > that higgley piggley like it is today. > > > > Differential Revision: https://reviews.freebsd.org/D3496 > > > > Added: > > head/share/mk/bsd.stand.mk (contents, props changed) > > Modified: > > head/lib/libstand/Makefile > > head/sys/boot/efi/Makefile.inc > > head/sys/boot/ficl/Makefile > > head/sys/boot/i386/Makefile.inc > > head/sys/boot/libstand32/Makefile > > head/sys/boot/pc98/Makefile.inc > > head/sys/boot/userboot/ficl/Makefile > > head/sys/boot/userboot/libstand/Makefile > > head/sys/boot/zfs/Makefile > > > > Hi! I get this on amd64 after this commit: > > --- sys.all__D --- > ld: i386:x86-64 architecture of input file > > `/usr/obj/usr/src/sys/boot/i386/gptboot/../../libstand32/libstand.a(qdivrem.o)' > is incompatible with i386 output > *** [gptboot.out] Error code 1 > > - Nikolai Lifanov > > From owner-svn-src-head@freebsd.org Fri Aug 28 14:05:14 2015 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 480E59C471E; Fri, 28 Aug 2015 14:05:14 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f170.google.com (mail-yk0-f170.google.com [209.85.160.170]) (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 0DF661A01; Fri, 28 Aug 2015 14:05:13 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by ykdz80 with SMTP id z80so16003391ykd.0; Fri, 28 Aug 2015 07:05:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=zdqEueWNokcH6eXn2/X/5DhD0OTXXEZy3WnGZ+CwcEg=; b=NcVgFI6bdXMqz+xqTqGiqzRzPu7Ik8gNMsATrOsQ/7kIH1tcW0+SU886oaDCwLCA3H 6UBH5pCF/CA5h3T+5d6KLRb4r2QZ5DwyrXaN0/OyLhQoemZmK7c7yqXwk71ZgbuHkFvp IwmxnPLClVR1LhZSwnvfbjW5L2/CPf6N/yiYWGkdftzpKj8UZeIYNOnW8T2HjH21z/6z 41VsntTSGS1d9sjgxcym4sJxtjrQH3K6exezoLXK8Y6FHig/QoPD/S6VX62xsTLvWs3r xYpy8RibdkB4c7TM5Ihs7eNGOr4OMi5/gGYhLS93jgYRk8jtBG4/EKlrGA5AOIQnegW6 mVcQ== X-Received: by 10.129.95.87 with SMTP id t84mr9198812ywb.29.1440770706873; Fri, 28 Aug 2015 07:05:06 -0700 (PDT) Received: from mail-yk0-f175.google.com (mail-yk0-f175.google.com. [209.85.160.175]) by smtp.gmail.com with ESMTPSA id y129sm5322303ywc.6.2015.08.28.07.05.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2015 07:05:06 -0700 (PDT) Received: by ykdz80 with SMTP id z80so16002999ykd.0; Fri, 28 Aug 2015 07:05:06 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.170.73.136 with SMTP id p130mr8853220ykp.108.1440770706356; Fri, 28 Aug 2015 07:05:06 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.37.48.134 with HTTP; Fri, 28 Aug 2015 07:05:06 -0700 (PDT) In-Reply-To: <55E01D9A.2090805@delphij.net> References: <201508280044.t7S0ixfW038766@repo.freebsd.org> <20150828044312.GA88538@FreeBSD.org> <55E01D9A.2090805@delphij.net> Date: Fri, 28 Aug 2015 07:05:06 -0700 Message-ID: Subject: Re: svn commit: r287236 - head/bin/df From: Conrad Meyer To: Xin LI 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.20 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, 28 Aug 2015 14:05:14 -0000 On Fri, Aug 28, 2015 at 1:36 AM, Xin Li wrote: > > > On 8/27/15 21:43, Alexey Dokuchaev wrote: >> On Fri, Aug 28, 2015 at 12:44:59AM +0000, Xin LI wrote: >>> New Revision: 287236 >>> URL: https://svnweb.freebsd.org/changeset/base/287236 >>> >>> Log: >>> Use exit() instead of return in main(). >> >> Because?.. > > Because the explicit exit() have a subtle difference from returning from > main(), and that could confuse static analyzers. I thought it was > obvious and too much for trivial changes like this. Let me try again: > > C standard defines that when main() returns to the startup code, the > latter is required by the standard to call exit() with main()'s return > value, should main() be defined to return a type compatible with int. > On FreeBSD, this is done by lib/csu/${ARCH}/crt1.c. > > Note, however, that return'ing from a C function means the stack > contents, for example, variables defined in function scope, are > discarded. Therefore, if, let's say one defined a pointer in the > function scope, like: > > void *p; > > And then later assign a block of memory allocated from heap to it: > > p = malloc(size); > > Since p is in function scope, upon return, it's gone. If there is no > other pointers that referenced the memory block referenced by p, the > memory block is _technically_ leaked. > > This does not matter in practice because exit() or returning from main > are both the points of termination, and the kernel would then reclaim > all memory pages that belongs to the process. However, doing exit() > makes it more explicit that this is the point of no returns, actually, > it hints the compiler or a static analyzer to do the right thing without > needing to make main() a special case. So, a better commit log may have been: "Use exit() instead of return in main() to work around a broken static analyzer" Any C static analyzer must understand main(). Best, Conrad From owner-svn-src-head@freebsd.org Fri Aug 28 14:06:29 2015 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 749589C476B; Fri, 28 Aug 2015 14:06:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4BB431B79; Fri, 28 Aug 2015 14:06:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SE6T3T002371; Fri, 28 Aug 2015 14:06:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SE6TYQ002370; Fri, 28 Aug 2015 14:06:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201508281406.t7SE6TYQ002370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 28 Aug 2015 14:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287254 - 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.20 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, 28 Aug 2015 14:06:29 -0000 Author: pfg Date: Fri Aug 28 14:06:28 2015 New Revision: 287254 URL: https://svnweb.freebsd.org/changeset/base/287254 Log: Be more GCC-friendly with attributes Being clang the default compiler, we were always giving precedence to the __has_attribute check. Unfortunately clang generally doesn't support the new attributes (alloc_size was briefly supported and then reverted) so we were always doing both checks. Give the precedence to GCC as that is the working case now. Do the same for __has_builtin() for consistency. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Aug 28 13:57:30 2015 (r287253) +++ head/sys/sys/cdefs.h Fri Aug 28 14:06:28 2015 (r287254) @@ -237,12 +237,12 @@ #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #endif -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) +#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size) #define __alloc_size(x) __attribute__((__alloc_size__(x))) #else #define __alloc_size(x) #endif -#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9) +#if __GNUC_PREREQ__(4, 9) || __has_attribute(alloc_align) #define __alloc_align(x) __attribute__((__alloc_align__(x))) #else #define __alloc_align(x) @@ -382,7 +382,7 @@ #define __returns_twice #endif -#if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ__(4, 6) +#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable) #define __unreachable() __builtin_unreachable() #else #define __unreachable() ((void)0) @@ -535,7 +535,7 @@ * well enough to use them in limited cases. */ #if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__) -#if __has_attribute(artificial) || __GNUC_PREREQ__(4, 3) +#if __GNUC_PREREQ__(4, 3) || __has_attribute(artificial) #define __gnu_inline __attribute__((__gnu_inline__, __artificial__)) #else #define __gnu_inline __attribute__((__gnu_inline__)) From owner-svn-src-head@freebsd.org Fri Aug 28 14:13:02 2015 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 65E4E9C4B72; Fri, 28 Aug 2015 14:13:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 536792DA; Fri, 28 Aug 2015 14:13:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SED22D006398; Fri, 28 Aug 2015 14:13:02 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SED2df006397; Fri, 28 Aug 2015 14:13:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201508281413.t7SED2df006397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 28 Aug 2015 14:13:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287255 - 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.20 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, 28 Aug 2015 14:13:02 -0000 Author: pfg Date: Fri Aug 28 14:13:01 2015 New Revision: 287255 URL: https://svnweb.freebsd.org/changeset/base/287255 Log: trailing space Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Aug 28 14:06:28 2015 (r287254) +++ head/sys/sys/cdefs.h Fri Aug 28 14:13:01 2015 (r287255) @@ -382,7 +382,7 @@ #define __returns_twice #endif -#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable) +#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable) #define __unreachable() __builtin_unreachable() #else #define __unreachable() ((void)0) From owner-svn-src-head@freebsd.org Fri Aug 28 14:26:12 2015 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 CEDA89C50DF; Fri, 28 Aug 2015 14:26:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 BF38BC61; Fri, 28 Aug 2015 14:26:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SEQCbM010999; Fri, 28 Aug 2015 14:26:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SEQCo5010998; Fri, 28 Aug 2015 14:26:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508281426.t7SEQCo5010998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 28 Aug 2015 14:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287256 - head/sys/fs/nfs 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.20 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, 28 Aug 2015 14:26:12 -0000 Author: trasz Date: Fri Aug 28 14:26:11 2015 New Revision: 287256 URL: https://svnweb.freebsd.org/changeset/base/287256 Log: Fix an NFS server bug that manifested in "ls -al" displaying a plus sign on every directory exported via NFSv4 with NFSv4 ACLs enabled. Reviewed by: rmacklem@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3502 Modified: head/sys/fs/nfs/nfs_commonacl.c Modified: head/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- head/sys/fs/nfs/nfs_commonacl.c Fri Aug 28 14:13:01 2015 (r287255) +++ head/sys/fs/nfs/nfs_commonacl.c Fri Aug 28 14:26:11 2015 (r287256) @@ -347,6 +347,8 @@ nfsrv_buildace(struct nfsrv_descript *nd acemask |= NFSV4ACE_WRITEACL; if (ace->ae_perm & ACL_WRITE_OWNER) acemask |= NFSV4ACE_WRITEOWNER; + if (ace->ae_perm & ACL_SYNCHRONIZE) + acemask |= NFSV4ACE_SYNCHRONIZE; } else { if (ace->ae_perm & ACL_READ_DATA) acemask |= NFSV4ACE_READDATA; From owner-svn-src-head@freebsd.org Fri Aug 28 14:38:56 2015 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 B07FD9C555D; Fri, 28 Aug 2015 14:38:56 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo6-p00-ob.smtp.rzone.de (mo6-p00-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5300::10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.smtp.rzone.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CECDD1395; Fri, 28 Aug 2015 14:38:55 +0000 (UTC) (envelope-from joerg@britannica.bec.de) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/auYssSp3lXGnYOgGHMs= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-2-207-250-194.web.vodafone.de [2.207.250.194]) by smtp.strato.de (RZmta 37.11 DYNA|AUTH) with ESMTPSA id w02284r7SEcmrpu (using TLSv1 with cipher AES256-SHA (256 bits)) (Client did not present a certificate); Fri, 28 Aug 2015 16:38:48 +0200 (CEST) Received: by britannica.bec.de (sSMTP sendmail emulation); Fri, 28 Aug 2015 16:38:47 +0200 Date: Fri, 28 Aug 2015 16:38:47 +0200 From: Joerg Sonnenberger To: Bruce Evans Cc: Xin LI , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r287217 - head/usr.sbin/syslogd Message-ID: <20150828143847.GA24222@britannica.bec.de> References: <201508271811.t7RIB0xl077002@repo.freebsd.org> <20150828215109.G1227@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150828215109.G1227@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 14:38:56 -0000 On Fri, Aug 28, 2015 at 10:17:56PM +1000, Bruce Evans wrote: > >-static void die(int); > >+static void die(int) __dead2; > > Since the function is static, it is very easy for the compiler to see > that it doesn't return. But the compiler can't tell if it is the *intention* that the function never returns. The warning behavior exists because that can easily change with macros etc. > Even gcc-4.2.1 does this by default, since > -O implies -funit-at-a-time for gcc-4.2.1. For clang, there is no way > to prevent this (except possibly -O0) since, since -fno-unit-at-a-time > is broken in clang. It is not broken. It is loadly ignored as unsupported. The very existance of the option in GCC has always been a concession to broken and badly written code, including of course GCC's own CRT. Joerg From owner-svn-src-head@freebsd.org Fri Aug 28 14:50:37 2015 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 5332E9C589C; Fri, 28 Aug 2015 14:50:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 3FCDE1B17; Fri, 28 Aug 2015 14:50:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SEobED022128; Fri, 28 Aug 2015 14:50:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SEobOr022127; Fri, 28 Aug 2015 14:50:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508281450.t7SEobOr022127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2015 14:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287257 - head/sys/boot/libstand32 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.20 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, 28 Aug 2015 14:50:37 -0000 Author: imp Date: Fri Aug 28 14:50:36 2015 New Revision: 287257 URL: https://svnweb.freebsd.org/changeset/base/287257 Log: Add back missing -m32 for amd64 and powerpc64 that was lost in the move to bsd.stand.mk. Modified: head/sys/boot/libstand32/Makefile Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Fri Aug 28 14:26:11 2015 (r287256) +++ head/sys/boot/libstand32/Makefile Fri Aug 28 14:50:36 2015 (r287257) @@ -19,6 +19,9 @@ LIB= stand INTERNALLIB= MK_PROFILE= no NO_PIC= +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -m32 -I. +.endif WARNS?= 0 From owner-svn-src-head@freebsd.org Fri Aug 28 15:23:26 2015 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 468EA9C4868; Fri, 28 Aug 2015 15:23:26 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay114.isp.belgacom.be (mailrelay114.isp.belgacom.be [195.238.20.141]) by mx1.freebsd.org (Postfix) with ESMTP id 59ED6199B; Fri, 28 Aug 2015 15:23:24 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=b5VF44rymZs9Y1DiFqPAMix8rWtyBsB+bu/OWkEeo3k= c=1 sm=2 a=6I5d2MoRAAAA:8 a=M4tgkDYeLxmORRX0F_oA:9 a=CjuIK1q_8ugA:10 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DOBgBMe+BV/4OL8VFegxtUWg++C4F4hXsCgTs7EgEBAQEBAQGBCoQkAQEEOhwjEAsUBAklDyoeBhOIMgEIxFcBAQEBAQEBAwEBAQEBAQEXBItihFgzB4QsAQSVP4UGh2pSmhgmhAE8M4JNAQEB Received: from 131.139-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.139.131]) by relay.skynet.be with ESMTP; 28 Aug 2015 17:22:15 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id t7SFMCUo003936; Fri, 28 Aug 2015 17:22:12 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Fri, 28 Aug 2015 17:22:12 +0200 From: Tijl Coosemans To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287254 - head/sys/sys Message-ID: <20150828172212.1fcf0b53@kalimero.tijl.coosemans.org> In-Reply-To: <201508281406.t7SE6TYQ002370@repo.freebsd.org> References: <201508281406.t7SE6TYQ002370@repo.freebsd.org> 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.20 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, 28 Aug 2015 15:23:26 -0000 On Fri, 28 Aug 2015 14:06:29 +0000 (UTC) "Pedro F. Giffuni" wrote: > Author: pfg > Date: Fri Aug 28 14:06:28 2015 > New Revision: 287254 > URL: https://svnweb.freebsd.org/changeset/base/287254 > > Log: > Be more GCC-friendly with attributes > > Being clang the default compiler, we were always giving precedence to > the __has_attribute check. Unfortunately clang generally doesn't support > the new attributes (alloc_size was briefly supported and then reverted) > so we were always doing both checks. Give the precedence to GCC as that is > the working case now. > > Do the same for __has_builtin() for consistency. > > Modified: > head/sys/sys/cdefs.h > > Modified: head/sys/sys/cdefs.h > ============================================================================== > --- head/sys/sys/cdefs.h Fri Aug 28 13:57:30 2015 (r287253) > +++ head/sys/sys/cdefs.h Fri Aug 28 14:06:28 2015 (r287254) > @@ -237,12 +237,12 @@ > #define __aligned(x) __attribute__((__aligned__(x))) > #define __section(x) __attribute__((__section__(x))) > #endif > -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) > +#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size) I think you have to add underscores to the __has_attribute argument, like __alloc_size__ here, because user code is allowed to use alloc_size. From owner-svn-src-head@freebsd.org Fri Aug 28 15:27:56 2015 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 3E6D09C4AE8; Fri, 28 Aug 2015 15:27:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 2EA351D69; Fri, 28 Aug 2015 15:27:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SFRuVx037101; Fri, 28 Aug 2015 15:27:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SFRtfZ037098; Fri, 28 Aug 2015 15:27:55 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508281527.t7SFRtfZ037098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 28 Aug 2015 15:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287258 - head/sys/dev/mmc/host 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.20 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, 28 Aug 2015 15:27:56 -0000 Author: andrew Date: Fri Aug 28 15:27:55 2015 New Revision: 287258 URL: https://svnweb.freebsd.org/changeset/base/287258 Log: Move dwmmc.h to dwmmc_reg.h. This is in preperation for adding support to subclass the dwmmc driver to allow SoC specific attachments. Sponsored by: ABT Systems Ltd Added: head/sys/dev/mmc/host/dwmmc_reg.h - copied, changed from r287249, head/sys/dev/mmc/host/dwmmc.h Deleted: head/sys/dev/mmc/host/dwmmc.h Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Fri Aug 28 14:50:36 2015 (r287257) +++ head/sys/dev/mmc/host/dwmmc.c Fri Aug 28 15:27:55 2015 (r287258) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "mmcbr_if.h" Copied and modified: head/sys/dev/mmc/host/dwmmc_reg.h (from r287249, head/sys/dev/mmc/host/dwmmc.h) ============================================================================== --- head/sys/dev/mmc/host/dwmmc.h Fri Aug 28 09:38:18 2015 (r287249, copy source) +++ head/sys/dev/mmc/host/dwmmc_reg.h Fri Aug 28 15:27:55 2015 (r287258) @@ -30,6 +30,9 @@ * $FreeBSD$ */ +#ifndef DEV_MMC_HOST_DWMMC_REG_H +#define DEV_MMC_HOST_DWMMC_REG_H + #define SDMMC_CTRL 0x0 /* Control Register */ #define SDMMC_CTRL_USE_IDMAC (1 << 25) /* Use Internal DMAC */ #define SDMMC_CTRL_DMA_ENABLE (1 << 5) /* */ @@ -150,3 +153,5 @@ #define SDMMC_CLKSEL_SAMPLE_SHIFT 0 #define SDMMC_CLKSEL_DRIVE_SHIFT 16 #define SDMMC_CLKSEL_DIVIDER_SHIFT 24 + +#endif /* DEV_MMC_HOST_DWMMC_REG_H */ From owner-svn-src-head@freebsd.org Fri Aug 28 15:36:02 2015 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 6F85F9C4FB9 for ; Fri, 28 Aug 2015 15:36:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm38-vm0.bullet.mail.bf1.yahoo.com (nm38-vm0.bullet.mail.bf1.yahoo.com [72.30.239.16]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E1AC663 for ; Fri, 28 Aug 2015 15:36:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1440775773; bh=SdHpbwoO4FlxS1LOe5TdzOZYHJjxB2Z6vak33VpjuN4=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=J+u/pykvnYcuP7vdY4pYZRYZbCkYGazVhL1omwMQW6PXwEyCgT1w+hVSwnF3V+tEIgE9DgsceL3lWQlqklFJKeo1QKdKbqhp02CgXDxwvvNbdWXpL2fhsLg4N5lTuBk1hj/LrIzcmoiVjC3OavdurJLUBXYGS8MuY2nhYNndefDr7xugQg4jnpUl0bl+2uBuk1v6zcomCvyE2A/7eZ8Ldsuf/uW3XR26eGGrfbMuio/tpeATjxk6UM2jfRZU9bsKP4ga5VqmMDznzcg0UPz5YPNEktxFCp+q/UX2bq9jP7xs9sq3AlWedIzOSHcBsP1+L0Qxwz0jddgAhUgQU91jHA== Received: from [98.139.170.178] by nm38.bullet.mail.bf1.yahoo.com with NNFMP; 28 Aug 2015 15:29:33 -0000 Received: from [98.139.211.197] by tm21.bullet.mail.bf1.yahoo.com with NNFMP; 28 Aug 2015 15:29:33 -0000 Received: from [127.0.0.1] by smtp206.mail.bf1.yahoo.com with NNFMP; 28 Aug 2015 15:29:33 -0000 X-Yahoo-Newman-Id: 32933.90442.bm@smtp206.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: w8HTTocVM1nWy6fLFx4.UCjIF.RBc_kj.8tdnwquUO7n3gz ibjvXi1c.dxTXZeyEFE2G1llfYzEzs67CCEby17IMtbEW3L8JCfFmBxYRzf6 IVvXWBpR_lPbQdsje3UTUimgeecjD_BpgadiTR_3b8w4VN.9GKWucEGCZ8OO 0YmI8LvviQ.Aqge4O2Lp6SKqte9SXzVeQSYosqBZvcnnYYDo6Z6hcOml0ECo rd1KNJhmJZxcPX31pANXUTVLAZ1.dhQ6XbL2ULgTDA5K0.VqB57RZ9oCkiYx PVqT953SiTZcEMudGKe3UC.T1T4ADPM3kJ3jZa36j3ALttyLOgT6RxrAS6zu CGTZxNKS22ckkmWRcvjI8OVJiYI.RNsXsMLeCJCYs9IEfWAOtdr_i.uC0EZr mtgayT0fNPVDDPN6eHkwEEhhYzSthTnFFXCfl8vr1K17IOWM1_bv8PA0lQLQ NrxR.F..ZjRgjC1gY2Cu28RZAN1T9DE1SDtfS8735_mjoZsWn2Oj1VHOgOQO 4UUaqDzMk2repfjfGU1Qsg22ShzT1zPh. X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r287254 - head/sys/sys To: Tijl Coosemans References: <201508281406.t7SE6TYQ002370@repo.freebsd.org> <20150828172212.1fcf0b53@kalimero.tijl.coosemans.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <55E07E65.9020802@FreeBSD.org> Date: Fri, 28 Aug 2015 10:29:41 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150828172212.1fcf0b53@kalimero.tijl.coosemans.org> 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.20 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, 28 Aug 2015 15:36:02 -0000 On 08/28/15 10:22, Tijl Coosemans wrote: > On Fri, 28 Aug 2015 14:06:29 +0000 (UTC) "Pedro F. Giffuni" wrote: >> Author: pfg >> Date: Fri Aug 28 14:06:28 2015 >> New Revision: 287254 >> URL: https://svnweb.freebsd.org/changeset/base/287254 >> >> Log: >> Be more GCC-friendly with attributes >> >> Being clang the default compiler, we were always giving precedence to >> the __has_attribute check. Unfortunately clang generally doesn't support >> the new attributes (alloc_size was briefly supported and then reverted) >> so we were always doing both checks. Give the precedence to GCC as that is >> the working case now. >> >> Do the same for __has_builtin() for consistency. >> >> Modified: >> head/sys/sys/cdefs.h >> >> Modified: head/sys/sys/cdefs.h >> ============================================================================== >> --- head/sys/sys/cdefs.h Fri Aug 28 13:57:30 2015 (r287253) >> +++ head/sys/sys/cdefs.h Fri Aug 28 14:06:28 2015 (r287254) >> @@ -237,12 +237,12 @@ >> #define __aligned(x) __attribute__((__aligned__(x))) >> #define __section(x) __attribute__((__section__(x))) >> #endif >> -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) >> +#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size) > > I think you have to add underscores to the __has_attribute argument, > like __alloc_size__ here, because user code is allowed to use > alloc_size. > Hmm .. yes, it certainly won't hurt. Thanks! Pedro. From owner-svn-src-head@freebsd.org Fri Aug 28 15:36:06 2015 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 51B2C9C4FD0; Fri, 28 Aug 2015 15:36:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 28FEC681; Fri, 28 Aug 2015 15:36:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SFa5YD041260; Fri, 28 Aug 2015 15:36:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SFa5XX041259; Fri, 28 Aug 2015 15:36:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201508281536.t7SFa5XX041259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 28 Aug 2015 15:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287259 - 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.20 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, 28 Aug 2015 15:36:06 -0000 Author: pfg Date: Fri Aug 28 15:36:05 2015 New Revision: 287259 URL: https://svnweb.freebsd.org/changeset/base/287259 Log: Add underscores to attributes when checking for __has_attribute. This is a good practice to avoid confusion with allowed macros. Suggested by: jilles Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Aug 28 15:27:55 2015 (r287258) +++ head/sys/sys/cdefs.h Fri Aug 28 15:36:05 2015 (r287259) @@ -237,12 +237,12 @@ #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #endif -#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size) +#if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__) #define __alloc_size(x) __attribute__((__alloc_size__(x))) #else #define __alloc_size(x) #endif -#if __GNUC_PREREQ__(4, 9) || __has_attribute(alloc_align) +#if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__) #define __alloc_align(x) __attribute__((__alloc_align__(x))) #else #define __alloc_align(x) @@ -535,7 +535,7 @@ * well enough to use them in limited cases. */ #if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__) -#if __GNUC_PREREQ__(4, 3) || __has_attribute(artificial) +#if __GNUC_PREREQ__(4, 3) || __has_attribute(__artificial__) #define __gnu_inline __attribute__((__gnu_inline__, __artificial__)) #else #define __gnu_inline __attribute__((__gnu_inline__)) @@ -787,8 +787,8 @@ * properties that cannot be enforced by the C type system. */ -#if __has_attribute(argument_with_type_tag) && \ - __has_attribute(type_tag_for_datatype) && !defined(lint) +#if __has_attribute(__argument_with_type_tag__) && \ + __has_attribute(__type_tag_for_datatype__) && !defined(lint) #define __arg_type_tag(arg_kind, arg_idx, type_tag_idx) \ __attribute__((__argument_with_type_tag__(arg_kind, arg_idx, type_tag_idx))) #define __datatype_type_tag(kind, type) \ From owner-svn-src-head@freebsd.org Fri Aug 28 15:38:24 2015 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 4B0EB9C4119 for ; Fri, 28 Aug 2015 15:38:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm35.bullet.mail.bf1.yahoo.com (nm35.bullet.mail.bf1.yahoo.com [72.30.238.197]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0163EAA2 for ; Fri, 28 Aug 2015 15:38:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1440776296; bh=rZmXlN8ZD9cBDFq18iu/v+GK5pqJrSrQVvnzn9Zk4Ek=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=Ya7hvWaiZySx2nzsXSjT7QX6Myh4hB8GZKHDo7fypOW9xVWSK4btOLa0C5z7ZGqJVUCxcq9xisrlQ1u+L4bCAAoz9gLfOGwJWXqbZQEx6Rl2e4AGdxs7Gki8YMYB6003t8dDnMypOkgmcP8jXlYv2z+ocdCjEoSIgwP8nR3Cqj4yCy3GeE1wK5Sxw3OELaIcHwq1A2YsxMbjr77GIk5DH4UB0/TxksPhC/DKbdXLkk3ThMYhPFz31mSmaLo9x5+O1J8t0VlToIcStBRoVCaqUBwztlEfMfBa/TFjLTjI62+6izAWE3PfCFQLpHbwZbs6TSp8clF5EHTfe8RLO2rgQw== Received: from [66.196.81.174] by nm35.bullet.mail.bf1.yahoo.com with NNFMP; 28 Aug 2015 15:38:16 -0000 Received: from [68.142.230.75] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 28 Aug 2015 15:38:16 -0000 Received: from [127.0.0.1] by smtp232.mail.bf1.yahoo.com with NNFMP; 28 Aug 2015 15:38:16 -0000 X-Yahoo-Newman-Id: 710647.83189.bm@smtp232.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: vWSUWfsVM1kUXlBuF44rz9de1jN7InIBZ2pRZB_fJOKqey0 Hx6FHL0P7N1j1l8kwgOnE9x1YcVlyHvdsHmFkaTRJ9zQdyj9RJvwylYwRWSX IJ6g06mVfVO2GOzbfEiZ0pRm83Co0lWOW9Pv3VrI1U9OKazSZvTVcc7pSZMT 1LI0CDU5ULvARI7MGYbWJvoKvkLJLh00HvzxMJ3GJ6sp6SweT81yRZ4o48Ae 57DlhYEo_bU79UMaa2ijq1fU1hFjD4qW5yT9rHaKaNI0z.8Sz8oUlbx1iPhs AuUbYZ8FML_Q5DJE5uKDAjNVIbtOYdtu6lj3VSHSsqTCMMuG8psvz_funfsX qx7LGS2oi.fEiV351gEjBOdedzuuBUFSXruO.jfXQ5zoAXv.7.sqjnffqDax m9sxoxSJ8TYnWG9g1OKMd4uw_hx5c2poRUPCnvKoQd6zuR9Tkwc8uJqedZ_H SDU8M6H7By4.66KNwRaXgiT4ff4d7UwNqL0XpmdBn78Sq9sKLFhbl__T6n2A hDhLbLKZH0zuaKKxtSRHfH4VFJ8oTmTYh X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r287259 - head/sys/sys To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201508281536.t7SFa5XX041259@repo.freebsd.org> From: Pedro Giffuni Message-ID: <55E08071.4040107@FreeBSD.org> Date: Fri, 28 Aug 2015 10:38:25 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201508281536.t7SFa5XX041259@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.20 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, 28 Aug 2015 15:38:24 -0000 On 08/28/15 10:36, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Aug 28 15:36:05 2015 > New Revision: 287259 > URL: https://svnweb.freebsd.org/changeset/base/287259 > > Log: > Add underscores to attributes when checking for __has_attribute. > > This is a good practice to avoid confusion with allowed macros. > > Suggested by: jilles > Really sorry .. this was Tijl !! I hate it when my fingers betray me. From owner-svn-src-head@freebsd.org Fri Aug 28 15:41:11 2015 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 085FC9C4232; Fri, 28 Aug 2015 15:41:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E8F88E71; Fri, 28 Aug 2015 15:41:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SFfAJY044788; Fri, 28 Aug 2015 15:41:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SFfAx7044786; Fri, 28 Aug 2015 15:41:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508281541.t7SFfAx7044786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2015 15:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287260 - in head/sys: pc98/include x86/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.20 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, 28 Aug 2015 15:41:11 -0000 Author: imp Date: Fri Aug 28 15:41:09 2015 New Revision: 287260 URL: https://svnweb.freebsd.org/changeset/base/287260 Log: Add missing ofw_machdep.h. Make x86 ofw_machdep.h work pc98 too. This allows the owc module to compile on pc98 and seems preferable to adding another special case in the build system. Added: head/sys/pc98/include/ofw_machdep.h (contents, props changed) Modified: head/sys/x86/include/ofw_machdep.h Added: head/sys/pc98/include/ofw_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/pc98/include/ofw_machdep.h Fri Aug 28 15:41:09 2015 (r287260) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#include Modified: head/sys/x86/include/ofw_machdep.h ============================================================================== --- head/sys/x86/include/ofw_machdep.h Fri Aug 28 15:36:05 2015 (r287259) +++ head/sys/x86/include/ofw_machdep.h Fri Aug 28 15:41:09 2015 (r287260) @@ -29,7 +29,7 @@ #ifndef _MACHINE_OFW_MACHDEP_H_ #define _MACHINE_OFW_MACHDEP_H_ -#include +#include #include typedef uint32_t cell_t; From owner-svn-src-head@freebsd.org Fri Aug 28 15:59:45 2015 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 393509C4BDE; Fri, 28 Aug 2015 15:59:45 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id F07711DC3; Fri, 28 Aug 2015 15:59:44 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 369F296BA; Fri, 28 Aug 2015 15:59:44 +0000 (UTC) Subject: Re: svn commit: r287236 - head/bin/df To: Garrett Cooper , "O'Connor, Daniel" References: <201508280044.t7S0ixfW038766@repo.freebsd.org> <20150828044312.GA88538@FreeBSD.org> <20150828060458.GA20642@FreeBSD.org> Cc: Alexey Dokuchaev , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI From: Allan Jude Message-ID: <55E0859A.50504@freebsd.org> Date: Fri, 28 Aug 2015 12:00:26 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dJ82jxcGNPMGiLpMjFWL5NFTbJKSOcqre" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 15:59:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dJ82jxcGNPMGiLpMjFWL5NFTbJKSOcqre Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2015-08-28 03:48, Garrett Cooper wrote: >=20 >> On Aug 28, 2015, at 00:24, O'Connor, Daniel wrote= : >> >>> On 28 Aug 2015, at 15:34, Alexey Dokuchaev wrote:= >>>> On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote: >>>>> On Thu, Aug 27, 2015 at 9:43 PM, Alexey Dokuchaev wrote: >>>>>> On Fri, Aug 28, 2015 at 12:44:59AM +0000, Xin LI wrote: >>>>>> New Revision: 287236 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/287236 >>>>>> >>>>>> Log: >>>>>> Use exit() instead of return in main(). >>>>> >>>>> Because?.. >>>> >>>> Probably because of libxo... >>> >>> I'm just wondering how hard is it to write sensible commit logs. :( >> >> To put it in a hopefully more helpful way.. >> Please write why your change is doing something, not what it is doing.= >> >> Saying what it is doing is OK if it's really hairy, but 99% of the tim= e that isn't the case. >> >> Assuming this is a libxo thing the commit log should have been somethi= ng like.. >> "Use exit out of main otherwise libxo will not flush properly" >> (or something similar) >> >> Although it would be surprising if libxo required you to use exit().. >=20 > Libxo (iirc) doesn't install atexit handlers, which means that you need= to use exit (or a reason facsimile) in order for it to flush its file st= reams. >=20 > This is unintuitive though. I wish it did the right thing as part of in= itializing the streams.. >=20 This has nothing to do with libxo. libxo has an optional atexit handler, but as long as you call xo_finish(), then everything is flushed and the xo handle is closed. xo_finish() is indeed called the line before this change. --=20 Allan Jude --dJ82jxcGNPMGiLpMjFWL5NFTbJKSOcqre Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJV4IWaAAoJEBmVNT4SmAt+NyMQAJkp9LUGi8AHAaWrN3jQnWvC CxWHAMLKYd8OsVQgY7Cz+HBuVHFC2xOzsZuPj549/4rqRlQEC5fy6K22zxcZNHbT Fqe1P6E0E0nxXXjWtURxZigPQTctwgDb0ndBat7xcdtvqDf/Wojpn0mxvylGyOkP l4M60MIm2vMiE9kQkl4zYqce090ch3pTLjovRyBUA8G5+DbZk08XHH8jVoB/98Hx V3k3ds1gdqaYMhugBWBPDExZTkvvs045nOSkYqxuBBPbY8MGV4ht07xKGwIFldBK uqT1pS4GgTzPni2Zvr8jWVDTVuzC9ad8WLqAWq7jrGpGPwZQ5mqEUW8ZTQRqrelo kQI66OXySO4Dtv6h8Xhs3WnkgD2GeJ4W1UI1VQK7jA71nr2/ji/RIJCYyi1Ho/Tq eN079pPXBfVALN2KG0jJgUUBMAzfO6AxZo9ywmNyHoGfuEa+iG0wW6xq+IsEE+yK Ep5hRRMESU3TM44Ie91GwXnp5QgFzOU7/LGDR6OK1nNGf0QpZVrp8cO8ZafXBfyw jqyXNdYnkzXSbN0uieJKKmPoY/WUqBRyRIkOGHnYqFjHp5+NioZPe8bq2nXHP+Bg VKhzhuRG2lHfEGHdUe3wHzlrJgNacHU8BZ0aQRJsJYaNWQef4rjZQTIXrSATLExx IqDo+Yu1QCpYuu4JqNb0 =2D6K -----END PGP SIGNATURE----- --dJ82jxcGNPMGiLpMjFWL5NFTbJKSOcqre-- From owner-svn-src-head@freebsd.org Fri Aug 28 16:23:04 2015 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 BFD709C56BD; Fri, 28 Aug 2015 16:23:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 B0EB417C6; Fri, 28 Aug 2015 16:23:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SGN4mo062697; Fri, 28 Aug 2015 16:23:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SGN4Iu062696; Fri, 28 Aug 2015 16:23:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508281623.t7SGN4Iu062696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2015 16:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287262 - head/gnu/usr.bin/binutils 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.20 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, 28 Aug 2015 16:23:04 -0000 Author: imp Date: Fri Aug 28 16:23:03 2015 New Revision: 287262 URL: https://svnweb.freebsd.org/changeset/base/287262 Log: Remove .WAIT hacks and put in specific dependencies. Modified: head/gnu/usr.bin/binutils/Makefile Modified: head/gnu/usr.bin/binutils/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/Makefile Fri Aug 28 16:09:29 2015 (r287261) +++ head/gnu/usr.bin/binutils/Makefile Fri Aug 28 16:23:03 2015 (r287262) @@ -5,10 +5,8 @@ SUBDIR= doc\ libiberty \ libbfd \ - .WAIT \ libopcodes \ libbinutils \ - .WAIT \ as \ ld \ ${_objcopy} \ @@ -18,6 +16,11 @@ SUBDIR= doc\ _objcopy= objcopy .endif +SUBDIR_DEPEND_libbinutils=libbfd # for bfdver.h +SUBDIR_DEPEND_as=libbfd libiberty libopcodes +SUBDIR_DEPEND_ld=libbfd libiberty +SUBDIR_DEPEND_objcopy=libbfd libiberty libbinutils +SUBDIR_DEPEND_objdump=libbfd libiberty libbinutils libopcodes .if !make(install) SUBDIR_PARALLEL= From owner-svn-src-head@freebsd.org Fri Aug 28 16:29:39 2015 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 419DE9C5909; Fri, 28 Aug 2015 16:29:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 32D8D1BD2; Fri, 28 Aug 2015 16:29:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SGTdmY063080; Fri, 28 Aug 2015 16:29:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SGTdnb063079; Fri, 28 Aug 2015 16:29:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508281629.t7SGTdnb063079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2015 16:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287263 - head/sys/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.20 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, 28 Aug 2015 16:29:39 -0000 Author: imp Date: Fri Aug 28 16:29:38 2015 New Revision: 287263 URL: https://svnweb.freebsd.org/changeset/base/287263 Log: Comment out cleaning files, since it cleans too much. Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Fri Aug 28 16:23:03 2015 (r287262) +++ head/sys/conf/kmod.mk Fri Aug 28 16:29:38 2015 (r287263) @@ -361,7 +361,8 @@ _MPATH=${__MPATH:H:O:u} .endif .PATH.m: ${_MPATH} .for _i in ${SRCS:M*_if.[ch]} -CLEANFILES+= ${_i} +#removes too much, comment out until it's more constrained. +#CLEANFILES+= ${_i} .endfor # _i .m.c: ${SYSDIR}/tools/makeobjops.awk ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c From owner-svn-src-head@freebsd.org Fri Aug 28 16:29:45 2015 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 7D3E39C5931; Fri, 28 Aug 2015 16:29:45 +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 1166A1CF7; Fri, 28 Aug 2015 16:29:45 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (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 2FF6F1FE023; Fri, 28 Aug 2015 18:29:42 +0200 (CEST) Subject: Re: svn commit: r287196 - head/sys/kern To: Julien Charbon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201508270815.t7R8FXek029896@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <55E08CCC.6010208@selasky.org> Date: Fri, 28 Aug 2015 18:31:08 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <201508270815.t7R8FXek029896@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.20 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, 28 Aug 2015 16:29:45 -0000 On 08/27/15 10:15, Julien Charbon wrote: > Author: jch > Date: Thu Aug 27 08:15:32 2015 > New Revision: 287196 > URL: https://svnweb.freebsd.org/changeset/base/287196 > > Log: > In callout_stop(), if a callout is both pending and currently > being serviced return 0 (fail) but it is applicable only > mpsafe callouts. Thanks to hselasky for finding this. > > Differential Revision: https://reviews.freebsd.org/D3078 (Updated) > Submitted by: hselasky > Reviewed by: jch > Hi, I suggest that this special case be made into a new function, named callout_drain_async() inspired from projects/hps_head and that r287196 be backed out, so that callout_stop() works like before. See: https://reviews.freebsd.org/D3521 And that the following patch be MFC'ed to -current from projects/hps_head after D3521. https://svnweb.freebsd.org/changeset/base/287261 It should close the race in question. --HPS From owner-svn-src-head@freebsd.org Fri Aug 28 17:44:09 2015 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 1EEC39C4862; Fri, 28 Aug 2015 17:44:09 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 0DE9914B4; Fri, 28 Aug 2015 17:44:09 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 0CF261527; Fri, 28 Aug 2015 17:44:09 +0000 (UTC) Date: Fri, 28 Aug 2015 17:44:09 +0000 From: Alexey Dokuchaev To: Allan Jude Cc: Garrett Cooper , "O'Connor, Daniel" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI Subject: Re: svn commit: r287236 - head/bin/df Message-ID: <20150828174408.GA74045@FreeBSD.org> References: <201508280044.t7S0ixfW038766@repo.freebsd.org> <20150828044312.GA88538@FreeBSD.org> <20150828060458.GA20642@FreeBSD.org> <55E0859A.50504@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55E0859A.50504@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 17:44:09 -0000 On Fri, Aug 28, 2015 at 12:00:26PM -0400, Allan Jude wrote: > On 2015-08-28 03:48, Garrett Cooper wrote: > >> On Aug 28, 2015, at 00:24, O'Connor, Daniel wrote: > >>> On 28 Aug 2015, at 15:34, Alexey Dokuchaev wrote: > >>>> On Thu, Aug 27, 2015 at 10:25:28PM -0700, NGie Cooper wrote: > >>>> > >>>> Probably because of libxo... > >>> > >>> I'm just wondering how hard is it to write sensible commit logs. :( > >> > >> To put it in a hopefully more helpful way.. > >> Please write why your change is doing something, not what it is doing. > >> > >> Saying what it is doing is OK if it's really hairy, but 99% of the time > >> that isn't the case. > >> > >> Assuming this is a libxo thing the commit log should have been > >> something like.. "Use exit out of main otherwise libxo will not flush > >> properly" (or something similar) > >> > >> Although it would be surprising if libxo required you to use exit().. > > > > Libxo (iirc) doesn't install atexit handlers, which means that you need > > to use exit (or a reason facsimile) in order for it to flush its file > > streams. > > > > This is unintuitive though. I wish it did the right thing as part of > > initializing the streams.. > > This has nothing to do with libxo. libxo has an optional atexit handler, > but as long as you call xo_finish(), then everything is flushed and the > xo handle is closed. xo_finish() is indeed called the line before this > change. Funny how much hypotheses/guesses/speculations it had caused. Which just proves the necessity of good commit logs. But some of us had probably learned a few things about exit(), atexit handlers, flushing the file streams, etc. so thanks for that guys. :) ./danfe From owner-svn-src-head@freebsd.org Fri Aug 28 19:53:20 2015 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 584C39C5587; Fri, 28 Aug 2015 19:53:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 499FA641; Fri, 28 Aug 2015 19:53:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SJrKoi049645; Fri, 28 Aug 2015 19:53:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SJrKGI049644; Fri, 28 Aug 2015 19:53:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508281953.t7SJrKGI049644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2015 19:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287264 - 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.20 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, 28 Aug 2015 19:53:20 -0000 Author: imp Date: Fri Aug 28 19:53:19 2015 New Revision: 287264 URL: https://svnweb.freebsd.org/changeset/base/287264 Log: Per overwhelming sentiment in the code review, use FEATURE instead. Differential Revision: https://reviews.freebsd.org/D3488 MFC After: 2 days Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Fri Aug 28 16:29:38 2015 (r287263) +++ head/sys/kern/init_main.c Fri Aug 28 19:53:19 2015 (r287264) @@ -119,12 +119,8 @@ SYSCTL_INT(_debug, OID_AUTO, bootverbose /* Want to avoid defining INVARIANTS if not already defined */ #ifdef INVARIANTS -static int invariants = 1; -#else -static int invariants = 0; +FEATURE(invariants, "Kernel compiled with INVARIANTS, may affect performance"); #endif -SYSCTL_INT(_debug, OID_AUTO, invariants, CTLFLAG_RD, &invariants, 0, - "Kernel compiled with invariants"); /* * This ensures that there is at least one entry so that the sysinit_set From owner-svn-src-head@freebsd.org Fri Aug 28 20:06:58 2015 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 E03349C591F; Fri, 28 Aug 2015 20:06:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D1A5A10DA; Fri, 28 Aug 2015 20:06:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7SK6wfH053952; Fri, 28 Aug 2015 20:06:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7SK6woV053951; Fri, 28 Aug 2015 20:06:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508282006.t7SK6woV053951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2015 20:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287265 - 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.20 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, 28 Aug 2015 20:06:59 -0000 Author: imp Date: Fri Aug 28 20:06:58 2015 New Revision: 287265 URL: https://svnweb.freebsd.org/changeset/base/287265 Log: Remove now obsolete comment. MFC After: 2 days Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Fri Aug 28 19:53:19 2015 (r287264) +++ head/sys/kern/init_main.c Fri Aug 28 20:06:58 2015 (r287265) @@ -117,7 +117,6 @@ int bootverbose = BOOTVERBOSE; SYSCTL_INT(_debug, OID_AUTO, bootverbose, CTLFLAG_RW, &bootverbose, 0, "Control the output of verbose kernel messages"); -/* Want to avoid defining INVARIANTS if not already defined */ #ifdef INVARIANTS FEATURE(invariants, "Kernel compiled with INVARIANTS, may affect performance"); #endif From owner-svn-src-head@freebsd.org Fri Aug 28 20:52:56 2015 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 D08DB9C48EC; Fri, 28 Aug 2015 20:52:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.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 AD9B388E; Fri, 28 Aug 2015 20:52:56 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id A3D66B986; Fri, 28 Aug 2015 16:52:55 -0400 (EDT) From: John Baldwin To: cem@freebsd.org Cc: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287236 - head/bin/df Date: Fri, 28 Aug 2015 13:28:48 -0700 Message-ID: <1506354.HODiTnTr7L@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-PRERELEASE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201508280044.t7S0ixfW038766@repo.freebsd.org> <55E01D9A.2090805@delphij.net> 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.2.7 (bigwig.baldwin.cx); Fri, 28 Aug 2015 16:52:55 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 28 Aug 2015 20:52:56 -0000 On Friday, August 28, 2015 07:05:06 AM Conrad Meyer wrote: > On Fri, Aug 28, 2015 at 1:36 AM, Xin Li wrote: > > And then later assign a block of memory allocated from heap to it: > > > > p = malloc(size); > > > > Since p is in function scope, upon return, it's gone. If there is no > > other pointers that referenced the memory block referenced by p, the > > memory block is _technically_ leaked. > > > > This does not matter in practice because exit() or returning from main > > are both the points of termination, and the kernel would then reclaim > > all memory pages that belongs to the process. However, doing exit() > > makes it more explicit that this is the point of no returns, actually, > > it hints the compiler or a static analyzer to do the right thing without > > needing to make main() a special case. > > > So, a better commit log may have been: > > "Use exit() instead of return in main() to work around a broken static analyzer" > > Any C static analyzer must understand main(). +1 C++ might be another case (if you want to avoid destructors for local objects in main() for some reason, and that probably argues for preferring return over exit in general since usually you do want to run destructors). -- John Baldwin From owner-svn-src-head@freebsd.org Sat Aug 29 00:05:40 2015 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 059C59C4ECC; Sat, 29 Aug 2015 00:05:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 EA8A9F58; Sat, 29 Aug 2015 00:05:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7T05dqk052454; Sat, 29 Aug 2015 00:05:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7T05dVZ052453; Sat, 29 Aug 2015 00:05:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508290005.t7T05dVZ052453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 29 Aug 2015 00:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287268 - head/sys/dev/drm2/i915 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.20 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, 29 Aug 2015 00:05:40 -0000 Author: bapt Date: Sat Aug 29 00:05:39 2015 New Revision: 287268 URL: https://svnweb.freebsd.org/changeset/base/287268 Log: Mark ValleyView/Bay Trail as not supported Modified: head/sys/dev/drm2/i915/i915_drv.c Modified: head/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- head/sys/dev/drm2/i915/i915_drv.c Fri Aug 28 22:42:37 2015 (r287267) +++ head/sys/dev/drm2/i915/i915_drv.c Sat Aug 29 00:05:39 2015 (r287268) @@ -193,6 +193,7 @@ static const struct intel_device_info in .has_bsd_ring = 1, .has_blt_ring = 1, .is_valleyview = 1, + .not_supported = 1, }; static const struct intel_device_info intel_valleyview_d_info = { @@ -202,6 +203,7 @@ static const struct intel_device_info in .has_bsd_ring = 1, .has_blt_ring = 1, .is_valleyview = 1, + .not_supported = 1, }; static const struct intel_device_info intel_haswell_d_info = { From owner-svn-src-head@freebsd.org Sat Aug 29 04:33:32 2015 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 AAED29C49E2; Sat, 29 Aug 2015 04:33:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 9BF761044; Sat, 29 Aug 2015 04:33:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7T4XWw7088652; Sat, 29 Aug 2015 04:33:32 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7T4XWFm088651; Sat, 29 Aug 2015 04:33:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508290433.t7T4XWFm088651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 29 Aug 2015 04:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287270 - 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.20 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, 29 Aug 2015 04:33:32 -0000 Author: adrian Date: Sat Aug 29 04:33:31 2015 New Revision: 287270 URL: https://svnweb.freebsd.org/changeset/base/287270 Log: Remove now unused (and #if 0'ed out) headers. Modified: head/sys/net/rss_config.c Modified: head/sys/net/rss_config.c ============================================================================== --- head/sys/net/rss_config.c Sat Aug 29 02:41:59 2015 (r287269) +++ head/sys/net/rss_config.c Sat Aug 29 04:33:31 2015 (r287270) @@ -53,18 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if 0 -#include -#include -#include -#include - -/* for software rss hash support */ -#include -#include -#include -#endif - /*- * Operating system parts of receiver-side scaling (RSS), which allows * network cards to direct flows to particular receive queues based on hashes From owner-svn-src-head@freebsd.org Sat Aug 29 06:52:15 2015 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 623CB9C59EC; Sat, 29 Aug 2015 06:52:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 52CD4E85; Sat, 29 Aug 2015 06:52:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7T6qFED045540; Sat, 29 Aug 2015 06:52:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7T6qFE1045539; Sat, 29 Aug 2015 06:52:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201508290652.t7T6qFE1045539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 29 Aug 2015 06:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287276 - head/sys/powerpc/booke 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.20 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, 29 Aug 2015 06:52:15 -0000 Author: jhibbits Date: Sat Aug 29 06:52:14 2015 New Revision: 287276 URL: https://svnweb.freebsd.org/changeset/base/287276 Log: The TLB1 TSIZE is a multiple of 4, not 2, so shift 2 bits, not 1. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Aug 29 06:28:48 2015 (r287275) +++ head/sys/powerpc/booke/pmap.c Sat Aug 29 06:52:14 2015 (r287276) @@ -2817,7 +2817,7 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd sz = 1 << (ilog2(size) & ~1); if (va % sz != 0) { do { - sz >>= 1; + sz >>= 2; } while (va % sz != 0); } if (bootverbose) From owner-svn-src-head@freebsd.org Sat Aug 29 06:58:32 2015 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 F29659C5B4B; Sat, 29 Aug 2015 06:58:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C9683110D; Sat, 29 Aug 2015 06:58:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7T6wVac045963; Sat, 29 Aug 2015 06:58:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7T6wVqo045960; Sat, 29 Aug 2015 06:58:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508290658.t7T6wVqo045960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 29 Aug 2015 06:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287277 - 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.20 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, 29 Aug 2015 06:58:32 -0000 Author: adrian Date: Sat Aug 29 06:58:30 2015 New Revision: 287277 URL: https://svnweb.freebsd.org/changeset/base/287277 Log: Rename rss_soft_m2cpuid() -> rss_soft_m2cpuid_v4() in preparation for an IPv6 version to show up. Submitted by: Tiwei Bie Differential Revision: https://reviews.freebsd.org/D3504 Modified: head/sys/netinet/in_rss.c head/sys/netinet/in_rss.h head/sys/netinet/ip_input.c Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Sat Aug 29 06:52:14 2015 (r287276) +++ head/sys/netinet/in_rss.c Sat Aug 29 06:58:30 2015 (r287277) @@ -332,7 +332,7 @@ rss_mbuf_software_hash_v4(const struct m * XXX TODO: definitely want statistics here! */ struct mbuf * -rss_soft_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid) +rss_soft_m2cpuid_v4(struct mbuf *m, uintptr_t source, u_int *cpuid) { uint32_t hash_val, hash_type; int ret; Modified: head/sys/netinet/in_rss.h ============================================================================== --- head/sys/netinet/in_rss.h Sat Aug 29 06:52:14 2015 (r287276) +++ head/sys/netinet/in_rss.h Sat Aug 29 06:58:30 2015 (r287277) @@ -51,7 +51,7 @@ int rss_proto_software_hash_v4(struct i struct in_addr dst, u_short src_port, u_short dst_port, int proto, uint32_t *hashval, uint32_t *hashtype); -struct mbuf * rss_soft_m2cpuid(struct mbuf *m, uintptr_t source, +struct mbuf * rss_soft_m2cpuid_v4(struct mbuf *m, uintptr_t source, u_int *cpuid); #endif /* !_NETINET_IN_RSS_H_ */ Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Sat Aug 29 06:52:14 2015 (r287276) +++ head/sys/netinet/ip_input.c Sat Aug 29 06:58:30 2015 (r287277) @@ -140,7 +140,7 @@ static struct netisr_handler ip_nh = { .nh_handler = ip_input, .nh_proto = NETISR_IP, #ifdef RSS - .nh_m2cpuid = rss_soft_m2cpuid, + .nh_m2cpuid = rss_soft_m2cpuid_v4, .nh_policy = NETISR_POLICY_CPU, .nh_dispatch = NETISR_DISPATCH_HYBRID, #else From owner-svn-src-head@freebsd.org Sat Aug 29 07:14:31 2015 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 60BEA9C418D; Sat, 29 Aug 2015 07:14:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 447A51A0A; Sat, 29 Aug 2015 07:14:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7T7EVot053895; Sat, 29 Aug 2015 07:14:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7T7EU6m053891; Sat, 29 Aug 2015 07:14:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508290714.t7T7EU6m053891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 29 Aug 2015 07:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287278 - head/sys/netinet6 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.20 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, 29 Aug 2015 07:14:31 -0000 Author: adrian Date: Sat Aug 29 07:14:29 2015 New Revision: 287278 URL: https://svnweb.freebsd.org/changeset/base/287278 Log: Implement RSS hashing/re-hashing for IPv6 ingress packets. This mirrors the basic IPv4 implementation - IPv6 packets under RSS now are checked for a correct RSS hash and if one isn't provided, it's done in software. This only handles the initial receive - it doesn't yet handle reinjecting / rehashing packets after being decapsulated from various tunneling setups. That'll come in some follow-up work. For non-RSS users, this is almost a giant no-op. It does change a couple of ipv6 methods to use const mbuf * instead of mbuf * but it doesn't have any functional changes. So, the following now occurs: * If the NIC doesn't do any RSS hashing, it's all done in software. Single-queue, non-RSS NICs will now have the RX path distributed into multiple receive netisr queues. * If the NIC provides the wrong hash (eg only IPv6 hash when we needed an IPv6 TCP hash, or IPv6 UDP hash when we expected IPv6 hash) then the hash is recalculated. * .. if the hash is recalculated, it'll end up being injected into the correct netisr queue for v6 processing. Submitted by: Tiwei Bie Differential Revision: https://reviews.freebsd.org/D3504 Modified: head/sys/netinet6/in6_rss.c head/sys/netinet6/in6_rss.h head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/in6_rss.c ============================================================================== --- head/sys/netinet6/in6_rss.c Sat Aug 29 06:58:30 2015 (r287277) +++ head/sys/netinet6/in6_rss.c Sat Aug 29 07:14:29 2015 (r287278) @@ -58,7 +58,8 @@ __FBSDID("$FreeBSD$"); #include /* for software rss hash support */ -#include +#include +#include #include #include @@ -150,3 +151,207 @@ rss_proto_software_hash_v6(const struct RSS_DEBUG("no available hashtypes!\n"); return (-1); } + +/* + * Do a software calculation of the RSS for the given mbuf. + * + * This is typically used by the input path to recalculate the RSS after + * some form of packet processing (eg de-capsulation, IP fragment reassembly.) + * + * dir is the packet direction - RSS_HASH_PKT_INGRESS for incoming and + * RSS_HASH_PKT_EGRESS for outgoing. + * + * Returns 0 if a hash was done, -1 if no hash was done, +1 if + * the mbuf already had a valid RSS flowid. + * + * This function doesn't modify the mbuf. It's up to the caller to + * assign flowid/flowtype as appropriate. + */ +int +rss_mbuf_software_hash_v6(const struct mbuf *m, int dir, uint32_t *hashval, + uint32_t *hashtype) +{ + const struct ip6_hdr *ip6; + const struct tcphdr *th; + const struct udphdr *uh; + uint32_t flowtype; + uint8_t proto; + int off, newoff; + int nxt; + + /* + * XXX For now this only handles hashing on incoming mbufs. + */ + if (dir != RSS_HASH_PKT_INGRESS) { + RSS_DEBUG("called on EGRESS packet!\n"); + return (-1); + } + + off = sizeof(struct ip6_hdr); + + /* + * First, validate that the mbuf we have is long enough + * to have an IPv6 header in it. + */ + if (m->m_pkthdr.len < off) { + RSS_DEBUG("short mbuf pkthdr\n"); + return (-1); + } + if (m->m_len < off) { + RSS_DEBUG("short mbuf len\n"); + return (-1); + } + + /* Ok, let's dereference that */ + ip6 = mtod(m, struct ip6_hdr *); + proto = ip6->ip6_nxt; + + /* + * Find the beginning of the TCP/UDP header. + * + * If this is a fragment then it shouldn't be four-tuple + * hashed just yet. Once it's reassembled into a full + * frame it should be re-hashed. + */ + while (proto != IPPROTO_FRAGMENT) { + newoff = ip6_nexthdr(m, off, proto, &nxt); + if (newoff < 0) + break; + off = newoff; + proto = nxt; + } + + /* + * If the mbuf flowid/flowtype matches the packet type, + * and we don't support the 4-tuple version of the given protocol, + * then signal to the owner that it can trust the flowid/flowtype + * details. + * + * This is a little picky - eg, if TCPv6 / UDPv6 hashing + * is supported but we got a TCP/UDP frame only 2-tuple hashed, + * then we shouldn't just "trust" the 2-tuple hash. We need + * a 4-tuple hash. + */ + flowtype = M_HASHTYPE_GET(m); + + if (flowtype != M_HASHTYPE_NONE) { + switch (proto) { + case IPPROTO_UDP: + if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV6) && + (flowtype == M_HASHTYPE_RSS_UDP_IPV6)) { + return (1); + } + /* + * Only allow 2-tuple for UDP frames if we don't also + * support 4-tuple for UDP. + */ + if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_IPV6) && + ((rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV6) == 0) && + flowtype == M_HASHTYPE_RSS_IPV6) { + return (1); + } + break; + case IPPROTO_TCP: + if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV6) && + (flowtype == M_HASHTYPE_RSS_TCP_IPV6)) { + return (1); + } + /* + * Only allow 2-tuple for TCP frames if we don't also + * support 4-tuple for TCP. + */ + if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_IPV6) && + ((rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV6) == 0) && + flowtype == M_HASHTYPE_RSS_IPV6) { + return (1); + } + break; + default: + if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_IPV6) && + flowtype == M_HASHTYPE_RSS_IPV6) { + return (1); + } + break; + } + } + + /* + * Decode enough information to make a hash decision. + */ + if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV6) && + (proto == IPPROTO_TCP)) { + if (m->m_len < off + sizeof(struct tcphdr)) { + RSS_DEBUG("short TCP frame?\n"); + return (-1); + } + th = (const struct tcphdr *)((c_caddr_t)ip6 + off); + return rss_proto_software_hash_v6(&ip6->ip6_src, &ip6->ip6_dst, + th->th_sport, + th->th_dport, + proto, + hashval, + hashtype); + } else if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV6) && + (proto == IPPROTO_UDP)) { + if (m->m_len < off + sizeof(struct udphdr)) { + RSS_DEBUG("short UDP frame?\n"); + return (-1); + } + uh = (const struct udphdr *)((c_caddr_t)ip6 + off); + return rss_proto_software_hash_v6(&ip6->ip6_src, &ip6->ip6_dst, + uh->uh_sport, + uh->uh_dport, + proto, + hashval, + hashtype); + } else if (rss_gethashconfig() & RSS_HASHTYPE_RSS_IPV6) { + /* Default to 2-tuple hash */ + return rss_proto_software_hash_v6(&ip6->ip6_src, &ip6->ip6_dst, + 0, /* source port */ + 0, /* destination port */ + 0, /* IPPROTO_IP */ + hashval, + hashtype); + } else { + RSS_DEBUG("no available hashtypes!\n"); + return (-1); + } +} + +/* + * Similar to rss_m2cpuid, but designed to be used by the IPv6 NETISR + * on incoming frames. + * + * If an existing RSS hash exists and it matches what the configured + * hashing is, then use it. + * + * If there's an existing RSS hash but the desired hash is different, + * or if there's no useful RSS hash, then calculate it via + * the software path. + * + * XXX TODO: definitely want statistics here! + */ +struct mbuf * +rss_soft_m2cpuid_v6(struct mbuf *m, uintptr_t source, u_int *cpuid) +{ + uint32_t hash_val, hash_type; + int ret; + + M_ASSERTPKTHDR(m); + + ret = rss_mbuf_software_hash_v6(m, RSS_HASH_PKT_INGRESS, + &hash_val, &hash_type); + if (ret > 0) { + /* mbuf has a valid hash already; don't need to modify it */ + *cpuid = rss_hash2cpuid(m->m_pkthdr.flowid, M_HASHTYPE_GET(m)); + } else if (ret == 0) { + /* hash was done; update */ + m->m_pkthdr.flowid = hash_val; + M_HASHTYPE_SET(m, hash_type); + *cpuid = rss_hash2cpuid(m->m_pkthdr.flowid, M_HASHTYPE_GET(m)); + } else { /* ret < 0 */ + /* no hash was done */ + *cpuid = NETISR_CPUID_NONE; + } + return (m); +} Modified: head/sys/netinet6/in6_rss.h ============================================================================== --- head/sys/netinet6/in6_rss.h Sat Aug 29 06:58:30 2015 (r287277) +++ head/sys/netinet6/in6_rss.h Sat Aug 29 07:14:29 2015 (r287278) @@ -46,8 +46,13 @@ uint32_t rss_hash_ip6_2tuple(const struc * Functions to calculate a software RSS hash for a given mbuf or * packet detail. */ +int rss_mbuf_software_hash_v6(const struct mbuf *m, int dir, + uint32_t *hashval, uint32_t *hashtype); int rss_proto_software_hash_v6(const struct in6_addr *src, const struct in6_addr *dst, u_short src_port, u_short dst_port, int proto, uint32_t *hashval, uint32_t *hashtype); +struct mbuf * rss_soft_m2cpuid_v6(struct mbuf *m, uintptr_t source, + u_int *cpuid); + #endif /* !_NETINET6_IN6_RSS_H_ */ Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Sat Aug 29 06:58:30 2015 (r287277) +++ head/sys/netinet6/ip6_input.c Sat Aug 29 07:14:29 2015 (r287278) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ipfw.h" #include "opt_ipsec.h" #include "opt_route.h" +#include "opt_rss.h" #include #include @@ -112,6 +113,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef IPSEC #include @@ -132,7 +134,13 @@ static struct netisr_handler ip6_nh = { .nh_name = "ip6", .nh_handler = ip6_input, .nh_proto = NETISR_IPV6, +#ifdef RSS + .nh_m2cpuid = rss_soft_m2cpuid_v6, + .nh_policy = NETISR_POLICY_CPU, + .nh_dispatch = NETISR_DISPATCH_HYBRID, +#else .nh_policy = NETISR_POLICY_FLOW, +#endif }; VNET_DECLARE(struct callout, in6_tmpaddrtimer_ch); @@ -1440,7 +1448,7 @@ ip6_pullexthdr(struct mbuf *m, size_t of * we develop `neater' mechanism to process extension headers. */ char * -ip6_get_prevhdr(struct mbuf *m, int off) +ip6_get_prevhdr(const struct mbuf *m, int off) { struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); @@ -1479,7 +1487,7 @@ ip6_get_prevhdr(struct mbuf *m, int off) * get next header offset. m will be retained. */ int -ip6_nexthdr(struct mbuf *m, int off, int proto, int *nxtp) +ip6_nexthdr(const struct mbuf *m, int off, int proto, int *nxtp) { struct ip6_hdr ip6; struct ip6_ext ip6e; @@ -1547,14 +1555,14 @@ ip6_nexthdr(struct mbuf *m, int off, int return -1; } - return -1; + /* NOTREACHED */ } /* * get offset for the last header in the chain. m will be kept untainted. */ int -ip6_lasthdr(struct mbuf *m, int off, int proto, int *nxtp) +ip6_lasthdr(const struct mbuf *m, int off, int proto, int *nxtp) { int newoff; int nxt; Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Sat Aug 29 06:58:30 2015 (r287277) +++ head/sys/netinet6/ip6_var.h Sat Aug 29 07:14:29 2015 (r287278) @@ -356,9 +356,9 @@ void ip6_input(struct mbuf *); void ip6_freepcbopts(struct ip6_pktopts *); int ip6_unknown_opt(u_int8_t *, struct mbuf *, int); -char * ip6_get_prevhdr(struct mbuf *, int); -int ip6_nexthdr(struct mbuf *, int, int, int *); -int ip6_lasthdr(struct mbuf *, int, int, int *); +char * ip6_get_prevhdr(const struct mbuf *, int); +int ip6_nexthdr(const struct mbuf *, int, int, int *); +int ip6_lasthdr(const struct mbuf *, int, int, int *); extern int (*ip6_mforward)(struct ip6_hdr *, struct ifnet *, struct mbuf *); From owner-svn-src-head@freebsd.org Sat Aug 29 07:23:43 2015 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 6DAD29C4524; Sat, 29 Aug 2015 07:23:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::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 3B15B1E57; Sat, 29 Aug 2015 07:23:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pabzx8 with SMTP id zx8so85079199pab.1; Sat, 29 Aug 2015 00:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=D3TLtfMS/+xdyQOOBKG69TmuyTC5ldPP378aouIp+Nk=; b=nanSvVJMa4SIa5PcEhdw2+LHt5M7EgQ6ePQcRJQY5Lps22kI0GhRF+vjOszqmBceps 0Y6zkWcBVUZ7gKWnz7ZoV6opK30sX1D+nwwba8ZjnCwrJMXrm5dfUfkeVWgex1n0ZNOA 0xAKt3ySfiEIu2dYWlcWAwWtFlHHSPksqCCmi9/TqnqwzquvHO/lFWz0OqO/pdSf88O0 4WocP/gdfDVC5haRM70obWIjGAxbUKUM818jqBfB0PPETvPJ3HzqzFRZfuPvF9oP82HR WBhsdDsF2ifCjZVNJKYv3ttNJlnhrvk+gSHyH1/4y/k7kbDRr+VFJvDao73UI6EwFmD2 RHRg== X-Received: by 10.66.217.138 with SMTP id oy10mr21481519pac.83.1440833022799; Sat, 29 Aug 2015 00:23:42 -0700 (PDT) Received: from ?IPv6:2601:601:800:126d:d9d:ae1d:4add:6080? ([2601:601:800:126d:d9d:ae1d:4add:6080]) by smtp.gmail.com with ESMTPSA id hg3sm2673786pbc.45.2015.08.29.00.23.41 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 29 Aug 2015 00:23:42 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r287236 - head/bin/df From: Garrett Cooper In-Reply-To: <55E0859A.50504@freebsd.org> Date: Sat, 29 Aug 2015 00:23:41 -0700 Cc: "O'Connor, Daniel" , Alexey Dokuchaev , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI Content-Transfer-Encoding: quoted-printable Message-Id: References: <201508280044.t7S0ixfW038766@repo.freebsd.org> <20150828044312.GA88538@FreeBSD.org> <20150828060458.GA20642@FreeBSD.org> <55E0859A.50504@freebsd.org> To: Allan Jude X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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, 29 Aug 2015 07:23:43 -0000 > On Aug 28, 2015, at 09:00, Allan Jude wrote: =85 >> Libxo (iirc) doesn't install atexit handlers, which means that you = need to use exit (or a reason facsimile) in order for it to flush its = file streams. >>=20 >> This is unintuitive though. I wish it did the right thing as part of = initializing the streams.. >=20 > This has nothing to do with libxo. libxo has an optional atexit = handler, > but as long as you call xo_finish(), then everything is flushed and = the > xo handle is closed. xo_finish() is indeed called the line before this > change. (Just wanted to clarify/correct what I said earlier :)..) Yes. Some of the details I was remembering were a bit correct from = dealing with the bugs with usr.bin/w, but I was also blurred/said some = incorrect things (as others have pointed out): - As you said, there=92s an optional atexit handler in libxo = (xo_finish_atexit). - xo_finish_atexit and xo_finish both call xo_finish_h with the NULL on = r287124. - xo_finish_h writes out data, flushes its streams via xo_flush_h, then = closes them out. exit definitely flushes file descriptors, but it doesn=92t do everything = that xo_finish does (for obvious reasons). This is where the statement I = made was incorrect. As Warner said later on, exit flushes file = descriptors (along with _exit/_Exit, with caveats noted in the POSIX = spec: = http://pubs.opengroup.org/onlinepubs/9699919799/functions/_exit.html ). Thanks :), -NGie= From owner-svn-src-head@freebsd.org Sat Aug 29 07:59:32 2015 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 94AE19C5325; Sat, 29 Aug 2015 07:59:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 820AF1040; Sat, 29 Aug 2015 07:59:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7T7xWat070499; Sat, 29 Aug 2015 07:59:32 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7T7xWSB070498; Sat, 29 Aug 2015 07:59:32 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201508290759.t7T7xWSB070498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 29 Aug 2015 07:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287279 - 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.20 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, 29 Aug 2015 07:59:32 -0000 Author: glebius Date: Sat Aug 29 07:59:31 2015 New Revision: 287279 URL: https://svnweb.freebsd.org/changeset/base/287279 Log: Add reminder to run etcupdate or mergemaster to get updated rc.d scripts for wireless. Poked by: adrian Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Aug 29 07:14:29 2015 (r287278) +++ head/UPDATING Sat Aug 29 07:59:31 2015 (r287279) @@ -32,6 +32,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20150827: + The wireless drivers had undergone changes that remove the 'parent + interface' from the ifconfig -l output. The rc.d network scripts + used to check presence of a parent interface in the list, so old + scripts would fail to start wireless networking. Thus, etcupdate(3) + or mergemaster(8) run is required after kernel update, to update your + rc.d scripts in /etc. + +20150827: pf no longer supports 'scrub fragment crop' or 'scrub fragment drop-ovl' These configurations are now automatically interpreted as 'scrub fragment reassemble'. From owner-svn-src-head@freebsd.org Sat Aug 29 08:16:58 2015 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 5CCA89C5BBB; Sat, 29 Aug 2015 08:16:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4CD051D29; Sat, 29 Aug 2015 08:16:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7T8Gwl0078862; Sat, 29 Aug 2015 08:16:58 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7T8Gwtq078861; Sat, 29 Aug 2015 08:16:58 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508290816.t7T8Gwtq078861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 29 Aug 2015 08:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287280 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.20 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, 29 Aug 2015 08:16:58 -0000 Author: delphij Date: Sat Aug 29 08:16:57 2015 New Revision: 287280 URL: https://svnweb.freebsd.org/changeset/base/287280 Log: In r286705 (Illumos 5960/a2cdcdd), a separate thread is created with curproc as parent. In the case of a send or receive, the curproc would be the userland application that issues the ioctl. This would trigger an assertion failure introduced in Solaris compatibility shims in r196458 when kernel is compiled with INVARIANTS. Fix this by using p0 (proc0 or kernel) as the parent thread when creating the kernel threads. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Aug 29 07:59:31 2015 (r287279) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Aug 29 08:16:57 2015 (r287280) @@ -786,7 +786,7 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, to_arg.ds = to_ds; to_arg.fromtxg = fromtxg; to_arg.flags = TRAVERSE_PRE | TRAVERSE_PREFETCH; - (void) thread_create(NULL, 0, send_traverse_thread, &to_arg, 0, curproc, + (void) thread_create(NULL, 0, send_traverse_thread, &to_arg, 0, &p0, TS_RUN, minclsyspri); struct send_block_record *to_data; @@ -2446,7 +2446,7 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, rwa.os = ra.os; rwa.byteswap = drc->drc_byteswap; - (void) thread_create(NULL, 0, receive_writer_thread, &rwa, 0, curproc, + (void) thread_create(NULL, 0, receive_writer_thread, &rwa, 0, &p0, TS_RUN, minclsyspri); /* * We're reading rwa.err without locks, which is safe since we are the From owner-svn-src-head@freebsd.org Sat Aug 29 09:10:53 2015 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 D47A49C4640; Sat, 29 Aug 2015 09:10:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 C18721601; Sat, 29 Aug 2015 09:10:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7T9Ar6Q000729; Sat, 29 Aug 2015 09:10:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7T9ArX4000727; Sat, 29 Aug 2015 09:10:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201508290910.t7T9ArX4000727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 29 Aug 2015 09:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287281 - head/usr.bin/sockstat 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.20 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, 29 Aug 2015 09:10:53 -0000 Author: tuexen Date: Sat Aug 29 09:10:52 2015 New Revision: 287281 URL: https://svnweb.freebsd.org/changeset/base/287281 Log: Report CLOSED as state for bound sockets for consistency with netstat and the way TCP is handled. PR: 201585 MFC after: 3 weeks Modified: head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Sat Aug 29 08:16:57 2015 (r287280) +++ head/usr.bin/sockstat/sockstat.c Sat Aug 29 09:10:52 2015 (r287281) @@ -332,10 +332,8 @@ gather_sctp(void) sock->socket = xinpcb->socket; sock->proto = IPPROTO_SCTP; sock->protoname = "sctp"; - if (xinpcb->flags & SCTP_PCB_FLAGS_UNBOUND) + if (xinpcb->maxqlen == 0) sock->state = SCTP_CLOSED; - else if (xinpcb->maxqlen == 0) - sock->state = SCTP_BOUND; else sock->state = SCTP_LISTEN; if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) { From owner-svn-src-head@freebsd.org Sat Aug 29 09:14:34 2015 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 E6D799C4868; Sat, 29 Aug 2015 09:14:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D73B91A47; Sat, 29 Aug 2015 09:14:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7T9EY1T003588; Sat, 29 Aug 2015 09:14:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7T9EXje003583; Sat, 29 Aug 2015 09:14:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201508290914.t7T9EXje003583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 29 Aug 2015 09:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287282 - 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.20 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, 29 Aug 2015 09:14:35 -0000 Author: tuexen Date: Sat Aug 29 09:14:32 2015 New Revision: 287282 URL: https://svnweb.freebsd.org/changeset/base/287282 Log: Fix the exporting of SCTP association states to userland. Without this, associations in SHUTDOWN-PENDING were never reported correctly. MFC after: 3 weeks Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sat Aug 29 09:10:52 2015 (r287281) +++ head/sys/netinet/sctp_constants.h Sat Aug 29 09:14:32 2015 (r287282) @@ -458,7 +458,7 @@ __FBSDID("$FreeBSD$"); /* - * SCTP states for internal state machine XXX (should match "user" values) + * SCTP states for internal state machine */ #define SCTP_STATE_EMPTY 0x0000 #define SCTP_STATE_INUSE 0x0001 Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sat Aug 29 09:10:52 2015 (r287281) +++ head/sys/netinet/sctp_sysctl.c Sat Aug 29 09:14:32 2015 (r287282) @@ -453,7 +453,7 @@ sctp_sysctl_handle_assoclist(SYSCTL_HAND if (stcb->asoc.primary_destination != NULL) xstcb.primary_addr = stcb->asoc.primary_destination->ro._l_addr; xstcb.heartbeat_interval = stcb->asoc.heart_beat_delay; - xstcb.state = SCTP_GET_STATE(&stcb->asoc); /* FIXME */ + xstcb.state = (uint32_t) sctp_map_assoc_state(stcb->asoc.state); /* 7.0 does not support these */ xstcb.assoc_id = sctp_get_associd(stcb); xstcb.peers_rwnd = stcb->asoc.peers_rwnd; Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Aug 29 09:10:52 2015 (r287281) +++ head/sys/netinet/sctp_usrreq.c Sat Aug 29 09:14:32 2015 (r287282) @@ -2668,12 +2668,7 @@ flags_out: error = EINVAL; break; } - /* - * I think passing the state is fine since - * sctp_constants.h will be available to the user - * land. - */ - sstat->sstat_state = stcb->asoc.state; + sstat->sstat_state = sctp_map_assoc_state(stcb->asoc.state); sstat->sstat_assoc_id = sctp_get_associd(stcb); sstat->sstat_rwnd = stcb->asoc.peers_rwnd; sstat->sstat_unackdata = stcb->asoc.sent_queue_cnt; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Aug 29 09:10:52 2015 (r287281) +++ head/sys/netinet/sctputil.c Sat Aug 29 09:14:32 2015 (r287282) @@ -893,6 +893,49 @@ sctp_select_a_tag(struct sctp_inpcb *inp return (x); } +int32_t +sctp_map_assoc_state(int kernel_state) +{ + int32_t user_state; + + if (kernel_state & SCTP_STATE_WAS_ABORTED) { + user_state = SCTP_CLOSED; + } else if (kernel_state & SCTP_STATE_SHUTDOWN_PENDING) { + user_state = SCTP_SHUTDOWN_PENDING; + } else { + switch (kernel_state & SCTP_STATE_MASK) { + case SCTP_STATE_EMPTY: + user_state = SCTP_CLOSED; + break; + case SCTP_STATE_INUSE: + user_state = SCTP_CLOSED; + break; + case SCTP_STATE_COOKIE_WAIT: + user_state = SCTP_COOKIE_WAIT; + break; + case SCTP_STATE_COOKIE_ECHOED: + user_state = SCTP_COOKIE_ECHOED; + break; + case SCTP_STATE_OPEN: + user_state = SCTP_ESTABLISHED; + break; + case SCTP_STATE_SHUTDOWN_SENT: + user_state = SCTP_SHUTDOWN_SENT; + break; + case SCTP_STATE_SHUTDOWN_RECEIVED: + user_state = SCTP_SHUTDOWN_RECEIVED; + break; + case SCTP_STATE_SHUTDOWN_ACK_SENT: + user_state = SCTP_SHUTDOWN_ACK_SENT; + break; + default: + user_state = SCTP_CLOSED; + break; + } + } + return (user_state); +} + int sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint32_t override_tag, uint32_t vrf_id) Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sat Aug 29 09:10:52 2015 (r287281) +++ head/sys/netinet/sctputil.h Sat Aug 29 09:14:32 2015 (r287282) @@ -67,6 +67,9 @@ void /* * Function prototypes */ +int32_t +sctp_map_assoc_state(int); + uint32_t sctp_get_ifa_hash_val(struct sockaddr *addr); From owner-svn-src-head@freebsd.org Sat Aug 29 09:22:33 2015 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 8F8BF9C4BB9; Sat, 29 Aug 2015 09:22:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 744851F70; Sat, 29 Aug 2015 09:22:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7T9MX8X007621; Sat, 29 Aug 2015 09:22:33 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7T9MXhF007620; Sat, 29 Aug 2015 09:22:33 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508290922.t7T9MXhF007620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 29 Aug 2015 09:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287283 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.20 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, 29 Aug 2015 09:22:33 -0000 Author: delphij Date: Sat Aug 29 09:22:32 2015 New Revision: 287283 URL: https://svnweb.freebsd.org/changeset/base/287283 Log: Fix a buffer overrun which may lead to data corruption, introduced in r286951 by reinstating changes in r274628. In l2arc_compress_buf(), we allocate a buffer to stash away the compressed data in 'cdata', allocated of l2hdr->b_asize bytes. We then ask zio_compress_data() to compress the buffer, b_l1hdr.b_tmp_cdata, which is of l2hdr->b_asize bytes, and have the compressed size (or original size, if compress didn't gain enough) stored in csize. To pad the buffer to fit the optimal write size, we round up the compressed size to L2 device's vdev_ashift. Illumos code rounds up the size by at most SPA_MINBLOCKSIZE. Because we know csize <= b_asize, and b_asize is integer multiple of SPA_MINBLOCKSIZE, we are guaranteed that the rounded up csize would be <= b_asize. However, this is not necessarily true when we round up to 1 << vdev_ashift, because it could be larger than SPA_MINBLOCKSIZE. So, in the worst case scenario, we are overwriting at most (1 << vdev_ashift - SPA_MINBLOCKSIZE) bytes of memory next to the compressed data buffer. Andriy's original change in r274628 reorganized the code a little bit, by moving the padding to after we determined that the compression was beneficial. At which point, we would check rounded size against the allocated buffer size, and the buffer overrun would not be possible. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug 29 09:14:32 2015 (r287282) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug 29 09:22:32 2015 (r287283) @@ -6529,13 +6529,6 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) csize = zio_compress_data(ZIO_COMPRESS_LZ4, hdr->b_l1hdr.b_tmp_cdata, cdata, l2hdr->b_asize); - rounded = P2ROUNDUP(csize, - (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift); - if (rounded > csize) { - bzero((char *)cdata + csize, rounded - csize); - csize = rounded; - } - if (csize == 0) { /* zero block, indicate that there's nothing to write */ zio_data_buf_free(cdata, len); @@ -6544,11 +6537,19 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) hdr->b_l1hdr.b_tmp_cdata = NULL; ARCSTAT_BUMP(arcstat_l2_compress_zeros); return (B_TRUE); - } else if (csize > 0 && csize < len) { + } + + rounded = P2ROUNDUP(csize, + (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift); + if (rounded < len) { /* * Compression succeeded, we'll keep the cdata around for * writing and release it afterwards. */ + if (rounded > csize) { + bzero((char *)cdata + csize, rounded - csize); + csize = rounded; + } HDR_SET_COMPRESS(hdr, ZIO_COMPRESS_LZ4); l2hdr->b_asize = csize; hdr->b_l1hdr.b_tmp_cdata = cdata; From owner-svn-src-head@freebsd.org Sat Aug 29 09:27:30 2015 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 53F7D9C4DE6; Sat, 29 Aug 2015 09:27:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 44CB4238; Sat, 29 Aug 2015 09:27:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7T9RUe2007887; Sat, 29 Aug 2015 09:27:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7T9RUm3007886; Sat, 29 Aug 2015 09:27:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201508290927.t7T9RUm3007886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 29 Aug 2015 09:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287284 - head/usr.bin/netstat 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.20 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, 29 Aug 2015 09:27:30 -0000 Author: tuexen Date: Sat Aug 29 09:27:29 2015 New Revision: 287284 URL: https://svnweb.freebsd.org/changeset/base/287284 Log: Use the userland exported states and handle them completely. Modified: head/usr.bin/netstat/sctp.c Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Sat Aug 29 09:22:32 2015 (r287283) +++ head/usr.bin/netstat/sctp.c Sat Aug 29 09:27:29 2015 (r287284) @@ -614,25 +614,34 @@ sctp_statesprint(uint32_t state) int idx; switch (state) { - case SCTP_STATE_COOKIE_WAIT: + case SCTP_CLOSED: + idx = NETSTAT_SCTP_STATES_CLOSED; + break; + case SCTP_BOUND: + idx = NETSTAT_SCTP_STATES_BOUND; + break; + case SCTP_LISTEN: + idx = NETSTAT_SCTP_STATES_LISTEN; + break; + case SCTP_COOKIE_WAIT: idx = NETSTAT_SCTP_STATES_COOKIE_WAIT; break; - case SCTP_STATE_COOKIE_ECHOED: + case SCTP_COOKIE_ECHOED: idx = NETSTAT_SCTP_STATES_COOKIE_ECHOED; break; - case SCTP_STATE_OPEN: + case SCTP_ESTABLISHED: idx = NETSTAT_SCTP_STATES_ESTABLISHED; break; - case SCTP_STATE_SHUTDOWN_SENT: + case SCTP_SHUTDOWN_SENT: idx = NETSTAT_SCTP_STATES_SHUTDOWN_SENT; break; - case SCTP_STATE_SHUTDOWN_RECEIVED: + case SCTP_SHUTDOWN_RECEIVED: idx = NETSTAT_SCTP_STATES_SHUTDOWN_RECEIVED; break; - case SCTP_STATE_SHUTDOWN_ACK_SENT: + case SCTP_SHUTDOWN_ACK_SENT: idx = NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT; break; - case SCTP_STATE_SHUTDOWN_PENDING: + case SCTP_SHUTDOWN_PENDING: idx = NETSTAT_SCTP_STATES_SHUTDOWN_PENDING; break; default: From owner-svn-src-head@freebsd.org Sat Aug 29 11:21:23 2015 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 6E2D09C5BCA; Sat, 29 Aug 2015 11:21:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4CBD91624; Sat, 29 Aug 2015 11:21:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7TBLNfF060730; Sat, 29 Aug 2015 11:21:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7TBLLu3060720; Sat, 29 Aug 2015 11:21:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508291121.t7TBLLu3060720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 29 Aug 2015 11:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287289 - in head/sys/cam: ata 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.20 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, 29 Aug 2015 11:21:23 -0000 Author: mav Date: Sat Aug 29 11:21:20 2015 New Revision: 287289 URL: https://svnweb.freebsd.org/changeset/base/287289 Log: Attach pass driver to LUNs is OFFLINE state. Previously such LUNs were silently ignored. But while they indeed unable to process most of SCSI commands, some, like RTPG, they still can. MFC after: 1 month Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_ch.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_pt.c head/sys/cam/scsi/scsi_sa.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Sat Aug 29 11:15:58 2015 (r287288) +++ head/sys/cam/ata/ata_xpt.c Sat Aug 29 11:21:20 2015 (r287289) @@ -1090,7 +1090,8 @@ notsata: periph_qual = SID_QUAL(inq_buf); - if (periph_qual != SID_QUAL_LU_CONNECTED) + if (periph_qual != SID_QUAL_LU_CONNECTED && + periph_qual != SID_QUAL_LU_OFFLINE) break; /* Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Sat Aug 29 11:15:58 2015 (r287288) +++ head/sys/cam/scsi/scsi_cd.c Sat Aug 29 11:21:20 2015 (r287289) @@ -389,7 +389,8 @@ cdasync(void *callback_arg, u_int32_t co if (cgd->protocol != PROTO_SCSI) break; - + if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED) + break; if (SID_TYPE(&cgd->inq_data) != T_CDROM && SID_TYPE(&cgd->inq_data) != T_WORM) break; Modified: head/sys/cam/scsi/scsi_ch.c ============================================================================== --- head/sys/cam/scsi/scsi_ch.c Sat Aug 29 11:15:58 2015 (r287288) +++ head/sys/cam/scsi/scsi_ch.c Sat Aug 29 11:21:20 2015 (r287289) @@ -337,7 +337,8 @@ chasync(void *callback_arg, u_int32_t co if (cgd->protocol != PROTO_SCSI) break; - + if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED) + break; if (SID_TYPE(&cgd->inq_data)!= T_CHANGER) break; Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sat Aug 29 11:15:58 2015 (r287288) +++ head/sys/cam/scsi/scsi_da.c Sat Aug 29 11:21:20 2015 (r287289) @@ -1663,7 +1663,8 @@ daasync(void *callback_arg, u_int32_t co if (cgd->protocol != PROTO_SCSI) break; - + if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED) + break; if (SID_TYPE(&cgd->inq_data) != T_DIRECT && SID_TYPE(&cgd->inq_data) != T_RBC && SID_TYPE(&cgd->inq_data) != T_OPTICAL) Modified: head/sys/cam/scsi/scsi_pt.c ============================================================================== --- head/sys/cam/scsi/scsi_pt.c Sat Aug 29 11:15:58 2015 (r287288) +++ head/sys/cam/scsi/scsi_pt.c Sat Aug 29 11:21:20 2015 (r287289) @@ -366,7 +366,8 @@ ptasync(void *callback_arg, u_int32_t co if (cgd->protocol != PROTO_SCSI) break; - + if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED) + break; if (SID_TYPE(&cgd->inq_data) != T_PROCESSOR) break; Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Sat Aug 29 11:15:58 2015 (r287288) +++ head/sys/cam/scsi/scsi_sa.c Sat Aug 29 11:21:20 2015 (r287289) @@ -2255,7 +2255,8 @@ saasync(void *callback_arg, u_int32_t co if (cgd->protocol != PROTO_SCSI) break; - + if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED) + break; if (SID_TYPE(&cgd->inq_data) != T_SEQUENTIAL) break; Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Sat Aug 29 11:15:58 2015 (r287288) +++ head/sys/cam/scsi/scsi_xpt.c Sat Aug 29 11:21:20 2015 (r287289) @@ -1123,6 +1123,7 @@ probedone(struct cam_periph *periph, uni { probe_softc *softc; struct cam_path *path; + struct scsi_inquiry_data *inq_buf; u_int32_t priority; CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probedone\n")); @@ -1162,7 +1163,6 @@ out: case PROBE_FULL_INQUIRY: { if (cam_ccb_status(done_ccb) == CAM_REQ_CMP) { - struct scsi_inquiry_data *inq_buf; u_int8_t periph_qual; path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID; @@ -1171,7 +1171,8 @@ out: periph_qual = SID_QUAL(inq_buf); - if (periph_qual == SID_QUAL_LU_CONNECTED) { + if (periph_qual == SID_QUAL_LU_CONNECTED || + periph_qual == SID_QUAL_LU_OFFLINE) { u_int8_t len; /* @@ -1347,10 +1348,10 @@ out: probe_purge_old(path, lp, softc->flags); lp = NULL; } + inq_buf = &path->device->inq_data; if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID && - SID_QUAL(&path->device->inq_data) == SID_QUAL_LU_CONNECTED) { - struct scsi_inquiry_data *inq_buf; - inq_buf = &path->device->inq_data; + (SID_QUAL(inq_buf) == SID_QUAL_LU_CONNECTED || + SID_QUAL(inq_buf) == SID_QUAL_LU_OFFLINE)) { if (INQ_DATA_TQ_ENABLED(inq_buf)) PROBE_SET_ACTION(softc, PROBE_MODE_SENSE); else From owner-svn-src-head@freebsd.org Sat Aug 29 14:25:08 2015 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 C39C39C5365; Sat, 29 Aug 2015 14:25:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 B260EBBA; Sat, 29 Aug 2015 14:25:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7TEP8FR052681; Sat, 29 Aug 2015 14:25:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7TEP2li052648; Sat, 29 Aug 2015 14:25:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508291425.t7TEP2li052648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 29 Aug 2015 14:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287292 - in head/lib/libc: amd64/gen compat-43 db/btree db/hash gen i386/gen include net stdio stdlib 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.20 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, 29 Aug 2015 14:25:08 -0000 Author: kib Date: Sat Aug 29 14:25:01 2015 New Revision: 287292 URL: https://svnweb.freebsd.org/changeset/base/287292 Log: Switch libc from using _sig{procmask,action,suspend} symbols, which are aliases for the syscall stubs and are plt-interposed, to the libc-private aliases of internally interposed sigprocmask() etc. Since e.g. _sigaction is not interposed by libthr, calling signal() removes thr_sighandler() from the handler slot etc. The result was breaking signal semantic and rtld locking. The added __libc_sigprocmask and other symbols are hidden, they are not exported and cannot be called through PLT. The setjmp/longjmp functions for x86 were changed to use direct calls, and since PIC_PROLOGUE only needed for functional PLT indirection on i386, it is removed as well. The PowerPC bug of calling the syscall directly in the setjmp/longjmp implementation is kept as is. Reported by: Pete French Tested by: Michiel Boland Reviewed by: jilles (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/amd64/gen/setjmp.S head/lib/libc/amd64/gen/sigsetjmp.S head/lib/libc/compat-43/sigcompat.c head/lib/libc/db/btree/bt_open.c head/lib/libc/db/hash/hash_page.c head/lib/libc/gen/daemon.c head/lib/libc/gen/posix_spawn.c head/lib/libc/gen/readpassphrase.c head/lib/libc/gen/setmode.c head/lib/libc/gen/siginterrupt.c head/lib/libc/gen/signal.c head/lib/libc/gen/wordexp.c head/lib/libc/i386/gen/setjmp.S head/lib/libc/i386/gen/sigsetjmp.S head/lib/libc/include/libc_private.h head/lib/libc/net/rcmd.c head/lib/libc/stdio/tmpfile.c head/lib/libc/stdlib/abort.c head/lib/libc/stdlib/system.c head/lib/libc/sys/sigaction.c head/lib/libc/sys/sigprocmask.c head/lib/libc/sys/sigsuspend.c Modified: head/lib/libc/amd64/gen/setjmp.S ============================================================================== --- head/lib/libc/amd64/gen/setjmp.S Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/amd64/gen/setjmp.S Sat Aug 29 14:25:01 2015 (r287292) @@ -55,7 +55,7 @@ ENTRY(setjmp) movq $0,%rsi /* (sigset_t*)set */ leaq 72(%rcx),%rdx /* 9,10; (sigset_t*)oset */ /* stack is 16-byte aligned */ - call PIC_PLT(CNAME(_sigprocmask)) + call __libc_sigprocmask popq %rdi movq %rdi,%rcx movq 0(%rsp),%rdx /* retval */ @@ -82,7 +82,7 @@ ENTRY(__longjmp) leaq 72(%rdx),%rsi /* (sigset_t*)set */ movq $0,%rdx /* (sigset_t*)oset */ subq $0x8,%rsp /* make the stack 16-byte aligned */ - call PIC_PLT(CNAME(_sigprocmask)) + call __libc_sigprocmask addq $0x8,%rsp popq %rsi popq %rdi /* jmpbuf */ Modified: head/lib/libc/amd64/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/amd64/gen/sigsetjmp.S Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/amd64/gen/sigsetjmp.S Sat Aug 29 14:25:01 2015 (r287292) @@ -63,7 +63,7 @@ ENTRY(sigsetjmp) movq $0,%rsi /* (sigset_t*)set */ leaq 72(%rcx),%rdx /* 9,10 (sigset_t*)oset */ /* stack is 16-byte aligned */ - call PIC_PLT(CNAME(_sigprocmask)) + call __libc_sigprocmask popq %rdi 2: movq %rdi,%rcx movq 0(%rsp),%rdx /* retval */ @@ -91,7 +91,7 @@ ENTRY(__siglongjmp) leaq 72(%rdx),%rsi /* (sigset_t*)set */ movq $0,%rdx /* (sigset_t*)oset */ subq $0x8,%rsp /* make the stack 16-byte aligned */ - call PIC_PLT(CNAME(_sigprocmask)) + call __libc_sigprocmask addq $0x8,%rsp popq %rsi popq %rdi /* jmpbuf */ Modified: head/lib/libc/compat-43/sigcompat.c ============================================================================== --- head/lib/libc/compat-43/sigcompat.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/compat-43/sigcompat.c Sat Aug 29 14:25:01 2015 (r287292) @@ -59,7 +59,7 @@ sigvec(signo, sv, osv) } else sap = NULL; osap = osv != NULL ? &osa : NULL; - ret = _sigaction(signo, sap, osap); + ret = __libc_sigaction(signo, sap, osap); if (ret == 0 && osv != NULL) { osv->sv_handler = osa.sa_handler; osv->sv_flags = osa.sa_flags ^ SV_INTERRUPT; @@ -77,7 +77,7 @@ sigsetmask(mask) sigemptyset(&set); set.__bits[0] = mask; - n = _sigprocmask(SIG_SETMASK, &set, &oset); + n = __libc_sigprocmask(SIG_SETMASK, &set, &oset); if (n) return (n); return (oset.__bits[0]); @@ -92,7 +92,7 @@ sigblock(mask) sigemptyset(&set); set.__bits[0] = mask; - n = _sigprocmask(SIG_BLOCK, &set, &oset); + n = __libc_sigprocmask(SIG_BLOCK, &set, &oset); if (n) return (n); return (oset.__bits[0]); @@ -105,7 +105,7 @@ sigpause(int mask) sigemptyset(&set); set.__bits[0] = mask; - return (_sigsuspend(&set)); + return (__libc_sigsuspend(&set)); } int @@ -113,11 +113,11 @@ xsi_sigpause(int sig) { sigset_t set; - if (_sigprocmask(SIG_BLOCK, NULL, &set) == -1) + if (__libc_sigprocmask(SIG_BLOCK, NULL, &set) == -1) return (-1); if (sigdelset(&set, sig) == -1) return (-1); - return (_sigsuspend(&set)); + return (__libc_sigsuspend(&set)); } int @@ -128,7 +128,7 @@ sighold(int sig) sigemptyset(&set); if (sigaddset(&set, sig) == -1) return (-1); - return (_sigprocmask(SIG_BLOCK, &set, NULL)); + return (__libc_sigprocmask(SIG_BLOCK, &set, NULL)); } int @@ -138,7 +138,7 @@ sigignore(int sig) bzero(&sa, sizeof(sa)); sa.sa_handler = SIG_IGN; - return (_sigaction(sig, &sa, NULL)); + return (__libc_sigaction(sig, &sa, NULL)); } int @@ -149,7 +149,7 @@ sigrelse(int sig) sigemptyset(&set); if (sigaddset(&set, sig) == -1) return (-1); - return (_sigprocmask(SIG_UNBLOCK, &set, NULL)); + return (__libc_sigprocmask(SIG_UNBLOCK, &set, NULL)); } void @@ -161,26 +161,26 @@ void sigemptyset(&set); if (sigaddset(&set, sig) == -1) return (SIG_ERR); - if (_sigprocmask(SIG_BLOCK, NULL, &pset) == -1) + if (__libc_sigprocmask(SIG_BLOCK, NULL, &pset) == -1) return (SIG_ERR); if ((__sighandler_t *)disp == SIG_HOLD) { - if (_sigprocmask(SIG_BLOCK, &set, &pset) == -1) + if (__libc_sigprocmask(SIG_BLOCK, &set, &pset) == -1) return (SIG_ERR); if (sigismember(&pset, sig)) return (SIG_HOLD); else { - if (_sigaction(sig, NULL, &psa) == -1) + if (__libc_sigaction(sig, NULL, &psa) == -1) return (SIG_ERR); return (psa.sa_handler); } } else { - if (_sigprocmask(SIG_UNBLOCK, &set, &pset) == -1) + if (__libc_sigprocmask(SIG_UNBLOCK, &set, &pset) == -1) return (SIG_ERR); } bzero(&sa, sizeof(sa)); sa.sa_handler = disp; - if (_sigaction(sig, &sa, &psa) == -1) + if (__libc_sigaction(sig, &sa, &psa) == -1) return (SIG_ERR); if (sigismember(&pset, sig)) return (SIG_HOLD); Modified: head/lib/libc/db/btree/bt_open.c ============================================================================== --- head/lib/libc/db/btree/bt_open.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/db/btree/bt_open.c Sat Aug 29 14:25:01 2015 (r287292) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "libc_private.h" #include #include "btree.h" @@ -401,10 +402,10 @@ tmp(void) } (void)sigfillset(&set); - (void)_sigprocmask(SIG_BLOCK, &set, &oset); + (void)__libc_sigprocmask(SIG_BLOCK, &set, &oset); if ((fd = mkostemp(path, O_CLOEXEC)) != -1) (void)unlink(path); - (void)_sigprocmask(SIG_SETMASK, &oset, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oset, NULL); return(fd); } Modified: head/lib/libc/db/hash/hash_page.c ============================================================================== --- head/lib/libc/db/hash/hash_page.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/db/hash/hash_page.c Sat Aug 29 14:25:01 2015 (r287292) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include "un-namespace.h" +#include "libc_private.h" #include #include "hash.h" @@ -861,10 +862,10 @@ open_temp(HTAB *hashp) /* Block signals; make sure file goes away at process exit. */ (void)sigfillset(&set); - (void)_sigprocmask(SIG_BLOCK, &set, &oset); + (void)__libc_sigprocmask(SIG_BLOCK, &set, &oset); if ((hashp->fp = mkostemp(path, O_CLOEXEC)) != -1) (void)unlink(path); - (void)_sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL); return (hashp->fp != -1 ? 0 : -1); } Modified: head/lib/libc/gen/daemon.c ============================================================================== --- head/lib/libc/gen/daemon.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/gen/daemon.c Sat Aug 29 14:25:01 2015 (r287292) @@ -41,10 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "libc_private.h" int -daemon(nochdir, noclose) - int nochdir, noclose; +daemon(int nochdir, int noclose) { struct sigaction osa, sa; int fd; @@ -56,7 +56,7 @@ daemon(nochdir, noclose) sigemptyset(&sa.sa_mask); sa.sa_handler = SIG_IGN; sa.sa_flags = 0; - osa_ok = _sigaction(SIGHUP, &sa, &osa); + osa_ok = __libc_sigaction(SIGHUP, &sa, &osa); switch (fork()) { case -1: @@ -74,7 +74,7 @@ daemon(nochdir, noclose) newgrp = setsid(); oerrno = errno; if (osa_ok != -1) - _sigaction(SIGHUP, &osa, NULL); + __libc_sigaction(SIGHUP, &osa, NULL); if (newgrp == -1) { errno = oerrno; Modified: head/lib/libc/gen/posix_spawn.c ============================================================================== --- head/lib/libc/gen/posix_spawn.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/gen/posix_spawn.c Sat Aug 29 14:25:01 2015 (r287292) @@ -118,15 +118,18 @@ process_spawnattr(const posix_spawnattr_ return (errno); } - /* Set signal masks/defaults */ + /* + * Set signal masks/defaults. + * Use unwrapped syscall, libthr is in undefined state after vfork(). + */ if (sa->sa_flags & POSIX_SPAWN_SETSIGMASK) { - _sigprocmask(SIG_SETMASK, &sa->sa_sigmask, NULL); + __libc_sigprocmask(SIG_SETMASK, &sa->sa_sigmask, NULL); } if (sa->sa_flags & POSIX_SPAWN_SETSIGDEF) { for (i = 1; i <= _SIG_MAXSIG; i++) { if (sigismember(&sa->sa_sigdefault, i)) - if (_sigaction(i, &sigact, NULL) != 0) + if (__libc_sigaction(i, &sigact, NULL) != 0) return (errno); } } Modified: head/lib/libc/gen/readpassphrase.c ============================================================================== --- head/lib/libc/gen/readpassphrase.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/gen/readpassphrase.c Sat Aug 29 14:25:01 2015 (r287292) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "libc_private.h" static volatile sig_atomic_t signo[NSIG]; @@ -104,15 +105,15 @@ restart: sigemptyset(&sa.sa_mask); sa.sa_flags = 0; /* don't restart system calls */ sa.sa_handler = handler; - (void)_sigaction(SIGALRM, &sa, &savealrm); - (void)_sigaction(SIGHUP, &sa, &savehup); - (void)_sigaction(SIGINT, &sa, &saveint); - (void)_sigaction(SIGPIPE, &sa, &savepipe); - (void)_sigaction(SIGQUIT, &sa, &savequit); - (void)_sigaction(SIGTERM, &sa, &saveterm); - (void)_sigaction(SIGTSTP, &sa, &savetstp); - (void)_sigaction(SIGTTIN, &sa, &savettin); - (void)_sigaction(SIGTTOU, &sa, &savettou); + (void)__libc_sigaction(SIGALRM, &sa, &savealrm); + (void)__libc_sigaction(SIGHUP, &sa, &savehup); + (void)__libc_sigaction(SIGINT, &sa, &saveint); + (void)__libc_sigaction(SIGPIPE, &sa, &savepipe); + (void)__libc_sigaction(SIGQUIT, &sa, &savequit); + (void)__libc_sigaction(SIGTERM, &sa, &saveterm); + (void)__libc_sigaction(SIGTSTP, &sa, &savetstp); + (void)__libc_sigaction(SIGTTIN, &sa, &savettin); + (void)__libc_sigaction(SIGTTOU, &sa, &savettou); if (!(flags & RPP_STDIN)) (void)_write(output, prompt, strlen(prompt)); @@ -142,15 +143,15 @@ restart: errno == EINTR && !signo[SIGTTOU]) continue; } - (void)_sigaction(SIGALRM, &savealrm, NULL); - (void)_sigaction(SIGHUP, &savehup, NULL); - (void)_sigaction(SIGINT, &saveint, NULL); - (void)_sigaction(SIGQUIT, &savequit, NULL); - (void)_sigaction(SIGPIPE, &savepipe, NULL); - (void)_sigaction(SIGTERM, &saveterm, NULL); - (void)_sigaction(SIGTSTP, &savetstp, NULL); - (void)_sigaction(SIGTTIN, &savettin, NULL); - (void)_sigaction(SIGTTOU, &savettou, NULL); + (void)__libc_sigaction(SIGALRM, &savealrm, NULL); + (void)__libc_sigaction(SIGHUP, &savehup, NULL); + (void)__libc_sigaction(SIGINT, &saveint, NULL); + (void)__libc_sigaction(SIGQUIT, &savequit, NULL); + (void)__libc_sigaction(SIGPIPE, &savepipe, NULL); + (void)__libc_sigaction(SIGTERM, &saveterm, NULL); + (void)__libc_sigaction(SIGTSTP, &savetstp, NULL); + (void)__libc_sigaction(SIGTTIN, &savettin, NULL); + (void)__libc_sigaction(SIGTTOU, &savettou, NULL); if (input != STDIN_FILENO) (void)_close(input); Modified: head/lib/libc/gen/setmode.c ============================================================================== --- head/lib/libc/gen/setmode.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/gen/setmode.c Sat Aug 29 14:25:01 2015 (r287292) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include "un-namespace.h" +#include "libc_private.h" #define SET_LEN 6 /* initial # of bitcmd struct to malloc */ #define SET_LEN_INCR 4 /* # of bitcmd structs to add as needed */ @@ -364,9 +365,9 @@ getumask(void) * handler, protect them as best we can. */ sigfillset(&sigset); - (void)_sigprocmask(SIG_BLOCK, &sigset, &sigoset); + (void)__libc_sigprocmask(SIG_BLOCK, &sigset, &sigoset); (void)umask(mask = umask(0)); - (void)_sigprocmask(SIG_SETMASK, &sigoset, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &sigoset, NULL); return (mask); } Modified: head/lib/libc/gen/siginterrupt.c ============================================================================== --- head/lib/libc/gen/siginterrupt.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/gen/siginterrupt.c Sat Aug 29 14:25:01 2015 (r287292) @@ -43,14 +43,13 @@ __FBSDID("$FreeBSD$"); * after an instance of the indicated signal. */ int -siginterrupt(sig, flag) - int sig, flag; +siginterrupt(int sig, int flag) { extern sigset_t _sigintr __hidden; struct sigaction sa; int ret; - if ((ret = _sigaction(sig, (struct sigaction *)0, &sa)) < 0) + if ((ret = __libc_sigaction(sig, (struct sigaction *)0, &sa)) < 0) return (ret); if (flag) { sigaddset(&_sigintr, sig); @@ -59,5 +58,5 @@ siginterrupt(sig, flag) sigdelset(&_sigintr, sig); sa.sa_flags |= SA_RESTART; } - return (_sigaction(sig, &sa, (struct sigaction *)0)); + return (__libc_sigaction(sig, &sa, (struct sigaction *)0)); } Modified: head/lib/libc/gen/signal.c ============================================================================== --- head/lib/libc/gen/signal.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/gen/signal.c Sat Aug 29 14:25:01 2015 (r287292) @@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$"); sigset_t _sigintr __hidden; /* shared with siginterrupt */ sig_t -signal(s, a) - int s; - sig_t a; +signal(int s, sig_t a) { struct sigaction sa, osa; @@ -55,7 +53,7 @@ signal(s, a) sa.sa_flags = 0; if (!sigismember(&_sigintr, s)) sa.sa_flags |= SA_RESTART; - if (_sigaction(s, &sa, &osa) < 0) + if (__libc_sigaction(s, &sa, &osa) < 0) return (SIG_ERR); return (osa.sa_handler); } Modified: head/lib/libc/gen/wordexp.c ============================================================================== --- head/lib/libc/gen/wordexp.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/gen/wordexp.c Sat Aug 29 14:25:01 2015 (r287292) @@ -38,6 +38,7 @@ #include #include #include "un-namespace.h" +#include "libc_private.h" __FBSDID("$FreeBSD$"); @@ -127,12 +128,12 @@ we_askshell(const char *words, wordexp_t return (WRDE_NOSPACE); /* XXX */ (void)sigemptyset(&newsigblock); (void)sigaddset(&newsigblock, SIGCHLD); - (void)_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); + (void)__libc_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); if ((pid = fork()) < 0) { serrno = errno; _close(pdes[0]); _close(pdes[1]); - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); errno = serrno; return (WRDE_NOSPACE); /* XXX */ } @@ -140,7 +141,7 @@ we_askshell(const char *words, wordexp_t /* * We are the child; make /bin/sh expand `words'. */ - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); if ((pdes[1] != STDOUT_FILENO ? _dup2(pdes[1], STDOUT_FILENO) : _fcntl(pdes[1], F_SETFD, 0)) < 0) @@ -222,7 +223,7 @@ cleanup: do wpid = _waitpid(pid, &status, 0); while (wpid < 0 && errno == EINTR); - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); if (error != 0) { errno = serrno; return (error); Modified: head/lib/libc/i386/gen/setjmp.S ============================================================================== --- head/lib/libc/i386/gen/setjmp.S Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/i386/gen/setjmp.S Sat Aug 29 14:25:01 2015 (r287292) @@ -50,21 +50,12 @@ __FBSDID("$FreeBSD$"); ENTRY(setjmp) movl 4(%esp),%ecx - PIC_PROLOGUE -#ifdef PIC - subl $12,%esp /* make the stack 16-byte aligned */ -#endif leal 28(%ecx), %eax pushl %eax /* (sigset_t*)oset */ pushl $0 /* (sigset_t*)set */ pushl $1 /* SIG_BLOCK */ - call PIC_PLT(CNAME(_sigprocmask)) -#ifdef PIC - addl $24,%esp -#else + call __libc_sigprocmask addl $12,%esp -#endif - PIC_EPILOGUE movl 4(%esp),%ecx movl 0(%esp),%edx movl %edx, 0(%ecx) @@ -81,21 +72,12 @@ END(setjmp) WEAK_REFERENCE(__longjmp, longjmp) ENTRY(__longjmp) movl 4(%esp),%edx - PIC_PROLOGUE -#ifdef PIC - subl $12,%esp /* make the stack 16-byte aligned */ -#endif pushl $0 /* (sigset_t*)oset */ leal 28(%edx), %eax pushl %eax /* (sigset_t*)set */ pushl $3 /* SIG_SETMASK */ - call PIC_PLT(CNAME(_sigprocmask)) -#ifdef PIC - addl $24,%esp -#else + call __libc_sigprocmask addl $12,%esp -#endif - PIC_EPILOGUE movl 4(%esp),%edx movl 8(%esp),%eax movl 0(%edx),%ecx Modified: head/lib/libc/i386/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/i386/gen/sigsetjmp.S Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/i386/gen/sigsetjmp.S Sat Aug 29 14:25:01 2015 (r287292) @@ -59,21 +59,12 @@ ENTRY(sigsetjmp) movl %eax,44(%ecx) testl %eax,%eax jz 2f - PIC_PROLOGUE -#ifdef PIC - subl $12,%esp /* make the stack 16-byte aligned */ -#endif leal 28(%ecx), %eax pushl %eax /* (sigset_t*)oset */ pushl $0 /* (sigset_t*)set */ pushl $1 /* SIG_BLOCK */ - call PIC_PLT(CNAME(_sigprocmask)) -#ifdef PIC - addl $24,%esp -#else + call __libc_sigprocmask addl $12,%esp -#endif - PIC_EPILOGUE movl 4(%esp),%ecx 2: movl 0(%esp),%edx movl %edx, 0(%ecx) @@ -92,21 +83,12 @@ ENTRY(__siglongjmp) movl 4(%esp),%edx cmpl $0,44(%edx) jz 2f - PIC_PROLOGUE -#ifdef PIC - subl $12,%esp /* make the stack 16-byte aligned */ -#endif pushl $0 /* (sigset_t*)oset */ leal 28(%edx), %eax pushl %eax /* (sigset_t*)set */ pushl $3 /* SIG_SETMASK */ - call PIC_PLT(CNAME(_sigprocmask)) -#ifdef PIC - addl $24,%esp -#else + call __libc_sigprocmask addl $12,%esp -#endif - PIC_EPILOGUE movl 4(%esp),%edx 2: movl 8(%esp),%eax movl 0(%edx),%ecx Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/include/libc_private.h Sat Aug 29 14:25:01 2015 (r287292) @@ -359,6 +359,11 @@ __pid_t __sys_wait6(enum idtype, __id_t __ssize_t __sys_write(int, const void *, __size_t); __ssize_t __sys_writev(int, const struct iovec *, int); +int __libc_sigaction(int, const struct sigaction *, + struct sigaction *) __hidden; +int __libc_sigprocmask(int, const __sigset_t *, __sigset_t *) + __hidden; +int __libc_sigsuspend(const __sigset_t *) __hidden; int __libc_sigwait(const __sigset_t * __restrict, int * restrict sig); int __libc_system(const char *); Modified: head/lib/libc/net/rcmd.c ============================================================================== --- head/lib/libc/net/rcmd.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/net/rcmd.c Sat Aug 29 14:25:01 2015 (r287292) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include "un-namespace.h" +#include "libc_private.h" extern int innetgr( const char *, const char *, const char *, const char * ); @@ -148,7 +149,7 @@ rcmd_af(ahost, rport, locuser, remuser, refused = 0; sigemptyset(&newmask); sigaddset(&newmask, SIGURG); - _sigprocmask(SIG_BLOCK, (const sigset_t *)&newmask, &oldmask); + __libc_sigprocmask(SIG_BLOCK, (const sigset_t *)&newmask, &oldmask); for (timo = 1, lport = IPPORT_RESERVED - 1;;) { s = rresvport_af(&lport, ai->ai_family); if (s < 0) { @@ -163,7 +164,7 @@ rcmd_af(ahost, rport, locuser, remuser, (void)fprintf(stderr, "rcmd: socket: %s\n", strerror(errno)); freeaddrinfo(res); - _sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, + __libc_sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL); return (-1); } @@ -181,7 +182,7 @@ rcmd_af(ahost, rport, locuser, remuser, (void)fprintf(stderr, "%s: %s\n", *ahost, strerror(errno)); freeaddrinfo(res); - _sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, + __libc_sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL); return (-1); } @@ -306,7 +307,7 @@ again: } goto bad2; } - _sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL); + __libc_sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL); freeaddrinfo(res); return (s); bad2: @@ -314,7 +315,7 @@ bad2: (void)_close(*fd2p); bad: (void)_close(s); - _sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL); + __libc_sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL); freeaddrinfo(res); return (-1); } Modified: head/lib/libc/stdio/tmpfile.c ============================================================================== --- head/lib/libc/stdio/tmpfile.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/stdio/tmpfile.c Sat Aug 29 14:25:01 2015 (r287292) @@ -46,9 +46,10 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "libc_private.h" FILE * -tmpfile() +tmpfile(void) { sigset_t set, oset; FILE *fp; @@ -69,7 +70,7 @@ tmpfile() return (NULL); sigfillset(&set); - (void)_sigprocmask(SIG_BLOCK, &set, &oset); + (void)__libc_sigprocmask(SIG_BLOCK, &set, &oset); fd = mkstemp(buf); if (fd != -1) @@ -77,7 +78,7 @@ tmpfile() free(buf); - (void)_sigprocmask(SIG_SETMASK, &oset, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oset, NULL); if (fd == -1) return (NULL); Modified: head/lib/libc/stdlib/abort.c ============================================================================== --- head/lib/libc/stdlib/abort.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/stdlib/abort.c Sat Aug 29 14:25:01 2015 (r287292) @@ -61,7 +61,7 @@ abort() * any errors -- ISO C doesn't allow abort to return anyway. */ sigdelset(&act.sa_mask, SIGABRT); - (void)_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL); (void)raise(SIGABRT); /* @@ -71,9 +71,9 @@ abort() act.sa_handler = SIG_DFL; act.sa_flags = 0; sigfillset(&act.sa_mask); - (void)_sigaction(SIGABRT, &act, NULL); + (void)__libc_sigaction(SIGABRT, &act, NULL); sigdelset(&act.sa_mask, SIGABRT); - (void)_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &act.sa_mask, NULL); (void)raise(SIGABRT); exit(1); } Modified: head/lib/libc/stdlib/system.c ============================================================================== --- head/lib/libc/stdlib/system.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/stdlib/system.c Sat Aug 29 14:25:01 2015 (r287292) @@ -70,16 +70,20 @@ __libc_system(const char *command) (void)sigaddset(&newsigblock, SIGCHLD); (void)sigaddset(&newsigblock, SIGINT); (void)sigaddset(&newsigblock, SIGQUIT); - (void)_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); + (void)__libc_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); switch(pid = vfork()) { + /* + * In the child, use unwrapped syscalls. libthr is in + * undefined state after vfork(). + */ case -1: /* error */ - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); return (-1); case 0: /* child */ /* * Restore original signal dispositions and exec the command. */ - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + (void)__sys_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL); _exit(127); } @@ -92,16 +96,16 @@ __libc_system(const char *command) memset(&ign, 0, sizeof(ign)); ign.sa_handler = SIG_IGN; (void)sigemptyset(&ign.sa_mask); - (void)_sigaction(SIGINT, &ign, &intact); - (void)_sigaction(SIGQUIT, &ign, &quitact); + (void)__libc_sigaction(SIGINT, &ign, &intact); + (void)__libc_sigaction(SIGQUIT, &ign, &quitact); savedpid = pid; do { pid = _wait4(savedpid, &pstat, 0, (struct rusage *)0); } while (pid == -1 && errno == EINTR); - (void)_sigaction(SIGINT, &intact, NULL); - (void)_sigaction(SIGQUIT, &quitact, NULL); - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); - return(pid == -1 ? -1 : pstat); + (void)__libc_sigaction(SIGINT, &intact, NULL); + (void)__libc_sigaction(SIGQUIT, &quitact, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + return (pid == -1 ? -1 : pstat); } __weak_reference(__libc_system, __system); Modified: head/lib/libc/sys/sigaction.c ============================================================================== --- head/lib/libc/sys/sigaction.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/sys/sigaction.c Sat Aug 29 14:25:01 2015 (r287292) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" __weak_reference(__sys_sigaction, __sigaction); +__weak_reference(sigaction, __libc_sigaction); #pragma weak sigaction int Modified: head/lib/libc/sys/sigprocmask.c ============================================================================== --- head/lib/libc/sys/sigprocmask.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/sys/sigprocmask.c Sat Aug 29 14:25:01 2015 (r287292) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" __weak_reference(__sys_sigprocmask, __sigprocmask); +__weak_reference(sigprocmask, __libc_sigprocmask); #pragma weak sigprocmask int Modified: head/lib/libc/sys/sigsuspend.c ============================================================================== --- head/lib/libc/sys/sigsuspend.c Sat Aug 29 13:44:27 2015 (r287291) +++ head/lib/libc/sys/sigsuspend.c Sat Aug 29 14:25:01 2015 (r287292) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" __weak_reference(__sys_sigsuspend, __sigsuspend); +__weak_reference(sigsuspend, __libc_sigsuspend); #pragma weak sigsuspend int From owner-svn-src-head@freebsd.org Sat Aug 29 15:33:33 2015 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 435799C369A; Sat, 29 Aug 2015 15:33:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 32B0DF4A; Sat, 29 Aug 2015 15:33:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7TFXWU1082569; Sat, 29 Aug 2015 15:33:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7TFXWZr082567; Sat, 29 Aug 2015 15:33:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508291533.t7TFXWZr082567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 29 Aug 2015 15:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287293 - head/sys/cam/ctl 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.20 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, 29 Aug 2015 15:33:33 -0000 Author: mav Date: Sat Aug 29 15:33:31 2015 New Revision: 287293 URL: https://svnweb.freebsd.org/changeset/base/287293 Log: Remove 600 bytes of port_priv from struct ctl_io_hdr. This field used only for camtgt frontend, and once it any way preallocates all requests, let it preallocate this memory too, not bothering core code. Modified: head/sys/cam/ctl/ctl_io.h head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Sat Aug 29 14:25:01 2015 (r287292) +++ head/sys/cam/ctl/ctl_io.h Sat Aug 29 15:33:31 2015 (r287293) @@ -173,35 +173,11 @@ union ctl_priv { #define CTL_PRIV_MODEPAGE 1 /* Modepage info for config write */ #define CTL_PRIV_BACKEND 2 /* Reserved for block, RAIDCore */ #define CTL_PRIV_BACKEND_LUN 3 /* Backend LUN pointer */ -#define CTL_PRIV_FRONTEND 4 /* LSI driver, ioctl front end */ -#define CTL_PRIV_USER 5 /* Userland use */ +#define CTL_PRIV_FRONTEND 4 /* Frontend storage */ +#define CTL_PRIV_FRONTEND2 5 /* Another frontend storage */ #define CTL_INVALID_PORTNAME 0xFF #define CTL_UNMAPPED_IID 0xFF -/* - * XXX KDM this size is for the port_priv variable in struct ctl_io_hdr - * below. This should be defined in terms of the size of struct - * ctlfe_lun_cmd_info at the moment: - * struct ctlfe_lun_cmd_info { - * int cur_transfer_index; - * ctlfe_cmd_flags flags; - * bus_dma_segment_t cam_sglist[32]; - * }; - * - * This isn't really the way I'd prefer to do it, but it does make some - * sense, AS LONG AS we can guarantee that there will always only be one - * outstanding DMA request per ctl_io. If that assumption isn't valid, - * then we've got problems. - * - * At some point it may be nice switch CTL over to using CCBs for - * everything. At that point we can probably use the ATIO/CTIO model, so - * that multiple simultaneous DMAs per command will just work. - * - * Also note that the current size, 600, is appropriate for 64-bit - * architectures, but is overkill for 32-bit architectures. Need a way to - * figure out the size at compile time, or just get rid of this altogether. - */ -#define CTL_PORT_PRIV_SIZE 600 struct ctl_sg_entry { void *addr; @@ -268,7 +244,6 @@ struct ctl_io_hdr { union ctl_io *serializing_sc; void *pool; /* I/O pool */ union ctl_priv ctl_private[CTL_NUM_PRIV];/* CTL private area */ - uint8_t port_priv[CTL_PORT_PRIV_SIZE];/* PORT private area*/ struct ctl_sg_entry remote_sglist[CTL_NUM_SG_ENTRIES]; struct ctl_sg_entry remote_dma_sglist[CTL_NUM_SG_ENTRIES]; struct ctl_sg_entry local_sglist[CTL_NUM_SG_ENTRIES]; Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Sat Aug 29 14:25:01 2015 (r287292) +++ head/sys/cam/ctl/scsi_ctl.c Sat Aug 29 15:33:31 2015 (r287293) @@ -119,11 +119,7 @@ typedef enum { CTLFE_CMD_PIECEWISE = 0x01 } ctlfe_cmd_flags; -/* - * The size limit of this structure is CTL_PORT_PRIV_SIZE, from ctl_io.h. - * Currently that is 600 bytes. - */ -struct ctlfe_lun_cmd_info { +struct ctlfe_cmd_info { int cur_transfer_index; size_t cur_transfer_off; ctlfe_cmd_flags flags; @@ -135,7 +131,6 @@ struct ctlfe_lun_cmd_info { #define CTLFE_MAX_SEGS 32 bus_dma_segment_t cam_sglist[CTLFE_MAX_SEGS]; }; -CTASSERT(sizeof(struct ctlfe_lun_cmd_info) <= CTL_PORT_PRIV_SIZE); /* * When we register the adapter/bus, request that this many ctl_ios be @@ -533,6 +528,7 @@ ctlferegister(struct cam_periph *periph, for (i = 0; i < CTLFE_ATIO_PER_LUN; i++) { union ccb *new_ccb; union ctl_io *new_io; + struct ctlfe_cmd_info *cmd_info; new_ccb = (union ccb *)malloc(sizeof(*new_ccb), M_CTLFE, M_ZERO|M_NOWAIT); @@ -546,6 +542,15 @@ ctlferegister(struct cam_periph *periph, status = CAM_RESRC_UNAVAIL; break; } + cmd_info = malloc(sizeof(*cmd_info), M_CTLFE, + M_ZERO | M_NOWAIT); + if (cmd_info == NULL) { + ctl_free_io(new_io); + free(new_ccb, M_CTLFE); + status = CAM_RESRC_UNAVAIL; + break; + } + new_io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr = cmd_info; softc->atios_alloced++; new_ccb->ccb_h.io_ptr = new_io; @@ -556,6 +561,7 @@ ctlferegister(struct cam_periph *periph, xpt_action(new_ccb); status = new_ccb->ccb_h.status; if ((status & CAM_STATUS_MASK) != CAM_REQ_INPROG) { + free(cmd_info, M_CTLFE); ctl_free_io(new_io); free(new_ccb, M_CTLFE); break; @@ -686,13 +692,13 @@ ctlfedata(struct ctlfe_lun_softc *softc, u_int16_t *sglist_cnt) { struct ctlfe_softc *bus_softc; - struct ctlfe_lun_cmd_info *cmd_info; + struct ctlfe_cmd_info *cmd_info; struct ctl_sg_entry *ctl_sglist; bus_dma_segment_t *cam_sglist; size_t off; int i, idx; - cmd_info = (struct ctlfe_lun_cmd_info *)io->io_hdr.port_priv; + cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; bus_softc = softc->parent_softc; /* @@ -768,7 +774,7 @@ static void ctlfestart(struct cam_periph *periph, union ccb *start_ccb) { struct ctlfe_lun_softc *softc; - struct ctlfe_lun_cmd_info *cmd_info; + struct ctlfe_cmd_info *cmd_info; struct ccb_hdr *ccb_h; struct ccb_accept_tio *atio; struct ccb_scsiio *csio; @@ -796,7 +802,7 @@ ctlfestart(struct cam_periph *periph, un flags = atio->ccb_h.flags & (CAM_DIS_DISCONNECT|CAM_TAG_ACTION_VALID|CAM_DIR_MASK); - cmd_info = (struct ctlfe_lun_cmd_info *)io->io_hdr.port_priv; + cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; cmd_info->cur_transfer_index = 0; cmd_info->cur_transfer_off = 0; cmd_info->flags = 0; @@ -968,12 +974,17 @@ static void ctlfe_free_ccb(struct cam_periph *periph, union ccb *ccb) { struct ctlfe_lun_softc *softc; + union ctl_io *io; + struct ctlfe_cmd_info *cmd_info; softc = (struct ctlfe_lun_softc *)periph->softc; + io = ccb->ccb_h.io_ptr; switch (ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: softc->atios_freed++; + cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + free(cmd_info, M_CTLFE); break; case XPT_IMMEDIATE_NOTIFY: case XPT_NOTIFY_ACKNOWLEDGE: @@ -983,7 +994,7 @@ ctlfe_free_ccb(struct cam_periph *periph break; } - ctl_free_io(ccb->ccb_h.io_ptr); + ctl_free_io(io); free(ccb, M_CTLFE); KASSERT(softc->atios_freed <= softc->atios_alloced, ("%s: " @@ -1078,6 +1089,7 @@ ctlfedone(struct cam_periph *periph, uni { struct ctlfe_lun_softc *softc; struct ctlfe_softc *bus_softc; + struct ctlfe_cmd_info *cmd_info; struct ccb_accept_tio *atio = NULL; union ctl_io *io = NULL; struct mtx *mtx; @@ -1139,10 +1151,12 @@ ctlfedone(struct cam_periph *periph, uni */ mtx_unlock(mtx); io = done_ccb->ccb_h.io_ptr; + cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; ctl_zero_io(io); /* Save pointers on both sides */ io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = done_ccb; + io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr = cmd_info; done_ccb->ccb_h.io_ptr = io; /* @@ -1291,12 +1305,11 @@ ctlfedone(struct cam_periph *periph, uni return; } } else { - struct ctlfe_lun_cmd_info *cmd_info; + struct ctlfe_cmd_info *cmd_info; struct ccb_scsiio *csio; csio = &done_ccb->csio; - cmd_info = (struct ctlfe_lun_cmd_info *) - io->io_hdr.port_priv; + cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG; From owner-svn-src-head@freebsd.org Sat Aug 29 17:26:30 2015 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 E51F79C4B2B; Sat, 29 Aug 2015 17:26:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 BBD80305; Sat, 29 Aug 2015 17:26:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7THQUCu027881; Sat, 29 Aug 2015 17:26:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7THQUcQ027878; Sat, 29 Aug 2015 17:26:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201508291726.t7THQUcQ027878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 29 Aug 2015 17:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287294 - 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.20 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, 29 Aug 2015 17:26:31 -0000 Author: tuexen Date: Sat Aug 29 17:26:29 2015 New Revision: 287294 URL: https://svnweb.freebsd.org/changeset/base/287294 Log: Use 5 times RTO.Max as the default for the shutdown guard timer as required by RFC 4960. The sysctl variable can be used to overwrite this. Discussed with: rrs MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sat Aug 29 15:33:31 2015 (r287293) +++ head/sys/netinet/sctp_constants.h Sat Aug 29 17:26:29 2015 (r287294) @@ -612,10 +612,6 @@ __FBSDID("$FreeBSD$"); /* 30 seconds + RTO (in ms) */ #define SCTP_HB_DEFAULT_MSEC 30000 -/* Max time I will wait for Shutdown to complete */ -#define SCTP_DEF_MAX_SHUTDOWN_SEC 180 - - /* * This is how long a secret lives, NOT how long a cookie lives how many * ticks the current secret will live. Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sat Aug 29 15:33:31 2015 (r287293) +++ head/sys/netinet/sctp_sysctl.h Sat Aug 29 17:26:29 2015 (r287294) @@ -291,10 +291,10 @@ struct sctp_sysctl { #define SCTPCTL_PMTU_RAISE_TIME_DEFAULT SCTP_DEF_PMTU_RAISE_SEC /* shutdown_guard_time: Default shutdown guard timer in seconds */ -#define SCTPCTL_SHUTDOWN_GUARD_TIME_DESC "Default shutdown guard timer in seconds" +#define SCTPCTL_SHUTDOWN_GUARD_TIME_DESC "Shutdown guard timer in seconds (0 means 5 times RTO.Max)" #define SCTPCTL_SHUTDOWN_GUARD_TIME_MIN 0 #define SCTPCTL_SHUTDOWN_GUARD_TIME_MAX 0xFFFFFFFF -#define SCTPCTL_SHUTDOWN_GUARD_TIME_DEFAULT SCTP_DEF_MAX_SHUTDOWN_SEC +#define SCTPCTL_SHUTDOWN_GUARD_TIME_DEFAULT 0 /* secret_lifetime: Default secret lifetime in seconds */ #define SCTPCTL_SECRET_LIFETIME_DESC "Default secret lifetime in seconds" Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Aug 29 15:33:31 2015 (r287293) +++ head/sys/netinet/sctputil.c Sat Aug 29 17:26:29 2015 (r287294) @@ -2123,7 +2123,11 @@ sctp_timer_start(int t_type, struct sctp if (stcb == NULL) { return; } - to_ticks = inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_MAXSHUTDOWN]; + if (inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_MAXSHUTDOWN] == 0) { + to_ticks = 5 * MSEC_TO_TICKS(stcb->asoc.maxrto); + } else { + to_ticks = inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_MAXSHUTDOWN]; + } tmr = &stcb->asoc.shut_guard_timer; break; case SCTP_TIMER_TYPE_STRRESET: From owner-svn-src-head@freebsd.org Sat Aug 29 18:37:11 2015 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 191509C5789; Sat, 29 Aug 2015 18:37:11 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 097C7763; Sat, 29 Aug 2015 18:37:11 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7TIbAHe056795; Sat, 29 Aug 2015 18:37:10 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7TIbAtu056792; Sat, 29 Aug 2015 18:37:10 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201508291837.t7TIbAtu056792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Sat, 29 Aug 2015 18:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287295 - in head/sys/dev/usb: . serial 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.20 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, 29 Aug 2015 18:37:11 -0000 Author: gavin Date: Sat Aug 29 18:37:09 2015 New Revision: 287295 URL: https://svnweb.freebsd.org/changeset/base/287295 Log: Support the ZTE MF112 HSUPA 3G USB stick. MFC after: 1 week Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sat Aug 29 17:26:29 2015 (r287294) +++ head/sys/dev/usb/serial/u3g.c Sat Aug 29 18:37:09 2015 (r287295) @@ -477,6 +477,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMMINC, E2003, 0), U3G_DEV(QUALCOMMINC, K3772_Z, 0), U3G_DEV(QUALCOMMINC, K3772_Z_INIT, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMMINC, MF112, U3GINIT_ZTESTOR), U3G_DEV(QUALCOMMINC, MF195E, 0), U3G_DEV(QUALCOMMINC, MF195E_INIT, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, MF626, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sat Aug 29 17:26:29 2015 (r287294) +++ head/sys/dev/usb/usbdevs Sat Aug 29 18:37:09 2015 (r287295) @@ -3683,6 +3683,7 @@ product QUALCOMMINC E0076 0x0076 3G mode product QUALCOMMINC E0078 0x0078 3G modem product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem +product QUALCOMMINC MF112 0x0103 3G modem product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick product QUALCOMMINC K3772_Z_INIT 0x1179 K3772-Z Initial product QUALCOMMINC K3772_Z 0x1181 K3772-Z From owner-svn-src-head@freebsd.org Sat Aug 29 19:41:49 2015 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 7BEF69C6DF9; Sat, 29 Aug 2015 19:41:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5FFC560; Sat, 29 Aug 2015 19:41:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7TJfn4S084832; Sat, 29 Aug 2015 19:41:49 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7TJfmvs084828; Sat, 29 Aug 2015 19:41:48 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201508291941.t7TJfmvs084828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 29 Aug 2015 19:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287296 - head/bin/sh 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.20 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, 29 Aug 2015 19:41:49 -0000 Author: jilles Date: Sat Aug 29 19:41:47 2015 New Revision: 287296 URL: https://svnweb.freebsd.org/changeset/base/287296 Log: sh: Add set -o nolog. POSIX requires this to prevent entering function definitions in history but this implementation does nothing except retain the option's value. In ksh88, function definitions were usually entered in the history file, even when they came from ~/.profile and the $ENV file, to allow displaying their definitions. This is also the first option that does not have a letter. Modified: head/bin/sh/expand.c head/bin/sh/options.c head/bin/sh/options.h head/bin/sh/sh.1 Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sat Aug 29 18:37:09 2015 (r287295) +++ head/bin/sh/expand.c Sat Aug 29 19:41:47 2015 (r287296) @@ -886,7 +886,7 @@ varvalue(const char *name, int quoted, i num = backgndpidval(); break; case '-': - for (i = 0 ; i < NOPTS ; i++) { + for (i = 0 ; i < NSHORTOPTS ; i++) { if (optlist[i].val) STPUTC(optlist[i].letter, expdest); } Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Sat Aug 29 18:37:09 2015 (r287295) +++ head/bin/sh/options.c Sat Aug 29 19:41:47 2015 (r287296) @@ -302,7 +302,7 @@ setoption(int flag, int val) { int i; - for (i = 0; i < NOPTS; i++) + for (i = 0; i < NSHORTOPTS; i++) if (optlist[i].letter == flag) { setoptionbyindex(i, val); return; Modified: head/bin/sh/options.h ============================================================================== --- head/bin/sh/options.h Sat Aug 29 18:37:09 2015 (r287295) +++ head/bin/sh/options.h Sat Aug 29 19:41:47 2015 (r287296) @@ -64,8 +64,10 @@ struct shparam { #define Tflag optlist[16].val #define Pflag optlist[17].val #define hflag optlist[18].val +#define nologflag optlist[19].val -#define NOPTS 19 +#define NSHORTOPTS 19 +#define NOPTS 20 struct optent { const char *name; @@ -95,6 +97,7 @@ struct optent optlist[NOPTS] = { { "trapsasync", 'T', 0 }, { "physical", 'P', 0 }, { "trackall", 'h', 0 }, + { "nolog", '\0', 0 }, }; #endif Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sat Aug 29 18:37:09 2015 (r287295) +++ head/bin/sh/sh.1 Sat Aug 29 19:41:47 2015 (r287296) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd July 11, 2015 +.Dd August 29, 2015 .Dt SH 1 .Os .Sh NAME @@ -343,6 +343,11 @@ Write each command variable subjected to parameter expansion and arithmetic expansion) to standard error before it is executed. Useful for debugging. +.It nolog +Another do-nothing option for +.Tn POSIX +compliance. +It only has a long name. .El .Pp The @@ -1173,7 +1178,9 @@ The only special parameter that can be m .Ql - . Making .Ql - -local causes any shell options that are +local causes any shell options +(including those that only have long names) +that are changed via the .Ic set command inside the function to be From owner-svn-src-head@freebsd.org Sat Aug 29 19:47:28 2015 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 8DBA39C6F6E; Sat, 29 Aug 2015 19:47:28 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 7565126F; Sat, 29 Aug 2015 19:47:28 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7TJlSS0085144; Sat, 29 Aug 2015 19:47:28 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7TJlLvY085117; Sat, 29 Aug 2015 19:47:21 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201508291947.t7TJlLvY085117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sat, 29 Aug 2015 19:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287297 - in head/tools: regression/lib/msun regression/p1003_1b tools/ath/athaggrstats tools/ath/athdebug tools/ath/athrd tools/ath/athstats tools/ath/common tools/crypto tools/cxgbeto... 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.20 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, 29 Aug 2015 19:47:28 -0000 Author: rodrigc Date: Sat Aug 29 19:47:20 2015 New Revision: 287297 URL: https://svnweb.freebsd.org/changeset/base/287297 Log: - Replace N(a)/N(i)/N(T)/LEN(a)/ARRAY_SIZE(a) with nitems() - Add missing for err() and for sysctlbyname() - NULL -> 0 for 5th parameter of sysctlbyname() Submitted by: Andriy Voskoboinyk Differential Revision: https://reviews.freebsd.org/D3442 Modified: head/tools/regression/lib/msun/test-cexp.c head/tools/regression/lib/msun/test-csqrt.c head/tools/regression/lib/msun/test-invtrig.c head/tools/regression/lib/msun/test-trig.c head/tools/regression/p1003_1b/main.c head/tools/tools/ath/athaggrstats/athaggrstats.c head/tools/tools/ath/athaggrstats/main.c head/tools/tools/ath/athdebug/athdebug.c head/tools/tools/ath/athrd/athrd.c head/tools/tools/ath/athstats/athstats.c head/tools/tools/ath/athstats/main.c head/tools/tools/ath/common/ah_osdep.h head/tools/tools/ath/common/dumpregs_5210.c head/tools/tools/ath/common/dumpregs_5211.c head/tools/tools/ath/common/dumpregs_5212.c head/tools/tools/ath/common/dumpregs_5416.c head/tools/tools/crypto/cryptostats.c head/tools/tools/crypto/cryptotest.c head/tools/tools/crypto/hifnstats.c head/tools/tools/crypto/ipsecstats.c head/tools/tools/crypto/safestats.c head/tools/tools/crypto/ubsecstats.c head/tools/tools/cxgbetool/cxgbetool.c head/tools/tools/mwl/mwldebug/mwldebug.c head/tools/tools/mwl/mwlstats/mwlstats.c head/tools/tools/net80211/wlanstats/main.c head/tools/tools/net80211/wlanstats/wlanstats.c head/tools/tools/net80211/wlantxtime/wlantxtime.c head/tools/tools/npe/npestats/main.c head/tools/tools/npe/npestats/npestats.c Modified: head/tools/regression/lib/msun/test-cexp.c ============================================================================== --- head/tools/regression/lib/msun/test-cexp.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/regression/lib/msun/test-cexp.c Sat Aug 29 19:47:20 2015 (r287297) @@ -31,6 +31,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -40,8 +42,6 @@ __FBSDID("$FreeBSD$"); #include "test-utils.h" -#define N(i) (sizeof(i) / sizeof((i)[0])) - #pragma STDC FENV_ACCESS ON #pragma STDC CX_LIMITED_RANGE OFF @@ -116,7 +116,7 @@ test_nan() /* cexp(x + NaNi) = NaN + NaNi and optionally raises invalid */ /* cexp(NaN + yi) = NaN + NaNi and optionally raises invalid (|y|>0) */ - for (i = 0; i < N(finites); i++) { + for (i = 0; i < nitems(finites); i++) { printf("# Run %d..\n", i); testall(CMPLXL(finites[i], NAN), CMPLXL(NAN, NAN), ALL_STD_EXCEPT & ~FE_INVALID, 0, 0); @@ -148,7 +148,7 @@ test_inf(void) int i; /* cexp(x + inf i) = NaN + NaNi and raises invalid */ - for (i = 0; i < N(finites); i++) { + for (i = 0; i < nitems(finites); i++) { printf("# Run %d..\n", i); testall(CMPLXL(finites[i], INFINITY), CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 1); @@ -189,7 +189,7 @@ test_reals(void) { int i; - for (i = 0; i < N(finites); i++) { + for (i = 0; i < nitems(finites); i++) { /* XXX could check exceptions more meticulously */ printf("# Run %d..\n", i); test(cexp, CMPLXL(finites[i], 0.0), @@ -212,7 +212,7 @@ test_imaginaries(void) { int i; - for (i = 0; i < N(finites); i++) { + for (i = 0; i < nitems(finites); i++) { printf("# Run %d..\n", i); test(cexp, CMPLXL(0.0, finites[i]), CMPLXL(cos(finites[i]), sin(finites[i])), @@ -244,7 +244,7 @@ test_small(void) double x, y; int i; - for (i = 0; i < N(tests); i += 4) { + for (i = 0; i < nitems(tests); i += 4) { printf("# Run %d..\n", i); a = tests[i]; b = tests[i + 1]; Modified: head/tools/regression/lib/msun/test-csqrt.c ============================================================================== --- head/tools/regression/lib/msun/test-csqrt.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/regression/lib/msun/test-csqrt.c Sat Aug 29 19:47:20 2015 (r287297) @@ -31,6 +31,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -39,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include "test-utils.h" -#define N(i) (sizeof(i) / sizeof((i)[0])) - /* * This is a test hook that can point to csqrtl(), _csqrt(), or to _csqrtf(). * The latter two convert to float or double, respectively, and test csqrtf() @@ -127,8 +127,8 @@ test_finite() double x, y; int i, j; - for (i = 0; i < N(tests); i += 4) { - for (j = 0; j < N(mults); j++) { + for (i = 0; i < nitems(tests); i += 4) { + for (j = 0; j < nitems(mults); j++) { a = tests[i] * mults[j] * mults[j]; b = tests[i + 1] * mults[j] * mults[j]; x = tests[i + 2] * mults[j]; @@ -169,7 +169,7 @@ test_infinities() int i; - for (i = 0; i < N(vals); i++) { + for (i = 0; i < nitems(vals); i++) { if (isfinite(vals[i])) { assert_equal(t_csqrt(CMPLXL(-INFINITY, vals[i])), CMPLXL(0.0, copysignl(INFINITY, vals[i]))); Modified: head/tools/regression/lib/msun/test-invtrig.c ============================================================================== --- head/tools/regression/lib/msun/test-invtrig.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/regression/lib/msun/test-invtrig.c Sat Aug 29 19:47:20 2015 (r287297) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include "test-utils.h" -#define LEN(a) (sizeof(a) / sizeof((a)[0])) - #pragma STDC FENV_ACCESS ON /* Modified: head/tools/regression/lib/msun/test-trig.c ============================================================================== --- head/tools/regression/lib/msun/test-trig.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/regression/lib/msun/test-trig.c Sat Aug 29 19:47:20 2015 (r287297) @@ -36,6 +36,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -44,8 +46,6 @@ __FBSDID("$FreeBSD$"); #include "test-utils.h" -#define LEN(a) (sizeof(a) / sizeof((a)[0])) - #pragma STDC FENV_ACCESS ON /* @@ -155,7 +155,7 @@ run_reduction_tests(void) int i; - for (i = 0; i < LEN(f_pi_odd); i++) { + for (i = 0; i < nitems(f_pi_odd); i++) { assert(fabs(sinf(f_pi_odd[i])) < FLT_EPSILON); assert(cosf(f_pi_odd[i]) == -1.0); assert(fabs(tan(f_pi_odd[i])) < FLT_EPSILON); @@ -173,7 +173,7 @@ run_reduction_tests(void) assert(fabs(tanf(-f_pi_odd[i] * 2)) < FLT_EPSILON); } - for (i = 0; i < LEN(d_pi_odd); i++) { + for (i = 0; i < nitems(d_pi_odd); i++) { assert(fabs(sin(d_pi_odd[i])) < 2 * DBL_EPSILON); assert(cos(d_pi_odd[i]) == -1.0); assert(fabs(tan(d_pi_odd[i])) < 2 * DBL_EPSILON); @@ -192,7 +192,7 @@ run_reduction_tests(void) } #if LDBL_MANT_DIG > 53 - for (i = 0; i < LEN(ld_pi_odd); i++) { + for (i = 0; i < nitems(ld_pi_odd); i++) { assert(fabsl(sinl(ld_pi_odd[i])) < LDBL_EPSILON); assert(cosl(ld_pi_odd[i]) == -1.0); assert(fabsl(tanl(ld_pi_odd[i])) < LDBL_EPSILON); Modified: head/tools/regression/p1003_1b/main.c ============================================================================== --- head/tools/regression/p1003_1b/main.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/regression/p1003_1b/main.c Sat Aug 29 19:47:20 2015 (r287297) @@ -1,4 +1,7 @@ /* $FreeBSD$ */ + +#include + #include #include @@ -20,8 +23,6 @@ static struct { { "yield", yield, 1 }, }; -#define N(T) (sizeof (T)/ sizeof(T[0])) - static int usage(int argc, char *argv[]) { int i; @@ -47,14 +48,14 @@ int main(int argc, char *argv[]) " (my notes say \"because things detach\");\n" "meanwhile do these individual tests and look" " for a non-zero exit code:\n"); - for (i = 0; i < N(tab); i++) + for (i = 0; i < nitems(tab); i++) if (tab[i].works) fprintf(stderr, "p1003_1b %s\n", tab[i].t); return -1; #else { int r; - for (i = 0; i < N(tab); i++) { + for (i = 0; i < nitems(tab); i++) { if (tab[i].works) { if ( (r = (*tab[i].f)(argc - 1, argv + 1)) ) { @@ -70,7 +71,7 @@ int main(int argc, char *argv[]) } if (argc > 1) { - for (i = 0; i < N(tab); i++) + for (i = 0; i < nitems(tab); i++) if (strcmp(tab[i].t, argv[1]) == 0) return (*tab[i].f)(argc - 1, argv + 1); } Modified: head/tools/tools/ath/athaggrstats/athaggrstats.c ============================================================================== --- head/tools/tools/ath/athaggrstats/athaggrstats.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/ath/athaggrstats/athaggrstats.c Sat Aug 29 19:47:20 2015 (r287297) @@ -29,6 +29,8 @@ * $FreeBSD$ */ +#include + #include "opt_ah.h" /* @@ -368,13 +370,12 @@ BSDSTAT_DEFINE_BOUNCE(athaggrstatfoo) struct athaggrstatfoo * athaggrstats_new(const char *ifname, const char *fmtstring) { -#define N(a) (sizeof(a) / sizeof(a[0])) struct athaggrstatfoo_p *wf; wf = calloc(1, sizeof(struct athaggrstatfoo_p)); if (wf != NULL) { bsdstat_init(&wf->base.base, "athaggrstats", - athaggrstats, N(athaggrstats)); + athaggrstats, nitems(athaggrstats)); /* override base methods */ wf->base.base.collect_cur = ath_collect_cur; wf->base.base.collect_tot = ath_collect_tot; @@ -400,5 +401,4 @@ athaggrstats_new(const char *ifname, con wf->base.setfmt(&wf->base, fmtstring); } return &wf->base; -#undef N } Modified: head/tools/tools/ath/athaggrstats/main.c ============================================================================== --- head/tools/tools/ath/athaggrstats/main.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/ath/athaggrstats/main.c Sat Aug 29 19:47:20 2015 (r287297) @@ -42,12 +42,14 @@ * print a list of all possible statistics for use with the -o option. */ +#include + +#include +#include #include #include -#include -#include #include -#include +#include #include "athaggrstats.h" @@ -63,13 +65,11 @@ static struct { static const char * getfmt(const char *tag) { -#define N(a) (sizeof(a)/sizeof(a[0])) int i; - for (i = 0; i < N(tags); i++) + for (i = 0; i < nitems(tags); i++) if (strcasecmp(tags[i].tag, tag) == 0) return tags[i].fmt; return tag; -#undef N } static int signalled; Modified: head/tools/tools/ath/athdebug/athdebug.c ============================================================================== --- head/tools/tools/ath/athdebug/athdebug.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/ath/athdebug/athdebug.c Sat Aug 29 19:47:20 2015 (r287297) @@ -33,21 +33,20 @@ * athdebug [-i interface] flags * (default interface is ath0). */ -#include + +#include #include #include #include #include -#include #include +#include #include +#include #include #include #include -#include - -#define N(a) (sizeof(a)/sizeof(a[0])) const char *progname; @@ -115,7 +114,7 @@ getflag(const char *name, int len) { int i; - for (i = 0; i < N(flags); i++) + for (i = 0; i < nitems(flags); i++) if (strncasecmp(flags[i].name, name, len) == 0) return flags[i].bit; return 0; @@ -126,7 +125,7 @@ getflagname(u_int flag) { int i; - for (i = 0; i < N(flags); i++) + for (i = 0; i < nitems(flags); i++) if (flags[i].bit == flag) return flags[i].name; return "???"; @@ -139,7 +138,7 @@ usage(void) fprintf(stderr, "usage: %s [-i device] [flags]\n", progname); fprintf(stderr, "where flags are:\n"); - for (i = 0; i < N(flags); i++) + for (i = 0; i < nitems(flags); i++) printf("%s\n", flags[i].name); exit(-1); } @@ -221,7 +220,7 @@ main(int argc, char *argv[]) } else printf("%s: 0x%llx", oid, (long long) debug); sep = "<"; - for (i = 0; i < N(flags); i++) + for (i = 0; i < nitems(flags); i++) if (debug & flags[i].bit) { printf("%s%s", sep, flags[i].name); sep = ","; Modified: head/tools/tools/ath/athrd/athrd.c ============================================================================== --- head/tools/tools/ath/athrd/athrd.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/ath/athrd/athrd.c Sat Aug 29 19:47:20 2015 (r287297) @@ -32,18 +32,20 @@ #include "ah.h" +#include + #include #include #include "ah_internal.h" #include "ah_eeprom_v3.h" /* XXX */ +#include +#include #include #include -#include #include #include -#include int ath_hal_debug = 0; HAL_CTRY_CODE cc = CTRY_DEFAULT; @@ -535,43 +537,37 @@ static struct { static HAL_BOOL rdlookup(const char *name, HAL_REG_DOMAIN *rd) { -#define N(a) (sizeof(a)/sizeof(a[0])) int i; - for (i = 0; i < N(domains); i++) + for (i = 0; i < nitems(domains); i++) if (strcasecmp(domains[i].name, name) == 0) { *rd = domains[i].rd; return AH_TRUE; } return AH_FALSE; -#undef N } static const char * getrdname(HAL_REG_DOMAIN rd) { -#define N(a) (sizeof(a)/sizeof(a[0])) int i; - for (i = 0; i < N(domains); i++) + for (i = 0; i < nitems(domains); i++) if (domains[i].rd == rd) return domains[i].name; return NULL; -#undef N } static void rdlist() { -#define N(a) (sizeof(a)/sizeof(a[0])) int i; printf("\nRegulatory domains:\n\n"); - for (i = 0; i < N(domains); i++) + for (i = 0; i < nitems(domains); i++) printf("%-15s%s", domains[i].name, ((i+1)%5) == 0 ? "\n" : ""); printf("\n"); -#undef N } typedef struct { @@ -728,10 +724,9 @@ static COUNTRY_CODE_TO_ENUM_RD allCountr static HAL_BOOL cclookup(const char *name, HAL_REG_DOMAIN *rd, HAL_CTRY_CODE *cc) { -#define N(a) (sizeof(a)/sizeof(a[0])) int i; - for (i = 0; i < N(allCountries); i++) + for (i = 0; i < nitems(allCountries); i++) if (strcasecmp(allCountries[i].isoName, name) == 0 || strcasecmp(allCountries[i].name, name) == 0) { *rd = allCountries[i].regDmnEnum; @@ -739,49 +734,42 @@ cclookup(const char *name, HAL_REG_DOMAI return AH_TRUE; } return AH_FALSE; -#undef N } static const char * getccname(HAL_CTRY_CODE cc) { -#define N(a) (sizeof(a)/sizeof(a[0])) int i; - for (i = 0; i < N(allCountries); i++) + for (i = 0; i < nitems(allCountries); i++) if (allCountries[i].countryCode == cc) return allCountries[i].name; return NULL; -#undef N } static const char * getccisoname(HAL_CTRY_CODE cc) { -#define N(a) (sizeof(a)/sizeof(a[0])) int i; - for (i = 0; i < N(allCountries); i++) + for (i = 0; i < nitems(allCountries); i++) if (allCountries[i].countryCode == cc) return allCountries[i].isoName; return NULL; -#undef N } static void cclist() { -#define N(a) (sizeof(a)/sizeof(a[0])) int i; printf("\nCountry codes:\n"); - for (i = 0; i < N(allCountries); i++) + for (i = 0; i < nitems(allCountries); i++) printf("%2s %-15.15s%s", allCountries[i].isoName, allCountries[i].name, ((i+1)%4) == 0 ? "\n" : " "); printf("\n"); -#undef N } static HAL_BOOL Modified: head/tools/tools/ath/athstats/athstats.c ============================================================================== --- head/tools/tools/ath/athstats/athstats.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/ath/athstats/athstats.c Sat Aug 29 19:47:20 2015 (r287297) @@ -34,20 +34,22 @@ /* * ath statistics class. */ -#include + +#include #include #include #include + #include #include #include +#include +#include #include #include -#include #include #include -#include #include "ah.h" #include "ah_desc.h" @@ -1058,12 +1060,12 @@ BSDSTAT_DEFINE_BOUNCE(athstatfoo) struct athstatfoo * athstats_new(const char *ifname, const char *fmtstring) { -#define N(a) (sizeof(a) / sizeof(a[0])) struct athstatfoo_p *wf; wf = calloc(1, sizeof(struct athstatfoo_p)); if (wf != NULL) { - bsdstat_init(&wf->base.base, "athstats", athstats, N(athstats)); + bsdstat_init(&wf->base.base, "athstats", athstats, + nitems(athstats)); /* override base methods */ wf->base.base.collect_cur = ath_collect_cur; wf->base.base.collect_tot = ath_collect_tot; @@ -1089,5 +1091,4 @@ athstats_new(const char *ifname, const c wf->base.setfmt(&wf->base, fmtstring); } return &wf->base; -#undef N } Modified: head/tools/tools/ath/athstats/main.c ============================================================================== --- head/tools/tools/ath/athstats/main.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/ath/athstats/main.c Sat Aug 29 19:47:20 2015 (r287297) @@ -41,12 +41,14 @@ * print a list of all possible statistics for use with the -o option. */ +#include + +#include +#include #include #include -#include -#include #include -#include +#include #include "athstats.h" @@ -68,13 +70,11 @@ static struct { static const char * getfmt(const char *tag) { -#define N(a) (sizeof(a)/sizeof(a[0])) int i; - for (i = 0; i < N(tags); i++) + for (i = 0; i < nitems(tags); i++) if (strcasecmp(tags[i].tag, tag) == 0) return tags[i].fmt; return tag; -#undef N } static int signalled; Modified: head/tools/tools/ath/common/ah_osdep.h ============================================================================== --- head/tools/tools/ath/common/ah_osdep.h Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/ath/common/ah_osdep.h Sat Aug 29 19:47:20 2015 (r287297) @@ -35,6 +35,8 @@ */ #include +#include + /* * Bus i/o type definitions. */ Modified: head/tools/tools/ath/common/dumpregs_5210.c ============================================================================== --- head/tools/tools/ath/common/dumpregs_5210.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/ath/common/dumpregs_5210.c Sat Aug 29 19:47:20 2015 (r287297) @@ -28,6 +28,9 @@ * * $FreeBSD$ */ + +#include + #include "diag.h" #include "ah.h" @@ -37,8 +40,6 @@ #include "dumpregs.h" -#define N(a) (sizeof(a) / sizeof(a[0])) - static struct dumpreg ar5210regs[] = { DEFBASIC(AR_TXDP0, "TXDP0"), DEFBASIC(AR_TXDP1, "TXDP1"), @@ -118,7 +119,7 @@ static __constructor void ar5210_ctor(void) { #define MAC5210 SREV(1,0), SREV(2,0) - register_regs(ar5210regs, N(ar5210regs), MAC5210, PHYANY); + register_regs(ar5210regs, nitems(ar5210regs), MAC5210, PHYANY); register_keycache(64, MAC5210, PHYANY); register_range(0x9800, 0x9840, DUMP_BASEBAND, MAC5210, PHYANY); Modified: head/tools/tools/ath/common/dumpregs_5211.c ============================================================================== --- head/tools/tools/ath/common/dumpregs_5211.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/ath/common/dumpregs_5211.c Sat Aug 29 19:47:20 2015 (r287297) @@ -28,6 +28,9 @@ * * $FreeBSD$ */ + +#include + #include "diag.h" #include "ah.h" @@ -37,8 +40,6 @@ #include "dumpregs.h" -#define N(a) (sizeof(a) / sizeof(a[0])) - static struct dumpreg ar5211regs[] = { DEFBASICfmt(AR_CR, "CR", AR_CR_BITS), DEFBASIC(AR_RXDP, "RXDP"), @@ -284,7 +285,7 @@ static __constructor void ar5211_ctor(void) { #define MAC5211 SREV(2,0), SREV(4,5) - register_regs(ar5211regs, N(ar5211regs), MAC5211, PHYANY); + register_regs(ar5211regs, nitems(ar5211regs), MAC5211, PHYANY); register_keycache(128, MAC5211, PHYANY); register_range(0x9800, 0x987c, DUMP_BASEBAND, MAC5211, PHYANY); Modified: head/tools/tools/ath/common/dumpregs_5212.c ============================================================================== --- head/tools/tools/ath/common/dumpregs_5212.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/ath/common/dumpregs_5212.c Sat Aug 29 19:47:20 2015 (r287297) @@ -28,6 +28,9 @@ * * $FreeBSD$ */ + +#include + #include "diag.h" #include "ah.h" @@ -37,8 +40,6 @@ #include "dumpregs.h" -#define N(a) (sizeof(a) / sizeof(a[0])) - #define MAC5212 SREV(4,5), SREV(16,0) #define MAC5213 SREV(5,9), SREV(16,0) @@ -421,7 +422,7 @@ static struct dumpreg ar5212regs[] = { static __constructor void ar5212_ctor(void) { - register_regs(ar5212regs, N(ar5212regs), MAC5212, PHYANY); + register_regs(ar5212regs, nitems(ar5212regs), MAC5212, PHYANY); register_keycache(128, MAC5212, PHYANY); register_range(0x9800, 0x987c, DUMP_BASEBAND, MAC5212, PHYANY); Modified: head/tools/tools/ath/common/dumpregs_5416.c ============================================================================== --- head/tools/tools/ath/common/dumpregs_5416.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/ath/common/dumpregs_5416.c Sat Aug 29 19:47:20 2015 (r287297) @@ -28,6 +28,9 @@ * * $FreeBSD$ */ + +#include + #include "diag.h" #include "ah.h" @@ -37,8 +40,6 @@ #include "dumpregs.h" -#define N(a) (sizeof(a) / sizeof(a[0])) - #define MAC5416 SREV(13,8), SREV(0xffff,0xffff) /* XXX */ static struct dumpreg ar5416regs[] = { @@ -406,7 +407,7 @@ static struct dumpreg ar5416regs[] = { static __constructor void ar5416_ctor(void) { - register_regs(ar5416regs, N(ar5416regs), MAC5416, PHYANY); + register_regs(ar5416regs, nitems(ar5416regs), MAC5416, PHYANY); register_keycache(128, MAC5416, PHYANY); register_range(0x9800, 0x987c, DUMP_BASEBAND, MAC5416, PHYANY); Modified: head/tools/tools/crypto/cryptostats.c ============================================================================== --- head/tools/tools/crypto/cryptostats.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/crypto/cryptostats.c Sat Aug 29 19:47:20 2015 (r287297) @@ -30,15 +30,19 @@ * Little program to dump the crypto statistics block and, optionally, * zero all the stats or just the timing stuff. */ -#include -#include -#include #include #include #include + #include +#include +#include +#include +#include +#include + static void printt(const char* tag, struct cryptotstat *ts) { Modified: head/tools/tools/crypto/cryptotest.c ============================================================================== --- head/tools/tools/crypto/cryptotest.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/crypto/cryptotest.c Sat Aug 29 19:47:20 2015 (r287297) @@ -82,25 +82,25 @@ * Expect ~400 Mb/s for a Broadcom 582x for 8K buffers on a reasonable CPU * (64-bit PCI helps). Hifn 7811 parts top out at ~110 Mb/s. */ -#include + #include -#include #include -#include -#include -#include -#include #include +#include +#include +#include + +#include +#include #include +#include #include #include +#include -#include -#include #include #define CHUNK 64 /* how much to display */ -#define N(a) (sizeof (a) / sizeof (a[0])) #define streq(a,b) (strcasecmp(a,b) == 0) void hexdump(char *, int); @@ -164,7 +164,7 @@ getalgbycode(int cipher) { int i; - for (i = 0; i < N(algorithms); i++) + for (i = 0; i < nitems(algorithms); i++) if (cipher == algorithms[i].code) return &algorithms[i]; return NULL; @@ -175,7 +175,7 @@ getalgbyname(const char* name) { int i; - for (i = 0; i < N(algorithms); i++) + for (i = 0; i < nitems(algorithms); i++) if (streq(name, algorithms[i].name)) return &algorithms[i]; return NULL; @@ -239,7 +239,7 @@ rdigit(void) 0x10,0x54,0x11,0x48,0x45,0x12,0x4f,0x13,0x49,0x53,0x14,0x41, 0x15,0x16,0x4e,0x55,0x54,0x17,0x18,0x4a,0x4f,0x42,0x19,0x01 }; - return 0x20+a[random()%N(a)]; + return 0x20+a[random()%nitems(a)]; } static void @@ -298,7 +298,7 @@ runtest(struct alg *alg, int count, int for (i = 0; i < size; i++) cleartext[i] = rdigit(); memcpy(originaltext, cleartext, size); - for (i = 0; i < N(iv); i++) + for (i = 0; i < nitems(iv); i++) iv[i] = rdigit(); if (verbose) { @@ -569,7 +569,7 @@ main(int argc, char **argv) count = atoi(argv[0]); while (argc > 1) { int s = atoi(argv[1]); - if (nsizes < N(sizes)) { + if (nsizes < nitems(sizes)) { sizes[nsizes++] = s; } else { printf("Too many sizes, ignoring %u\n", s); @@ -590,7 +590,7 @@ main(int argc, char **argv) } if (testall) { - for (i = 0; i < N(algorithms); i++) { + for (i = 0; i < nitems(algorithms); i++) { int j; alg = &algorithms[i]; for (j = 0; j < nsizes; j++) Modified: head/tools/tools/crypto/hifnstats.c ============================================================================== --- head/tools/tools/crypto/hifnstats.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/crypto/hifnstats.c Sat Aug 29 19:47:20 2015 (r287297) @@ -25,8 +25,13 @@ * * $FreeBSD$ */ -#include + #include +#include + +#include +#include + #include "../../../sys/dev/hifn/hifn7751var.h" /* @@ -39,7 +44,7 @@ main(int argc, char *argv[]) size_t slen; slen = sizeof (stats); - if (sysctlbyname("hw.hifn.stats", &stats, &slen, NULL, NULL) < 0) + if (sysctlbyname("hw.hifn.stats", &stats, &slen, NULL, 0) < 0) err(1, "kern.hifn.stats"); printf("input %llu bytes %u packets\n", Modified: head/tools/tools/crypto/ipsecstats.c ============================================================================== --- head/tools/tools/crypto/ipsecstats.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/crypto/ipsecstats.c Sat Aug 29 19:47:20 2015 (r287297) @@ -25,10 +25,15 @@ * * $FreeBSD$ */ -#include + +#include +#include + #include #include #include + +#include #include #include @@ -62,7 +67,6 @@ static const struct alg ipcompalgs[] = { { SADB_X_CALG_DEFLATE, "deflate", }, { SADB_X_CALG_LZS, "lzs", }, }; -#define N(a) (sizeof(a)/sizeof(a[0])) static const char* algname(int a, const struct alg algs[], int nalgs) @@ -91,13 +95,13 @@ main(int argc, char *argv[]) int i; slen = sizeof (ips); - if (sysctlbyname("net.inet.ipsec.ipsecstats", &ips, &slen, NULL, NULL) < 0) + if (sysctlbyname("net.inet.ipsec.ipsecstats", &ips, &slen, NULL, 0) < 0) err(1, "net.inet.ipsec.ipsecstats"); slen = sizeof (ahs); - if (sysctlbyname("net.inet.ah.stats", &ahs, &slen, NULL, NULL) < 0) + if (sysctlbyname("net.inet.ah.stats", &ahs, &slen, NULL, 0) < 0) err(1, "net.inet.ah.stats"); slen = sizeof (esps); - if (sysctlbyname("net.inet.esp.stats", &esps, &slen, NULL, NULL) < 0) + if (sysctlbyname("net.inet.esp.stats", &esps, &slen, NULL, 0) < 0) err(1, "net.inet.esp.stats"); #define AHSTAT(x,fmt) if (x) printf("ah " fmt ": %ju\n", (uintmax_t)x) @@ -121,7 +125,7 @@ main(int argc, char *argv[]) for (i = 0; i < AH_ALG_MAX; i++) if (ahs.ahs_hist[i]) printf("ah packets with %s: %ju\n" - , algname(i, aalgs, N(aalgs)) + , algname(i, aalgs, nitems(aalgs)) , (uintmax_t)ahs.ahs_hist[i] ); AHSTAT(ahs.ahs_ibytes, "bytes received"); @@ -150,7 +154,7 @@ main(int argc, char *argv[]) for (i = 0; i < ESP_ALG_MAX; i++) if (esps.esps_hist[i]) printf("esp packets with %s: %ju\n" - , algname(i, espalgs, N(espalgs)) + , algname(i, espalgs, nitems(espalgs)) , (uintmax_t)esps.esps_hist[i] ); ESPSTAT(esps.esps_ibytes, "bytes received"); Modified: head/tools/tools/crypto/safestats.c ============================================================================== --- head/tools/tools/crypto/safestats.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/crypto/safestats.c Sat Aug 29 19:47:20 2015 (r287297) @@ -25,8 +25,13 @@ * * $FreeBSD$ */ -#include + #include +#include + +#include +#include + #include "../../../sys/dev/safe/safevar.h" /* @@ -39,7 +44,7 @@ main(int argc, char *argv[]) size_t slen; slen = sizeof (stats); - if (sysctlbyname("hw.safe.stats", &stats, &slen, NULL, NULL) < 0) + if (sysctlbyname("hw.safe.stats", &stats, &slen, NULL, 0) < 0) err(1, "hw.safe.stats"); printf("input %llu bytes %u packets\n", Modified: head/tools/tools/crypto/ubsecstats.c ============================================================================== --- head/tools/tools/crypto/ubsecstats.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/crypto/ubsecstats.c Sat Aug 29 19:47:20 2015 (r287297) @@ -25,8 +25,13 @@ * * $FreeBSD$ */ -#include + #include +#include + +#include +#include + #include "../../../sys/dev/ubsec/ubsecvar.h" /* @@ -39,7 +44,7 @@ main(int argc, char *argv[]) size_t slen; slen = sizeof (stats); - if (sysctlbyname("hw.ubsec.stats", &stats, &slen, NULL, NULL) < 0) + if (sysctlbyname("hw.ubsec.stats", &stats, &slen, NULL, 0) < 0) err(1, "kern.ubsec_stats"); printf("input %llu bytes %u packets\n", Modified: head/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- head/tools/tools/cxgbetool/cxgbetool.c Sat Aug 29 19:41:47 2015 (r287296) +++ head/tools/tools/cxgbetool/cxgbetool.c Sat Aug 29 19:47:20 2015 (r287297) @@ -28,29 +28,30 @@ #include __FBSDID("$FreeBSD$"); -#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 #include "t4_ioctl.h" -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) #define in_range(val, lo, hi) ( val < 0 || (val <= hi && val >= lo)) #define max(x, y) ((x) > (y) ? (x) : (y)) @@ -345,7 +346,7 @@ dump_regs_t4(int argc, const char *argv[ T4_MODREGS(xgmac) }; - return dump_regs_table(argc, argv, regs, t4_mod, ARRAY_SIZE(t4_mod)); + return dump_regs_table(argc, argv, regs, t4_mod, nitems(t4_mod)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***