Re: svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys

2017-10-13 Thread Ngie Cooper (yaneurabeya)

> On Oct 11, 2017, at 14:53, Matt Joras  wrote:
> 
> Author: mjoras
> Date: Wed Oct 11 21:53:50 2017
> New Revision: 324541
> URL: https://svnweb.freebsd.org/changeset/base/324541
> 
> Log:
>  Add clearing function for unr(9).
> 
>  Previously before you could call unrhdr_delete you needed to
>  individually free every allocated unit. It is useful to be able to tear
>  down the unr without having to go through this process, as it is
>  significantly faster than freeing the individual units.
> 
>  Reviewed by: cem, lidl
>  Approved by: rstone (mentor)
>  Sponsored by:Dell EMC Isilon
>  Differential Revision:   https://reviews.freebsd.org/D12591
> 
> Modified:
>  head/share/man/man9/Makefile
>  head/share/man/man9/unr.9
>  head/sys/kern/subr_unit.c
>  head/sys/sys/systm.h
> 
> Modified: head/share/man/man9/Makefile
> ==
> --- head/share/man/man9/Makefile  Wed Oct 11 20:36:22 2017
> (r324540)
> +++ head/share/man/man9/Makefile  Wed Oct 11 21:53:50 2017
> (r324541)
> @@ -414,6 +414,7 @@ MAN=  accept_filter.9 \
> MLINKS=   unr.9 alloc_unr.9 \
>   unr.9 alloc_unrl.9 \
>   unr.9 alloc_unr_specific.9 \
> + unr.9 clear_unrhdr.9 \
>   unr.9 delete_unrhdr.9 \
>   unr.9 free_unr.9 \
>   unr.9 new_unrhdr.9
> 
> Modified: head/share/man/man9/unr.9
> ==
> --- head/share/man/man9/unr.9 Wed Oct 11 20:36:22 2017(r324540)
> +++ head/share/man/man9/unr.9 Wed Oct 11 21:53:50 2017(r324541)
> @@ -24,11 +24,12 @@
> .\"
> .\" $FreeBSD$
> .\"
> -.Dd July 5, 2010
> +.Dd October 4, 2017
> .Dt UNR 9
> .Os
> .Sh NAME
> .Nm new_unrhdr ,
> +.Nm clear_unrhdr ,
> .Nm delete_unrhdr ,
> .Nm alloc_unr ,
> .Nm alloc_unr_specific ,
> @@ -39,6 +40,8 @@
> .Ft "struct unrhdr *"
> .Fn new_unrhdr "int low" "int high" "struct mtx *mutex"
> .Ft void
> +.Fn clear_unrhdr "struct unrhdr *uh"
> +.Ft void
> .Fn delete_unrhdr "struct unrhdr *uh"
> .Ft int
> .Fn alloc_unr "struct unrhdr *uh"
> @@ -70,8 +73,16 @@ is not
> .Dv NULL ,
> it is used for locking when allocating and freeing units.
> Otherwise, internal mutex is used.
> +.It Fn clear_unrhdr uh
> +Clear all units from the specified unit number allocator entity.
> +This function resets the entity as if it were just initialized with
> +.Fn new_unrhdr .
> .It Fn delete_unrhdr uh
> -Destroy specified unit number allocator entity.
> +Delete specified unit number allocator entity.
> +This function frees the memory associated with the entity, it does not free
> +any units.
> +To free all units use
> +.Fn clear_unrhdr .
> .It Fn alloc_unr uh
> Return a new unit number.
> The lowest free number is always allocated.
> 
> Modified: head/sys/kern/subr_unit.c
> ==
> --- head/sys/kern/subr_unit.c Wed Oct 11 20:36:22 2017(r324540)
> +++ head/sys/kern/subr_unit.c Wed Oct 11 21:53:50 2017(r324541)
> @@ -366,6 +366,27 @@ delete_unrhdr(struct unrhdr *uh)
>   Free(uh);
> }
> 
> +void
> +clear_unrhdr(struct unrhdr *uh)
> +{
> + struct unr *up, *uq;
> +
> + KASSERT(TAILQ_EMPTY(>ppfree),
> + ("unrhdr has postponed item for free"));
> + up = TAILQ_FIRST(>head);
> + while (up != NULL) {

Could this be done with TAILQ_FOREACH_SAFE?
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r324614 - head/sys/sys

2017-10-13 Thread Mateusz Guzik
Author: mjg
Date: Sat Oct 14 04:27:58 2017
New Revision: 324614
URL: https://svnweb.freebsd.org/changeset/base/324614

Log:
  Fix wrong v_free_count annotation - (f) instead of (a)
  
  Reported by:  alc

Modified:
  head/sys/sys/vmmeter.h

Modified: head/sys/sys/vmmeter.h
==
--- head/sys/sys/vmmeter.h  Sat Oct 14 00:47:30 2017(r324613)
+++ head/sys/sys/vmmeter.h  Sat Oct 14 04:27:58 2017(r324614)
@@ -140,7 +140,7 @@ struct vmmeter {
u_int v_inactive_count VMMETER_ALIGNED; /* (a) pages inactive */
u_int v_laundry_count VMMETER_ALIGNED; /* (a) pages eligible for
  laundering */
-   u_int v_free_count VMMETER_ALIGNED; /* (a) pages free */
+   u_int v_free_count VMMETER_ALIGNED; /* (f) pages free */
 };
 #endif /* _KERNEL || _WANT_VMMETER */
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r324609 - head/sys/sys

2017-10-13 Thread Mateusz Guzik
On Sat, Oct 14, 2017 at 2:30 AM, Ian Lepore  wrote:

> On Fri, 2017-10-13 at 23:38 +0200, Svatopluk Kraus wrote:
> > MTX_UNOWNED is a flag. You did not change its value from 4 to 0, you
> > removed it actually. I have very bad feeling about it. But maybe, it's
> > really possible and in that case, a very good explanation should be
> > provided.
> >
> > Svata
> >
>
> The part that scares me is that DESTROYED may have been defined as
> CONTESTED|UNOWNED for subtle and clever reasons lost in the mists of
> time.  Any of the places that are testing the MTX_CONTESTED bit may
> have been relying somehow on the fact that a destroyed mutex has that
> bit set.
>
> Then again, maybe Mateusz has carefully analyzed all this stuff, and we
> should just relax. :)
>
>
I highly doubt there was anything clever going on. Rather, someone wanted
to somehow denote a destroyed mutex, but did not want to introduce an
additional flag - they are not free since the field shares the value with
the
address of the owner. That is, adding flags requires increasing alignment
of struct thread and that adds to memory usage. Thus they combined the
flags in a way which can never happen under normal circumstances.

mtx_destroy explicitly sets the value to MTX_DESTROYED, so there is no
change here.

MTX_UNOWNED is *not* used as a flag. If you grep the tree you will see
it is only used in direct comparisons.

That said, I reviewed all users again and a minor bug was introduced in
owner_mtx (only used by dtrace). For some reason it grabs the owner,
but the instead of checking if it grabbed anything it checks the flag
(fixed in r324613). So that's my bad.

Justification for the change was provided in the commit message: it makes
.text smaller on amd64 and probably all architectures.

-- 
Mateusz Guzik 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324613 - head/sys/kern

2017-10-13 Thread Mateusz Guzik
Author: mjg
Date: Sat Oct 14 00:47:30 2017
New Revision: 324613
URL: https://svnweb.freebsd.org/changeset/base/324613

Log:
  mtx: fix up owner_mtx after r324609
  
  Now that MTX_UNOWNED is 0 the test was alwayas false.

Modified:
  head/sys/kern/kern_mutex.c

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Fri Oct 13 22:40:57 2017(r324612)
+++ head/sys/kern/kern_mutex.c  Sat Oct 14 00:47:30 2017(r324613)
@@ -217,7 +217,7 @@ owner_mtx(const struct lock_object *lock, struct threa
m = (const struct mtx *)lock;
x = m->mtx_lock;
*owner = (struct thread *)(x & ~MTX_FLAGMASK);
-   return (x != MTX_UNOWNED);
+   return (*owner != NULL);
 }
 #endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r324609 - head/sys/sys

2017-10-13 Thread Ian Lepore
On Fri, 2017-10-13 at 23:38 +0200, Svatopluk Kraus wrote:
> MTX_UNOWNED is a flag. You did not change its value from 4 to 0, you
> removed it actually. I have very bad feeling about it. But maybe, it's
> really possible and in that case, a very good explanation should be
> provided.
> 
> Svata
> 

The part that scares me is that DESTROYED may have been defined as
CONTESTED|UNOWNED for subtle and clever reasons lost in the mists of
time.  Any of the places that are testing the MTX_CONTESTED bit may
have been relying somehow on the fact that a destroyed mutex has that
bit set.

Then again, maybe Mateusz has carefully analyzed all this stuff, and we
should just relax. :)

-- Ian

> 
> On Fri, Oct 13, 2017 at 10:31 PM, Mateusz Guzik 
> wrote:
> > 
> > Author: mjg
> > Date: Fri Oct 13 20:31:56 2017
> > New Revision: 324609
> > URL: https://svnweb.freebsd.org/changeset/base/324609
> > 
> > Log:
> >   mtx: change MTX_UNOWNED from 4 to 0
> > 
> >   The value is spread all over the kernel and zeroing a register is
> >   cheaper/shorter than setting it up to an arbitrary value.
> > 
> >   Reduces amd64 GENERIC-NODEBUG .text size by 0.4%.
> > 
> >   MFC after:1 week
> > 
> > Modified:
> >   head/sys/sys/mutex.h
> > 
> > Modified: head/sys/sys/mutex.h
> > ===
> > ===
> > --- head/sys/sys/mutex.hFri Oct 13 20:29:35
> > 2017(r324608)
> > +++ head/sys/sys/mutex.hFri Oct 13 20:31:56
> > 2017(r324609)
> > @@ -65,15 +65,11 @@
> >   * State bits kept in mutex->mtx_lock, for the DEFAULT lock type.
> > None of this,
> >   * with the exception of MTX_UNOWNED, applies to spin locks.
> >   */
> > +#defineMTX_UNOWNED 0x  /* Cookie for free
> > mutex */
> >  #defineMTX_RECURSED0x0001  /* lock recursed
> > (for MTX_DEF only) */
> >  #defineMTX_CONTESTED   0x0002  /* lock contested
> > (for MTX_DEF only) */
> > -#define MTX_UNOWNED0x0004  /* Cookie for free mutex */
> > -#defineMTX_FLAGMASK(MTX_RECURSED | MTX_CONTESTED |
> > MTX_UNOWNED)
> > -
> > -/*
> > - * Value stored in mutex->mtx_lock to denote a destroyed mutex.
> > - */
> > -#defineMTX_DESTROYED   (MTX_CONTESTED | MTX_UNOWNED)
> > +#defineMTX_DESTROYED   0x0004  /* lock destroyed
> > */
> > +#defineMTX_FLAGMASK(MTX_RECURSED | MTX_CONTESTED |
> > MTX_DESTROYED)
> > 
> >  /*
> >   * Prototypes
> > 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r324609 - head/sys/sys

2017-10-13 Thread Svatopluk Kraus
MTX_UNOWNED is a flag. You did not change its value from 4 to 0, you
removed it actually. I have very bad feeling about it. But maybe, it's
really possible and in that case, a very good explanation should be
provided.

Svata


On Fri, Oct 13, 2017 at 10:31 PM, Mateusz Guzik  wrote:
> Author: mjg
> Date: Fri Oct 13 20:31:56 2017
> New Revision: 324609
> URL: https://svnweb.freebsd.org/changeset/base/324609
>
> Log:
>   mtx: change MTX_UNOWNED from 4 to 0
>
>   The value is spread all over the kernel and zeroing a register is
>   cheaper/shorter than setting it up to an arbitrary value.
>
>   Reduces amd64 GENERIC-NODEBUG .text size by 0.4%.
>
>   MFC after:1 week
>
> Modified:
>   head/sys/sys/mutex.h
>
> Modified: head/sys/sys/mutex.h
> ==
> --- head/sys/sys/mutex.hFri Oct 13 20:29:35 2017(r324608)
> +++ head/sys/sys/mutex.hFri Oct 13 20:31:56 2017(r324609)
> @@ -65,15 +65,11 @@
>   * State bits kept in mutex->mtx_lock, for the DEFAULT lock type. None of 
> this,
>   * with the exception of MTX_UNOWNED, applies to spin locks.
>   */
> +#defineMTX_UNOWNED 0x  /* Cookie for free mutex */
>  #defineMTX_RECURSED0x0001  /* lock recursed (for MTX_DEF 
> only) */
>  #defineMTX_CONTESTED   0x0002  /* lock contested (for 
> MTX_DEF only) */
> -#define MTX_UNOWNED0x0004  /* Cookie for free mutex */
> -#defineMTX_FLAGMASK(MTX_RECURSED | MTX_CONTESTED | MTX_UNOWNED)
> -
> -/*
> - * Value stored in mutex->mtx_lock to denote a destroyed mutex.
> - */
> -#defineMTX_DESTROYED   (MTX_CONTESTED | MTX_UNOWNED)
> +#defineMTX_DESTROYED   0x0004  /* lock destroyed */
> +#defineMTX_FLAGMASK(MTX_RECURSED | MTX_CONTESTED | MTX_DESTROYED)
>
>  /*
>   * Prototypes
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324612 - in stable: 10/sys/ufs/ffs 11/sys/ufs/ffs

2017-10-13 Thread John Baldwin
Author: jhb
Date: Fri Oct 13 22:40:57 2017
New Revision: 324612
URL: https://svnweb.freebsd.org/changeset/base/324612

Log:
  MFC 324039: Don't defer wakeup()s for completed journal workitems.
  
  Normally wakeups() are performed for completed softupdates work items
  in workitem_free() before the underlying memory is free()'d.
  complete_jseg() was clearing the "wakeup needed" flag in work items to
  defer the wakeup until the end of each loop iteration.  However, this
  resulted in the item being free'd before it's address was used with
  wakeup().  As a result, another part of the kernel could allocate this
  memory from malloc() and use it as a wait channel for a different
  "event" with a different lock.  This triggered an assertion failure
  when the lock passed to sleepq_add() did not match the existing lock
  associated with the sleep queue.  Fix this by removing the code to
  defer the wakeup in complete_jseg() allowing the wakeup to occur
  slightly earlier in workitem_free() before free() is called.

Modified:
  stable/11/sys/ufs/ffs/ffs_softdep.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/ufs/ffs/ffs_softdep.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/ufs/ffs/ffs_softdep.c
==
--- stable/11/sys/ufs/ffs/ffs_softdep.c Fri Oct 13 21:58:44 2017
(r324611)
+++ stable/11/sys/ufs/ffs/ffs_softdep.c Fri Oct 13 22:40:57 2017
(r324612)
@@ -3596,15 +3596,13 @@ complete_jseg(jseg)
 {
struct worklist *wk;
struct jmvref *jmvref;
-   int waiting;
 #ifdef INVARIANTS
int i = 0;
 #endif
 
while ((wk = LIST_FIRST(>js_entries)) != NULL) {
WORKLIST_REMOVE(wk);
-   waiting = wk->wk_state & IOWAITING;
-   wk->wk_state &= ~(INPROGRESS | IOWAITING);
+   wk->wk_state &= ~INPROGRESS;
wk->wk_state |= COMPLETE;
KASSERT(i++ < jseg->js_cnt,
("handle_written_jseg: overflow %d >= %d",
@@ -3645,8 +3643,6 @@ complete_jseg(jseg)
TYPENAME(wk->wk_type));
/* NOTREACHED */
}
-   if (waiting)
-   wakeup(wk);
}
/* Release the self reference so the structure may be freed. */
rele_jseg(jseg);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324612 - in stable: 10/sys/ufs/ffs 11/sys/ufs/ffs

