From owner-svn-src-projects@FreeBSD.ORG Sun Jun 17 00:23:48 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D088B106566B; Sun, 17 Jun 2012 00:23:48 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBE128FC08; Sun, 17 Jun 2012 00:23:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5H0Nm2V074046; Sun, 17 Jun 2012 00:23:48 GMT (envelope-from linimon@svn.freebsd.org) Received: (from linimon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5H0NmnZ074044; Sun, 17 Jun 2012 00:23:48 GMT (envelope-from linimon@svn.freebsd.org) Message-Id: <201206170023.q5H0NmnZ074044@svn.freebsd.org> From: Mark Linimon Date: Sun, 17 Jun 2012 00:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237175 - projects/portbuild/scripts X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 00:23:48 -0000 Author: linimon (doc,ports committer) Date: Sun Jun 17 00:23:48 2012 New Revision: 237175 URL: http://svn.freebsd.org/changeset/base/237175 Log: Make error message more verbose. Modified: projects/portbuild/scripts/allgohans Modified: projects/portbuild/scripts/allgohans ============================================================================== --- projects/portbuild/scripts/allgohans Sat Jun 16 22:28:36 2012 (r237174) +++ projects/portbuild/scripts/allgohans Sun Jun 17 00:23:48 2012 (r237175) @@ -12,7 +12,7 @@ doarch() { if [ -f "${pbd}/${arch}/portbuild.conf" ]; then . ${pbd}/${arch}/portbuild.conf else - echo "Invalid arch" + echo "Invalid arch $arch" exit 1 fi From owner-svn-src-projects@FreeBSD.ORG Sun Jun 17 00:27:07 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 651A8106564A; Sun, 17 Jun 2012 00:27:07 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 508498FC1C; Sun, 17 Jun 2012 00:27:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5H0R7Pu074217; Sun, 17 Jun 2012 00:27:07 GMT (envelope-from linimon@svn.freebsd.org) Received: (from linimon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5H0R7iD074215; Sun, 17 Jun 2012 00:27:07 GMT (envelope-from linimon@svn.freebsd.org) Message-Id: <201206170027.q5H0R7iD074215@svn.freebsd.org> From: Mark Linimon Date: Sun, 17 Jun 2012 00:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237176 - projects/portbuild/qmanager X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 00:27:07 -0000 Author: linimon (doc,ports committer) Date: Sun Jun 17 00:27:06 2012 New Revision: 237176 URL: http://svn.freebsd.org/changeset/base/237176 Log: Add some more error handling. Modified: projects/portbuild/qmanager/qmanagerobj.py Modified: projects/portbuild/qmanager/qmanagerobj.py ============================================================================== --- projects/portbuild/qmanager/qmanagerobj.py Sun Jun 17 00:23:48 2012 (r237175) +++ projects/portbuild/qmanager/qmanagerobj.py Sun Jun 17 00:27:06 2012 (r237176) @@ -722,7 +722,10 @@ class Machine(Base): (prio, starttime, next) = self.blocked[0] except IndexError: # No more jobs to run - self.curjobs -= 1 + if self.curjobs > 0: + self.curjobs -= 1 + else: + print "self.curjobs was zero for %s!" % str( self ) return # Try to make the job runabble From owner-svn-src-projects@FreeBSD.ORG Sun Jun 17 00:28:58 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63F52106566B; Sun, 17 Jun 2012 00:28:58 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8AC8FC08; Sun, 17 Jun 2012 00:28:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5H0Swtk074384; Sun, 17 Jun 2012 00:28:58 GMT (envelope-from linimon@svn.freebsd.org) Received: (from linimon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5H0Sw0u074382; Sun, 17 Jun 2012 00:28:58 GMT (envelope-from linimon@svn.freebsd.org) Message-Id: <201206170028.q5H0Sw0u074382@svn.freebsd.org> From: Mark Linimon Date: Sun, 17 Jun 2012 00:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237177 - projects/portbuild/qmanager X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 00:28:58 -0000 Author: linimon (doc,ports committer) Date: Sun Jun 17 00:28:57 2012 New Revision: 237177 URL: http://svn.freebsd.org/changeset/base/237177 Log: Make the dump of machines table more verbose. Modified: projects/portbuild/qmanager/dumpdb.py Modified: projects/portbuild/qmanager/dumpdb.py ============================================================================== --- projects/portbuild/qmanager/dumpdb.py Sun Jun 17 00:27:06 2012 (r237176) +++ projects/portbuild/qmanager/dumpdb.py Sun Jun 17 00:28:57 2012 (r237177) @@ -104,12 +104,27 @@ def show_machines( session ): for machine in machines: print + # String print "name: %s" % machine.name - # list - print "acl: " + str( machine.acl ) - # boolean + # Integer + print "maxjobs: " + str( machine.maxjobs ) + # Integer + print "osversion: " + str( machine.osversion ) + # Integer + print "arch: " + str( machine.arch ) + # String + print "domain: " + machine.domain + # String + print "primarypool: " + machine.primarypool + # PickleType + print "pools: " + str( machine.pools ) + # Integer + print "numcpus: " + str( machine.numcpus ) + # Boolean print "haszfs: " + str( machine.haszfs ) - # boolean + # PickleType + print "acl: " + str( machine.acl ) + # Boolean print "online: " + str( machine.online ) From owner-svn-src-projects@FreeBSD.ORG Sun Jun 17 20:45:47 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C00E106571C; Sun, 17 Jun 2012 20:45:46 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 320EE8FC0C; Sun, 17 Jun 2012 20:45:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5HKjkMh031641; Sun, 17 Jun 2012 20:45:46 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5HKjj92031635; Sun, 17 Jun 2012 20:45:45 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206172045.q5HKjj92031635@svn.freebsd.org> From: Davide Italiano Date: Sun, 17 Jun 2012 20:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237202 - in projects/calloutng/sys: kern sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 20:45:47 -0000 Author: davide Date: Sun Jun 17 20:45:45 2012 New Revision: 237202 URL: http://svn.freebsd.org/changeset/base/237202 Log: - Extend the condvar(9) KPI introducing a new cv_timedwait_bt_sig() function so that we can specify timeout precision in terms of struct bintime. - Now seltdwait() takes three argument rather than two so that their consumers can specify if the timeout should be passed as ticks or bintime. - Refactor the kern_select() and the sys_poll() code so that these two services may rely on cv_timedwait_bt_sig() rather than on the previous less precise cv_timedwait_sig(). - Rethink the sleepqueue(9) KPI in order to make an attempt of avoiding both code duplication and breakages. Your mileage WILL vary, feel free to comment. Reviewed by: mav Modified: projects/calloutng/sys/kern/kern_condvar.c projects/calloutng/sys/kern/subr_sleepqueue.c projects/calloutng/sys/kern/sys_generic.c projects/calloutng/sys/sys/condvar.h projects/calloutng/sys/sys/sleepqueue.h Modified: projects/calloutng/sys/kern/kern_condvar.c ============================================================================== --- projects/calloutng/sys/kern/kern_condvar.c Sun Jun 17 19:16:31 2012 (r237201) +++ projects/calloutng/sys/kern/kern_condvar.c Sun Jun 17 20:45:45 2012 (r237202) @@ -342,7 +342,8 @@ _cv_timedwait(struct cv *cvp, struct loc * a signal was caught. */ int -_cv_timedwait_sig(struct cv *cvp, struct lock_object *lock, int timo) +_cv_timedwait_sig(struct cv *cvp, struct lock_object *lock, + struct bintime *bt, int timo) { WITNESS_SAVE_DECL(lock_witness); struct lock_class *class; @@ -379,7 +380,10 @@ _cv_timedwait_sig(struct cv *cvp, struct sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR | SLEEPQ_INTERRUPTIBLE, 0); - sleepq_set_timeout(cvp, timo); + if (bt == NULL) + sleepq_set_timeout(cvp, timo); + else + sleepq_set_timeout_bt(cvp, *bt); if (lock != &Giant.lock_object) { if (class->lc_flags & LC_SLEEPABLE) sleepq_release(cvp); Modified: projects/calloutng/sys/kern/subr_sleepqueue.c ============================================================================== --- projects/calloutng/sys/kern/subr_sleepqueue.c Sun Jun 17 19:16:31 2012 (r237201) +++ projects/calloutng/sys/kern/subr_sleepqueue.c Sun Jun 17 20:45:45 2012 (r237202) @@ -362,7 +362,7 @@ sleepq_add(void *wchan, struct lock_obje * sleep queue after timo ticks if the thread has not already been awakened. */ void -sleepq_set_timeout_bt(void *wchan, struct bintime bt) +_sleepq_set_timeout(void *wchan, struct bintime *bt, int timo) { struct sleepqueue_chain *sc; @@ -374,22 +374,12 @@ sleepq_set_timeout_bt(void *wchan, struc MPASS(TD_ON_SLEEPQ(td)); MPASS(td->td_sleepqueue == NULL); MPASS(wchan != NULL); - callout_reset_bt_on(&td->td_slpcallout, bt, sleepq_timeout, td, PCPU_GET(cpuid), 0); -} - -void -sleepq_set_timeout(void *wchan, int timo) -{ - struct sleepqueue_chain *sc; - struct thread *td; - - td = curthread; - sc = SC_LOOKUP(wchan); - mtx_assert(&sc->sc_lock, MA_OWNED); - MPASS(TD_ON_SLEEPQ(td)); - MPASS(td->td_sleepqueue == NULL); - MPASS(wchan != NULL); - callout_reset_curcpu(&td->td_slpcallout, timo, sleepq_timeout, td); + if (bt == NULL) + callout_reset_curcpu(&td->td_slpcallout, timo, + sleepq_timeout, td); + else + callout_reset_bt_on(&td->td_slpcallout, *bt, + sleepq_timeout, td, PCPU_GET(cpuid), 0); } /* Modified: projects/calloutng/sys/kern/sys_generic.c ============================================================================== --- projects/calloutng/sys/kern/sys_generic.c Sun Jun 17 19:16:31 2012 (r237201) +++ projects/calloutng/sys/kern/sys_generic.c Sun Jun 17 20:45:45 2012 (r237202) @@ -102,7 +102,7 @@ static int dofilewrite(struct thread *, off_t, int); static void doselwakeup(struct selinfo *, int); static void seltdinit(struct thread *); -static int seltdwait(struct thread *, int); +static int seltdwait(struct thread *, struct bintime *, int); static void seltdclear(struct thread *); /* @@ -902,7 +902,8 @@ kern_select(struct thread *td, int nd, f */ fd_mask s_selbits[howmany(2048, NFDBITS)]; fd_mask *ibits[3], *obits[3], *selbits, *sbp; - struct timeval atv, rtv, ttv; + struct bintime abt, rbt; + struct timeval atv; int error, lf, ndu, timo; u_int nbufbytes, ncpbytes, ncpubytes, nfdbits; @@ -996,33 +997,34 @@ kern_select(struct thread *td, int nd, f if (tvp != NULL) { atv = *tvp; - if (itimerfix(&atv)) { + if (atv.tv_sec < 0 || atv.tv_usec < 0 || + atv.tv_usec >= 1000000) { error = EINVAL; goto done; } - getmicrouptime(&rtv); - timevaladd(&atv, &rtv); + binuptime(&rbt); + timeval2bintime(&atv, &abt); + bintime_add(&abt, &rbt); } else { - atv.tv_sec = 0; - atv.tv_usec = 0; + abt.sec = 0; + abt.frac = 0; } - timo = 0; seltdinit(td); /* Iterate until the timeout expires or descriptors become ready. */ for (;;) { error = selscan(td, ibits, obits, nd); if (error || td->td_retval[0] != 0) break; - if (atv.tv_sec || atv.tv_usec) { - getmicrouptime(&rtv); - if (timevalcmp(&rtv, &atv, >=)) + if (abt.sec || abt.frac) { + binuptime(&rbt); + if (bintime_cmp(&rbt, &abt, >=)) break; - ttv = atv; - timevalsub(&ttv, &rtv); - timo = ttv.tv_sec > 24 * 60 * 60 ? - 24 * 60 * 60 * hz : tvtohz(&ttv); + error = seltdwait(td, &abt, 0); + } + else { + timo = 0; + error = seltdwait(td, NULL, timo); } - error = seltdwait(td, timo); if (error) break; error = selrescan(td, ibits, obits); @@ -1254,8 +1256,9 @@ sys_poll(td, uap) { struct pollfd *bits; struct pollfd smallbits[32]; - struct timeval atv, rtv, ttv; - int error = 0, timo; + struct bintime abt, rbt; + struct timeval atv; + int error, timo; u_int nfds; size_t ni; @@ -1273,33 +1276,33 @@ sys_poll(td, uap) if (uap->timeout != INFTIM) { atv.tv_sec = uap->timeout / 1000; atv.tv_usec = (uap->timeout % 1000) * 1000; - if (itimerfix(&atv)) { + if (atv.tv_sec < 0 || atv.tv_usec < 0 || + atv.tv_usec >= 1000000) { error = EINVAL; goto done; } - getmicrouptime(&rtv); - timevaladd(&atv, &rtv); + binuptime(&rbt); + timeval2bintime(&atv, &abt); + bintime_add(&abt, &rbt); } else { - atv.tv_sec = 0; - atv.tv_usec = 0; + abt.sec = 0; + abt.frac = 0; } - timo = 0; seltdinit(td); /* Iterate until the timeout expires or descriptors become ready. */ for (;;) { error = pollscan(td, bits, nfds); if (error || td->td_retval[0] != 0) break; - if (atv.tv_sec || atv.tv_usec) { - getmicrouptime(&rtv); - if (timevalcmp(&rtv, &atv, >=)) + if (abt.sec || abt.frac) { + binuptime(&rbt); + if (bintime_cmp(&rbt, &abt, >=)) break; - ttv = atv; - timevalsub(&ttv, &rtv); - timo = ttv.tv_sec > 24 * 60 * 60 ? - 24 * 60 * 60 * hz : tvtohz(&ttv); + error = seltdwait(td, &abt, 0); + } else { + timo = 0; + error = seltdwait(td, NULL, timo); } - error = seltdwait(td, timo); if (error) break; error = pollrescan(td); @@ -1518,7 +1521,7 @@ selsocket(struct socket *so, int events, timo = ttv.tv_sec > 24 * 60 * 60 ? 24 * 60 * 60 * hz : tvtohz(&ttv); } - error = seltdwait(td, timo); + error = seltdwait(td, NULL, timo); seltdclear(td); if (error) break; @@ -1697,7 +1700,7 @@ out: } static int -seltdwait(struct thread *td, int timo) +seltdwait(struct thread *td, struct bintime *bt, int timo) { struct seltd *stp; int error; @@ -1716,9 +1719,11 @@ seltdwait(struct thread *td, int timo) mtx_unlock(&stp->st_mtx); return (0); } - if (timo > 0) + if (bt == NULL && timo > 0) error = cv_timedwait_sig(&stp->st_wait, &stp->st_mtx, timo); - else + else if (bt != NULL) + error = cv_timedwait_bt_sig(&stp->st_wait, &stp->st_mtx, *bt); + else error = cv_wait_sig(&stp->st_wait, &stp->st_mtx); mtx_unlock(&stp->st_mtx); Modified: projects/calloutng/sys/sys/condvar.h ============================================================================== --- projects/calloutng/sys/sys/condvar.h Sun Jun 17 19:16:31 2012 (r237201) +++ projects/calloutng/sys/sys/condvar.h Sun Jun 17 20:45:45 2012 (r237202) @@ -56,7 +56,8 @@ void _cv_wait(struct cv *cvp, struct loc void _cv_wait_unlock(struct cv *cvp, struct lock_object *lock); int _cv_wait_sig(struct cv *cvp, struct lock_object *lock); int _cv_timedwait(struct cv *cvp, struct lock_object *lock, int timo); -int _cv_timedwait_sig(struct cv *cvp, struct lock_object *lock, int timo); +int _cv_timedwait_sig(struct cv *cvp, struct lock_object *lock, + struct bintime *bt, int timo); void cv_signal(struct cv *cvp); void cv_broadcastpri(struct cv *cvp, int pri); @@ -70,7 +71,9 @@ void cv_broadcastpri(struct cv *cvp, int #define cv_timedwait(cvp, lock, timo) \ _cv_timedwait((cvp), &(lock)->lock_object, (timo)) #define cv_timedwait_sig(cvp, lock, timo) \ - _cv_timedwait_sig((cvp), &(lock)->lock_object, (timo)) + _cv_timedwait_sig((cvp), &(lock)->lock_object, (NULL), (timo)) +#define cv_timedwait_bt_sig(cvp, lock, bt) \ + _cv_timedwait_sig((cvp), &(lock)->lock_object, (&bt), (0)) #define cv_broadcast(cvp) cv_broadcastpri(cvp, 0) Modified: projects/calloutng/sys/sys/sleepqueue.h ============================================================================== --- projects/calloutng/sys/sys/sleepqueue.h Sun Jun 17 19:16:31 2012 (r237201) +++ projects/calloutng/sys/sys/sleepqueue.h Sun Jun 17 20:45:45 2012 (r237202) @@ -108,8 +108,11 @@ struct sleepqueue *sleepq_lookup(void *w void sleepq_release(void *wchan); void sleepq_remove(struct thread *td, void *wchan); int sleepq_signal(void *wchan, int flags, int pri, int queue); -void sleepq_set_timeout_bt(void *wchan, struct bintime bt); -void sleepq_set_timeout(void *wchan, int timo); +void _sleepq_set_timeout(void *wchan, struct bintime *bt, int timo); +#define sleepq_set_timeout(wchan, timo) \ + _sleepq_set_timeout((wchan), (NULL), (timo)) +#define sleepq_set_timeout_bt(wchan, bt) \ + _sleepq_set_timeout((wchan), (&bt), (0)) u_int sleepq_sleepcnt(void *wchan, int queue); int sleepq_timedwait(void *wchan, int pri); int sleepq_timedwait_sig(void *wchan, int pri); From owner-svn-src-projects@FreeBSD.ORG Sun Jun 17 21:48:44 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15FAA1065673; Sun, 17 Jun 2012 21:48:44 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0A5A8FC1B; Sun, 17 Jun 2012 21:48:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5HLmh5a034823; Sun, 17 Jun 2012 21:48:43 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5HLmfm3034811; Sun, 17 Jun 2012 21:48:41 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206172148.q5HLmfm3034811@svn.freebsd.org> From: Davide Italiano Date: Sun, 17 Jun 2012 21:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237213 - in projects/calloutng: . bin/rcp cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest cddl... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 21:48:44 -0000 Author: davide Date: Sun Jun 17 21:48:40 2012 New Revision: 237213 URL: http://svn.freebsd.org/changeset/base/237213 Log: MFC as per r237201. Added: projects/calloutng/cddl/contrib/opensolaris/cmd/zhack/ - copied from r237202, head/cddl/contrib/opensolaris/cmd/zhack/ projects/calloutng/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 - copied unchanged from r237202, head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 projects/calloutng/cddl/lib/libdtrace/io.d - copied unchanged from r237202, head/cddl/lib/libdtrace/io.d projects/calloutng/cddl/usr.sbin/zhack/ - copied from r237202, head/cddl/usr.sbin/zhack/ projects/calloutng/share/man/man4/filemon.4 - copied unchanged from r237202, head/share/man/man4/filemon.4 projects/calloutng/sys/arm/include/atags.h - copied unchanged from r237202, head/sys/arm/include/atags.h projects/calloutng/sys/cddl/contrib/opensolaris/common/nvpair/fnvpair.c - copied unchanged from r237202, head/sys/cddl/contrib/opensolaris/common/nvpair/fnvpair.c projects/calloutng/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c - copied unchanged from r237202, head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c projects/calloutng/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h - copied unchanged from r237202, head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c - copied unchanged from r237202, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h - copied unchanged from r237202, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h - copied unchanged from r237202, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c - copied unchanged from r237202, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c projects/calloutng/sys/dev/filemon/ - copied from r237202, head/sys/dev/filemon/ projects/calloutng/sys/kern/kern_rangelock.c - copied unchanged from r237202, head/sys/kern/kern_rangelock.c projects/calloutng/sys/modules/filemon/ - copied from r237202, head/sys/modules/filemon/ projects/calloutng/sys/powerpc/booke/machdep_e500.c - copied unchanged from r237202, head/sys/powerpc/booke/machdep_e500.c projects/calloutng/sys/powerpc/booke/machdep_ppc4xx.c - copied unchanged from r237202, head/sys/powerpc/booke/machdep_ppc4xx.c projects/calloutng/sys/powerpc/include/machdep.h - copied unchanged from r237202, head/sys/powerpc/include/machdep.h projects/calloutng/sys/sys/rangelock.h - copied unchanged from r237202, head/sys/sys/rangelock.h projects/calloutng/sys/x86/acpica/acpi_wakeup.c - copied unchanged from r237202, head/sys/x86/acpica/acpi_wakeup.c projects/calloutng/tools/build/make_check/check.mk - copied unchanged from r237202, head/tools/build/make_check/check.mk projects/calloutng/tools/regression/filemon/ - copied from r237202, head/tools/regression/filemon/ projects/calloutng/tools/regression/usr.bin/make/test-new.mk - copied unchanged from r237202, head/tools/regression/usr.bin/make/test-new.mk projects/calloutng/tools/regression/usr.bin/make/variables/modifier_t/ - copied from r237202, head/tools/regression/usr.bin/make/variables/modifier_t/ projects/calloutng/tools/regression/usr.bin/make/variables/opt_V/ - copied from r237202, head/tools/regression/usr.bin/make/variables/opt_V/ projects/calloutng/tools/tools/ath/athaggrstats/ - copied from r237202, head/tools/tools/ath/athaggrstats/ projects/calloutng/tools/tools/ifpifa/ - copied from r237202, head/tools/tools/ifpifa/ projects/calloutng/usr.sbin/pciconf/err.c - copied unchanged from r237202, head/usr.sbin/pciconf/err.c Deleted: projects/calloutng/etc/auth.conf projects/calloutng/lib/libutil/auth.3 projects/calloutng/lib/libutil/auth.conf.5 projects/calloutng/sys/amd64/acpica/acpi_switch.S projects/calloutng/sys/amd64/acpica/acpi_wakeup.c projects/calloutng/sys/arm/at91/files.at91sam9 projects/calloutng/sys/i386/acpica/acpi_wakeup.c Modified: projects/calloutng/Makefile.inc1 projects/calloutng/ObsoleteFiles.inc projects/calloutng/UPDATING projects/calloutng/bin/rcp/rcp.1 projects/calloutng/cddl/contrib/opensolaris/cmd/zdb/zdb.c projects/calloutng/cddl/contrib/opensolaris/cmd/zpool/zpool.8 projects/calloutng/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c projects/calloutng/cddl/contrib/opensolaris/cmd/ztest/ztest.c projects/calloutng/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c projects/calloutng/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h projects/calloutng/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c projects/calloutng/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c projects/calloutng/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c projects/calloutng/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c projects/calloutng/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c projects/calloutng/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c projects/calloutng/cddl/lib/libnvpair/Makefile projects/calloutng/cddl/lib/libzfs/Makefile projects/calloutng/cddl/sbin/zpool/Makefile projects/calloutng/cddl/usr.bin/ztest/Makefile projects/calloutng/cddl/usr.sbin/Makefile projects/calloutng/contrib/bind9/CHANGES projects/calloutng/contrib/bind9/lib/dns/rdata.c projects/calloutng/contrib/bind9/lib/dns/rdataslab.c projects/calloutng/contrib/bind9/version projects/calloutng/contrib/bsnmp/lib/bsnmpclient.3 projects/calloutng/contrib/bsnmp/lib/bsnmplib.3 projects/calloutng/contrib/bsnmp/snmp_mibII/mibII_tcp.c projects/calloutng/contrib/bsnmp/snmp_target/snmp_target.3 projects/calloutng/contrib/bsnmp/snmp_usm/snmp_usm.3 projects/calloutng/contrib/bsnmp/snmp_vacm/snmp_vacm.3 projects/calloutng/contrib/gcc/config/arm/freebsd.h projects/calloutng/contrib/gcc/config/sparc/freebsd.h projects/calloutng/contrib/libc++/include/__bit_reference projects/calloutng/contrib/libstdc++/include/bits/locale_facets.tcc projects/calloutng/contrib/libstdc++/include/bits/stl_bvector.h projects/calloutng/contrib/libstdc++/include/bits/stl_deque.h projects/calloutng/contrib/libstdc++/include/bits/stl_list.h projects/calloutng/contrib/libstdc++/include/bits/stl_map.h projects/calloutng/contrib/libstdc++/include/bits/stl_multimap.h projects/calloutng/contrib/libstdc++/include/bits/stl_multiset.h projects/calloutng/contrib/libstdc++/include/bits/stl_set.h projects/calloutng/contrib/libstdc++/include/bits/stl_tree.h projects/calloutng/contrib/libstdc++/include/bits/stl_vector.h projects/calloutng/contrib/llvm/tools/bugpoint/ToolRunner.cpp projects/calloutng/contrib/telnet/telnet/telnet.1 projects/calloutng/etc/Makefile projects/calloutng/gnu/lib/libgomp/config.h projects/calloutng/gnu/lib/libstdc++/config.h projects/calloutng/gnu/lib/libsupc++/Version.map projects/calloutng/include/fmtmsg.h projects/calloutng/include/paths.h projects/calloutng/kerberos5/Makefile.inc projects/calloutng/kerberos5/lib/libasn1/Makefile projects/calloutng/kerberos5/lib/libgssapi_krb5/Makefile projects/calloutng/kerberos5/lib/libgssapi_ntlm/Makefile projects/calloutng/kerberos5/lib/libgssapi_spnego/Makefile projects/calloutng/kerberos5/lib/libhdb/Makefile projects/calloutng/kerberos5/lib/libheimbase/Makefile projects/calloutng/kerberos5/lib/libheimipcc/Makefile projects/calloutng/kerberos5/lib/libheimipcs/Makefile projects/calloutng/kerberos5/lib/libhx509/Makefile projects/calloutng/kerberos5/lib/libkadm5clnt/Makefile projects/calloutng/kerberos5/lib/libkadm5srv/Makefile projects/calloutng/kerberos5/lib/libkafs5/Makefile projects/calloutng/kerberos5/lib/libkdc/Makefile projects/calloutng/kerberos5/lib/libkrb5/Makefile projects/calloutng/kerberos5/lib/libroken/Makefile projects/calloutng/kerberos5/lib/libvers/Makefile projects/calloutng/kerberos5/libexec/hprop/Makefile projects/calloutng/kerberos5/libexec/kadmind/Makefile projects/calloutng/kerberos5/libexec/kcm/Makefile projects/calloutng/kerberos5/libexec/kdigest/Makefile projects/calloutng/kerberos5/libexec/kfd/Makefile projects/calloutng/kerberos5/tools/asn1_compile/Makefile projects/calloutng/kerberos5/tools/slc/Makefile projects/calloutng/kerberos5/usr.bin/hxtool/Makefile projects/calloutng/kerberos5/usr.bin/kadmin/Makefile projects/calloutng/kerberos5/usr.bin/kcc/Makefile projects/calloutng/kerberos5/usr.bin/kf/Makefile projects/calloutng/kerberos5/usr.bin/string2key/Makefile projects/calloutng/kerberos5/usr.sbin/iprop-log/Makefile projects/calloutng/kerberos5/usr.sbin/ktutil/Makefile projects/calloutng/lib/libc++/Makefile projects/calloutng/lib/libc/arm/Symbol.map projects/calloutng/lib/libc/gen/fstab.c projects/calloutng/lib/libc/gen/getnetgrent.c projects/calloutng/lib/libc/gen/posix_spawnattr_getflags.3 projects/calloutng/lib/libc/gen/signal.3 projects/calloutng/lib/libc/include/port_before.h projects/calloutng/lib/libc/locale/setrunelocale.c projects/calloutng/lib/libc/net/getaddrinfo.c projects/calloutng/lib/libc/stdlib/getopt_long.c projects/calloutng/lib/libc/stdlib/realpath.c projects/calloutng/lib/libc/sys/stat.2 projects/calloutng/lib/libcrypt/Makefile projects/calloutng/lib/libcrypt/crypt.3 projects/calloutng/lib/libcrypt/crypt.c projects/calloutng/lib/libcxxrt/Makefile projects/calloutng/lib/libcxxrt/Version.map projects/calloutng/lib/libelf/elf.3 projects/calloutng/lib/libelf/elf_begin.3 projects/calloutng/lib/libelf/gelf.3 projects/calloutng/lib/libgpib/gpib.3 projects/calloutng/lib/libgssapi/gss_accept_sec_context.3 projects/calloutng/lib/libgssapi/gss_acquire_cred.3 projects/calloutng/lib/libgssapi/gss_add_cred.3 projects/calloutng/lib/libgssapi/gss_add_oid_set_member.3 projects/calloutng/lib/libgssapi/gss_canonicalize_name.3 projects/calloutng/lib/libgssapi/gss_compare_name.3 projects/calloutng/lib/libgssapi/gss_context_time.3 projects/calloutng/lib/libgssapi/gss_create_empty_oid_set.3 projects/calloutng/lib/libgssapi/gss_delete_sec_context.3 projects/calloutng/lib/libgssapi/gss_display_name.3 projects/calloutng/lib/libgssapi/gss_display_status.3 projects/calloutng/lib/libgssapi/gss_duplicate_name.3 projects/calloutng/lib/libgssapi/gss_export_name.3 projects/calloutng/lib/libgssapi/gss_export_sec_context.3 projects/calloutng/lib/libgssapi/gss_get_mic.3 projects/calloutng/lib/libgssapi/gss_import_name.3 projects/calloutng/lib/libgssapi/gss_import_sec_context.3 projects/calloutng/lib/libgssapi/gss_indicate_mechs.3 projects/calloutng/lib/libgssapi/gss_init_sec_context.3 projects/calloutng/lib/libgssapi/gss_inquire_context.3 projects/calloutng/lib/libgssapi/gss_inquire_cred.3 projects/calloutng/lib/libgssapi/gss_inquire_cred_by_mech.3 projects/calloutng/lib/libgssapi/gss_inquire_mechs_for_name.3 projects/calloutng/lib/libgssapi/gss_inquire_names_for_mech.3 projects/calloutng/lib/libgssapi/gss_process_context_token.3 projects/calloutng/lib/libgssapi/gss_release_buffer.3 projects/calloutng/lib/libgssapi/gss_release_cred.3 projects/calloutng/lib/libgssapi/gss_release_name.3 projects/calloutng/lib/libgssapi/gss_release_oid_set.3 projects/calloutng/lib/libgssapi/gss_test_oid_set_member.3 projects/calloutng/lib/libgssapi/gss_unwrap.3 projects/calloutng/lib/libgssapi/gss_verify_mic.3 projects/calloutng/lib/libgssapi/gss_wrap.3 projects/calloutng/lib/libgssapi/gss_wrap_size_limit.3 projects/calloutng/lib/libgssapi/gssapi.3 projects/calloutng/lib/libgssapi/mech.5 projects/calloutng/lib/libkiconv/Makefile projects/calloutng/lib/libncp/ncpl_nls.c projects/calloutng/lib/libpmc/pmc.3 projects/calloutng/lib/libprocstat/libprocstat.c projects/calloutng/lib/librpcsec_gss/rpc_gss_get_error.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_get_mech_info.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_get_principal_name.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_get_versions.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_getcred.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_is_installed.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_max_data_length.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_mech_to_oid.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_oid_to_mech.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_qop_to_num.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_seccreate.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_set_callback.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_set_defaults.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_set_svc_name.3 projects/calloutng/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3 projects/calloutng/lib/libusb/Makefile projects/calloutng/lib/libusb/libusb10.c projects/calloutng/lib/libusb/libusb10_io.c projects/calloutng/lib/libusb/libusb20.3 projects/calloutng/lib/libutil/Makefile projects/calloutng/lib/libutil/auth.c projects/calloutng/lib/libutil/login.conf.5 projects/calloutng/lib/libutil/property.3 projects/calloutng/libexec/rshd/rshd.8 projects/calloutng/libexec/rtld-elf/map_object.c projects/calloutng/release/picobsd/tinyware/passwd/passwd.c projects/calloutng/sbin/camcontrol/camcontrol.8 projects/calloutng/sbin/camcontrol/camcontrol.c projects/calloutng/sbin/devd/devd.cc projects/calloutng/sbin/devfs/devfs.8 projects/calloutng/sbin/fsck_ffs/suj.c projects/calloutng/sbin/hastd/primary.c projects/calloutng/sbin/hastd/synch.h projects/calloutng/sbin/ifconfig/ifconfig.8 projects/calloutng/sbin/ipfw/ipfw.8 projects/calloutng/sbin/mca/Makefile projects/calloutng/sbin/mca/mca.c projects/calloutng/sbin/natd/natd.8 projects/calloutng/sbin/setkey/setkey.8 projects/calloutng/share/examples/csh/dot.cshrc projects/calloutng/share/examples/etc/README.examples projects/calloutng/share/examples/mdoc/example.4 projects/calloutng/share/man/man4/Makefile projects/calloutng/share/man/man4/acpi_panasonic.4 projects/calloutng/share/man/man4/ahci.4 projects/calloutng/share/man/man4/ata.4 projects/calloutng/share/man/man4/bce.4 projects/calloutng/share/man/man4/firewire.4 projects/calloutng/share/man/man4/hptrr.4 projects/calloutng/share/man/man4/io.4 projects/calloutng/share/man/man4/ip.4 projects/calloutng/share/man/man4/mac_lomac.4 projects/calloutng/share/man/man4/man4.i386/sbni.4 projects/calloutng/share/man/man4/mps.4 projects/calloutng/share/man/man4/mpt.4 projects/calloutng/share/man/man4/mvs.4 projects/calloutng/share/man/man4/ng_ksocket.4 projects/calloutng/share/man/man4/run.4 projects/calloutng/share/man/man4/scsi.4 projects/calloutng/share/man/man4/siis.4 projects/calloutng/share/man/man4/snd_hda.4 projects/calloutng/share/man/man4/usb.4 projects/calloutng/share/man/man4/vlan.4 projects/calloutng/share/man/man4/witness.4 projects/calloutng/share/man/man5/make.conf.5 projects/calloutng/share/man/man5/periodic.conf.5 projects/calloutng/share/man/man5/rc.conf.5 projects/calloutng/share/man/man7/development.7 projects/calloutng/share/man/man9/rmlock.9 projects/calloutng/share/man/man9/rwlock.9 projects/calloutng/share/misc/committers-ports.dot projects/calloutng/share/misc/committers-src.dot projects/calloutng/share/mk/bsd.lib.mk projects/calloutng/share/mk/bsd.own.mk projects/calloutng/share/mk/bsd.sys.mk projects/calloutng/sys/amd64/acpica/acpi_wakecode.S projects/calloutng/sys/amd64/amd64/cpu_switch.S projects/calloutng/sys/amd64/amd64/genassym.c projects/calloutng/sys/amd64/amd64/minidump_machdep.c projects/calloutng/sys/amd64/amd64/mp_machdep.c projects/calloutng/sys/amd64/amd64/pmap.c projects/calloutng/sys/amd64/amd64/trap.c projects/calloutng/sys/amd64/conf/GENERIC projects/calloutng/sys/amd64/include/atomic.h projects/calloutng/sys/amd64/include/pcb.h projects/calloutng/sys/amd64/include/pmap.h projects/calloutng/sys/amd64/include/smp.h projects/calloutng/sys/arm/arm/bcopyinout_xscale.S projects/calloutng/sys/arm/arm/bootconfig.c projects/calloutng/sys/arm/arm/busdma_machdep.c projects/calloutng/sys/arm/arm/cpufunc.c projects/calloutng/sys/arm/arm/cpufunc_asm.S projects/calloutng/sys/arm/arm/cpufunc_asm_arm10.S projects/calloutng/sys/arm/arm/cpufunc_asm_arm11.S projects/calloutng/sys/arm/arm/cpufunc_asm_arm7tdmi.S projects/calloutng/sys/arm/arm/cpufunc_asm_arm8.S projects/calloutng/sys/arm/arm/cpufunc_asm_arm9.S projects/calloutng/sys/arm/arm/cpufunc_asm_armv4.S projects/calloutng/sys/arm/arm/cpufunc_asm_armv5.S projects/calloutng/sys/arm/arm/cpufunc_asm_sa1.S projects/calloutng/sys/arm/arm/cpufunc_asm_xscale.S projects/calloutng/sys/arm/arm/cpufunc_asm_xscale_c3.S projects/calloutng/sys/arm/arm/db_disasm.c projects/calloutng/sys/arm/arm/db_interface.c projects/calloutng/sys/arm/arm/db_trace.c projects/calloutng/sys/arm/arm/disassem.c projects/calloutng/sys/arm/arm/dump_machdep.c projects/calloutng/sys/arm/arm/elf_trampoline.c projects/calloutng/sys/arm/arm/exception.S projects/calloutng/sys/arm/arm/gdb_machdep.c projects/calloutng/sys/arm/arm/in_cksum.c projects/calloutng/sys/arm/arm/intr.c projects/calloutng/sys/arm/arm/irq_dispatch.S projects/calloutng/sys/arm/arm/locore.S projects/calloutng/sys/arm/arm/machdep.c projects/calloutng/sys/arm/arm/mem.c projects/calloutng/sys/arm/arm/nexus.c projects/calloutng/sys/arm/arm/pmap.c projects/calloutng/sys/arm/arm/support.S projects/calloutng/sys/arm/arm/swtch.S projects/calloutng/sys/arm/arm/sys_machdep.c projects/calloutng/sys/arm/arm/trap.c projects/calloutng/sys/arm/arm/undefined.c projects/calloutng/sys/arm/arm/vectors.S projects/calloutng/sys/arm/arm/vm_machdep.c projects/calloutng/sys/arm/at91/at91.c projects/calloutng/sys/arm/at91/at91_machdep.c projects/calloutng/sys/arm/at91/at91_mci.c projects/calloutng/sys/arm/at91/at91_pio.c projects/calloutng/sys/arm/at91/at91_pio_rm9200.h projects/calloutng/sys/arm/at91/at91_pit.c projects/calloutng/sys/arm/at91/at91_pitreg.h projects/calloutng/sys/arm/at91/at91_pmc.c projects/calloutng/sys/arm/at91/at91_pmcvar.h projects/calloutng/sys/arm/at91/at91_reset.S projects/calloutng/sys/arm/at91/at91_rst.c projects/calloutng/sys/arm/at91/at91_spi.c projects/calloutng/sys/arm/at91/at91_spireg.h projects/calloutng/sys/arm/at91/at91_ssc.c projects/calloutng/sys/arm/at91/at91_st.c projects/calloutng/sys/arm/at91/at91_wdtreg.h projects/calloutng/sys/arm/at91/at91reg.h projects/calloutng/sys/arm/at91/at91rm9200.c projects/calloutng/sys/arm/at91/at91rm92reg.h projects/calloutng/sys/arm/at91/at91sam9260.c projects/calloutng/sys/arm/at91/at91sam9260reg.h projects/calloutng/sys/arm/at91/at91sam9g20.c projects/calloutng/sys/arm/at91/at91sam9g20reg.h projects/calloutng/sys/arm/at91/at91var.h projects/calloutng/sys/arm/at91/board_qila9g20.c projects/calloutng/sys/arm/at91/board_sam9g20ek.c projects/calloutng/sys/arm/at91/files.at91 projects/calloutng/sys/arm/at91/if_macb.c projects/calloutng/sys/arm/at91/std.at91 projects/calloutng/sys/arm/at91/std.at91sam9 projects/calloutng/sys/arm/at91/uart_cpu_at91rm9200usart.c projects/calloutng/sys/arm/conf/AVILA projects/calloutng/sys/arm/conf/BWCT projects/calloutng/sys/arm/conf/CAMBRIA projects/calloutng/sys/arm/conf/CNS11XXNAS projects/calloutng/sys/arm/conf/CRB projects/calloutng/sys/arm/conf/EP80219 projects/calloutng/sys/arm/conf/ETHERNUT5 projects/calloutng/sys/arm/conf/GUMSTIX projects/calloutng/sys/arm/conf/GUMSTIX-QEMU projects/calloutng/sys/arm/conf/HL200 projects/calloutng/sys/arm/conf/HL201 projects/calloutng/sys/arm/conf/IQ31244 projects/calloutng/sys/arm/conf/KB920X projects/calloutng/sys/arm/conf/LN2410SBC projects/calloutng/sys/arm/conf/NSLU projects/calloutng/sys/arm/conf/QILA9G20 projects/calloutng/sys/arm/conf/QILA9G20.hints projects/calloutng/sys/arm/conf/SAM9G20EK projects/calloutng/sys/arm/conf/SAM9G20EK.hints projects/calloutng/sys/arm/conf/SIMICS projects/calloutng/sys/arm/econa/econa_machdep.c projects/calloutng/sys/arm/include/armreg.h projects/calloutng/sys/arm/include/asmacros.h projects/calloutng/sys/arm/include/atomic.h projects/calloutng/sys/arm/include/blockio.h projects/calloutng/sys/arm/include/cpu.h projects/calloutng/sys/arm/include/cpufunc.h projects/calloutng/sys/arm/include/elf.h projects/calloutng/sys/arm/include/endian.h projects/calloutng/sys/arm/include/fdt.h projects/calloutng/sys/arm/include/fp.h projects/calloutng/sys/arm/include/frame.h projects/calloutng/sys/arm/include/ieee.h projects/calloutng/sys/arm/include/in_cksum.h projects/calloutng/sys/arm/include/intr.h projects/calloutng/sys/arm/include/katelib.h projects/calloutng/sys/arm/include/machdep.h projects/calloutng/sys/arm/include/param.h projects/calloutng/sys/arm/include/pmap.h projects/calloutng/sys/arm/include/pmc_mdep.h projects/calloutng/sys/arm/include/profile.h projects/calloutng/sys/arm/include/pte.h projects/calloutng/sys/arm/include/resource.h projects/calloutng/sys/arm/include/stack.h projects/calloutng/sys/arm/include/vmparam.h projects/calloutng/sys/arm/mv/mv_machdep.c projects/calloutng/sys/arm/mv/mvwin.h projects/calloutng/sys/arm/mv/std.mv projects/calloutng/sys/arm/s3c2xx0/s3c2410reg.h projects/calloutng/sys/arm/s3c2xx0/s3c2440reg.h projects/calloutng/sys/arm/s3c2xx0/s3c24x0.c projects/calloutng/sys/arm/s3c2xx0/s3c24x0_machdep.c projects/calloutng/sys/arm/s3c2xx0/s3c24x0reg.h projects/calloutng/sys/arm/sa11x0/assabet_machdep.c projects/calloutng/sys/arm/sa11x0/sa11x0.c projects/calloutng/sys/arm/sa11x0/sa11x0_gpioreg.h projects/calloutng/sys/arm/sa11x0/sa11x0_io_asm.S projects/calloutng/sys/arm/sa11x0/sa11x0_irq.S projects/calloutng/sys/arm/sa11x0/sa11x0_ost.c projects/calloutng/sys/arm/sa11x0/sa11x0_ostreg.h projects/calloutng/sys/arm/sa11x0/sa11x0_var.h projects/calloutng/sys/arm/sa11x0/uart_dev_sa1110.c projects/calloutng/sys/arm/xscale/i80321/ep80219_machdep.c projects/calloutng/sys/arm/xscale/i80321/i80321.c projects/calloutng/sys/arm/xscale/i80321/i80321_aau.c projects/calloutng/sys/arm/xscale/i80321/i80321_dma.c projects/calloutng/sys/arm/xscale/i80321/i80321_intr.h projects/calloutng/sys/arm/xscale/i80321/i80321_pci.c projects/calloutng/sys/arm/xscale/i80321/i80321_space.c projects/calloutng/sys/arm/xscale/i80321/i80321_timer.c projects/calloutng/sys/arm/xscale/i80321/i80321reg.h projects/calloutng/sys/arm/xscale/i80321/iq31244_7seg.c projects/calloutng/sys/arm/xscale/i80321/iq31244_machdep.c projects/calloutng/sys/arm/xscale/i80321/iq80321.c projects/calloutng/sys/arm/xscale/i80321/obio.c projects/calloutng/sys/arm/xscale/i8134x/crb_machdep.c projects/calloutng/sys/arm/xscale/i8134x/i81342.c projects/calloutng/sys/arm/xscale/i8134x/i81342_mcu.c projects/calloutng/sys/arm/xscale/i8134x/i81342_pci.c projects/calloutng/sys/arm/xscale/i8134x/i81342_space.c projects/calloutng/sys/arm/xscale/i8134x/i81342reg.h projects/calloutng/sys/arm/xscale/i8134x/iq81342_7seg.c projects/calloutng/sys/arm/xscale/i8134x/obio.c projects/calloutng/sys/arm/xscale/i8134x/uart_cpu_i81342.c projects/calloutng/sys/arm/xscale/ixp425/avila_ata.c projects/calloutng/sys/arm/xscale/ixp425/avila_gpio.c projects/calloutng/sys/arm/xscale/ixp425/avila_machdep.c projects/calloutng/sys/arm/xscale/ixp425/cambria_exp_space.c projects/calloutng/sys/arm/xscale/ixp425/if_npe.c projects/calloutng/sys/arm/xscale/ixp425/if_npereg.h projects/calloutng/sys/arm/xscale/ixp425/ixp425.c projects/calloutng/sys/arm/xscale/ixp425/ixp425_iic.c projects/calloutng/sys/arm/xscale/ixp425/ixp425_npe.c projects/calloutng/sys/arm/xscale/ixp425/ixp425_npereg.h projects/calloutng/sys/arm/xscale/ixp425/ixp425_pci.c projects/calloutng/sys/arm/xscale/ixp425/ixp425_pci_space.c projects/calloutng/sys/arm/xscale/ixp425/ixp425_qmgr.c projects/calloutng/sys/arm/xscale/ixp425/ixp425_qmgr.h projects/calloutng/sys/arm/xscale/ixp425/ixp425reg.h projects/calloutng/sys/arm/xscale/pxa/if_smc_smi.c projects/calloutng/sys/arm/xscale/pxa/pxa_machdep.c projects/calloutng/sys/arm/xscale/pxa/pxareg.h projects/calloutng/sys/boot/i386/boot2/boot2.c projects/calloutng/sys/boot/ofw/libofw/ofw_disk.c projects/calloutng/sys/boot/sparc64/loader/main.c projects/calloutng/sys/boot/zfs/zfsimpl.c projects/calloutng/sys/cam/ata/ata_da.c projects/calloutng/sys/cam/ata/ata_pmp.c projects/calloutng/sys/cam/ata/ata_xpt.c projects/calloutng/sys/cam/cam.h projects/calloutng/sys/cam/cam_ccb.h projects/calloutng/sys/cam/cam_debug.h projects/calloutng/sys/cam/cam_periph.c projects/calloutng/sys/cam/cam_periph.h projects/calloutng/sys/cam/cam_xpt.c projects/calloutng/sys/cam/cam_xpt.h projects/calloutng/sys/cam/ctl/scsi_ctl.c projects/calloutng/sys/cam/scsi/scsi_all.c projects/calloutng/sys/cam/scsi/scsi_all.h projects/calloutng/sys/cam/scsi/scsi_cd.c projects/calloutng/sys/cam/scsi/scsi_da.c projects/calloutng/sys/cam/scsi/scsi_pass.c projects/calloutng/sys/cam/scsi/scsi_pt.c projects/calloutng/sys/cam/scsi/scsi_sa.c projects/calloutng/sys/cam/scsi/scsi_target.c projects/calloutng/sys/cam/scsi/scsi_xpt.c projects/calloutng/sys/cddl/boot/zfs/zfsimpl.h projects/calloutng/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/Makefile.files projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h projects/calloutng/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h projects/calloutng/sys/cddl/dev/dtrace/amd64/dtrace_subr.c projects/calloutng/sys/cddl/dev/dtrace/i386/dtrace_subr.c projects/calloutng/sys/conf/NOTES projects/calloutng/sys/conf/files projects/calloutng/sys/conf/files.amd64 projects/calloutng/sys/conf/files.i386 projects/calloutng/sys/conf/files.powerpc projects/calloutng/sys/conf/kern.post.mk projects/calloutng/sys/conf/options projects/calloutng/sys/conf/options.arm projects/calloutng/sys/contrib/pf/net/pf.c projects/calloutng/sys/contrib/pf/net/pf_ioctl.c projects/calloutng/sys/contrib/pf/net/pf_table.c projects/calloutng/sys/contrib/pf/net/pfvar.h projects/calloutng/sys/dev/acpica/Osd/OsdSynch.c projects/calloutng/sys/dev/acpica/acpi.c projects/calloutng/sys/dev/acpica/acpi_ec.c projects/calloutng/sys/dev/acpica/acpi_video.c projects/calloutng/sys/dev/acpica/acpivar.h projects/calloutng/sys/dev/ae/if_ae.c projects/calloutng/sys/dev/ahci/ahci.c projects/calloutng/sys/dev/aic7xxx/aicasm/Makefile projects/calloutng/sys/dev/aic7xxx/aicasm/aicasm.c projects/calloutng/sys/dev/ata/ata-all.c projects/calloutng/sys/dev/ata/chipsets/ata-ite.c projects/calloutng/sys/dev/ath/ath_hal/ah_desc.h projects/calloutng/sys/dev/ath/ath_hal/ah_internal.h projects/calloutng/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c projects/calloutng/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c projects/calloutng/sys/dev/ath/if_ath.c projects/calloutng/sys/dev/ath/if_ath_debug.c projects/calloutng/sys/dev/ath/if_ath_misc.h projects/calloutng/sys/dev/ath/if_ath_rx.c projects/calloutng/sys/dev/ath/if_ath_sysctl.c projects/calloutng/sys/dev/ath/if_ath_tx.c projects/calloutng/sys/dev/ath/if_ath_tx.h projects/calloutng/sys/dev/ath/if_ath_tx_ht.c projects/calloutng/sys/dev/ath/if_athioctl.h projects/calloutng/sys/dev/ath/if_athvar.h projects/calloutng/sys/dev/bge/if_bge.c projects/calloutng/sys/dev/bge/if_bgereg.h projects/calloutng/sys/dev/drm2/i915/i915_gem.c projects/calloutng/sys/dev/e1000/if_igb.c projects/calloutng/sys/dev/flash/at45d.c projects/calloutng/sys/dev/hptiop/hptiop.c projects/calloutng/sys/dev/hptmv/entry.c projects/calloutng/sys/dev/hptrr/hptrr_osm_bsd.c projects/calloutng/sys/dev/hwpmc/hwpmc_arm.c projects/calloutng/sys/dev/hwpmc/hwpmc_intel.c projects/calloutng/sys/dev/isp/isp.c projects/calloutng/sys/dev/isp/isp_freebsd.c projects/calloutng/sys/dev/isp/isp_freebsd.h projects/calloutng/sys/dev/isp/isp_pci.c projects/calloutng/sys/dev/isp/isp_sbus.c projects/calloutng/sys/dev/isp/ispvar.h projects/calloutng/sys/dev/iwn/if_iwn.c projects/calloutng/sys/dev/ixgbe/ixgbe.c projects/calloutng/sys/dev/jme/if_jme.c projects/calloutng/sys/dev/mfi/mfi_disk.c projects/calloutng/sys/dev/mmc/mmc.c projects/calloutng/sys/dev/mmc/mmcsd.c projects/calloutng/sys/dev/mvs/mvs.c projects/calloutng/sys/dev/mvs/mvs.h projects/calloutng/sys/dev/mvs/mvs_soc.c projects/calloutng/sys/dev/pci/pci_pci.c projects/calloutng/sys/dev/puc/pucdata.c projects/calloutng/sys/dev/siis/siis.c projects/calloutng/sys/dev/sym/sym_conf.h projects/calloutng/sys/dev/sym/sym_hipd.c projects/calloutng/sys/dev/usb/quirk/usb_quirk.c projects/calloutng/sys/dev/usb/serial/uftdi.c projects/calloutng/sys/dev/usb/serial/uftdi_reg.h projects/calloutng/sys/dev/usb/usb_device.c projects/calloutng/sys/dev/usb/usb_generic.c projects/calloutng/sys/dev/usb/usbdevs projects/calloutng/sys/dev/usb/wlan/if_rum.c projects/calloutng/sys/dev/usb/wlan/if_run.c projects/calloutng/sys/dev/usb/wlan/if_ural.c projects/calloutng/sys/dev/vxge/vxgehal/vxgehal-channel.h projects/calloutng/sys/dev/wpi/if_wpi.c projects/calloutng/sys/fs/nfsclient/nfs_clbio.c projects/calloutng/sys/fs/nfsclient/nfs_clnode.c projects/calloutng/sys/geom/multipath/g_multipath.c projects/calloutng/sys/geom/part/g_part_gpt.c projects/calloutng/sys/i386/acpica/acpi_wakecode.S projects/calloutng/sys/i386/conf/GENERIC projects/calloutng/sys/i386/i386/minidump_machdep.c projects/calloutng/sys/i386/i386/mp_machdep.c projects/calloutng/sys/i386/i386/pmap.c projects/calloutng/sys/i386/i386/swtch.s projects/calloutng/sys/i386/include/atomic.h projects/calloutng/sys/i386/include/pcb.h projects/calloutng/sys/i386/include/pmap.h projects/calloutng/sys/i386/include/smp.h projects/calloutng/sys/i386/xen/pmap.c projects/calloutng/sys/ia64/acpica/acpi_wakeup.c projects/calloutng/sys/ia64/ia64/pmap.c projects/calloutng/sys/ia64/include/pmap.h projects/calloutng/sys/kern/capabilities.conf projects/calloutng/sys/kern/init_main.c projects/calloutng/sys/kern/init_sysent.c projects/calloutng/sys/kern/kern_descrip.c projects/calloutng/sys/kern/kern_event.c projects/calloutng/sys/kern/kern_shutdown.c projects/calloutng/sys/kern/kern_thread.c projects/calloutng/sys/kern/subr_rman.c projects/calloutng/sys/kern/subr_smp.c projects/calloutng/sys/kern/subr_trap.c projects/calloutng/sys/kern/sys_capability.c projects/calloutng/sys/kern/tty.c projects/calloutng/sys/kern/uipc_syscalls.c projects/calloutng/sys/kern/uipc_usrreq.c projects/calloutng/sys/kern/vfs_bio.c projects/calloutng/sys/kern/vfs_default.c projects/calloutng/sys/kern/vfs_subr.c projects/calloutng/sys/kern/vfs_syscalls.c projects/calloutng/sys/kern/vfs_vnops.c projects/calloutng/sys/libkern/iconv.c projects/calloutng/sys/mips/include/pmap.h projects/calloutng/sys/mips/rmi/rootfs_list.txt projects/calloutng/sys/modules/Makefile projects/calloutng/sys/modules/wpi/Makefile projects/calloutng/sys/modules/zfs/Makefile projects/calloutng/sys/net/bpf.c projects/calloutng/sys/net/if.h projects/calloutng/sys/net/if_bridge.c projects/calloutng/sys/net/if_gif.c projects/calloutng/sys/net/if_loop.c projects/calloutng/sys/net/if_tap.c projects/calloutng/sys/netgraph/netflow/netflow_v9.c projects/calloutng/sys/netgraph/netflow/ng_netflow.c projects/calloutng/sys/netinet/in.h projects/calloutng/sys/netinet/in_pcb.c projects/calloutng/sys/netinet/in_pcb.h projects/calloutng/sys/netinet/ip_input.c projects/calloutng/sys/netinet/ip_output.c projects/calloutng/sys/netinet/ipfw/ip_fw_table.c projects/calloutng/sys/netinet/libalias/libalias.3 projects/calloutng/sys/netinet/sctp_asconf.c projects/calloutng/sys/netinet/sctp_indata.c projects/calloutng/sys/netinet/sctp_indata.h projects/calloutng/sys/netinet/sctp_input.c projects/calloutng/sys/netinet/sctp_input.h projects/calloutng/sys/netinet/sctp_output.c projects/calloutng/sys/netinet/sctp_output.h projects/calloutng/sys/netinet/sctp_pcb.c projects/calloutng/sys/netinet/sctputil.c projects/calloutng/sys/netinet/sctputil.h projects/calloutng/sys/netinet/tcp_input.c projects/calloutng/sys/netinet/tcp_lro.c projects/calloutng/sys/netinet/udp_usrreq.c projects/calloutng/sys/netinet6/in6.c projects/calloutng/sys/netinet6/ip6_forward.c projects/calloutng/sys/netinet6/ip6_input.c projects/calloutng/sys/netinet6/ip6_output.c projects/calloutng/sys/netinet6/sctp6_usrreq.c projects/calloutng/sys/netncp/ncp_nls.h projects/calloutng/sys/netsmb/smb_dev.c projects/calloutng/sys/powerpc/booke/machdep.c projects/calloutng/sys/powerpc/booke/platform_bare.c projects/calloutng/sys/powerpc/include/pmap.h projects/calloutng/sys/sparc64/include/pmap.h projects/calloutng/sys/sys/buf.h projects/calloutng/sys/sys/cdefs.h projects/calloutng/sys/sys/filedesc.h projects/calloutng/sys/sys/kernel.h projects/calloutng/sys/sys/mbuf.h projects/calloutng/sys/sys/mount.h projects/calloutng/sys/sys/param.h projects/calloutng/sys/sys/proc.h projects/calloutng/sys/sys/smp.h projects/calloutng/sys/sys/vnode.h projects/calloutng/sys/ufs/ffs/ffs_softdep.c projects/calloutng/sys/ufs/ffs/ffs_vfsops.c projects/calloutng/sys/ufs/ffs/ffs_vnops.c projects/calloutng/sys/vm/pmap.h projects/calloutng/sys/vm/swap_pager.c projects/calloutng/sys/vm/vm_map.c projects/calloutng/sys/vm/vm_page.c projects/calloutng/sys/vm/vm_page.h projects/calloutng/sys/vm/vm_pageout.c projects/calloutng/sys/vm/vnode_pager.c projects/calloutng/sys/x86/x86/dump_machdep.c projects/calloutng/tools/regression/bin/sh/builtins/wait3.0 projects/calloutng/tools/tools/ath/Makefile projects/calloutng/tools/tools/ath/athdebug/athdebug.c projects/calloutng/tools/tools/net80211/wlanstats/main.c projects/calloutng/tools/tools/syscall_timing/syscall_timing.c projects/calloutng/tools/tools/tinybsd/README projects/calloutng/usr.bin/calendar/calendars/calendar.freebsd projects/calloutng/usr.bin/cut/cut.1 projects/calloutng/usr.bin/cut/cut.c projects/calloutng/usr.bin/find/find.1 projects/calloutng/usr.bin/gzip/zmore.1 projects/calloutng/usr.bin/kdump/kdump.1 projects/calloutng/usr.bin/kdump/kdump.c projects/calloutng/usr.bin/ktrace/ktrace.1 projects/calloutng/usr.bin/ktrace/ktrace.h projects/calloutng/usr.bin/login/login.1 projects/calloutng/usr.bin/make/Makefile projects/calloutng/usr.bin/make/make.1 projects/calloutng/usr.bin/make/var.c projects/calloutng/usr.bin/man/man.conf.5 projects/calloutng/usr.bin/passwd/passwd.1 projects/calloutng/usr.bin/rlogin/rlogin.1 projects/calloutng/usr.bin/rsh/rsh.1 projects/calloutng/usr.bin/sort/coll.c projects/calloutng/usr.bin/sort/sort.h projects/calloutng/usr.bin/touch/touch.1 projects/calloutng/usr.bin/touch/touch.c projects/calloutng/usr.bin/usbhidctl/usbhidctl.1 projects/calloutng/usr.sbin/adduser/rmuser.8 projects/calloutng/usr.sbin/apmd/apmd.8 projects/calloutng/usr.sbin/arp/arp.4 projects/calloutng/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.8 projects/calloutng/usr.sbin/bluetooth/btpand/btpand.8 projects/calloutng/usr.sbin/bluetooth/hccontrol/hccontrol.8 projects/calloutng/usr.sbin/bluetooth/l2control/l2control.8 projects/calloutng/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8 projects/calloutng/usr.sbin/cpucontrol/amd.c projects/calloutng/usr.sbin/ctladm/ctladm.8 projects/calloutng/usr.sbin/daemon/daemon.8 projects/calloutng/usr.sbin/daemon/daemon.c projects/calloutng/usr.sbin/digictl/digictl.8 projects/calloutng/usr.sbin/flowctl/flowctl.8 projects/calloutng/usr.sbin/flowctl/flowctl.c projects/calloutng/usr.sbin/fwcontrol/fwcontrol.8 projects/calloutng/usr.sbin/gssd/gssd.8 projects/calloutng/usr.sbin/inetd/inetd.c projects/calloutng/usr.sbin/inetd/inetd.h projects/calloutng/usr.sbin/jail/jail.8 projects/calloutng/usr.sbin/jail/jail.conf.5 projects/calloutng/usr.sbin/ndiscvt/ndiscvt.8 projects/calloutng/usr.sbin/newsyslog/newsyslog.8 projects/calloutng/usr.sbin/newsyslog/newsyslog.conf.5 projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-localize.sh projects/calloutng/usr.sbin/pc-sysinstall/backend/functions.sh projects/calloutng/usr.sbin/pciconf/Makefile projects/calloutng/usr.sbin/pciconf/cap.c projects/calloutng/usr.sbin/pciconf/pciconf.8 projects/calloutng/usr.sbin/pciconf/pciconf.c projects/calloutng/usr.sbin/pciconf/pciconf.h projects/calloutng/usr.sbin/pkg_install/add/main.c projects/calloutng/usr.sbin/pkg_install/add/perform.c projects/calloutng/usr.sbin/pkg_install/add/pkg_add.1 projects/calloutng/usr.sbin/pkg_install/lib/file.c projects/calloutng/usr.sbin/pkg_install/lib/lib.h projects/calloutng/usr.sbin/pkg_install/lib/url.c projects/calloutng/usr.sbin/pmcstat/pmcstat.8 projects/calloutng/usr.sbin/pmcstat/pmcstat_log.c projects/calloutng/usr.sbin/setfib/setfib.1 projects/calloutng/usr.sbin/syslogd/syslogd.8 Directory Properties: projects/calloutng/ (props changed) projects/calloutng/cddl/contrib/opensolaris/ (props changed) projects/calloutng/contrib/bind9/ (props changed) projects/calloutng/contrib/gcc/ (props changed) projects/calloutng/contrib/libc++/ (props changed) projects/calloutng/contrib/libstdc++/ (props changed) projects/calloutng/contrib/llvm/ (props changed) projects/calloutng/gnu/lib/ (props changed) projects/calloutng/lib/libc/ (props changed) projects/calloutng/lib/libutil/ (props changed) projects/calloutng/sbin/ (props changed) projects/calloutng/sbin/ipfw/ (props changed) projects/calloutng/share/man/man4/ (props changed) projects/calloutng/sys/ (props changed) projects/calloutng/sys/boot/ (props changed) projects/calloutng/sys/cddl/contrib/opensolaris/ (props changed) projects/calloutng/sys/conf/ (props changed) projects/calloutng/sys/contrib/pf/ (props changed) projects/calloutng/tools/regression/usr.bin/make/all.sh (props changed) projects/calloutng/usr.bin/calendar/ (props changed) projects/calloutng/usr.sbin/jail/ (props changed) projects/calloutng/usr.sbin/ndiscvt/ (props changed) Modified: projects/calloutng/Makefile.inc1 ============================================================================== --- projects/calloutng/Makefile.inc1 Sun Jun 17 21:47:24 2012 (r237212) +++ projects/calloutng/Makefile.inc1 Sun Jun 17 21:48:40 2012 (r237213) @@ -15,6 +15,7 @@ # -DNO_WWWUPDATE do not update www in ${MAKE} update # -DNO_CTF do not run the DTrace CTF conversion tools on built objects # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list +# LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target # LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools # list # TARGET="machine" to crossbuild world for a different machine type @@ -88,7 +89,7 @@ SUBDIR+=etc # These are last, since it is nice to at least get the base system # rebuilt before you do them. -.for _DIR in ${LOCAL_DIRS} +.for _DIR in ${LOCAL_LIB_DIRS} ${LOCAL_DIRS} .if exists(${.CURDIR}/${_DIR}/Makefile) SUBDIR+= ${_DIR} .endif @@ -242,7 +243,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ SSP_CFLAGS= \ -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ -DNO_PIC -DNO_PROFILE -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF + -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD # build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ @@ -252,7 +253,7 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ -DNO_LINT \ - -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF + -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ @@ -487,7 +488,8 @@ build32: .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic cd ${.CURDIR}/${_dir}; \ MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ - DIRPRFX=${_dir}/ build-tools + DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \ + -DEARLY_BUILD build-tools .endfor cd ${.CURDIR}; \ ${LIB32WMAKE} -f Makefile.inc1 libraries @@ -829,7 +831,7 @@ buildkernel: cd ${KRNLOBJDIR}/${_kernel}; \ PATH=${BPATH}:${PATH} \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \ + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD \ -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) @@ -837,7 +839,7 @@ buildkernel: cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ PATH=${BPATH}:${PATH} \ MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target} + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD ${target} .endfor .endif .if !defined(NO_KERNELDEPEND) @@ -1272,6 +1274,11 @@ _ofed_lib= contrib/ofed/usr.lib/ .endif _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib} +.for _DIR in ${LOCAL_LIB_DIRS} +.if exists(${.CURDIR}/${_DIR}/Makefile) +_generic_libs+= ${_DIR} +.endif +.endfor lib/libopie__L lib/libtacplus__L: lib/libmd__L Modified: projects/calloutng/ObsoleteFiles.inc ============================================================================== --- projects/calloutng/ObsoleteFiles.inc Sun Jun 17 21:47:24 2012 (r237212) +++ projects/calloutng/ObsoleteFiles.inc Sun Jun 17 21:48:40 2012 (r237213) @@ -38,8 +38,13 @@ # xargs -n1 | sort | uniq -d; # done +# 20120613: auth.conf removed +OLD_FILES+=etc/auth.conf +OLD_FILES+=usr/share/examples/etc/auth.conf +OLD_FILES+=usr/share/man/man3/auth.3.gz +OLD_FILES+=usr/share/man/man5/auth.conf.5.gz # 20120530: kde pam lives now in ports -OLD_FILES+=/etc/pam.d/kde +OLD_FILES+=etc/pam.d/kde # 20120505: new clang import installed a redundant internal header OLD_FILES+=usr/include/clang/3.1/stdalign.h # 20120428: MD2 removed from libmd Modified: projects/calloutng/UPDATING ============================================================================== --- projects/calloutng/UPDATING Sun Jun 17 21:47:24 2012 (r237212) +++ projects/calloutng/UPDATING Sun Jun 17 21:48:40 2012 (r237213) @@ -24,6 +24,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20120611: + A new version of ZFS (pool version 5000) has been merged to -HEAD. + Starting with this version the old system of ZFS pool versioning + is superseded by "feature flags". This concept enables forward + compatibility against certain future changes in functionality of ZFS + pools. The first read-only compatible "feature flag" for ZFS pools + is named "com.delphix:async_destroy". For more information + read the new zpool-features(5) manual page. + Please refer to the "ZFS notes" section of this file for information + on upgrading boot ZFS pools. + 20120417: The malloc(3) implementation embedded in libc now uses sources imported as contrib/jemalloc. The most disruptive API change is to Modified: projects/calloutng/bin/rcp/rcp.1 ============================================================================== --- projects/calloutng/bin/rcp/rcp.1 Sun Jun 17 21:47:24 2012 (r237212) +++ projects/calloutng/bin/rcp/rcp.1 Sun Jun 17 21:48:40 2012 (r237213) @@ -116,17 +116,11 @@ The .Nm utility handles third party copies, where neither source nor target files are on the current machine. -.Sh FILES -.Bl -tag -width ".Pa /etc/auth.conf" -compact -.It Pa /etc/auth.conf -configure authentication services -.El .Sh SEE ALSO .Xr cp 1 , .Xr ftp 1 , .Xr rlogin 1 , .Xr rsh 1 , -.Xr auth.conf 5 , .Xr hosts.equiv 5 .Sh HISTORY The Modified: projects/calloutng/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- projects/calloutng/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Jun 17 21:47:24 2012 (r237212) +++ projects/calloutng/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Jun 17 21:48:40 2012 (r237213) @@ -18,8 +18,10 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -54,6 +56,7 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include @@ -63,7 +66,8 @@ #define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ zio_checksum_table[(idx)].ci_name : "UNKNOWN") #define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ - dmu_ot[(idx)].ot_name : "UNKNOWN") + dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \ + dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN") #define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES) #ifndef lint @@ -1088,7 +1092,7 @@ dump_dsl_dataset(objset_t *os, uint64_t ASSERT(size == sizeof (*ds)); crtime = ds->ds_creation_time; - zdb_nicenum(ds->ds_used_bytes, used); + zdb_nicenum(ds->ds_referenced_bytes, used); zdb_nicenum(ds->ds_compressed_bytes, compressed); zdb_nicenum(ds->ds_uncompressed_bytes, uncompressed); zdb_nicenum(ds->ds_unique_bytes, unique); @@ -1132,6 +1136,44 @@ dump_dsl_dataset(objset_t *os, uint64_t /* ARGSUSED */ static int +dump_bptree_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) +{ + char blkbuf[BP_SPRINTF_LEN]; + + if (bp->blk_birth != 0) { + sprintf_blkptr(blkbuf, bp); + (void) printf("\t%s\n", blkbuf); + } + return (0); +} + +static void +dump_bptree(objset_t *os, uint64_t obj, char *name) +{ + char bytes[32]; + bptree_phys_t *bt; + dmu_buf_t *db; + + if (dump_opt['d'] < 3) + return; + + VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db)); + bt = db->db_data; + zdb_nicenum(bt->bt_bytes, bytes); + (void) printf("\n %s: %llu datasets, %s\n", + name, (unsigned long long)(bt->bt_end - bt->bt_begin), bytes); + dmu_buf_rele(db, FTAG); + + if (dump_opt['d'] < 5) + return; + + (void) printf("\n"); + + (void) bptree_iterate(os, obj, B_FALSE, dump_bptree_cb, NULL, NULL); +} + +/* ARGSUSED */ +static int dump_bpobj_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) { char blkbuf[BP_SPRINTF_LEN]; @@ -1883,11 +1925,13 @@ typedef struct zdb_blkstats { */ #define ZDB_OT_DEFERRED (DMU_OT_NUMTYPES + 0) #define ZDB_OT_DITTO (DMU_OT_NUMTYPES + 1) -#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 2) +#define ZDB_OT_OTHER (DMU_OT_NUMTYPES + 2) +#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 3) static char *zdb_ot_extname[] = { "deferred free", "dedup ditto", + "other", "Total", }; @@ -1968,9 +2012,10 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog type = BP_GET_TYPE(bp); - zdb_count_block(zcb, zilog, bp, type); + zdb_count_block(zcb, zilog, bp, + (type & DMU_OT_NEWTYPE) ? ZDB_OT_OTHER : type); - is_metadata = (BP_GET_LEVEL(bp) != 0 || dmu_ot[type].ot_metadata); + is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type)); if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) { int ioerr; @@ -2197,6 +2242,12 @@ dump_block_stats(spa_t *spa) (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, count_block_cb, &zcb, NULL); } + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset, + spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb, + &zcb, NULL)); + } if (dump_opt['c'] > 1) flags |= TRAVERSE_PREFETCH_DATA; @@ -2373,7 +2424,7 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilo } if (BP_IS_HOLE(bp) || BP_GET_CHECKSUM(bp) == ZIO_CHECKSUM_OFF || - BP_GET_LEVEL(bp) > 0 || dmu_ot[BP_GET_TYPE(bp)].ot_metadata) + BP_GET_LEVEL(bp) > 0 || DMU_OT_IS_METADATA(BP_GET_TYPE(bp))) return (0); ddt_key_fill(&zdde_search.zdde_key, bp); @@ -2478,7 +2529,14 @@ dump_zpool(spa_t *spa) dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees"); if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj, - "Pool frees"); + "Pool snapshot frees"); + } + + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + dump_bptree(spa->spa_meta_objset, + spa->spa_dsl_pool->dp_bptree_obj, + "Pool dataset frees"); } dump_dtl(spa->spa_root_vdev, 0); } Copied: projects/calloutng/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 (from r237202, head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/calloutng/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Sun Jun 17 21:48:40 2012 (r237213, copy of r237202, head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5) @@ -0,0 +1,174 @@ +'\" te +.\" Copyright (c) 2012, Martin Matuska . +.\" All Rights Reserved. +.\" +.\" The contents of this file are subject to the terms of the +.\" Common Development and Distribution License (the "License"). +.\" You may not use this file except in compliance with the License. +.\" +.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +.\" or http://www.opensolaris.org/os/licensing. +.\" See the License for the specific language governing permissions +.\" and limitations under the License. +.\" +.\" When distributing Covered Code, include this CDDL HEADER in each +.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. +.\" If applicable, add the following below this CDDL HEADER, with the +.\" fields enclosed by brackets "[]" replaced with your own identifying +.\" information: Portions Copyright [yyyy] [name of copyright owner] +.\" +.\" Copyright (c) 2012 by Delphix. All rights reserved. +.\" +.\" $FreeBSD$ +.\" +.Dd May 28, 2012 +.Dt ZPOOL-FEATURES 8 +.Os +.Sh NAME +.Nm zpool-features +.Nd ZFS pool feature descriptions +.Sh DESCRIPTION +ZFS pool on\-disk format versions are specified via "features" which replace +the old on\-disk format numbers (the last supported on\-disk format number is +28). +To enable a feature on a pool use the +.Xr zpool 8 +command to set the +.Sy feature@feature_name +property to +.Ar enabled . +.Pp +The pool format does not affect file system version compatibility or the ability +to send file systems between pools. +.Pp +Since most features can be enabled independently of each other the on\-disk +format of the pool is specified by the set of all features marked as +.Sy active +on the pool. If the pool was created by another software version this set may +include unsupported features. +.Ss Identifying features +Every feature has a guid of the form +.Sy com.example:feature_name . +The reverse DNS name ensures that the feature's guid is unique across all ZFS +implementations. When unsupported features are encountered on a pool they will +be identified by their guids. +Refer to the documentation for the ZFS implementation that created the pool +for information about those features. +.Pp +Each supported feature also has a short name. +By convention a feature's short name is the portion of its guid which follows +the ':' (e.g. +.Sy com.example:feature_name +would have the short name +.Sy feature_name ), +however a feature's short name may differ across ZFS implementations if +following the convention would result in name conflicts. +.Ss Feature states +Features can be in one of three states: +.Bl -tag +.It Sy active +This feature's on\-disk format changes are in effect on the pool. +Support for this feature is required to import the pool in read\-write mode. +If this feature is not read-only compatible, support is also required to +import the pool in read\-only mode (see "Read\-only compatibility"). +.It Sy enabled +An administrator has marked this feature as enabled on the pool, but the +feature's on\-disk format changes have not been made yet. +The pool can still be imported by software that does not support this feature, +but changes may be made to the on\-disk format at any time which will move +the feature to the +.Sy active +state. +Some features may support returning to the +.Sy enabled +state after becoming +.Sy active . +See feature\-specific documentation for details. +.It Sy disabled +This feature's on\-disk format changes have not been made and will not be made +unless an administrator moves the feature to the +.Sy enabled +state. +Features cannot be disabled once they have been enabled. +.El +The state of supported features is exposed through pool properties of the form +.Sy feature@short_name . +.Ss Read\-only compatibility +Some features may make on\-disk format changes that do not interfere with other +software's ability to read from the pool. +These features are referred to as "read\-only compatible". +If all unsupported features on a pool are read\-only compatible, the pool can +be imported in read\-only mode by setting the +.Sy readonly +property during import (see +.Xr zpool 8 +for details on importing pools). +.Ss Unsupported features +For each unsupported feature enabled on an imported pool a pool property +named +.Sy unsupported@feature_guid +will indicate why the import was allowed despite the unsupported feature. +Possible values for this property are: +.Bl -tag +.It Sy inactive +The feature is in the +.Sy enabled +state and therefore the pool's on\-disk format is still compatible with +software that does not support this feature. +.It Sy readonly +The feature is read\-only compatible and the pool has been imported in +read\-only mode. +.El +.Ss Feature dependencies +Some features depend on other features being enabled in order to function +properly. +Enabling a feature will automatically enable any features it depends on. +.Sh FEATURES +The following features are supported on this system: +.Bl -tag +.It Sy async_destroy +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:async_destroy" +.It GUID Ta com.delphix:async_destroy +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta none +.El +.Pp +Destroying a file system requires traversing all of its data in order to +return its used space to the pool. +Without +.Sy async_destroy +the file system is not fully removed until all space has been reclaimed. +If the destroy operation is interrupted by a reboot or power outage the next +attempt to open the pool will need to complete the destroy operation +synchronously. +.Pp +When +.Sy async_destroy +is enabled the file system's data will be reclaimed by a background process, +allowing the destroy operation to complete without traversing the entire file +system. +The background process is able to resume interrupted destroys after the pool +has been opened, eliminating the need to finish interrupted destroys as part +of the open operation. +The amount of space remaining to be reclaimed by the background process is +available through the +.Sy freeing +property. +.Sh SEE ALSO +.Xr zpool 8 +.Sh AUTHORS +This manual page is a +.Xr mdoc 7 +reimplementation of the +.Tn illumos +manual page +.Em zpool-features(5) , +modified and customized for +.Fx +and licensed under the Common Development and Distribution License +.Pq Tn CDDL . +.Pp +The +.Xr mdoc 7 +implementation of this manual page was initially written by +.An Martin Matuska Aq mm@FreeBSD.org . Modified: projects/calloutng/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- projects/calloutng/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Jun 17 21:47:24 2012 (r237212) +++ projects/calloutng/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Jun 17 21:48:40 2012 (r237213) @@ -1,5 +1,5 @@ '\" te -.\" Copyright (c) 2011, Martin Matuska . +.\" Copyright (c) 2012, Martin Matuska . .\" All Rights Reserved. .\" .\" The contents of this file are subject to the terms of the @@ -20,6 +20,7 @@ .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2011, Justin T. Gibbs +.\" Copyright (c) 2012 by Delphix. All Rights Reserved. .\" .\" $FreeBSD$ .\" @@ -47,7 +48,7 @@ .Op Ar device .Nm .Cm create -.Op Fl fn +.Op Fl fnd .Op Fl o Ar property Ns = Ns Ar value .Ar ... .Op Fl O Ar file-system-property Ns = Ns Ar value @@ -189,7 +190,7 @@ for information on managing datasets. A .Qq virtual device .Pq No vdev -describes a single device or a collection of devices organized according to +describes a single device or a collection of devices organized according to certain performance and fault characteristics. The following virtual devices are supported: .Bl -tag @@ -237,7 +238,7 @@ A group can have single-, double- , or triple parity, meaning that the .No raidz group can sustain one, two, or three failures, respectively, without -losing any data. The +losing any data. The .Sy raidz1 No vdev type specifies a single-parity .No raidz @@ -287,7 +288,7 @@ writes are load-balanced between devices .No raidz .No vdev types are not supported for the intent log. For more information, -see the +see the .Qq Sx Intent Log section. .It Sy cache @@ -309,13 +310,13 @@ A pool can have any number of virtual de (known as .Qq root .No vdev Ns s). -Data is dynamically distributed across all top-level devices to balance data +Data is dynamically distributed across all top-level devices to balance data among devices. As new virtual devices are added, .Tn ZFS automatically places data on the newly available devices. .Pp Virtual devices are specified one at a time on the command line, separated by -whitespace. The keywords +whitespace. The keywords .Qq mirror and .Qq raidz @@ -428,7 +429,7 @@ allows devices to be associated with poo .Qq hot spares . These devices are not actively used in the pool, but when an active device fails, it is automatically replaced by a hot spare. To create a pool with hot -spares, specify a +spares, specify a .Qq spare .No vdev with any number of devices. For example, @@ -458,7 +459,7 @@ pools. .Pp Spares cannot replace log devices. .Ss Intent Log -The +The .Tn ZFS Intent Log .Pq Tn ZIL @@ -537,6 +538,16 @@ value of 1.76 indicates that 1.76 units for a description of the deduplication feature. .It Sy free Number of blocks within the pool that are not allocated. +.It Sy freeing +After a file system or snapshot is destroyed, the space it was using is +returned to the pool asynchronously. +.Sy freeing +is the amount of space remaining to be reclaimed. +Over time +.Sy freeing +will decrease while +.Sy free +increases. .It Sy expandsize This property has currently no value on FreeBSD. .It Sy guid @@ -552,11 +563,16 @@ or .Qq Sy UNAVAIL . .It Sy size Total size of the storage pool. +.It Sy unsupported@ Ns Ar feature_guid +Information about unsupported features that are enabled on the pool. +See +.Xr zpool-features 5 +for details. .It Sy used Amount of storage space used within the pool. .El .Pp -These space usage properties report actual physical space available to the +The space usage properties report actual physical space available to the storage pool. The physical space can be different from the total amount of space that any contained datasets can actually use. The amount of space used in a @@ -582,7 +598,7 @@ the typical paths are not valid. .Sy altroot is not a persistent property. It is valid only while the system is up. Setting -.Sy altroot +.Sy altroot defaults to using .Cm cachefile=none , though this may be overridden using an explicit setting. @@ -627,9 +643,9 @@ This property can also be referred to by .It Sy autoreplace Ns = Ns Cm on No | Cm off Controls automatic device replacement. If set to .Qq Cm off , -device replacement must be initiated by the administrator by using the +device replacement must be initiated by the administrator by using the .Qq Nm Cm replace -command. If set to +command. If set to .Qq Cm on , any new device, found in the same physical location as a device that previously belonged to the pool, is @@ -650,13 +666,18 @@ pool configuration in a different locati .Qq Nm Cm import Fl c . Setting it to the special value .Qq Cm none -creates a temporary pool that is never cached, and the special value +creates a temporary pool that is never cached, and the special value .Cm '' (empty string) uses the default location. +.It Sy comment Ns = Ns Ar text +A text string consisting of printable ASCII characters that will be stored +such that it is available even if the pool becomes faulted. +An administrator can provide additional information about a pool using this +property. .It Sy dedupditto Ns = Ns Ar number Threshold for the number of block ditto copies. If the reference count for a deduplicated block increases above this number, a new ditto copy of this block -is automatically stored. Deafult setting is +is automatically stored. Default setting is .Cm 0 . .It Sy delegation Ns = Ns Cm on No | Cm off Controls whether a non-privileged user is granted access based on the dataset @@ -686,6 +707,17 @@ requests that have yet to be committed t .It Sy panic Prints out a message to the console and generates a system crash dump. .El +.It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled +The value of this property is the current state of +.Ar feature_name . +The only valid value when setting this property is +.Sy enabled +which moves +.Ar feature_name +to the enabled state. +See +.Xr zpool-features 5 +for details on feature states. .It Sy listsnaps Ns = Ns Cm on No | Cm off Controls whether information about snapshots associated with this pool is output when @@ -699,9 +731,9 @@ The current on-disk version of the pool. decreased. The preferred method of updating pools is with the .Qq Nm Cm upgrade command, though this property can be used when a specific version is needed -for backwards compatibility. This property can be any number between 1 and the -current version reported by -.Qo Ic zpool upgrade -v Qc . +for backwards compatibility. +Once feature flags is enabled on a pool this property will no longer have a +value. .El .Sh SUBCOMMANDS All subcommands that modify state are logged persistently to the pool in their @@ -810,7 +842,7 @@ do not actually discard any transactions .It Xo .Nm .Cm create -.Op Fl fn +.Op Fl fnd .Op Fl o Ar property Ns = Ns Ar value .Ar ... .Op Fl O Ar file-system-property Ns = Ns Ar value @@ -859,9 +891,13 @@ The mount point must not exist or must b root dataset cannot be mounted. This can be overridden with the .Fl m option. +.Pp +By default all supported features are enabled on the new pool unless the +.Fl d +option is specified. .Bl -tag -width indent .It Fl f -Forces use of +Forces use of .Ar vdev Ns s, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner. @@ -869,6 +905,17 @@ Not all devices can be overridden in thi Displays the configuration that would be used without actually creating the pool. The actual pool creation can still fail due to insufficient privileges or device sharing. +.It Fl d +Do not enable any features on the new pool. +Individual features can be enabled by setting their corresponding properties +to +.Sy enabled +with the +.Fl o +option. +See +.Xr zpool-features 5 +for details about feature properties. .It Xo .Fl o Ar property Ns = Ns Ar value .Op Fl o Ar property Ns = Ns Ar value @@ -897,7 +944,7 @@ or .Qq Cm altroot Ns Pa /pool if .Sy altroot -is specified. The mount point must be an absolute path, +is specified. The mount point must be an absolute path, .Qq Cm legacy , or .Qq Cm none . @@ -1234,7 +1281,7 @@ seconds until .Sy Ctrl-C is pressed. If no .Ar pools -are specified, statistics for every pool in the system is shown. If +are specified, statistics for every pool in the system is shown. If .Ar count is specified, the command exits after .Ar count @@ -1292,7 +1339,7 @@ When given an interval, the output is pr .Ar interval seconds until .Sy Ctrl-C -is pressed. If +is pressed. If .Ar count is specified, the command exits after .Ar count @@ -1301,6 +1348,8 @@ reports are printed. .It Fl H Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space. +.It Fl v +Show more detailed information. .It Fl o Ar property Ns Op , Ns Ar ... Comma-separated list of properties to display. See the .Qq Sx Properties @@ -1396,7 +1445,7 @@ This is equivalent to attaching waiting for it to resilver, and then detaching .Ar old_device . .Pp -The size of +The size of .Ar new_device must be greater than or equal to the minimum size of all the devices in a mirror or @@ -1407,7 +1456,7 @@ configuration. is required if the pool is not redundant. If .Ar new_device is not specified, it defaults to -.Ar old_device . +.Ar old_device . This form of replacement is useful after an existing disk has failed and has been physically replaced. In this case, the new disk may have the same .Pa /dev @@ -1494,12 +1543,12 @@ unless overridden by a device specificat .Pp When using a .Ar device -argument, +argument, .Cm split -includes the specified device(s) in a new pool and, should any devices remain +includes the specified device(s) in a new pool and, should any devices remain unspecified, assigns the last device in each mirror .No vdev -to that pool, as it does normally. If you are uncertain about the outcome of a +to that pool, as it does normally. If you are uncertain about the outcome of a .Cm split command, use the .Fl n @@ -1552,7 +1601,7 @@ When given an interval, the output is pr .Ar interval seconds until .Sy Ctrl-C -is pressed. If +is pressed. If .Ar count is specified, the command exits after .Ar count @@ -1873,6 +1922,7 @@ Invalid command line options were specif .El .Sh SEE ALSO .Xr zfs 8 +.Xr zpool-features 5 .Sh AUTHORS This manual page is a .Xr mdoc 7 Modified: projects/calloutng/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- projects/calloutng/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Jun 17 21:47:24 2012 (r237212) +++ projects/calloutng/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Jun 17 21:48:40 2012 (r237213) @@ -54,6 +54,7 @@ #include "zpool_util.h" #include "zfs_comutil.h" +#include "zfeature_common.h" #include "statcommon.h" @@ -207,7 +208,7 @@ get_usage(zpool_help_t idx) { case HELP_CLEAR: return (gettext("\tclear [-nF] [device]\n")); case HELP_CREATE: - return (gettext("\tcreate [-fn] [-o property=value] ... \n" + return (gettext("\tcreate [-fnd] [-o property=value] ... \n" "\t [-O file-system-property=value] ... \n" "\t [-m mountpoint] [-R root] ...\n")); case HELP_DESTROY: @@ -234,7 +235,7 @@ get_usage(zpool_help_t idx) { case HELP_LABELCLEAR: return (gettext("\tlabelclear [-f] \n")); case HELP_LIST: - return (gettext("\tlist [-H] [-o property[,...]] " + return (gettext("\tlist [-Hv] [-o property[,...]] " "[-T d|u] [pool] ... [interval [count]]\n")); case HELP_OFFLINE: return (gettext("\toffline [-t] ...\n")); @@ -339,6 +340,12 @@ usage(boolean_t requested) /* Iterate over all properties */ (void) zprop_iter(print_prop_cb, fp, B_FALSE, B_TRUE, ZFS_TYPE_POOL); + + (void) fprintf(fp, "\t%-15s ", "feature@..."); + (void) fprintf(fp, "YES disabled | enabled | active\n"); + + (void) fprintf(fp, gettext("\nThe feature@ properties must be " + "appended with a feature name.\nSee zpool-features(5).\n")); } /* @@ -405,12 +412,16 @@ add_prop_list(const char *propname, char proplist = *props; if (poolprop) { - if ((prop = zpool_name_to_prop(propname)) == ZPROP_INVAL) { + if ((prop = zpool_name_to_prop(propname)) == ZPROP_INVAL && + !zpool_prop_feature(propname)) { (void) fprintf(stderr, gettext("property '%s' is " "not a valid pool property\n"), propname); return (2); } - normnm = zpool_prop_to_name(prop); + if (zpool_prop_feature(propname)) + normnm = propname; + else + normnm = zpool_prop_to_name(prop); } else { if ((fprop = zfs_name_to_prop(propname)) != ZPROP_INVAL) { normnm = zfs_prop_to_name(fprop); @@ -701,7 +712,7 @@ errout: } /* - * zpool create [-fn] [-o property=value] ... + * zpool create [-fnd] [-o property=value] ... * [-O file-system-property=value] ... * [-R root] [-m mountpoint] ... * @@ -710,8 +721,10 @@ errout: * were to be created. * -R Create a pool under an alternate root * -m Set default mountpoint for the root dataset. By default it's - * '/' + * '/' * -o Set property=value. + * -d Don't automatically enable all supported pool features + * (individual features can be enabled with -o). * -O Set fsproperty=value in the pool's root file system * * Creates the named pool according to the given vdev specification. The @@ -724,6 +737,7 @@ zpool_do_create(int argc, char **argv) { boolean_t force = B_FALSE; boolean_t dryrun = B_FALSE; + boolean_t enable_all_pool_feat = B_TRUE; int c; nvlist_t *nvroot = NULL; char *poolname; @@ -735,7 +749,7 @@ zpool_do_create(int argc, char **argv) char *propval; /* check options */ - while ((c = getopt(argc, argv, ":fnR:m:o:O:")) != -1) { + while ((c = getopt(argc, argv, ":fndR:m:o:O:")) != -1) { switch (c) { case 'f': force = B_TRUE; @@ -743,6 +757,9 @@ zpool_do_create(int argc, char **argv) case 'n': dryrun = B_TRUE; break; + case 'd': + enable_all_pool_feat = B_FALSE; + break; case 'R': altroot = optarg; if (add_prop_list(zpool_prop_to_name( @@ -770,6 +787,21 @@ zpool_do_create(int argc, char **argv) if (add_prop_list(optarg, propval, &props, B_TRUE)) goto errout; + + /* + * If the user is creating a pool that doesn't support + * feature flags, don't enable any features. + */ + if (zpool_name_to_prop(optarg) == ZPOOL_PROP_VERSION) { + char *end; + u_longlong_t ver; + + ver = strtoull(propval, &end, 10); + if (*end == '\0' && + ver < SPA_VERSION_FEATURES) { + enable_all_pool_feat = B_FALSE; + } + } break; case 'O': if ((propval = strchr(optarg, '=')) == NULL) { @@ -835,7 +867,6 @@ zpool_do_create(int argc, char **argv) goto errout; } - if (altroot != NULL && altroot[0] != '/') { (void) fprintf(stderr, gettext("invalid alternate root '%s': " "must be an absolute path\n"), altroot); @@ -917,6 +948,27 @@ zpool_do_create(int argc, char **argv) /* * Hand off to libzfs. */ + if (enable_all_pool_feat) { + int i; + for (i = 0; i < SPA_FEATURES; i++) { + char propname[MAXPATHLEN]; + zfeature_info_t *feat = &spa_feature_table[i]; + + (void) snprintf(propname, sizeof (propname), + "feature@%s", feat->fi_uname); + + /* + * Skip feature if user specified it manually + * on the command line. + */ + if (nvlist_exists(props, propname)) + continue; + + if (add_prop_list(propname, ZFS_FEATURE_ENABLED, + &props, B_TRUE) != 0) + goto errout; + } + } if (zpool_create(g_zfs, poolname, nvroot, props, fsprops) == 0) { zfs_handle_t *pool = zfs_open(g_zfs, poolname, @@ -1249,6 +1301,10 @@ print_status_config(zpool_handle_t *zhp, (void) printf(gettext("newer version")); break; + case VDEV_AUX_UNSUP_FEAT: + (void) printf(gettext("unsupported feature(s)")); + break; + case VDEV_AUX_SPARED: verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &cb.cb_guid) == 0); @@ -1366,6 +1422,10 @@ print_import_config(const char *name, nv (void) printf(gettext("newer version")); break; + case VDEV_AUX_UNSUP_FEAT: + (void) printf(gettext("unsupported feature(s)")); + break; + case VDEV_AUX_ERR_EXCEEDED: (void) printf(gettext("too many errors")); break; @@ -1532,6 +1592,20 @@ show_import(nvlist_t *config) "incompatible version.\n")); break; + case ZPOOL_STATUS_UNSUP_FEAT_READ: + (void) printf(gettext("status: The pool uses the following " + "feature(s) not supported on this sytem:\n")); + zpool_print_unsup_feat(config); + break; + + case ZPOOL_STATUS_UNSUP_FEAT_WRITE: + (void) printf(gettext("status: The pool can only be accessed " + "in read-only mode on this system. It\n\tcannot be " + "accessed in read-write mode because it uses the " + "following\n\tfeature(s) not supported on this system:\n")); + zpool_print_unsup_feat(config); + break; + case ZPOOL_STATUS_HOSTID_MISMATCH: (void) printf(gettext(" status: The pool was last accessed by " "another system.\n")); @@ -1589,6 +1663,20 @@ show_import(nvlist_t *config) "newer\n\tsoftware, or recreate the pool from " "backup.\n")); break; + case ZPOOL_STATUS_UNSUP_FEAT_READ: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Mon Jun 18 04:00:57 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA22E106566B; Mon, 18 Jun 2012 04:00:56 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC4448FC18; Mon, 18 Jun 2012 04:00:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5I40u0a052233; Mon, 18 Jun 2012 04:00:56 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5I40u3J052230; Mon, 18 Jun 2012 04:00:56 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201206180400.q5I40u3J052230@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 18 Jun 2012 04:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237215 - projects/altix2/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 04:00:57 -0000 Author: marcel Date: Mon Jun 18 04:00:56 2012 New Revision: 237215 URL: http://svn.freebsd.org/changeset/base/237215 Log: Have the map method apply to a segment for now. Modified: projects/altix2/sys/kern/busdma_if.m projects/altix2/sys/kern/subr_busdma.c Modified: projects/altix2/sys/kern/busdma_if.m ============================================================================== --- projects/altix2/sys/kern/busdma_if.m Mon Jun 18 02:08:04 2012 (r237214) +++ projects/altix2/sys/kern/busdma_if.m Mon Jun 18 04:00:56 2012 (r237215) @@ -40,7 +40,14 @@ CODE { } static int - default_iommu_map_unmap(device_t dev, busdma_md_t md) + default_iommu_map(device_t dev, busdma_md_t md, u_int idx, + bus_addr_t *ba_p) + { + return (0); + } + + static int + default_iommu_unmap(device_t dev, busdma_md_t md) { return (0); } @@ -54,9 +61,11 @@ METHOD int iommu_xlate { METHOD int iommu_map { device_t dev; busdma_md_t md; -} DEFAULT default_iommu_map_unmap; + u_int idx; + bus_addr_t *ba_p; +} DEFAULT default_iommu_map; METHOD int iommu_unmap { device_t dev; busdma_md_t md; -} DEFAULT default_iommu_map_unmap; +} DEFAULT default_iommu_unmap; Modified: projects/altix2/sys/kern/subr_busdma.c ============================================================================== --- projects/altix2/sys/kern/subr_busdma.c Mon Jun 18 02:08:04 2012 (r237214) +++ projects/altix2/sys/kern/subr_busdma.c Mon Jun 18 04:00:56 2012 (r237215) @@ -241,40 +241,44 @@ _busdma_iommu_xlate(device_t leaf, struc } static int -_busdma_iommu_map_r(device_t dev, struct busdma_md *md) +_busdma_iommu_map_r(device_t dev, struct busdma_md *md, u_int idx, + bus_addr_t *ba_p) { - struct busdma_md_seg *seg; - u_int idx; int error; - if (dev == root_bus) { - /* - * A bus address and a physical address are one and the same - * at this level. - */ - for (idx = 0; idx < md->md_nsegs; idx++) { - seg = &md->md_seg[idx]; - seg->mds_busaddr = seg->mds_paddr; - } - _busdma_md_dump(__func__, dev, md); + if (dev == root_bus) return (0); - } - error = _busdma_iommu_map_r(device_get_parent(dev), md); - if (!error) { - error = BUSDMA_IOMMU_MAP(dev, md); - _busdma_md_dump(__func__, dev, md); - } + error = _busdma_iommu_map_r(device_get_parent(dev), md, idx, ba_p); + if (!error) + error = BUSDMA_IOMMU_MAP(dev, md, idx, ba_p); return (error); } static int _busdma_iommu_map(device_t leaf, struct busdma_md *md) { + struct busdma_md_seg *seg; + device_t dev; + u_int idx; int error; - _busdma_md_dump(__func__, leaf, md); - error = _busdma_iommu_map_r(device_get_parent(leaf), md); + _busdma_md_dump(__func__, root_bus, md); + dev = device_get_parent(leaf); + error = 0; + for (idx = 0; idx < md->md_nsegs; idx++) { + seg = &md->md_seg[idx]; + /* + * A bus address and a physical address are one and the same + * at this level. + */ + seg->mds_busaddr = seg->mds_paddr; + error = _busdma_iommu_map_r(dev, md, idx, &seg->mds_busaddr); + if (error) + break; + } + if (!error) + _busdma_md_dump(__func__, leaf, md); return (error); } From owner-svn-src-projects@FreeBSD.ORG Mon Jun 18 07:37:31 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86CED106564A; Mon, 18 Jun 2012 07:37:31 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71F338FC16; Mon, 18 Jun 2012 07:37:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5I7bVO3062637; Mon, 18 Jun 2012 07:37:31 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5I7bVOv062636; Mon, 18 Jun 2012 07:37:31 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201206180737.q5I7bVOv062636@svn.freebsd.org> From: Peter Holm Date: Mon, 18 Jun 2012 07:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237220 - projects/stress2/misc X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 07:37:31 -0000 Author: pho Date: Mon Jun 18 07:37:30 2012 New Revision: 237220 URL: http://svn.freebsd.org/changeset/base/237220 Log: Regression test for r237219 added. Added: projects/stress2/misc/pts.sh (contents, props changed) Added: projects/stress2/misc/pts.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/pts.sh Mon Jun 18 07:37:30 2012 (r237220) @@ -0,0 +1,140 @@ +#!/bin/sh + +# +# Copyright (c) 2012 Peter Holm +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Page fault in ttydev_open+0x2d seen. Fixed in r237219. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > pts.c +cc -o pts -Wall -Wextra -O2 pts.c -lutil +rm -f pts.c + +/tmp/pts & + +while kill -0 $! 2>/dev/null; do + $here/../testcases/swap/swap -t 2m -i 20 +done +wait + +rm -f /tmp/pts +exit 0 +EOF +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void +churn(char *path) +{ + + FTS *fts; + FTSENT *p; + int fd, ftsoptions, i; + char *args[2]; + + ftsoptions = 0; + args[0] = path; + args[1] = 0; + + setproctitle("churn"); + for (i = 0; i < 5000; i++) { + if ((fts = fts_open(args, ftsoptions, NULL)) == NULL) + err(1, "fts_open"); + + while ((p = fts_read(fts)) != NULL) { + if (p->fts_info == FTS_D || + p->fts_info == FTS_DP) + continue; + if ((fd = open(p->fts_path, O_RDONLY)) > 0) + close(fd); + + } + + if (errno != 0 && errno != ENOENT) + err(1, "fts_read"); + if (fts_close(fts) == -1) + err(1, "fts_close()"); + } + + _exit(0); +} + +void +pty(void) +{ + int i, master, slave; + char slname[1025]; + + setproctitle("pty"); + for (i = 0; i < 20000; i++) { + if (openpty(&master, &slave, slname, NULL, NULL) == -1) + err(1, "openpty"); + if (close(master) == -1) + err(1, "close(master)"); + if (close(slave) == -1) + err(1, "close(%s)", slname); + } + _exit(0); +} + +int +main(void) +{ + int i, j; + + for (j = 0; j < 10; j++) { + for (i = 0; i < 2; i++) { + if (fork() == 0) + pty(); + } + for (i = 0; i < 2; i++) { + if (fork() == 0) + churn("/dev/pts"); + } + for (i = 0; i < 4; i++) + wait(NULL); + } + + return (0); +} From owner-svn-src-projects@FreeBSD.ORG Mon Jun 18 07:43:24 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 433A01065687; Mon, 18 Jun 2012 07:43:24 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 168708FC1C; Mon, 18 Jun 2012 07:43:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5I7hNMS062966; Mon, 18 Jun 2012 07:43:23 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5I7hNHr062965; Mon, 18 Jun 2012 07:43:23 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201206180743.q5I7hNHr062965@svn.freebsd.org> From: Peter Holm Date: Mon, 18 Jun 2012 07:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237222 - projects/stress2 user/pho/stress2 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 07:43:24 -0000 Author: pho Date: Mon Jun 18 07:43:23 2012 New Revision: 237222 URL: http://svn.freebsd.org/changeset/base/237222 Log: Move /projects/stress2 -> /user/pho/stress2 as requested by uqs. Deleted: projects/stress2/ Changes in other areas also in this revision: Added: user/pho/stress2/ - copied from r237221, projects/stress2/ From owner-svn-src-projects@FreeBSD.ORG Mon Jun 18 13:40:50 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C087E1065676; Mon, 18 Jun 2012 13:40:50 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id D7EA28FC18; Mon, 18 Jun 2012 13:40:49 +0000 (UTC) Received: by lbon10 with SMTP id n10so5296978lbo.13 for ; Mon, 18 Jun 2012 06:40:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=WZZhNcBrB2UnBzkkNt0zzSI0SpA58Met+iYh7jeSktQ=; b=Lgs5yXeb6EytlgYliblfUk3cE9qd71NI9LOgUPvMUTbjFNZkOHhgqHTNH1nEKlAYQB tj7XpIa941A5wCyN8eZ/THy0ZCkCt0XpJUznBx795tr3Zzd7QIIpKpQvdf9tkLbYpb3I cy8DBF555RLEas6RM2Jcw3AoRDZn3wAf2Ao13DCW7xf6WvR6/N+jbKQTf44mR44gxa8H 5LTrVVD0X5PLlFlUl4ewS/Cnna0UyMULawXQ8GhnojZPWNK9VOtPpJYhN4DiOSBhAEc5 sy6/xgIUISRDABeRI/1YI9+nb3Wcon/i/NssyiIHHiBltYlU+MmI3QkL7fObWmImeBs2 ucPA== MIME-Version: 1.0 Received: by 10.152.46.6 with SMTP id r6mr14712453lam.7.1340026848835; Mon, 18 Jun 2012 06:40:48 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.27.65 with HTTP; Mon, 18 Jun 2012 06:40:48 -0700 (PDT) In-Reply-To: <201206172045.q5HKjj92031635@svn.freebsd.org> References: <201206172045.q5HKjj92031635@svn.freebsd.org> Date: Mon, 18 Jun 2012 14:40:48 +0100 X-Google-Sender-Auth: 9mKvofwYcpUt8cxdIgnmYnXlRx8 Message-ID: From: Attilio Rao To: Davide Italiano Content-Type: text/plain; charset=UTF-8 Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237202 - in projects/calloutng/sys: kern sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 13:40:50 -0000 2012/6/17, Davide Italiano : > Author: davide > Date: Sun Jun 17 20:45:45 2012 > New Revision: 237202 > URL: http://svn.freebsd.org/changeset/base/237202 > > Log: > - Extend the condvar(9) KPI introducing a new cv_timedwait_bt_sig() > function so that we can specify timeout precision in terms of struct > bintime. > > - Now seltdwait() takes three argument rather than two so that their > consumers can specify if the timeout should be passed as ticks or > bintime. > > - Refactor the kern_select() and the sys_poll() code so that these two > services may rely on cv_timedwait_bt_sig() rather than on the previous > less > precise cv_timedwait_sig(). > > - Rethink the sleepqueue(9) KPI in order to make an attempt of avoiding > both code duplication and breakages. Your mileage WILL vary, feel free to > comment. I would still prefer the unified KPI, but at least the committed code avoids code-duplication, I appreciate your effort here, thanks. Why you don't do the same thing for callout_ KPI? Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-projects@FreeBSD.ORG Mon Jun 18 18:25:58 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 984531065675; Mon, 18 Jun 2012 18:25:58 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79A498FC08; Mon, 18 Jun 2012 18:25:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5IIPwG2093882; Mon, 18 Jun 2012 18:25:58 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5IIPw1S093880; Mon, 18 Jun 2012 18:25:58 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206181825.q5IIPw1S093880@svn.freebsd.org> From: Davide Italiano Date: Mon, 18 Jun 2012 18:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237233 - projects/calloutng/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 18:25:58 -0000 Author: davide Date: Mon Jun 18 18:25:57 2012 New Revision: 237233 URL: http://svn.freebsd.org/changeset/base/237233 Log: Don't compute the bucket applying the hash function if there's no need to do this. While here, try to simplify the callout_tick() logic and fix a couple of style bugs. Discussed with: mav Modified: projects/calloutng/sys/kern/kern_timeout.c Modified: projects/calloutng/sys/kern/kern_timeout.c ============================================================================== --- projects/calloutng/sys/kern/kern_timeout.c Mon Jun 18 17:23:24 2012 (r237232) +++ projects/calloutng/sys/kern/kern_timeout.c Mon Jun 18 18:25:57 2012 (r237233) @@ -358,13 +358,11 @@ get_bucket(struct bintime *bt) void callout_tick(void) { + struct bintime limit, next, now; struct callout *tmp; struct callout_cpu *cc; struct callout_tailq *sc; - struct bintime now; - struct bintime limit; - struct bintime next; - int cpu, first, flag, future, last, need_softclock; + int cpu, first, future, last, need_softclock; /* * Process callouts at a very low cpu priority, so we don't keep the @@ -374,8 +372,12 @@ callout_tick(void) cc = CC_SELF(); mtx_lock_spin_flags(&cc->cc_lock, MTX_QUIET); binuptime(&now); + cpu = curcpu; first = callout_hash(&cc->cc_softticks); last = callout_hash(&now); + next.sec = -1; + next.frac = -1; + future = ((last + hz/4) & callwheelmask); /* * Check if we wrapped around the entire wheel from the last scan. * In case, we need to scan entirely the wheel for pending callouts. @@ -388,19 +390,10 @@ callout_tick(void) first &= callwheelmask; last &= callwheelmask; } - cpu = curcpu; - next.sec = -1; - next .frac = -1; - limit.sec = 0; - limit.frac = 4611686018427250000; /* 1/4 sec */ - bintime_add(&limit,&now); - future = get_bucket(&limit); - flag = 0; for (;;) { sc = &cc->cc_callwheel[first]; TAILQ_FOREACH(tmp, sc, c_links.tqe) { - if ((!flag || flag == 1) && - bintime_cmp(&tmp->c_time, &now, <=)) { + if (bintime_cmp(&tmp->c_time, &now, <=)) { if (tmp->c_flags & CALLOUT_DIRECT) { tmp->c_func(tmp->c_arg); TAILQ_REMOVE(sc, tmp, c_links.tqe); @@ -414,8 +407,18 @@ callout_tick(void) need_softclock = 1; } } - if ((flag == 1 || flag == 2) && - bintime_cmp(&tmp->c_time, &now, >)) { + } + if (first == last) + break; + first = ((first + 1) & callwheelmask); + } + limit.sec = 0; + limit.frac = (uint64_t)1 << (64 - 2); + bintime_add(&limit, &now); + for (;;) { + sc = &cc->cc_callwheel[last]; + TAILQ_FOREACH(tmp, sc, c_links.tqe) { + if (bintime_cmp(&tmp->c_time, &limit, <=)) { if (next.sec == -1 || bintime_cmp(&tmp->c_time, &next, <)) { next = tmp->c_time; @@ -423,16 +426,15 @@ callout_tick(void) } } } - if (first == ((last - 1) & callwheelmask)) - flag = 1; - if (first == last) - flag = 2; - if (first == future || next.sec != -1) + if ((last == future) || (next.sec != -1)) break; - first = (first + 1) & callwheelmask; + last = ((last + 1) & callwheelmask); + } + if (next.sec == -1) { + next.sec = 0; + next.frac = (uint64_t)1 << (64 - 2); + bintime_add(&next, &now); } - if (next.sec == -1) - next = limit; cc->cc_firsttick = next; if (callout_new_inserted != NULL) (*callout_new_inserted)(cpu, next); From owner-svn-src-projects@FreeBSD.ORG Mon Jun 18 22:08:18 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 186801065670; Mon, 18 Jun 2012 22:08:18 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8287A8FC18; Mon, 18 Jun 2012 22:08:17 +0000 (UTC) Received: by vbmv11 with SMTP id v11so3814715vbm.13 for ; Mon, 18 Jun 2012 15:08:17 -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:content-transfer-encoding; bh=9IQYqCsNTauF7eaOxsseC95ZtnNxUxYGGYFTepUfFqM=; b=YNmHB+jDqP4JL9o1jYlogLYH84aYX49BQH5zyM7guZKhZOG+62lNf6rYnzNyuSnF9a LbVDu1b6OphPARCc1rgA8x9k/NXaJC8c/KGIW4ShZRoDM+9uYI766+/g5/um6ydFg6En PKPRQ9CFnr/LOA8XtVNoX+9Qgp5TYPDCT9tlsjISq6fFqqCCcGCwx/D2i0/7quqII/HL 9o1XkAqi+JPbUOs8bpPhwWBccXa/6mLGx4zWuuLB/dw/Ww5RY9no/3efp1wylDYJ6oc2 AQ/VxNhMOZxga4h90EY2Dvwe5Ruw8S0a1PX26JQnHSsRklcn7rQ8fGWDWGRDEXq9ZQ8k rsqQ== MIME-Version: 1.0 Received: by 10.220.215.136 with SMTP id he8mr8619458vcb.13.1340057296772; Mon, 18 Jun 2012 15:08:16 -0700 (PDT) Received: by 10.52.28.132 with HTTP; Mon, 18 Jun 2012 15:08:16 -0700 (PDT) In-Reply-To: References: <201206172045.q5HKjj92031635@svn.freebsd.org> Date: Tue, 19 Jun 2012 00:08:16 +0200 Message-ID: From: Davide Italiano To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-projects@freebsd.org, Alexander Motin , src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r237202 - in projects/calloutng/sys: kern sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 22:08:18 -0000 On Mon, Jun 18, 2012 at 3:40 PM, Attilio Rao wrote: > 2012/6/17, Davide Italiano : >> Author: davide >> Date: Sun Jun 17 20:45:45 2012 >> New Revision: 237202 >> URL: http://svn.freebsd.org/changeset/base/237202 >> >> Log: >> =A0 - Extend the condvar(9) KPI introducing a new cv_timedwait_bt_sig() >> =A0 function so that we can specify timeout precision in terms of struct >> =A0 bintime. >> >> =A0 - Now seltdwait() takes three argument rather than two so that their >> =A0 consumers can specify if the timeout should be passed as ticks or >> bintime. >> >> =A0 - Refactor the kern_select() and the sys_poll() code so that these t= wo >> =A0 services may rely on cv_timedwait_bt_sig() rather than on the previo= us >> less >> =A0 precise cv_timedwait_sig(). >> >> =A0 - Rethink the sleepqueue(9) KPI in order to make an attempt of avoid= ing >> =A0 both code duplication and breakages. Your mileage WILL vary, feel fr= ee to >> =A0 comment. > > I would still prefer the unified KPI, but at least the committed code > avoids code-duplication, I appreciate your effort here, thanks. > > Why you don't do the same thing for callout_ KPI? > > Attilio > > > -- > Peace can only be achieved by understanding - A. Einstein Attilio, here you can find a patch: http://people.freebsd.org/~davide/callout_refactorkpi.diff I'm not confident enough at this point to break all the callout_reset_on() stuffs, but at least I thought it's good to provide a variant of it named callout_reset_direct_on() that takes an additive parameter so that you can specifiy if you want to execute your callout directly from hw interrupt context or in SWI thread. I also patched the callout_reset_on() to always execute in SWI thread, as it has done until now. Note that this solution is a good compromise among breakages and code duplication avoidance, even though, as you pointed out makes the KPI more verbose. If you want to make a review, feel free. I've some doubt on the style of the macros I've added, to I cc'ed Bruce, I guess he's the best person to point me out what I'm doing wrong. Thanks for your time, Davide From owner-svn-src-projects@FreeBSD.ORG Tue Jun 19 19:40:55 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B7819106566C; Tue, 19 Jun 2012 19:40:55 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 974418FC14; Tue, 19 Jun 2012 19:40:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5JJet1m092822; Tue, 19 Jun 2012 19:40:55 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5JJetvE092817; Tue, 19 Jun 2012 19:40:55 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206191940.q5JJetvE092817@svn.freebsd.org> From: Davide Italiano Date: Tue, 19 Jun 2012 19:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237275 - in projects/calloutng/sys: kern sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 19:40:55 -0000 Author: davide Date: Tue Jun 19 19:40:54 2012 New Revision: 237275 URL: http://svn.freebsd.org/changeset/base/237275 Log: - Modify a bit the callout(9) public KPI to avoid code duplication and avoid breakages, as recently done for sleepqueue(9) - Rename the 'direct' argument in callout_reset_on() and friends into 'flags' because it may used for furter enhancements, such as specify precision specification, on which I'm currently woking on. Suggested by: attilio [1], mav [2] Reviewed by: mav Modified: projects/calloutng/sys/kern/kern_timeout.c projects/calloutng/sys/kern/subr_sleepqueue.c projects/calloutng/sys/sys/callout.h Modified: projects/calloutng/sys/kern/kern_timeout.c ============================================================================== --- projects/calloutng/sys/kern/kern_timeout.c Tue Jun 19 18:42:24 2012 (r237274) +++ projects/calloutng/sys/kern/kern_timeout.c Tue Jun 19 19:40:54 2012 (r237275) @@ -475,7 +475,8 @@ callout_lock(struct callout *c) static void callout_cc_add(struct callout *c, struct callout_cpu *cc, - struct bintime to_bintime, void (*func)(void *), void *arg, int cpu, int direct) + struct bintime to_bintime, void (*func)(void *), void *arg, int cpu, + int flags) { int bucket; @@ -485,7 +486,7 @@ callout_cc_add(struct callout *c, struct } c->c_arg = arg; c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); - if (direct) + if (flags & C_DIRECT) c->c_flags |= CALLOUT_DIRECT; c->c_flags &= ~CALLOUT_PROCESSED; c->c_func = func; @@ -831,13 +832,22 @@ callout_handle_init(struct callout_handl * callout_deactivate() - marks the callout as having been serviced */ int -callout_reset_bt_on(struct callout *c, struct bintime bt, void (*ftn)(void *), - void *arg, int cpu, int direct) +_callout_reset_on(struct callout *c, struct bintime *bt, int to_ticks, + void (*ftn)(void *), void *arg, int cpu, int flags) { + struct bintime now, to_bt; struct callout_cpu *cc; int cancelled = 0; int bucket; + if (bt == NULL) { + FREQ2BT(hz,&to_bt); + getbinuptime(&now); + bintime_mul(&to_bt,to_ticks); + bintime_add(&to_bt,&now); + } + else + to_bt = *bt; /* * Don't allow migration of pre-allocated callouts lest they * become unbalanced. @@ -892,14 +902,14 @@ callout_reset_bt_on(struct callout *c, s if (c->c_cpu != cpu) { if (cc->cc_curr == c) { cc->cc_migration_cpu = cpu; - cc->cc_migration_time = bt; + cc->cc_migration_time = to_bt; cc->cc_migration_func = ftn; cc->cc_migration_arg = arg; c->c_flags |= CALLOUT_DFRMIGRATION; CTR6(KTR_CALLOUT, "migration of %p func %p arg %p in %d.%08x to %u deferred", - c, c->c_func, c->c_arg, (int)(bt.sec), - (u_int)(bt.frac >> 32), cpu); + c, c->c_func, c->c_arg, (int)(to_bt.sec), + (u_int)(to_bt.frac >> 32), cpu); CC_UNLOCK(cc); return (cancelled); } @@ -907,28 +917,15 @@ callout_reset_bt_on(struct callout *c, s } #endif - callout_cc_add(c, cc, bt, ftn, arg, cpu, direct); + callout_cc_add(c, cc, to_bt, ftn, arg, cpu, flags); CTR6(KTR_CALLOUT, "%sscheduled %p func %p arg %p in %d.%08x", - cancelled ? "re" : "", c, c->c_func, c->c_arg, (int)(bt.sec), - (u_int)(bt.frac >> 32)); + cancelled ? "re" : "", c, c->c_func, c->c_arg, (int)(to_bt.sec), + (u_int)(to_bt.frac >> 32)); CC_UNLOCK(cc); return (cancelled); } -int -callout_reset_on(struct callout *c, int to_ticks, void (*ftn)(void *), - void *arg, int cpu) -{ - struct bintime bt, now; - - FREQ2BT(hz,&bt); - getbinuptime(&now); - bintime_mul(&bt,to_ticks); - bintime_add(&bt,&now); - return (callout_reset_bt_on(c, bt, ftn, arg, cpu, 0)); -} - /* * Common idioms that can be optimized in the future. */ Modified: projects/calloutng/sys/kern/subr_sleepqueue.c ============================================================================== --- projects/calloutng/sys/kern/subr_sleepqueue.c Tue Jun 19 18:42:24 2012 (r237274) +++ projects/calloutng/sys/kern/subr_sleepqueue.c Tue Jun 19 19:40:54 2012 (r237275) @@ -378,7 +378,7 @@ _sleepq_set_timeout(void *wchan, struct callout_reset_curcpu(&td->td_slpcallout, timo, sleepq_timeout, td); else - callout_reset_bt_on(&td->td_slpcallout, *bt, + callout_reset_bt_on(&td->td_slpcallout, bt, sleepq_timeout, td, PCPU_GET(cpuid), 0); } Modified: projects/calloutng/sys/sys/callout.h ============================================================================== --- projects/calloutng/sys/sys/callout.h Tue Jun 19 18:42:24 2012 (r237274) +++ projects/calloutng/sys/sys/callout.h Tue Jun 19 19:40:54 2012 (r237275) @@ -54,6 +54,8 @@ struct callout_handle { struct callout *callout; }; +#define C_DIRECT 0x0001 /* direct execution of callout */ + #ifdef _KERNEL extern int ncallout; @@ -69,9 +71,16 @@ void _callout_init_lock(struct callout * _callout_init_lock((c), ((rw) != NULL) ? &(rw)->lock_object : \ NULL, (flags)) #define callout_pending(c) ((c)->c_flags & CALLOUT_PENDING) -int callout_reset_bt_on(struct callout *, struct bintime, void(*)(void *), - void *, int, int); -int callout_reset_on(struct callout *, int, void (*)(void *), void *, int); +int _callout_reset_on(struct callout *, struct bintime *, int, + void (*)(void *), void *, int, int); +#define callout_reset_on(c, to_ticks, fn, arg, cpu) \ + _callout_reset_on((c), (NULL), (to_ticks), (fn), (arg), (cpu), \ + (0)) +#define callout_reset_flags_on(c, to_ticks, fn, arg, cpu, flags) \ + _callout_reset_on((c), (NULL), (to_ticks), (fn), (arg), (cpu), \ + (flags)) +#define callout_reset_bt_on(c, bt, fn, arg, cpu, flags) \ + _callout_reset_on((c), (bt), (0), (fn), (arg), (cpu), (flags)) #define callout_reset(c, on_tick, fn, arg) \ callout_reset_on((c), (on_tick), (fn), (arg), (c)->c_cpu) #define callout_reset_curcpu(c, on_tick, fn, arg) \ From owner-svn-src-projects@FreeBSD.ORG Wed Jun 20 00:13:45 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 185EE106564A; Wed, 20 Jun 2012 00:13:45 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03CF98FC0C; Wed, 20 Jun 2012 00:13:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5K0Die5005579; Wed, 20 Jun 2012 00:13:44 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5K0Di1e005576; Wed, 20 Jun 2012 00:13:44 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206200013.q5K0Di1e005576@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 20 Jun 2012 00:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237280 - in projects/bmake: etc/mtree include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 00:13:45 -0000 Author: obrien Date: Wed Jun 20 00:13:44 2012 New Revision: 237280 URL: http://svn.freebsd.org/changeset/base/237280 Log: MFC: r237279: install filemon.h Modified: projects/bmake/etc/mtree/BSD.include.dist projects/bmake/include/Makefile Directory Properties: projects/bmake/ (props changed) Modified: projects/bmake/etc/mtree/BSD.include.dist ============================================================================== --- projects/bmake/etc/mtree/BSD.include.dist Wed Jun 20 00:09:47 2012 (r237279) +++ projects/bmake/etc/mtree/BSD.include.dist Wed Jun 20 00:13:44 2012 (r237280) @@ -102,6 +102,8 @@ .. ciss .. + filemon + .. firewire .. hwpmc Modified: projects/bmake/include/Makefile ============================================================================== --- projects/bmake/include/Makefile Wed Jun 20 00:09:47 2012 (r237279) +++ projects/bmake/include/Makefile Wed Jun 20 00:13:44 2012 (r237280) @@ -39,7 +39,7 @@ LDIRS= bsm cam geom net net80211 netatal sys vm LSUBDIRS= cam/ata cam/scsi \ - dev/acpica dev/an dev/bktr dev/ciss dev/firewire dev/hwpmc \ + dev/acpica dev/an dev/bktr dev/ciss dev/filemon dev/firewire dev/hwpmc \ dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \ dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ From owner-svn-src-projects@FreeBSD.ORG Wed Jun 20 00:41:31 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9B37106564A; Wed, 20 Jun 2012 00:41:31 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C30918FC12; Wed, 20 Jun 2012 00:41:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5K0fVJr006942; Wed, 20 Jun 2012 00:41:31 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5K0fVuO006940; Wed, 20 Jun 2012 00:41:31 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201206200041.q5K0fVuO006940@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 20 Jun 2012 00:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237283 - in projects/bmake: external external/bsd external/bsd/bmake external/bsd/bmake/dist external/bsd/bmake/usr.bin external/bsd/bmake/usr.bin/bmake usr.bin/make X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 00:41:31 -0000 Author: obrien Date: Wed Jun 20 00:41:31 2012 New Revision: 237283 URL: http://svn.freebsd.org/changeset/base/237283 Log: MFC: r237282: version typo Added: projects/bmake/external/ projects/bmake/external/bsd/ projects/bmake/external/bsd/bmake/ projects/bmake/external/bsd/bmake/dist/ - copied from r236770, vendor/NetBSD/bmake/dist/ projects/bmake/external/bsd/bmake/usr.bin/ projects/bmake/external/bsd/bmake/usr.bin/bmake/ Modified: projects/bmake/usr.bin/make/Makefile Directory Properties: projects/bmake/ (props changed) Modified: projects/bmake/usr.bin/make/Makefile ============================================================================== --- projects/bmake/usr.bin/make/Makefile Wed Jun 20 00:37:00 2012 (r237282) +++ projects/bmake/usr.bin/make/Makefile Wed Jun 20 00:41:31 2012 (r237283) @@ -15,7 +15,7 @@ NO_SHARED?= YES .endif # Version has the RYYYYMMDDX format, where R is from RELENG_ -CFLAGS+=-DMAKE_VERSION=\"10201120530\" +CFLAGS+=-DMAKE_VERSION=\"10201205300\" # There is no obvious performance improvement currently. # CFLAGS+=-DUSE_KQUEUE From owner-svn-src-projects@FreeBSD.ORG Wed Jun 20 05:26:02 2012 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EEE8106566C; Wed, 20 Jun 2012 05:26:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx06.syd.optusnet.com.au (fallbackmx06.syd.optusnet.com.au [211.29.132.8]) by mx1.freebsd.org (Postfix) with ESMTP id 24FAD8FC14; Wed, 20 Jun 2012 05:26:01 +0000 (UTC) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by fallbackmx06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q5K5PtGM027896; Wed, 20 Jun 2012 15:25:55 +1000 Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q5K5Piqe012526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 20 Jun 2012 15:25:45 +1000 Date: Wed, 20 Jun 2012 15:25:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Davide Italiano In-Reply-To: Message-ID: <20120620151115.A1111@besplex.bde.org> References: <201206172045.q5HKjj92031635@svn.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-670748366-1340169944=:1111" Cc: Attilio Rao , svn-src-projects@FreeBSD.org, Alexander Motin , src-committers@FreeBSD.org Subject: Re: svn commit: r237202 - in projects/calloutng/sys: kern sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 05:26:02 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-670748366-1340169944=:1111 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Tue, 19 Jun 2012, Davide Italiano wrote: > On Mon, Jun 18, 2012 at 3:40 PM, Attilio Rao wrote: >> 2012/6/17, Davide Italiano : >>> Author: davide >>> Date: Sun Jun 17 20:45:45 2012 >>> New Revision: 237202 >>> URL: http://svn.freebsd.org/changeset/base/237202 >>> >>> Log: >>> =A0 - Extend the condvar(9) KPI introducing a new cv_timedwait_bt_sig() >>> =A0 function so that we can specify timeout precision in terms of struc= t >>> =A0 bintime. >>> >>> =A0 - Now seltdwait() takes three argument rather than two so that thei= r >>> =A0 consumers can specify if the timeout should be passed as ticks or >>> bintime. >>> >>> =A0 - Refactor the kern_select() and the sys_poll() code so that these = two >>> =A0 services may rely on cv_timedwait_bt_sig() rather than on the previ= ous >>> less >>> =A0 precise cv_timedwait_sig(). >>> >>> =A0 - Rethink the sleepqueue(9) KPI in order to make an attempt of avoi= ding >>> =A0 both code duplication and breakages. Your mileage WILL vary, feel f= ree to >>> =A0 comment. >> >> I would still prefer the unified KPI, but at least the committed code >> avoids code-duplication, I appreciate your effort here, thanks. >> >> Why you don't do the same thing for callout_ KPI? I prefer separate functions with no flags args to tell them who they are, or at least macros to hide the difference (like timeout() still existss, and tsleep() is still spelled tsleep() although it is really msleep() with a macro hiding this). > Attilio, > here you can find a patch: > http://people.freebsd.org/~davide/callout_refactorkpi.diff > I'm not confident enough at this point to break all the > callout_reset_on() stuffs, but at least I thought it's good to provide > a variant of it named callout_reset_direct_on() that takes an additive > parameter so that you can specifiy if you want to execute your callout > directly from hw interrupt context or in SWI thread. I also patched > the callout_reset_on() to always execute in SWI thread, as it has done > until now. Note that this solution is a good compromise among > breakages and code duplication avoidance, even though, as you pointed > out makes the KPI more verbose. > If you want to make a review, feel free. > I've some doubt on the style of the macros I've added, to I cc'ed > Bruce, I guess he's the best person to point me out what I'm doing > wrong. I see you committed it. I pointed out some problems not related to the APIs in private mail. The macros for hiding the details of the API changes seem reasonable. % Index: sys/sys/callout.h % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D % --- sys/sys/callout.h=09(revision 237202) % +++ sys/sys/callout.h=09(working copy) % ... % @@ -69,9 +71,16 @@ % =09_callout_init_lock((c), ((rw) !=3D NULL) ? &(rw)->lock_object :=09\ % =09 NULL, (flags)) % #define=09callout_pending(c)=09((c)->c_flags & CALLOUT_PENDING) % -int=09callout_reset_bt_on(struct callout *, struct bintime, void(*)(void= *), % -=09 void *, int, int); % -int=09callout_reset_on(struct callout *, int, void (*)(void *), void *, = int); % +int=09_callout_reset_on(struct callout *, struct bintime *, int, % +=09 void (*)(void *), void *, int, int); % +#define=09callout_reset_on(c, to_ticks, fn, arg, cpu)=09=09=09\ % + _callout_reset_on((c), (NULL), (to_ticks), (fn), (arg), (cpu),=09\ % + (0)) % +#define callout_reset_flags_on(c, to_ticks, fn, arg, cpu, flags)=09\ % + _callout_reset_on((c), (NULL), (to_ticks), (fn), (arg), (cpu),=09\ % + (flags))=20 % +#define callout_reset_bt_on(c, bt, fn, arg, cpu, direct)=09=09\ % + _callout_reset_on((c), (bt), (0), (fn), (arg), (cpu), (direct))=20 % #define=09callout_reset(c, on_tick, fn, arg)=09=09=09=09\ % callout_reset_on((c), (on_tick), (fn), (arg), (c)->c_cpu) % #define=09callout_reset_curcpu(c, on_tick, fn, arg)=09=09=09\ I think I would sort the macros more. They don't have to be unsorted to place them after the functions that they invoke. Either put them all in a macro section separate from the prototypes, or sort them in the prototype= s. 2 out of 3 of the the new #defines have tab lossage, unlike all of the old #defines. The parentheses around (0) and (NULL)) are bogus. Especially the latter. Parentheses that are necessary are ugly enough, and using unnecessary ones makes it harder to see that all the necessary ones are there. After removing unnecessary parentheses, 2 lines need splitting even less than before. I didn't notice so many style bugs in the committed version. Bruce --0-670748366-1340169944=:1111-- From owner-svn-src-projects@FreeBSD.ORG Wed Jun 20 11:30:16 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EC84106564A; Wed, 20 Jun 2012 11:30:16 +0000 (UTC) (envelope-from cherry@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 607508FC20; Wed, 20 Jun 2012 11:30:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KBUGBb039404; Wed, 20 Jun 2012 11:30:16 GMT (envelope-from cherry@svn.freebsd.org) Received: (from cherry@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KBUGAD039400; Wed, 20 Jun 2012 11:30:16 GMT (envelope-from cherry@svn.freebsd.org) Message-Id: <201206201130.q5KBUGAD039400@svn.freebsd.org> From: "Cherry G. Mathew" Date: Wed, 20 Jun 2012 11:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237299 - in projects/amd64_xen_pv/sys/amd64: include xen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 11:30:16 -0000 Author: cherry Date: Wed Jun 20 11:30:15 2012 New Revision: 237299 URL: http://svn.freebsd.org/changeset/base/237299 Log: Add more Xen interface primitives to privileged ops (eg: cli, load_cr3 etc ) Approved by: gibbs (implicit) Modified: projects/amd64_xen_pv/sys/amd64/include/cpufunc.h projects/amd64_xen_pv/sys/amd64/xen/machdep.c projects/amd64_xen_pv/sys/amd64/xen/mm.c Modified: projects/amd64_xen_pv/sys/amd64/include/cpufunc.h ============================================================================== --- projects/amd64_xen_pv/sys/amd64/include/cpufunc.h Wed Jun 20 10:59:11 2012 (r237298) +++ projects/amd64_xen_pv/sys/amd64/include/cpufunc.h Wed Jun 20 11:30:15 2012 (r237299) @@ -46,9 +46,11 @@ #ifdef XEN extern void xen_cli(void); extern void xen_sti(void); -extern void xen_load_cr3(u_int data); +extern u_long xen_rcr2(void); +extern void xen_load_cr3(u_long data); extern void xen_tlb_flush(void); extern void xen_invlpg(vm_offset_t addr); +extern void write_rflags(u_long rflags); extern u_long read_rflags(void); #endif /* XEN */ @@ -118,7 +120,11 @@ clflush(u_long addr) static __inline void disable_intr(void) { +#ifdef XEN + xen_cli(); +#else __asm __volatile("cli" : : : "memory"); +#endif } static __inline void @@ -355,7 +361,11 @@ wbinvd(void) } static __inline void +#ifdef XEN +_write_rflags(u_long rf) +#else write_rflags(u_long rf) +#endif { __asm __volatile("pushq %0; popfq" : : "r" (rf)); } @@ -391,6 +401,9 @@ rcr2(void) { u_long data; +#ifdef XEN + return (xen_rcr2()); +#endif __asm __volatile("movq %%cr2,%0" : "=r" (data)); return (data); } @@ -398,8 +411,11 @@ rcr2(void) static __inline void load_cr3(u_long data) { - +#ifdef XEN + xen_load_cr3(data); +#else __asm __volatile("movq %0,%%cr3" : : "r" (data) : "memory"); +#endif } static __inline u_long @@ -443,8 +459,11 @@ invltlb(void) static __inline void invlpg(u_long addr) { - +#ifdef XEN + xen_invlpg(addr); +#else __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory"); +#endif } static __inline u_short Modified: projects/amd64_xen_pv/sys/amd64/xen/machdep.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/xen/machdep.c Wed Jun 20 10:59:11 2012 (r237298) +++ projects/amd64_xen_pv/sys/amd64/xen/machdep.c Wed Jun 20 11:30:15 2012 (r237299) @@ -367,7 +367,7 @@ initxen(struct start_info *si) if (si->mod_start != 0) { /* we have a ramdisk or kernel module */ preload_metadata = (caddr_t)(si->mod_start); - // preload_bootstrap_relocate(KERNBASE); XXX: not sure this is needed. + preload_bootstrap_relocate(KERNBASE); } kmdp = preload_search_by_type("elf kernel"); @@ -376,8 +376,7 @@ initxen(struct start_info *si) #ifdef notyet boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); // XXX: + - // KERNBASE; + kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); #endif /* notyet */ #ifdef DDB @@ -446,8 +445,8 @@ initxen(struct start_info *si) init_param2(physmem); - //msgbufinit(msgbufp, msgbufsize); - //fpuinit(); + msgbufinit(msgbufp, msgbufsize); + //fpuinit(); XXX: TODO /* * Set up thread0 pcb after fpuinit calculated pcb + fpu save @@ -466,9 +465,6 @@ initxen(struct start_info *si) _ufssel = GSEL(GUFS32_SEL, SEL_UPL); _ugssel = GSEL(GUGS32_SEL, SEL_UPL); - /* console */ - printk("Hello world!\n"); - return (u_int64_t) thread0.td_pcb; } @@ -1053,19 +1049,30 @@ printk(const char *fmt, ...) static __inline void -cpu_write_rflags(u_int ef) +cpu_write_rflags(u_long rf) { - __asm __volatile("pushl %0; popfl" : : "r" (ef)); + __asm __volatile("pushq %0; popfq" : : "r" (rf)); } -static __inline u_int +static __inline u_long cpu_read_rflags(void) { - u_int ef; + u_long rf; + + __asm __volatile("pushfq; popq %0" : "=r" (rf)); + return (rf); +} + +#ifdef KTR +static __inline u_long +rrbp(void) +{ + u_long data; - __asm __volatile("pushfl; popl %0" : "=r" (ef)); - return (ef); + __asm __volatile("movq 4(%%rbp),%0" : "=r" (data)); + return (data); } +#endif u_long read_rflags(void) @@ -1082,6 +1089,17 @@ read_rflags(void) } void +write_rflags(u_long rflags) +{ + u_int intr; + + CTR2(KTR_SPARE2, "%x xen_restore_flags rflags %x", rrbp(), rflags); + intr = ((rflags & PSL_I) == 0); + __restore_flags(intr); + _write_rflags(rflags); +} + +void xen_cli(void) { CTR1(KTR_SPARE2, "%x xen_cli disabling interrupts", rrbp()); @@ -1095,6 +1113,13 @@ xen_sti(void) __sti(); } +u_long +xen_rcr2(void) +{ + + return (HYPERVISOR_shared_info->vcpu_info[curcpu].arch.cr2); +} + char *console_page; #include struct amd64tss common_tss[MAXCPU]; Modified: projects/amd64_xen_pv/sys/amd64/xen/mm.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/xen/mm.c Wed Jun 20 10:59:11 2012 (r237298) +++ projects/amd64_xen_pv/sys/amd64/xen/mm.c Wed Jun 20 11:30:15 2012 (r237299) @@ -158,6 +158,12 @@ xen_invlpg(vm_offset_t va) PANIC_IF(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0); } +inline void +xen_load_cr3(u_long val) +{ + xen_pt_switch(val); +} + void xen_pt_switch(vm_paddr_t kpml4phys) { @@ -195,8 +201,10 @@ _xen_queue_pt_update(vm_paddr_t ptr, vm_ { SET_VCPU(); +#ifdef revisit if (__predict_true(gdtset)) mtx_assert(&vm_page_queue_mtx, MA_OWNED); +#endif KASSERT((ptr & 7) == 0, ("misaligned update")); From owner-svn-src-projects@FreeBSD.ORG Wed Jun 20 14:22:39 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 453D1106566C; Wed, 20 Jun 2012 14:22:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3163F8FC1A; Wed, 20 Jun 2012 14:22:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KEMdxJ047348; Wed, 20 Jun 2012 14:22:39 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEMc23047346; Wed, 20 Jun 2012 14:22:38 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206201422.q5KEMc23047346@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 20 Jun 2012 14:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237312 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:22:39 -0000 Author: glebius Date: Wed Jun 20 14:22:38 2012 New Revision: 237312 URL: http://svn.freebsd.org/changeset/base/237312 Log: Don't use locking in the clone destroy routine. Modified: projects/pf/head/sys/contrib/pf/net/if_pfsync.c Modified: projects/pf/head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/if_pfsync.c Wed Jun 20 14:19:55 2012 (r237311) +++ projects/pf/head/sys/contrib/pf/net/if_pfsync.c Wed Jun 20 14:22:38 2012 (r237312) @@ -362,7 +362,6 @@ pfsync_clone_destroy(struct ifnet *ifp) * drain callouts. */ relock: - PFSYNC_LOCK(sc); while (sc->sc_deferred > 0) { struct pfsync_deferral *pd = TAILQ_FIRST(&sc->sc_deferrals); @@ -374,7 +373,6 @@ relock: free(pd, M_PFSYNC); } else { pd->pd_refs++; - PFSYNC_UNLOCK(sc); callout_drain(&pd->pd_tmo); free(pd, M_PFSYNC); goto relock; From owner-svn-src-projects@FreeBSD.ORG Wed Jun 20 14:24:13 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC8DB106567B; Wed, 20 Jun 2012 14:24:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C840F8FC15; Wed, 20 Jun 2012 14:24:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KEODTk047562; Wed, 20 Jun 2012 14:24:13 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEODTh047560; Wed, 20 Jun 2012 14:24:13 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206201424.q5KEODTh047560@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 20 Jun 2012 14:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237314 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:24:14 -0000 Author: glebius Date: Wed Jun 20 14:24:13 2012 New Revision: 237314 URL: http://svn.freebsd.org/changeset/base/237314 Log: Don't leak mship in case if we specify syncpeer. Modified: projects/pf/head/sys/contrib/pf/net/if_pfsync.c Modified: projects/pf/head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/if_pfsync.c Wed Jun 20 14:23:10 2012 (r237313) +++ projects/pf/head/sys/contrib/pf/net/if_pfsync.c Wed Jun 20 14:24:13 2012 (r237314) @@ -1323,7 +1323,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cm struct ip_moptions *imo = &sc->sc_imo; struct ifnet *sifp; struct ip *ip; - void *mship; + void *mship = NULL; if ((error = priv_check(curthread, PRIV_NETINET_PF)) != 0) return (error); @@ -1338,8 +1338,9 @@ pfsyncioctl(struct ifnet *ifp, u_long cm else if ((sifp = ifunit_ref(pfsyncr.pfsyncr_syncdev)) == NULL) return (EINVAL); - mship = malloc((sizeof(struct in_multi *) * - IP_MIN_MEMBERSHIPS), M_PFSYNC, M_WAITOK | M_ZERO); + if (pfsyncr.pfsyncr_syncpeer.s_addr == 0 && sifp != NULL) + mship = malloc((sizeof(struct in_multi *) * + IP_MIN_MEMBERSHIPS), M_PFSYNC, M_WAITOK | M_ZERO); PFSYNC_LOCK(sc); if (pfsyncr.pfsyncr_syncpeer.s_addr == 0) @@ -1364,7 +1365,6 @@ pfsyncioctl(struct ifnet *ifp, u_long cm if (imo->imo_membership) pfsync_multicast_cleanup(sc); PFSYNC_UNLOCK(sc); - free(mship, M_PFSYNC); break; } From owner-svn-src-projects@FreeBSD.ORG Thu Jun 21 09:08:12 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34F131065673; Thu, 21 Jun 2012 09:08:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20CAE8FC1F; Thu, 21 Jun 2012 09:08:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5L98BqV000885; Thu, 21 Jun 2012 09:08:11 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L98BG5000881; Thu, 21 Jun 2012 09:08:11 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206210908.q5L98BG5000881@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 21 Jun 2012 09:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237363 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 09:08:12 -0000 Author: glebius Date: Thu Jun 21 09:08:11 2012 New Revision: 237363 URL: http://svn.freebsd.org/changeset/base/237363 Log: Fix couple off-by-ones when traversing source nodes hash. Modified: projects/pf/head/sys/contrib/pf/net/pf.c projects/pf/head/sys/contrib/pf/net/pf_ioctl.c projects/pf/head/sys/contrib/pf/net/pfvar.h Modified: projects/pf/head/sys/contrib/pf/net/pf.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf.c Thu Jun 21 08:55:07 2012 (r237362) +++ projects/pf/head/sys/contrib/pf/net/pf.c Thu Jun 21 09:08:11 2012 (r237363) @@ -744,7 +744,7 @@ pf_initialize() V_pf_srchash = malloc((PF_HASHSIZ / 4) * sizeof(struct pf_srchash), M_PFHASH, M_WAITOK|M_ZERO); V_pf_srchashmask = (PF_HASHSIZ / 4) - 1; - for (i = 0, sh = V_pf_srchash; i < V_pf_srchashmask; i++, sh++) + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) mtx_init(&sh->lock, "pf_srchash", NULL, MTX_DEF); /* ALTQ */ @@ -1397,7 +1397,7 @@ pf_purge_expired_src_nodes() struct pf_src_node *cur, *next; int i; - for (i = 0, sh = V_pf_srchash; i < V_pf_srchashmask; i++, sh++) { + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH_SAFE(cur, &sh->nodes, entry, next) if (cur->states <= 0 && cur->expire <= time_uptime) { Modified: projects/pf/head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf_ioctl.c Thu Jun 21 08:55:07 2012 (r237362) +++ projects/pf/head/sys/contrib/pf/net/pf_ioctl.c Thu Jun 21 09:08:11 2012 (r237363) @@ -136,8 +136,6 @@ static int pf_addr_setup(struct pf_rul static void pf_addr_copyout(struct pf_addr_wrap *); VNET_DEFINE(struct pf_rule, pf_default_rule); -VNET_DEFINE(struct sx, pf_consistency_lock); -#define V_pf_consistency_lock VNET(pf_consistency_lock) #ifdef ALTQ static VNET_DEFINE(int, pf_altq_running); @@ -227,22 +225,6 @@ export_pflow_t *export_pflow_ptr = NUL /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; -static void -init_pf_mutex(void) -{ - - rw_init(&pf_rules_lock, "pf rulesets"); - sx_init(&V_pf_consistency_lock, "pfioctl"); -} - -static void -destroy_pf_mutex(void) -{ - - rw_destroy(&pf_rules_lock); - sx_destroy(&V_pf_consistency_lock); -} - static int pfattach(void) { @@ -1110,8 +1092,6 @@ pfioctl(struct cdev *dev, u_long cmd, ca return (EACCES); } - sx_xlock(&V_pf_consistency_lock); - switch (cmd) { case DIOCSTART: PF_RULES_WLOCK(); @@ -3288,7 +3268,6 @@ DIOCCHANGEADDR_error: break; } fail: - sx_xunlock(&V_pf_consistency_lock); CURVNET_RESTORE(); return (error); @@ -3744,7 +3723,8 @@ pf_load(void) } VNET_LIST_RUNLOCK(); - init_pf_mutex(); + rw_init(&pf_rules_lock, "pf rulesets"); + pf_dev = make_dev(&pf_cdevsw, 0, 0, 0, 0600, PF_NAME); if ((error = pfattach()) != 0) return (error); @@ -3785,7 +3765,7 @@ pf_unload(void) pf_cleanup(); PF_RULES_WUNLOCK(); destroy_dev(pf_dev); - destroy_pf_mutex(); + rw_destroy(&pf_rules_lock); return (error); } Modified: projects/pf/head/sys/contrib/pf/net/pfvar.h ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pfvar.h Thu Jun 21 08:55:07 2012 (r237362) +++ projects/pf/head/sys/contrib/pf/net/pfvar.h Thu Jun 21 09:08:11 2012 (r237363) @@ -39,7 +39,6 @@ #include #include #include -#include #include #include From owner-svn-src-projects@FreeBSD.ORG Thu Jun 21 09:12:34 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F16A0106564A; Thu, 21 Jun 2012 09:12:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD01A8FC1B; Thu, 21 Jun 2012 09:12:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5L9CXwc001298; Thu, 21 Jun 2012 09:12:33 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L9CXpt001296; Thu, 21 Jun 2012 09:12:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206210912.q5L9CXpt001296@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 21 Jun 2012 09:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237364 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 09:12:34 -0000 Author: glebius Date: Thu Jun 21 09:12:33 2012 New Revision: 237364 URL: http://svn.freebsd.org/changeset/base/237364 Log: Finish what leaked into r237363: - remove the sx lock for pf_ioctl(). I believe correct use of PF_RULES_WLOCK() is sufficient to protect concurrent ioctl() calls from each other. - inline init_pf_mutex/destroy_pf_mutex. Modified: projects/pf/head/sys/contrib/pf/net/pf.c Modified: projects/pf/head/sys/contrib/pf/net/pf.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf.c Thu Jun 21 09:08:11 2012 (r237363) +++ projects/pf/head/sys/contrib/pf/net/pf.c Thu Jun 21 09:12:33 2012 (r237364) @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-projects@FreeBSD.ORG Thu Jun 21 09:46:23 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E888106566B; Thu, 21 Jun 2012 09:46:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48E348FC12; Thu, 21 Jun 2012 09:46:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5L9kNUw002946; Thu, 21 Jun 2012 09:46:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L9kNjW002944; Thu, 21 Jun 2012 09:46:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206210946.q5L9kNjW002944@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 21 Jun 2012 09:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237368 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 09:46:23 -0000 Author: glebius Date: Thu Jun 21 09:46:22 2012 New Revision: 237368 URL: http://svn.freebsd.org/changeset/base/237368 Log: Finish r237312. Modified: projects/pf/head/sys/contrib/pf/net/if_pfsync.c Modified: projects/pf/head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/if_pfsync.c Thu Jun 21 09:26:06 2012 (r237367) +++ projects/pf/head/sys/contrib/pf/net/if_pfsync.c Thu Jun 21 09:46:22 2012 (r237368) @@ -361,7 +361,6 @@ pfsync_clone_destroy(struct ifnet *ifp) * cleared by pfsync_uninit(), and we have only to * drain callouts. */ -relock: while (sc->sc_deferred > 0) { struct pfsync_deferral *pd = TAILQ_FIRST(&sc->sc_deferrals); @@ -375,7 +374,6 @@ relock: pd->pd_refs++; callout_drain(&pd->pd_tmo); free(pd, M_PFSYNC); - goto relock; } } From owner-svn-src-projects@FreeBSD.ORG Thu Jun 21 09:47:06 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18B64106566B; Thu, 21 Jun 2012 09:47:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0483B8FC18; Thu, 21 Jun 2012 09:47:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5L9l5S0003020; Thu, 21 Jun 2012 09:47:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L9l5dD003017; Thu, 21 Jun 2012 09:47:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206210947.q5L9l5dD003017@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 21 Jun 2012 09:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237369 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 09:47:06 -0000 Author: glebius Date: Thu Jun 21 09:47:05 2012 New Revision: 237369 URL: http://svn.freebsd.org/changeset/base/237369 Log: Use the pf_rules_lock to correctly finish the expiry thread. Modified: projects/pf/head/sys/contrib/pf/net/pf.c projects/pf/head/sys/contrib/pf/net/pf_ioctl.c Modified: projects/pf/head/sys/contrib/pf/net/pf.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf.c Thu Jun 21 09:46:22 2012 (r237368) +++ projects/pf/head/sys/contrib/pf/net/pf.c Thu Jun 21 09:47:05 2012 (r237369) @@ -1317,14 +1317,16 @@ pf_purge_thread(void *v) CURVNET_SET((struct vnet *)v); + PF_RULES_RLOCK(); for (;;) { - tsleep(pf_purge_thread, PWAIT, "pftm", hz / 10); + rw_sleep(pf_purge_thread, &pf_rules_lock, 0, "pftm", hz / 10); if (V_pf_end_threads) { pf_purge_expired_states(V_pf_hashmask + 1); pf_purge_expired_fragments(); pf_purge_expired_src_nodes(); V_pf_end_threads++; + PF_RULES_RUNLOCK(); wakeup(pf_purge_thread); kproc_exit(0); } Modified: projects/pf/head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf_ioctl.c Thu Jun 21 09:46:22 2012 (r237368) +++ projects/pf/head/sys/contrib/pf/net/pf_ioctl.c Thu Jun 21 09:47:05 2012 (r237369) @@ -3756,7 +3756,7 @@ pf_unload(void) V_pf_end_threads = 1; while (V_pf_end_threads < 2) { wakeup_one(pf_purge_thread); - tsleep(pf_purge_thread, PWAIT, "pftmo", hz); + rw_sleep(pf_purge_thread, &pf_rules_lock, 0, "pftmo", 0); } pf_normalize_cleanup(); pfi_cleanup(); From owner-svn-src-projects@FreeBSD.ORG Thu Jun 21 10:21:14 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF6A4106566B; Thu, 21 Jun 2012 10:21:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAA658FC08; Thu, 21 Jun 2012 10:21:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5LALE2d006458; Thu, 21 Jun 2012 10:21:14 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LALEnl006456; Thu, 21 Jun 2012 10:21:14 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206211021.q5LALEnl006456@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 21 Jun 2012 10:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237376 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 10:21:15 -0000 Author: glebius Date: Thu Jun 21 10:21:14 2012 New Revision: 237376 URL: http://svn.freebsd.org/changeset/base/237376 Log: - To free all rules when shutting down we need to perform a couple of scans. Do this and provide some comments to explain what is going on here. - We can't call into pf_purge_unlinked_rules() with rules lock held, since it would obtain it exclusively. Modified: projects/pf/head/sys/contrib/pf/net/pf.c Modified: projects/pf/head/sys/contrib/pf/net/pf.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf.c Thu Jun 21 10:06:00 2012 (r237375) +++ projects/pf/head/sys/contrib/pf/net/pf.c Thu Jun 21 10:21:14 2012 (r237376) @@ -1317,19 +1317,45 @@ pf_purge_thread(void *v) CURVNET_SET((struct vnet *)v); - PF_RULES_RLOCK(); for (;;) { + PF_RULES_RLOCK(); rw_sleep(pf_purge_thread, &pf_rules_lock, 0, "pftm", hz / 10); if (V_pf_end_threads) { + /* + * To cleanse up all kifs and rules we need + * two runs: first one clears reference flags, + * then pf_purge_expired_states() doesn't + * raise them, and then second run frees. + */ + PF_RULES_RUNLOCK(); + pf_purge_unlinked_rules(); + pfi_kif_purge(); + + /* + * Now purge everything. + */ pf_purge_expired_states(V_pf_hashmask + 1); pf_purge_expired_fragments(); pf_purge_expired_src_nodes(); + + /* + * Now all kifs & rules should be unreferenced, + * thus should be successfully freed. + */ + pf_purge_unlinked_rules(); + pfi_kif_purge(); + + /* + * Announce success and exit. + */ + PF_RULES_RLOCK(); V_pf_end_threads++; PF_RULES_RUNLOCK(); wakeup(pf_purge_thread); kproc_exit(0); } + PF_RULES_RUNLOCK(); /* Process 1/interval fraction of the state table every run. */ fullrun = pf_purge_expired_states(V_pf_hashmask / From owner-svn-src-projects@FreeBSD.ORG Thu Jun 21 11:39:57 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 91EBB106564A; Thu, 21 Jun 2012 11:39:57 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E1F38FC0C; Thu, 21 Jun 2012 11:39:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5LBdvSq010417; Thu, 21 Jun 2012 11:39:57 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LBdvdT010415; Thu, 21 Jun 2012 11:39:57 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201206211139.q5LBdvdT010415@svn.freebsd.org> From: Attilio Rao Date: Thu, 21 Jun 2012 11:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237387 - projects/amd64_xen_pv/sys/vm X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 11:39:57 -0000 Author: attilio Date: Thu Jun 21 11:39:56 2012 New Revision: 237387 URL: http://svn.freebsd.org/changeset/base/237387 Log: Exclude dump pages for the moment. They should be mapped into the kernel virtual address area before they can really work. Modified: projects/amd64_xen_pv/sys/vm/vm_page.c Modified: projects/amd64_xen_pv/sys/vm/vm_page.c ============================================================================== --- projects/amd64_xen_pv/sys/vm/vm_page.c Thu Jun 21 11:23:38 2012 (r237386) +++ projects/amd64_xen_pv/sys/vm/vm_page.c Thu Jun 21 11:39:56 2012 (r237387) @@ -348,7 +348,7 @@ vm_page_startup(vm_offset_t vaddr) new_end + vm_page_dump_size, VM_PROT_READ | VM_PROT_WRITE); bzero((void *)vm_page_dump, vm_page_dump_size); #endif -#ifdef __amd64__ +#if defined(__amd64__) && !defined(XEN) /* * Request that the physical pages underlying the message buffer be * included in a crash dump. Since the message buffer is accessed From owner-svn-src-projects@FreeBSD.ORG Thu Jun 21 16:21:32 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2794A1065673; Thu, 21 Jun 2012 16:21:32 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC6558FC0C; Thu, 21 Jun 2012 16:21:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5LGLVVk023579; Thu, 21 Jun 2012 16:21:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LGLVGU023575; Thu, 21 Jun 2012 16:21:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201206211621.q5LGLVGU023575@svn.freebsd.org> From: Attilio Rao Date: Thu, 21 Jun 2012 16:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237403 - in projects/amd64_xen_pv/sys: amd64/include/xen amd64/xen kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 16:21:32 -0000 Author: attilio Date: Thu Jun 21 16:21:31 2012 New Revision: 237403 URL: http://svn.freebsd.org/changeset/base/237403 Log: Until console is not working, redirect the output of panic on the emergency console. This is a bit hackish as it uses an MD interface on MI directly, but this code is thought to be removed soon anyway. Reviewed by: cherry Modified: projects/amd64_xen_pv/sys/amd64/include/xen/xen-os.h projects/amd64_xen_pv/sys/amd64/xen/machdep.c projects/amd64_xen_pv/sys/kern/kern_shutdown.c Modified: projects/amd64_xen_pv/sys/amd64/include/xen/xen-os.h ============================================================================== --- projects/amd64_xen_pv/sys/amd64/include/xen/xen-os.h Thu Jun 21 15:47:06 2012 (r237402) +++ projects/amd64_xen_pv/sys/amd64/include/xen/xen-os.h Thu Jun 21 16:21:31 2012 (r237403) @@ -75,6 +75,7 @@ void bootmem_free(void *ptr, unsigned in #include void printk(const char *fmt, ...); +void vprintk(const char *fmt, __va_list ap); /* some function prototypes */ void trap_init(void); Modified: projects/amd64_xen_pv/sys/amd64/xen/machdep.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/xen/machdep.c Thu Jun 21 15:47:06 2012 (r237402) +++ projects/amd64_xen_pv/sys/amd64/xen/machdep.c Thu Jun 21 16:21:31 2012 (r237403) @@ -1037,12 +1037,19 @@ void printk(const char *fmt, ...) { __va_list ap; + + va_start(ap, fmt); + vprintk(fmt, ap); + va_end(ap); +} + +void +vprintk(const char *fmt, __va_list ap) +{ int retval; static char buf[PRINTK_BUFSIZE]; - va_start(ap, fmt); retval = vsnprintf(buf, PRINTK_BUFSIZE - 1, fmt, ap); - va_end(ap); buf[retval] = 0; (void)HYPERVISOR_console_write(buf, retval); } Modified: projects/amd64_xen_pv/sys/kern/kern_shutdown.c ============================================================================== --- projects/amd64_xen_pv/sys/kern/kern_shutdown.c Thu Jun 21 15:47:06 2012 (r237402) +++ projects/amd64_xen_pv/sys/kern/kern_shutdown.c Thu Jun 21 16:21:31 2012 (r237403) @@ -616,10 +616,18 @@ panic(const char *fmt, ...) panicstr = buf; cngrab(); printf("panic: %s\n", buf); +#ifdef XEN + printk("panic: %s\n", buf); +#endif } else { printf("panic: "); vprintf(fmt, ap); printf("\n"); +#ifdef XEN + printk("panic: "); + vprintk(fmt, ap); + printk("\n"); +#endif } va_end(ap); #ifdef SMP From owner-svn-src-projects@FreeBSD.ORG Fri Jun 22 10:25:12 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C58F1106564A; Fri, 22 Jun 2012 10:25:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B013D8FC08; Fri, 22 Jun 2012 10:25:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5MAPC8r071256; Fri, 22 Jun 2012 10:25:12 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MAPCK7071251; Fri, 22 Jun 2012 10:25:12 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206221025.q5MAPCK7071251@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Jun 2012 10:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237440 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 10:25:12 -0000 Author: glebius Date: Fri Jun 22 10:25:12 2012 New Revision: 237440 URL: http://svn.freebsd.org/changeset/base/237440 Log: Stop allocating the mbuf tag unconditionally in pf_test(), pf_test6(). We actually need tag only in case of: - ALTQ - "tag" rules - "route" rules - divert processing In all above cases allocate tag only by the time we are sure we need it. Modified: projects/pf/head/sys/contrib/pf/net/pf.c projects/pf/head/sys/contrib/pf/net/pf_lb.c projects/pf/head/sys/contrib/pf/net/pf_norm.c projects/pf/head/sys/contrib/pf/net/pfvar.h Modified: projects/pf/head/sys/contrib/pf/net/pf.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf.c Fri Jun 22 08:37:33 2012 (r237439) +++ projects/pf/head/sys/contrib/pf/net/pf.c Fri Jun 22 10:25:12 2012 (r237440) @@ -328,7 +328,8 @@ VNET_DECLARE(int, pf_end_threads); VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); -#define PACKET_LOOPED(pd) ((pd)->pf_mtag->flags & PF_PACKET_LOOPED) +#define PACKET_LOOPED(pd) ((pd)->pf_mtag && \ + (pd)->pf_mtag->flags & PF_PACKET_LOOPED) #define STATE_LOOKUP(i, k, d, s, pd) \ do { \ @@ -2466,29 +2467,25 @@ pf_match_gid(u_int8_t op, gid_t a1, gid_ } int -pf_match_tag(struct mbuf *m, struct pf_rule *r, int *tag, - struct pf_mtag *pf_mtag) +pf_match_tag(struct mbuf *m, struct pf_rule *r, int *tag, int mtag) { if (*tag == -1) - *tag = pf_mtag->tag; + *tag = mtag; return ((!r->match_tag_not && r->match_tag == *tag) || (r->match_tag_not && r->match_tag != *tag)); } int -pf_tag_packet(struct mbuf *m, int tag, int rtableid, - struct pf_mtag *pf_mtag) +pf_tag_packet(struct mbuf *m, struct pf_pdesc *pd, int tag) { - if (tag <= 0 && rtableid < 0) - return (0); - if (tag > 0) - pf_mtag->tag = tag; - if (rtableid >= 0) - { - M_SETFIB(m, rtableid); - } + KASSERT(tag > 0, ("%s: tag %d", __func__, tag)); + + if (pd->pf_mtag == NULL && ((pd->pf_mtag = pf_get_mtag(m)) == NULL)) + return (ENOMEM); + + pd->pf_mtag->tag = tag; return (0); } @@ -3168,7 +3165,8 @@ pf_test_rule(struct pf_rule **rm, struct else if (r->prob && r->prob <= arc4random()) r = TAILQ_NEXT(r, entries); - else if (r->match_tag && !pf_match_tag(m, r, &tag, pd->pf_mtag)) + else if (r->match_tag && !pf_match_tag(m, r, &tag, + pd->pf_mtag ? pd->pf_mtag->tag : 0)) r = TAILQ_NEXT(r, entries); else if (r->os_fingerprint != PF_OSFP_ANY && (pd->proto != IPPROTO_TCP || !pf_osfp_match( @@ -3280,10 +3278,12 @@ pf_test_rule(struct pf_rule **rm, struct if (r->action == PF_DROP) goto cleanup; - if (pf_tag_packet(m, tag, rtableid, pd->pf_mtag)) { + if (tag > 0 && pf_tag_packet(m, pd, tag)) { REASON_SET(&reason, PFRES_MEMORY); goto cleanup; } + if (rtableid >= 0) + M_SETFIB(m, rtableid); if (!state_icmp && (r->keep_state || nr != NULL || (pd->flags & PFDESC_TCP_NORM))) { @@ -3603,7 +3603,8 @@ pf_test_fragment(struct pf_rule **rm, in else if (r->prob && r->prob <= (arc4random() % (UINT_MAX - 1) + 1)) r = TAILQ_NEXT(r, entries); - else if (r->match_tag && !pf_match_tag(m, r, &tag, pd->pf_mtag)) + else if (r->match_tag && !pf_match_tag(m, r, &tag, + pd->pf_mtag ? pd->pf_mtag->tag : 0)) r = TAILQ_NEXT(r, entries); else { if (r->anchor == NULL) { @@ -3635,7 +3636,7 @@ pf_test_fragment(struct pf_rule **rm, in if (r->action != PF_PASS) return (PF_DROP); - if (pf_tag_packet(m, tag, -1, pd->pf_mtag)) { + if (tag > 0 && pf_tag_packet(m, pd, tag)) { REASON_SET(&reason, PFRES_MEMORY); return (PF_DROP); } @@ -5124,7 +5125,9 @@ pf_route(struct mbuf **m, struct pf_rule KASSERT(dir == PF_IN || dir == PF_OUT, ("%s: invalid direction", __func__)); - if (pd->pf_mtag->routed++ > 3) { + if ((pd->pf_mtag == NULL && + ((pd->pf_mtag = pf_get_mtag(*m)) == NULL)) || + pd->pf_mtag->routed++ > 3) { m0 = *m; *m = NULL; goto bad_locked; @@ -5306,7 +5309,9 @@ pf_route6(struct mbuf **m, struct pf_rul KASSERT(dir == PF_IN || dir == PF_OUT, ("%s: invalid direction", __func__)); - if (pd->pf_mtag->routed++ > 3) { + if ((pd->pf_mtag == NULL && + ((pd->pf_mtag = pf_get_mtag(*m)) == NULL)) || + pd->pf_mtag->routed++ > 3) { m0 = *m; *m = NULL; goto bad_locked; @@ -5571,11 +5576,7 @@ pf_test(int dir, struct ifnet *ifp, stru return (PF_PASS); memset(&pd, 0, sizeof(pd)); - if ((pd.pf_mtag = pf_get_mtag(m)) == NULL) { - DPFPRINTF(PF_DEBUG_URGENT, - ("pf_test: pf_get_mtag returned NULL\n")); - return (PF_DROP); - } + kif = (struct pfi_kif *)ifp->if_pf_kif; if (kif == NULL) { @@ -5596,16 +5597,23 @@ pf_test(int dir, struct ifnet *ifp, stru goto done; } + pd.pf_mtag = pf_find_mtag(m); + PF_RULES_RLOCK(); if (ip_divert_ptr != NULL && ((ipfwtag = m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL)) != NULL)) { struct ipfw_rule_ref *rr = (struct ipfw_rule_ref *)(ipfwtag+1); if (rr->info & IPFW_IS_DIVERT && rr->rulenum == 0) { + if (pd.pf_mtag == NULL && + ((pd.pf_mtag = pf_get_mtag(m)) == NULL)) { + action = PF_DROP; + goto done; + } pd.pf_mtag->flags |= PF_PACKET_LOOPED; m_tag_delete(m, ipfwtag); } - if (pd.pf_mtag->flags & PF_FASTFWD_OURS_PRESENT) { + if (pd.pf_mtag && pd.pf_mtag->flags & PF_FASTFWD_OURS_PRESENT) { m->m_flags |= M_FASTFWD_OURS; pd.pf_mtag->flags &= ~PF_FASTFWD_OURS_PRESENT; } @@ -5762,11 +5770,20 @@ done: ("pf: dropping packet with ip options\n")); } - if ((s && s->tag) || r->rtableid >= 0) - pf_tag_packet(m, s ? s->tag : 0, r->rtableid, pd.pf_mtag); + if (s && s->tag > 0 && pf_tag_packet(m, &pd, s->tag)) { + action = PF_DROP; + REASON_SET(&reason, PFRES_MEMORY); + } + if (r->rtableid >= 0) + M_SETFIB(m, r->rtableid); #ifdef ALTQ if (action == PF_PASS && r->qid) { + if (pd.pf_mtag == NULL && + ((pd.pf_mtag = pf_get_mtag(m)) == NULL)) { + action = PF_DROP; + REASON_SET(&reason, PFRES_MEMORY); + } if (pqid || (pd.tos & IPTOS_LOWDELAY)) pd.pf_mtag->qid = r->pqid; else @@ -5804,6 +5821,14 @@ done: m_tag_prepend(m, ipfwtag); if (m->m_flags & M_FASTFWD_OURS) { + if (pd.pf_mtag == NULL && + ((pd.pf_mtag = pf_get_mtag(m)) == NULL)) { + action = PF_DROP; + REASON_SET(&reason, PFRES_MEMORY); + log = 1; + DPFPRINTF(PF_DEBUG_MISC, + ("pf: failed to allocate tag\n")); + } pd.pf_mtag->flags |= PF_FASTFWD_OURS_PRESENT; m->m_flags &= ~M_FASTFWD_OURS; } @@ -5923,13 +5948,9 @@ pf_test6(int dir, struct ifnet *ifp, str return (PF_PASS); memset(&pd, 0, sizeof(pd)); - if ((pd.pf_mtag = pf_get_mtag(m)) == NULL) { - DPFPRINTF(PF_DEBUG_URGENT, - ("pf_test: pf_get_mtag returned NULL\n")); - return (PF_DROP); - } + pd.pf_mtag = pf_find_mtag(m); - if (pd.pf_mtag->flags & PF_TAG_GENERATED) + if (pd.pf_mtag && pd.pf_mtag->flags & PF_TAG_GENERATED) return (PF_PASS); kif = (struct pfi_kif *)ifp->if_pf_kif; @@ -6173,11 +6194,20 @@ done: ("pf: dropping packet with dangerous v6 headers\n")); } - if ((s && s->tag) || r->rtableid >= 0) - pf_tag_packet(m, s ? s->tag : 0, r->rtableid, pd.pf_mtag); + if (s && s->tag > 0 && pf_tag_packet(m, &pd, s->tag)) { + action = PF_DROP; + REASON_SET(&reason, PFRES_MEMORY); + } + if (r->rtableid >= 0) + M_SETFIB(m, r->rtableid); #ifdef ALTQ if (action == PF_PASS && r->qid) { + if (pd.pf_mtag == NULL && + ((pd.pf_mtag = pf_get_mtag(m)) == NULL)) { + action = PF_DROP; + REASON_SET(&reason, PFRES_MEMORY); + } if (pd.tos & IPTOS_LOWDELAY) pd.pf_mtag->qid = r->pqid; else Modified: projects/pf/head/sys/contrib/pf/net/pf_lb.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf_lb.c Fri Jun 22 08:37:33 2012 (r237439) +++ projects/pf/head/sys/contrib/pf/net/pf_lb.c Fri Jun 22 10:25:12 2012 (r237440) @@ -227,7 +227,8 @@ pf_match_translation(struct pf_pdesc *pd !pf_match_port(dst->port_op, dst->port[0], dst->port[1], dport)) r = r->skip[PF_SKIP_DST_PORT].ptr; - else if (r->match_tag && !pf_match_tag(m, r, &tag, pd->pf_mtag)) + else if (r->match_tag && !pf_match_tag(m, r, &tag, + pd->pf_mtag ? pd->pf_mtag->tag : 0)) r = TAILQ_NEXT(r, entries); else if (r->os_fingerprint != PF_OSFP_ANY && (pd->proto != IPPROTO_TCP || !pf_osfp_match(pf_osfp_fingerprint(pd, m, @@ -248,8 +249,12 @@ pf_match_translation(struct pf_pdesc *pd pf_step_out_of_anchor(&asd, &ruleset, rs_num, &r, NULL, NULL); } - if (pf_tag_packet(m, tag, rtableid, pd->pf_mtag)) + + if (tag > 0 && pf_tag_packet(m, pd, tag)) return (NULL); + if (rtableid >= 0) + M_SETFIB(m, rtableid); + if (rm != NULL && (rm->action == PF_NONAT || rm->action == PF_NORDR || rm->action == PF_NOBINAT)) return (NULL); Modified: projects/pf/head/sys/contrib/pf/net/pf_norm.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf_norm.c Fri Jun 22 08:37:33 2012 (r237439) +++ projects/pf/head/sys/contrib/pf/net/pf_norm.c Fri Jun 22 10:25:12 2012 (r237440) @@ -904,7 +904,8 @@ pf_normalize_ip(struct mbuf **m0, int di (struct pf_addr *)&h->ip_dst.s_addr, AF_INET, r->dst.neg, NULL, M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; - else if (r->match_tag && !pf_match_tag(m, r, &tag, pd->pf_mtag)) + else if (r->match_tag && !pf_match_tag(m, r, &tag, + pd->pf_mtag ? pd->pf_mtag->tag : 0)) r = TAILQ_NEXT(r, entries); else break; Modified: projects/pf/head/sys/contrib/pf/net/pfvar.h ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pfvar.h Fri Jun 22 08:37:33 2012 (r237439) +++ projects/pf/head/sys/contrib/pf/net/pfvar.h Fri Jun 22 10:25:12 2012 (r237440) @@ -1902,9 +1902,8 @@ void pfi_get_ifaces(const char *, stru int pfi_set_flags(const char *, int); int pfi_clear_flags(const char *, int); -int pf_match_tag(struct mbuf *, struct pf_rule *, int *, - struct pf_mtag *); -int pf_tag_packet(struct mbuf *, int, int, struct pf_mtag *); +int pf_match_tag(struct mbuf *, struct pf_rule *, int *, int); +int pf_tag_packet(struct mbuf *, struct pf_pdesc *, int); void pf_qid2qname(u_int32_t, char *); VNET_DECLARE(struct pf_status, pf_status); From owner-svn-src-projects@FreeBSD.ORG Fri Jun 22 13:56:02 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A2621065672; Fri, 22 Jun 2012 13:56:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7511C8FC0A; Fri, 22 Jun 2012 13:56:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5MDu2qL081766; Fri, 22 Jun 2012 13:56:02 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MDu27L081764; Fri, 22 Jun 2012 13:56:02 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206221356.q5MDu27L081764@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 22 Jun 2012 13:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237442 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 13:56:02 -0000 Author: glebius Date: Fri Jun 22 13:56:01 2012 New Revision: 237442 URL: http://svn.freebsd.org/changeset/base/237442 Log: Spelling. Modified: projects/pf/head/sys/contrib/pf/net/pf_lb.c Modified: projects/pf/head/sys/contrib/pf/net/pf_lb.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf_lb.c Fri Jun 22 12:15:38 2012 (r237441) +++ projects/pf/head/sys/contrib/pf/net/pf_lb.c Fri Jun 22 13:56:01 2012 (r237442) @@ -471,7 +471,7 @@ pf_map_addr(sa_family_t af, struct pf_ru * forwarding thread needs to modify rule. * * This is done w/o locking, because performance is assumed - * more importand than round-robin precision. + * more important than round-robin precision. * * In the simpliest case we just update the "rpool->cur" * pointer. However, if pool contains tables or dynamic @@ -481,7 +481,7 @@ pf_map_addr(sa_family_t af, struct pf_ru * * Things get worse, if table contains not hosts, but * prefixes. In this case counter also stores machine state, - * and for IPv6 address, counter can be updated atomically. + * and for IPv6 address, counter can't be updated atomically. * Probably, using round-robin on a table containing IPv6 * prefixes (or even IPv4) would cause a panic. */ From owner-svn-src-projects@FreeBSD.ORG Fri Jun 22 13:56:58 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4FE81065670; Fri, 22 Jun 2012 13:56:58 +0000 (UTC) (envelope-from cherry@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C65928FC15; Fri, 22 Jun 2012 13:56:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5MDuw5F081842; Fri, 22 Jun 2012 13:56:58 GMT (envelope-from cherry@svn.freebsd.org) Received: (from cherry@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MDuwNl081837; Fri, 22 Jun 2012 13:56:58 GMT (envelope-from cherry@svn.freebsd.org) Message-Id: <201206221356.q5MDuwNl081837@svn.freebsd.org> From: "Cherry G. Mathew" Date: Fri, 22 Jun 2012 13:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237443 - in projects/amd64_xen_pv/sys: amd64/include amd64/xen x86/x86 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 13:56:59 -0000 Author: cherry Date: Fri Jun 22 13:56:58 2012 New Revision: 237443 URL: http://svn.freebsd.org/changeset/base/237443 Log: Add stub functions and global variables for xen suspend/resume code. While at it, re-arrange pmap.[ch] a bit. Fix macro abuse. Approved by: gibbs (implicit) Modified: projects/amd64_xen_pv/sys/amd64/include/pmap.h projects/amd64_xen_pv/sys/amd64/xen/machdep.c projects/amd64_xen_pv/sys/amd64/xen/pmap.c projects/amd64_xen_pv/sys/x86/x86/busdma_machdep.c Modified: projects/amd64_xen_pv/sys/amd64/include/pmap.h ============================================================================== --- projects/amd64_xen_pv/sys/amd64/include/pmap.h Fri Jun 22 13:56:01 2012 (r237442) +++ projects/amd64_xen_pv/sys/amd64/include/pmap.h Fri Jun 22 13:56:58 2012 (r237443) @@ -241,21 +241,7 @@ pte_store(pt_entry_t *ptep, pt_entry_t p #define VM_PAGE_TO_MACH(m) xpmap_ptom(VM_PAGE_TO_PHYS((m))) #define VTOM(va) xpmap_ptom(VTOP(va)) - -static __inline vm_paddr_t -pmap_kextract_ma(vm_offset_t va) -{ - vm_paddr_t ma = 0; - KASSERT(0, ("XXX: Please implement")); - return ma; -} - -static __inline vm_paddr_t -pmap_kextract(vm_offset_t va) -{ - return xpmap_mtop(pmap_kextract_ma(va)); -} - +vm_paddr_t pmap_kextract_ma(vm_offset_t); #define vtomach(va) pmap_kextract_ma(((vm_offset_t) (va))) vm_paddr_t pmap_extract_ma(struct pmap *pmap, vm_offset_t va); @@ -358,9 +344,7 @@ void pmap_demote_DMAP(vm_paddr_t base, v void pmap_init_pat(void); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void *pmap_kenter_temporary(vm_paddr_t pa, int i); -#ifndef XEN vm_paddr_t pmap_kextract(vm_offset_t); -#endif /* XEN */ void pmap_kremove(vm_offset_t); void *pmap_mapbios(vm_paddr_t, vm_size_t); void *pmap_mapdev(vm_paddr_t, vm_size_t); Modified: projects/amd64_xen_pv/sys/amd64/xen/machdep.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/xen/machdep.c Fri Jun 22 13:56:01 2012 (r237442) +++ projects/amd64_xen_pv/sys/amd64/xen/machdep.c Fri Jun 22 13:56:58 2012 (r237443) @@ -102,6 +102,8 @@ start_info_t *xen_start_info; shared_info_t *HYPERVISOR_shared_info; xen_pfn_t *xen_machine_phys = machine_to_phys_mapping; xen_pfn_t *xen_phys_machine; +xen_pfn_t *xen_pfn_to_mfn_frame_list[16]; /* XXX: TODO init for suspend/resume */ +xen_pfn_t *xen_pfn_to_mfn_frame_list_list; /* XXX: TODO init for suspend/resume */ #define PHYSMAP_SIZE (2 * VM_PHYSSEG_MAX) vm_offset_t pa_index = 0; Modified: projects/amd64_xen_pv/sys/amd64/xen/pmap.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/xen/pmap.c Fri Jun 22 13:56:01 2012 (r237442) +++ projects/amd64_xen_pv/sys/amd64/xen/pmap.c Fri Jun 22 13:56:58 2012 (r237443) @@ -303,7 +303,7 @@ create_boot_pagetables(vm_paddr_t *first /* Fill in the underlying page table pages */ for (i = 0; ptoa(i) < ptoa(nkmapped); i++) { ((pt_entry_t *)KPTphys)[i] = phystomach(i << PAGE_SHIFT); - ((pt_entry_t *)KPTphys)[i] |= PG_V | PG_G | PG_U; + ((pt_entry_t *)KPTphys)[i] |= PG_V | PG_U; ((pt_entry_t *)KPTphys)[i] |= pmap_xen_kernel_vaflags(PTOV(i << PAGE_SHIFT)); } @@ -773,6 +773,45 @@ pmap_extract_and_hold(pmap_t pmap, vm_of return 0; } +vm_paddr_t +pmap_kextract(vm_offset_t va) +{ + return xpmap_mtop(pmap_kextract_ma(va)); +} + +vm_paddr_t +pmap_kextract_ma(vm_offset_t va) +{ + vm_paddr_t ma; + + /* Walk the PT hierarchy to get the ma */ + char tbuf[tsz]; /* Safe to do this on the stack since tsz is + * effectively const. + */ + + mmu_map_t tptr = tbuf; + + struct mmu_map_mbackend mb = { + ptmb_mappedalloc, + ptmb_mappedfree, + ptmb_ptov, + ptmb_vtop + }; + mmu_map_t_init(tptr, &mb); + + if (!mmu_map_inspect_va(kernel_pmap, tptr, va)) { + ma = 0; + goto nomapping; + } + + ma = mmu_map_pt(tptr)[(~PDRMASK & PAGE_MASK & va) >> PAGE_SHIFT]; + + mmu_map_t_fini(tptr); + +nomapping: + return ma; +} + /*************************************************** * Low level mapping routines..... ***************************************************/ @@ -787,6 +826,12 @@ pmap_extract_and_hold(pmap_t pmap, vm_of void pmap_kenter(vm_offset_t va, vm_paddr_t pa) { + pmap_kenter_ma(va, xpmap_ptom(pa)); +} + +void +pmap_kenter_ma(vm_offset_t va, vm_paddr_t ma) +{ char tbuf[tsz]; /* Safe to do this on the stack since tsz is * effectively const. @@ -808,7 +853,7 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p } /* Backing page tables are in place, let xen do the maths */ - PT_SET_MA(va, xpmap_ptom(pa) | PG_RW | PG_V | PG_U); + PT_SET_MA(va, ma | PG_RW | PG_V | PG_U); PT_UPDATES_FLUSH(); mmu_map_release_va(kernel_pmap, tptr, va); @@ -1038,6 +1083,18 @@ pmap_align_superpage(vm_object_t object, *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset; } +void +pmap_suspend() +{ + KASSERT(0, ("XXX: TODO\n")); +} + +void +pmap_resume() +{ + KASSERT(0, ("XXX: TODO\n")); +} + int pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { Modified: projects/amd64_xen_pv/sys/x86/x86/busdma_machdep.c ============================================================================== --- projects/amd64_xen_pv/sys/x86/x86/busdma_machdep.c Fri Jun 22 13:56:01 2012 (r237442) +++ projects/amd64_xen_pv/sys/x86/x86/busdma_machdep.c Fri Jun 22 13:56:58 2012 (r237443) @@ -147,7 +147,7 @@ int _bus_dmamap_count_pages(bus_dma_tag_ #ifdef XEN #undef pmap_kextract -#define pmap_kextract pmap_kextract_ma +#define pmap_kextract(va) pmap_kextract_ma((va)) #endif /* From owner-svn-src-projects@FreeBSD.ORG Fri Jun 22 18:18:50 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50EAA106566B; Fri, 22 Jun 2012 18:18:50 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3BCB8FC08; Fri, 22 Jun 2012 18:18:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5MIInxJ092997; Fri, 22 Jun 2012 18:18:49 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MIInv6092993; Fri, 22 Jun 2012 18:18:49 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201206221818.q5MIInv6092993@svn.freebsd.org> From: Attilio Rao Date: Fri, 22 Jun 2012 18:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237449 - in projects/amd64_xen_pv/sys: ddb kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 18:18:50 -0000 Author: attilio Date: Fri Jun 22 18:18:49 2012 New Revision: 237449 URL: http://svn.freebsd.org/changeset/base/237449 Log: Remove the code for redirecting the panic message on emergency console and use it directly in vprintf() and db_printf(). This will let most of the output to get out when booting FreeBSD and when debugging directly in the emergency console. Modified: projects/amd64_xen_pv/sys/ddb/db_output.c projects/amd64_xen_pv/sys/kern/kern_shutdown.c projects/amd64_xen_pv/sys/kern/subr_prf.c Modified: projects/amd64_xen_pv/sys/ddb/db_output.c ============================================================================== --- projects/amd64_xen_pv/sys/ddb/db_output.c Fri Jun 22 18:01:22 2012 (r237448) +++ projects/amd64_xen_pv/sys/ddb/db_output.c Fri Jun 22 18:18:49 2012 (r237449) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef XEN +#include +#endif #include #include @@ -337,6 +340,11 @@ db_printf(const char *fmt, ...) #endif va_start(listp, fmt); + +#ifdef XEN + /* Redirect the db_printf() output also to the emergency console. */ + vprintk(fmt, listp); +#endif retval = kvprintf (fmt, db_putchar, &dca, db_radix, listp); va_end(listp); Modified: projects/amd64_xen_pv/sys/kern/kern_shutdown.c ============================================================================== --- projects/amd64_xen_pv/sys/kern/kern_shutdown.c Fri Jun 22 18:01:22 2012 (r237448) +++ projects/amd64_xen_pv/sys/kern/kern_shutdown.c Fri Jun 22 18:18:49 2012 (r237449) @@ -616,18 +616,10 @@ panic(const char *fmt, ...) panicstr = buf; cngrab(); printf("panic: %s\n", buf); -#ifdef XEN - printk("panic: %s\n", buf); -#endif } else { printf("panic: "); vprintf(fmt, ap); printf("\n"); -#ifdef XEN - printk("panic: "); - vprintk(fmt, ap); - printk("\n"); -#endif } va_end(ap); #ifdef SMP Modified: projects/amd64_xen_pv/sys/kern/subr_prf.c ============================================================================== --- projects/amd64_xen_pv/sys/kern/subr_prf.c Fri Jun 22 18:01:22 2012 (r237448) +++ projects/amd64_xen_pv/sys/kern/subr_prf.c Fri Jun 22 18:18:49 2012 (r237449) @@ -68,6 +68,9 @@ __FBSDID("$FreeBSD$"); * ANSI and traditional C compilers. */ #include +#ifdef XEN +#include +#endif #define TOCONS 0x01 #define TOTTY 0x02 @@ -388,6 +391,10 @@ vprintf(const char *fmt, va_list ap) pca.p_bufr = NULL; #endif +#ifdef XEN + /* Redirect the vprintf() output also to the emergency console. */ + vprintk(fmt, ap); +#endif retval = kvprintf(fmt, putchar, &pca, 10, ap); #ifdef PRINTF_BUFR_SIZE From owner-svn-src-projects@FreeBSD.ORG Fri Jun 22 18:20:27 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DCB61065676; Fri, 22 Jun 2012 18:20:27 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A5148FC1C; Fri, 22 Jun 2012 18:20:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5MIKRUu093100; Fri, 22 Jun 2012 18:20:27 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MIKRnB093098; Fri, 22 Jun 2012 18:20:27 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201206221820.q5MIKRnB093098@svn.freebsd.org> From: Attilio Rao Date: Fri, 22 Jun 2012 18:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237450 - projects/amd64_xen_pv/sys/amd64/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 18:20:27 -0000 Author: attilio Date: Fri Jun 22 18:20:26 2012 New Revision: 237450 URL: http://svn.freebsd.org/changeset/base/237450 Log: Add KTR_TRACE to the XEN kernel config. This is now capable of showing a backtrace of offending functions on the emergency console. Modified: projects/amd64_xen_pv/sys/amd64/conf/XEN Modified: projects/amd64_xen_pv/sys/amd64/conf/XEN ============================================================================== --- projects/amd64_xen_pv/sys/amd64/conf/XEN Fri Jun 22 18:18:49 2012 (r237449) +++ projects/amd64_xen_pv/sys/amd64/conf/XEN Fri Jun 22 18:20:26 2012 (r237450) @@ -46,6 +46,7 @@ options AUDIT # Security event auditi # Debugging for use in -current options KDB # Enable kernel debugger support. +options KDB_TRACE # Show backtrace when inovking KDB. options DDB # Support DDB. options GDB # Support remote GDB. options DEADLKRES # Enable the deadlock resolver From owner-svn-src-projects@FreeBSD.ORG Fri Jun 22 19:09:16 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B531106566B; Fri, 22 Jun 2012 19:09:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 171428FC14; Fri, 22 Jun 2012 19:09:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5MJ9Fjp095212; Fri, 22 Jun 2012 19:09:15 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MJ9FjF095210; Fri, 22 Jun 2012 19:09:15 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201206221909.q5MJ9FjF095210@svn.freebsd.org> From: Attilio Rao Date: Fri, 22 Jun 2012 19:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237453 - projects/amd64_xen_pv/sys/amd64/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 19:09:16 -0000 Author: attilio Date: Fri Jun 22 19:09:15 2012 New Revision: 237453 URL: http://svn.freebsd.org/changeset/base/237453 Log: Remove the WITNESS option for XEN. Modified: projects/amd64_xen_pv/sys/amd64/conf/XEN Modified: projects/amd64_xen_pv/sys/amd64/conf/XEN ============================================================================== --- projects/amd64_xen_pv/sys/amd64/conf/XEN Fri Jun 22 18:57:06 2012 (r237452) +++ projects/amd64_xen_pv/sys/amd64/conf/XEN Fri Jun 22 19:09:15 2012 (r237453) @@ -52,8 +52,8 @@ options GDB # Support remote GDB. options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +nooptions WITNESS # Enable checks to detect deadlocks and cycles +nooptions WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed nooption NATIVE option XEN From owner-svn-src-projects@FreeBSD.ORG Sat Jun 23 19:39:04 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68FC9106567C; Sat, 23 Jun 2012 19:39:04 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 533068FC08; Sat, 23 Jun 2012 19:39:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5NJd4LD060779; Sat, 23 Jun 2012 19:39:04 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NJd4CL060775; Sat, 23 Jun 2012 19:39:04 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206231939.q5NJd4CL060775@svn.freebsd.org> From: Davide Italiano Date: Sat, 23 Jun 2012 19:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237502 - in projects/calloutng/sys: kern sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 19:39:04 -0000 Author: davide Date: Sat Jun 23 19:39:03 2012 New Revision: 237502 URL: http://svn.freebsd.org/changeset/base/237502 Log: First commit that concerns event aggregation. Augment the callout structure so that consumers other than actual time at which callout should fire may specify a tolerance interval. Rather than looking for the next callout event in callout_tick() determine a range [t-delta;t'+delta'] deriving it from the tolerance parameter specified by clients so that's suitable for a given number of events, and schedule an interrupt in the middle of such range. Add some comments to better specify what we're doing. Suggested by: mav Reviewed by: mav Modified: projects/calloutng/sys/kern/kern_timeout.c projects/calloutng/sys/sys/_callout.h projects/calloutng/sys/sys/callout.h Modified: projects/calloutng/sys/kern/kern_timeout.c ============================================================================== --- projects/calloutng/sys/kern/kern_timeout.c Sat Jun 23 19:15:12 2012 (r237501) +++ projects/calloutng/sys/kern/kern_timeout.c Sat Jun 23 19:39:03 2012 (r237502) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -358,7 +359,7 @@ get_bucket(struct bintime *bt) void callout_tick(void) { - struct bintime limit, next, now; + struct bintime limit, max, min, next, now, tmp_max, tmp_min; struct callout *tmp; struct callout_cpu *cc; struct callout_tailq *sc; @@ -375,25 +376,21 @@ callout_tick(void) cpu = curcpu; first = callout_hash(&cc->cc_softticks); last = callout_hash(&now); - next.sec = -1; - next.frac = -1; - future = ((last + hz/4) & callwheelmask); /* * Check if we wrapped around the entire wheel from the last scan. * In case, we need to scan entirely the wheel for pending callouts. */ - if (last - first >= callwheelsize) { - first &= callwheelmask; - last = (first - 1) & callwheelmask; - } - else { - first &= callwheelmask; - last &= callwheelmask; - } + last = (last - first >= callwheelsize) ? (first - 1) & callwheelmask : + last & callwheelmask; + first &= callwheelmask; for (;;) { sc = &cc->cc_callwheel[first]; TAILQ_FOREACH(tmp, sc, c_links.tqe) { if (bintime_cmp(&tmp->c_time, &now, <=)) { + /* + * Consumer told us the callout may be run + * directly from hardware interrupt context. + */ if (tmp->c_flags & CALLOUT_DIRECT) { tmp->c_func(tmp->c_arg); TAILQ_REMOVE(sc, tmp, c_links.tqe); @@ -410,31 +407,69 @@ callout_tick(void) } if (first == last) break; - first = ((first + 1) & callwheelmask); + first = (first + 1) & callwheelmask; } + future = ((last + hz/4) & callwheelmask); + max.sec = max.frac = INT_MAX; + min.sec = min.frac = INT_MAX; limit.sec = 0; limit.frac = (uint64_t)1 << (64 - 2); bintime_add(&limit, &now); - for (;;) { + /* + * Look for the first bucket in the future that contains some event, + * up to some point, so that we can look for aggregation. + */ + for (;;) { sc = &cc->cc_callwheel[last]; TAILQ_FOREACH(tmp, sc, c_links.tqe) { - if (bintime_cmp(&tmp->c_time, &limit, <=)) { - if (next.sec == -1 || - bintime_cmp(&tmp->c_time, &next, <)) { - next = tmp->c_time; - cpu = tmp->c_cpu; - } + tmp_max = tmp_min = tmp->c_time; + bintime_add(&tmp_max, &tmp->c_precision); + bintime_sub(&tmp_min, &tmp->c_precision); + /* + * This is the fist event we're going to process or + * event maximal time is less than present minimal. + * In both cases, take it. + */ + if (bintime_cmp(&tmp_max, &min, <)) { + max = tmp_max; + min = tmp_min; + continue; } - } - if ((last == future) || (next.sec != -1)) + /* + * Event minimal time is bigger than present maximal + * time, so it cannot be aggregated. + */ + if (bintime_cmp(&tmp_min, &max, >)) + continue; + /* + * If neither of the two previous happened, just take + * the intersection of events. + */ + min = (bintime_cmp(&tmp_min, &min, >)) ? tmp_min : min; + max = (bintime_cmp(&tmp_max, &max, >)) ? tmp_max : max; + } + if (last == future || + (max.sec != INT_MAX && min.sec != INT_MAX)) break; - last = ((last + 1) & callwheelmask); - } - if (next.sec == -1) { + last = (last + 1) & callwheelmask; + } + if (max.sec == INT_MAX && min.sec == INT_MAX) { next.sec = 0; next.frac = (uint64_t)1 << (64 - 2); bintime_add(&next, &now); } + /* + * Now that we found something to aggregate, schedule an interrupt in + * the middle of the previously calculated range. + */ + else { + bintime_add(&max, &min); + next = max; + next.frac >>= 1; + if (next.sec & 1) + next.frac |= ((uint64_t)1 << 63); + next.sec >>= 1; + } cc->cc_firsttick = next; if (callout_new_inserted != NULL) (*callout_new_inserted)(cpu, next); @@ -478,6 +513,7 @@ callout_cc_add(struct callout *c, struct struct bintime to_bintime, void (*func)(void *), void *arg, int cpu, int flags) { + struct timeval tv; int bucket; CC_LOCK_ASSERT(cc); @@ -486,11 +522,28 @@ callout_cc_add(struct callout *c, struct } c->c_arg = arg; c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); - if (flags & C_DIRECT) + if (flags & C_DIRECT_EXEC) c->c_flags |= CALLOUT_DIRECT; c->c_flags &= ~CALLOUT_PROCESSED; c->c_func = func; c->c_time = to_bintime; + tv.tv_sec = 0; + if (flags & C_10US) { + tv.tv_usec = 10; + timeval2bintime(&tv, &c->c_precision); + } + else if (flags & C_100US) { + tv.tv_usec = 100; + timeval2bintime(&tv, &c->c_precision); + } + else if (flags & C_1MS) { + tv.tv_usec = 1000; + timeval2bintime(&tv, &c->c_precision); + } + else { + c->c_precision.sec = 0; + c->c_precision.frac = 0; + } bucket = get_bucket(&c->c_time); TAILQ_INSERT_TAIL(&cc->cc_callwheel[bucket & callwheelmask], c, c_links.tqe); Modified: projects/calloutng/sys/sys/_callout.h ============================================================================== --- projects/calloutng/sys/sys/_callout.h Sat Jun 23 19:15:12 2012 (r237501) +++ projects/calloutng/sys/sys/_callout.h Sat Jun 23 19:39:03 2012 (r237502) @@ -53,6 +53,7 @@ struct callout { } c_links; TAILQ_ENTRY(callout) c_staiter; struct bintime c_time; /* ticks to the event */ + struct bintime c_precision; /* delta allowed wrt opt */ void *c_arg; /* function argument */ void (*c_func)(void *); /* function to call */ struct lock_object *c_lock; /* lock to handle */ Modified: projects/calloutng/sys/sys/callout.h ============================================================================== --- projects/calloutng/sys/sys/callout.h Sat Jun 23 19:15:12 2012 (r237501) +++ projects/calloutng/sys/sys/callout.h Sat Jun 23 19:39:03 2012 (r237502) @@ -50,12 +50,15 @@ #define CALLOUT_PROCESSED 0x0080 /* callout in wheel or processing list? */ #define CALLOUT_DIRECT 0x1000 /* allow exec from hw int context */ +#define C_DIRECT_EXEC 0x0001 /* direct execution of callout */ +#define C_10US 0x0002 /* precision field */ +#define C_100US 0x0004 /* precision field */ +#define C_1MS 0x0008 /* precision field */ + struct callout_handle { struct callout *callout; }; -#define C_DIRECT 0x0001 /* direct execution of callout */ - #ifdef _KERNEL extern int ncallout; From owner-svn-src-projects@FreeBSD.ORG Sat Jun 23 19:49:19 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6134D1065674; Sat, 23 Jun 2012 19:49:19 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A7488FC0A; Sat, 23 Jun 2012 19:49:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5NJnJRn061373; Sat, 23 Jun 2012 19:49:19 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NJnJoL061363; Sat, 23 Jun 2012 19:49:19 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201206231949.q5NJnJoL061363@svn.freebsd.org> From: Tim Kientzle Date: Sat, 23 Jun 2012 19:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237506 - in projects/armv6/sys/boot: arm/uboot fdt uboot/common uboot/lib X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 19:49:19 -0000 Author: kientzle Date: Sat Jun 23 19:49:18 2012 New Revision: 237506 URL: http://svn.freebsd.org/changeset/base/237506 Log: Merge from -CURRENT: Fix ubldr to work correctly on the TI AM335x-based BeagleBone. In particular: * Query U-Boot's memory map to automatically determine where to load the kernel, * rework a lot of the loader FDT code to correctly use copyin()/copyout() to access the in-kernel FDT, * allow ubldr to be easily rebuilt with different load addresses, * fix a few NULL pointer dereferences, * support MBR partitions Modified: projects/armv6/sys/boot/arm/uboot/Makefile projects/armv6/sys/boot/arm/uboot/ldscript.arm projects/armv6/sys/boot/fdt/fdt_loader_cmd.c projects/armv6/sys/boot/uboot/common/metadata.c projects/armv6/sys/boot/uboot/lib/copy.c projects/armv6/sys/boot/uboot/lib/devicename.c projects/armv6/sys/boot/uboot/lib/disk.c projects/armv6/sys/boot/uboot/lib/elf_freebsd.c projects/armv6/sys/boot/uboot/lib/libuboot.h Directory Properties: projects/armv6/sys/boot/ (props changed) Modified: projects/armv6/sys/boot/arm/uboot/Makefile ============================================================================== --- projects/armv6/sys/boot/arm/uboot/Makefile Sat Jun 23 19:46:07 2012 (r237505) +++ projects/armv6/sys/boot/arm/uboot/Makefile Sat Jun 23 19:49:18 2012 (r237506) @@ -7,6 +7,9 @@ NEWVERSWHAT= "U-Boot loader" ${MACHINE_A BINDIR?= /boot INSTALLFLAGS= -b WARNS?= 1 +# Address at which ubldr will be loaded. +# This varies for different boards and SOCs. +UBLDR_LOADADDR?= 0x1000000 # Architecture-specific loader code SRCS= start.S conf.c vers.c @@ -77,7 +80,9 @@ CLEANFILES+= vers.c loader.help CFLAGS+= -ffreestanding -LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} +LDFLAGS= -nostdlib -static +LDFLAGS+= -T ldscript.generated +LDFLAGS+= -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} # Pull in common loader code .PATH: ${.CURDIR}/../../uboot/common @@ -102,6 +107,18 @@ loader.help: help.common help.uboot cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} +${PROG}: ldscript.generated ${.CURDIR}/ldscript.${MACHINE_CPUARCH} + +ldscript.generated:: + rm -f ldscript.generated.tmp + echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >ldscript.generated.tmp + if diff ldscript.generated ldscript.generated.tmp > /dev/null; then \ + true; \ + else \ + rm -f ldscript.generated; \ + mv ldscript.generated.tmp ldscript.generated; \ + fi + .PATH: ${.CURDIR}/../../forth FILES= loader.help Modified: projects/armv6/sys/boot/arm/uboot/ldscript.arm ============================================================================== --- projects/armv6/sys/boot/arm/uboot/ldscript.arm Sat Jun 23 19:46:07 2012 (r237505) +++ projects/armv6/sys/boot/arm/uboot/ldscript.arm Sat Jun 23 19:49:18 2012 (r237506) @@ -5,7 +5,7 @@ ENTRY(_start) SECTIONS { /* Read-only sections, merged into text segment: */ - . = 0x1000000 + SIZEOF_HEADERS; + . = UBLDR_LOADADDR + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } Modified: projects/armv6/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- projects/armv6/sys/boot/fdt/fdt_loader_cmd.c Sat Jun 23 19:46:07 2012 (r237505) +++ projects/armv6/sys/boot/fdt/fdt_loader_cmd.c Sat Jun 23 19:49:18 2012 (r237506) @@ -57,11 +57,17 @@ __FBSDID("$FreeBSD$"); #define STR(number) #number #define STRINGIFY(number) STR(number) -#define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) +#define COPYOUT(s,d,l) archsw.arch_copyout(s, d, l) +#define COPYIN(s,d,l) archsw.arch_copyin(s, d, l) #define FDT_STATIC_DTB_SYMBOL "fdt_static_dtb" +/* Local copy of FDT */ static struct fdt_header *fdtp = NULL; +/* Size of FDT blob */ +static size_t fdtp_size = 0; +/* Location of FDT in kernel or module */ +static vm_offset_t fdtp_va = 0; static int fdt_cmd_nyi(int argc, char *argv[]); @@ -98,21 +104,19 @@ static const struct cmdtab commands[] = static char cwd[FDT_CWD_LEN] = "/"; static vm_offset_t -fdt_find_static_dtb(void) +fdt_find_static_dtb() { + Elf_Dyn dyn; Elf_Sym sym; - vm_offset_t dyntab, esym; + vm_offset_t dyntab, esym, strtab, symtab, fdt_start; uint64_t offs; struct preloaded_file *kfp; struct file_metadata *md; - Elf_Sym *symtab; - Elf_Dyn *dyn; - char *strtab, *strp; - int i, sym_count; - - symtab = NULL; - dyntab = esym = 0; - strtab = strp = NULL; + char *strp; + int sym_count; + + symtab = strtab = dyntab = esym = 0; + strp = NULL; offs = __elfN(relocation_offset); @@ -123,28 +127,29 @@ fdt_find_static_dtb(void) md = file_findmetadata(kfp, MODINFOMD_ESYM); if (md == NULL) return (0); - COPYOUT(md->md_data, &esym, sizeof(esym)); + bcopy(md->md_data, &esym, sizeof(esym)); + // esym is already offset md = file_findmetadata(kfp, MODINFOMD_DYNAMIC); if (md == NULL) return (0); - COPYOUT(md->md_data, &dyntab, sizeof(dyntab)); - + bcopy(md->md_data, &dyntab, sizeof(dyntab)); dyntab += offs; /* Locate STRTAB and DYNTAB */ - for (dyn = (Elf_Dyn *)dyntab; dyn->d_tag != DT_NULL; dyn++) { - if (dyn->d_tag == DT_STRTAB) { - strtab = (char *)(uintptr_t)(dyn->d_un.d_ptr + offs); - continue; - } else if (dyn->d_tag == DT_SYMTAB) { - symtab = (Elf_Sym *)(uintptr_t) - (dyn->d_un.d_ptr + offs); - continue; + for (;;) { + COPYOUT(dyntab, &dyn, sizeof(dyn)); + if (dyn.d_tag == DT_STRTAB) { + strtab = (vm_offset_t)(dyn.d_un.d_ptr) + offs; + } else if (dyn.d_tag == DT_SYMTAB) { + symtab = (vm_offset_t)(dyn.d_un.d_ptr) + offs; + } else if (dyn.d_tag == DT_NULL) { + break; } + dyntab += sizeof(dyn); } - if (symtab == NULL || strtab == NULL) { + if (symtab == 0 || strtab == 0) { /* * No symtab? No strtab? That should not happen here, * and should have been verified during __elfN(loadimage). @@ -153,7 +158,7 @@ fdt_find_static_dtb(void) return (0); } - sym_count = (int)((Elf_Sym *)esym - symtab) / sizeof(Elf_Sym); + sym_count = (int)(esym - symtab) / sizeof(Elf_Sym); /* * The most efficent way to find a symbol would be to calculate a @@ -165,26 +170,27 @@ fdt_find_static_dtb(void) * we are eliminating symbols type of which is not STT_NOTYPE, or(and) * those which binding attribute is not STB_GLOBAL. */ - for (i = 0; i < sym_count; i++) { - COPYOUT(symtab + i, &sym, sizeof(sym)); + fdt_start = 0; + while (sym_count > 0 && fdt_start == 0) { + COPYOUT(symtab, &sym, sizeof(sym)); + symtab += sizeof(sym); + --sym_count; if (ELF_ST_BIND(sym.st_info) != STB_GLOBAL || ELF_ST_TYPE(sym.st_info) != STT_NOTYPE) continue; - - strp = strdupout((vm_offset_t)(strtab + sym.st_name)); - if (strcmp(strp, FDT_STATIC_DTB_SYMBOL) == 0) { - /* Found a match ! */ - free(strp); - return ((vm_offset_t)(sym.st_value + offs)); - } + strp = strdupout(strtab + sym.st_name); + if (strcmp(strp, FDT_STATIC_DTB_SYMBOL) == 0) + fdt_start = (vm_offset_t)sym.st_value + offs; free(strp); } - return (0); + printf("fdt_start: 0x%08jX\n", (intmax_t)fdt_start); + return (fdt_start); } static int fdt_setup_fdtp() { + struct fdt_header header; struct preloaded_file *bfp; int err; @@ -193,15 +199,26 @@ fdt_setup_fdtp() */ bfp = file_findfile(NULL, "dtb"); if (bfp == NULL) { - if ((fdtp = (struct fdt_header *)fdt_find_static_dtb()) == 0) { + if ((fdtp_va = fdt_find_static_dtb()) == 0) { command_errmsg = "no device tree blob found!"; + printf("%s\n", command_errmsg); return (CMD_ERROR); } } else { /* Dynamic blob has precedence over static. */ - fdtp = (struct fdt_header *)bfp->f_addr; + fdtp_va = bfp->f_addr; } + COPYOUT(fdtp_va, &header, sizeof(header)); + fdtp_size = fdt_totalsize(&header); + fdtp = malloc(fdtp_size); + if (fdtp == NULL) { + command_errmsg = "can't allocate memory for device tree copy"; + printf("%s\n", command_errmsg); + return (CMD_ERROR); + } + COPYOUT(fdtp_va, fdtp, fdtp_size); + /* * Validate the blob. */ @@ -317,6 +334,8 @@ fixup_cpubusfreqs(unsigned long cpufreq, /* We want to modify every subnode of /cpus */ o = fdt_path_offset(fdtp, "/cpus"); + if (o < 0) + return; /* maxo should contain offset of node next to /cpus */ depth = 0; @@ -545,7 +564,7 @@ fixup_stdout(const char *env) /* * Locate the blob, fix it up and return its location. */ -void * +vm_offset_t fdt_fixup(void) { const char *env; @@ -561,7 +580,7 @@ fdt_fixup(void) err = fdt_setup_fdtp(); if (err) { sprintf(command_errbuf, "No valid device tree blob found!"); - return (NULL); + return (0); } /* Create /chosen node (if not exists) */ @@ -616,7 +635,9 @@ fdt_fixup(void) fdt_setprop(fdtp, chosen, "fixup-applied", NULL, 0); success: - return (fdtp); + /* Overwrite the FDT with the fixed version. */ + COPYIN(fdtp, fdtp_va, fdtp_size); + return (fdtp_va); } int @@ -634,7 +655,7 @@ command_fdt_internal(int argc, char *arg /* * Check if uboot env vars were parsed already. If not, do it now. */ - if (fdt_fixup() == NULL) + if (fdt_fixup() == 0) return (CMD_ERROR); /* @@ -1151,6 +1172,8 @@ fdt_modprop(int nodeoff, char *propname, else sprintf(command_errbuf, "Could not add/modify property!\n"); + } else { + COPYIN(fdtp, fdtp_va, fdtp_size); } return (rv); } @@ -1371,6 +1394,8 @@ fdt_cmd_rm(int argc, char *argv[]) if (rv) { sprintf(command_errbuf, "could not delete node"); return (CMD_ERROR); + } else { + COPYIN(fdtp, fdtp_va, fdtp_size); } return (CMD_OK); } @@ -1401,6 +1426,8 @@ fdt_cmd_mknode(int argc, char *argv[]) sprintf(command_errbuf, "Could not add node!\n"); return (CMD_ERROR); + } else { + COPYIN(fdtp, fdtp_va, fdtp_size); } return (CMD_OK); } Modified: projects/armv6/sys/boot/uboot/common/metadata.c ============================================================================== --- projects/armv6/sys/boot/uboot/common/metadata.c Sat Jun 23 19:46:07 2012 (r237505) +++ projects/armv6/sys/boot/uboot/common/metadata.c Sat Jun 23 19:49:18 2012 (r237506) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include "glue.h" #if defined(LOADER_FDT_SUPPORT) -extern int fdt_fixup(void); +extern vm_offset_t fdt_fixup(void); #endif /* @@ -72,6 +72,7 @@ static int md_getboothowto(char *kargs) { char *cp; + char *p; int howto; int active; int i; @@ -132,10 +133,12 @@ md_getboothowto(char *kargs) if (getenv(howto_names[i].ev) != NULL) howto |= howto_names[i].mask; } - if (!strcmp(getenv("console"), "comconsole")) - howto |= RB_SERIAL; - if (!strcmp(getenv("console"), "nullconsole")) - howto |= RB_MUTE; + if ((p = getenv("console"))) { + if (!strcmp(p, "comconsole")) + howto |= RB_SERIAL; + if (!strcmp(p, "nullconsole")) + howto |= RB_MUTE; + } return(howto); } @@ -334,7 +337,7 @@ md_load(char *args, vm_offset_t *modulep #if defined(LOADER_FDT_SUPPORT) /* Handle device tree blob */ dtbp = fdt_fixup(); - if (dtbp != (vm_offset_t)NULL) + if (dtbp != 0) file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp); else pager_output("WARNING! Trying to fire up the kernel, but no " Modified: projects/armv6/sys/boot/uboot/lib/copy.c ============================================================================== --- projects/armv6/sys/boot/uboot/lib/copy.c Sat Jun 23 19:46:07 2012 (r237505) +++ projects/armv6/sys/boot/uboot/lib/copy.c Sat Jun 23 19:49:18 2012 (r237506) @@ -29,32 +29,64 @@ __FBSDID("$FreeBSD$"); #include +#include + +#include "api_public.h" +#include "glue.h" /* * MD primitives supporting placement of module data - * - * XXX should check load address/size against memory top. */ +void * +uboot_vm_translate(vm_offset_t o) { + struct sys_info *si; + static uintptr_t start = 0; + static size_t size = 0; + int i; + + if (size == 0) { + if ((si = ub_get_sys_info()) == NULL) + panic("could not retrieve system info"); + + /* Find start/size of largest DRAM block. */ + for (i = 0; i < si->mr_no; i++) { + if (si->mr[i].flags == MR_ATTR_DRAM + && si->mr[i].size > size) { + start = si->mr[i].start; + size = si->mr[i].size; + } + } + + if (size <= 0) + panic("No suitable DRAM?\n"); + /* + printf("Loading into memory region 0x%08X-0x%08X (%d MiB)\n", + start, start + size, size / 1024 / 1024); + */ + } + if (o > size) + panic("Address 0x%08jX bigger than size 0x%08X\n", + (intmax_t)o, size); + return (void *)(start + o); +} + ssize_t uboot_copyin(const void *src, vm_offset_t dest, const size_t len) { - - bcopy(src, (void *)dest, len); + bcopy(src, uboot_vm_translate(dest), len); return (len); } ssize_t uboot_copyout(const vm_offset_t src, void *dest, const size_t len) { - - bcopy((void *)src, dest, len); + bcopy(uboot_vm_translate(src), dest, len); return (len); } ssize_t uboot_readin(const int fd, vm_offset_t dest, const size_t len) { - - return (read(fd, (void *) dest, len)); + return (read(fd, uboot_vm_translate(dest), len)); } Modified: projects/armv6/sys/boot/uboot/lib/devicename.c ============================================================================== --- projects/armv6/sys/boot/uboot/lib/devicename.c Sat Jun 23 19:46:07 2012 (r237505) +++ projects/armv6/sys/boot/uboot/lib/devicename.c Sat Jun 23 19:49:18 2012 (r237506) @@ -131,6 +131,10 @@ uboot_parsedev(struct uboot_devdesc **de *(cp + 1) != ':') { pnum = strtol(cp + 1, &cp, 10); ptype = PTYPE_GPT; + } else if (*cp == 's' && *(cp + 1) && + *(cp + 1) != ':') { + pnum = strtol(cp + 1, &cp, 10); + ptype = PTYPE_MBR; } else { pnum = *cp - 'a'; ptype = PTYPE_BSDLABEL; @@ -218,6 +222,9 @@ uboot_fmtdev(void *vdev) else if (dev->d_kind.disk.ptype == PTYPE_GPT) cp += sprintf(cp, "p%i", dev->d_kind.disk.pnum); + else if (dev->d_kind.disk.ptype == PTYPE_MBR) + cp += sprintf(cp, "s%i", + dev->d_kind.disk.pnum); } strcat(cp, ":"); Modified: projects/armv6/sys/boot/uboot/lib/disk.c ============================================================================== --- projects/armv6/sys/boot/uboot/lib/disk.c Sat Jun 23 19:46:07 2012 (r237505) +++ projects/armv6/sys/boot/uboot/lib/disk.c Sat Jun 23 19:49:18 2012 (r237506) @@ -398,6 +398,94 @@ out: } static int +stor_open_mbr(struct open_dev *od, struct uboot_devdesc *dev) +{ + char *buf = NULL; + struct dos_partition *dp; + int err, i, part; + + od->od_nparts = 0; + od->od_partitions = NULL; + + /* Block size must be at least 512 bytes. */ + if (od->od_bsize < 512) + return (ENXIO); + + /* Read MBR */ + buf = malloc(od->od_bsize); + if (!buf) { + stor_printf("could not allocate memory for MBR\n"); + return (ENOMEM); + } + err = stor_readdev(dev, 0, 1, buf); + if (err) { + stor_printf("MBR read error=%d\n", err); + err = EIO; + goto out; + } + + /* Check the slice table magic. */ + if (le16toh(*((uint16_t *)(buf + DOSMAGICOFFSET))) != DOSMAGIC) { + err = ENXIO; + goto out; + } + + /* Save information about partitions. */ + dp = (struct dos_partition *)(buf + DOSPARTOFF); + od->od_partitions = calloc(NDOSPART, sizeof(struct gpt_part)); + if (!od->od_partitions) { + stor_printf("could not allocate memory for MBR partitions\n"); + err = ENOMEM; + goto out; + } + + part = 0; + for (i = 0; i < NDOSPART; i++) { + u_int32_t start = le32dec(&dp[i].dp_start); + u_int32_t size = le32dec(&dp[i].dp_size); + uuid_t *u = NULL; + + /* Map MBR partition types to GPT partition types. */ + switch (dp[i].dp_typ) { + case DOSPTYP_386BSD: + u = &freebsd_ufs; + break; + /* XXX Other types XXX */ + } + + if (u) { + od->od_partitions[part].gp_type = *u; + od->od_partitions[part].gp_index = i + 1; + od->od_partitions[part].gp_start = start; + od->od_partitions[part].gp_end = start + size; + part += 1; + } + } + od->od_nparts = part; + + if (od->od_nparts == 0) { + err = EINVAL; + goto out; + } + + dev->d_disk.ptype = PTYPE_MBR; + + /* XXX Be smarter here? XXX */ + if (dev->d_disk.pnum == 0) + dev->d_disk.pnum = od->od_partitions[0].gp_index; + + for (i = 0; i < od->od_nparts; i++) + if (od->od_partitions[i].gp_index == dev->d_disk.pnum) + od->od_bstart = od->od_partitions[i].gp_start; + +out: + if (err && od->od_partitions) + free(od->od_partitions); + free(buf); + return (err); +} + +static int stor_open_bsdlabel(struct open_dev *od, struct uboot_devdesc *dev) { char *buf; @@ -443,7 +531,7 @@ stor_readdev(struct uboot_devdesc *dev, lbasize_t real_size; int err, handle; - debugf("reading size=%d @ 0x%08x\n", size, (uint32_t)buf); + debugf("reading blk=%d size=%d @ 0x%08x\n", (int)blk, size, (uint32_t)buf); handle = stor_info[dev->d_unit]; err = ub_dev_read(handle, buf, size, blk, &real_size); @@ -495,7 +583,10 @@ stor_opendev(struct open_dev **odp, stru od->od_bsize = di->di_stor.block_size; od->od_bstart = 0; - if ((err = stor_open_gpt(od, dev)) != 0) + err = stor_open_gpt(od, dev); + if (err != 0) + err = stor_open_mbr(od, dev); + if (err != 0) err = stor_open_bsdlabel(od, dev); if (err != 0) @@ -517,6 +608,8 @@ stor_closedev(struct uboot_devdesc *dev) od = (struct open_dev *)dev->d_disk.data; if (dev->d_disk.ptype == PTYPE_GPT && od->od_nparts != 0) free(od->od_partitions); + if (dev->d_disk.ptype == PTYPE_MBR && od->od_nparts != 0) + free(od->od_partitions); free(od); dev->d_disk.data = NULL; Modified: projects/armv6/sys/boot/uboot/lib/elf_freebsd.c ============================================================================== --- projects/armv6/sys/boot/uboot/lib/elf_freebsd.c Sat Jun 23 19:46:07 2012 (r237505) +++ projects/armv6/sys/boot/uboot/lib/elf_freebsd.c Sat Jun 23 19:49:18 2012 (r237506) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" +#include "libuboot.h" extern vm_offset_t md_load(char *, vm_offset_t *); @@ -69,6 +70,7 @@ __elfN(uboot_exec)(struct preloaded_file vm_offset_t mdp; Elf_Ehdr *e; int error; + void (*entry)(void *); if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) return (EFTYPE); @@ -78,11 +80,12 @@ __elfN(uboot_exec)(struct preloaded_file if ((error = md_load(fp->f_args, &mdp)) != 0) return (error); - printf("Kernel entry at 0x%x ...\n", e->e_entry); + entry = uboot_vm_translate(e->e_entry); + printf("Kernel entry at 0x%x...\n", (unsigned)entry); dev_cleanup(); - (*(void (*)())e->e_entry)((void *)mdp); + (*entry)((void *)mdp); panic("exec returned"); } Modified: projects/armv6/sys/boot/uboot/lib/libuboot.h ============================================================================== --- projects/armv6/sys/boot/uboot/lib/libuboot.h Sat Jun 23 19:46:07 2012 (r237505) +++ projects/armv6/sys/boot/uboot/lib/libuboot.h Sat Jun 23 19:49:18 2012 (r237506) @@ -45,6 +45,7 @@ struct uboot_devdesc #define PTYPE_BSDLABEL 1 #define PTYPE_GPT 2 +#define PTYPE_MBR 3 /* * Default network packet alignment in memory @@ -59,6 +60,7 @@ extern int devs_no; extern struct netif_driver uboot_net; extern struct devsw uboot_storage; +void *uboot_vm_translate(vm_offset_t); ssize_t uboot_copyin(const void *src, vm_offset_t dest, const size_t len); ssize_t uboot_copyout(const vm_offset_t src, void *dest, const size_t len); ssize_t uboot_readin(const int fd, vm_offset_t dest, const size_t len);