2017-10-13 Thread John Baldwin
Author: jhb
Date: Fri Oct 13 22:40:57 2017
New Revision: 324612
URL: https://svnweb.freebsd.org/changeset/base/324612

Log:
  MFC 324039: Don't defer wakeup()s for completed journal workitems.
  
  Normally wakeups() are performed for completed softupdates work items
  in workitem_free() before the underlying memory is free()'d.
  complete_jseg() was clearing the "wakeup needed" flag in work items to
  defer the wakeup until the end of each loop iteration.  However, this
  resulted in the item being free'd before it's address was used with
  wakeup().  As a result, another part of the kernel could allocate this
  memory from malloc() and use it as a wait channel for a different
  "event" with a different lock.  This triggered an assertion failure
  when the lock passed to sleepq_add() did not match the existing lock
  associated with the sleep queue.  Fix this by removing the code to
  defer the wakeup in complete_jseg() allowing the wakeup to occur
  slightly earlier in workitem_free() before free() is called.

Modified:
  stable/10/sys/ufs/ffs/ffs_softdep.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/ufs/ffs/ffs_softdep.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/ufs/ffs/ffs_softdep.c
==
--- stable/10/sys/ufs/ffs/ffs_softdep.c Fri Oct 13 21:58:44 2017
(r324611)
+++ stable/10/sys/ufs/ffs/ffs_softdep.c Fri Oct 13 22:40:57 2017
(r324612)
@@ -3594,15 +3594,13 @@ complete_jseg(jseg)
 {
struct worklist *wk;
struct jmvref *jmvref;
-   int waiting;
 #ifdef INVARIANTS
int i = 0;
 #endif
 
while ((wk = LIST_FIRST(>js_entries)) != NULL) {
WORKLIST_REMOVE(wk);
-   waiting = wk->wk_state & IOWAITING;
-   wk->wk_state &= ~(INPROGRESS | IOWAITING);
+   wk->wk_state &= ~INPROGRESS;
wk->wk_state |= COMPLETE;
KASSERT(i++ < jseg->js_cnt,
("handle_written_jseg: overflow %d >= %d",
@@ -3643,8 +3641,6 @@ complete_jseg(jseg)
TYPENAME(wk->wk_type));
/* NOTREACHED */
}
-   if (waiting)
-   wakeup(wk);
}
/* Release the self reference so the structure may be freed. */
rele_jseg(jseg);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324611 - in stable: 10/sys/kern 11/sys/kern

2017-10-13 Thread John Baldwin
Author: jhb
Date: Fri Oct 13 21:58:44 2017
New Revision: 324611
URL: https://svnweb.freebsd.org/changeset/base/324611

Log:
  MFC 324073: Use UMA_ALIGNOF() for name cache UMA zones.
  
  This fixes kernel crashes due to misaligned accesses to the 64-bit
  time_t embedded in struct namecache_ts in MIPS n32 kernels.

Modified:
  stable/11/sys/kern/vfs_cache.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/kern/vfs_cache.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/kern/vfs_cache.c
==
--- stable/11/sys/kern/vfs_cache.c  Fri Oct 13 21:54:34 2017
(r324610)
+++ stable/11/sys/kern/vfs_cache.c  Fri Oct 13 21:58:44 2017
(r324611)
@@ -1760,16 +1760,20 @@ nchinit(void *dummy __unused)
 
cache_zone_small = uma_zcreate("S VFS Cache",
sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1,
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+   NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache),
+   UMA_ZONE_ZINIT);
cache_zone_small_ts = uma_zcreate("STS VFS Cache",
sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1,
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+   NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts),
+   UMA_ZONE_ZINIT);
cache_zone_large = uma_zcreate("L VFS Cache",
sizeof(struct namecache) + NAME_MAX + 1,
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+   NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache),
+   UMA_ZONE_ZINIT);
cache_zone_large_ts = uma_zcreate("LTS VFS Cache",
sizeof(struct namecache_ts) + NAME_MAX + 1,
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+   NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts),
+   UMA_ZONE_ZINIT);
 
nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, );
ncbuckethash = cache_roundup_2(mp_ncpus * 64) - 1;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324611 - in stable: 10/sys/kern 11/sys/kern

2017-10-13 Thread John Baldwin
Author: jhb
Date: Fri Oct 13 21:58:44 2017
New Revision: 324611
URL: https://svnweb.freebsd.org/changeset/base/324611

Log:
  MFC 324073: Use UMA_ALIGNOF() for name cache UMA zones.
  
  This fixes kernel crashes due to misaligned accesses to the 64-bit
  time_t embedded in struct namecache_ts in MIPS n32 kernels.

Modified:
  stable/10/sys/kern/vfs_cache.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/kern/vfs_cache.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/kern/vfs_cache.c
==
--- stable/10/sys/kern/vfs_cache.c  Fri Oct 13 21:54:34 2017
(r324610)
+++ stable/10/sys/kern/vfs_cache.c  Fri Oct 13 21:58:44 2017
(r324611)
@@ -907,16 +907,20 @@ nchinit(void *dummy __unused)
 
cache_zone_small = uma_zcreate("S VFS Cache",
sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1,
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+   NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache),
+   UMA_ZONE_ZINIT);
cache_zone_small_ts = uma_zcreate("STS VFS Cache",
sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1,
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+   NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts),
+   UMA_ZONE_ZINIT);
cache_zone_large = uma_zcreate("L VFS Cache",
sizeof(struct namecache) + NAME_MAX + 1,
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+   NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache),
+   UMA_ZONE_ZINIT);
cache_zone_large_ts = uma_zcreate("LTS VFS Cache",
sizeof(struct namecache_ts) + NAME_MAX + 1,
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+   NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts),
+   UMA_ZONE_ZINIT);
 
nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, );
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324610 - in head/sys: sys vm

2017-10-13 Thread Mateusz Guzik
Author: mjg
Date: Fri Oct 13 21:54:34 2017
New Revision: 324610
URL: https://svnweb.freebsd.org/changeset/base/324610

Log:
  Reduce traffic on vm_cnt.v_free_count
  
  The variable is modified with the highly contended page free queue lock.
  It unnecessarily shares a cacheline with purely read-only fields and is
  re-read after the lock is dropped in the page allocation code making the
  hold time longer.
  
  Pad the variable just like the others and store the value as found with
  the lock held instead of re-reading.
  
  Provides a modest 1%-ish speed up in concurrent page faults.
  
  Reviewed by:  kib, markj
  Differential Revision:https://reviews.freebsd.org/D12665

Modified:
  head/sys/sys/vmmeter.h
  head/sys/vm/vm_page.c
  head/sys/vm/vm_phys.h

Modified: head/sys/sys/vmmeter.h
==
--- head/sys/sys/vmmeter.h  Fri Oct 13 20:31:56 2017(r324609)
+++ head/sys/sys/vmmeter.h  Fri Oct 13 21:54:34 2017(r324610)
@@ -131,7 +131,6 @@ struct vmmeter {
u_int v_free_reserved;  /* (c) pages reserved for deadlock */
u_int v_free_target;/* (c) pages desired free */
u_int v_free_min;   /* (c) pages desired free */
-   u_int v_free_count; /* (f) pages free */
u_int v_inactive_target; /* (c) pages desired inactive */
u_int v_pageout_free_min;   /* (c) min pages reserved for kernel */
u_int v_interrupt_free_min; /* (c) reserved pages for int code */
@@ -141,6 +140,7 @@ struct vmmeter {
u_int v_inactive_count VMMETER_ALIGNED; /* (a) pages inactive */
u_int v_laundry_count VMMETER_ALIGNED; /* (a) pages eligible for
  laundering */
+   u_int v_free_count VMMETER_ALIGNED; /* (a) pages free */
 };
 #endif /* _KERNEL || _WANT_VMMETER */
 
@@ -208,10 +208,10 @@ vm_paging_target(void)
  * Returns TRUE if the pagedaemon needs to be woken up.
  */
 static inline int
-vm_paging_needed(void)
+vm_paging_needed(u_int free_count)
 {
 
-   return (vm_cnt.v_free_count < vm_pageout_wakeup_thresh);
+   return (free_count < vm_pageout_wakeup_thresh);
 }
 
 /*

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Fri Oct 13 20:31:56 2017(r324609)
+++ head/sys/vm/vm_page.c   Fri Oct 13 21:54:34 2017(r324610)
@@ -1588,6 +1588,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi
 {
vm_page_t m;
int flags, req_class;
+   u_int free_count;
 
KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) &&
(object != NULL || (req & VM_ALLOC_SBUSY) == 0) &&
@@ -1655,7 +1656,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi
 *  At this point we had better have found a good page.
 */
KASSERT(m != NULL, ("missing page"));
-   vm_phys_freecnt_adj(m, -1);
+   free_count = vm_phys_freecnt_adj(m, -1);
mtx_unlock(_page_queue_free_mtx);
vm_page_alloc_check(m);
 
@@ -1713,7 +1714,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi
 * Don't wakeup too often - wakeup the pageout daemon when
 * we would be nearly out of memory.
 */
-   if (vm_paging_needed())
+   if (vm_paging_needed(free_count))
pagedaemon_wakeup();
 
return (m);
@@ -1899,7 +1900,7 @@ retry:
pmap_page_set_memattr(m, memattr);
pindex++;
}
-   if (vm_paging_needed())
+   if (vm_paging_needed(vm_cnt.v_free_count))
pagedaemon_wakeup();
return (m_ret);
 }
@@ -1948,7 +1949,7 @@ vm_page_t
 vm_page_alloc_freelist(int flind, int req)
 {
vm_page_t m;
-   u_int flags;
+   u_int flags, free_count;
int req_class;
 
req_class = req & VM_ALLOC_CLASS_MASK;
@@ -1980,7 +1981,7 @@ vm_page_alloc_freelist(int flind, int req)
mtx_unlock(_page_queue_free_mtx);
return (NULL);
}
-   vm_phys_freecnt_adj(m, -1);
+   free_count = vm_phys_freecnt_adj(m, -1);
mtx_unlock(_page_queue_free_mtx);
vm_page_alloc_check(m);
 
@@ -2002,7 +2003,7 @@ vm_page_alloc_freelist(int flind, int req)
}
/* Unmanaged pages don't use "act_count". */
m->oflags = VPO_UNMANAGED;
-   if (vm_paging_needed())
+   if (vm_paging_needed(free_count))
pagedaemon_wakeup();
return (m);
 }

Modified: head/sys/vm/vm_phys.h
==
--- head/sys/vm/vm_phys.h   Fri Oct 13 20:31:56 2017(r324609)
+++ head/sys/vm/vm_phys.h   Fri Oct 13 21:54:34 2017(r324610)
@@ -112,13 +112,13 @@ vm_phys_domain(vm_page_t m)
 #endif
 }
 
-static inline void
+static inline u_int
 vm_phys_freecnt_adj(vm_page_t m, int adj)
 {
 

Re: svn commit: r324471 - head/sys/boot

2017-10-13 Thread Devin Teske

> On Oct 13, 2017, at 8:53 AM, Ngie Cooper  wrote:
> 
> 
>> On Oct 9, 2017, at 21:57, Ngie Cooper (yaneurabeya)  
>> wrote:
>> 
>> 
>>> On Oct 9, 2017, at 21:56, Warner Losh  wrote:
>>> 
>>> DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME.
>>> 
>>> DO NOT MAKE ANY COMMITS TO sys/boot.
>>> 
>>> BACK OFF.
>>> 
>>> Seriously, though, extra changes create extra friction, and these changes 
>>> aren't worth any friction at all. I'm deleting LIBSAU and this guarantees a 
>>> conflict when I update.
>>> 
>>> So please, do not make any edits to sys/boot whatsoever, no matter how 
>>> trivial.
>>> 
>>> At least until I'm done.
>> 
>> Ok
> 
> So... what’s the status?

Your typo gave me an idea for a new tool ...

Usage: whatfs path ...

Return unique list of filesystems containing list of paths.

Lol ;D

E.g., "whatfs / /usr /usr/local /foo /bar" would list minimal filesystem 
mountpoints containing all given paths

-- 
Devin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Re: svn commit: r324609 - head/sys/sys

2017-10-13 Thread Mateusz Guzik
On Fri, Oct 13, 2017 at 10:54 PM, Ian Lepore  wrote:

> On Fri, 2017-10-13 at 20:31 +, Mateusz Guzik wrote:
> > Author: mjg
> > Date: Fri Oct 13 20:31:56 2017
> > New Revision: 324609
> > URL: https://svnweb.freebsd.org/changeset/base/324609
> >
> > Log:
> >   mtx: change MTX_UNOWNED from 4 to 0
> >
> >   The value is spread all over the kernel and zeroing a register is
> >   cheaper/shorter than setting it up to an arbitrary value.
> >
> >   Reduces amd64 GENERIC-NODEBUG .text size by 0.4%.
> >
> >   MFC after:  1 week
> >
>
> If you MFC this, won't that break the ABI for modules compiled against
> earlier versions of the branch?
>
> Also, won't this trigger a need to recompile out of tree modules such
> as video drivers, virtualbox, etc?  Does that need an UPDATING entry?
>
> -- Ian
>
>
All modules (even ones provided with base) always call dedicated
primitives, i.e. they never inspect the lock value.

The only non-opaque part of locks (and annoying at that) is placememnt
of the lock word, which right not is at the very end. This happens to
matter when passing the lock around to funcs like _sleep which
automagically determine what it is.

I am considering a change for head which moves the word to the beginning
instead and that probably wont be MFCable unless I come up with a
reasonably non-terrible kludge.

-- 
Mateusz Guzik 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r324609 - head/sys/sys

2017-10-13 Thread Ian Lepore
On Fri, 2017-10-13 at 20:31 +, Mateusz Guzik wrote:
> Author: mjg
> Date: Fri Oct 13 20:31:56 2017
> New Revision: 324609
> URL: https://svnweb.freebsd.org/changeset/base/324609
> 
> Log:
>   mtx: change MTX_UNOWNED from 4 to 0
>   
>   The value is spread all over the kernel and zeroing a register is
>   cheaper/shorter than setting it up to an arbitrary value.
>   
>   Reduces amd64 GENERIC-NODEBUG .text size by 0.4%.
>   
>   MFC after:  1 week
> 

If you MFC this, won't that break the ABI for modules compiled against
earlier versions of the branch?

Also, won't this trigger a need to recompile out of tree modules such
as video drivers, virtualbox, etc?  Does that need an UPDATING entry?

-- Ian

___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324609 - head/sys/sys

2017-10-13 Thread Mateusz Guzik
Author: mjg
Date: Fri Oct 13 20:31:56 2017
New Revision: 324609
URL: https://svnweb.freebsd.org/changeset/base/324609

Log:
  mtx: change MTX_UNOWNED from 4 to 0
  
  The value is spread all over the kernel and zeroing a register is
  cheaper/shorter than setting it up to an arbitrary value.
  
  Reduces amd64 GENERIC-NODEBUG .text size by 0.4%.
  
  MFC after:1 week

Modified:
  head/sys/sys/mutex.h

Modified: head/sys/sys/mutex.h
==
--- head/sys/sys/mutex.hFri Oct 13 20:29:35 2017(r324608)
+++ head/sys/sys/mutex.hFri Oct 13 20:31:56 2017(r324609)
@@ -65,15 +65,11 @@
  * State bits kept in mutex->mtx_lock, for the DEFAULT lock type. None of this,
  * with the exception of MTX_UNOWNED, applies to spin locks.
  */
+#defineMTX_UNOWNED 0x  /* Cookie for free mutex */
 #defineMTX_RECURSED0x0001  /* lock recursed (for MTX_DEF 
only) */
 #defineMTX_CONTESTED   0x0002  /* lock contested (for MTX_DEF 
only) */
-#define MTX_UNOWNED0x0004  /* Cookie for free mutex */
-#defineMTX_FLAGMASK(MTX_RECURSED | MTX_CONTESTED | MTX_UNOWNED)
-
-/*
- * Value stored in mutex->mtx_lock to denote a destroyed mutex.
- */
-#defineMTX_DESTROYED   (MTX_CONTESTED | MTX_UNOWNED)
+#defineMTX_DESTROYED   0x0004  /* lock destroyed */
+#defineMTX_FLAGMASK(MTX_RECURSED | MTX_CONTESTED | MTX_DESTROYED)
 
 /*
  * Prototypes
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324608 - head/etc/devd

2017-10-13 Thread Kristof Provost
Author: kp
Date: Fri Oct 13 20:29:35 2017
New Revision: 324608
URL: https://svnweb.freebsd.org/changeset/base/324608

Log:
  Regenerate usb.conf

Modified:
  head/etc/devd/usb.conf

Modified: head/etc/devd/usb.conf
==
--- head/etc/devd/usb.conf  Fri Oct 13 19:41:35 2017(r324607)
+++ head/etc/devd/usb.conf  Fri Oct 13 20:29:35 2017(r324608)
@@ -4744,6 +4744,14 @@ nomatch 32 {
 nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
+   match "vendor" "0x17ef";
+   match "product" "0x7205";
+   action "kldload -n if_ure";
+};
+
+nomatch 32 {
+   match "bus" "uhub[0-9]+";
+   match "mode" "host";
match "vendor" "0x17f4";
match "product" "0x";
action "kldload -n uslcom";
@@ -5097,7 +5105,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x2001";
-   match "product" "(0x7d02|0x7e12|0xa707|0xa805)";
+   match "product" "(0x7d02|0x7e12|0x7e35|0xa707|0xa805|0xab00)";
action "kldload -n u3g";
 };
 
@@ -5905,5 +5913,5 @@ nomatch 32 {
action "kldload -n umass";
 };
 
-# 2754 USB entries processed
+# 2757 USB entries processed
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324607 - in head/sys/dev/usb: . serial

2017-10-13 Thread Kristof Provost
Author: kp
Date: Fri Oct 13 19:41:35 2017
New Revision: 324607
URL: https://svnweb.freebsd.org/changeset/base/324607

Log:
  Support the D-Link DWM-222 LTE Dongle
  
  Submitted by: Daniel Hänschke 

Modified:
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/u3g.c
==
--- head/sys/dev/usb/serial/u3g.c   Fri Oct 13 19:27:33 2017
(r324606)
+++ head/sys/dev/usb/serial/u3g.c   Fri Oct 13 19:41:35 2017
(r324607)
@@ -236,6 +236,8 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = {
U3G_DEV(DLINK, DWR510, 0),
U3G_DEV(DLINK, DWM157_CD, U3GINIT_SCSIEJECT),
U3G_DEV(DLINK, DWM157, 0),
+   U3G_DEV(DLINK, DWM222_CD, U3GINIT_SCSIEJECT),
+   U3G_DEV(DLINK, DWM222, 0),
U3G_DEV(DLINK3, DWM652, 0),
U3G_DEV(HP, EV2200, 0),
U3G_DEV(HP, HS2300, 0),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsFri Oct 13 19:27:33 2017(r324606)
+++ head/sys/dev/usb/usbdevsFri Oct 13 19:41:35 2017(r324607)
@@ -1673,8 +1673,10 @@ product DLINK DSB650TX2  0x4102  10/100 Ethernet
 product DLINK DUB1312  0x4a00  10/100/1000 Ethernet
 product DLINK DWM157   0x7d02  DWM-157
 product DLINK DWR510   0x7e12  DWR-510
+product DLINK DWM222   0x7e35  DWM-222
 product DLINK DWM157_CD0xa707  DWM-157 CD-ROM Mode
 product DLINK DWR510_CD0xa805  DWR-510 CD-ROM Mode
+product DLINK DWM222_CD0xab00  DWM-222 CD-ROM Mode
 product DLINK DSB650   0xabc1  10/100 Ethernet
 product DLINK DUBH70xf103  DUB-H7 USB 2.0 7-Port Hub
 product DLINK2 RTL8192SU_1 0x3300  RTL8192SU
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r324606 - head/sys/compat/linuxkpi/common/src

2017-10-13 Thread Mark Johnston
Author: markj
Date: Fri Oct 13 19:27:33 2017
New Revision: 324606
URL: https://svnweb.freebsd.org/changeset/base/324606

Log:
  Make the PHOLD in linux_wait_event_common() unconditional.
  
  After some in-progress work is committed, this would otherwise be the only
  instance of #if(n)def NO_SWAPPING in the tree. Moreover, the requisite
  opt_vm.h include was missing, so the PHOLD/PRELE calls were always being
  compiled in anyway.
  
  MFC after:1 week

Modified:
  head/sys/compat/linuxkpi/common/src/linux_schedule.c

Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c
==
--- head/sys/compat/linuxkpi/common/src/linux_schedule.cFri Oct 13 
18:30:32 2017(r324605)
+++ head/sys/compat/linuxkpi/common/src/linux_schedule.cFri Oct 13 
19:27:33 2017(r324606)
@@ -232,9 +232,7 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q
 * Our wait queue entry is on the stack - make sure it doesn't
 * get swapped out while we sleep.
 */
-#ifndef NO_SWAPPING
PHOLD(task->task_thread->td_proc);
-#endif
sleepq_lock(task);
if (atomic_load_acq_int(>state) != TASK_WAKING) {
ret = linux_add_to_sleepqueue(task, "wevent", timeout, state);
@@ -242,9 +240,7 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q
sleepq_release(task);
ret = linux_signal_pending_state(state, task) ? -ERESTARTSYS : 
0;
}
-#ifndef NO_SWAPPING
PRELE(task->task_thread->td_proc);
-#endif
 
PICKUP_GIANT();
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324605 - head/targets/pseudo/userland/gnu

2017-10-13 Thread Ed Maste
Author: emaste
Date: Fri Oct 13 18:30:32 2017
New Revision: 324605
URL: https://svnweb.freebsd.org/changeset/base/324605

Log:
  clean up remnants of removed GPL software
  
  send-pr   r267486
  texinfo   r276551
  ranlibr286332
  sdiff r298823
  rcs   r307351
  diff  r317209

Modified:
  head/targets/pseudo/userland/gnu/Makefile.depend

Modified: head/targets/pseudo/userland/gnu/Makefile.depend
==
--- head/targets/pseudo/userland/gnu/Makefile.dependFri Oct 13 18:23:08 
2017(r324604)
+++ head/targets/pseudo/userland/gnu/Makefile.dependFri Oct 13 18:30:32 
2017(r324605)
@@ -28,10 +28,7 @@ DIRDEPS = \
gnu/usr.bin/binutils/libiberty \
gnu/usr.bin/binutils/libopcodes \
gnu/usr.bin/binutils/objdump \
-   gnu/usr.bin/binutils/ranlib \
gnu/usr.bin/dialog \
-   gnu/usr.bin/diff \
-   gnu/usr.bin/diff/doc \
gnu/usr.bin/diff3 \
gnu/usr.bin/gdb/doc \
gnu/usr.bin/gdb/gdb \
@@ -43,26 +40,6 @@ DIRDEPS = \
gnu/usr.bin/gperf/doc \
gnu/usr.bin/grep \
gnu/usr.bin/grep/doc \
-   gnu/usr.bin/rcs/ci \
-   gnu/usr.bin/rcs/co \
-   gnu/usr.bin/rcs/ident \
-   gnu/usr.bin/rcs/lib \
-   gnu/usr.bin/rcs/merge \
-   gnu/usr.bin/rcs/rcs \
-   gnu/usr.bin/rcs/rcsclean \
-   gnu/usr.bin/rcs/rcsdiff \
-   gnu/usr.bin/rcs/rcsfreeze \
-   gnu/usr.bin/rcs/rcsmerge \
-   gnu/usr.bin/rcs/rlog \
-   gnu/usr.bin/sdiff \
-   gnu/usr.bin/send-pr/doc \
-   gnu/usr.bin/texinfo/doc \
-   gnu/usr.bin/texinfo/info \
-   gnu/usr.bin/texinfo/infokey \
-   gnu/usr.bin/texinfo/install-info \
-   gnu/usr.bin/texinfo/libtxi \
-   gnu/usr.bin/texinfo/makeinfo \
-   gnu/usr.bin/texinfo/texindex \
 
 .if ${MK_GPL_DTC} != "no"
 DIRDEPS+= gnu/usr.bin/dtc
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324604 - head/targets/pseudo/userland/gnu

2017-10-13 Thread Ed Maste
Author: emaste
Date: Fri Oct 13 18:23:08 2017
New Revision: 324604
URL: https://svnweb.freebsd.org/changeset/base/324604

Log:
  Remove additional groff leftovers (r319664)

Modified:
  head/targets/pseudo/userland/gnu/Makefile.depend

Modified: head/targets/pseudo/userland/gnu/Makefile.depend
==
--- head/targets/pseudo/userland/gnu/Makefile.dependFri Oct 13 17:15:17 
2017(r324603)
+++ head/targets/pseudo/userland/gnu/Makefile.dependFri Oct 13 18:23:08 
2017(r324604)
@@ -43,53 +43,6 @@ DIRDEPS = \
gnu/usr.bin/gperf/doc \
gnu/usr.bin/grep \
gnu/usr.bin/grep/doc \
-   gnu/usr.bin/groff/contrib/mm \
-   gnu/usr.bin/groff/doc \
-   gnu/usr.bin/groff/font/devX100 \
-   gnu/usr.bin/groff/font/devX100-12 \
-   gnu/usr.bin/groff/font/devX75 \
-   gnu/usr.bin/groff/font/devX75-12 \
-   gnu/usr.bin/groff/font/devascii \
-   gnu/usr.bin/groff/font/devcp1047 \
-   gnu/usr.bin/groff/font/devdvi \
-   gnu/usr.bin/groff/font/devhtml \
-   gnu/usr.bin/groff/font/devkoi8-r \
-   gnu/usr.bin/groff/font/devlatin1 \
-   gnu/usr.bin/groff/font/devlbp \
-   gnu/usr.bin/groff/font/devlj4 \
-   gnu/usr.bin/groff/font/devps \
-   gnu/usr.bin/groff/font/devutf8 \
-   gnu/usr.bin/groff/man \
-   gnu/usr.bin/groff/src/devices/grodvi \
-   gnu/usr.bin/groff/src/devices/grohtml \
-   gnu/usr.bin/groff/src/devices/grolbp \
-   gnu/usr.bin/groff/src/devices/grolj4 \
-   gnu/usr.bin/groff/src/devices/grops \
-   gnu/usr.bin/groff/src/devices/grotty \
-   gnu/usr.bin/groff/src/libs/libbib \
-   gnu/usr.bin/groff/src/libs/libdriver \
-   gnu/usr.bin/groff/src/libs/libgroff \
-   gnu/usr.bin/groff/src/preproc/eqn \
-   gnu/usr.bin/groff/src/preproc/grn \
-   gnu/usr.bin/groff/src/preproc/html \
-   gnu/usr.bin/groff/src/preproc/pic \
-   gnu/usr.bin/groff/src/preproc/refer \
-   gnu/usr.bin/groff/src/preproc/soelim \
-   gnu/usr.bin/groff/src/preproc/tbl \
-   gnu/usr.bin/groff/src/roff/groff \
-   gnu/usr.bin/groff/src/roff/grog \
-   gnu/usr.bin/groff/src/roff/nroff \
-   gnu/usr.bin/groff/src/roff/psroff \
-   gnu/usr.bin/groff/src/roff/troff \
-   gnu/usr.bin/groff/src/utils/addftinfo \
-   gnu/usr.bin/groff/src/utils/afmtodit \
-   gnu/usr.bin/groff/src/utils/hpftodit \
-   gnu/usr.bin/groff/src/utils/indxbib \
-   gnu/usr.bin/groff/src/utils/lkbib \
-   gnu/usr.bin/groff/src/utils/lookbib \
-   gnu/usr.bin/groff/src/utils/pfbtops \
-   gnu/usr.bin/groff/src/utils/tfmtodit \
-   gnu/usr.bin/groff/tmac \
gnu/usr.bin/rcs/ci \
gnu/usr.bin/rcs/co \
gnu/usr.bin/rcs/ident \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324603 - head

2017-10-13 Thread Ed Maste
Author: emaste
Date: Fri Oct 13 17:15:17 2017
New Revision: 324603
URL: https://svnweb.freebsd.org/changeset/base/324603

Log:
  ObsoleteFiles.inc: correct year on libstand removal

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri Oct 13 17:11:08 2017(r324602)
+++ head/ObsoleteFiles.inc  Fri Oct 13 17:15:17 2017(r324603)
@@ -38,7 +38,7 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
-# 20161010: Remove libstand
+# 20171010: Remove libstand
 OLD_FILES+=usr/lib/libstand.a
 OLD_FILES+=usr/lib/libstand_p.a
 OLD_FILES+=usr/include/stand.h
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324602 - in stable: 10/sys/vm 11/sys/vm

2017-10-13 Thread John Baldwin
Author: jhb
Date: Fri Oct 13 17:11:08 2017
New Revision: 324602
URL: https://svnweb.freebsd.org/changeset/base/324602

Log:
  MFC 324072: Add UMA_ALIGNOF().
  
  This is a wrapper around _Alignof() that sets the alignment for a zone
  to the alignment required by a given type.  This allows the compiler to
  determine the proper alignment rather than having the programmer try to
  guess.

Modified:
  stable/10/sys/vm/uma.h
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/vm/uma.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/vm/uma.h
==
--- stable/10/sys/vm/uma.h  Fri Oct 13 16:31:50 2017(r324601)
+++ stable/10/sys/vm/uma.h  Fri Oct 13 17:11:08 2017(r324602)
@@ -296,6 +296,7 @@ uma_zone_t uma_zcache_create(char *name, int size, uma
 #define UMA_ALIGN_SHORT(sizeof(short) - 1) /* "" short */
 #define UMA_ALIGN_CHAR (sizeof(char) - 1)  /* "" char */
 #define UMA_ALIGN_CACHE(0 - 1) /* Cache line size 
align */
+#defineUMA_ALIGNOF(type) (_Alignof(type) - 1)  /* Alignment fit for 
'type' */
 
 /*
  * Destroys an empty uma zone.  If the zone is not empty uma complains loudly.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324602 - in stable: 10/sys/vm 11/sys/vm

2017-10-13 Thread John Baldwin
Author: jhb
Date: Fri Oct 13 17:11:08 2017
New Revision: 324602
URL: https://svnweb.freebsd.org/changeset/base/324602

Log:
  MFC 324072: Add UMA_ALIGNOF().
  
  This is a wrapper around _Alignof() that sets the alignment for a zone
  to the alignment required by a given type.  This allows the compiler to
  determine the proper alignment rather than having the programmer try to
  guess.

Modified:
  stable/11/sys/vm/uma.h
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/vm/uma.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/vm/uma.h
==
--- stable/11/sys/vm/uma.h  Fri Oct 13 16:31:50 2017(r324601)
+++ stable/11/sys/vm/uma.h  Fri Oct 13 17:11:08 2017(r324602)
@@ -296,6 +296,7 @@ uma_zone_t uma_zcache_create(char *name, int size, uma
 #define UMA_ALIGN_SHORT(sizeof(short) - 1) /* "" short */
 #define UMA_ALIGN_CHAR (sizeof(char) - 1)  /* "" char */
 #define UMA_ALIGN_CACHE(0 - 1) /* Cache line size 
align */
+#defineUMA_ALIGNOF(type) (_Alignof(type) - 1)  /* Alignment fit for 
'type' */
 
 /*
  * Destroys an empty uma zone.  If the zone is not empty uma complains loudly.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324601 - head/sys/kern

2017-10-13 Thread Alan Cox
Author: alc
Date: Fri Oct 13 16:31:50 2017
New Revision: 324601
URL: https://svnweb.freebsd.org/changeset/base/324601

Log:
  Address two problems with sendfile(..., SF_NOCACHE) and apply one
  "optimization".  First, sendfile(..., SF_NOCACHE) frees pages without
  checking whether those pages are mapped.  This can leave the system
  with mappings to free or repurposed pages.  Second, a page can be
  busied between the time of the current busy test and acquiring the
  object lock.  Essentially, the test performed before the object lock
  is acquired can only be regarded as an optimization to short-circuit
  further work on the page.  It cannot, however, be relied upon to prove
  that it is safe to free the page.  Third, when sendfile(..., SF_NOCACHE)
  was originally implemented, vm_page_deactivate_noreuse() did not yet
  exist.  Use vm_page_deactivate_noreuse() instead of vm_page_deactivate(),
  because it comes closer to freeing the page.
  
  In collaboration with:glebius
  Discussed with:   gallatin, kib, markj
  X-MFC after:  r324448

Modified:
  head/sys/kern/kern_sendfile.c

Modified: head/sys/kern/kern_sendfile.c
==
--- head/sys/kern/kern_sendfile.c   Fri Oct 13 16:23:05 2017
(r324600)
+++ head/sys/kern/kern_sendfile.c   Fri Oct 13 16:31:50 2017
(r324601)
@@ -143,10 +143,23 @@ sendfile_free_page(vm_page_t pg, bool nocache)
vm_page_free(pg);
else if (nocache) {
if (!vm_page_xbusied(pg) && VM_OBJECT_TRYWLOCK(obj)) {
-   vm_page_free(pg);
+   bool freed;
+
+   /* Only free unmapped pages. */
+   if (obj->ref_count == 0 ||
+   !pmap_page_is_mapped(pg))
+   /*
+* The busy test before the object is
+* locked cannot be relied upon.
+*/
+   freed = vm_page_try_to_free(pg);
+   else
+   freed = false;
VM_OBJECT_WUNLOCK(obj);
+   if (!freed)
+   vm_page_deactivate_noreuse(pg);
} else
-   vm_page_deactivate(pg);
+   vm_page_deactivate_noreuse(pg);
}
}
vm_page_unlock(pg);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324600 - head/sys/vm

2017-10-13 Thread Konstantin Belousov
Author: kib
Date: Fri Oct 13 16:23:05 2017
New Revision: 324600
URL: https://svnweb.freebsd.org/changeset/base/324600

Log:
  Evaluate the real size of the sblk_zone.
  
  Submitted by: o...@j.email.ne.jp
  PR:   221356
  Reviewed by:  alc, markj
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D12660

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cFri Oct 13 15:16:57 2017(r324599)
+++ head/sys/vm/swap_pager.cFri Oct 13 16:23:05 2017(r324600)
@@ -541,6 +541,14 @@ swap_pager_swap_init(void)
 */
n -= ((n + 2) / 3);
} while (n > 0);
+
+   /*
+* Often uma_zone_reserve_kva() cannot reserve exactly the
+* requested size.  Account for the difference when
+* calculating swap_maxpages.
+*/
+   n = uma_zone_get_max(swblk_zone);
+
if (n2 != n)
printf("Swap blk zone entries reduced from %lu to %lu.\n",
n2, n);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r324471 - head/sys/boot

2017-10-13 Thread Ngie Cooper

> On Oct 9, 2017, at 21:57, Ngie Cooper (yaneurabeya)  
> wrote:
> 
> 
>> On Oct 9, 2017, at 21:56, Warner Losh  wrote:
>> 
>> DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME.
>> 
>> DO NOT MAKE ANY COMMITS TO sys/boot.
>> 
>> BACK OFF.
>> 
>> Seriously, though, extra changes create extra friction, and these changes 
>> aren't worth any friction at all. I'm deleting LIBSAU and this guarantees a 
>> conflict when I update.
>> 
>> So please, do not make any edits to sys/boot whatsoever, no matter how 
>> trivial.
>> 
>> At least until I'm done.
> 
> Ok

So... what’s the status?
-Ngie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r324599 - head/release/arm

2017-10-13 Thread Glen Barber
Author: gjb
Date: Fri Oct 13 15:16:57 2017
New Revision: 324599
URL: https://svnweb.freebsd.org/changeset/base/324599

Log:
  Increase the arm/armv6 and arm/armv7 images from 2.5GB to 3GB,
  since the RPI2 (at least) does not fit in 2.5GB.
  
  While here, add a missing BOARDNAME to RPI2.conf.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/arm/BANANAPI.conf
  head/release/arm/BEAGLEBONE.conf
  head/release/arm/CUBIEBOARD.conf
  head/release/arm/CUBIEBOARD2.conf
  head/release/arm/CUBOX-HUMMINGBOARD.conf
  head/release/arm/GUMSTIX.conf
  head/release/arm/PANDABOARD.conf
  head/release/arm/RPI-B.conf
  head/release/arm/RPI2.conf
  head/release/arm/WANDBOARD.conf

Modified: head/release/arm/BANANAPI.conf
==
--- head/release/arm/BANANAPI.conf  Fri Oct 13 15:02:29 2017
(r324598)
+++ head/release/arm/BANANAPI.conf  Fri Oct 13 15:16:57 2017
(r324599)
@@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7"
 EMBEDDEDPORTS="sysutils/u-boot-bananapi"
 KERNEL="GENERIC"
 WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x4200"
-IMAGE_SIZE="2560M"
+IMAGE_SIZE="3072M"
 PART_SCHEME="MBR"
 FAT_SIZE="32m -b 1m"
 FAT_TYPE="16"

Modified: head/release/arm/BEAGLEBONE.conf
==
--- head/release/arm/BEAGLEBONE.confFri Oct 13 15:02:29 2017
(r324598)
+++ head/release/arm/BEAGLEBONE.confFri Oct 13 15:16:57 2017
(r324599)
@@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7"
 EMBEDDEDPORTS="sysutils/u-boot-beaglebone"
 KERNEL="GENERIC"
 WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x8800"
-IMAGE_SIZE="2560M"
+IMAGE_SIZE="3072M"
 PART_SCHEME="MBR"
 FAT_SIZE="2m"
 FAT_TYPE="12"

Modified: head/release/arm/CUBIEBOARD.conf
==
--- head/release/arm/CUBIEBOARD.confFri Oct 13 15:02:29 2017
(r324598)
+++ head/release/arm/CUBIEBOARD.confFri Oct 13 15:16:57 2017
(r324599)
@@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7"
 EMBEDDEDPORTS="sysutils/u-boot-cubieboard"
 KERNEL="GENERIC"
 WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x4200"
-IMAGE_SIZE="2560M"
+IMAGE_SIZE="3072M"
 PART_SCHEME="MBR"
 FAT_SIZE="32m -b 1m"
 FAT_TYPE="16"

Modified: head/release/arm/CUBIEBOARD2.conf
==
--- head/release/arm/CUBIEBOARD2.conf   Fri Oct 13 15:02:29 2017
(r324598)
+++ head/release/arm/CUBIEBOARD2.conf   Fri Oct 13 15:16:57 2017
(r324599)
@@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7"
 EMBEDDEDPORTS="sysutils/u-boot-cubieboard2"
 KERNEL="GENERIC"
 WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x4200"
-IMAGE_SIZE="2560M"
+IMAGE_SIZE="3072M"
 PART_SCHEME="MBR"
 FAT_SIZE="32m -b 1m"
 FAT_TYPE="16"

Modified: head/release/arm/CUBOX-HUMMINGBOARD.conf
==
--- head/release/arm/CUBOX-HUMMINGBOARD.confFri Oct 13 15:02:29 2017
(r324598)
+++ head/release/arm/CUBOX-HUMMINGBOARD.confFri Oct 13 15:16:57 2017
(r324599)
@@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7"
 EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard"
 KERNEL="IMX6"
 WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x1200"
-IMAGE_SIZE="2560M"
+IMAGE_SIZE="3072M"
 PART_SCHEME="MBR"
 FAT_SIZE="50m -b 16384"
 FAT_TYPE="16"

Modified: head/release/arm/GUMSTIX.conf
==
--- head/release/arm/GUMSTIX.conf   Fri Oct 13 15:02:29 2017
(r324598)
+++ head/release/arm/GUMSTIX.conf   Fri Oct 13 15:16:57 2017
(r324599)
@@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6"
 EMBEDDEDPORTS="sysutils/u-boot-duovero"
 KERNEL="GUMSTIX"
 WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x8800"
-IMAGE_SIZE="2560M"
+IMAGE_SIZE="3072M"
 PART_SCHEME="MBR"
 FAT_SIZE="2m"
 FAT_TYPE="12"

Modified: head/release/arm/PANDABOARD.conf
==
--- head/release/arm/PANDABOARD.confFri Oct 13 15:02:29 2017
(r324598)
+++ head/release/arm/PANDABOARD.confFri Oct 13 15:16:57 2017
(r324599)
@@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7"
 EMBEDDEDPORTS="sysutils/u-boot-pandaboard"
 KERNEL="GENERIC"
 WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x8800"
-IMAGE_SIZE="2560M"
+IMAGE_SIZE="3072M"
 PART_SCHEME="MBR"
 FAT_SIZE="2m"
 FAT_TYPE="12"

Modified: head/release/arm/RPI-B.conf
==
--- head/release/arm/RPI-B.conf Fri Oct 13 15:02:29 2017(r324598)
+++ head/release/arm/RPI-B.conf Fri Oct 13 15:16:57 2017(r324599)
@@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6"
 EMBEDDEDPORTS="sysutils/u-boot-rpi"
 KERNEL="RPI-B"
 WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x200"
-IMAGE_SIZE="2560M"
+IMAGE_SIZE="3072M"
 

svn commit: r324598 - head/sys/dev/hwpmc

2017-10-13 Thread Ruslan Bukin
Author: br
Date: Fri Oct 13 15:02:29 2017
New Revision: 324598
URL: https://svnweb.freebsd.org/changeset/base/324598

Log:
  o Support for Kabylake CPU PMCs (fall down to PMC_CPU_INTEL_SKYLAKE).
  o Fix bugs in events descriptions for Skylake, Skylake Xeon and Haswell.
  
  Reviewed by:  kib
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D12654

Modified:
  head/sys/dev/hwpmc/hwpmc_core.c
  head/sys/dev/hwpmc/hwpmc_intel.c
  head/sys/dev/hwpmc/pmc_events.h

Modified: head/sys/dev/hwpmc/hwpmc_core.c
==
--- head/sys/dev/hwpmc/hwpmc_core.c Fri Oct 13 14:14:46 2017
(r324597)
+++ head/sys/dev/hwpmc/hwpmc_core.c Fri Oct 13 15:02:29 2017
(r324598)
@@ -720,8 +720,8 @@ static struct iap_event_descr iap_events[] = {
 IAPDESCR(0CH_02H, 0x0C, 0x02, IAP_F_FM | IAP_F_CC2),
 IAPDESCR(0CH_03H, 0x0C, 0x03, IAP_F_FM | IAP_F_CA),
 
-IAPDESCR(0DH_01H, 0x0D, 0x80, IAP_F_FM | IAP_F_SLX),
-IAPDESCR(0DH_03H, 0x0D, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW |
+IAPDESCR(0DH_01H, 0x0D, 0x01, IAP_F_FM | IAP_F_SL | IAP_F_SLX),
+IAPDESCR(0DH_03H, 0x0D, 0x03, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW |
IAP_F_IB | IAP_F_IBX | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
 IAPDESCR(0DH_40H, 0x0D, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX),
 IAPDESCR(0DH_80H, 0x0D, 0x80, IAP_F_FM | IAP_F_SL | IAP_F_SLX),
@@ -1142,7 +1142,7 @@ static struct iap_event_descr iap_events[] = {
IAP_F_BW | IAP_F_BWX ),
 IAPDESCR(63H_02H, 0x63, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
-   IAP_F_BW | IAP_F_BWX),
+   IAP_F_BW | IAP_F_BWX | IAP_F_SL),
 
 IAPDESCR(64H, 0x64, IAP_M_CORE, IAP_F_CA | IAP_F_CC2),
 IAPDESCR(64H_40H, 0x64, 0x40, IAP_F_FM | IAP_F_CC),
@@ -1425,11 +1425,11 @@ static struct iap_event_descr iap_events[] = {
 
 IAPDESCR(A6H_01H, 0xA6, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL |
IAP_F_SLX),
-IAPDESCR(A6H_02H, 0xA3, 0x02, IAP_F_FM | IAP_F_SL | IAP_F_SLX),
-IAPDESCR(A6H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SL | IAP_F_SLX),
-IAPDESCR(A6H_08H, 0xA3, 0x08, IAP_F_FM | IAP_F_SL | IAP_F_SLX),
-IAPDESCR(A6H_10H, 0xA3, 0x10, IAP_F_FM | IAP_F_SL | IAP_F_SLX),
-IAPDESCR(A6H_40H, 0xA3, 0x40, IAP_F_FM | IAP_F_SL | IAP_F_SLX),
+IAPDESCR(A6H_02H, 0xA6, 0x02, IAP_F_FM | IAP_F_SL | IAP_F_SLX),
+IAPDESCR(A6H_04H, 0xA6, 0x04, IAP_F_FM | IAP_F_SL | IAP_F_SLX),
+IAPDESCR(A6H_08H, 0xA6, 0x08, IAP_F_FM | IAP_F_SL | IAP_F_SLX),
+IAPDESCR(A6H_10H, 0xA6, 0x10, IAP_F_FM | IAP_F_SL | IAP_F_SLX),
+IAPDESCR(A6H_40H, 0xA6, 0x40, IAP_F_FM | IAP_F_SL | IAP_F_SLX),
 
 IAPDESCR(A7H_01H, 0xA7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM ),
 
@@ -1446,7 +1446,7 @@ static struct iap_event_descr iap_events[] = {
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
 IAPDESCR(ABH_02H, 0xAB, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_BW | IAP_F_BWX |
-   IAP_F_SLX),
+   IAP_F_SL | IAP_F_SLX),
 
 IAPDESCR(ACH_02H, 0xAC, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_SL),
 IAPDESCR(ACH_08H, 0xAC, 0x08, IAP_F_FM | IAP_F_SB | IAP_F_IB |
@@ -1486,7 +1486,8 @@ static struct iap_event_descr iap_events[] = {
IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX),
 IAPDESCR(B1H_04H, 0xB1, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
 IAPDESCR(B1H_08H, 0xB1, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
-IAPDESCR(B1H_10H, 0xB1, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SLX),
+IAPDESCR(B1H_10H, 0xB1, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL |
+   IAP_F_SLX),
 IAPDESCR(B1H_1FH, 0xB1, 0x1F, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
 IAPDESCR(B1H_20H, 0xB1, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
 IAPDESCR(B1H_3FH, 0xB1, 0x3F, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
@@ -1495,7 +1496,7 @@ static struct iap_event_descr iap_events[] = {
IAP_F_WM),
 
 IAPDESCR(B2H_01H, 0xB2, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
-   IAP_F_SB | IAP_F_SBX | IAP_F_SLX),
+   IAP_F_SB | IAP_F_SBX | IAP_F_SL | IAP_F_SLX),
 
 IAPDESCR(B3H_01H, 0xB3, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 |
IAP_F_WM | IAP_F_I7O),
@@ -1656,7 +1657,7 @@ static struct iap_event_descr iap_events[] = {
IAP_F_SL | IAP_F_SLX),
 IAPDESCR(C5H_01H, 0xC5, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB |
IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW |
-   IAP_F_BWX | IAP_F_SLX),
+   IAP_F_BWX | IAP_F_SL | IAP_F_SLX),
 IAPDESCR(C5H_02H, 0xC5, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_SL | IAP_F_SLX),
 IAPDESCR(C5H_04H, 0xC5, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_SB |

Modified: head/sys/dev/hwpmc/hwpmc_intel.c
==
--- head/sys/dev/hwpmc/hwpmc_intel.c  

Re: svn commit: r324580 - head/sys/net80211

2017-10-13 Thread Cy Schubert
In message <201710130649.v9d6n7ci036...@repo.freebsd.org>, Adrian Chadd 
writes:
> Author: adrian
> Date: Fri Oct 13 06:49:07 2017
> New Revision: 324580
> URL: https://svnweb.freebsd.org/changeset/base/324580
> 
> Log:
>   [net80211] don't try to follow a NULL rxs pointer down the sink.
>   
>   It's smelly, and we already checked earlier whether we needed to.
> 
> Modified:
>   head/sys/net80211/ieee80211_input.h
> 
> Modified: head/sys/net80211/ieee80211_input.h
> =
> =
> --- head/sys/net80211/ieee80211_input.h   Fri Oct 13 05:14:54 2017
>   (r324579)
> +++ head/sys/net80211/ieee80211_input.h   Fri Oct 13 06:49:07 2017
>   (r324580)
> @@ -278,7 +278,7 @@ ok:
>*/
>   if (ieee80211_check_rxseq_amsdu_more(rxs)) {
>   ni->ni_rxseqs[tid] = rxseq;
> - if (ieee80211_check_rxseq_amsdu(rxs))
> + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs))
>   IEEE80211_NODE_STAT(ni, rx_amsdu_more_end);
>   } else {
>   /* .. still waiting */
> 

Thank you. This fixes it.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324597 - head/sys/compat/linuxkpi/common/src

2017-10-13 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Oct 13 14:14:46 2017
New Revision: 324597
URL: https://svnweb.freebsd.org/changeset/base/324597

Log:
  Don't call selrecord() outside the select system call in the LinuxKPI, because
  then td->td_sel is NULL and this will result in a segfault inside selrecord().
  This happens when only using kqueue() to poll for read and write events.
  If select() and kqueue() is mixed there won't be a segfault.
  
  Reported by:  Johannes Lundberg
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Fri Oct 13 13:56:44 
2017(r324596)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Fri Oct 13 14:14:46 
2017(r324597)
@@ -1021,6 +1021,8 @@ linux_dev_write(struct cdev *dev, struct uio *uio, int
return (error);
 }
 
+#defineLINUX_POLL_TABLE_NORMAL ((poll_table *)1)
+
 static int
 linux_dev_poll(struct cdev *dev, int events, struct thread *td)
 {
@@ -1037,7 +1039,7 @@ linux_dev_poll(struct cdev *dev, int events, struct th
filp->f_flags = file->f_flag;
linux_set_current(td);
if (filp->f_op->poll != NULL)
-   revents = filp->f_op->poll(filp, NULL) & events;
+   revents = filp->f_op->poll(filp, LINUX_POLL_TABLE_NORMAL) & 
events;
else
revents = 0;
 
@@ -1094,7 +1096,9 @@ linux_poll_wait(struct linux_file *filp, wait_queue_he
[LINUX_FWQ_STATE_READY] = LINUX_FWQ_STATE_QUEUED,
};
 
-   selrecord(curthread, >f_selinfo);
+   /* check if we are called inside the select system call */
+   if (p == LINUX_POLL_TABLE_NORMAL)
+   selrecord(curthread, >f_selinfo);
 
switch (linux_poll_wakeup_state(>f_wait_queue.state, state)) {
case LINUX_FWQ_STATE_INIT:
@@ -1438,10 +1442,9 @@ linux_file_poll(struct file *file, int events, struct 
filp = (struct linux_file *)file->f_data;
filp->f_flags = file->f_flag;
linux_set_current(td);
-   if (filp->f_op->poll != NULL) {
-   selrecord(td, >f_selinfo);
-   revents = filp->f_op->poll(filp, NULL) & events;
-   } else
+   if (filp->f_op->poll != NULL)
+   revents = filp->f_op->poll(filp, LINUX_POLL_TABLE_NORMAL) & 
events;
+   else
revents = 0;
 
return (revents);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324596 - stable/11/cddl/contrib/opensolaris/lib/libdtrace/common

2017-10-13 Thread Mark Johnston
Author: markj
Date: Fri Oct 13 13:56:44 2017
New Revision: 324596
URL: https://svnweb.freebsd.org/changeset/base/324596

Log:
  MFC r324373:
  Avoid adding an extra "0x" prefix before pointer formats.

Modified:
  stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c
  stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c
==
--- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.cFri Oct 
13 13:53:19 2017(r324595)
+++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.cFri Oct 
13 13:56:44 2017(r324596)
@@ -434,7 +434,7 @@ dt_dis(const dtrace_difo_t *dp, FILE *fp)
ulong_t i = 0;
char type[DT_TYPE_NAMELEN];
 
-   (void) fprintf(fp, "\nDIFO 0x%p returns %s\n", (void *)dp,
+   (void) fprintf(fp, "\nDIFO %p returns %s\n", (void *)dp,
dt_dis_typestr(>dtdo_rtype, type, sizeof (type)));
 
(void) fprintf(fp, "%-3s %-8s%s\n",

Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c
==
--- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c  Fri Oct 
13 13:53:19 2017(r324595)
+++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c  Fri Oct 
13 13:56:44 2017(r324596)
@@ -377,7 +377,7 @@ dt_print_array(ctf_id_t base, ulong_t off, dt_printarg
ctf_id_t rtype;
 
if (ctf_array_info(ctfp, base, ) == CTF_ERR) {
-   (void) fprintf(fp, "0x%p", (void *)addr);
+   (void) fprintf(fp, "%p", (void *)addr);
return;
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324595 - head/sys/vm

2017-10-13 Thread Ed Maste
Author: emaste
Date: Fri Oct 13 13:53:19 2017
New Revision: 324595
URL: https://svnweb.freebsd.org/changeset/base/324595

Log:
  ANSIfy vm_kern.c
  
  PR:   222673
  Submitted by: o...@j.email.ne.jp
  MFC after:1 week

Modified:
  head/sys/vm/vm_kern.c

Modified: head/sys/vm/vm_kern.c
==
--- head/sys/vm/vm_kern.c   Fri Oct 13 13:47:55 2017(r324594)
+++ head/sys/vm/vm_kern.c   Fri Oct 13 13:53:19 2017(r324595)
@@ -122,8 +122,7 @@ SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLA
  * a mapping on demand through vm_fault() will result in a panic. 
  */
 vm_offset_t
-kva_alloc(size)
-   vm_size_t size;
+kva_alloc(vm_size_t size)
 {
vm_offset_t addr;
 
@@ -144,9 +143,7 @@ kva_alloc(size)
  * This routine may not block on kernel maps.
  */
 void
-kva_free(addr, size)
-   vm_offset_t addr;
-   vm_size_t size;
+kva_free(vm_offset_t addr, vm_size_t size)
 {
 
size = round_page(size);
@@ -433,9 +430,7 @@ kmem_free(struct vmem *vmem, vm_offset_t addr, vm_size
  * This routine may block.
  */
 vm_offset_t
-kmap_alloc_wait(map, size)
-   vm_map_t map;
-   vm_size_t size;
+kmap_alloc_wait(vm_map_t map, vm_size_t size)
 {
vm_offset_t addr;
 
@@ -473,10 +468,7 @@ kmap_alloc_wait(map, size)
  * waiting for memory in that map.
  */
 void
-kmap_free_wakeup(map, addr, size)
-   vm_map_t map;
-   vm_offset_t addr;
-   vm_size_t size;
+kmap_free_wakeup(vm_map_t map, vm_offset_t addr, vm_size_t size)
 {
 
vm_map_lock(map);
@@ -520,8 +512,7 @@ kmem_init_zero_region(void)
  * `start' as allocated, and the range between `start' and `end' as free.
  */
 void
-kmem_init(start, end)
-   vm_offset_t start, end;
+kmem_init(vm_offset_t start, vm_offset_t end)
 {
vm_map_t m;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324594 - head/usr.bin/truss

2017-10-13 Thread Ed Maste
Author: emaste
Date: Fri Oct 13 13:47:55 2017
New Revision: 324594
URL: https://svnweb.freebsd.org/changeset/base/324594

Log:
  truss: mention 'H' in usage
  
  r295930 introduced the 'H' option to display thread IDs, but did not add
  the option to usage().
  
  PR:   222837
  Submitted by: Oliver Kiddle 
  MFC after:1 week

Modified:
  head/usr.bin/truss/main.c

Modified: head/usr.bin/truss/main.c
==
--- head/usr.bin/truss/main.c   Fri Oct 13 11:11:53 2017(r324593)
+++ head/usr.bin/truss/main.c   Fri Oct 13 13:47:55 2017(r324594)
@@ -57,8 +57,8 @@ static void
 usage(void)
 {
fprintf(stderr, "%s\n%s\n",
-   "usage: truss [-cfaedDS] [-o file] [-s strsize] -p pid",
-   "   truss [-cfaedDS] [-o file] [-s strsize] command [args]");
+   "usage: truss [-cfaedDHS] [-o file] [-s strsize] -p pid",
+   "   truss [-cfaedDHS] [-o file] [-s strsize] command [args]");
exit(1);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324593 - head/sys/netpfil/ipfw

2017-10-13 Thread Andrey V. Elsukov
Author: ae
Date: Fri Oct 13 11:11:53 2017
New Revision: 324593
URL: https://svnweb.freebsd.org/changeset/base/324593

Log:
  Fix regression in handling O_FORWARD_IP opcode after r279948.
  
  To properly handle 'fwd tablearg,port' opcode, copy sin_port value from
  sockaddr_in structure stored in the opcode into corresponding hopstore
  field.
  
  PR:   222953
  MFC after:1 week

Modified:
  head/sys/netpfil/ipfw/ip_fw2.c

Modified: head/sys/netpfil/ipfw/ip_fw2.c
==
--- head/sys/netpfil/ipfw/ip_fw2.c  Fri Oct 13 11:01:33 2017
(r324592)
+++ head/sys/netpfil/ipfw/ip_fw2.c  Fri Oct 13 11:11:53 2017
(r324593)
@@ -2442,6 +2442,7 @@ do {  
\
sa6->sin6_len = sizeof(*sa6);
sa6->sin6_addr = TARG_VAL(
chain, tablearg, nh6);
+   sa6->sin6_port = sa->sin_port;
/*
 * Set sin6_scope_id only for
 * link-local unicast addresses.
@@ -2455,6 +2456,8 @@ do {  
\
} else
 #endif
{
+   args->hopstore.sin_port =
+   sa->sin_port;
sa = args->next_hop =
>hopstore;
sa->sin_family = AF_INET;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324592 - head/sbin/ipfw

2017-10-13 Thread Andrey V. Elsukov
Author: ae
Date: Fri Oct 13 11:01:33 2017
New Revision: 324592
URL: https://svnweb.freebsd.org/changeset/base/324592

Log:
  Return 'errno' value from the table_do_modify_record(), it is expected
  by table_modify_record().
  
  This makes quiet operations with tables really quiet.
  
  PR:   222953
  MFC after:1 week

Modified:
  head/sbin/ipfw/tables.c

Modified: head/sbin/ipfw/tables.c
==
--- head/sbin/ipfw/tables.c Fri Oct 13 09:42:05 2017(r324591)
+++ head/sbin/ipfw/tables.c Fri Oct 13 11:01:33 2017(r324592)
@@ -885,6 +885,8 @@ table_do_modify_record(int cmd, ipfw_obj_header *oh,
 
sz += sizeof(*oh);
error = do_get3(cmd, >opheader, );
+   if (error != 0)
+   error = errno;
tent = (ipfw_obj_tentry *)(ctlv + 1);
/* Copy result back to provided buffer */
memcpy(tent_base, ctlv + 1, sizeof(*tent) * count);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324591 - head/sys/kern

2017-10-13 Thread Andriy Gapon
Author: avg
Date: Fri Oct 13 09:42:05 2017
New Revision: 324591
URL: https://svnweb.freebsd.org/changeset/base/324591

Log:
  remove process and jail directory machinations from dounmount
  
  The manipulations done by mountcheckdirs() are not that useful during
  the unmount, they can bring about unexpected security consequences.
  
  Thic change effectively reverts the change in r73241.
  
  The change also allows to simplify the handling of rootvnode global
  variable.
  
  Discussed with:   mckusick, mjg, kib
  Reviewed by:  trasz
  MFC after:1 month
  Differential Revision: https://reviews.freebsd.org/D12366

Modified:
  head/sys/kern/vfs_mount.c

Modified: head/sys/kern/vfs_mount.c
==
--- head/sys/kern/vfs_mount.c   Fri Oct 13 09:21:41 2017(r324590)
+++ head/sys/kern/vfs_mount.c   Fri Oct 13 09:42:05 2017(r324591)
@@ -1262,7 +1262,7 @@ dounmount_cleanup(struct mount *mp, struct vnode *cove
 int
 dounmount(struct mount *mp, int flags, struct thread *td)
 {
-   struct vnode *coveredvp, *fsrootvp;
+   struct vnode *coveredvp;
int error;
uint64_t async_flag;
int mnt_gen_r;
@@ -1364,22 +1364,6 @@ dounmount(struct mount *mp, int flags, struct thread *
MNT_IUNLOCK(mp);
cache_purgevfs(mp, false); /* remove cache entries for this file sys */
vfs_deallocate_syncvnode(mp);
-   /*
-* For forced unmounts, move process cdir/rdir refs on the fs root
-* vnode to the covered vnode.  For non-forced unmounts we want
-* such references to cause an EBUSY error.
-*/
-   if ((flags & MNT_FORCE) &&
-   VFS_ROOT(mp, LK_EXCLUSIVE, ) == 0) {
-   if (mp->mnt_vnodecovered != NULL &&
-   (mp->mnt_flag & MNT_IGNORE) == 0)
-   mountcheckdirs(fsrootvp, mp->mnt_vnodecovered);
-   if (fsrootvp == rootvnode) {
-   vrele(rootvnode);
-   rootvnode = NULL;
-   }
-   vput(fsrootvp);
-   }
if ((mp->mnt_flag & MNT_RDONLY) != 0 || (flags & MNT_FORCE) != 0 ||
(error = VFS_SYNC(mp, MNT_WAIT)) == 0)
error = VFS_UNMOUNT(mp, flags);
@@ -1391,17 +1375,6 @@ dounmount(struct mount *mp, int flags, struct thread *
 * it doesn't exist anymore.
 */
if (error && error != ENXIO) {
-   if ((flags & MNT_FORCE) &&
-   VFS_ROOT(mp, LK_EXCLUSIVE, ) == 0) {
-   if (mp->mnt_vnodecovered != NULL &&
-   (mp->mnt_flag & MNT_IGNORE) == 0)
-   mountcheckdirs(mp->mnt_vnodecovered, fsrootvp);
-   if (rootvnode == NULL) {
-   rootvnode = fsrootvp;
-   vref(rootvnode);
-   }
-   vput(fsrootvp);
-   }
MNT_ILOCK(mp);
mp->mnt_kern_flag &= ~MNTK_NOINSMNTQ;
if ((mp->mnt_flag & MNT_RDONLY) == 0) {
@@ -1432,6 +1405,10 @@ dounmount(struct mount *mp, int flags, struct thread *
VOP_UNLOCK(coveredvp, 0);
}
vfs_event_signal(NULL, VQ_UNMOUNT, 0);
+   if (rootvnode != NULL && mp == rootvnode->v_mount) {
+   vrele(rootvnode);
+   rootvnode = NULL;
+   }
if (mp == rootdevmp)
rootdevmp = NULL;
vfs_mount_destroy(mp);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324590 - head/usr.sbin/i2c

2017-10-13 Thread Andriy Gapon
Author: avg
Date: Fri Oct 13 09:21:41 2017
New Revision: 324590
URL: https://svnweb.freebsd.org/changeset/base/324590

Log:
  i2c(8): clean up and clarify read operation
  
  The code went to a lot of trouble to issue either a start+stop condition
  or a repeated start condition only to follow it with a stop condition
  and a read(2) call that issues a new start condition.
  So, fix the read in I2C_MODE_REPEATED_START mode by using I2CREAD ioctl
  within the running transaction.  This obviously requires that the slave
  address has the read bit set which was not required before.
  
  Another problem was with width parameter of zero and
  I2C_MODE_REPEATED_START mode.  In that case we issued a repeated start
  without any preceding start.
  
  While here, remove the redundant (unused) argument to I2CSTOP throughout
  the program.
  Also, clarify the meaning of -w option, especially "-w 0", in the manual
  page.
  
  Reviewed by:  no one
  Differential Revision: https://reviews.freebsd.org/D12331

Modified:
  head/usr.sbin/i2c/i2c.8
  head/usr.sbin/i2c/i2c.c

Modified: head/usr.sbin/i2c/i2c.8
==
--- head/usr.sbin/i2c/i2c.8 Fri Oct 13 09:14:05 2017(r324589)
+++ head/usr.sbin/i2c/i2c.8 Fri Oct 13 09:21:41 2017(r324590)
@@ -83,6 +83,10 @@ using selected addresses 'a:b:c'. This option is avail
 used.
 .It Fl o Ar offset
 offset within the device for data transfer (hex).
+The default is zero.
+Use
+.Dq -w 0
+to disable writing of the offset to the slave.
 .It Fl r
 reset the controller.
 .It Fl s
@@ -91,6 +95,12 @@ scan the bus for devices.
 be verbose.
 .It Fl w Ar 0|8|16
 device addressing width (in bits).
+This is used to determine how to pass
+.Ar offset
+specified with
+.Fl o
+to the slave.
+Zero means that the offset is ignored and not passed to the slave at all.
 .El
 .Sh WARNINGS
 Great care must be taken when manipulating slave I2C devices with the

Modified: head/usr.sbin/i2c/i2c.c
==
--- head/usr.sbin/i2c/i2c.c Fri Oct 13 09:14:05 2017(r324589)
+++ head/usr.sbin/i2c/i2c.c Fri Oct 13 09:21:41 2017(r324590)
@@ -212,15 +212,14 @@ start_over:
use_read_xfer = 1;
goto start_over;
}
-   cmd.slave = i << 1;
-   cmd.last = 1;
-   ioctl(fd, I2CSTOP, );
+   ioctl(fd, I2CSTOP);
}
if (error == 0) {
++num_found;
printf("%02x ", i);
}
}
+
/*
 * If we found nothing, maybe START is not supported and returns a
 * generic error code such as EIO or ENXIO, so try again using reads.
@@ -355,7 +354,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c
}
}
 
-   error = ioctl(fd, I2CSTOP, );
+   error = ioctl(fd, I2CSTOP);
if (error == -1) {
err_msg = "ioctl: error sending stop condition";
goto err2;
@@ -439,8 +438,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c
}
break;
}
-   cmd.slave = i2c_opt.addr;
-   error = ioctl(fd, I2CSTOP, );
+   error = ioctl(fd, I2CSTOP);
if (error == -1) {
err_msg = "ioctl: error sending stop condition";
goto err2;
@@ -450,8 +448,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c
return (0);
 
 err1:
-   cmd.slave = i2c_opt.addr;
-   error = ioctl(fd, I2CSTOP, );
+   error = ioctl(fd, I2CSTOP);
if (error == -1)
fprintf(stderr, "error sending stop condition\n");
 err2:
@@ -466,7 +463,7 @@ static int
 i2c_read(char *dev, struct options i2c_opt, char *i2c_buf)
 {
struct iiccmd cmd;
-   int i, fd, error, bufsize;
+   int fd, error, bufsize;
char *err_msg, data = 0, *buf;
 
fd = open(dev, O_RDWR);
@@ -503,23 +500,22 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_
}
 
if (i2c_opt.mode == I2C_MODE_STOP_START) {
-   cmd.slave = i2c_opt.addr;
-   error = ioctl(fd, I2CSTOP, );
+   error = ioctl(fd, I2CSTOP);
if (error == -1) {
err_msg = "error sending stop condition";
goto err2;
}
}
}
-   cmd.slave = i2c_opt.addr;
+   cmd.slave = i2c_opt.addr | 1;
cmd.count = 1;
cmd.last = 0;
cmd.buf = 
-   if (i2c_opt.mode == I2C_MODE_STOP_START) {
+   if (i2c_opt.mode == I2C_MODE_STOP_START || i2c_opt.width == 0) {
error = 

svn commit: r324589 - stable/10/sys/geom/mirror

2017-10-13 Thread Andriy Gapon
Author: avg
Date: Fri Oct 13 09:14:05 2017
New Revision: 324589
URL: https://svnweb.freebsd.org/changeset/base/324589

Log:
  MFC r323612: gmirror: treat ENXIO as disk disconnect, not media error

Modified:
  stable/10/sys/geom/mirror/g_mirror.c
  stable/10/sys/geom/mirror/g_mirror.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/geom/mirror/g_mirror.c
==
--- stable/10/sys/geom/mirror/g_mirror.cFri Oct 13 09:13:08 2017
(r324588)
+++ stable/10/sys/geom/mirror/g_mirror.cFri Oct 13 09:14:05 2017
(r324589)
@@ -975,7 +975,13 @@ g_mirror_regular_request(struct bio *bp)
if (g_mirror_disconnect_on_failure &&
g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE) > 1)
{
-   sc->sc_bump_id |= G_MIRROR_BUMP_GENID;
+   if (bp->bio_error == ENXIO &&
+   bp->bio_cmd == BIO_READ)
+   sc->sc_bump_id |= G_MIRROR_BUMP_SYNCID;
+   else if (bp->bio_error == ENXIO)
+   sc->sc_bump_id |= 
G_MIRROR_BUMP_SYNCID_NOW;
+   else
+   sc->sc_bump_id |= G_MIRROR_BUMP_GENID;
g_mirror_event_send(disk,
G_MIRROR_DISK_STATE_DISCONNECTED,
G_MIRROR_EVENT_DONTWAIT);
@@ -2479,6 +2485,10 @@ g_mirror_update_device(struct g_mirror_softc *sc, bool
if ((sc->sc_bump_id & G_MIRROR_BUMP_GENID) != 0) {
sc->sc_bump_id &= ~G_MIRROR_BUMP_GENID;
g_mirror_bump_genid(sc);
+   }
+   if ((sc->sc_bump_id & G_MIRROR_BUMP_SYNCID_NOW) != 0) {
+   sc->sc_bump_id &= ~G_MIRROR_BUMP_SYNCID_NOW;
+   g_mirror_bump_syncid(sc);
}
break;
default:

Modified: stable/10/sys/geom/mirror/g_mirror.h
==
--- stable/10/sys/geom/mirror/g_mirror.hFri Oct 13 09:13:08 2017
(r324588)
+++ stable/10/sys/geom/mirror/g_mirror.hFri Oct 13 09:14:05 2017
(r324589)
@@ -166,9 +166,11 @@ struct g_mirror_event {
 #defineG_MIRROR_DEVICE_STATE_RUNNING   1
 
 /* Bump syncid on first write. */
-#defineG_MIRROR_BUMP_SYNCID0x1
+#defineG_MIRROR_BUMP_SYNCID0x1
 /* Bump genid immediately. */
-#defineG_MIRROR_BUMP_GENID 0x2
+#defineG_MIRROR_BUMP_GENID 0x2
+/* Bump syncid immediately. */
+#defineG_MIRROR_BUMP_SYNCID_NOW0x4
 struct g_mirror_softc {
u_int   sc_state;   /* Device state. */
uint32_tsc_slice;   /* Slice size. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324588 - stable/11/sys/geom/mirror

2017-10-13 Thread Andriy Gapon
Author: avg
Date: Fri Oct 13 09:13:08 2017
New Revision: 324588
URL: https://svnweb.freebsd.org/changeset/base/324588

Log:
  MFC r323612: gmirror: treat ENXIO as disk disconnect, not media error

Modified:
  stable/11/sys/geom/mirror/g_mirror.c
  stable/11/sys/geom/mirror/g_mirror.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/geom/mirror/g_mirror.c
==
--- stable/11/sys/geom/mirror/g_mirror.cFri Oct 13 09:11:24 2017
(r324587)
+++ stable/11/sys/geom/mirror/g_mirror.cFri Oct 13 09:13:08 2017
(r324588)
@@ -982,7 +982,13 @@ g_mirror_regular_request(struct bio *bp)
if (g_mirror_disconnect_on_failure &&
g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE) > 1)
{
-   sc->sc_bump_id |= G_MIRROR_BUMP_GENID;
+   if (bp->bio_error == ENXIO &&
+   bp->bio_cmd == BIO_READ)
+   sc->sc_bump_id |= G_MIRROR_BUMP_SYNCID;
+   else if (bp->bio_error == ENXIO)
+   sc->sc_bump_id |= 
G_MIRROR_BUMP_SYNCID_NOW;
+   else
+   sc->sc_bump_id |= G_MIRROR_BUMP_GENID;
g_mirror_event_send(disk,
G_MIRROR_DISK_STATE_DISCONNECTED,
G_MIRROR_EVENT_DONTWAIT);
@@ -2505,6 +2511,10 @@ g_mirror_update_device(struct g_mirror_softc *sc, bool
if ((sc->sc_bump_id & G_MIRROR_BUMP_GENID) != 0) {
sc->sc_bump_id &= ~G_MIRROR_BUMP_GENID;
g_mirror_bump_genid(sc);
+   }
+   if ((sc->sc_bump_id & G_MIRROR_BUMP_SYNCID_NOW) != 0) {
+   sc->sc_bump_id &= ~G_MIRROR_BUMP_SYNCID_NOW;
+   g_mirror_bump_syncid(sc);
}
break;
default:

Modified: stable/11/sys/geom/mirror/g_mirror.h
==
--- stable/11/sys/geom/mirror/g_mirror.hFri Oct 13 09:11:24 2017
(r324587)
+++ stable/11/sys/geom/mirror/g_mirror.hFri Oct 13 09:13:08 2017
(r324588)
@@ -169,9 +169,11 @@ struct g_mirror_event {
 #defineG_MIRROR_TYPE_AUTOMATIC 1
 
 /* Bump syncid on first write. */
-#defineG_MIRROR_BUMP_SYNCID0x1
+#defineG_MIRROR_BUMP_SYNCID0x1
 /* Bump genid immediately. */
-#defineG_MIRROR_BUMP_GENID 0x2
+#defineG_MIRROR_BUMP_GENID 0x2
+/* Bump syncid immediately. */
+#defineG_MIRROR_BUMP_SYNCID_NOW0x4
 struct g_mirror_softc {
u_int   sc_type;/* Device type (manual/automatic). */
u_int   sc_state;   /* Device state. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324587 - stable/10/cddl/contrib/opensolaris/lib/libzpool/common

2017-10-13 Thread Andriy Gapon
Author: avg
Date: Fri Oct 13 09:11:24 2017
New Revision: 324587
URL: https://svnweb.freebsd.org/changeset/base/324587

Log:
  MFC r323528: MFV r323527: 5815 libzpool's panic function doesn't set global 
panicstr

Modified:
  stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
==
--- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Oct 
13 09:10:37 2017(r324586)
+++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Oct 
13 09:11:24 2017(r324587)
@@ -727,11 +727,9 @@ static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n"
 void
 vpanic(const char *fmt, va_list adx)
 {
-   (void) fprintf(stderr, "error: ");
-   (void) vfprintf(stderr, fmt, adx);
-   (void) fprintf(stderr, "\n");
-
-   abort();/* think of it as a "user-level crash dump" */
+   char buf[512];
+   (void) vsnprintf(buf, 512, fmt, adx);
+   assfail(buf, NULL, 0);
 }
 
 void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324586 - stable/11/cddl/contrib/opensolaris/lib/libzpool/common

2017-10-13 Thread Andriy Gapon
Author: avg
Date: Fri Oct 13 09:10:37 2017
New Revision: 324586
URL: https://svnweb.freebsd.org/changeset/base/324586

Log:
  MFC r323528: MFV r323527: 5815 libzpool's panic function doesn't set global 
panicstr

Modified:
  stable/11/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
==
--- stable/11/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Oct 
13 09:07:58 2017(r324585)
+++ stable/11/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Oct 
13 09:10:37 2017(r324586)
@@ -735,11 +735,9 @@ static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n"
 void
 vpanic(const char *fmt, va_list adx)
 {
-   (void) fprintf(stderr, "error: ");
-   (void) vfprintf(stderr, fmt, adx);
-   (void) fprintf(stderr, "\n");
-
-   abort();/* think of it as a "user-level crash dump" */
+   char buf[512];
+   (void) vsnprintf(buf, 512, fmt, adx);
+   assfail(buf, NULL, 0);
 }
 
 void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324585 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common

2017-10-13 Thread Andriy Gapon
Author: avg
Date: Fri Oct 13 09:07:58 2017
New Revision: 324585
URL: https://svnweb.freebsd.org/changeset/base/324585

Log:
  MFC r323525: MFV r323523: 8331 zfs_unshare returns wrong error code for smb 
unshare failure

Modified:
  stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
==
--- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 
13 09:06:57 2017(r324584)
+++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 
13 09:07:58 2017(r324585)
@@ -24,6 +24,7 @@
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014 by Delphix. All rights reserved.
  * Copyright 2016 Igor Kozhukhov 
+ * Copyright 2017 RackTop Systems.
  */
 
 /*
@@ -88,7 +89,7 @@ zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, c
 zfs_share_proto_t);
 
 /*
- * The share protocols table must be in the same order as the zfs_share_prot_t
+ * The share protocols table must be in the same order as the zfs_share_proto_t
  * enum in libzfs_impl.h
  */
 typedef struct {
@@ -873,7 +874,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co
/* make sure libshare initialized */
if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) {
free(mntpt);/* don't need the copy anymore */
-   return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
+   return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
name, _sa_errorstr(err)));
}
@@ -884,12 +885,13 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co
if (share != NULL) {
err = zfs_sa_disable_share(share, proto_table[proto].p_name);
if (err != SA_OK) {
-   return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
+   return (zfs_error_fmt(hdl,
+   proto_table[proto].p_unshare_err,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
name, _sa_errorstr(err)));
}
} else {
-   return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
+   return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': not found"),
name));
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324584 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common

2017-10-13 Thread Andriy Gapon
Author: avg
Date: Fri Oct 13 09:06:57 2017
New Revision: 324584
URL: https://svnweb.freebsd.org/changeset/base/324584

Log:
  MFC r323525: MFV r323523: 8331 zfs_unshare returns wrong error code for smb 
unshare failure

Modified:
  stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
==
--- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 
13 09:05:32 2017(r324583)
+++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 
13 09:06:57 2017(r324584)
@@ -24,6 +24,7 @@
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014 by Delphix. All rights reserved.
  * Copyright 2016 Igor Kozhukhov 
+ * Copyright 2017 RackTop Systems.
  */
 
 /*
@@ -88,7 +89,7 @@ zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, c
 zfs_share_proto_t);
 
 /*
- * The share protocols table must be in the same order as the zfs_share_prot_t
+ * The share protocols table must be in the same order as the zfs_share_proto_t
  * enum in libzfs_impl.h
  */
 typedef struct {
@@ -873,7 +874,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co
/* make sure libshare initialized */
if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) {
free(mntpt);/* don't need the copy anymore */
-   return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
+   return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
name, _sa_errorstr(err)));
}
@@ -884,12 +885,13 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co
if (share != NULL) {
err = zfs_sa_disable_share(share, proto_table[proto].p_name);
if (err != SA_OK) {
-   return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
+   return (zfs_error_fmt(hdl,
+   proto_table[proto].p_unshare_err,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
name, _sa_errorstr(err)));
}
} else {
-   return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
+   return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': not found"),
name));
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324583 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common

2017-10-13 Thread Andriy Gapon
Author: avg
Date: Fri Oct 13 09:05:32 2017
New Revision: 324583
URL: https://svnweb.freebsd.org/changeset/base/324583

Log:
  MFC r323524: MFV r316932: 6280 libzfs: unshare_one() could fail with 
EZFS_SHARENFSFAILED

Modified:
  stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
==
--- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 
13 09:05:20 2017(r324582)
+++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 
13 09:05:32 2017(r324583)
@@ -20,6 +20,7 @@
  */
 
 /*
+ * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014 by Delphix. All rights reserved.
  * Copyright 2016 Igor Kozhukhov 
@@ -872,7 +873,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co
/* make sure libshare initialized */
if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) {
free(mntpt);/* don't need the copy anymore */
-   return (zfs_error_fmt(hdl, EZFS_SHARENFSFAILED,
+   return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
name, _sa_errorstr(err)));
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324582 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common

2017-10-13 Thread Andriy Gapon
Author: avg
Date: Fri Oct 13 09:05:20 2017
New Revision: 324582
URL: https://svnweb.freebsd.org/changeset/base/324582

Log:
  MFC r323524: MFV r316932: 6280 libzfs: unshare_one() could fail with 
EZFS_SHARENFSFAILED

Modified:
  stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
==
--- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 
13 07:50:44 2017(r324581)
+++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Oct 
13 09:05:20 2017(r324582)
@@ -20,6 +20,7 @@
  */
 
 /*
+ * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014 by Delphix. All rights reserved.
  * Copyright 2016 Igor Kozhukhov 
@@ -872,7 +873,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, co
/* make sure libshare initialized */
if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) {
free(mntpt);/* don't need the copy anymore */
-   return (zfs_error_fmt(hdl, EZFS_SHARENFSFAILED,
+   return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
name, _sa_errorstr(err)));
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r324580 - head/sys/net80211

2017-10-13 Thread Hans Petter Selasky

On 10/13/17 09:45, Adrian Chadd wrote:

no, it checks it.


-a


On 13 October 2017 at 00:11, Hans Petter Selasky  wrote:

On 10/13/17 08:49, Adrian Chadd wrote:


 if (ieee80211_check_rxseq_amsdu_more(rxs)) {


^^^ does this line also need a NULL check?



 ni->ni_rxseqs[tid] = rxseq;
-   if (ieee80211_check_rxseq_amsdu(rxs))
+   if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs))
 IEEE80211_NODE_STAT(ni, rx_amsdu_more_end);



--HPS





Then why are you checking that pointer twice? Why not make 
ieee80211_check_rxseq_amsdu_more() return false, if rxs is NULL?


--HPS
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324581 - stable/11/contrib/mdocml

2017-10-13 Thread Baptiste Daroussin
Author: bapt
Date: Fri Oct 13 07:50:44 2017
New Revision: 324581
URL: https://svnweb.freebsd.org/changeset/base/324581

Log:
  MFC: r324362
  
  Import mandoc 1.14.3

Modified:
  stable/11/contrib/mdocml/Makefile
  stable/11/contrib/mdocml/NEWS
  stable/11/contrib/mdocml/man_term.c
  stable/11/contrib/mdocml/mansearch.c
  stable/11/contrib/mdocml/mdoc_validate.c
  stable/11/contrib/mdocml/tbl_html.c
  stable/11/contrib/mdocml/tbl_term.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/mdocml/Makefile
==
--- stable/11/contrib/mdocml/Makefile   Fri Oct 13 06:49:07 2017
(r324580)
+++ stable/11/contrib/mdocml/Makefile   Fri Oct 13 07:50:44 2017
(r324581)
@@ -15,7 +15,7 @@
 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-VERSION = 1.14.2
+VERSION = 1.14.3
 
 # === LIST OF FILES 
 

Modified: stable/11/contrib/mdocml/NEWS
==
--- stable/11/contrib/mdocml/NEWS   Fri Oct 13 06:49:07 2017
(r324580)
+++ stable/11/contrib/mdocml/NEWS   Fri Oct 13 07:50:44 2017
(r324581)
@@ -2,6 +2,21 @@ $Id: NEWS,v 1.26 2017/07/28 14:57:56 schwarze Exp $
 
 This file lists the most important changes in the mandoc.bsd.lv distribution.
 
+Changes in version 1.14.3, released on August 5, 2017
+
+--- BUG FIXES ---
+ * man(7): Do not crash with out-of-bounds read access to a constant
+   array if .sp or a blank line immediately precedes .SS or .SH.
+ * mdoc(7): Do not crash with out-of-bounds read access to a constant
+   array if .sp or a blank line precede the first .Sh macro.
+ * tbl(7): Ignore explicitly specified negative column widths rather than
+   wrapping around to huge numbers and risking memory exhaustion.
+ * man(1): No longer use names that only occur in the SYNOPSIS section.
+   Gets rid of some surprising behaviour and bogus warnings.
+--- THANKS TO ---
+   Leah Neukirchen (Void Linux), Markus Waldeck (Debian),
+   Peter Bui (nd.edu), and Yuri Pankov (illumos) for bug reports.
+
 Changes in version 1.14.2, released on July 28, 2017
 
 --- MAJOR NEW FEATURES ---

Modified: stable/11/contrib/mdocml/man_term.c
==
--- stable/11/contrib/mdocml/man_term.c Fri Oct 13 06:49:07 2017
(r324580)
+++ stable/11/contrib/mdocml/man_term.c Fri Oct 13 07:50:44 2017
(r324581)
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.208 2017/06/25 11:42:02 schwarze Exp $ */
+/* $Id: man_term.c,v 1.209 2017/07/31 15:19:06 schwarze Exp $ */
 /*
  * Copyright (c) 2008-2012 Kristaps Dzonsons 
  * Copyright (c) 2010-2015, 2017 Ingo Schwarze 
@@ -673,7 +673,7 @@ pre_SS(DECL_ARGS)
 
do {
n = n->prev;
-   } while (n != NULL && n->tok != TOKEN_NONE &&
+   } while (n != NULL && n->tok >= MAN_TH &&
termacts[n->tok].flags & MAN_NOTEXT);
if (n == NULL || (n->tok == MAN_SS && n->body->child == NULL))
break;
@@ -735,7 +735,7 @@ pre_SH(DECL_ARGS)
 
do {
n = n->prev;
-   } while (n != NULL && n->tok != TOKEN_NONE &&
+   } while (n != NULL && n->tok >= MAN_TH &&
termacts[n->tok].flags & MAN_NOTEXT);
if (n == NULL || (n->tok == MAN_SH && n->body->child == NULL))
break;

Modified: stable/11/contrib/mdocml/mansearch.c
==
--- stable/11/contrib/mdocml/mansearch.cFri Oct 13 06:49:07 2017
(r324580)
+++ stable/11/contrib/mdocml/mansearch.cFri Oct 13 07:50:44 2017
(r324581)
@@ -1,4 +1,4 @@
-/* $OpenBSD: mansearch.c,v 1.50 2016/07/09 15:23:36 schwarze Exp $ */
+/* $Id: mansearch.c,v 1.76 2017/08/02 13:29:04 schwarze Exp $ */
 /*
  * Copyright (c) 2012 Kristaps Dzonsons 
  * Copyright (c) 2013-2017 Ingo Schwarze 
@@ -171,7 +171,9 @@ mansearch(const struct mansearch *search,
page = dbm_page_get(rp->page);
 
if (lstmatch(search->sec, page->sect) == 0 ||
-   lstmatch(search->arch, page->arch) == 0)
+   lstmatch(search->arch, page->arch) == 0 ||
+   (search->argmode == ARG_NAME &&
+rp->bits <= (int32_t)(NAME_SYN & NAME_MASK)))
continue;
 
if (res == NULL) {
@@ -452,14 +454,28 @@ lstlen(const char *cp, size_t sep)
 {
size_t   sz;
 
-   for (sz = 0;; sz++) {
-   

Re: svn commit: r324580 - head/sys/net80211

2017-10-13 Thread Adrian Chadd
no, it checks it.


-a


On 13 October 2017 at 00:11, Hans Petter Selasky  wrote:
> On 10/13/17 08:49, Adrian Chadd wrote:
>>
>> if (ieee80211_check_rxseq_amsdu_more(rxs)) {
>
> ^^^ does this line also need a NULL check?
>
>
>> ni->ni_rxseqs[tid] = rxseq;
>> -   if (ieee80211_check_rxseq_amsdu(rxs))
>> +   if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs))
>> IEEE80211_NODE_STAT(ni, rx_amsdu_more_end);
>
>
> --HPS
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r324580 - head/sys/net80211

2017-10-13 Thread Hans Petter Selasky

On 10/13/17 08:49, Adrian Chadd wrote:

if (ieee80211_check_rxseq_amsdu_more(rxs)) {

^^^ does this line also need a NULL check?


ni->ni_rxseqs[tid] = rxseq;
-   if (ieee80211_check_rxseq_amsdu(rxs))
+   if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs))
IEEE80211_NODE_STAT(ni, rx_amsdu_more_end);


--HPS
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324580 - head/sys/net80211

2017-10-13 Thread Adrian Chadd
Author: adrian
Date: Fri Oct 13 06:49:07 2017
New Revision: 324580
URL: https://svnweb.freebsd.org/changeset/base/324580

Log:
  [net80211] don't try to follow a NULL rxs pointer down the sink.
  
  It's smelly, and we already checked earlier whether we needed to.

Modified:
  head/sys/net80211/ieee80211_input.h

Modified: head/sys/net80211/ieee80211_input.h
==
--- head/sys/net80211/ieee80211_input.h Fri Oct 13 05:14:54 2017
(r324579)
+++ head/sys/net80211/ieee80211_input.h Fri Oct 13 06:49:07 2017
(r324580)
@@ -278,7 +278,7 @@ ok:
 */
if (ieee80211_check_rxseq_amsdu_more(rxs)) {
ni->ni_rxseqs[tid] = rxseq;
-   if (ieee80211_check_rxseq_amsdu(rxs))
+   if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs))
IEEE80211_NODE_STAT(ni, rx_amsdu_more_end);
} else {
/* .. still waiting */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r324570 - head/sys/net80211

2017-10-13 Thread Adrian Chadd
god damnit.

lemme go look at what's going on.

thanks for the heads up!


-a


On 12 October 2017 at 18:53, Cy Schubert  wrote:
> In message <201710122156.v9cluwh4017...@repo.freebsd.org>, Adrian Chadd
> writes:
>> Author: adrian
>> Date: Thu Oct 12 21:56:58 2017
>> New Revision: 324570
>> URL: https://svnweb.freebsd.org/changeset/base/324570
>>
>> Log:
>>   [net80211] begin handling multiple hardware decap'ed A-MSDU in the RX path.
>>
>>   The duplicate detection code currently expects A-MSDU frames to be encaped
>> -
>>   they're decap'ed /after/ duplicate detection.
>>
>>   However for ath10k (and iwm hardware later on) the firmware supports
>>   doing A-MSDU decap in hardware - which shows up as multiple frames with
>>   the same sequence number and IV.
>>
>>   This is the first part of decap handling - if we see a stretch of A-MSDU
>>   frames from the driver with the MORE bit set, then don't treat them
>>   as duplicates.
>>
>>   This isn't 100% complete as crypto sequence number handling and "A-MSDU in
>>   A-MPDU" needs handling, but it's a start.
>>
>>   This should be a glorified no-op for everyone.  Please tell me if it isn't.
>>
>
> Hi Adrian,
>
> This is causing iwn in my laptop a bit of gas.
>
> wlan0: Ethernet address: 20:6a:8a:72:03:17
> <118>Created wlan(4) interfaces: wlan0.
> <118>Created clone interfaces: lagg0.
> <5>bge0: link state changed to DOWN
> iwn0: iwn_read_firmware: ucode rev=0x12a80601
> <118>Starting wpa_supplicant.
> <5>lagg0: link state changed to DOWN
> iwn0: iwn_read_firmware: ucode rev=0x12a80601
> <118>Starting dhclient.
> <118>lagg0: no link ...
>
>
> Fatal trap 12: page fault while in kernel mode
> cpuid = 0; apic id = 00
> fault virtual address   = 0x4
> fault code  = supervisor read data, page not present
> instruction pointer = 0x20:0x8155cd59
> stack pointer   = 0x28:0xfe01491e4790
> frame pointer   = 0x28:0xfe01491e4830
> code segment= base 0x0, limit 0xf, type 0x1b
> = DPL 0, pres 1, long 1, def32 0, gran 1
> processor eflags= interrupt enabled, resume, IOPL = 0
> current process = 12 (irq265: iwn0)
> trap number = 12
> panic: page fault
> cpuid = 0
> time = 1507858438
> KDB: stack backtrace:
> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
> 0xfe01491e4370
> vpanic() at vpanic+0x19c/frame 0xfe01491e43f0
> panic() at panic+0x43/frame 0xfe01491e4450
> trap_fatal() at trap_fatal+0x34d/frame 0xfe01491e44a0
> trap_pfault() at trap_pfault+0x49/frame 0xfe01491e4500
> trap() at trap+0x2a9/frame 0xfe01491e46c0
> calltrap() at calltrap+0x8/frame 0xfe01491e46c0
> --- trap 0xc, rip = 0x8155cd59, rsp = 0xfe01491e4790, rbp =
> 0xfe01491e4830 ---
> sta_input() at sta_input+0xb89/frame 0xfe01491e4830
> iwn_notif_intr() at iwn_notif_intr+0x15f7/frame 0xfe01491e4970
> iwn_intr() at iwn_intr+0x5a0/frame 0xfe01491e49e0
> intr_event_execute_handlers() at intr_event_execute_handlers+0xec/frame
> 0xfe01491e4a20
> ithread_loop() at ithread_loop+0xd6/frame 0xfe01491e4a70
> fork_exit() at fork_exit+0x85/frame 0xfe01491e4ab0
> fork_trampoline() at fork_trampoline+0xe/frame 0xfe01491e4ab0
> --- trap 0, rip = 0, rsp = 0, rbp = 0 ---
> Uptime: 29s
> Dumping 704 out of 7978 MB:..3%..12%..21%..32%..41%..53%..62%..71%..82%..91%
>
>
> Loaded symbols for /boot/kernel/nullfs.ko
> #0  doadump (textdump=1) at pcpu.h:232
> 232 pcpu.h: No such file or directory.
> in pcpu.h
> (kgdb) bt
> #0  doadump (textdump=1) at pcpu.h:232
> #1  0x80583eb6 in kern_reboot (howto=260) at
> /opt/src/svn-current/sys/kern/kern_shutdown.c:386
> #2  0x805843a6 in vpanic (fmt=, ap= optimized out>) at /opt/src/svn-current/sys/kern/kern_shutdown.c:779
> #3  0x805841c3 in panic (fmt=) at
> /opt/src/svn-current/sys/kern/kern_shutdown.c:710
> #4  0x80886a8d in trap_fatal (frame=0xfe01491e46d0, eva=4) at
> /opt/src/svn-current/sys/amd64/amd64/trap.c:799
> #5  0x80886ae9 in trap_pfault (frame=0xfe01491e46d0,
> usermode=0) at pcpu.h:232
> #6  0x80886339 in trap (frame=0xfe01491e46d0) at
> /opt/src/svn-current/sys/amd64/amd64/trap.c:420
> #7  0x8086acf1 in calltrap () at /opt/src/svn-current/sys/amd64/amd6
> 4/exception.S:237
> #8  0x8155cd59 in sta_input (ni=0xfe0012651000,
> m=0xf80004040e00, rxs=0x0, rssi=63, nf=-95) at ieee80211_input.h:280
> #9  0x81513987 in iwn_notif_intr () from /boot/kernel/if_iwn.ko
> #10 0x8150a270 in iwn_intr () from /boot/kernel/if_iwn.ko
> #11 0x80548dcc in intr_event_execute_handlers (p= out>, ie=0xf80002b06800) at /opt/src/svn-current/sys/kern/kern_intr.c:13
> 36
> #12 0x80549496 in ithread_loop (arg=0xf80002b50c20) at
> /opt/src/svn-current/sys/kern/kern_intr.c:1349
> #13 0x80546135 in fork_exit (callout=0x805493c0
> ,