svn commit: r339634 - in head/sys: kern net

2018-10-22 Thread Eric Joyner
Author: erj
Date: Tue Oct 23 04:37:29 2018
New Revision: 339634
URL: https://svnweb.freebsd.org/changeset/base/339634

Log:
  iflib: drain enqueued tasks before detaching from taskqgroup
  
  The taskqgroup_detach function does not check if task is already enqueued when
  detaching it. This may lead to kernel panic if enqueued task starts after
  context state lock is destroyed. Ensure that the already enqueued admin tasks
  are executed before detaching them.
  
  The issue was discovered during validation of D16429. Unloading of if_ixlv
  followed by immediate removal of VFs with iovctl -D may lead to panic on
  NODEBUG kernel.
  
  As well, check if iflib is in detach before enqueueing new admin or iov
  tasks, to prevent new tasks from executing while the taskqgroup tasks
  are being drained.
  
  Submitted by: Krzysztof Galazka 
  Reviewed by:  shurd@, erj@
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D17404

Modified:
  head/sys/kern/subr_gtaskqueue.c
  head/sys/net/iflib.c

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Tue Oct 23 03:30:14 2018
(r339633)
+++ head/sys/kern/subr_gtaskqueue.c Tue Oct 23 04:37:29 2018
(r339634)
@@ -812,6 +812,7 @@ taskqgroup_detach(struct taskqgroup *qgroup, struct gr
qgroup->tqg_queue[i].tgc_cnt--;
LIST_REMOVE(gtask, gt_list);
mtx_unlock(>tqg_lock);
+   gtaskqueue_drain(gtask->gt_taskqueue, >gt_task);
gtask->gt_taskqueue = NULL;
 }
 

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Oct 23 03:30:14 2018(r339633)
+++ head/sys/net/iflib.cTue Oct 23 04:37:29 2018(r339634)
@@ -2279,8 +2279,8 @@ iflib_timer(void *arg)
STATE_LOCK(ctx);
if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING);
ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET);
-   iflib_admin_intr_deferred(ctx);
STATE_UNLOCK(ctx);
+   iflib_admin_intr_deferred(ctx);
 }
 
 static void
@@ -2802,8 +2802,8 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget)
 err:
STATE_LOCK(ctx);
ctx->ifc_flags |= IFC_DO_RESET;
-   iflib_admin_intr_deferred(ctx);
STATE_UNLOCK(ctx);
+   iflib_admin_intr_deferred(ctx);
return (false);
 }
 
@@ -5973,7 +5973,10 @@ iflib_admin_intr_deferred(if_ctx_t ctx)
 {
 #ifdef INVARIANTS
struct grouptask *gtask;
-
+#endif
+   if (iflib_in_detach(ctx))
+   return;
+#ifdef INVARIANTS
gtask = >ifc_admin_task;
MPASS(gtask != NULL && gtask->gt_taskqueue != NULL);
 #endif
@@ -5984,6 +5987,8 @@ iflib_admin_intr_deferred(if_ctx_t ctx)
 void
 iflib_iov_intr_deferred(if_ctx_t ctx)
 {
+   if (iflib_in_detach(ctx))
+   return;
 
GROUPTASK_ENQUEUE(>ifc_vflr_task);
 }
___
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: r339523 - in head/sys: conf dev/amdgpio modules modules/amdgpio

2018-10-22 Thread Nathan Whitehorn



On 10/21/18 1:12 PM, Oleksandr Tymoshenko wrote:
> Nathan Whitehorn (nwhiteh...@freebsd.org) wrote:
>>
>> On 10/20/18 9:52 PM, Oleksandr Tymoshenko wrote:
>>> Author: gonzo
>>> Date: Sun Oct 21 04:52:37 2018
>>> New Revision: 339523
>>> URL: https://svnweb.freebsd.org/changeset/base/339523
>>>
>>> Log:
>>>   Add amdgpio, driver for GPIO controller on AMD-based x86_64 platforms
>>>   
>>>   Submitted by: Rajesh Kumar 
>>>   Differential Revision:https://reviews.freebsd.org/D16865
>>>
>> [...]
>>> Modified: head/sys/modules/Makefile
>>> ==
>>> --- head/sys/modules/Makefile   Sun Oct 21 02:39:13 2018
>>> (r339522)
>>> +++ head/sys/modules/Makefile   Sun Oct 21 04:52:37 2018
>>> (r339523)
>>> @@ -34,6 +34,7 @@ SUBDIR=   \
>>> ale \
>>> alq \
>>> ${_amd_ecc_inject} \
>>> +   ${_amdgpio} \
>>> ${_amdsbwd} \
>>> ${_amdsmn} \
>>> ${_amdtemp} \
>>> @@ -717,6 +718,7 @@ _x86bios=   x86bios
>>>  .endif
>>>  
>>>  .if ${MACHINE_CPUARCH} == "amd64"
>>> +_amdgpio=  amdgpio
>>>  _ccp=  ccp
>>>  _efirt=efirt
>>>  _iavf= iavf
>>>
>> Does this not work on 64-bit AMD processors running i386 kernels?
> I see no reason why it wouldn't. Probably just haven't been tested.
>

It might be nice if we just added it to all architectures where it
conceivably applies. Essentially all of our code is more portable than
the platforms on which it is tested, so there doesn't seem to be a good
reason to limit such things.
-Nathan
___
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: r339554 - head/sys/net

2018-10-22 Thread Kristof Provost

On 22 Oct 2018, at 17:51, Kristof Provost wrote:

On 21 Oct 2018, at 11:24, Andrey V. Elsukov wrote:

Author: ae
Date: Sun Oct 21 18:24:20 2018
New Revision: 339554
URL: https://svnweb.freebsd.org/changeset/base/339554

Log:
  Rework if_ipsec(4) to use epoch(9) instead of rmlock.

  * use CK_LIST and FNV hash to keep chains of softc;
  * read access to softc is protected by epoch();
  * write access is protected by ipsec_ioctl_sx. Changing of softc 
fields

is allowed only when softc is unlinked from CK_LIST chains.
  * linking/unlinking of softc is allowed only when ipsec_ioctl_sx is
exclusive locked.
  * the plain LIST of all softc is replaced by hash table that uses 
ingress

address of tunnels as a key.
  * added support for appearing/disappearing of ingress address 
handling.
Now it is allowed configure non-local ingress IP address, and 
thus the

problem with if_ipsec(4) configuration that happens on boot, when
ingress address is not yet configured, is solved.

  MFC after:1 month
  Sponsored by: Yandex LLC
  Differential Revision:https://reviews.freebsd.org/D17190


This panics during the pf tests.

I think I understand what’s happening here.

With this patch I see a different panic:

diff --git a/sys/net/if_ipsec.c b/sys/net/if_ipsec.c
index 91b11a455b3..146cb59 100644
--- a/sys/net/if_ipsec.c
+++ b/sys/net/if_ipsec.c
@@ -134,6 +134,9 @@ ipsec_srchash(const struct sockaddr *sa)
 {
uint32_t hval;

+   KASSERT(V_ipsec4_srchtbl, ("NULL"));
+   KASSERT(V_ipsec6_srchtbl, ("NULL (v6)"));
+
switch (sa->sa_family) {
 #ifdef INET
case AF_INET:
@@ -265,17 +274,22 @@ static void
 vnet_ipsec_uninit(const void *unused __unused)
 {

if_clone_detach(V_ipsec_cloner);
free(V_ipsec_idhtbl, M_IPSEC);
 #ifdef INET
if (IS_DEFAULT_VNET(curvnet))
ip_encap_unregister_srcaddr(ipsec4_srctab);
free(V_ipsec4_srchtbl, M_IPSEC);
+   V_ipsec4_srchtbl = NULL;
+
 #endif
 #ifdef INET6
if (IS_DEFAULT_VNET(curvnet))
ip6_encap_unregister_srcaddr(ipsec6_srctab);
free(V_ipsec6_srchtbl, M_IPSEC);
+   V_ipsec4_srchtbl = NULL;
 #endif
 }
	 VNET_SYSUNINIT(vnet_ipsec_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, 
SI_ORDER_ANY,


That trips the KASSERT() in ipsec_srchash(). Basically, the problem is 
that the V_ipsec4_srchtbl table gets freed in vnet_ipsec_uninit(), and 
later we get a srcaddr_change_event(), which tries to iterate the list 
(in ipsec_srcaddr()). Obviously iterating a freed list doesn’t go well 
for us (hence the 0xdeadc0dedeadc0de softc).


That also explains why this happens during the pf tests, even though 
they don’t actually use IPSec.


I’m not quite sure how to best fix this though. I suppose we could set 
V_ipsec4_srchtbl to NULL (well, copy the pointer first, set it to NULL 
and then free it so we don’t add a race condition) and then check for 
NULL in  ipsec_srcaddr().
It feels like the srcaddr_change_event needs to be per-vnet, so we can 
unregister before we free V_ipsec4_srchtbl.


Best regards,
Kristof
___
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: r339633 - in stable/12: . sys/dev/drm2

2018-10-22 Thread Warner Losh
Author: imp
Date: Tue Oct 23 03:30:14 2018
New Revision: 339633
URL: https://svnweb.freebsd.org/changeset/base/339633

Log:
  MFC 339475: improve drm messaging in driver and UPDATING
  
  Approved by:  re@ (rgrimes)

Modified:
  stable/12/UPDATING
  stable/12/sys/dev/drm2/drm_os_freebsd.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/UPDATING
==
--- stable/12/UPDATING  Tue Oct 23 01:56:52 2018(r339632)
+++ stable/12/UPDATING  Tue Oct 23 03:30:14 2018(r339633)
@@ -20,6 +20,31 @@ from older version of current across the gcc/clang cut
The stable/12 branch has been created in subversion from head
revision r339432.
 
+20181015:
+   Ports for the DRM modules have been simplified. Now, amd64 users should
+   just install the drm-kmod port. All others should install
+   drm-legacy-kmod.
+
+   Graphics hardware that's newer than about 2010 usually works with
+   drm-kmod.  For hardware older than 2013, however, some users will need
+   to use drm-legacy-kmod if drm-kmod doesn't work for them. Hardware older
+   than 2008 usually only works in drm-legacy-kmod. The graphics team can
+   only commit to hardware made since 2013 due to the complexity of the
+   market and difficulty to test all the older cards effectively. If you
+   have hardware supported by drm-kmod, you are strongly encouraged to use
+   that as you will get better support.
+
+   Other than KPI chasing, drm-legacy-kmod will not be updated. As outlined
+   elsewhere, the drm and drm2 modules will be eliminated from the src base
+   soon (with a limited exception for arm). Please update to the package 
asap
+   and report any issues to x...@freebsd.org.
+
+   Generally, anybody using the drm*-kmod packages should add
+   WITHOUT_DRM_MODULE=t and WITHOUT_DRM2_MODULE=t to avoid nasty
+   cross-threading surprises, especially with automatic driver
+   loading from X11 startup. These will become the defaults in 13-current
+   shortly.
+
 20181009:
OpenSSL has been updated to version 1.1.1.  This update included
additional various API changes througout the base system.  It is

Modified: stable/12/sys/dev/drm2/drm_os_freebsd.h
==
--- stable/12/sys/dev/drm2/drm_os_freebsd.h Tue Oct 23 01:56:52 2018
(r339632)
+++ stable/12/sys/dev/drm2/drm_os_freebsd.h Tue Oct 23 03:30:14 2018
(r339633)
@@ -154,8 +154,8 @@ typedef voidirqreturn_t;
*(volatile u_int64_t *)(((vm_offset_t)(map)->handle) +  \
(vm_offset_t)(offset)) = htole64(val)
 
-#ifdef __LP64__
-#define DRM_PORT "graphics/drm-stable-kmod"
+#ifdef amd64
+#define DRM_PORT "graphics/drm-kmod"
 #else
 #define DRM_PORT "graphics/drm-legacy-kmod"
 #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"


svn commit: r339631 - stable/10/contrib/tzdata

2018-10-22 Thread Philip Paeps
Author: philip
Date: Tue Oct 23 01:42:43 2018
New Revision: 339631
URL: https://svnweb.freebsd.org/changeset/base/339631

Log:
  MFC r339503: Import tzdata 2018f

Modified:
  stable/10/contrib/tzdata/CONTRIBUTING
  stable/10/contrib/tzdata/Makefile
  stable/10/contrib/tzdata/NEWS
  stable/10/contrib/tzdata/README
  stable/10/contrib/tzdata/africa
  stable/10/contrib/tzdata/antarctica
  stable/10/contrib/tzdata/asia
  stable/10/contrib/tzdata/australasia
  stable/10/contrib/tzdata/backward
  stable/10/contrib/tzdata/backzone
  stable/10/contrib/tzdata/etcetera
  stable/10/contrib/tzdata/europe
  stable/10/contrib/tzdata/factory
  stable/10/contrib/tzdata/leap-seconds.list
  stable/10/contrib/tzdata/leapseconds
  stable/10/contrib/tzdata/leapseconds.awk
  stable/10/contrib/tzdata/northamerica
  stable/10/contrib/tzdata/pacificnew
  stable/10/contrib/tzdata/southamerica
  stable/10/contrib/tzdata/systemv
  stable/10/contrib/tzdata/theory.html
  stable/10/contrib/tzdata/version
  stable/10/contrib/tzdata/yearistype.sh
  stable/10/contrib/tzdata/zishrink.awk
  stable/10/contrib/tzdata/zone.tab
  stable/10/contrib/tzdata/zone1970.tab
  stable/10/contrib/tzdata/zoneinfo2tdf.pl
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/tzdata/CONTRIBUTING
==
--- stable/10/contrib/tzdata/CONTRIBUTING   Tue Oct 23 01:41:07 2018
(r339630)
+++ stable/10/contrib/tzdata/CONTRIBUTING   Tue Oct 23 01:42:43 2018
(r339631)
@@ -17,11 +17,14 @@ To email small changes, please run a POSIX shell comma
 'diff -u old/europe new/europe >myfix.patch', and attach
 myfix.patch to the email.
 
-For more-elaborate changes, please read the theory.html file and browse
-the mailing list archives  for
-examples of patches that tend to work well.  Additions to
-data should contain commentary citing reliable sources as
-justification.  Citations should use https: URLs if available.
+For more-elaborate or possibly-controversial changes,
+such as renaming, adding or removing zones, please read
+ or the file
+theory.html.  It is also good to browse the mailing list archives
+ for examples of patches that tend
+to work well.  Additions to data should contain commentary citing
+reliable sources as justification.  Citations should use https: URLs
+if available.
 
 Please submit changes against either the latest release in
  or the master branch of the development

Modified: stable/10/contrib/tzdata/Makefile
==
--- stable/10/contrib/tzdata/Makefile   Tue Oct 23 01:41:07 2018
(r339630)
+++ stable/10/contrib/tzdata/Makefile   Tue Oct 23 01:42:43 2018
(r339631)
@@ -1,3 +1,5 @@
+# Make and install tzdb code and data.
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -19,9 +21,9 @@ BUGEMAIL= t...@iana.org
 #  DATAFORM=   rearguard
 DATAFORM=  main
 
-# Change the line below for your time zone (after finding the zone you want in
-# the time zone files, or adding it to a time zone file).
-# Alternatively, if you discover you've got the wrong time zone, you can just
+# Change the line below for your timezone (after finding the one you want in
+# one of the $(TDATA) source files, or adding it to a source file).
+# Alternatively, if you discover you've got the wrong timezone, you can just
 #  zic -l rightzone
 # to correct things.
 # Use the command
@@ -31,14 +33,14 @@ DATAFORM=   main
 LOCALTIME= GMT
 
 # If you want something other than Eastern United States time as a template
-# for handling POSIX-style time zone environment variables,
-# change the line below (after finding the zone you want in the
-# time zone files, or adding it to a time zone file).
+# for handling POSIX-style timezone environment variables,
+# change the line below (after finding the timezone you want in the
+# one of the $(TDATA) source files, or adding it to a source file).
 # When a POSIX-style environment variable is handled, the rules in the
 # template file are used to determine "spring forward" and "fall back" days and
 # times; the environment variable itself specifies UT offsets of standard and
 # daylight saving time.
-# Alternatively, if you discover you've got the wrong time zone, you can just
+# Alternatively, if you discover you've got the wrong timezone, you can just
 #  zic -p rightzone
 # to correct things.
 # Use the command
@@ -75,7 +77,7 @@ DESTDIR =
 # TOPDIR should be empty or an absolute name unless you're just testing.
 TOPDIR =
 
-# The default local time zone is taken from the file TZDEFAULT.
+# The default local timezone is taken from the file TZDEFAULT.
 TZDEFAULT = $(TOPDIR)/etc/localtime
 
 # 

svn commit: r339630 - stable/11/contrib/tzdata

2018-10-22 Thread Philip Paeps
Author: philip
Date: Tue Oct 23 01:41:07 2018
New Revision: 339630
URL: https://svnweb.freebsd.org/changeset/base/339630

Log:
  MFC r339503: Import tzdata 2018f

Modified:
  stable/11/contrib/tzdata/CONTRIBUTING
  stable/11/contrib/tzdata/Makefile
  stable/11/contrib/tzdata/NEWS
  stable/11/contrib/tzdata/README
  stable/11/contrib/tzdata/africa
  stable/11/contrib/tzdata/antarctica
  stable/11/contrib/tzdata/asia
  stable/11/contrib/tzdata/australasia
  stable/11/contrib/tzdata/backward
  stable/11/contrib/tzdata/backzone
  stable/11/contrib/tzdata/etcetera
  stable/11/contrib/tzdata/europe
  stable/11/contrib/tzdata/factory
  stable/11/contrib/tzdata/leap-seconds.list
  stable/11/contrib/tzdata/leapseconds
  stable/11/contrib/tzdata/leapseconds.awk
  stable/11/contrib/tzdata/northamerica
  stable/11/contrib/tzdata/pacificnew
  stable/11/contrib/tzdata/southamerica
  stable/11/contrib/tzdata/systemv
  stable/11/contrib/tzdata/theory.html
  stable/11/contrib/tzdata/version
  stable/11/contrib/tzdata/yearistype.sh
  stable/11/contrib/tzdata/zishrink.awk
  stable/11/contrib/tzdata/zone.tab
  stable/11/contrib/tzdata/zone1970.tab
  stable/11/contrib/tzdata/zoneinfo2tdf.pl
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/tzdata/CONTRIBUTING
==
--- stable/11/contrib/tzdata/CONTRIBUTING   Tue Oct 23 01:39:26 2018
(r339629)
+++ stable/11/contrib/tzdata/CONTRIBUTING   Tue Oct 23 01:41:07 2018
(r339630)
@@ -17,11 +17,14 @@ To email small changes, please run a POSIX shell comma
 'diff -u old/europe new/europe >myfix.patch', and attach
 myfix.patch to the email.
 
-For more-elaborate changes, please read the theory.html file and browse
-the mailing list archives  for
-examples of patches that tend to work well.  Additions to
-data should contain commentary citing reliable sources as
-justification.  Citations should use https: URLs if available.
+For more-elaborate or possibly-controversial changes,
+such as renaming, adding or removing zones, please read
+ or the file
+theory.html.  It is also good to browse the mailing list archives
+ for examples of patches that tend
+to work well.  Additions to data should contain commentary citing
+reliable sources as justification.  Citations should use https: URLs
+if available.
 
 Please submit changes against either the latest release in
  or the master branch of the development

Modified: stable/11/contrib/tzdata/Makefile
==
--- stable/11/contrib/tzdata/Makefile   Tue Oct 23 01:39:26 2018
(r339629)
+++ stable/11/contrib/tzdata/Makefile   Tue Oct 23 01:41:07 2018
(r339630)
@@ -1,3 +1,5 @@
+# Make and install tzdb code and data.
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -19,9 +21,9 @@ BUGEMAIL= t...@iana.org
 #  DATAFORM=   rearguard
 DATAFORM=  main
 
-# Change the line below for your time zone (after finding the zone you want in
-# the time zone files, or adding it to a time zone file).
-# Alternatively, if you discover you've got the wrong time zone, you can just
+# Change the line below for your timezone (after finding the one you want in
+# one of the $(TDATA) source files, or adding it to a source file).
+# Alternatively, if you discover you've got the wrong timezone, you can just
 #  zic -l rightzone
 # to correct things.
 # Use the command
@@ -31,14 +33,14 @@ DATAFORM=   main
 LOCALTIME= GMT
 
 # If you want something other than Eastern United States time as a template
-# for handling POSIX-style time zone environment variables,
-# change the line below (after finding the zone you want in the
-# time zone files, or adding it to a time zone file).
+# for handling POSIX-style timezone environment variables,
+# change the line below (after finding the timezone you want in the
+# one of the $(TDATA) source files, or adding it to a source file).
 # When a POSIX-style environment variable is handled, the rules in the
 # template file are used to determine "spring forward" and "fall back" days and
 # times; the environment variable itself specifies UT offsets of standard and
 # daylight saving time.
-# Alternatively, if you discover you've got the wrong time zone, you can just
+# Alternatively, if you discover you've got the wrong timezone, you can just
 #  zic -p rightzone
 # to correct things.
 # Use the command
@@ -75,7 +77,7 @@ DESTDIR =
 # TOPDIR should be empty or an absolute name unless you're just testing.
 TOPDIR =
 
-# The default local time zone is taken from the file TZDEFAULT.
+# The default local timezone is taken from the file TZDEFAULT.
 TZDEFAULT = $(TOPDIR)/etc/localtime
 
 # 

svn commit: r339629 - stable/12/contrib/tzdata

2018-10-22 Thread Philip Paeps
Author: philip
Date: Tue Oct 23 01:39:26 2018
New Revision: 339629
URL: https://svnweb.freebsd.org/changeset/base/339629

Log:
  MFC r339503: Import tzdata 2018f
  
  Approved by:  re (kib)

Modified:
  stable/12/contrib/tzdata/CONTRIBUTING
  stable/12/contrib/tzdata/Makefile
  stable/12/contrib/tzdata/NEWS
  stable/12/contrib/tzdata/README
  stable/12/contrib/tzdata/africa
  stable/12/contrib/tzdata/antarctica
  stable/12/contrib/tzdata/asia
  stable/12/contrib/tzdata/australasia
  stable/12/contrib/tzdata/backward
  stable/12/contrib/tzdata/backzone
  stable/12/contrib/tzdata/etcetera
  stable/12/contrib/tzdata/europe
  stable/12/contrib/tzdata/factory
  stable/12/contrib/tzdata/leap-seconds.list
  stable/12/contrib/tzdata/leapseconds
  stable/12/contrib/tzdata/leapseconds.awk
  stable/12/contrib/tzdata/northamerica
  stable/12/contrib/tzdata/pacificnew
  stable/12/contrib/tzdata/southamerica
  stable/12/contrib/tzdata/systemv
  stable/12/contrib/tzdata/theory.html
  stable/12/contrib/tzdata/version
  stable/12/contrib/tzdata/yearistype.sh
  stable/12/contrib/tzdata/zishrink.awk
  stable/12/contrib/tzdata/zone.tab
  stable/12/contrib/tzdata/zone1970.tab
  stable/12/contrib/tzdata/zoneinfo2tdf.pl
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/tzdata/CONTRIBUTING
==
--- stable/12/contrib/tzdata/CONTRIBUTING   Mon Oct 22 23:57:59 2018
(r339628)
+++ stable/12/contrib/tzdata/CONTRIBUTING   Tue Oct 23 01:39:26 2018
(r339629)
@@ -17,11 +17,14 @@ To email small changes, please run a POSIX shell comma
 'diff -u old/europe new/europe >myfix.patch', and attach
 myfix.patch to the email.
 
-For more-elaborate changes, please read the theory.html file and browse
-the mailing list archives  for
-examples of patches that tend to work well.  Additions to
-data should contain commentary citing reliable sources as
-justification.  Citations should use https: URLs if available.
+For more-elaborate or possibly-controversial changes,
+such as renaming, adding or removing zones, please read
+ or the file
+theory.html.  It is also good to browse the mailing list archives
+ for examples of patches that tend
+to work well.  Additions to data should contain commentary citing
+reliable sources as justification.  Citations should use https: URLs
+if available.
 
 Please submit changes against either the latest release in
  or the master branch of the development

Modified: stable/12/contrib/tzdata/Makefile
==
--- stable/12/contrib/tzdata/Makefile   Mon Oct 22 23:57:59 2018
(r339628)
+++ stable/12/contrib/tzdata/Makefile   Tue Oct 23 01:39:26 2018
(r339629)
@@ -1,3 +1,5 @@
+# Make and install tzdb code and data.
+
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -19,9 +21,9 @@ BUGEMAIL= t...@iana.org
 #  DATAFORM=   rearguard
 DATAFORM=  main
 
-# Change the line below for your time zone (after finding the zone you want in
-# the time zone files, or adding it to a time zone file).
-# Alternatively, if you discover you've got the wrong time zone, you can just
+# Change the line below for your timezone (after finding the one you want in
+# one of the $(TDATA) source files, or adding it to a source file).
+# Alternatively, if you discover you've got the wrong timezone, you can just
 #  zic -l rightzone
 # to correct things.
 # Use the command
@@ -31,14 +33,14 @@ DATAFORM=   main
 LOCALTIME= GMT
 
 # If you want something other than Eastern United States time as a template
-# for handling POSIX-style time zone environment variables,
-# change the line below (after finding the zone you want in the
-# time zone files, or adding it to a time zone file).
+# for handling POSIX-style timezone environment variables,
+# change the line below (after finding the timezone you want in the
+# one of the $(TDATA) source files, or adding it to a source file).
 # When a POSIX-style environment variable is handled, the rules in the
 # template file are used to determine "spring forward" and "fall back" days and
 # times; the environment variable itself specifies UT offsets of standard and
 # daylight saving time.
-# Alternatively, if you discover you've got the wrong time zone, you can just
+# Alternatively, if you discover you've got the wrong timezone, you can just
 #  zic -p rightzone
 # to correct things.
 # Use the command
@@ -75,7 +77,7 @@ DESTDIR =
 # TOPDIR should be empty or an absolute name unless you're just testing.
 TOPDIR =
 
-# The default local time zone is taken from the file TZDEFAULT.
+# The default local timezone is taken from the file TZDEFAULT.
 TZDEFAULT = 

svn commit: r339632 - head/sys/dev/dpaa

2018-10-22 Thread Justin Hibbits
Author: jhibbits
Date: Tue Oct 23 01:56:52 2018
New Revision: 339632
URL: https://svnweb.freebsd.org/changeset/base/339632

Log:
  dpaa: Mark BMan and QMan as earlier driver modules
  
  The BMan softc must exist when dtsec devices are created, else a NULL
  pointer is dereferenced.  QMan likely as well.  Until now, we have relied on
  order within the fdt parsing to attach correctly, but this obviously is not
  foolproof.  Mark these as BUS_PASS_SUPPORTDEV so they're probed and attached
  explicitly before dtsec devices.

Modified:
  head/sys/dev/dpaa/bman_fdt.c
  head/sys/dev/dpaa/qman_fdt.c

Modified: head/sys/dev/dpaa/bman_fdt.c
==
--- head/sys/dev/dpaa/bman_fdt.cTue Oct 23 01:42:43 2018
(r339631)
+++ head/sys/dev/dpaa/bman_fdt.cTue Oct 23 01:56:52 2018
(r339632)
@@ -68,7 +68,8 @@ static driver_t bman_driver = {
 };
 
 static devclass_t bman_devclass;
-DRIVER_MODULE(bman, simplebus, bman_driver, bman_devclass, 0, 0);
+EARLY_DRIVER_MODULE(bman, simplebus, bman_driver, bman_devclass, 0, 0,
+BUS_PASS_SUPPORTDEV);
 
 static int
 bman_fdt_probe(device_t dev)

Modified: head/sys/dev/dpaa/qman_fdt.c
==
--- head/sys/dev/dpaa/qman_fdt.cTue Oct 23 01:42:43 2018
(r339631)
+++ head/sys/dev/dpaa/qman_fdt.cTue Oct 23 01:56:52 2018
(r339632)
@@ -68,7 +68,8 @@ static driver_t qman_driver = {
 };
 
 static devclass_t qman_devclass;
-DRIVER_MODULE(qman, simplebus, qman_driver, qman_devclass, 0, 0);
+EARLY_DRIVER_MODULE(qman, simplebus, qman_driver, qman_devclass, 0, 0,
+BUS_PASS_SUPPORTDEV);
 
 static int
 qman_fdt_probe(device_t dev)
___
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: r339554 - head/sys/net

2018-10-22 Thread Kristof Provost

On 21 Oct 2018, at 11:24, Andrey V. Elsukov wrote:

Author: ae
Date: Sun Oct 21 18:24:20 2018
New Revision: 339554
URL: https://svnweb.freebsd.org/changeset/base/339554

Log:
  Rework if_ipsec(4) to use epoch(9) instead of rmlock.

  * use CK_LIST and FNV hash to keep chains of softc;
  * read access to softc is protected by epoch();
  * write access is protected by ipsec_ioctl_sx. Changing of softc 
fields

is allowed only when softc is unlinked from CK_LIST chains.
  * linking/unlinking of softc is allowed only when ipsec_ioctl_sx is
exclusive locked.
  * the plain LIST of all softc is replaced by hash table that uses 
ingress

address of tunnels as a key.
  * added support for appearing/disappearing of ingress address 
handling.
Now it is allowed configure non-local ingress IP address, and thus 
the

problem with if_ipsec(4) configuration that happens on boot, when
ingress address is not yet configured, is solved.

  MFC after:1 month
  Sponsored by: Yandex LLC
  Differential Revision:https://reviews.freebsd.org/D17190


This panics during the pf tests.
To reproduce:

pkg install scapy
kldload pf
cd /usr/tests/sys/netpfil
kyua test

Fatal trap 9: general protection fault while in kernel mode
cpuid = 3; apic id = 03
instruction pointer = 0x20:0x80ca7260
stack pointer   = 0x28:0xfe00954c4650
frame pointer   = 0x28:0xfe00954c4660
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 = 3204 (jail)
[ thread pid 3204 tid 101409 ]
Stopped at  ipsec_srcaddr+0x40: cmpl$0,ll+0xb(%rbx)
db> bt
Tracing pid 3204 tid 101409 td 0xf80084239580
ipsec_srcaddr() at ipsec_srcaddr+0x40/frame 0xfe00954c4660
	srcaddr_change_event() at srcaddr_change_event+0x14d/frame 
0xfe00954c46c0

in_difaddr_ioctl() at in_difaddr_ioctl+0x41f/frame 0xfe00954c4720
in_ifscrub_all() at in_ifscrub_all+0x13d/frame 0xfe00954c47a0
ip_destroy() at ip_destroy+0xbd/frame 0xfe00954c47c0
vnet_destroy() at vnet_destroy+0x124/frame 0xfe00954c47f0
prison_deref() at prison_deref+0x29d/frame 0xfe00954c4830
sys_jail_remove() at sys_jail_remove+0x28a/frame 0xfe00954c4880
amd64_syscall() at amd64_syscall+0x278/frame 0xfe00954c49b0
	fast_syscall_common() at fast_syscall_common+0x101/frame 
0xfe00954c49b0
	--- syscall (508, FreeBSD ELF64, sys_jail_remove), rip = 0x8003131ba, 
rsp = 0x7fffe828, rbp = 0x7fffe8b0 ---



At that point %rbx is 0xdeadc0dedeadc0de, so presumably we’re trying 
to dereference something that’s been freed already.


kgdb agrees. The softc has been freed:

#0  __curthread () at ./machine/pcpu.h:230
#1  doadump (textdump=0) at /usr/src/sys/kern/kern_shutdown.c:366
	#2  0x804645db in db_dump (dummy=, 
dummy2=, dummy3=, dummy4=) at 
/usr/src/sys/ddb/db_command.c:574
	#3  0x804643a9 in db_command (last_cmdp=, 
cmd_table=, dopager=) at 
/usr/src/sys/ddb/db_command.c:481
	#4  0x80464124 in db_command_loop () at 
/usr/src/sys/ddb/db_command.c:534
	#5  0x8046733f in db_trap (type=, 
code=) at /usr/src/sys/ddb/db_main.c:252
	#6  0x80be5987 in kdb_trap (type=9, code=0, 
tf=0xfe00954c4590) at /usr/src/sys/kern/subr_kdb.c:693
	#7  0x81072f51 in trap_fatal (frame=0xfe00954c4590, eva=0) 
at /usr/src/sys/amd64/amd64/trap.c:921
	#8  0x8107244d in trap (frame=0xfe00954c4590) at 
/usr/src/sys/amd64/amd64/trap.c:217

#9  
	#10 ipsec_srcaddr (arg=, sa=0xf80023591298, 
event=) at /usr/src/sys/net/if_ipsec.c:784
	#11 0x80d2de7d in srcaddr_change_event (arg=, 
ifp=0xf80057864800, ifa=0xf80023591200, event=1) at 
/usr/src/sys/netinet/ip_encap.c:181
	#12 0x80d1ec4f in in_difaddr_ioctl (cmd=2149607705, 
data=, ifp=0xf80057864800, td=) at 
/usr/src/sys/netinet/in.c:651
	#13 0x80d1f4cd in in_control (cmd=2149607705, ifp=out>, td=0x81b98600 , so=out>, data=)

at /usr/src/sys/netinet/in.c:250
#14 in_ifscrub_all () at /usr/src/sys/netinet/in.c:935
	#15 0x80d32dfd in ip_destroy (unused=) at 
/usr/src/sys/netinet/ip_input.c:398
	#16 0x80ccd734 in vnet_sysuninit () at 
/usr/src/sys/net/vnet.c:597
	#17 vnet_destroy (vnet=0xf80005d9c0c0) at 
/usr/src/sys/net/vnet.c:284
	#18 0x80b64c0d in prison_deref (pr=0x81b0cc30 
, flags=23) at /usr/src/sys/kern/kern_jail.c:2634
	#19 0x80b6620a in sys_jail_remove (td=, 
uap=) at /usr/src/sys/kern/kern_jail.c:2257
	#20 0x81073b28 in syscallenter (td=0xf80084239580) at 
/usr/src/sys/amd64/amd64/../../kern/subr_syscall.c:135
	#21 amd64_syscall (td=0xf80084239580, traced=0) 

svn commit: r339628 - head/sys/dev/cxgbe

2018-10-22 Thread Navdeep Parhar
Author: np
Date: Mon Oct 22 23:57:59 2018
New Revision: 339628
URL: https://svnweb.freebsd.org/changeset/base/339628

Log:
  cxgbe(4): improve the accuracy of various TSO limits reported to the kernel.
  
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hMon Oct 22 23:33:48 2018
(r339627)
+++ head/sys/dev/cxgbe/adapter.hMon Oct 22 23:57:59 2018
(r339628)
@@ -113,6 +113,7 @@ enum {
SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR size in desc */
TX_SGL_SEGS = 39,
TX_SGL_SEGS_TSO = 38,
+   TX_SGL_SEGS_EO_TSO = 30,/* XXX: lower for IPv6. */
TX_WR_FLITS = SGE_MAX_WR_LEN / 8
 };
 

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cMon Oct 22 23:33:48 2018
(r339627)
+++ head/sys/dev/cxgbe/t4_main.cMon Oct 22 23:57:59 2018
(r339628)
@@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$");
 #ifdef RSS
 #include 
 #endif
+#include 
+#include 
 #if defined(__i386__) || defined(__amd64__)
 #include 
 #include 
@@ -1535,9 +1537,13 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi)
ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO |
CSUM_UDP_IPV6 | CSUM_TCP_IPV6;
 
-   ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN);
-   ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS;
-   ifp->if_hw_tsomaxsegsize = 65536;
+   ifp->if_hw_tsomax = IP_MAXPACKET;
+   ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_TSO;
+#ifdef RATELIMIT
+   if (is_ethoffload(vi->pi->adapter) && vi->nofldtxq != 0)
+   ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_EO_TSO;
+#endif
+   ifp->if_hw_tsomaxsegsize = 0;
 
ether_ifattach(ifp, vi->hw_addr);
 #ifdef DEV_NETMAP
___
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: r339626 - head/sys/dev/cxgbe

2018-10-22 Thread Rodney W. Grimes
> Author: np
> Date: Mon Oct 22 23:06:23 2018
> New Revision: 339626
> URL: https://svnweb.freebsd.org/changeset/base/339626
> 
> Log:
>   cxgbe(4): Use automatic cidx updates with ofld and ctrl queues.
>   
>   The bits that explicitly request cidx updates do not work reliably with
>   all possible WRs that can be sent over the queue.  The F_FW_WR_EQUIQ
>   requests that still remain may also have to be replaced with explicit
>   credit flush WRs in the future.
>   
>   MFC after:  2 days

Please note in your RFA to re@ your reasons for requesting early
merge to a frozen stable branch.  I see good reason for this to
be approved as it would be good to get this in the next snapshot,
but it usually would be rejected if there is not a reason given.

(There is a normal 3 day minimum on MFC after to a frozen branch)


Thanks,
RodSponsored by:   Chelsio Communications
> 
> Modified:
>   head/sys/dev/cxgbe/t4_sge.c
> 
> Modified: head/sys/dev/cxgbe/t4_sge.c
> ==
> --- head/sys/dev/cxgbe/t4_sge.c   Mon Oct 22 22:24:32 2018
> (r339625)
> +++ head/sys/dev/cxgbe/t4_sge.c   Mon Oct 22 23:06:23 2018
> (r339626)
> @@ -2089,12 +2089,13 @@ drain_wrq_wr_list(struct adapter *sc, struct sge_wrq *
>  
>   if (available < eq->sidx / 4 &&
>   atomic_cmpset_int(>equiq, 0, 1)) {
> + /*
> +  * XXX: This is not 100% reliable with some
> +  * types of WRs.  But this is a very unusual
> +  * situation for an ofld/ctrl queue anyway.
> +  */
>   dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ |
>   F_FW_WR_EQUEQ);
> - eq->equeqidx = eq->pidx;
> - } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 32) {
> - dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ);
> - eq->equeqidx = eq->pidx;
>   }
>  
>   dbdiff += n;
> @@ -2644,12 +2645,13 @@ commit_wrq_wr(struct sge_wrq *wrq, void *w, struct wrq
>   available = IDXDIFF(eq->cidx, eq->pidx, eq->sidx) - 1;
>   if (available < eq->sidx / 4 &&
>   atomic_cmpset_int(>equiq, 0, 1)) {
> + /*
> +  * XXX: This is not 100% reliable with some
> +  * types of WRs.  But this is a very unusual
> +  * situation for an ofld/ctrl queue anyway.
> +  */
>   dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ |
>   F_FW_WR_EQUEQ);
> - eq->equeqidx = pidx;
> - } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 
> 32) {
> - dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ);
> - eq->equeqidx = pidx;
>   }
>  
>   ring_eq_db(wrq->adapter, eq, ndesc);
> @@ -3584,6 +3586,23 @@ free_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_
>  }
>  #endif
>  
> +/*
> + * Returns a reasonable automatic cidx flush threshold for a given queue 
> size.
> + */
> +static u_int
> +qsize_to_fthresh(int qsize)
> +{
> + u_int fthresh;
> +
> + while (!powerof2(qsize))
> + qsize++;
> + fthresh = ilog2(qsize);
> + if (fthresh > X_CIDXFLUSHTHRESH_128)
> + fthresh = X_CIDXFLUSHTHRESH_128;
> +
> + return (fthresh);
> +}
> +
>  static int
>  ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq)
>  {
> @@ -3607,7 +3626,7 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq)
>   c.dcaen_to_eqsize =
>   htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) |
>   V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) |
> - V_FW_EQ_CTRL_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) |
> + V_FW_EQ_CTRL_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) |
>   V_FW_EQ_CTRL_CMD_EQSIZE(qsize));
>   c.eqaddr = htobe64(eq->ba);
>  
> @@ -3689,12 +3708,13 @@ ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, 
>   c.alloc_to_len16 = htonl(F_FW_EQ_OFLD_CMD_ALLOC |
>   F_FW_EQ_OFLD_CMD_EQSTART | FW_LEN16(c));
>   c.fetchszm_to_iqid =
> - htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) |
> + htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) |
>   V_FW_EQ_OFLD_CMD_PCIECHN(eq->tx_chan) |
>   F_FW_EQ_OFLD_CMD_FETCHRO | V_FW_EQ_OFLD_CMD_IQID(eq->iqid));
>   c.dcaen_to_eqsize =
>   htobe32(V_FW_EQ_OFLD_CMD_FBMIN(X_FETCHBURSTMIN_64B) |
>   V_FW_EQ_OFLD_CMD_FBMAX(X_FETCHBURSTMAX_512B) |
> + V_FW_EQ_OFLD_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) |
>   

svn commit: r339627 - head/sbin/pfctl/tests/files

2018-10-22 Thread Kristof Provost
Author: kp
Date: Mon Oct 22 23:33:48 2018
New Revision: 339627
URL: https://svnweb.freebsd.org/changeset/base/339627

Log:
  pf tests: Fix incorrect test for PR 231323
  
  Fix r339466.  The test result file did not list the rdr rule.
  Additionally, the route-to rule needs a redirection address.
  
  X-MFC-with:   339466

Modified:
  head/sbin/pfctl/tests/files/pf1005.in
  head/sbin/pfctl/tests/files/pf1005.ok

Modified: head/sbin/pfctl/tests/files/pf1005.in
==
--- head/sbin/pfctl/tests/files/pf1005.in   Mon Oct 22 23:06:23 2018
(r339626)
+++ head/sbin/pfctl/tests/files/pf1005.in   Mon Oct 22 23:33:48 2018
(r339627)
@@ -1,3 +1,3 @@
 rdr on em0 proto tcp from any to any -> 1.1.1.1 port 2121
-pass out log quick on lo0 route-to lo0 from any to any
-pass in log quick on lo0 route-to (lo0 localhost) from any to any
+pass out log quick on lo0 route-to (lo0 localhost) inet from any to any
+pass in log quick on lo0 route-to (lo0 localhost) inet6 from any to any

Modified: head/sbin/pfctl/tests/files/pf1005.ok
==
--- head/sbin/pfctl/tests/files/pf1005.ok   Mon Oct 22 23:06:23 2018
(r339626)
+++ head/sbin/pfctl/tests/files/pf1005.ok   Mon Oct 22 23:33:48 2018
(r339627)
@@ -1,2 +1,3 @@
-pass out log quick on lo0 route-to (lo0 ?) all flags S/SA keep state
+rdr on em0 inet proto tcp all -> 1.1.1.1 port 2121
+pass out log quick on lo0 route-to (lo0 127.0.0.1) inet all flags S/SA keep 
state
 pass in log quick on lo0 route-to (lo0 ::1) inet6 all flags S/SA keep 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: r339626 - head/sys/dev/cxgbe

2018-10-22 Thread Navdeep Parhar
Author: np
Date: Mon Oct 22 23:06:23 2018
New Revision: 339626
URL: https://svnweb.freebsd.org/changeset/base/339626

Log:
  cxgbe(4): Use automatic cidx updates with ofld and ctrl queues.
  
  The bits that explicitly request cidx updates do not work reliably with
  all possible WRs that can be sent over the queue.  The F_FW_WR_EQUIQ
  requests that still remain may also have to be replaced with explicit
  credit flush WRs in the future.
  
  MFC after:2 days
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Mon Oct 22 22:24:32 2018(r339625)
+++ head/sys/dev/cxgbe/t4_sge.c Mon Oct 22 23:06:23 2018(r339626)
@@ -2089,12 +2089,13 @@ drain_wrq_wr_list(struct adapter *sc, struct sge_wrq *
 
if (available < eq->sidx / 4 &&
atomic_cmpset_int(>equiq, 0, 1)) {
+   /*
+* XXX: This is not 100% reliable with some
+* types of WRs.  But this is a very unusual
+* situation for an ofld/ctrl queue anyway.
+*/
dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ |
F_FW_WR_EQUEQ);
-   eq->equeqidx = eq->pidx;
-   } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 32) {
-   dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ);
-   eq->equeqidx = eq->pidx;
}
 
dbdiff += n;
@@ -2644,12 +2645,13 @@ commit_wrq_wr(struct sge_wrq *wrq, void *w, struct wrq
available = IDXDIFF(eq->cidx, eq->pidx, eq->sidx) - 1;
if (available < eq->sidx / 4 &&
atomic_cmpset_int(>equiq, 0, 1)) {
+   /*
+* XXX: This is not 100% reliable with some
+* types of WRs.  But this is a very unusual
+* situation for an ofld/ctrl queue anyway.
+*/
dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ |
F_FW_WR_EQUEQ);
-   eq->equeqidx = pidx;
-   } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 
32) {
-   dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ);
-   eq->equeqidx = pidx;
}
 
ring_eq_db(wrq->adapter, eq, ndesc);
@@ -3584,6 +3586,23 @@ free_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_
 }
 #endif
 
+/*
+ * Returns a reasonable automatic cidx flush threshold for a given queue size.
+ */
+static u_int
+qsize_to_fthresh(int qsize)
+{
+   u_int fthresh;
+
+   while (!powerof2(qsize))
+   qsize++;
+   fthresh = ilog2(qsize);
+   if (fthresh > X_CIDXFLUSHTHRESH_128)
+   fthresh = X_CIDXFLUSHTHRESH_128;
+
+   return (fthresh);
+}
+
 static int
 ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq)
 {
@@ -3607,7 +3626,7 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq)
c.dcaen_to_eqsize =
htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) |
V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) |
-   V_FW_EQ_CTRL_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) |
+   V_FW_EQ_CTRL_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) |
V_FW_EQ_CTRL_CMD_EQSIZE(qsize));
c.eqaddr = htobe64(eq->ba);
 
@@ -3689,12 +3708,13 @@ ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, 
c.alloc_to_len16 = htonl(F_FW_EQ_OFLD_CMD_ALLOC |
F_FW_EQ_OFLD_CMD_EQSTART | FW_LEN16(c));
c.fetchszm_to_iqid =
-   htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) |
+   htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) |
V_FW_EQ_OFLD_CMD_PCIECHN(eq->tx_chan) |
F_FW_EQ_OFLD_CMD_FETCHRO | V_FW_EQ_OFLD_CMD_IQID(eq->iqid));
c.dcaen_to_eqsize =
htobe32(V_FW_EQ_OFLD_CMD_FBMIN(X_FETCHBURSTMIN_64B) |
V_FW_EQ_OFLD_CMD_FBMAX(X_FETCHBURSTMAX_512B) |
+   V_FW_EQ_OFLD_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) |
V_FW_EQ_OFLD_CMD_EQSIZE(qsize));
c.eqaddr = htobe64(eq->ba);
 
@@ -3732,8 +3752,9 @@ alloc_eq(struct adapter *sc, struct vi_info *vi, struc
if (rc)
return (rc);
 
-   eq->pidx = eq->cidx = 0;
-   eq->equeqidx = eq->dbidx = 0;
+   eq->pidx = eq->cidx = eq->dbidx = 0;
+   /* Note that equeqidx is not used with sge_wrq (OFLD/CTRL) queues. */
+   eq->equeqidx = 0;
eq->doorbells = sc->doorbells;
 

Re: svn commit: r339617 - head/sys/contrib/zstd

2018-10-22 Thread John Baldwin
On 10/22/18 1:22 PM, Conrad Meyer wrote:
> Author: cem
> Date: Mon Oct 22 20:22:33 2018
> New Revision: 339617
> URL: https://svnweb.freebsd.org/changeset/base/339617
> 
> Log:
>   Retroactively vendor 1.3.3, 1.3.4, and 1.3.7 imports
>   
>   "svn merge --record-only svn+ssh://repo.freebsd.org/base/vendor/zstd/dist"
>   
>   Reported by:jhb, markj
>   Sponsored by:   Dell EMC Isilon

Thanks!

-- 
John Baldwin
___
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: r339625 - in head/sys: arm/include arm64/include mips/include powerpc/include riscv/include sparc64/include sys x86/include

2018-10-22 Thread Brooks Davis
Author: brooks
Date: Mon Oct 22 22:24:32 2018
New Revision: 339625
URL: https://svnweb.freebsd.org/changeset/base/339625

Log:
  Consolidate identical ELF auxargs type defintions.
  
  All platforms except powerpc use the same values and powerpc shares a
  majority of them.
  
  Go ahead and declare AT_NOTELF, AT_UID, and AT_EUID in favor of the
  unused AT_DCACHEBSIZE, AT_ICACHEBSIZE, and AT_UCACHEBSIZE for powerpc.
  
  Reviewed by:  jhb, imp
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D17397

Modified:
  head/sys/arm/include/elf.h
  head/sys/arm64/include/elf.h
  head/sys/mips/include/elf.h
  head/sys/powerpc/include/elf.h
  head/sys/riscv/include/elf.h
  head/sys/sparc64/include/elf.h
  head/sys/sys/elf_common.h
  head/sys/x86/include/elf.h

Modified: head/sys/arm/include/elf.h
==
--- head/sys/arm/include/elf.h  Mon Oct 22 22:13:00 2018(r339624)
+++ head/sys/arm/include/elf.h  Mon Oct 22 22:24:32 2018(r339625)
@@ -61,39 +61,7 @@ __ElfType(Auxinfo);
  * Relocation types.
  */
 
-/* Values for a_type. */
-#defineAT_NULL 0   /* Terminates the vector. */
-#defineAT_IGNORE   1   /* Ignored entry. */
-#defineAT_EXECFD   2   /* File descriptor of program to load. 
*/
-#defineAT_PHDR 3   /* Program header of program already 
loaded. */
-#defineAT_PHENT4   /* Size of each program header entry. */
-#defineAT_PHNUM5   /* Number of program header entries. */
-#defineAT_PAGESZ   6   /* Page size in bytes. */
-#defineAT_BASE 7   /* Interpreter's base address. */
-#defineAT_FLAGS8   /* Flags (unused). */
-#defineAT_ENTRY9   /* Where interpreter should transfer 
control. */
-#defineAT_NOTELF   10  /* Program is not ELF ?? */
-#defineAT_UID  11  /* Real uid. */
-#defineAT_EUID 12  /* Effective uid. */
-#defineAT_GID  13  /* Real gid. */
-#defineAT_EGID 14  /* Effective gid. */
-#defineAT_EXECPATH 15  /* Path to the executable. */
-#defineAT_CANARY   16  /* Canary for SSP */
-#defineAT_CANARYLEN17  /* Length of the canary. */
-#defineAT_OSRELDATE18  /* OSRELDATE. */
-#defineAT_NCPUS19  /* Number of CPUs. */
-#defineAT_PAGESIZES20  /* Pagesizes. */
-#defineAT_PAGESIZESLEN 21  /* Number of pagesizes. */
-#defineAT_TIMEKEEP 22  /* Pointer to timehands. */
-#defineAT_STACKPROT23  /* Initial stack protection. */
-#defineAT_EHDRFLAGS24  /* e_flags field from elf hdr */
-#defineAT_HWCAP25  /* CPU feature flags. */
-#defineAT_HWCAP2   26  /* CPU feature flags 2. */
-
-#defineAT_COUNT27  /* Count of defined aux entry types. */
-
 #defineR_ARM_COUNT 33  /* Count of defined relocation types. */
-
 
 /* Define "machine" characteristics */
 #defineELF_TARG_CLASS  ELFCLASS32

Modified: head/sys/arm64/include/elf.h
==
--- head/sys/arm64/include/elf.hMon Oct 22 22:13:00 2018
(r339624)
+++ head/sys/arm64/include/elf.hMon Oct 22 22:24:32 2018
(r339625)
@@ -68,37 +68,6 @@ __ElfType(Auxinfo);
 
 #defineELF_MACHINE_OK(x) ((x) == (ELF_ARCH))
 
-/* Values for a_type. */
-#defineAT_NULL 0   /* Terminates the vector. */
-#defineAT_IGNORE   1   /* Ignored entry. */
-#defineAT_EXECFD   2   /* File descriptor of program to load. 
*/
-#defineAT_PHDR 3   /* Program header of program already 
loaded. */
-#defineAT_PHENT4   /* Size of each program header entry. */
-#defineAT_PHNUM5   /* Number of program header entries. */
-#defineAT_PAGESZ   6   /* Page size in bytes. */
-#defineAT_BASE 7   /* Interpreter's base address. */
-#defineAT_FLAGS8   /* Flags (unused). */
-#defineAT_ENTRY9   /* Where interpreter should transfer 
control. */
-#defineAT_NOTELF   10  /* Program is not ELF ?? */
-#defineAT_UID  11  /* Real uid. */
-#defineAT_EUID 12  /* Effective uid. */
-#defineAT_GID  13  /* Real gid. */
-#defineAT_EGID 14  /* Effective gid. */
-#defineAT_EXECPATH 15  /* Path to the executable. */
-#defineAT_CANARY   16  /* Canary for SSP */
-#defineAT_CANARYLEN17  /* Length of the canary. */
-#defineAT_OSRELDATE18  /* OSRELDATE. */
-#define

svn commit: r339624 - head/sys/kern

2018-10-22 Thread Brooks Davis
Author: brooks
Date: Mon Oct 22 22:13:00 2018
New Revision: 339624
URL: https://svnweb.freebsd.org/changeset/base/339624

Log:
  Remove the need for backslashes in syscalls.master.
  
  Join non-special lines together until we hit a line containing a '}'
  character. This allows the function declaration body to be split
  across multiple lines without backslash continuation characters.
  
  Continue to join lines ending with backslashes to allow gradual
  migration and to support out-of-tree syscall vectors
  
  Reviewed by:  emaste, kib
  Obtained from:CheriBSD
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D17488

Modified:
  head/sys/kern/makesyscalls.sh

Modified: head/sys/kern/makesyscalls.sh
==
--- head/sys/kern/makesyscalls.sh   Mon Oct 22 21:51:59 2018
(r339623)
+++ head/sys/kern/makesyscalls.sh   Mon Oct 22 22:13:00 2018
(r339624)
@@ -68,13 +68,33 @@ if [ -n "$2" ]; then
 fi
 
 sed -e '
-:join
+   # FreeBSD ID, includes, comments, and blank lines
+   /.*\$FreeBSD/b done_joining
+   /^[#;]/b done_joining
+   /^$/b done_joining
+
+   # Join lines ending in backslash
+:joining
/\\$/{a\
 
N
s/\\\n//
-   b join
+   b joining
}
+
+   # OBSOL, etc lines without function signatures
+   /^[0-9][^{]*$/b done_joining
+
+   # Join incomplete signatures.  The { must appear on the first line
+   # and the } must appear on the last line (modulo lines joined by
+   # backslashes).
+   /^[^}]*$/{a\
+
+   N
+   s/\n//
+   b joining
+   }
+:done_joining
 2,${
/^#/!s/\([{}()*,]\)/ \1 /g
 }
___
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: r339623 - head/sys/sys

2018-10-22 Thread Brooks Davis
Author: brooks
Date: Mon Oct 22 21:51:59 2018
New Revision: 339623
URL: https://svnweb.freebsd.org/changeset/base/339623

Log:
  Regen after r339622.
  
  Note: changes to freebsd32 syscalls.master impacted no generated files.

Modified:
  head/sys/sys/sysproto.h

Modified: head/sys/sys/sysproto.h
==
--- head/sys/sys/sysproto.h Mon Oct 22 21:50:43 2018(r339622)
+++ head/sys/sys/sysproto.h Mon Oct 22 21:51:59 2018(r339623)
@@ -135,23 +135,23 @@ struct recvfrom_args {
char buf_l_[PADL_(caddr_t)]; caddr_t buf; char buf_r_[PADR_(caddr_t)];
char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
-   char from_l_[PADL_(struct sockaddr *__restrict)]; struct sockaddr 
*__restrict from; char from_r_[PADR_(struct sockaddr *__restrict)];
-   char fromlenaddr_l_[PADL_(__socklen_t *__restrict)]; __socklen_t 
*__restrict fromlenaddr; char fromlenaddr_r_[PADR_(__socklen_t *__restrict)];
+   char from_l_[PADL_(struct sockaddr *)]; struct sockaddr * from; char 
from_r_[PADR_(struct sockaddr *)];
+   char fromlenaddr_l_[PADL_(__socklen_t *)]; __socklen_t * fromlenaddr; 
char fromlenaddr_r_[PADR_(__socklen_t *)];
 };
 struct accept_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
-   char name_l_[PADL_(struct sockaddr *__restrict)]; struct sockaddr 
*__restrict name; char name_r_[PADR_(struct sockaddr *__restrict)];
-   char anamelen_l_[PADL_(__socklen_t *__restrict)]; __socklen_t 
*__restrict anamelen; char anamelen_r_[PADR_(__socklen_t *__restrict)];
+   char name_l_[PADL_(struct sockaddr *)]; struct sockaddr * name; char 
name_r_[PADR_(struct sockaddr *)];
+   char anamelen_l_[PADL_(__socklen_t *)]; __socklen_t * anamelen; char 
anamelen_r_[PADR_(__socklen_t *)];
 };
 struct getpeername_args {
char fdes_l_[PADL_(int)]; int fdes; char fdes_r_[PADR_(int)];
-   char asa_l_[PADL_(struct sockaddr *__restrict)]; struct sockaddr 
*__restrict asa; char asa_r_[PADR_(struct sockaddr *__restrict)];
-   char alen_l_[PADL_(__socklen_t *__restrict)]; __socklen_t *__restrict 
alen; char alen_r_[PADR_(__socklen_t *__restrict)];
+   char asa_l_[PADL_(struct sockaddr *)]; struct sockaddr * asa; char 
asa_r_[PADR_(struct sockaddr *)];
+   char alen_l_[PADL_(__socklen_t *)]; __socklen_t * alen; char 
alen_r_[PADR_(__socklen_t *)];
 };
 struct getsockname_args {
char fdes_l_[PADL_(int)]; int fdes; char fdes_r_[PADR_(int)];
-   char asa_l_[PADL_(struct sockaddr *__restrict)]; struct sockaddr 
*__restrict asa; char asa_r_[PADR_(struct sockaddr *__restrict)];
-   char alen_l_[PADL_(__socklen_t *__restrict)]; __socklen_t *__restrict 
alen; char alen_r_[PADR_(__socklen_t *__restrict)];
+   char asa_l_[PADL_(struct sockaddr *)]; struct sockaddr * asa; char 
asa_r_[PADR_(struct sockaddr *)];
+   char alen_l_[PADL_(__socklen_t *)]; __socklen_t * alen; char 
alen_r_[PADR_(__socklen_t *)];
 };
 struct access_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
@@ -1662,8 +1662,8 @@ struct chflagsat_args {
 };
 struct accept4_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
-   char name_l_[PADL_(struct sockaddr *__restrict)]; struct sockaddr 
*__restrict name; char name_r_[PADR_(struct sockaddr *__restrict)];
-   char anamelen_l_[PADL_(__socklen_t *__restrict)]; __socklen_t 
*__restrict anamelen; char anamelen_r_[PADR_(__socklen_t *__restrict)];
+   char name_l_[PADL_(struct sockaddr *)]; struct sockaddr * name; char 
name_r_[PADR_(struct sockaddr *)];
+   char anamelen_l_[PADL_(__socklen_t *)]; __socklen_t * anamelen; char 
anamelen_r_[PADR_(__socklen_t *)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
 };
 struct pipe2_args {
___
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: r339622 - in head/sys: compat/freebsd32 kern

2018-10-22 Thread Brooks Davis
Author: brooks
Date: Mon Oct 22 21:50:43 2018
New Revision: 339622
URL: https://svnweb.freebsd.org/changeset/base/339622

Log:
  Remove __restrict qualifiers from syscalls.master.
  
  The restruct qualifier is intended to aid code generation in the
  compiler, but the only access to storage through these pointers is via
  structs using copyin/copyout and the like which can not be written in C
  or C++ and thus the compiler gains nothing from the qualifiers.
  
  As such, the qualifiers add no value in current usage.
  
  Reviewed by:  kib
  Obtained from:CheriBSD
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D17574

Modified:
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/syscalls.master

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Mon Oct 22 21:26:37 2018
(r339621)
+++ head/sys/compat/freebsd32/syscalls.master   Mon Oct 22 21:50:43 2018
(r339622)
@@ -1051,8 +1051,8 @@
 540AUE_CHFLAGSAT   NOPROTO { int chflagsat(int fd, const char *path, \
u_long flags, int atflag); }
 541AUE_ACCEPT  NOPROTO { int accept4(int s, \
-   struct sockaddr * __restrict name, \
-   __socklen_t * __restrict anamelen, \
+   struct sockaddr *name, \
+   __socklen_t *anamelen, \
int flags); }
 542AUE_PIPENOPROTO { int pipe2(int *fildes, int flags); }
 543AUE_AIO_MLOCK   STD { int freebsd32_aio_mlock( \

Modified: head/sys/kern/syscalls.master
==
--- head/sys/kern/syscalls.master   Mon Oct 22 21:26:37 2018
(r339621)
+++ head/sys/kern/syscalls.master   Mon Oct 22 21:50:43 2018
(r339622)
@@ -144,23 +144,23 @@
_Out_writes_bytes_(len) caddr_t buf, \
size_t len, int flags, \
_Out_writes_bytes_opt_(*fromlenaddr) \
-   struct sockaddr * __restrict from, \
+   struct sockaddr *from, \
_Inout_opt_ \
-   __socklen_t * __restrict fromlenaddr); }
+   __socklen_t *fromlenaddr); }
 30 AUE_ACCEPT  STD { int accept(int s, \
_Out_writes_bytes_opt_(*anamelen) \
-   struct sockaddr * __restrict name, \
+   struct sockaddr *name, \
_Inout_opt_ \
-   __socklen_t * __restrict anamelen); }
+   __socklen_t *anamelen); }
 31 AUE_GETPEERNAME STD { int getpeername(int fdes, \
_Out_writes_bytes_(*alen) \
-   struct sockaddr * __restrict asa, \
+   struct sockaddr *asa, \
_Inout_opt_ \
-   __socklen_t * __restrict alen); }
+   __socklen_t *alen); }
 32 AUE_GETSOCKNAME STD { int getsockname(int fdes, \
_Out_writes_bytes_(*alen) \
-   struct sockaddr * __restrict asa, \
-   _Inout_ __socklen_t * __restrict alen); }
+   struct sockaddr *asa, \
+   _Inout_ __socklen_t *alen); }
 33 AUE_ACCESS  STD { int access(_In_z_ char *path, int amode); }
 34 AUE_CHFLAGS STD { int chflags(_In_z_ const char *path, \
u_long flags); }
@@ -1273,9 +1273,9 @@
u_long flags, int atflag); }
 541AUE_ACCEPT  STD { int accept4(int s, \
_Out_writes_bytes_opt_(*anamelen) \
-   struct sockaddr * __restrict name, \
+   struct sockaddr *name, \
_Inout_opt_ \
-   __socklen_t * __restrict anamelen, \
+   __socklen_t *anamelen, \
int flags); }
 542AUE_PIPESTD { int pipe2(_Out_writes_(2) int *fildes, \
int flags); }
___
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: r339621 - stable/11/usr.bin/vmstat

2018-10-22 Thread John Baldwin
Author: jhb
Date: Mon Oct 22 21:26:37 2018
New Revision: 339621
URL: https://svnweb.freebsd.org/changeset/base/339621

Log:
  MFC 338094: Fully retire the unimplemented -t option from vmstat(8).
  
  It was #ifdef'd out in the 4.4BSD import and hasn't been re-enabled
  since then.

Modified:
  stable/11/usr.bin/vmstat/vmstat.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/vmstat/vmstat.c
==
--- stable/11/usr.bin/vmstat/vmstat.c   Mon Oct 22 21:25:28 2018
(r339620)
+++ stable/11/usr.bin/vmstat/vmstat.c   Mon Oct 22 21:26:37 2018
(r339621)
@@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$");
 static char da[] = "da";
 
 enum x_stats { X_SUM, X_HZ, X_STATHZ, X_NCHSTATS, X_INTRNAMES, X_SINTRNAMES,
-X_INTRCNT, X_SINTRCNT, X_DEFICIT, X_REC, X_PGIN, X_XSTATS };
+X_INTRCNT, X_SINTRCNT };
 
 static struct nlist namelist[] = {
[X_SUM] = { .n_name = "_vm_cnt", },
@@ -94,12 +94,6 @@ static struct nlist namelist[] = {
[X_SINTRNAMES] = { .n_name = "_sintrnames", },
[X_INTRCNT] = { .n_name = "_intrcnt", },
[X_SINTRCNT] = { .n_name = "_sintrcnt", },
-#ifdef notyet
-   [X_DEFICIT] = { .n_name = "_deficit", },
-   [X_REC] = { .n_name = "_rectime", },
-   [X_PGIN] = { .n_name = "_pgintime", },
-   [X_XSTATS] = { .n_name = "_xstats", },
-#endif
{ .n_name = NULL, },
 };
 
@@ -178,7 +172,7 @@ main(int argc, char *argv[])
if (argc < 0)
return (argc);
 
-   while ((c = getopt(argc, argv, "ac:fhHiM:mN:n:oPp:stw:z")) != -1) {
+   while ((c = getopt(argc, argv, "ac:fhHiM:mN:n:oPp:sw:z")) != -1) {
switch (c) {
case 'a':
aflag++;
@@ -228,14 +222,6 @@ main(int argc, char *argv[])
case 's':
todo |= SUMSTAT;
break;
-   case 't':
-#ifdef notyet
-   todo |= TIMESTAT;
-#else
-   xo_errx(EX_USAGE,
-   "sorry, -t is not (re)implemented yet");
-#endif
-   break;
case 'w':
/* Convert to milliseconds. */
f = atof(optarg);
@@ -339,10 +325,6 @@ retry_nlist:
dosum();
if (todo & OBJSTAT)
doobjstat();
-#ifdef notyet
-   if (todo & TIMESTAT)
-   dotimes();
-#endif
if (todo & INTRSTAT)
dointr(interval, reps);
if (todo & VMSTAT)
@@ -954,29 +936,6 @@ doresize(void)
 */
wresized = 0;
 }
-
-#ifdef notyet
-static void
-dotimes(void)
-{
-   unsigned int pgintime, rectime;
-
-   kread(X_REC, , sizeof(rectime));
-   kread(X_PGIN, , sizeof(pgintime));
-   kread(X_SUM, , sizeof(sum));
-   xo_emit("{:page-reclaims/%u} {N:reclaims}, "
-   "{:reclaim-time/%u} {N:total time (usec)}\n",
-   sum.v_pgrec, rectime);
-   xo_emit("{L:average}: {:reclaim-average/%u} {N:usec \\/ reclaim}\n",
-   rectime / sum.v_pgrec);
-   xo_emit("\n");
-   xo_emit("{:page-ins/%u} {N:page ins}, "
-   "{:page-in-time/%u} {N:total time (msec)}\n",
-   sum.v_pgin, pgintime / 10);
-   xo_emit("{L:average}: {:average/%8.1f} {N:msec \\/ page in}\n",
-   pgintime / (sum.v_pgin * 10.0));
-}
-#endif
 
 static long
 pct(long top, long bot)
___
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: r339620 - head/usr.bin/ktrdump

2018-10-22 Thread John Baldwin
Author: jhb
Date: Mon Oct 22 21:25:28 2018
New Revision: 339620
URL: https://svnweb.freebsd.org/changeset/base/339620

Log:
  Add a "live" mode to ktrdump.
  
  Support a "live" mode in ktrdump enabled via the -l flag.  In this
  mode, ktrdump polls the kernel's trace buffer periodically (currently
  hardcoded as a 50 millisecond interval) and dumps any newly added
  entries.  Fancier logic for the timeout (e.g. a command line option or
  some kind of backoff based on the time since the last entry) can be
  added later as the need arises.
  
  While here, fix some bugs from when this was Capsicum-ized:
  - Use caph_limit_stream() for the output stream so that isatty() works
and the output can be line-buffered (especially useful for live
mode).
  - Use caph_limit_stderr() to permit error messages to be displayed if
an error occurs after cap_enter().
  
  Reviewed by:  kib, 0mp (manpage)
  MFC after:2 months
  Differential Revision:https://reviews.freebsd.org/D17315

Modified:
  head/usr.bin/ktrdump/ktrdump.8
  head/usr.bin/ktrdump/ktrdump.c

Modified: head/usr.bin/ktrdump/ktrdump.8
==
--- head/usr.bin/ktrdump/ktrdump.8  Mon Oct 22 21:17:36 2018
(r339619)
+++ head/usr.bin/ktrdump/ktrdump.8  Mon Oct 22 21:25:28 2018
(r339620)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 6, 2015
+.Dd October 22, 2018
 .Dt KTRDUMP 8
 .Os
 .Sh NAME
@@ -33,7 +33,7 @@
 .Nd print kernel ktr trace buffer
 .Sh SYNOPSIS
 .Nm
-.Op Fl cfqrtH
+.Op Fl cflqrtH
 .Op Fl i Ar ktrfile
 .Op Fl M Ar core
 .Op Fl N Ar system
@@ -47,6 +47,9 @@ The following options are available:
 .Bl -tag -width ".Fl i Ar ktrfile"
 .It Fl c
 Print the CPU number that each entry was logged from.
+.It Fl l
+Poll the kernel ktr trace buffer periodically dumping any new events after
+each poll.
 .It Fl f
 Print the file and line number that each entry was logged from.
 .It Fl q

Modified: head/usr.bin/ktrdump/ktrdump.c
==
--- head/usr.bin/ktrdump/ktrdump.c  Mon Oct 22 21:17:36 2018
(r339619)
+++ head/usr.bin/ktrdump/ktrdump.c  Mon Oct 22 21:25:28 2018
(r339620)
@@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$");
 
 #defineSBUFLEN 128
 #defineUSAGE \
-   "usage: ktrdump [-cfqrtH] [-i ktrfile] [-M core] [-N system] [-o 
outfile]\n"
+   "usage: ktrdump [-cflqrtH] [-i ktrfile] [-M core] [-N system] [-o 
outfile]\n"
 
 static void usage(void);
 
@@ -65,6 +65,7 @@ static struct nlist nl[] = {
 
 static int cflag;
 static int fflag;
+static int lflag;
 static int Mflag;
 static int Nflag;
 static int qflag;
@@ -111,7 +112,7 @@ main(int ac, char **av)
 * Parse commandline arguments.
 */
out = stdout;
-   while ((c = getopt(ac, av, "cfqrtHe:i:m:M:N:o:")) != -1)
+   while ((c = getopt(ac, av, "cflqrtHe:i:m:M:N:o:")) != -1)
switch (c) {
case 'c':
cflag = 1;
@@ -136,6 +137,9 @@ main(int ac, char **av)
err(1, "unable to limit rights for %s",
optarg);
break;
+   case 'l':
+   lflag = 1;
+   break;
case 'M':
case 'm':
if (strlcpy(corefile, optarg, sizeof(corefile))
@@ -169,9 +173,10 @@ main(int ac, char **av)
if (ac != 0)
usage();
 
-   cap_rights_init(, CAP_FSTAT, CAP_WRITE);
-   if (cap_rights_limit(fileno(out), ) < 0 && errno != ENOSYS)
+   if (caph_limit_stream(fileno(out), CAPH_WRITE) < 0)
err(1, "unable to limit rights for %s", outfile);
+   if (caph_limit_stderr() < 0)
+   err(1, "unable to limit rights for stderr");
 
/*
 * Open our execfile and corefile, resolve needed symbols and read in
@@ -258,15 +263,29 @@ main(int ac, char **av)
fprintf(out, "\n");
}
 
+   tlast = -1;
/*
 * Now tear through the trace buffer.
+*
+* In "live" mode, find the oldest entry (first non-NULL entry
+* after index2) and walk forward.  Otherwise, start with the
+* most recent entry and walk backwards.
 */
if (!iflag) {
-   i = index - 1;
-   if (i < 0)
-   i = entries - 1;
+   if (lflag) {
+   i = index2 + 1 % entries;
+   while (buf[i].ktr_desc == NULL && i != index) {
+   i++;
+   if (i == entries)
+   i = 0;
+   }
+   } else {
+   i = index - 1;
+   if (i < 0)
+   i = entries - 1;
+   }
}
- 

svn commit: r339619 - in head/sys: netinet sys

2018-10-22 Thread John Baldwin
Author: jhb
Date: Mon Oct 22 21:17:36 2018
New Revision: 339619
URL: https://svnweb.freebsd.org/changeset/base/339619

Log:
  A couple of style fixes in recent TCP changes.
  
  - Add a blank line before a block comment to match other block comments
in the same function.
  - Sort the prototype for sbsndptr_adv and fix whitespace between return
type and function name.
  
  Reviewed by:  gallatin, bz
  Differential Revision:https://reviews.freebsd.org/D17474

Modified:
  head/sys/netinet/tcp_output.c
  head/sys/sys/sockbuf.h

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Mon Oct 22 20:55:35 2018
(r339618)
+++ head/sys/netinet/tcp_output.c   Mon Oct 22 21:17:36 2018
(r339619)
@@ -895,6 +895,7 @@ send:
len = max_len;
}
}
+
/*
 * Prevent the last segment from being
 * fractional unless the send sockbuf can be

Modified: head/sys/sys/sockbuf.h
==
--- head/sys/sys/sockbuf.h  Mon Oct 22 20:55:35 2018(r339618)
+++ head/sys/sys/sockbuf.h  Mon Oct 22 21:17:36 2018(r339619)
@@ -165,10 +165,9 @@ intsbreserve_locked(struct sockbuf *sb, u_long cc, 
st
struct thread *td);
 struct mbuf *
sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff);
+void   sbsndptr_adv(struct sockbuf *sb, struct mbuf *mb, u_int len);
 struct mbuf *
sbsndptr_noadv(struct sockbuf *sb, u_int off, u_int *moff);
-void
-   sbsndptr_adv(struct sockbuf *sb, struct mbuf *mb, u_int len);
 struct mbuf *
sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff);
 intsbwait(struct sockbuf *sb);
___
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: r339618 - head/sys/compat/linuxkpi/common/include/linux

2018-10-22 Thread Tijl Coosemans
Author: tijl
Date: Mon Oct 22 20:55:35 2018
New Revision: 339618
URL: https://svnweb.freebsd.org/changeset/base/339618

Log:
  Define linuxkpi readq for 64-bit architectures.  It is used by drm-kmod.
  Currently the compiler picks up the definition in machine/cpufunc.h.
  
  Add compiler memory barriers to read* and write*.  The Linux x86
  implementation of these functions uses inline asm with "memory" clobber.
  The Linux x86 implementation of read_relaxed* and write_relaxed* uses the
  same inline asm without "memory" clobber.
  
  Implement ioread* and iowrite* in terms of read* and write* so they also
  have memory barriers.
  
  Qualify the addr parameter in write* as volatile.
  
  Like Linux, define macros with the same name as the inline functions.
  
  Only define 64-bit versions on 64-bit architectures because generally
  32-bit architectures can't do atomic 64-bit loads and stores.
  
  Regroup the functions a bit and add brief comments explaining what they do:
  - __raw_read*, __raw_write*: atomic, no barriers, no byte swapping
  - read_relaxed*, write_relaxed*: atomic, no barriers, little-endian
  - read*, write*: atomic, with barriers, little-endian
  
  Add a comment that says our implementation of ioread* and iowrite*
  only handles MMIO and does not support port IO.
  
  Reviewed by:  hselasky
  MFC after:3 days

Modified:
  head/sys/compat/linuxkpi/common/include/linux/io.h

Modified: head/sys/compat/linuxkpi/common/include/linux/io.h
==
--- head/sys/compat/linuxkpi/common/include/linux/io.h  Mon Oct 22 20:22:33 
2018(r339617)
+++ head/sys/compat/linuxkpi/common/include/linux/io.h  Mon Oct 22 20:55:35 
2018(r339618)
@@ -38,153 +38,309 @@
 #include 
 #include 
 
+/*
+ * XXX This is all x86 specific.  It should be bus space access.
+ */
+
+/* Access MMIO registers atomically without barriers and byte swapping. */
+
+static inline uint8_t
+__raw_readb(const volatile void *addr)
+{
+   return (*(const volatile uint8_t *)addr);
+}
+#define__raw_readb(addr)   __raw_readb(addr)
+
+static inline void
+__raw_writeb(uint8_t v, volatile void *addr)
+{
+   *(volatile uint8_t *)addr = v;
+}
+#define__raw_writeb(v, addr)   __raw_writeb(v, addr)
+
+static inline uint16_t
+__raw_readw(const volatile void *addr)
+{
+   return (*(const volatile uint16_t *)addr);
+}
+#define__raw_readw(addr)   __raw_readw(addr)
+
+static inline void
+__raw_writew(uint16_t v, volatile void *addr)
+{
+   *(volatile uint16_t *)addr = v;
+}
+#define__raw_writew(v, addr)   __raw_writew(v, addr)
+
 static inline uint32_t
 __raw_readl(const volatile void *addr)
 {
-   return *(const volatile uint32_t *)addr;
+   return (*(const volatile uint32_t *)addr);
 }
+#define__raw_readl(addr)   __raw_readl(addr)
 
 static inline void
-__raw_writel(uint32_t b, volatile void *addr)
+__raw_writel(uint32_t v, volatile void *addr)
 {
-   *(volatile uint32_t *)addr = b;
+   *(volatile uint32_t *)addr = v;
 }
+#define__raw_writel(v, addr)   __raw_writel(v, addr)
 
+#ifdef __LP64__
 static inline uint64_t
 __raw_readq(const volatile void *addr)
 {
-   return *(const volatile uint64_t *)addr;
+   return (*(const volatile uint64_t *)addr);
 }
+#define__raw_readq(addr)   __raw_readq(addr)
 
 static inline void
-__raw_writeq(uint64_t b, volatile void *addr)
+__raw_writeq(uint64_t v, volatile void *addr)
 {
-   *(volatile uint64_t *)addr = b;
+   *(volatile uint64_t *)addr = v;
 }
+#define__raw_writeq(v, addr)   __raw_writeq(v, addr)
+#endif
 
-/*
- * XXX This is all x86 specific.  It should be bus space access.
- */
 #definemmiowb()barrier()
 
-#undef writel
+/* Access little-endian MMIO registers atomically with memory barriers. */
+
+#undef readb
+static inline uint8_t
+readb(const volatile void *addr)
+{
+   uint8_t v;
+
+   __compiler_membar();
+   v = *(const volatile uint8_t *)addr;
+   __compiler_membar();
+   return (v);
+}
+#definereadb(addr) readb(addr)
+
+#undef writeb
 static inline void
-writel(uint32_t b, void *addr)
+writeb(uint8_t v, volatile void *addr)
 {
-   *(volatile uint32_t *)addr = b;
+   __compiler_membar();
+   *(volatile uint8_t *)addr = v;
+   __compiler_membar();
 }
+#definewriteb(v, addr) writeb(v, addr)
 
-#undef writel_relaxed
+#undef readw
+static inline uint16_t
+readw(const volatile void *addr)
+{
+   uint16_t v;
+
+   __compiler_membar();
+   v = *(const volatile uint16_t *)addr;
+   __compiler_membar();
+   return (v);
+}
+#definereadw(addr) readw(addr)
+
+#undef writew
 static inline void
-writel_relaxed(uint32_t b, void *addr)
+writew(uint16_t v, volatile void *addr)
 {
-   *(volatile uint32_t *)addr = b;
+   __compiler_membar();
+   *(volatile uint16_t 

Re: svn commit: r339616 - in head: share/man/man4 sys/arm64/arm64 sys/kern sys/vm sys/x86/acpica

2018-10-22 Thread Rodney W. Grimes
> Author: markj
> Date: Mon Oct 22 20:13:51 2018
> New Revision: 339616
> URL: https://svnweb.freebsd.org/changeset/base/339616
> 
> Log:
>   Make it possible to disable NUMA support with a tunable.
>   
>   This provides a chicken switch for anyone negatively impacted by
>   enabling NUMA in the amd64 GENERIC kernel configuration.  With
>   NUMA disabled at boot-time, information about the NUMA topology
>   is not exposed to the rest of the kernel, and all of physical
>   memory is viewed as coming from a single domain.
>   
>   This method still has some performance overhead relative to disabling
>   NUMA support at compile time.
>   
>   PR: 231460
>   Reviewed by:alc, gallatin, kib
>   MFC after:  1 week
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D17439

Thank you Mark.

> Modified:
>   head/share/man/man4/numa.4
>   head/sys/arm64/arm64/mp_machdep.c
>   head/sys/kern/kern_cpuset.c
>   head/sys/vm/vm_phys.c
>   head/sys/x86/acpica/srat.c
> 
> Modified: head/share/man/man4/numa.4
> ==
> --- head/share/man/man4/numa.4Mon Oct 22 20:00:43 2018
> (r339615)
> +++ head/share/man/man4/numa.4Mon Oct 22 20:13:51 2018
> (r339616)
> @@ -24,18 +24,16 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd July 10, 2018
> +.Dd October 22, 2018
>  .Dt NUMA 4
>  .Os
>  .Sh NAME
>  .Nm NUMA
>  .Nd Non-Uniform Memory Access
>  .Sh SYNOPSIS
> -.Cd options SMP
> -.Cd options MAXMEMDOM=16
> +.Cd options MAXMEMDOM
> +.Cd options NUMA
>  .Pp
> -.In sys/cpuset.h
> -.In sys/bus.h
>  .Sh DESCRIPTION
>  Non-Uniform Memory Access is a computer architecture design which
>  involves unequal costs between processors, memory and IO devices
> @@ -47,14 +45,26 @@ architecture, the latency to access specific memory or
>  depends upon which processor the memory or device is attached to.
>  Accessing memory local to a processor is faster than accessing memory
>  that is connected to one of the other processors.
> +.Fx
> +implements NUMA-aware memory allocation policies.
> +By default it attempts to ensure that allocations are balanced across
> +each domain.
> +Users may override the default domain selection policy using
> +.Xr cpuset 1 .
>  .Pp
>  .Nm
> -is enabled when the
> +support is enabled when the
>  .Cd NUMA
> -option is used in a kernel configuration
> -file and the
> +option is specified in the kernel configuration file.
> +Each platform defines the
>  .Cd MAXMEMDOM
> -option is set to a value greater than 1.
> +constant, which specifies the maximum number of supported NUMA domains.
> +This constant may be specified in the kernel configuration file.
> +.Nm
> +support can be disabled at boot time by setting the
> +.Va vm.numa.disabled
> +tunable to 1.
> +Other values for this tunable are currently ignored.
>  .Pp
>  Thread and process
>  .Nm
> @@ -128,7 +138,7 @@ tool first appeared in
>  .Fx 11.0
>  and were removed in
>  .Fx 12.0 .
> -Current implementation appeared in
> +The current implementation appeared in
>  .Fx 12.0 .
>  .Pp
>  .Sh AUTHORS
> 
> Modified: head/sys/arm64/arm64/mp_machdep.c
> ==
> --- head/sys/arm64/arm64/mp_machdep.c Mon Oct 22 20:00:43 2018
> (r339615)
> +++ head/sys/arm64/arm64/mp_machdep.c Mon Oct 22 20:13:51 2018
> (r339616)
> @@ -576,11 +576,12 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size
>   return (FALSE);
>  
>   /* Try to read the numa node of this cpu */
> - if (OF_getencprop(node, "numa-node-id", , sizeof(domain)) > 0) {
> - __pcpu[id].pc_domain = domain;
> - if (domain < MAXMEMDOM)
> - CPU_SET(id, _domain[domain]);
> - }
> + if (vm_ndomains == 1 ||
> + OF_getencprop(node, "numa-node-id", , sizeof(domain)) <= 0)
> + domain = 0;
> + __pcpu[id].pc_domain = domain;
> + if (domain < MAXMEMDOM)
> + CPU_SET(id, _domain[domain]);
>  
>   return (TRUE);
>  }
> 
> Modified: head/sys/kern/kern_cpuset.c
> ==
> --- head/sys/kern/kern_cpuset.c   Mon Oct 22 20:00:43 2018
> (r339615)
> +++ head/sys/kern/kern_cpuset.c   Mon Oct 22 20:13:51 2018
> (r339616)
> @@ -458,6 +458,12 @@ _domainset_create(struct domainset *domain, struct dom
>   struct domainset *ndomain;
>   int i, j, max;
>  
> + KASSERT(domain->ds_cnt <= vm_ndomains,
> + ("invalid domain count in domainset %p", domain));
> + KASSERT(domain->ds_policy != DOMAINSET_POLICY_PREFER ||
> + domain->ds_prefer < vm_ndomains,
> + ("invalid preferred domain in domains %p", domain));
> +
>   mtx_lock_spin(_lock);
>   LIST_FOREACH(ndomain, _domains, ds_link)
>   if (domainset_equal(ndomain, domain))
> 
> Modified: 

svn commit: r339617 - head/sys/contrib/zstd

2018-10-22 Thread Conrad Meyer
Author: cem
Date: Mon Oct 22 20:22:33 2018
New Revision: 339617
URL: https://svnweb.freebsd.org/changeset/base/339617

Log:
  Retroactively vendor 1.3.3, 1.3.4, and 1.3.7 imports
  
  "svn merge --record-only svn+ssh://repo.freebsd.org/base/vendor/zstd/dist"
  
  Reported by:  jhb, markj
  Sponsored by: Dell EMC Isilon

Modified:
Directory Properties:
  head/sys/contrib/zstd/   (props changed)
___
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: r339616 - in head: share/man/man4 sys/arm64/arm64 sys/kern sys/vm sys/x86/acpica

2018-10-22 Thread Mark Johnston
Author: markj
Date: Mon Oct 22 20:13:51 2018
New Revision: 339616
URL: https://svnweb.freebsd.org/changeset/base/339616

Log:
  Make it possible to disable NUMA support with a tunable.
  
  This provides a chicken switch for anyone negatively impacted by
  enabling NUMA in the amd64 GENERIC kernel configuration.  With
  NUMA disabled at boot-time, information about the NUMA topology
  is not exposed to the rest of the kernel, and all of physical
  memory is viewed as coming from a single domain.
  
  This method still has some performance overhead relative to disabling
  NUMA support at compile time.
  
  PR:   231460
  Reviewed by:  alc, gallatin, kib
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D17439

Modified:
  head/share/man/man4/numa.4
  head/sys/arm64/arm64/mp_machdep.c
  head/sys/kern/kern_cpuset.c
  head/sys/vm/vm_phys.c
  head/sys/x86/acpica/srat.c

Modified: head/share/man/man4/numa.4
==
--- head/share/man/man4/numa.4  Mon Oct 22 20:00:43 2018(r339615)
+++ head/share/man/man4/numa.4  Mon Oct 22 20:13:51 2018(r339616)
@@ -24,18 +24,16 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 10, 2018
+.Dd October 22, 2018
 .Dt NUMA 4
 .Os
 .Sh NAME
 .Nm NUMA
 .Nd Non-Uniform Memory Access
 .Sh SYNOPSIS
-.Cd options SMP
-.Cd options MAXMEMDOM=16
+.Cd options MAXMEMDOM
+.Cd options NUMA
 .Pp
-.In sys/cpuset.h
-.In sys/bus.h
 .Sh DESCRIPTION
 Non-Uniform Memory Access is a computer architecture design which
 involves unequal costs between processors, memory and IO devices
@@ -47,14 +45,26 @@ architecture, the latency to access specific memory or
 depends upon which processor the memory or device is attached to.
 Accessing memory local to a processor is faster than accessing memory
 that is connected to one of the other processors.
+.Fx
+implements NUMA-aware memory allocation policies.
+By default it attempts to ensure that allocations are balanced across
+each domain.
+Users may override the default domain selection policy using
+.Xr cpuset 1 .
 .Pp
 .Nm
-is enabled when the
+support is enabled when the
 .Cd NUMA
-option is used in a kernel configuration
-file and the
+option is specified in the kernel configuration file.
+Each platform defines the
 .Cd MAXMEMDOM
-option is set to a value greater than 1.
+constant, which specifies the maximum number of supported NUMA domains.
+This constant may be specified in the kernel configuration file.
+.Nm
+support can be disabled at boot time by setting the
+.Va vm.numa.disabled
+tunable to 1.
+Other values for this tunable are currently ignored.
 .Pp
 Thread and process
 .Nm
@@ -128,7 +138,7 @@ tool first appeared in
 .Fx 11.0
 and were removed in
 .Fx 12.0 .
-Current implementation appeared in
+The current implementation appeared in
 .Fx 12.0 .
 .Pp
 .Sh AUTHORS

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Mon Oct 22 20:00:43 2018
(r339615)
+++ head/sys/arm64/arm64/mp_machdep.c   Mon Oct 22 20:13:51 2018
(r339616)
@@ -576,11 +576,12 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size
return (FALSE);
 
/* Try to read the numa node of this cpu */
-   if (OF_getencprop(node, "numa-node-id", , sizeof(domain)) > 0) {
-   __pcpu[id].pc_domain = domain;
-   if (domain < MAXMEMDOM)
-   CPU_SET(id, _domain[domain]);
-   }
+   if (vm_ndomains == 1 ||
+   OF_getencprop(node, "numa-node-id", , sizeof(domain)) <= 0)
+   domain = 0;
+   __pcpu[id].pc_domain = domain;
+   if (domain < MAXMEMDOM)
+   CPU_SET(id, _domain[domain]);
 
return (TRUE);
 }

Modified: head/sys/kern/kern_cpuset.c
==
--- head/sys/kern/kern_cpuset.c Mon Oct 22 20:00:43 2018(r339615)
+++ head/sys/kern/kern_cpuset.c Mon Oct 22 20:13:51 2018(r339616)
@@ -458,6 +458,12 @@ _domainset_create(struct domainset *domain, struct dom
struct domainset *ndomain;
int i, j, max;
 
+   KASSERT(domain->ds_cnt <= vm_ndomains,
+   ("invalid domain count in domainset %p", domain));
+   KASSERT(domain->ds_policy != DOMAINSET_POLICY_PREFER ||
+   domain->ds_prefer < vm_ndomains,
+   ("invalid preferred domain in domains %p", domain));
+
mtx_lock_spin(_lock);
LIST_FOREACH(ndomain, _domains, ds_link)
if (domainset_equal(ndomain, domain))

Modified: head/sys/vm/vm_phys.c
==
--- head/sys/vm/vm_phys.c   Mon Oct 22 20:00:43 2018(r339615)
+++ head/sys/vm/vm_phys.c   Mon Oct 22 20:13:51 2018(r339616)
@@ -597,11 +597,22 @@ 

svn commit: r339615 - vendor/zstd/1.3.7

2018-10-22 Thread Conrad Meyer
Author: cem
Date: Mon Oct 22 20:00:43 2018
New Revision: 339615
URL: https://svnweb.freebsd.org/changeset/base/339615

Log:
  tag import of zstd 1.3.7

Added:
  vendor/zstd/1.3.7/
 - copied from r339614, vendor/zstd/dist/
___
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: r339614 - in vendor/zstd/dist: . contrib/adaptive-compression contrib/gen_html contrib/meson contrib/pzstd contrib/seekable_format contrib/seekable_format/examples doc doc/images lib li...

2018-10-22 Thread Conrad Meyer
Author: cem
Date: Mon Oct 22 20:00:30 2018
New Revision: 339614
URL: https://svnweb.freebsd.org/changeset/base/339614

Log:
  import zstd 1.3.7

Added:
  vendor/zstd/dist/CODE_OF_CONDUCT.md
  vendor/zstd/dist/doc/images/cdict_v136.png   (contents, props changed)
  vendor/zstd/dist/doc/images/zstd_cdict_v1_3_5.png   (contents, props changed)
  vendor/zstd/dist/lib/common/debug.c   (contents, props changed)
  vendor/zstd/dist/lib/common/debug.h   (contents, props changed)
  vendor/zstd/dist/lib/compress/hist.c   (contents, props changed)
  vendor/zstd/dist/lib/compress/hist.h   (contents, props changed)
  vendor/zstd/dist/lib/dictBuilder/cover.h   (contents, props changed)
  vendor/zstd/dist/lib/dictBuilder/fastcover.c   (contents, props changed)
  vendor/zstd/dist/programs/zstdgrep.1   (contents, props changed)
  vendor/zstd/dist/programs/zstdgrep.1.md
  vendor/zstd/dist/programs/zstdless.1   (contents, props changed)
  vendor/zstd/dist/programs/zstdless.1.md
  vendor/zstd/dist/tests/libzstd_partial_builds.sh   (contents, props changed)
  vendor/zstd/dist/tests/rateLimiter.py   (contents, props changed)
Deleted:
  vendor/zstd/dist/circle.yml
  vendor/zstd/dist/doc/images/ldmCspeed.png
  vendor/zstd/dist/doc/images/ldmDspeed.png
  vendor/zstd/dist/doc/images/linux-4.7-12-compress.png
  vendor/zstd/dist/doc/images/linux-4.7-12-decompress.png
  vendor/zstd/dist/doc/images/linux-4.7-12-mt-compress.png
  vendor/zstd/dist/doc/images/linux-git-compress.png
  vendor/zstd/dist/doc/images/linux-git-decompress.png
  vendor/zstd/dist/doc/images/linux-git-mt-compress.png
Modified:
  vendor/zstd/dist/.gitattributes
  vendor/zstd/dist/Makefile
  vendor/zstd/dist/NEWS
  vendor/zstd/dist/README.md
  vendor/zstd/dist/TESTING.md
  vendor/zstd/dist/appveyor.yml
  vendor/zstd/dist/contrib/adaptive-compression/Makefile
  vendor/zstd/dist/contrib/gen_html/Makefile
  vendor/zstd/dist/contrib/meson/meson.build
  vendor/zstd/dist/contrib/pzstd/Makefile
  vendor/zstd/dist/contrib/pzstd/Options.cpp
  vendor/zstd/dist/contrib/pzstd/Pzstd.cpp
  vendor/zstd/dist/contrib/seekable_format/examples/Makefile
  vendor/zstd/dist/contrib/seekable_format/examples/seekable_compression.c
  vendor/zstd/dist/contrib/seekable_format/examples/seekable_decompression.c
  vendor/zstd/dist/contrib/seekable_format/zstd_seekable.h
  vendor/zstd/dist/contrib/seekable_format/zstdseek_decompress.c
  vendor/zstd/dist/doc/zstd_compression_format.md
  vendor/zstd/dist/doc/zstd_manual.html
  vendor/zstd/dist/lib/BUCK
  vendor/zstd/dist/lib/Makefile
  vendor/zstd/dist/lib/README.md
  vendor/zstd/dist/lib/common/bitstream.h
  vendor/zstd/dist/lib/common/compiler.h
  vendor/zstd/dist/lib/common/cpu.h
  vendor/zstd/dist/lib/common/entropy_common.c
  vendor/zstd/dist/lib/common/fse.h
  vendor/zstd/dist/lib/common/fse_decompress.c
  vendor/zstd/dist/lib/common/huf.h
  vendor/zstd/dist/lib/common/mem.h
  vendor/zstd/dist/lib/common/pool.c
  vendor/zstd/dist/lib/common/pool.h
  vendor/zstd/dist/lib/common/xxhash.c
  vendor/zstd/dist/lib/common/zstd_common.c
  vendor/zstd/dist/lib/common/zstd_internal.h
  vendor/zstd/dist/lib/compress/fse_compress.c
  vendor/zstd/dist/lib/compress/huf_compress.c
  vendor/zstd/dist/lib/compress/zstd_compress.c
  vendor/zstd/dist/lib/compress/zstd_compress_internal.h
  vendor/zstd/dist/lib/compress/zstd_double_fast.c
  vendor/zstd/dist/lib/compress/zstd_double_fast.h
  vendor/zstd/dist/lib/compress/zstd_fast.c
  vendor/zstd/dist/lib/compress/zstd_fast.h
  vendor/zstd/dist/lib/compress/zstd_lazy.c
  vendor/zstd/dist/lib/compress/zstd_lazy.h
  vendor/zstd/dist/lib/compress/zstd_ldm.c
  vendor/zstd/dist/lib/compress/zstd_ldm.h
  vendor/zstd/dist/lib/compress/zstd_opt.c
  vendor/zstd/dist/lib/compress/zstd_opt.h
  vendor/zstd/dist/lib/compress/zstdmt_compress.c
  vendor/zstd/dist/lib/compress/zstdmt_compress.h
  vendor/zstd/dist/lib/decompress/huf_decompress.c
  vendor/zstd/dist/lib/decompress/zstd_decompress.c
  vendor/zstd/dist/lib/dictBuilder/cover.c
  vendor/zstd/dist/lib/dictBuilder/divsufsort.c
  vendor/zstd/dist/lib/dictBuilder/zdict.c
  vendor/zstd/dist/lib/dictBuilder/zdict.h
  vendor/zstd/dist/lib/legacy/zstd_v01.c
  vendor/zstd/dist/lib/legacy/zstd_v02.c
  vendor/zstd/dist/lib/legacy/zstd_v03.c
  vendor/zstd/dist/lib/legacy/zstd_v04.c
  vendor/zstd/dist/lib/legacy/zstd_v05.c
  vendor/zstd/dist/lib/legacy/zstd_v06.c
  vendor/zstd/dist/lib/legacy/zstd_v07.c
  vendor/zstd/dist/lib/zstd.h
  vendor/zstd/dist/programs/Makefile
  vendor/zstd/dist/programs/README.md
  vendor/zstd/dist/programs/bench.c
  vendor/zstd/dist/programs/bench.h
  vendor/zstd/dist/programs/datagen.c
  vendor/zstd/dist/programs/dibio.c
  vendor/zstd/dist/programs/dibio.h
  vendor/zstd/dist/programs/fileio.c
  vendor/zstd/dist/programs/fileio.h
  vendor/zstd/dist/programs/platform.h
  vendor/zstd/dist/programs/util.h
  vendor/zstd/dist/programs/zstd.1
  vendor/zstd/dist/programs/zstd.1.md
  vendor/zstd/dist/programs/zstdcli.c
  vendor/zstd/dist/tests/.gitignore
  

svn commit: r339613 - vendor/zstd/1.3.4

2018-10-22 Thread Conrad Meyer
Author: cem
Date: Mon Oct 22 19:55:18 2018
New Revision: 339613
URL: https://svnweb.freebsd.org/changeset/base/339613

Log:
  tag import of zstd 1.3.4

Added:
  vendor/zstd/1.3.4/
 - copied from r339612, vendor/zstd/dist/
___
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: r339612 - in vendor/zstd/dist: . contrib/adaptive-compression contrib/gen_html contrib/long_distance_matching contrib/meson contrib/seekable_format doc doc/images lib lib/common lib/com...

2018-10-22 Thread Conrad Meyer
Author: cem
Date: Mon Oct 22 19:50:43 2018
New Revision: 339612
URL: https://svnweb.freebsd.org/changeset/base/339612

Log:
  import zstd 1.3.4

Added:
  vendor/zstd/dist/doc/images/CSpeed2.png   (contents, props changed)
  vendor/zstd/dist/doc/images/DSpeed3.png   (contents, props changed)
  vendor/zstd/dist/doc/images/linux-4.7-12-mt-compress.png   (contents, props 
changed)
  vendor/zstd/dist/doc/images/linux-git-mt-compress.png   (contents, props 
changed)
  vendor/zstd/dist/lib/common/cpu.h   (contents, props changed)
  vendor/zstd/dist/tests/checkTag.c   (contents, props changed)
Deleted:
  vendor/zstd/dist/contrib/long_distance_matching/
  vendor/zstd/dist/doc/images/Cspeed4.png
  vendor/zstd/dist/doc/images/Dspeed4.png
  vendor/zstd/dist/tests/namespaceTest.c
Modified:
  vendor/zstd/dist/Makefile
  vendor/zstd/dist/NEWS
  vendor/zstd/dist/README.md
  vendor/zstd/dist/appveyor.yml
  vendor/zstd/dist/contrib/adaptive-compression/adapt.c
  vendor/zstd/dist/contrib/gen_html/Makefile
  vendor/zstd/dist/contrib/meson/meson.build
  vendor/zstd/dist/contrib/meson/meson_options.txt
  vendor/zstd/dist/contrib/seekable_format/zstdseek_compress.c
  vendor/zstd/dist/contrib/seekable_format/zstdseek_decompress.c
  vendor/zstd/dist/doc/README.md
  vendor/zstd/dist/doc/images/dict-cr.png
  vendor/zstd/dist/doc/images/dict-cs.png
  vendor/zstd/dist/doc/images/dict-ds.png
  vendor/zstd/dist/doc/zstd_compression_format.md
  vendor/zstd/dist/doc/zstd_manual.html
  vendor/zstd/dist/lib/BUCK
  vendor/zstd/dist/lib/README.md
  vendor/zstd/dist/lib/common/bitstream.h
  vendor/zstd/dist/lib/common/compiler.h
  vendor/zstd/dist/lib/common/error_private.c
  vendor/zstd/dist/lib/common/fse.h
  vendor/zstd/dist/lib/common/fse_decompress.c
  vendor/zstd/dist/lib/common/huf.h
  vendor/zstd/dist/lib/common/pool.c
  vendor/zstd/dist/lib/common/pool.h
  vendor/zstd/dist/lib/common/threading.h
  vendor/zstd/dist/lib/common/zstd_errors.h
  vendor/zstd/dist/lib/common/zstd_internal.h
  vendor/zstd/dist/lib/compress/fse_compress.c
  vendor/zstd/dist/lib/compress/huf_compress.c
  vendor/zstd/dist/lib/compress/zstd_compress.c
  vendor/zstd/dist/lib/compress/zstd_compress_internal.h
  vendor/zstd/dist/lib/compress/zstd_double_fast.c
  vendor/zstd/dist/lib/compress/zstd_double_fast.h
  vendor/zstd/dist/lib/compress/zstd_fast.c
  vendor/zstd/dist/lib/compress/zstd_fast.h
  vendor/zstd/dist/lib/compress/zstd_lazy.c
  vendor/zstd/dist/lib/compress/zstd_lazy.h
  vendor/zstd/dist/lib/compress/zstd_ldm.c
  vendor/zstd/dist/lib/compress/zstd_ldm.h
  vendor/zstd/dist/lib/compress/zstd_opt.c
  vendor/zstd/dist/lib/compress/zstd_opt.h
  vendor/zstd/dist/lib/compress/zstdmt_compress.c
  vendor/zstd/dist/lib/compress/zstdmt_compress.h
  vendor/zstd/dist/lib/decompress/huf_decompress.c
  vendor/zstd/dist/lib/decompress/zstd_decompress.c
  vendor/zstd/dist/lib/dictBuilder/cover.c
  vendor/zstd/dist/lib/dictBuilder/zdict.c
  vendor/zstd/dist/lib/dictBuilder/zdict.h
  vendor/zstd/dist/lib/legacy/zstd_legacy.h
  vendor/zstd/dist/lib/legacy/zstd_v04.c
  vendor/zstd/dist/lib/legacy/zstd_v06.c
  vendor/zstd/dist/lib/legacy/zstd_v07.c
  vendor/zstd/dist/lib/zstd.h
  vendor/zstd/dist/programs/Makefile
  vendor/zstd/dist/programs/README.md
  vendor/zstd/dist/programs/bench.c
  vendor/zstd/dist/programs/bench.h
  vendor/zstd/dist/programs/fileio.c
  vendor/zstd/dist/programs/fileio.h
  vendor/zstd/dist/programs/platform.h
  vendor/zstd/dist/programs/util.h
  vendor/zstd/dist/programs/zstd.1
  vendor/zstd/dist/programs/zstd.1.md
  vendor/zstd/dist/programs/zstdcli.c
  vendor/zstd/dist/tests/.gitignore
  vendor/zstd/dist/tests/Makefile
  vendor/zstd/dist/tests/fullbench.c
  vendor/zstd/dist/tests/fuzz/zstd_helpers.c
  vendor/zstd/dist/tests/fuzzer.c
  vendor/zstd/dist/tests/legacy.c
  vendor/zstd/dist/tests/paramgrill.c
  vendor/zstd/dist/tests/playTests.sh
  vendor/zstd/dist/tests/roundTripCrash.c
  vendor/zstd/dist/tests/zstreamtest.c
  vendor/zstd/dist/zlibWrapper/examples/zwrapbench.c

Modified: vendor/zstd/dist/Makefile
==
--- vendor/zstd/dist/Makefile   Mon Oct 22 19:46:35 2018(r339611)
+++ vendor/zstd/dist/Makefile   Mon Oct 22 19:50:43 2018(r339612)
@@ -27,7 +27,7 @@ endif
 default: lib-release zstd-release
 
 .PHONY: all
-all: | allmost examples manual
+all: | allmost examples manual contrib
 
 .PHONY: allmost
 allmost: allzstd
@@ -72,14 +72,18 @@ zstdmt:
 zlibwrapper:
$(MAKE) -C $(ZWRAPDIR) test
 
-.PHONY: check
-check: shortest
+.PHONY: test
+test:
+   $(MAKE) -C $(PRGDIR) allVariants MOREFLAGS+="-g -DZSTD_DEBUG=1"
+   $(MAKE) -C $(TESTDIR) $@
 
-.PHONY: test shortest
-test shortest:
-   $(MAKE) -C $(PRGDIR) allVariants MOREFLAGS="-g -DZSTD_DEBUG=1"
+.PHONY: shortest
+shortest:
$(MAKE) -C $(TESTDIR) $@
 
+.PHONY: check
+check: shortest
+
 .PHONY: examples
 examples:
CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all
@@ 

svn commit: r339611 - vendor/zstd/1.3.3

2018-10-22 Thread Conrad Meyer
Author: cem
Date: Mon Oct 22 19:46:35 2018
New Revision: 339611
URL: https://svnweb.freebsd.org/changeset/base/339611

Log:
  tag import of zstd 1.3.3

Added:
  vendor/zstd/1.3.3/
 - copied from r339610, vendor/zstd/dist/
___
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: r339610 - in vendor/zstd/dist: . contrib/adaptive-compression contrib/long_distance_matching contrib/meson doc doc/images lib lib/common lib/compress lib/decompress lib/deprecated lib/d...

2018-10-22 Thread Conrad Meyer
Author: cem
Date: Mon Oct 22 19:45:18 2018
New Revision: 339610
URL: https://svnweb.freebsd.org/changeset/base/339610

Log:
  import zstd 1.3.3

Added:
  vendor/zstd/dist/contrib/adaptive-compression/
  vendor/zstd/dist/contrib/adaptive-compression/Makefile   (contents, props 
changed)
  vendor/zstd/dist/contrib/adaptive-compression/README.md
  vendor/zstd/dist/contrib/adaptive-compression/adapt.c   (contents, props 
changed)
  vendor/zstd/dist/contrib/adaptive-compression/datagencli.c   (contents, props 
changed)
  vendor/zstd/dist/contrib/adaptive-compression/test-correctness.sh   
(contents, props changed)
  vendor/zstd/dist/contrib/adaptive-compression/test-performance.sh   
(contents, props changed)
  vendor/zstd/dist/contrib/long_distance_matching/
  vendor/zstd/dist/contrib/long_distance_matching/Makefile   (contents, props 
changed)
  vendor/zstd/dist/contrib/long_distance_matching/README.md
  vendor/zstd/dist/contrib/long_distance_matching/ldm.c   (contents, props 
changed)
  vendor/zstd/dist/contrib/long_distance_matching/ldm.h   (contents, props 
changed)
  vendor/zstd/dist/contrib/long_distance_matching/ldm_common.c   (contents, 
props changed)
  vendor/zstd/dist/contrib/long_distance_matching/ldm_params.h   (contents, 
props changed)
  vendor/zstd/dist/contrib/long_distance_matching/main.c   (contents, props 
changed)
  vendor/zstd/dist/doc/images/ldmCspeed.png   (contents, props changed)
  vendor/zstd/dist/doc/images/ldmDspeed.png   (contents, props changed)
  vendor/zstd/dist/doc/images/linux-4.7-12-compress.png   (contents, props 
changed)
  vendor/zstd/dist/doc/images/linux-4.7-12-decompress.png   (contents, props 
changed)
  vendor/zstd/dist/doc/images/linux-git-compress.png   (contents, props changed)
  vendor/zstd/dist/doc/images/linux-git-decompress.png   (contents, props 
changed)
  vendor/zstd/dist/doc/images/zstd_logo86.png   (contents, props changed)
  vendor/zstd/dist/lib/compress/zstd_compress_internal.h   (contents, props 
changed)
  vendor/zstd/dist/tests/seqgen.c   (contents, props changed)
  vendor/zstd/dist/tests/seqgen.h   (contents, props changed)
Deleted:
  vendor/zstd/dist/lib/compress/zstd_compress.h
Modified:
  vendor/zstd/dist/Makefile
  vendor/zstd/dist/NEWS
  vendor/zstd/dist/README.md
  vendor/zstd/dist/circle.yml
  vendor/zstd/dist/contrib/meson/meson.build
  vendor/zstd/dist/doc/zstd_compression_format.md
  vendor/zstd/dist/doc/zstd_manual.html
  vendor/zstd/dist/lib/BUCK
  vendor/zstd/dist/lib/common/bitstream.h
  vendor/zstd/dist/lib/common/mem.h
  vendor/zstd/dist/lib/common/pool.c
  vendor/zstd/dist/lib/common/zstd_common.c
  vendor/zstd/dist/lib/common/zstd_internal.h
  vendor/zstd/dist/lib/compress/zstd_compress.c
  vendor/zstd/dist/lib/compress/zstd_double_fast.c
  vendor/zstd/dist/lib/compress/zstd_double_fast.h
  vendor/zstd/dist/lib/compress/zstd_fast.c
  vendor/zstd/dist/lib/compress/zstd_fast.h
  vendor/zstd/dist/lib/compress/zstd_lazy.c
  vendor/zstd/dist/lib/compress/zstd_lazy.h
  vendor/zstd/dist/lib/compress/zstd_ldm.h
  vendor/zstd/dist/lib/compress/zstd_opt.c
  vendor/zstd/dist/lib/compress/zstd_opt.h
  vendor/zstd/dist/lib/compress/zstdmt_compress.c
  vendor/zstd/dist/lib/compress/zstdmt_compress.h
  vendor/zstd/dist/lib/decompress/zstd_decompress.c
  vendor/zstd/dist/lib/deprecated/zbuff_compress.c
  vendor/zstd/dist/lib/dictBuilder/zdict.c
  vendor/zstd/dist/lib/legacy/zstd_v01.c
  vendor/zstd/dist/lib/legacy/zstd_v02.c
  vendor/zstd/dist/lib/legacy/zstd_v03.c
  vendor/zstd/dist/lib/legacy/zstd_v04.c
  vendor/zstd/dist/lib/legacy/zstd_v05.c
  vendor/zstd/dist/lib/legacy/zstd_v06.c
  vendor/zstd/dist/lib/legacy/zstd_v07.c
  vendor/zstd/dist/lib/zstd.h
  vendor/zstd/dist/programs/BUCK
  vendor/zstd/dist/programs/Makefile
  vendor/zstd/dist/programs/bench.c
  vendor/zstd/dist/programs/bench.h
  vendor/zstd/dist/programs/dibio.c
  vendor/zstd/dist/programs/fileio.c
  vendor/zstd/dist/programs/fileio.h
  vendor/zstd/dist/programs/platform.h
  vendor/zstd/dist/programs/util.h
  vendor/zstd/dist/programs/zstd.1
  vendor/zstd/dist/programs/zstd.1.md
  vendor/zstd/dist/programs/zstdcli.c
  vendor/zstd/dist/tests/Makefile
  vendor/zstd/dist/tests/decodecorpus.c
  vendor/zstd/dist/tests/fullbench.c
  vendor/zstd/dist/tests/fuzzer.c
  vendor/zstd/dist/tests/paramgrill.c
  vendor/zstd/dist/tests/playTests.sh
  vendor/zstd/dist/tests/zbufftest.c
  vendor/zstd/dist/tests/zstreamtest.c
  vendor/zstd/dist/zlibWrapper/BUCK
  vendor/zstd/dist/zlibWrapper/examples/zwrapbench.c
  vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.c

Modified: vendor/zstd/dist/Makefile
==
--- vendor/zstd/dist/Makefile   Mon Oct 22 19:39:20 2018(r339609)
+++ vendor/zstd/dist/Makefile   Mon Oct 22 19:45:18 2018(r339610)
@@ -72,9 +72,12 @@ zstdmt:
 zlibwrapper:
$(MAKE) -C $(ZWRAPDIR) test
 
+.PHONY: check
+check: shortest
+
 .PHONY: test shortest
 test shortest:
-   $(MAKE) -C 

svn commit: r339609 - in head/release: amd64 i386 powerpc sparc64

2018-10-22 Thread Ed Maste
Author: emaste
Date: Mon Oct 22 19:39:20 2018
New Revision: 339609
URL: https://svnweb.freebsd.org/changeset/base/339609

Log:
  release: set -e to exit on error in iso image scripts
  
  Reviewed by:  gjb
  Differential Revision:https://reviews.freebsd.org/D17651

Modified:
  head/release/amd64/mkisoimages.sh
  head/release/i386/mkisoimages.sh
  head/release/powerpc/mkisoimages.sh
  head/release/sparc64/mkisoimages.sh

Modified: head/release/amd64/mkisoimages.sh
==
--- head/release/amd64/mkisoimages.sh   Mon Oct 22 18:41:22 2018
(r339608)
+++ head/release/amd64/mkisoimages.sh   Mon Oct 22 19:39:20 2018
(r339609)
@@ -23,6 +23,8 @@
 # extra-bits-dir, if provided, contains additional files to be merged
 # into base-bits-dir as part of making the image.
 
+set -e
+
 if [ -z $ETDUMP ]; then
ETDUMP=etdump
 fi

Modified: head/release/i386/mkisoimages.sh
==
--- head/release/i386/mkisoimages.shMon Oct 22 18:41:22 2018
(r339608)
+++ head/release/i386/mkisoimages.shMon Oct 22 19:39:20 2018
(r339609)
@@ -23,6 +23,8 @@
 # extra-bits-dir, if provided, contains additional files to be merged
 # into base-bits-dir as part of making the image.
 
+set -e
+
 if [ "$1" = "-b" ]; then
# This is highly x86-centric and will be used directly below.
bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot"

Modified: head/release/powerpc/mkisoimages.sh
==
--- head/release/powerpc/mkisoimages.sh Mon Oct 22 18:41:22 2018
(r339608)
+++ head/release/powerpc/mkisoimages.sh Mon Oct 22 19:39:20 2018
(r339609)
@@ -23,6 +23,7 @@
 # extra-bits-dir, if provided, contains additional files to be merged
 # into base-bits-dir as part of making the image.
 
+set -e
 
 if [ "$1" = "-b" ]; then
bootable=1

Modified: head/release/sparc64/mkisoimages.sh
==
--- head/release/sparc64/mkisoimages.sh Mon Oct 22 18:41:22 2018
(r339608)
+++ head/release/sparc64/mkisoimages.sh Mon Oct 22 19:39:20 2018
(r339609)
@@ -22,6 +22,8 @@
 # resulting ISO image, base-bits-dir contains the image contents and
 # extra-bits-dir, if provided, contains additional files to be merged
 # into base-bits-dir as part of making the image.
+set -e
+
 if [ $# -lt 3 ]; then
echo "Usage: $0 [-b] image-label image-name base-bits-dir 
[extra-bits-dir]" > /dev/stderr
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"


Re: svn commit: r339606 - in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib/gen_html sys/contrib/zstd/contrib/meson sys/contrib/zstd/contrib/pzstd sys/contrib/zstd/contrib/seekab

2018-10-22 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: cem
> Date: Mon Oct 22 18:29:12 2018
> New Revision: 339606
> URL: https://svnweb.freebsd.org/changeset/base/339606
> 
> Log:
>   Update to Zstandard 1.3.7
>   
>   Relnotes:   yes
>   Sponsored by:   Dell EMC Isilon

MFC after: 1+month?

> Added:
>   head/sys/contrib/zstd/doc/images/cdict_v136.png   (contents, props changed)
>   head/sys/contrib/zstd/doc/images/zstd_cdict_v1_3_5.png   (contents, props 
> changed)
>   head/sys/contrib/zstd/lib/common/debug.c   (contents, props changed)
>   head/sys/contrib/zstd/lib/common/debug.h   (contents, props changed)
>   head/sys/contrib/zstd/lib/compress/hist.c   (contents, props changed)
>   head/sys/contrib/zstd/lib/compress/hist.h   (contents, props changed)
>   head/sys/contrib/zstd/lib/dictBuilder/cover.h   (contents, props changed)
>   head/sys/contrib/zstd/lib/dictBuilder/fastcover.c   (contents, props 
> changed)
>   head/sys/contrib/zstd/programs/zstdgrep.1   (contents, props changed)
>   head/sys/contrib/zstd/programs/zstdgrep.1.md
>   head/sys/contrib/zstd/programs/zstdless.1   (contents, props changed)
>   head/sys/contrib/zstd/programs/zstdless.1.md
>   head/sys/contrib/zstd/tests/libzstd_partial_builds.sh   (contents, props 
> changed)
>   head/sys/contrib/zstd/tests/rateLimiter.py   (contents, props changed)
> Deleted:
>   head/sys/contrib/zstd/circle.yml
>   head/sys/contrib/zstd/tests/namespaceTest.c
> Modified:
>   head/lib/libzstd/Makefile
>   head/sys/conf/files
>   head/sys/conf/files.sparc64
>   head/sys/contrib/zstd/.gitattributes
>   head/sys/contrib/zstd/Makefile
>   head/sys/contrib/zstd/NEWS
>   head/sys/contrib/zstd/README.md
>   head/sys/contrib/zstd/TESTING.md
>   head/sys/contrib/zstd/appveyor.yml
>   head/sys/contrib/zstd/contrib/gen_html/Makefile
>   head/sys/contrib/zstd/contrib/meson/meson.build
>   head/sys/contrib/zstd/contrib/pzstd/Makefile
>   head/sys/contrib/zstd/contrib/pzstd/Options.cpp
>   head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp
>   head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile
>   
> head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c
>   
> head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c
>   head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h
>   head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c
>   head/sys/contrib/zstd/doc/zstd_compression_format.md
>   head/sys/contrib/zstd/doc/zstd_manual.html
>   head/sys/contrib/zstd/lib/BUCK
>   head/sys/contrib/zstd/lib/Makefile
>   head/sys/contrib/zstd/lib/README.md
>   head/sys/contrib/zstd/lib/common/bitstream.h
>   head/sys/contrib/zstd/lib/common/compiler.h
>   head/sys/contrib/zstd/lib/common/cpu.h
>   head/sys/contrib/zstd/lib/common/entropy_common.c
>   head/sys/contrib/zstd/lib/common/fse.h
>   head/sys/contrib/zstd/lib/common/fse_decompress.c
>   head/sys/contrib/zstd/lib/common/huf.h
>   head/sys/contrib/zstd/lib/common/mem.h
>   head/sys/contrib/zstd/lib/common/pool.c
>   head/sys/contrib/zstd/lib/common/pool.h
>   head/sys/contrib/zstd/lib/common/xxhash.c
>   head/sys/contrib/zstd/lib/common/zstd_common.c
>   head/sys/contrib/zstd/lib/common/zstd_internal.h
>   head/sys/contrib/zstd/lib/compress/fse_compress.c
>   head/sys/contrib/zstd/lib/compress/huf_compress.c
>   head/sys/contrib/zstd/lib/compress/zstd_compress.c
>   head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h
>   head/sys/contrib/zstd/lib/compress/zstd_double_fast.c
>   head/sys/contrib/zstd/lib/compress/zstd_double_fast.h
>   head/sys/contrib/zstd/lib/compress/zstd_fast.c
>   head/sys/contrib/zstd/lib/compress/zstd_fast.h
>   head/sys/contrib/zstd/lib/compress/zstd_lazy.c
>   head/sys/contrib/zstd/lib/compress/zstd_lazy.h
>   head/sys/contrib/zstd/lib/compress/zstd_ldm.c
>   head/sys/contrib/zstd/lib/compress/zstd_ldm.h
>   head/sys/contrib/zstd/lib/compress/zstd_opt.c
>   head/sys/contrib/zstd/lib/compress/zstd_opt.h
>   head/sys/contrib/zstd/lib/compress/zstdmt_compress.c
>   head/sys/contrib/zstd/lib/compress/zstdmt_compress.h
>   head/sys/contrib/zstd/lib/decompress/huf_decompress.c
>   head/sys/contrib/zstd/lib/decompress/zstd_decompress.c
>   head/sys/contrib/zstd/lib/dictBuilder/cover.c
>   head/sys/contrib/zstd/lib/dictBuilder/divsufsort.c
>   head/sys/contrib/zstd/lib/dictBuilder/zdict.c
>   head/sys/contrib/zstd/lib/dictBuilder/zdict.h
>   head/sys/contrib/zstd/lib/freebsd/zstd_kmalloc.c
>   head/sys/contrib/zstd/lib/legacy/zstd_v01.c
>   head/sys/contrib/zstd/lib/legacy/zstd_v02.c
>   head/sys/contrib/zstd/lib/legacy/zstd_v03.c
>   head/sys/contrib/zstd/lib/legacy/zstd_v04.c
>   head/sys/contrib/zstd/lib/legacy/zstd_v05.c
>   head/sys/contrib/zstd/lib/legacy/zstd_v06.c
>   head/sys/contrib/zstd/lib/legacy/zstd_v07.c
>   head/sys/contrib/zstd/lib/zstd.h
>   head/sys/contrib/zstd/programs/Makefile
>   head/sys/contrib/zstd/programs/README.md
>   head/sys/contrib/zstd/programs/bench.c
>   

Re: svn commit: r339608 - head/share/man/man7

2018-10-22 Thread Rodney W. Grimes
> Author: emaste
> Date: Mon Oct 22 18:41:22 2018
> New Revision: 339608
> URL: https://svnweb.freebsd.org/changeset/base/339608
> 
> Log:
>   arch.7: first appeared in FreeBSD 11.1

MFC?

> Modified:
>   head/share/man/man7/arch.7
> 
> Modified: head/share/man/man7/arch.7
> ==
> --- head/share/man/man7/arch.7Mon Oct 22 18:40:21 2018
> (r339607)
> +++ head/share/man/man7/arch.7Mon Oct 22 18:41:22 2018
> (r339608)
> @@ -458,4 +458,4 @@ Like
>  An
>  .Nm
>  manual page appeared in
> -.Fx 12 .
> +.Fx 11.1 .
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
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: r339608 - head/share/man/man7

2018-10-22 Thread Ed Maste
Author: emaste
Date: Mon Oct 22 18:41:22 2018
New Revision: 339608
URL: https://svnweb.freebsd.org/changeset/base/339608

Log:
  arch.7: first appeared in FreeBSD 11.1

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Mon Oct 22 18:40:21 2018(r339607)
+++ head/share/man/man7/arch.7  Mon Oct 22 18:41:22 2018(r339608)
@@ -458,4 +458,4 @@ Like
 An
 .Nm
 manual page appeared in
-.Fx 12 .
+.Fx 11.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: r339607 - head

2018-10-22 Thread Ed Maste
Author: emaste
Date: Mon Oct 22 18:40:21 2018
New Revision: 339607
URL: https://svnweb.freebsd.org/changeset/base/339607

Log:
  Makefile.inc1: clean up stale dependency hacks
  
  Our dependency tracking cannot directly cope with certain source tree
  changes, particularly with respect to removing or moving source files or
  replacing generated files.  We have a collection of ad-hoc workarounds
  to handle these cases.  As there is a (small) build-time cost inherent
  in these workarounds, we do not want to keep them indefinitely.  Thus,
  remove workarounds from 2017.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Oct 22 18:29:12 2018(r339606)
+++ head/Makefile.inc1  Mon Oct 22 18:40:21 2018(r339607)
@@ -903,40 +903,18 @@ _sanity_check: .PHONY .MAKE
 _cleanobj_fast_depend_hack: .PHONY
 # Syscall stubs rewritten in C and obsolete MD assembly implementations
 # Date  SVN Rev  Syscalls
-# 20170624  r320278  fstat fstatat fstatfs getdirentries getfsstat statfs
 # 20180404  r332048  sigreturn
 # 20180405  r332080  shmat
 # 20180406  r332119  setlogin
 # 20180411  r332443  exect
 # 20180525  r334224  vadvise
 # 20180604  r334626  brk sbrk
-.for f in brk exect fstat fstatat fstatfs getdirentries getfsstat sbrk 
setlogin shmat sigreturn statfs vadvise
+.for f in brk exect sbrk setlogin shmat sigreturn vadvise
@if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \
egrep -qw '${f}\.[sS]' ${OBJTOP}/lib/libc/.depend.${f}.o; then \
echo "Removing stale dependencies for ${f} syscall wrappers"; \
rm -f ${OBJTOP}/lib/libc/.depend.${f}.* \
   ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \
-   fi
-.endfor
-# 20170607 remove stale dependencies for utimens* wrappers removed in r319663
-.for f in futimens utimensat
-   @if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \
-   egrep -q '/${f}.c' ${OBJTOP}/lib/libc/.depend.${f}.o; then \
-   echo "Removing stale dependencies for ${f} syscall wrappers"; \
-   rm -f ${OBJTOP}/lib/libc/.depend.${f}.* \
-  ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \
-   fi
-.endfor
-# 20170523 remove stale generated asm files for functions which are no longer
-# syscalls after r302092 (pipe) and r318736 (others)
-.for f in getdents lstat mknod pipe stat
-   @if [ -e "${OBJTOP}/lib/libc/${f}.s" ] || \
-   [ -e "${OBJTOP}/lib/libc/${f}.S" ] ; then \
-   echo "Removing stale generated ${f} syscall files"; \
-   rm -f ${OBJTOP}/lib/libc/${f}.* \
-   ${OBJTOP}/lib/libc/.depend.${f}.* \
-   ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/${f}.*} \
-   ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \
fi
 .endfor
 # 20181013  r339348  bcopy reimplemented as .c
___
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: r339606 - in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib/gen_html sys/contrib/zstd/contrib/meson sys/contrib/zstd/contrib/pzstd sys/contrib/zstd/contrib/seekabl...

2018-10-22 Thread Conrad Meyer
Author: cem
Date: Mon Oct 22 18:29:12 2018
New Revision: 339606
URL: https://svnweb.freebsd.org/changeset/base/339606

Log:
  Update to Zstandard 1.3.7
  
  Relnotes: yes
  Sponsored by: Dell EMC Isilon

Added:
  head/sys/contrib/zstd/doc/images/cdict_v136.png   (contents, props changed)
  head/sys/contrib/zstd/doc/images/zstd_cdict_v1_3_5.png   (contents, props 
changed)
  head/sys/contrib/zstd/lib/common/debug.c   (contents, props changed)
  head/sys/contrib/zstd/lib/common/debug.h   (contents, props changed)
  head/sys/contrib/zstd/lib/compress/hist.c   (contents, props changed)
  head/sys/contrib/zstd/lib/compress/hist.h   (contents, props changed)
  head/sys/contrib/zstd/lib/dictBuilder/cover.h   (contents, props changed)
  head/sys/contrib/zstd/lib/dictBuilder/fastcover.c   (contents, props changed)
  head/sys/contrib/zstd/programs/zstdgrep.1   (contents, props changed)
  head/sys/contrib/zstd/programs/zstdgrep.1.md
  head/sys/contrib/zstd/programs/zstdless.1   (contents, props changed)
  head/sys/contrib/zstd/programs/zstdless.1.md
  head/sys/contrib/zstd/tests/libzstd_partial_builds.sh   (contents, props 
changed)
  head/sys/contrib/zstd/tests/rateLimiter.py   (contents, props changed)
Deleted:
  head/sys/contrib/zstd/circle.yml
  head/sys/contrib/zstd/tests/namespaceTest.c
Modified:
  head/lib/libzstd/Makefile
  head/sys/conf/files
  head/sys/conf/files.sparc64
  head/sys/contrib/zstd/.gitattributes
  head/sys/contrib/zstd/Makefile
  head/sys/contrib/zstd/NEWS
  head/sys/contrib/zstd/README.md
  head/sys/contrib/zstd/TESTING.md
  head/sys/contrib/zstd/appveyor.yml
  head/sys/contrib/zstd/contrib/gen_html/Makefile
  head/sys/contrib/zstd/contrib/meson/meson.build
  head/sys/contrib/zstd/contrib/pzstd/Makefile
  head/sys/contrib/zstd/contrib/pzstd/Options.cpp
  head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp
  head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile
  head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c
  
head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c
  head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h
  head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c
  head/sys/contrib/zstd/doc/zstd_compression_format.md
  head/sys/contrib/zstd/doc/zstd_manual.html
  head/sys/contrib/zstd/lib/BUCK
  head/sys/contrib/zstd/lib/Makefile
  head/sys/contrib/zstd/lib/README.md
  head/sys/contrib/zstd/lib/common/bitstream.h
  head/sys/contrib/zstd/lib/common/compiler.h
  head/sys/contrib/zstd/lib/common/cpu.h
  head/sys/contrib/zstd/lib/common/entropy_common.c
  head/sys/contrib/zstd/lib/common/fse.h
  head/sys/contrib/zstd/lib/common/fse_decompress.c
  head/sys/contrib/zstd/lib/common/huf.h
  head/sys/contrib/zstd/lib/common/mem.h
  head/sys/contrib/zstd/lib/common/pool.c
  head/sys/contrib/zstd/lib/common/pool.h
  head/sys/contrib/zstd/lib/common/xxhash.c
  head/sys/contrib/zstd/lib/common/zstd_common.c
  head/sys/contrib/zstd/lib/common/zstd_internal.h
  head/sys/contrib/zstd/lib/compress/fse_compress.c
  head/sys/contrib/zstd/lib/compress/huf_compress.c
  head/sys/contrib/zstd/lib/compress/zstd_compress.c
  head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h
  head/sys/contrib/zstd/lib/compress/zstd_double_fast.c
  head/sys/contrib/zstd/lib/compress/zstd_double_fast.h
  head/sys/contrib/zstd/lib/compress/zstd_fast.c
  head/sys/contrib/zstd/lib/compress/zstd_fast.h
  head/sys/contrib/zstd/lib/compress/zstd_lazy.c
  head/sys/contrib/zstd/lib/compress/zstd_lazy.h
  head/sys/contrib/zstd/lib/compress/zstd_ldm.c
  head/sys/contrib/zstd/lib/compress/zstd_ldm.h
  head/sys/contrib/zstd/lib/compress/zstd_opt.c
  head/sys/contrib/zstd/lib/compress/zstd_opt.h
  head/sys/contrib/zstd/lib/compress/zstdmt_compress.c
  head/sys/contrib/zstd/lib/compress/zstdmt_compress.h
  head/sys/contrib/zstd/lib/decompress/huf_decompress.c
  head/sys/contrib/zstd/lib/decompress/zstd_decompress.c
  head/sys/contrib/zstd/lib/dictBuilder/cover.c
  head/sys/contrib/zstd/lib/dictBuilder/divsufsort.c
  head/sys/contrib/zstd/lib/dictBuilder/zdict.c
  head/sys/contrib/zstd/lib/dictBuilder/zdict.h
  head/sys/contrib/zstd/lib/freebsd/zstd_kmalloc.c
  head/sys/contrib/zstd/lib/legacy/zstd_v01.c
  head/sys/contrib/zstd/lib/legacy/zstd_v02.c
  head/sys/contrib/zstd/lib/legacy/zstd_v03.c
  head/sys/contrib/zstd/lib/legacy/zstd_v04.c
  head/sys/contrib/zstd/lib/legacy/zstd_v05.c
  head/sys/contrib/zstd/lib/legacy/zstd_v06.c
  head/sys/contrib/zstd/lib/legacy/zstd_v07.c
  head/sys/contrib/zstd/lib/zstd.h
  head/sys/contrib/zstd/programs/Makefile
  head/sys/contrib/zstd/programs/README.md
  head/sys/contrib/zstd/programs/bench.c
  head/sys/contrib/zstd/programs/bench.h
  head/sys/contrib/zstd/programs/datagen.c
  head/sys/contrib/zstd/programs/dibio.c
  head/sys/contrib/zstd/programs/dibio.h
  head/sys/contrib/zstd/programs/fileio.c
  head/sys/contrib/zstd/programs/fileio.h
  head/sys/contrib/zstd/programs/platform.h
  

svn commit: r339605 - head/sys/kern

2018-10-22 Thread Conrad Meyer
Author: cem
Date: Mon Oct 22 17:42:57 2018
New Revision: 339605
URL: https://svnweb.freebsd.org/changeset/base/339605

Log:
  Conditionalize kern.tty_info_kstacks feature on STACKS option
  
  Fix tinderbox (mips XLPN32) after r339471.
  
  Reported by:  tinderbox
  X-MFC-With:   r339471
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/kern/tty_info.c

Modified: head/sys/kern/tty_info.c
==
--- head/sys/kern/tty_info.cMon Oct 22 17:27:36 2018(r339604)
+++ head/sys/kern/tty_info.cMon Oct 22 17:42:57 2018(r339605)
@@ -236,10 +236,12 @@ sbuf_tty_drain(void *a, const char *d, int len)
return (-ENXIO);
 }
 
+#ifdef STACK
 static bool tty_info_kstacks = false;
 SYSCTL_BOOL(_kern, OID_AUTO, tty_info_kstacks, CTLFLAG_RWTUN,
 _info_kstacks, 0,
 "Enable printing kernel stack(9) traces on ^T (tty info)");
+#endif
 
 /*
  * Report on state of foreground process group.
@@ -248,13 +250,16 @@ void
 tty_info(struct tty *tp)
 {
struct timeval rtime, utime, stime;
+#ifdef STACK
struct stack stack;
+   int sterr;
+#endif
struct proc *p, *ppick;
struct thread *td, *tdpick;
const char *stateprefix, *state;
struct sbuf sb;
long rss;
-   int load, pctcpu, sterr;
+   int load, pctcpu;
pid_t pid;
char comm[MAXCOMLEN + 1];
struct rusage ru;
@@ -329,6 +334,7 @@ tty_info(struct tty *tp)
else
state = "unknown";
pctcpu = (sched_pctcpu(td) * 1 + FSCALE / 2) >> FSHIFT;
+#ifdef STACK
if (tty_info_kstacks) {
stack_zero();
if (TD_IS_SWAPPED(td) || TD_IS_RUNNING(td))
@@ -338,6 +344,7 @@ tty_info(struct tty *tp)
sterr = 0;
}
}
+#endif
thread_unlock(td);
if (p->p_state == PRS_NEW || p->p_state == PRS_ZOMBIE)
rss = 0;
@@ -359,8 +366,10 @@ tty_info(struct tty *tp)
(long)stime.tv_sec, stime.tv_usec / 1,
pctcpu / 100, rss);
 
+#ifdef STACK
if (tty_info_kstacks && sterr == 0)
stack_sbuf_print_flags(, , M_NOWAIT);
+#endif
 
 out:
sbuf_finish();
___
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: r339604 - stable/12/libexec/rc

2018-10-22 Thread Eugene Grosbein
Author: eugen
Date: Mon Oct 22 17:27:36 2018
New Revision: 339604
URL: https://svnweb.freebsd.org/changeset/base/339604

Log:
  MFC r339462: make upgrade from previous FreeBSD versions less painful
  and make previously working configuration like this work again:
  
  gif_interfaces="gif0"
  gifconfig_gif0="1.1.1.1 2.2.2.2"
  ifconfig_gif0="inet 192.168.1.1 192.168.1.2 netmask 255.255.255.252"
  
  PR:   204700
  Approved by:  re (gjb)

Modified:
  stable/12/libexec/rc/network.subr
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/libexec/rc/network.subr
==
--- stable/12/libexec/rc/network.subr   Mon Oct 22 17:19:48 2018
(r339603)
+++ stable/12/libexec/rc/network.subr   Mon Oct 22 17:27:36 2018
(r339604)
@@ -1393,7 +1393,7 @@ clone_up()
_list="$_list $ifn"
fi
tmpargs=$(get_if_var $ifn gifconfig_IF)
-   eval ifconfig_${ifn}=\"tunnel \$tmpargs\"
+   eval ifconfig_${ifn}=\"\$ifconfig_${ifn} tunnel \$tmpargs\"
done
if [ -n "${_list# }" ]; then
echo "Created clone interfaces: ${_list# }."
___
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: r339601 - head/sys/vm

2018-10-22 Thread Mark Johnston
On Mon, Oct 22, 2018 at 07:15:20PM +0200, O. Hartmann wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
> 
> Am Mon, 22 Oct 2018 17:04:05 + (UTC)
> Mark Johnston  schrieb:
> 
> > Author: markj
> > Date: Mon Oct 22 17:04:04 2018
> > New Revision: 339601
> > URL: https://svnweb.freebsd.org/changeset/base/339601
> > 
> > Log:
> >   Swap in processes unless there's a global memory shortage.
> >   
> >   On NUMA systems, we would not swap in processes unless all domains
> >   had some free pages.  This is too conservative in general.  Instead,
> >   permit swapins so long as at least one domain has free pages, and add
> >   a kernel stack NUMA policy which ensures that we will try to allocate
> >   kernel stack pages from any domain.
> >   
> >   Reported and tested by:   pho, Jan Bramkamp 
> >   Reviewed by:  alc, kib
> >   Discussed with:   jeff
> >   MFC after:3 days
> >   Sponsored by: The FreeBSD Foundation
> >   Differential Revision:https://reviews.freebsd.org/D17304
> > 
> > Modified:
> >   head/sys/vm/vm_glue.c
> >   head/sys/vm/vm_swapout.c
> > 
> This commit breaks CURRENT buildkernel:
> [...]
> - --- vm_glue.o ---
> /usr/src/sys/vm/vm_glue.c:380:17: error: no member named 'dr_iter' in 'struct
> domainset_ref'

Fixed, sorry for the breakage.
___
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: r339602 - head/sys/vm

2018-10-22 Thread Mark Johnston
Author: markj
Date: Mon Oct 22 17:17:30 2018
New Revision: 339602
URL: https://svnweb.freebsd.org/changeset/base/339602

Log:
  Avoid a redundancy in a comment updated by r339601.
  
  Reported by:  alc
  X-MFC with:   r339601

Modified:
  head/sys/vm/vm_swapout.c

Modified: head/sys/vm/vm_swapout.c
==
--- head/sys/vm/vm_swapout.cMon Oct 22 17:04:04 2018(r339601)
+++ head/sys/vm/vm_swapout.cMon Oct 22 17:17:30 2018(r339602)
@@ -742,8 +742,7 @@ swapper_selector(bool wkilled_only)
 /*
  * Limit swapper to swap in one non-WKILLED process in MAXSLP/2
  * interval, assuming that there is:
- * - there exists at least one domain that is not suffering from a shortage of
- *   free memory;
+ * - at least one domain that is not suffering from a shortage of free memory;
  * - no parallel swap-ins;
  * - no other swap-ins in the current SWAPIN_INTERVAL.
  */
___
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: r339603 - head/sys/vm

2018-10-22 Thread Mark Johnston
Author: markj
Date: Mon Oct 22 17:19:48 2018
New Revision: 339603
URL: https://svnweb.freebsd.org/changeset/base/339603

Log:
  Fix the build after r339601.
  
  I committed some patches out of order and didn't build-test one of them.
  
  Reported by:  Jenkins, O. Hartmann 
  X-MFC with:   r339601

Modified:
  head/sys/vm/vm_glue.c

Modified: head/sys/vm/vm_glue.c
==
--- head/sys/vm/vm_glue.c   Mon Oct 22 17:17:30 2018(r339602)
+++ head/sys/vm/vm_glue.c   Mon Oct 22 17:19:48 2018(r339603)
@@ -377,8 +377,8 @@ vm_thread_new(struct thread *td, int pages)
 */
if (vm_ndomains > 1) {
ksobj->domain.dr_policy = DOMAINSET_RR();
-   ksobj->domain.dr_iter = atomic_fetchadd_int(_domain_iter,
-   1);
+   ksobj->domain.dr_iterator =
+   atomic_fetchadd_int(_domain_iter, 1);
}
 
atomic_add_int(, 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"


Re: svn commit: r339601 - head/sys/vm

2018-10-22 Thread O. Hartmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Am Mon, 22 Oct 2018 17:04:05 + (UTC)
Mark Johnston  schrieb:

> Author: markj
> Date: Mon Oct 22 17:04:04 2018
> New Revision: 339601
> URL: https://svnweb.freebsd.org/changeset/base/339601
> 
> Log:
>   Swap in processes unless there's a global memory shortage.
>   
>   On NUMA systems, we would not swap in processes unless all domains
>   had some free pages.  This is too conservative in general.  Instead,
>   permit swapins so long as at least one domain has free pages, and add
>   a kernel stack NUMA policy which ensures that we will try to allocate
>   kernel stack pages from any domain.
>   
>   Reported and tested by: pho, Jan Bramkamp 
>   Reviewed by:alc, kib
>   Discussed with: jeff
>   MFC after:  3 days
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D17304
> 
> Modified:
>   head/sys/vm/vm_glue.c
>   head/sys/vm/vm_swapout.c
> 
> Modified: head/sys/vm/vm_glue.c
> ==
> --- head/sys/vm/vm_glue.c Mon Oct 22 16:21:50 2018(r339600)
> +++ head/sys/vm/vm_glue.c Mon Oct 22 17:04:04 2018(r339601)
> @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$");
>  
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -298,7 +299,7 @@ vm_sync_icache(vm_map_t map, vm_offset_t va, vm_offset
>  
>  struct kstack_cache_entry *kstack_cache;
>  static int kstack_cache_size = 128;
> -static int kstacks;
> +static int kstacks, kstack_domain_iter;
>  static struct mtx kstack_cache_mtx;
>  MTX_SYSINIT(kstack_cache, _cache_mtx, "kstkch", MTX_DEF);
>  
> @@ -367,6 +368,17 @@ vm_thread_new(struct thread *td, int pages)
>   printf("vm_thread_new: kstack allocation failed\n");
>   vm_object_deallocate(ksobj);
>   return (0);
> + }
> +
> + /*
> +  * Ensure that kstack objects can draw pages from any memory
> +  * domain.  Otherwise a local memory shortage can block a process
> +  * swap-in.
> +  */
> + if (vm_ndomains > 1) {
> + ksobj->domain.dr_policy = DOMAINSET_RR();
> + ksobj->domain.dr_iter = atomic_fetchadd_int(_domain_iter,
> + 1);
>   }
>  
>   atomic_add_int(, 1);
> 
> Modified: head/sys/vm/vm_swapout.c
> ==
> --- head/sys/vm/vm_swapout.c  Mon Oct 22 16:21:50 2018(r339600)
> +++ head/sys/vm/vm_swapout.c  Mon Oct 22 17:04:04 2018(r339601)
> @@ -742,7 +742,8 @@ swapper_selector(bool wkilled_only)
>  /*
>   * Limit swapper to swap in one non-WKILLED process in MAXSLP/2
>   * interval, assuming that there is:
> - * - no memory shortage;
> + * - there exists at least one domain that is not suffering from a shortage 
> of
> + *   free memory;
>   * - no parallel swap-ins;
>   * - no other swap-ins in the current SWAPIN_INTERVAL.
>   */
> @@ -750,7 +751,7 @@ static bool
>  swapper_wkilled_only(void)
>  {
>  
> - return (vm_page_count_min() || swap_inprogress > 0 ||
> + return (vm_page_count_min_set(_domains) || swap_inprogress > 0 ||
>   (u_int)(ticks - last_swapin) < SWAPIN_INTERVAL);
>  }
>  
> ___
> svn-src-h...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

This commit breaks CURRENT buildkernel:
[...]
- --- vm_glue.o ---
/usr/src/sys/vm/vm_glue.c:380:17: error: no member named 'dr_iter' in 'struct
domainset_ref'


Kind regards,

oh

- -- 
O. Hartmann

Ich widerspreche der Nutzung oder Übermittlung meiner Daten für
Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG).
-BEGIN PGP SIGNATURE-

iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCW84FwwAKCRDS528fyFhY
lMYGAf9h+vf8AI9JLGVUhUwwblt8GjAvrqRAcDw1Q6NG/I5xX8npX4OrXmrlzmpf
8VZ7n9fnnlZAD7e3/6MvgkfNMjPGAf96XTFAiTMSXTpQ84N5g2G03L5kAZaMaRKS
0mViZJlgQnjQaoV7089M0httbwXhz3oqGW+L0ZoZL5O5Rg9mDK/Y
=0PHK
-END PGP SIGNATURE-
___
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: r339601 - head/sys/vm

2018-10-22 Thread Mark Johnston
Author: markj
Date: Mon Oct 22 17:04:04 2018
New Revision: 339601
URL: https://svnweb.freebsd.org/changeset/base/339601

Log:
  Swap in processes unless there's a global memory shortage.
  
  On NUMA systems, we would not swap in processes unless all domains
  had some free pages.  This is too conservative in general.  Instead,
  permit swapins so long as at least one domain has free pages, and add
  a kernel stack NUMA policy which ensures that we will try to allocate
  kernel stack pages from any domain.
  
  Reported and tested by:   pho, Jan Bramkamp 
  Reviewed by:  alc, kib
  Discussed with:   jeff
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D17304

Modified:
  head/sys/vm/vm_glue.c
  head/sys/vm/vm_swapout.c

Modified: head/sys/vm/vm_glue.c
==
--- head/sys/vm/vm_glue.c   Mon Oct 22 16:21:50 2018(r339600)
+++ head/sys/vm/vm_glue.c   Mon Oct 22 17:04:04 2018(r339601)
@@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -298,7 +299,7 @@ vm_sync_icache(vm_map_t map, vm_offset_t va, vm_offset
 
 struct kstack_cache_entry *kstack_cache;
 static int kstack_cache_size = 128;
-static int kstacks;
+static int kstacks, kstack_domain_iter;
 static struct mtx kstack_cache_mtx;
 MTX_SYSINIT(kstack_cache, _cache_mtx, "kstkch", MTX_DEF);
 
@@ -367,6 +368,17 @@ vm_thread_new(struct thread *td, int pages)
printf("vm_thread_new: kstack allocation failed\n");
vm_object_deallocate(ksobj);
return (0);
+   }
+
+   /*
+* Ensure that kstack objects can draw pages from any memory
+* domain.  Otherwise a local memory shortage can block a process
+* swap-in.
+*/
+   if (vm_ndomains > 1) {
+   ksobj->domain.dr_policy = DOMAINSET_RR();
+   ksobj->domain.dr_iter = atomic_fetchadd_int(_domain_iter,
+   1);
}
 
atomic_add_int(, 1);

Modified: head/sys/vm/vm_swapout.c
==
--- head/sys/vm/vm_swapout.cMon Oct 22 16:21:50 2018(r339600)
+++ head/sys/vm/vm_swapout.cMon Oct 22 17:04:04 2018(r339601)
@@ -742,7 +742,8 @@ swapper_selector(bool wkilled_only)
 /*
  * Limit swapper to swap in one non-WKILLED process in MAXSLP/2
  * interval, assuming that there is:
- * - no memory shortage;
+ * - there exists at least one domain that is not suffering from a shortage of
+ *   free memory;
  * - no parallel swap-ins;
  * - no other swap-ins in the current SWAPIN_INTERVAL.
  */
@@ -750,7 +751,7 @@ static bool
 swapper_wkilled_only(void)
 {
 
-   return (vm_page_count_min() || swap_inprogress > 0 ||
+   return (vm_page_count_min_set(_domains) || swap_inprogress > 0 ||
(u_int)(ticks - last_swapin) < SWAPIN_INTERVAL);
 }
 
___
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: r339565 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf

2018-10-22 Thread Warner Losh
On Mon, Oct 22, 2018 at 9:52 AM Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:

> > On Sun, Oct 21, 2018 at 9:35 PM Warner Losh  wrote:
> >
> > > Author: imp
> > > Date: Mon Oct 22 02:34:25 2018
> > > New Revision: 339565
> > > URL: https://svnweb.freebsd.org/changeset/base/339565
> > >
> > > Log:
> > >   Remove aha(4) from the tree.
> > >
> > >
> > The documentation build is now failing, as there's an entity reference to
> > the autogenerated
> > hardware list, which does not exist anymore.  Will you be able to look at
> > those as part of your
> > removals or does someone from the doc team need to handle it?
>
> Please stop deprecaton processing until:
> 1) We have the new documented deprication policy
> 2) We have crafted a step by step deprication set
>of procedures so issues like this can be in it.
> 2) Release 12.0 is shipped.
>

These drivers have already been litigated and were previously tagged,
pursuant to community discussions, to be removed in 12. This is following
the process, such as we have. Committing these changes now means that we
could, if we wanted, MFC the changes. They were done carefully so they
could all be MFC'd or they could be MFC'd one at a time. ncr(4) was also
done w/o discussions today because it was deprecated in 1999, but its
removal was overlooked until now. The bottom line is that these were
properly removed in a time that was also proper to keep all our options
open.

I'm not going to stop the other deprecation activities. We're establishing
a process that's working well and we'll continue to use it. There were some
bumps with the NIC stuff which we've learned from and will incorporate into
further rounds (next up: other SCSI drivers with no users, and some
long-broken sound cards and PC Card (not CardBus)). While it would be nice
to write a generic policy, that's hard to get right w/o experience. So
Brooks and I are going to proceed with what we're doing (but plan no
further removals until after 12.0 is out) so we can develop that
experience. It's been a community discussion process so far, and will
continue to be one. Once we have a couple of successful rounds of
deprecation, we can look to formalizing the process that's working.

There will be no more removals before 12.0R since we're too early in the
process for all the others.

Warner
___
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: r339600 - head/sys/sys

2018-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Oct 22 16:21:50 2018
New Revision: 339600
URL: https://svnweb.freebsd.org/changeset/base/339600

Log:
  Make sure returned value is checked and assert a valid refcount.
  While at it fix a print: Unsigned types cannot be negative.
  
  Reviewed by:  kib, mjg
  Differential revision:https://reviews.freebsd.org/D17616
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/sys/refcount.h

Modified: head/sys/sys/refcount.h
==
--- head/sys/sys/refcount.h Mon Oct 22 16:16:42 2018(r339599)
+++ head/sys/sys/refcount.h Mon Oct 22 16:21:50 2018(r339600)
@@ -62,7 +62,7 @@ refcount_release(volatile u_int *count)
 
atomic_thread_fence_rel();
old = atomic_fetchadd_int(count, -1);
-   KASSERT(old > 0, ("negative refcount %p", count));
+   KASSERT(old > 0, ("refcount %p is zero", count));
if (old > 1)
return (0);
 
@@ -77,15 +77,19 @@ refcount_release(volatile u_int *count)
 }
 
 /*
+ * This functions returns non-zero if the refcount was
+ * incremented. Else zero is returned.
+ *
  * A temporary hack until refcount_* APIs are sorted out.
  */
-static __inline int
+static __inline __result_use_check int
 refcount_acquire_if_not_zero(volatile u_int *count)
 {
u_int old;
 
old = *count;
for (;;) {
+   KASSERT(old < UINT_MAX, ("refcount %p overflowed", count));
if (old == 0)
return (0);
if (atomic_fcmpset_int(count, , old + 1))
@@ -93,13 +97,14 @@ refcount_acquire_if_not_zero(volatile u_int *count)
}
 }
 
-static __inline int
+static __inline __result_use_check int
 refcount_release_if_not_last(volatile u_int *count)
 {
u_int old;
 
old = *count;
for (;;) {
+   KASSERT(old > 0, ("refcount %p is zero", count));
if (old == 1)
return (0);
if (atomic_fcmpset_int(count, , old - 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: r339599 - in head/sys: kern sys

2018-10-22 Thread Mark Johnston
Author: markj
Date: Mon Oct 22 16:16:42 2018
New Revision: 339599
URL: https://svnweb.freebsd.org/changeset/base/339599

Log:
  Don't import 0 into vmem quantum caches.
  
  vmem uses UMA cache zones to implement the quantum cache.  Since
  uma_zalloc() returns 0 (NULL) to signal an allocation failure, UMA
  should not be used to cache resource 0.  Fix this by ensuring that 0 is
  never cached in UMA in the first place, and by modifying vmem_alloc()
  to fall back to a search of the free lists if the cache is depleted,
  rather than blocking in qc_import().
  
  Reported by and discussed with:   Brett Gutstein 
  Reviewed by:  alc
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D17483

Modified:
  head/sys/kern/subr_vmem.c
  head/sys/sys/vmem.h

Modified: head/sys/kern/subr_vmem.c
==
--- head/sys/kern/subr_vmem.c   Mon Oct 22 16:09:01 2018(r339598)
+++ head/sys/kern/subr_vmem.c   Mon Oct 22 16:16:42 2018(r339599)
@@ -504,6 +504,9 @@ bt_insfree(vmem_t *vm, bt_t *bt)
 
 /*
  * Import from the arena into the quantum cache in UMA.
+ *
+ * We use VMEM_ADDR_QCACHE_MIN instead of 0: uma_zalloc() returns 0 to indicate
+ * failure, so UMA can't be used to cache a resource with value 0.
  */
 static int
 qc_import(void *arg, void **store, int cnt, int domain, int flags)
@@ -512,19 +515,16 @@ qc_import(void *arg, void **store, int cnt, int domain
vmem_addr_t addr;
int i;
 
+   KASSERT((flags & M_WAITOK) == 0, ("blocking allocation"));
+
qc = arg;
-   if ((flags & VMEM_FITMASK) == 0)
-   flags |= M_BESTFIT;
for (i = 0; i < cnt; i++) {
if (vmem_xalloc(qc->qc_vmem, qc->qc_size, 0, 0, 0,
-   VMEM_ADDR_MIN, VMEM_ADDR_MAX, flags, ) != 0)
+   VMEM_ADDR_QCACHE_MIN, VMEM_ADDR_MAX, flags, ) != 0)
break;
store[i] = (void *)addr;
-   /* Only guarantee one allocation. */
-   flags &= ~M_WAITOK;
-   flags |= M_NOWAIT;
}
-   return i;
+   return (i);
 }
 
 /*
@@ -1123,15 +1123,20 @@ vmem_alloc(vmem_t *vm, vmem_size_t size, int flags, vm
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "vmem_alloc");
 
if (size <= vm->vm_qcache_max) {
+   /*
+* Resource 0 cannot be cached, so avoid a blocking allocation
+* in qc_import() and give the vmem_xalloc() call below a chance
+* to return 0.
+*/
qc = >vm_qcache[(size - 1) >> vm->vm_quantum_shift];
-   *addrp = (vmem_addr_t)uma_zalloc(qc->qc_cache, flags);
-   if (*addrp == 0)
-   return (ENOMEM);
-   return (0);
+   *addrp = (vmem_addr_t)uma_zalloc(qc->qc_cache,
+   (flags & ~M_WAITOK) | M_NOWAIT);
+   if (__predict_true(*addrp != 0))
+   return (0);
}
 
-   return vmem_xalloc(vm, size, 0, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX,
-   flags, addrp);
+   return (vmem_xalloc(vm, size, 0, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX,
+   flags, addrp));
 }
 
 int
@@ -1263,7 +1268,8 @@ vmem_free(vmem_t *vm, vmem_addr_t addr, vmem_size_t si
qcache_t *qc;
MPASS(size > 0);
 
-   if (size <= vm->vm_qcache_max) {
+   if (size <= vm->vm_qcache_max &&
+   __predict_true(addr >= VMEM_ADDR_QCACHE_MIN)) {
qc = >vm_qcache[(size - 1) >> vm->vm_quantum_shift];
uma_zfree(qc->qc_cache, (void *)addr);
} else

Modified: head/sys/sys/vmem.h
==
--- head/sys/sys/vmem.h Mon Oct 22 16:09:01 2018(r339598)
+++ head/sys/sys/vmem.h Mon Oct 22 16:16:42 2018(r339599)
@@ -41,8 +41,9 @@ typedef struct vmem vmem_t;
 typedef uintptr_t  vmem_addr_t;
 typedef size_t vmem_size_t;
 
-#defineVMEM_ADDR_MIN   0
-#defineVMEM_ADDR_MAX   (~(vmem_addr_t)0)
+#defineVMEM_ADDR_MIN   0
+#defineVMEM_ADDR_QCACHE_MIN1
+#defineVMEM_ADDR_MAX   (~(vmem_addr_t)0)
 
 typedef int (vmem_import_t)(void *, vmem_size_t, int, vmem_addr_t *);
 typedef void (vmem_release_t)(void *, vmem_addr_t, vmem_size_t);
___
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: r339598 - head/sys/netinet6

2018-10-22 Thread Mark Johnston
Author: markj
Date: Mon Oct 22 16:09:01 2018
New Revision: 339598
URL: https://svnweb.freebsd.org/changeset/base/339598

Log:
  Fix style bugs in in6_pcblookup_lbgroup().
  
  This should have been a part of r338470.  No functional changes
  intended.
  
  Reported by:  gallatin
  Reviewed by:  gallatin, Johannes Lundberg 
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D17109

Modified:
  head/sys/netinet6/in6_pcb.c

Modified: head/sys/netinet6/in6_pcb.c
==
--- head/sys/netinet6/in6_pcb.c Mon Oct 22 15:54:28 2018(r339597)
+++ head/sys/netinet6/in6_pcb.c Mon Oct 22 16:09:01 2018(r339598)
@@ -873,10 +873,9 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo,
 const struct in6_addr *laddr, uint16_t lport, const struct in6_addr *faddr,
 uint16_t fport, int lookupflags)
 {
-   struct inpcb *local_wild = NULL;
+   struct inpcb *local_wild;
const struct inpcblbgrouphead *hdr;
struct inpcblbgroup *grp;
-   struct inpcblbgroup *grp_local_wild;
uint32_t idx;
 
INP_HASH_LOCK_ASSERT(pcbinfo);
@@ -893,33 +892,24 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo,
 * - Load balanced group does not contain jailed sockets.
 * - Load balanced does not contain IPv4 mapped INET6 wild sockets.
 */
+   local_wild = NULL;
CK_LIST_FOREACH(grp, hdr, il_list) {
 #ifdef INET
if (!(grp->il_vflag & INP_IPV6))
continue;
 #endif
-   if (grp->il_lport == lport) {
-   idx = 0;
-   int pkt_hash = INP_PCBLBGROUP_PKTHASH(
-   INP6_PCBHASHKEY(faddr), lport, fport);
+   if (grp->il_lport != lport)
+   continue;
 
-   idx = pkt_hash % grp->il_inpcnt;
-
-   if (IN6_ARE_ADDR_EQUAL(>il6_laddr, laddr)) {
-   return (grp->il_inp[idx]);
-   } else {
-   if (IN6_IS_ADDR_UNSPECIFIED(>il6_laddr) &&
-   (lookupflags & INPLOOKUP_WILDCARD)) {
-   local_wild = grp->il_inp[idx];
-   grp_local_wild = grp;
-   }
-   }
-   }
+   idx = INP_PCBLBGROUP_PKTHASH(INP6_PCBHASHKEY(faddr), lport,
+   fport) % grp->il_inpcnt;
+   if (IN6_ARE_ADDR_EQUAL(>il6_laddr, laddr))
+   return (grp->il_inp[idx]);
+   if (IN6_IS_ADDR_UNSPECIFIED(>il6_laddr) &&
+   (lookupflags & INPLOOKUP_WILDCARD) != 0)
+   local_wild = grp->il_inp[idx];
}
-   if (local_wild != NULL) {
-   return (local_wild);
-   }
-   return (NULL);
+   return (local_wild);
 }
 
 #ifdef PCBGROUP
___
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: r339570 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ncv sys/i386/conf sys/modules sys/modules/ncv

2018-10-22 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Mon, Oct 22, 2018 at 9:45 AM Rodney W. Grimes <
> free...@pdx.rh.cn85.dnsmgr.net> wrote:
> 
> > > Author: imp
> > > Date: Mon Oct 22 02:35:26 2018
> > > New Revision: 339570
> > > URL: https://svnweb.freebsd.org/changeset/base/339570
> > >
> > > Log:
> > >   Remove ncv(4) driver
> > >
> > >   ncv(4) is marked as gone in 12. Remove it. There are no sightings of
> > >   it in the nycbug dmesg database. It was for an obscure SCSI card that
> > >   sold mostly in Japan, and was especially popilar among pc98 hackers in
> > >   the 4.x time frame..
> > >
> > >   Relnote: Yes
> >
> > I would of liked to delay these until post 12.0 release production
> > incase there are any release cycle fixes that need to be MFC'ed to
> > fix the 12.0 release, but done is done and we shall just have to
> > deal with that by direct commit or other means.
> >
> 
> I did these because they were marked as going away in 12, and this would
> allow us to MFC them if we wanted before 12.0R.

Um, ok I may need to recant some of my wanting the 3 things
done before we process any more of this if infact your
still wanting to get all of this deprication merged and
into 12.0R

I see gjb@ has fixed the doc build issue already.

> Warner
> 
> 
> > > Deleted:
> > >   head/share/man/man4/ncv.4
> > >   head/sys/dev/ncv/ncr53c500.c
> > >   head/sys/dev/ncv/ncr53c500_pccard.c
> > >   head/sys/dev/ncv/ncr53c500hw.h
> > >   head/sys/dev/ncv/ncr53c500hwtab.h
> > >   head/sys/dev/ncv/ncr53c500reg.h
> > >   head/sys/dev/ncv/ncr53c500var.h
> > >   head/sys/modules/ncv/Makefile
> > > Modified:
> > >   head/share/man/man4/Makefile
> > >   head/sys/amd64/conf/NOTES
> > >   head/sys/conf/files
> > >   head/sys/i386/conf/NOTES
> > >   head/sys/modules/Makefile
> > >
> > > Modified: head/share/man/man4/Makefile
> > >
> > ==
> > > --- head/share/man/man4/Makefile  Mon Oct 22 02:35:12 2018
> > (r339569)
> > > +++ head/share/man/man4/Makefile  Mon Oct 22 02:35:26 2018
> > (r339570)
> > > @@ -305,7 +305,6 @@ MAN=  aac.4 \
> > >   nand.4 \
> > >   nandsim.4 \
> > >   ncr.4 \
> > > - ncv.4 \
> > >   ${_ndis.4} \
> > >   net80211.4 \
> > >   netdump.4 \
> > >
> > > Modified: head/sys/amd64/conf/NOTES
> > >
> > ==
> > > --- head/sys/amd64/conf/NOTES Mon Oct 22 02:35:12 2018(r339569)
> > > +++ head/sys/amd64/conf/NOTES Mon Oct 22 02:35:26 2018(r339570)
> > > @@ -428,11 +428,9 @@ device   twa # 3ware
> > 9000 series PATA/SATA RAID
> > >  #
> > >  # SCSI host adapters:
> > >  #
> > > -# ncv: NCR 53C500 based SCSI host adapters.
> > >  # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters.
> > >  # stg: TMC 18C30, 18C50 based SCSI host adapters.
> > >
> > > -device   ncv
> > >  device   nsp
> > >  device   stg
> > >
> > >
> > > Modified: head/sys/conf/files
> > >
> > ==
> > > --- head/sys/conf/files   Mon Oct 22 02:35:12 2018(r339569)
> > > +++ head/sys/conf/files   Mon Oct 22 02:35:26 2018(r339570)
> > > @@ -113,7 +113,7 @@ cam/ctl/scsi_ctl.coptional ctl
> > >  cam/mmc/mmc_xpt.coptional scbus mmccam
> > >  cam/mmc/mmc_da.c optional scbus mmccam da
> > >  cam/scsi/scsi_da.c   optional da
> > > -cam/scsi/scsi_low.c  optional ncv | nsp | stg
> > > +cam/scsi/scsi_low.c  optional nsp | stg
> > >  cam/scsi/scsi_pass.c optional pass
> > >  cam/scsi/scsi_pt.c   optional pt
> > >  cam/scsi/scsi_sa.c   optional sa
> > > @@ -2511,8 +2511,6 @@ dev/nand/nandsim_log.c  optional nandsim
> > nand
> > >  dev/nand/nandsim_swap.c  optional nandsim nand
> > >  dev/nand/nfc_if.moptional nand
> > >  dev/ncr/ncr.coptional ncr pci
> > > -dev/ncv/ncr53c500.c  optional ncv
> > > -dev/ncv/ncr53c500_pccard.c   optional ncv pccard
> > >  dev/netmap/if_ptnet.coptional netmap inet
> > >  dev/netmap/netmap.c  optional netmap
> > >  dev/netmap/netmap_freebsd.c  optional netmap
> > >
> > > Modified: head/sys/i386/conf/NOTES
> > >
> > ==
> > > --- head/sys/i386/conf/NOTES  Mon Oct 22 02:35:12 2018(r339569)
> > > +++ head/sys/i386/conf/NOTES  Mon Oct 22 02:35:26 2018(r339570)
> > > @@ -659,11 +659,9 @@ device   twa # 3ware
> > 9000 series PATA/SATA RAID
> > >  #
> > >  # SCSI host adapters:
> > >  #
> > > -# ncv: NCR 53C500 based SCSI host adapters.
> > >  # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters.
> > >  # stg: TMC 18C30, 18C50 based SCSI host adapters.
> > >
> > > -device

svn commit: r339597 - stable/11/sys/contrib/ck/include

2018-10-22 Thread Andriy Gapon
Author: avg
Date: Mon Oct 22 15:54:28 2018
New Revision: 339597
URL: https://svnweb.freebsd.org/changeset/base/339597

Log:
  MFC r334189: Import CK as of commit 0f017230ccc86929f56bf44ef2dca93d7df8076b
  
  This brings us the renaming of fields in ck_queue, so that our own
  LIST/SLIST/TAILQ/etc won't accidentally work with them.

Modified:
  stable/11/sys/contrib/ck/include/ck_queue.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/contrib/ck/include/ck_queue.h
==
--- stable/11/sys/contrib/ck/include/ck_queue.h Mon Oct 22 15:48:07 2018
(r339596)
+++ stable/11/sys/contrib/ck/include/ck_queue.h Mon Oct 22 15:54:28 2018
(r339597)
@@ -125,7 +125,7 @@
  */
 #defineCK_SLIST_HEAD(name, type)   
\
 struct name {  
\
-   struct type *slh_first; /* first element */ 
\
+   struct type *cslh_first;/* first element */ 
\
 }
 
 #defineCK_SLIST_HEAD_INITIALIZER(head) 
\
@@ -133,20 +133,20 @@ struct name { 
\
 
 #defineCK_SLIST_ENTRY(type)
\
 struct {   
\
-   struct type *sle_next;  /* next element */  
\
+   struct type *csle_next; /* next element */  
\
 }
 
 /*
  * Singly-linked List functions.
  */
 #defineCK_SLIST_EMPTY(head)
\
-   (ck_pr_load_ptr(&(head)->slh_first) == NULL)
+   (ck_pr_load_ptr(&(head)->cslh_first) == NULL)
 
 #defineCK_SLIST_FIRST(head)
\
-   (ck_pr_load_ptr(&(head)->slh_first))
+   (ck_pr_load_ptr(&(head)->cslh_first))
 
 #defineCK_SLIST_NEXT(elm, field)   
\
-   ck_pr_load_ptr(&((elm)->field.sle_next))
+   ck_pr_load_ptr(&((elm)->field.csle_next))
 
 #defineCK_SLIST_FOREACH(var, head, field)  
\
for ((var) = CK_SLIST_FIRST((head));
\
@@ -159,59 +159,59 @@ struct {  
\
(var) = (tvar))
 
 #defineCK_SLIST_FOREACH_PREVPTR(var, varp, head, field)
\
-   for ((varp) = &(head)->slh_first;   
\
+   for ((varp) = &(head)->cslh_first;  
\
((var) = ck_pr_load_ptr(varp)) != NULL && (ck_pr_fence_load(), 1);  
\
-   (varp) = &(var)->field.sle_next)
+   (varp) = &(var)->field.csle_next)
 
 #defineCK_SLIST_INIT(head) do {
\
-   ck_pr_store_ptr(&(head)->slh_first, NULL);  
\
+   ck_pr_store_ptr(&(head)->cslh_first, NULL); 
\
ck_pr_fence_store();
\
 } while (0)
 
 #defineCK_SLIST_INSERT_AFTER(a, b, field) do { 
\
-   (b)->field.sle_next = (a)->field.sle_next;  
\
+   (b)->field.csle_next = (a)->field.csle_next;
\
ck_pr_fence_store();
\
-   ck_pr_store_ptr(&(a)->field.sle_next, b);   
\
+   ck_pr_store_ptr(&(a)->field.csle_next, b);  
\
 } while (0)
 
 #defineCK_SLIST_INSERT_HEAD(head, elm, field) do { 
\
-   (elm)->field.sle_next = (head)->slh_first;  
\
+   (elm)->field.csle_next = (head)->cslh_first;
\
ck_pr_fence_store();
\
-   ck_pr_store_ptr(&(head)->slh_first, elm);   
\
+   ck_pr_store_ptr(&(head)->cslh_first, elm);  
\
 } while (0)
 
 #define CK_SLIST_REMOVE_AFTER(elm, field) do { 
\
-   ck_pr_store_ptr(&(elm)->field.sle_next, 
\
-   (elm)->field.sle_next->field.sle_next); 
\
+   ck_pr_store_ptr(&(elm)->field.csle_next,
\
+   (elm)->field.csle_next->field.csle_next);   
\
 } while (0)
 
 #defineCK_SLIST_REMOVE(head, elm, type, field) do {
\
-   if ((head)->slh_first == 

Re: svn commit: r339565 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf

2018-10-22 Thread Rodney W. Grimes
> On Sun, Oct 21, 2018 at 9:35 PM Warner Losh  wrote:
> 
> > Author: imp
> > Date: Mon Oct 22 02:34:25 2018
> > New Revision: 339565
> > URL: https://svnweb.freebsd.org/changeset/base/339565
> >
> > Log:
> >   Remove aha(4) from the tree.
> >
> >
> The documentation build is now failing, as there's an entity reference to
> the autogenerated
> hardware list, which does not exist anymore.  Will you be able to look at
> those as part of your
> removals or does someone from the doc team need to handle it?

Please stop deprecaton processing until:
1) We have the new documented deprication policy
2) We have crafted a step by step deprication set
   of procedures so issues like this can be in it.
2) Release 12.0 is shipped.


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


Re: svn commit: r339570 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ncv sys/i386/conf sys/modules sys/modules/ncv

2018-10-22 Thread Warner Losh
On Mon, Oct 22, 2018 at 9:45 AM Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:

> > Author: imp
> > Date: Mon Oct 22 02:35:26 2018
> > New Revision: 339570
> > URL: https://svnweb.freebsd.org/changeset/base/339570
> >
> > Log:
> >   Remove ncv(4) driver
> >
> >   ncv(4) is marked as gone in 12. Remove it. There are no sightings of
> >   it in the nycbug dmesg database. It was for an obscure SCSI card that
> >   sold mostly in Japan, and was especially popilar among pc98 hackers in
> >   the 4.x time frame..
> >
> >   Relnote: Yes
>
> I would of liked to delay these until post 12.0 release production
> incase there are any release cycle fixes that need to be MFC'ed to
> fix the 12.0 release, but done is done and we shall just have to
> deal with that by direct commit or other means.
>

I did these because they were marked as going away in 12, and this would
allow us to MFC them if we wanted before 12.0R.

Warner


> > Deleted:
> >   head/share/man/man4/ncv.4
> >   head/sys/dev/ncv/ncr53c500.c
> >   head/sys/dev/ncv/ncr53c500_pccard.c
> >   head/sys/dev/ncv/ncr53c500hw.h
> >   head/sys/dev/ncv/ncr53c500hwtab.h
> >   head/sys/dev/ncv/ncr53c500reg.h
> >   head/sys/dev/ncv/ncr53c500var.h
> >   head/sys/modules/ncv/Makefile
> > Modified:
> >   head/share/man/man4/Makefile
> >   head/sys/amd64/conf/NOTES
> >   head/sys/conf/files
> >   head/sys/i386/conf/NOTES
> >   head/sys/modules/Makefile
> >
> > Modified: head/share/man/man4/Makefile
> >
> ==
> > --- head/share/man/man4/Makefile  Mon Oct 22 02:35:12 2018
> (r339569)
> > +++ head/share/man/man4/Makefile  Mon Oct 22 02:35:26 2018
> (r339570)
> > @@ -305,7 +305,6 @@ MAN=  aac.4 \
> >   nand.4 \
> >   nandsim.4 \
> >   ncr.4 \
> > - ncv.4 \
> >   ${_ndis.4} \
> >   net80211.4 \
> >   netdump.4 \
> >
> > Modified: head/sys/amd64/conf/NOTES
> >
> ==
> > --- head/sys/amd64/conf/NOTES Mon Oct 22 02:35:12 2018(r339569)
> > +++ head/sys/amd64/conf/NOTES Mon Oct 22 02:35:26 2018(r339570)
> > @@ -428,11 +428,9 @@ device   twa # 3ware
> 9000 series PATA/SATA RAID
> >  #
> >  # SCSI host adapters:
> >  #
> > -# ncv: NCR 53C500 based SCSI host adapters.
> >  # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters.
> >  # stg: TMC 18C30, 18C50 based SCSI host adapters.
> >
> > -device   ncv
> >  device   nsp
> >  device   stg
> >
> >
> > Modified: head/sys/conf/files
> >
> ==
> > --- head/sys/conf/files   Mon Oct 22 02:35:12 2018(r339569)
> > +++ head/sys/conf/files   Mon Oct 22 02:35:26 2018(r339570)
> > @@ -113,7 +113,7 @@ cam/ctl/scsi_ctl.coptional ctl
> >  cam/mmc/mmc_xpt.coptional scbus mmccam
> >  cam/mmc/mmc_da.c optional scbus mmccam da
> >  cam/scsi/scsi_da.c   optional da
> > -cam/scsi/scsi_low.c  optional ncv | nsp | stg
> > +cam/scsi/scsi_low.c  optional nsp | stg
> >  cam/scsi/scsi_pass.c optional pass
> >  cam/scsi/scsi_pt.c   optional pt
> >  cam/scsi/scsi_sa.c   optional sa
> > @@ -2511,8 +2511,6 @@ dev/nand/nandsim_log.c  optional nandsim
> nand
> >  dev/nand/nandsim_swap.c  optional nandsim nand
> >  dev/nand/nfc_if.moptional nand
> >  dev/ncr/ncr.coptional ncr pci
> > -dev/ncv/ncr53c500.c  optional ncv
> > -dev/ncv/ncr53c500_pccard.c   optional ncv pccard
> >  dev/netmap/if_ptnet.coptional netmap inet
> >  dev/netmap/netmap.c  optional netmap
> >  dev/netmap/netmap_freebsd.c  optional netmap
> >
> > Modified: head/sys/i386/conf/NOTES
> >
> ==
> > --- head/sys/i386/conf/NOTES  Mon Oct 22 02:35:12 2018(r339569)
> > +++ head/sys/i386/conf/NOTES  Mon Oct 22 02:35:26 2018(r339570)
> > @@ -659,11 +659,9 @@ device   twa # 3ware
> 9000 series PATA/SATA RAID
> >  #
> >  # SCSI host adapters:
> >  #
> > -# ncv: NCR 53C500 based SCSI host adapters.
> >  # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters.
> >  # stg: TMC 18C30, 18C50 based SCSI host adapters.
> >
> > -device   ncv
> >  device   nsp
> >  device   stg
> >  hint.stg.0.at="isa"
> >
> > Modified: head/sys/modules/Makefile
> >
> ==
> > --- head/sys/modules/Makefile Mon Oct 22 02:35:12 2018(r339569)
> > +++ head/sys/modules/Makefile Mon Oct 22 02:35:26 2018(r339570)
> > @@ -268,7 +268,6 @@ SUBDIR=   \
> >   ${_nandsim} \
> >   ${_ncr} \
> >   ${_nctgpio} \
> > - ${_ncv} \
> >   

svn commit: r339596 - head/sys/vm

2018-10-22 Thread Gleb Smirnoff
Author: glebius
Date: Mon Oct 22 15:48:07 2018
New Revision: 339596
URL: https://svnweb.freebsd.org/changeset/base/339596

Log:
  If we lost race or were migrated during bucket allocation for the per-CPU
  cache, then we put new bucket on generic bucket cache. However, code didn't
  honor UMA_ZONE_NOBUCKETCACHE flag, so potentially we could start a cache
  on a zone that clearly forbids that. Fix this.
  
  Reviewed by:  markj

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Mon Oct 22 15:33:05 2018(r339595)
+++ head/sys/vm/uma_core.c  Mon Oct 22 15:48:07 2018(r339596)
@@ -2410,6 +2410,7 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags
 * the current cache; when we re-acquire the critical section, we
 * must detect and handle migration if it has occurred.
 */
+zalloc_restart:
critical_enter();
cpu = curcpu;
cache = >uz_cpu[cpu];
@@ -2551,12 +2552,18 @@ zalloc_start:
 * initialized bucket to make this less likely or claim
 * the memory directly.
 */
-   if (cache->uc_allocbucket != NULL ||
-   (zone->uz_flags & UMA_ZONE_NUMA &&
-   domain != PCPU_GET(domain)))
-   LIST_INSERT_HEAD(>uzd_buckets, bucket, ub_link);
-   else
+   if (cache->uc_allocbucket == NULL &&
+   ((zone->uz_flags & UMA_ZONE_NUMA) == 0 ||
+   domain == PCPU_GET(domain))) {
cache->uc_allocbucket = bucket;
+   } else if ((zone->uz_flags & UMA_ZONE_NOBUCKETCACHE) != 0) {
+   critical_exit();
+   ZONE_UNLOCK(zone);
+   bucket_drain(zone, bucket);
+   bucket_free(zone, bucket, udata);
+   goto zalloc_restart;
+   } else
+   LIST_INSERT_HEAD(>uzd_buckets, bucket, ub_link);
ZONE_UNLOCK(zone);
goto zalloc_start;
}
___
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: r339570 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ncv sys/i386/conf sys/modules sys/modules/ncv

2018-10-22 Thread Rodney W. Grimes
> Author: imp
> Date: Mon Oct 22 02:35:26 2018
> New Revision: 339570
> URL: https://svnweb.freebsd.org/changeset/base/339570
> 
> Log:
>   Remove ncv(4) driver
>   
>   ncv(4) is marked as gone in 12. Remove it. There are no sightings of
>   it in the nycbug dmesg database. It was for an obscure SCSI card that
>   sold mostly in Japan, and was especially popilar among pc98 hackers in
>   the 4.x time frame..
>   
>   Relnote: Yes

I would of liked to delay these until post 12.0 release production
incase there are any release cycle fixes that need to be MFC'ed to
fix the 12.0 release, but done is done and we shall just have to
deal with that by direct commit or other means.

> Deleted:
>   head/share/man/man4/ncv.4
>   head/sys/dev/ncv/ncr53c500.c
>   head/sys/dev/ncv/ncr53c500_pccard.c
>   head/sys/dev/ncv/ncr53c500hw.h
>   head/sys/dev/ncv/ncr53c500hwtab.h
>   head/sys/dev/ncv/ncr53c500reg.h
>   head/sys/dev/ncv/ncr53c500var.h
>   head/sys/modules/ncv/Makefile
> Modified:
>   head/share/man/man4/Makefile
>   head/sys/amd64/conf/NOTES
>   head/sys/conf/files
>   head/sys/i386/conf/NOTES
>   head/sys/modules/Makefile
> 
> Modified: head/share/man/man4/Makefile
> ==
> --- head/share/man/man4/Makefile  Mon Oct 22 02:35:12 2018
> (r339569)
> +++ head/share/man/man4/Makefile  Mon Oct 22 02:35:26 2018
> (r339570)
> @@ -305,7 +305,6 @@ MAN=  aac.4 \
>   nand.4 \
>   nandsim.4 \
>   ncr.4 \
> - ncv.4 \
>   ${_ndis.4} \
>   net80211.4 \
>   netdump.4 \
> 
> Modified: head/sys/amd64/conf/NOTES
> ==
> --- head/sys/amd64/conf/NOTES Mon Oct 22 02:35:12 2018(r339569)
> +++ head/sys/amd64/conf/NOTES Mon Oct 22 02:35:26 2018(r339570)
> @@ -428,11 +428,9 @@ device   twa # 3ware 9000 
> series PATA/SATA RAID
>  #
>  # SCSI host adapters:
>  #
> -# ncv: NCR 53C500 based SCSI host adapters.
>  # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters.
>  # stg: TMC 18C30, 18C50 based SCSI host adapters.
>  
> -device   ncv
>  device   nsp
>  device   stg
>  
> 
> Modified: head/sys/conf/files
> ==
> --- head/sys/conf/files   Mon Oct 22 02:35:12 2018(r339569)
> +++ head/sys/conf/files   Mon Oct 22 02:35:26 2018(r339570)
> @@ -113,7 +113,7 @@ cam/ctl/scsi_ctl.coptional ctl
>  cam/mmc/mmc_xpt.coptional scbus mmccam
>  cam/mmc/mmc_da.c optional scbus mmccam da
>  cam/scsi/scsi_da.c   optional da
> -cam/scsi/scsi_low.c  optional ncv | nsp | stg
> +cam/scsi/scsi_low.c  optional nsp | stg
>  cam/scsi/scsi_pass.c optional pass
>  cam/scsi/scsi_pt.c   optional pt
>  cam/scsi/scsi_sa.c   optional sa
> @@ -2511,8 +2511,6 @@ dev/nand/nandsim_log.c  optional nandsim nand
>  dev/nand/nandsim_swap.c  optional nandsim nand
>  dev/nand/nfc_if.moptional nand
>  dev/ncr/ncr.coptional ncr pci
> -dev/ncv/ncr53c500.c  optional ncv
> -dev/ncv/ncr53c500_pccard.c   optional ncv pccard
>  dev/netmap/if_ptnet.coptional netmap inet
>  dev/netmap/netmap.c  optional netmap
>  dev/netmap/netmap_freebsd.c  optional netmap
> 
> Modified: head/sys/i386/conf/NOTES
> ==
> --- head/sys/i386/conf/NOTES  Mon Oct 22 02:35:12 2018(r339569)
> +++ head/sys/i386/conf/NOTES  Mon Oct 22 02:35:26 2018(r339570)
> @@ -659,11 +659,9 @@ device   twa # 3ware 9000 
> series PATA/SATA RAID
>  #
>  # SCSI host adapters:
>  #
> -# ncv: NCR 53C500 based SCSI host adapters.
>  # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters.
>  # stg: TMC 18C30, 18C50 based SCSI host adapters.
>  
> -device   ncv
>  device   nsp
>  device   stg
>  hint.stg.0.at="isa"
> 
> Modified: head/sys/modules/Makefile
> ==
> --- head/sys/modules/Makefile Mon Oct 22 02:35:12 2018(r339569)
> +++ head/sys/modules/Makefile Mon Oct 22 02:35:26 2018(r339570)
> @@ -268,7 +268,6 @@ SUBDIR=   \
>   ${_nandsim} \
>   ${_ncr} \
>   ${_nctgpio} \
> - ${_ncv} \
>   ${_ndis} \
>   ${_netgraph} \
>   ${_nfe} \
> @@ -757,7 +756,6 @@ _glxiic=  glxiic
>  _glxsb=  glxsb
>  #_ibcs2= ibcs2
>  _ncr=ncr
> -_ncv=ncv
>  _nsp=nsp
>  _pcfclock=   pcfclock
>  _pst=pst
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___

Re: svn commit: r339561 - head/sys/crypto/chacha20

2018-10-22 Thread Rodney W. Grimes
> Author: cem
> Date: Mon Oct 22 01:27:11 2018
> New Revision: 339561
> URL: https://svnweb.freebsd.org/changeset/base/339561
> 
> Log:
>   Add explicit copyright text to trivial header
>   
>   Reported by:rgrimes

Thank you.

> Modified:
>   head/sys/crypto/chacha20/_chacha.h
> 
> Modified: head/sys/crypto/chacha20/_chacha.h
> ==
> --- head/sys/crypto/chacha20/_chacha.hMon Oct 22 00:27:37 2018
> (r339560)
> +++ head/sys/crypto/chacha20/_chacha.hMon Oct 22 01:27:11 2018
> (r339561)
> @@ -1,4 +1,7 @@
>  /* $FreeBSD$ */
> +/*
> + * Public domain.
> + */
>  
>  #ifndef _CHACHA_H
>  #define _CHACHA_H
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
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: r339595 - head/sys/fs/nfsserver

2018-10-22 Thread Andriy Gapon
Author: avg
Date: Mon Oct 22 15:33:05 2018
New Revision: 339595
URL: https://svnweb.freebsd.org/changeset/base/339595

Log:
  nfsrvd_readdirplus: for some errors, do not fail the entire request
  
  Instead, a failing entry is skipped.
  This change consist of two logical changes.
  
  A failure to vget or lookup an entry is considered to be a result of a
  concurrent removal, which is the only reasonable explanation given that
  the filesystem is busied.  So, the entry would be silently skipped.
  
  In the case of a failure to get attributes of an entry for an NFSv3
  request, the entry would be silently skipped.  There can be legitimate
  reasons for the failure, but NFSv3 does not provide any means to report
  the error, so we have two options: either fail the whole request or
  ignore the failed entry.  Traditionally, the old NFS server used the
  latter option, so the code is reverted to it.  Making the whole
  directory unreadable because of a single entry seems to be unpractical.
  
  Additionally, some bits of code are slightly re-arranged to account for
  the new control flow and to honor style(9).
  
  Reviewed by:  rmacklem
  Sponsored by: Panzura
  Differential Revision: https://reviews.freebsd.org/D15424

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cMon Oct 22 15:18:49 2018
(r339594)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cMon Oct 22 15:33:05 2018
(r339595)
@@ -2416,10 +2416,22 @@ again:
}
}
}
-   if (!r) {
-   if (refp == NULL &&
-   ((nd->nd_flag & ND_NFSV3) ||
-NFSNONZERO_ATTRBIT())) {
+
+   /*
+* If we failed to look up the entry, then it
+* has become invalid, most likely removed.
+*/
+   if (r != 0) {
+   if (needs_unbusy)
+   vfs_unbusy(new_mp);
+   goto invalid;
+   }
+   KASSERT(refp != NULL || nvp != NULL,
+   ("%s: undetected lookup error", __func__));
+
+   if (refp == NULL &&
+   ((nd->nd_flag & ND_NFSV3) ||
+NFSNONZERO_ATTRBIT())) {
r = nfsvno_getfh(nvp, , p);
if (!r)
r = nfsvno_getattr(nvp, nvap, nd, p,
@@ -2440,17 +2452,25 @@ again:
if (new_mp == mp)
new_mp = nvp->v_mount;
}
-   }
-   } else {
-   nvp = NULL;
}
-   if (r) {
+
+   /*
+* If we failed to get attributes of the entry,
+* then just skip it for NFSv3 (the traditional
+* behavior in the old NFS server).
+* For NFSv4 the behavior is controlled by
+* RDATTRERROR: we either ignore the error or
+* fail the request.
+* Note that RDATTRERROR is never set for NFSv3.
+*/
+   if (r != 0) {
if (!NFSISSET_ATTRBIT(,
NFSATTRBIT_RDATTRERROR)) {
-   if (nvp != NULL)
-   vput(nvp);
+   vput(nvp);
if (needs_unbusy != 0)
vfs_unbusy(new_mp);
+   if ((nd->nd_flag & ND_NFSV3))
+   goto invalid;
nd->nd_repstat = r;
break;
}
@@ -2519,6 +2539,7 @@ again:
if (dirlen <= cnt)
entrycnt++;
}
+invalid:
cpos += 

Re: svn commit: r339546 - head/sys/kern

2018-10-22 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: imp
> Date: Sun Oct 21 16:49:49 2018
> New Revision: 339546
> URL: https://svnweb.freebsd.org/changeset/base/339546
> 
> Log:
>   Remove stray refernce to pdq. Like the infamous twenty first of Johan
>   Sebastian Bach's twenty children, it hasn't been seen in many years.

With  Modified:
>   head/sys/kern/Make.tags.inc
> 
> Modified: head/sys/kern/Make.tags.inc
> ==
> --- head/sys/kern/Make.tags.inc   Sun Oct 21 16:44:57 2018
> (r339545)
> +++ head/sys/kern/Make.tags.inc   Sun Oct 21 16:49:49 2018
> (r339546)
> @@ -19,7 +19,6 @@ COMM=   ${SYS}/dev/advansys/*.[ch] \
>   ${SYS}/dev/en/*.[ch] \
>   ${SYS}/dev/iicbus/*.[ch] \
>   ${SYS}/dev/isp/*.[ch] \
> - ${SYS}/dev/pdq/*.[ch] \
>   ${SYS}/dev/ppbus/*.[ch] \
>   ${SYS}/dev/smbus/*.[ch] \
>   ${SYS}/dev/vx/*.[ch] \
> @@ -78,7 +77,6 @@ COMMDIR2= ${SYS}/dev/advansys \
>   ${SYS}/dev/iicbus \
>   ${SYS}/dev/isp \
>   ${SYS}/dev/md \
> - ${SYS}/dev/pdq \
>   ${SYS}/dev/ppbus \
>   ${SYS}/dev/smbus \
>   ${SYS}/dev/vx \
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
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: r339543 - head/sys/conf

2018-10-22 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: imp
> Date: Sun Oct 21 16:29:32 2018
> New Revision: 339543
> URL: https://svnweb.freebsd.org/changeset/base/339543
> 
> Log:
>   Remove stray fatm reference.

With  Modified:
>   head/sys/conf/WITHOUT_SOURCELESS_UCODE
> 
> Modified: head/sys/conf/WITHOUT_SOURCELESS_UCODE
> ==
> --- head/sys/conf/WITHOUT_SOURCELESS_UCODESun Oct 21 16:29:12 2018
> (r339542)
> +++ head/sys/conf/WITHOUT_SOURCELESS_UCODESun Oct 21 16:29:32 2018
> (r339543)
> @@ -6,7 +6,6 @@
>  
>  nodevice adw
>  nodevice bce
> -nodevice fatm
>  nodevice fxp
>  nodevice ispfw
>  nodevice mwlfw
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
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: r339594 - head/sys/arm64/arm64

2018-10-22 Thread Andrew Turner
Author: andrew
Date: Mon Oct 22 15:18:49 2018
New Revision: 339594
URL: https://svnweb.freebsd.org/changeset/base/339594

Log:
  Stop advertising ARMv8.3 Pointer Authentication
  
  This needs firmware and kernel support before userspace can use it. Until
  then don't advertise it's available.
  
  MFC after:3 days

Modified:
  head/sys/arm64/arm64/identcpu.c

Modified: head/sys/arm64/arm64/identcpu.c
==
--- head/sys/arm64/arm64/identcpu.c Mon Oct 22 15:06:14 2018
(r339593)
+++ head/sys/arm64/arm64/identcpu.c Mon Oct 22 15:18:49 2018
(r339594)
@@ -201,13 +201,13 @@ static struct mrs_field id_aa64isar0_fields[] = {
 };
 
 static struct mrs_field id_aa64isar1_fields[] = {
-   MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_GPI_SHIFT),
-   MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_GPA_SHIFT),
+   MRS_FIELD(false, MRS_EXACT, ID_AA64ISAR1_GPI_SHIFT),
+   MRS_FIELD(false, MRS_EXACT, ID_AA64ISAR1_GPA_SHIFT),
MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_LRCPC_SHIFT),
MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_FCMA_SHIFT),
MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_JSCVT_SHIFT),
-   MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_API_SHIFT),
-   MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_APA_SHIFT),
+   MRS_FIELD(false, MRS_EXACT, ID_AA64ISAR1_API_SHIFT),
+   MRS_FIELD(false, MRS_EXACT, ID_AA64ISAR1_APA_SHIFT),
MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_DPB_SHIFT),
MRS_FIELD_END,
 };
___
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: r339593 - head/sys/arm64/include

2018-10-22 Thread Andrew Turner
Author: andrew
Date: Mon Oct 22 15:06:14 2018
New Revision: 339593
URL: https://svnweb.freebsd.org/changeset/base/339593

Log:
  Fix the ID_AA64ISAR0_EL1 dot product field shift.
  
  It's 44 in the documentation, use this correct value.
  
  MFC after:3 days

Modified:
  head/sys/arm64/include/armreg.h

Modified: head/sys/arm64/include/armreg.h
==
--- head/sys/arm64/include/armreg.h Mon Oct 22 14:58:59 2018
(r339592)
+++ head/sys/arm64/include/armreg.h Mon Oct 22 15:06:14 2018
(r339593)
@@ -260,7 +260,7 @@
 #defineID_AA64ISAR0_SM4(x) ((x) & ID_AA64ISAR0_SM4_MASK)
 #define ID_AA64ISAR0_SM4_NONE  (0x0ul << 
ID_AA64ISAR0_SM4_SHIFT)
 #define ID_AA64ISAR0_SM4_IMPL  (0x1ul << 
ID_AA64ISAR0_SM4_SHIFT)
-#defineID_AA64ISAR0_DP_SHIFT   48
+#defineID_AA64ISAR0_DP_SHIFT   44
 #defineID_AA64ISAR0_DP_MASK(0xful << ID_AA64ISAR0_DP_SHIFT)
 #defineID_AA64ISAR0_DP(x)  ((x) & ID_AA64ISAR0_DP_MASK)
 #define ID_AA64ISAR0_DP_NONE   (0x0ul << ID_AA64ISAR0_DP_SHIFT)
___
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: r339592 - in head/sys/arm64: arm64 include

2018-10-22 Thread Andrew Turner
Author: andrew
Date: Mon Oct 22 14:58:59 2018
New Revision: 339592
URL: https://svnweb.freebsd.org/changeset/base/339592

Log:
  Correctly set the DAIF bits in new threads
  
  We should only unmask interrupts when creating a new thread and leave the
  other exceptions in teh same state as before creating the thread.
  
  Reported by:  jhibbits
  Reviewed by:  jhibbits
  MFC after:1 month
  Sponsored by: https://reviews.freebsd.org/D17497

Modified:
  head/sys/arm64/arm64/vm_machdep.c
  head/sys/arm64/include/armreg.h

Modified: head/sys/arm64/arm64/vm_machdep.c
==
--- head/sys/arm64/arm64/vm_machdep.c   Mon Oct 22 14:44:44 2018
(r339591)
+++ head/sys/arm64/arm64/vm_machdep.c   Mon Oct 22 14:58:59 2018
(r339592)
@@ -111,7 +111,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t
 
/* Setup to release spin count in fork_exit(). */
td2->td_md.md_spinlock_count = 1;
-   td2->td_md.md_saved_daif = 0;
+   td2->td_md.md_saved_daif = td1->td_md.md_saved_daif & ~DAIF_I_MASKED;
 }
 
 void
@@ -182,7 +182,7 @@ cpu_copy_thread(struct thread *td, struct thread *td0)
 
/* Setup to release spin count in fork_exit(). */
td->td_md.md_spinlock_count = 1;
-   td->td_md.md_saved_daif = 0;
+   td->td_md.md_saved_daif = td0->td_md.md_saved_daif & ~DAIF_I_MASKED;
 }
 
 /*

Modified: head/sys/arm64/include/armreg.h
==
--- head/sys/arm64/include/armreg.h Mon Oct 22 14:44:44 2018
(r339591)
+++ head/sys/arm64/include/armreg.h Mon Oct 22 14:58:59 2018
(r339592)
@@ -66,6 +66,12 @@
 #defineCTR_ILINE_MASK  (0xf << CTR_ILINE_SHIFT)
 #defineCTR_ILINE_SIZE(reg) (((reg) & CTR_ILINE_MASK) >> 
CTR_ILINE_SHIFT)
 
+/* DAIF - Interrupt Mask Bits */
+#defineDAIF_D_MASKED   (1 << 9)
+#defineDAIF_A_MASKED   (1 << 8)
+#defineDAIF_I_MASKED   (1 << 7)
+#defineDAIF_F_MASKED   (1 << 6)
+
 /* DCZID_EL0 - Data Cache Zero ID register */
 #define DCZID_DZP  (1 << 4) /* DC ZVA prohibited if non-0 */
 #define DCZID_BS_SHIFT 0
___
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: r339591 - head/sys/dev/ichwd

2018-10-22 Thread Andriy Gapon
Author: avg
Date: Mon Oct 22 14:44:44 2018
New Revision: 339591
URL: https://svnweb.freebsd.org/changeset/base/339591

Log:
  ichwd: add support for TCO watchdog timer in Lewisburg PCH (C620)
  
  The change is based on public documents listed below as well as Linux
  changes and the code developed by Kostik.
  
  The documents:
  - Intel® C620 Series Chipset Platform Controller Hub Datasheet
  - Intel® 100 Series and Intel® C230 Series Chipset Family Platform
Controller Hub (PCH) Datasheet - Volume 2 of 2
  
  Interesting Linux commits:
  - 
https://github.com/torvalds/linux/commit/9424693035a57961a8eb09e96aab315a7096535d
  - 
https://github.com/torvalds/linux/commit/2a7a0e9bf7b32e838d873226808ab8a6c00148f7
  
  The peculiarity of the new chipsets is that the watchdog resources are
  configured in PCI registers of SMBus controller and Power Management
  function as opposed to the LPC bridge.  I took a simplistic approach of
  querying the resources from the respective PCI devices.  ichwd is still
  a device on isa bus.  The PCI devices are found by their slot and
  function defined in the datasheets as siblings of the upstream LPC
  bridge.
  
  There are some shortcuts and missing features.
  
  First of all, I have not implemented the functionality required to clear
  the no-reboot bit.  That would require writing to a special PCI
  configuration register of a hidden / invisible PCI device after which
  the device would start responding to accesses to other registers.  The
  no-reboot bit was not set on my test hardware, so I decided to leave its
  handling for the later time.
  
  Also, I did not try to handle the case where the watchdog resources are
  not configured by the hardware as well as the case where ACPI defined
  operational region conflicts with the watchdog resources.  My test
  system did not have either of those problem, so, again, I decided to
  leave those cases until later.
  See this Linux commit for some details of the ACPI problem:
  
https://github.com/torvalds/linux/commit/a7ae81952cdab56a1277bd2f9ed7284c0f575120
  
  Finally, I have added only the PCI ID found on my test system.  I think
  that more IDs can be added as the change gets tested.
  
  Tested on Dell PowerEdge R740.
  
  PR:   222079
  Reviewed by:  mav, kib
  MFC after:3 weeks
  Relnotes: maybe
  Sponsored by: Panzura
  Differential Revision: https://reviews.freebsd.org/D17585

Modified:
  head/sys/dev/ichwd/ichwd.c
  head/sys/dev/ichwd/ichwd.h

Modified: head/sys/dev/ichwd/ichwd.c
==
--- head/sys/dev/ichwd/ichwd.c  Mon Oct 22 14:01:34 2018(r339590)
+++ head/sys/dev/ichwd/ichwd.c  Mon Oct 22 14:44:44 2018(r339591)
@@ -289,6 +289,11 @@ static struct ichwd_device ichwd_devices[] = {
{ 0, NULL, 0, 0 },
 };
 
+static struct ichwd_device ichwd_smb_devices[] = {
+   { DEVICEID_LEWISBURG_SMB, "Lewisburg watchdog timer",   10, 4 },
+   { 0, NULL, 0, 0 },
+};
+
 static devclass_t ichwd_devclass;
 
 #define ichwd_read_tco_1(sc, off) \
@@ -374,7 +379,8 @@ ichwd_sts_reset(struct ichwd_softc *sc)
 * be done in two separate operations.
 */
ichwd_write_tco_2(sc, TCO2_STS, TCO_SECOND_TO_STS);
-   ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS);
+   if (sc->tco_version < 4)
+   ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS);
 }
 
 /*
@@ -488,6 +494,11 @@ ichwd_clear_noreboot(struct ichwd_softc *sc)
if (status & ICH_PMC_NO_REBOOT)
rc = EIO;
break;
+   case 4:
+   /*
+* TODO.  This needs access to a hidden PCI device at 31:1.
+*/
+   break;
default:
ichwd_verbose_printf(sc->device,
"Unknown TCO Version: %d, can't set NO_REBOOT.\n",
@@ -560,6 +571,36 @@ ichwd_find_ich_lpc_bridge(device_t isa, struct ichwd_d
return (NULL);
 }
 
+static device_t
+ichwd_find_smb_dev(device_t isa, struct ichwd_device **id_p)
+{
+   struct ichwd_device *id;
+   device_t isab, smb;
+   uint16_t devid;
+
+   /*
+* Check if SMBus controller provides TCO configuration.
+* The controller's device and function are fixed and we expect
+* it to be on the same bus as ISA bridge.
+*/
+   isab = device_get_parent(isa);
+   smb = pci_find_dbsf(pci_get_domain(isab), pci_get_bus(isab), 31, 4);
+   if (smb == NULL)
+   return (NULL);
+   if (pci_get_vendor(smb) != VENDORID_INTEL)
+   return (NULL);
+   devid = pci_get_device(smb);
+   for (id = ichwd_smb_devices; id->desc != NULL; ++id) {
+   if (devid == id->device) {
+   if (id_p != NULL)
+   *id_p = id;
+   return (smb);
+   }
+   }
+
+   return (NULL);
+}
+
 /*
  * Look for an ICH LPC 

svn commit: r339590 - head/share/misc

2018-10-22 Thread Serhii (Sergey) Kozlov
Author: skozlov (ports committer)
Date: Mon Oct 22 14:01:34 2018
New Revision: 339590
URL: https://svnweb.freebsd.org/changeset/base/339590

Log:
  Add myself to mentees with sbruno as mentor
  
  Approved by: sbruno (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotMon Oct 22 13:40:50 2018
(r339589)
+++ head/share/misc/committers-ports.dotMon Oct 22 14:01:34 2018
(r339590)
@@ -238,6 +238,7 @@ sergei [label="Sergei Kolobov\nser...@freebsd.org\n200
 shaun [label="Shaun Amott\nsh...@freebsd.org\n2006/06/19"]
 shurd [label="Stephen Hurd\nsh...@freebsd.org\n2014/06/14"]
 simon [label="Simon L. Nielsen\nsi...@freebsd.org\n2005/01/08"]
+skozlov [label="Sergey Kozlov\nskoz...@freebsd.org\n2018/09/21"]
 skreuzer [label="Steven Kreuzer\nskreu...@freebsd.org\n2009/03/25"]
 sobomax[label="Maxim Sobolev\nsobo...@freebsd.org\n2000/05/17"]
 sperber[label="Armin Pirkovitsch\nsper...@freebsd.org\n2012/04/15"]
@@ -652,6 +653,8 @@ sahil -> culot
 sahil -> eadler
 
 sat -> beech
+
+sbruno -> skozlov
 
 sem -> az
 sem -> anray
___
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: r339589 - head/sys/powerpc/powernv

2018-10-22 Thread Leandro Lupori
Author: luporl
Date: Mon Oct 22 13:40:50 2018
New Revision: 339589
URL: https://svnweb.freebsd.org/changeset/base/339589

Log:
  ppc64: limited 32-bit DMA address range
  
  Further investigation of issues with 32-bit DMA on PowerNV revealed that
  its window is hardcoded by OPAL (at least in skiboot version 5.4.9) and
  cannot be changed by the OS.
  Thus, now jhb suggestion of limiting the range in PCI DMA tag seems
  the best way to deal with it.
  
  Reviewed by:  jhibbits, nwhitehorn, sbruno
  Approved by:  jhibbits(mentor)
  Differential Revision:https://reviews.freebsd.org/D17601

Modified:
  head/sys/powerpc/powernv/opal_pci.c

Modified: head/sys/powerpc/powernv/opal_pci.c
==
--- head/sys/powerpc/powernv/opal_pci.c Mon Oct 22 13:25:26 2018
(r339588)
+++ head/sys/powerpc/powernv/opal_pci.c Mon Oct 22 13:40:50 2018
(r339589)
@@ -96,6 +96,9 @@ static int opalpci_route_interrupt(device_t bus, devic
 static void opalpic_pic_enable(device_t dev, u_int irq, u_int vector);
 static void opalpic_pic_eoi(device_t dev, u_int irq);
 
+/* Bus interface */
+static bus_dma_tag_t opalpci_get_dma_tag(device_t dev, device_t child);
+
 /*
  * Commands
  */
@@ -119,6 +122,8 @@ static void opalpic_pic_eoi(device_t dev, u_int irq);
  */
 #define OPAL_PCI_DEFAULT_PE1
 
+#define OPAL_PCI_BUS_SPACE_LOWADDR_32BIT   0x7FFFUL
+
 /*
  * Driver methods.
  */
@@ -142,6 +147,9 @@ static device_method_t  opalpci_methods[] = {
DEVMETHOD(pic_enable,   opalpic_pic_enable),
DEVMETHOD(pic_eoi,  opalpic_pic_eoi),
 
+   /* Bus interface */
+   DEVMETHOD(bus_get_dma_tag,  opalpci_get_dma_tag),
+
DEVMETHOD_END
 };
 
@@ -424,6 +432,23 @@ opalpci_attach(device_t dev)
msi_ranges[1], msi_ranges[0]);
}
 
+   /* Create the parent DMA tag */
+   err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
+   1, 0,   /* alignment, bounds */
+   OPAL_PCI_BUS_SPACE_LOWADDR_32BIT,   /* lowaddr */
+   BUS_SPACE_MAXADDR_32BIT,/* highaddr */
+   NULL, NULL, /* filter, filterarg */
+   BUS_SPACE_MAXSIZE,  /* maxsize */
+   BUS_SPACE_UNRESTRICTED, /* nsegments */
+   BUS_SPACE_MAXSIZE,  /* maxsegsize */
+   0,  /* flags */
+   NULL, NULL, /* lockfunc, lockarg */
+   >ofw_sc.sc_dmat);
+   if (err != 0) {
+   device_printf(dev, "Failed to create DMA tag\n");
+   return (err);
+   }
+
/*
 * General OFW PCI attach
 */
@@ -660,4 +685,13 @@ static void opalpic_pic_eoi(device_t dev, u_int irq)
opal_call(OPAL_PCI_MSI_EOI, sc->phb_id, irq);
 
PIC_EOI(root_pic, irq);
+}
+
+static bus_dma_tag_t
+opalpci_get_dma_tag(device_t dev, device_t child)
+{
+   struct opalpci_softc *sc;
+
+   sc = device_get_softc(dev);
+   return (sc->ofw_sc.sc_dmat);
 }
___
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: r339588 - head/sys/net

2018-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Oct 22 13:25:26 2018
New Revision: 339588
URL: https://svnweb.freebsd.org/changeset/base/339588

Log:
  Resolve deadlock between epoch(9) and various network interface
  SX-locks, during if_purgeaddrs(), by not allowing to hold the epoch
  read lock over typical network IOCTL code paths. This is a regression
  issue after r334305.
  
  Reviewed by:  ae (network)
  Differential revision:https://reviews.freebsd.org/D17647
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Mon Oct 22 11:58:30 2018(r339587)
+++ head/sys/net/if.c   Mon Oct 22 13:25:26 2018(r339588)
@@ -964,12 +964,18 @@ if_attachdomain1(struct ifnet *ifp)
 void
 if_purgeaddrs(struct ifnet *ifp)
 {
-   struct ifaddr *ifa, *next;
+   struct ifaddr *ifa;
 
-   NET_EPOCH_ENTER();
-   CK_STAILQ_FOREACH_SAFE(ifa, >if_addrhead, ifa_link, next) {
-   if (ifa->ifa_addr->sa_family == AF_LINK)
-   continue;
+   while (1) {
+   NET_EPOCH_ENTER();
+   CK_STAILQ_FOREACH(ifa, >if_addrhead, ifa_link) {
+   if (ifa->ifa_addr->sa_family != AF_LINK)
+   break;
+   }
+   NET_EPOCH_EXIT();
+
+   if (ifa == NULL)
+   break;
 #ifdef INET
/* XXX: Ugly!! ad hoc just for INET */
if (ifa->ifa_addr->sa_family == AF_INET) {
@@ -996,7 +1002,6 @@ if_purgeaddrs(struct ifnet *ifp)
IF_ADDR_WUNLOCK(ifp);
ifa_free(ifa);
}
-   NET_EPOCH_EXIT();
 }
 
 /*
___
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: r339587 - head/sys/dev/usb/serial

2018-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Oct 22 11:58:30 2018
New Revision: 339587
URL: https://svnweb.freebsd.org/changeset/base/339587

Log:
  Added support for formula-based arbitrary baud rates, in contrast to
  the current fixed values, which enables use of rates above 1 Mbps.
  Improved the detection of HXD chips, and the status flag handling as
  well.
  
  Submitted by: Gabor Simon 
  PR:   225932
  Differential revision:https://reviews.freebsd.org/D16639
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/usb/serial/uplcom.c

Modified: head/sys/dev/usb/serial/uplcom.c
==
--- head/sys/dev/usb/serial/uplcom.cMon Oct 22 11:43:43 2018
(r339586)
+++ head/sys/dev/usb/serial/uplcom.cMon Oct 22 11:58:30 2018
(r339587)
@@ -134,12 +134,20 @@ SYSCTL_INT(_hw_usb_uplcom, OID_AUTO, debug, CTLFLAG_RW
 #defineUPLCOM_SET_CRTSCTS  0x41
 #defineUPLCOM_SET_CRTSCTS_PL2303X  0x61
 #defineRSAQ_STATUS_CTS 0x80
+#defineRSAQ_STATUS_OVERRUN_ERROR   0x40
+#defineRSAQ_STATUS_PARITY_ERROR0x20 
+#defineRSAQ_STATUS_FRAME_ERROR 0x10
+#defineRSAQ_STATUS_RING0x08
+#defineRSAQ_STATUS_BREAK_ERROR 0x04
 #defineRSAQ_STATUS_DSR 0x02
 #defineRSAQ_STATUS_DCD 0x01
 
 #defineTYPE_PL2303 0
 #defineTYPE_PL2303HX   1
+#defineTYPE_PL2303HXD  2
 
+#defineUPLCOM_STATE_INDEX  8
+
 enum {
UPLCOM_BULK_DT_WR,
UPLCOM_BULK_DT_RD,
@@ -369,18 +377,49 @@ uplcom_attach(device_t dev)
 
sc->sc_udev = uaa->device;
 
-   /* Determine the chip type.  This algorithm is taken from Linux. */
dd = usbd_get_device_descriptor(sc->sc_udev);
-   if (dd->bDeviceClass == 0x02)
-   sc->sc_chiptype = TYPE_PL2303;
-   else if (dd->bMaxPacketSize == 0x40)
+
+   switch (UGETW(dd->bcdDevice)) {
+   case 0x0300:
sc->sc_chiptype = TYPE_PL2303HX;
-   else
-   sc->sc_chiptype = TYPE_PL2303;
+   /* or TA, that is HX with external crystal */
+   break;
+   case 0x0400:
+   sc->sc_chiptype = TYPE_PL2303HXD;
+   /* or EA, that is HXD with ESD protection */
+   /* or RA, that has internal voltage level converter that works 
only up to 1Mbaud (!) */
+   break;
+   case 0x0500:
+   sc->sc_chiptype = TYPE_PL2303HXD;
+   /* in fact it's TB, that is HXD with external crystal */
+   break;
+   default:
+   /* NOTE: I have no info about the bcdDevice for the base PL2303 
(up to 1.2Mbaud,
+  only fixed rates) and for PL2303SA (8-pin chip, up to 115200 
baud */
+   /* Determine the chip type.  This algorithm is taken from 
Linux. */
+   if (dd->bDeviceClass == 0x02)
+   sc->sc_chiptype = TYPE_PL2303;
+   else if (dd->bMaxPacketSize == 0x40)
+   sc->sc_chiptype = TYPE_PL2303HX;
+   else
+   sc->sc_chiptype = TYPE_PL2303;
+   break;
+   }
 
-   DPRINTF("chiptype: %s\n",
-   (sc->sc_chiptype == TYPE_PL2303HX) ?
-   "2303X" : "2303");
+   switch (sc->sc_chiptype) {
+   case TYPE_PL2303:
+   DPRINTF("chiptype: 2303\n");
+   break;
+   case TYPE_PL2303HX:
+   DPRINTF("chiptype: 2303HX/TA\n");
+   break;
+   case TYPE_PL2303HXD:
+   DPRINTF("chiptype: 2303HXD/TB/RA/EA\n");
+   break;
+   default:
+   DPRINTF("chiptype: unknown %d\n", sc->sc_chiptype);
+   break;
+   }
 
/*
 * USB-RSAQ1 has two interface
@@ -429,13 +468,14 @@ uplcom_attach(device_t dev)
goto detach;
}
 
-   if (sc->sc_chiptype != TYPE_PL2303HX) {
+   if (sc->sc_chiptype == TYPE_PL2303) {
/* HX variants seem to lock up after a clear stall request. */
mtx_lock(>sc_mtx);
usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]);
usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]);
mtx_unlock(>sc_mtx);
} else {
+   /* reset upstream data pipes */
if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE,
UPLCOM_SET_REQUEST, 8, 0, 0) ||
uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE,
@@ -554,7 +594,7 @@ uplcom_pl2303_init(struct usb_device *udev, uint8_t ch
|| uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, 
UPLCOM_SET_REQUEST, 1, 0, 0))
return (EIO);
 
-   if (chiptype == 

svn commit: r339586 - head/usr.sbin/bhyve

2018-10-22 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Oct 22 11:43:43 2018
New Revision: 339586
URL: https://svnweb.freebsd.org/changeset/base/339586

Log:
  In bhyve's fbuf emulation improve the overall "usage" message and
  for the vga option, rather than printing the entire option string,
  only print vga (as we do for everything else).
  
  MFC after:3 days

Modified:
  head/usr.sbin/bhyve/pci_fbuf.c

Modified: head/usr.sbin/bhyve/pci_fbuf.c
==
--- head/usr.sbin/bhyve/pci_fbuf.c  Mon Oct 22 11:23:51 2018
(r339585)
+++ head/usr.sbin/bhyve/pci_fbuf.c  Mon Oct 22 11:43:43 2018
(r339586)
@@ -117,8 +117,9 @@ static void
 pci_fbuf_usage(char *opt)
 {
 
-   fprintf(stderr, "Invalid fbuf emulation \"%s\"\r\n", opt);
-   fprintf(stderr, "fbuf: {wait,}{vga=on|io|off,}rfb=:port\r\n");
+   fprintf(stderr, "Invalid fbuf emulation option \"%s\"\r\n", opt);
+   fprintf(stderr, "fbuf: {wait,}{vga=on|io|off,}rfb=:port"
+   "{,w=width}{,h=height}\r\n");
 }
 
 static void
@@ -268,7 +269,7 @@ pci_fbuf_parse_opts(struct pci_fbuf_softc *sc, char *o
sc->vga_enabled = 1;
sc->vga_full = 1;
} else {
-   pci_fbuf_usage(opts);
+   pci_fbuf_usage(xopts);
ret = -1;
goto done;
}
___
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: r339585 - head/sys/dev/hyperv/netvsc

2018-10-22 Thread Wei Hu
Author: whu
Date: Mon Oct 22 11:23:51 2018
New Revision: 339585
URL: https://svnweb.freebsd.org/changeset/base/339585

Log:
  Do not trop UDP traffic when TXCSUM_IPV6 flag is on
  
  PR:   231797
  Submitted by: whu
  Reviewed by:  dexuan
  Obtained from:Kevin Morse
  MFC after:3 days
  Sponsored by: Microsoft
  Differential Revision:
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=198333=diff

Modified:
  head/sys/dev/hyperv/netvsc/if_hn.c

Modified: head/sys/dev/hyperv/netvsc/if_hn.c
==
--- head/sys/dev/hyperv/netvsc/if_hn.c  Mon Oct 22 10:38:38 2018
(r339584)
+++ head/sys/dev/hyperv/netvsc/if_hn.c  Mon Oct 22 11:23:51 2018
(r339585)
@@ -861,7 +861,8 @@ hn_set_hlen(struct mbuf *m_head)
 
PULLUP_HDR(m_head, ehlen + sizeof(*ip6));
ip6 = mtodo(m_head, ehlen);
-   if (ip6->ip6_nxt != IPPROTO_TCP) {
+   if (ip6->ip6_nxt != IPPROTO_TCP &&
+   ip6->ip6_nxt != IPPROTO_UDP) {
m_freem(m_head);
return (NULL);
}
___
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: r339584 - in head/sys/dev/mlx5: . mlx5_core

2018-10-22 Thread Slava Shwartsman
Author: slavash
Date: Mon Oct 22 10:38:38 2018
New Revision: 339584
URL: https://svnweb.freebsd.org/changeset/base/339584

Log:
  mlx5: Notify user that the ConnectX-6 shutdown its port due to power 
limitation
  
  If power exceed the slot limit, or slot limit is unknown the ConnectX-6
  firmware will shutdown its port.
  Inform the user via debug message.
  
  MFC after:  3 days
  Approved by:hselasky (mentor), kib (mentor)
  Sponsored by:   Mellanox Technologies

Modified:
  head/sys/dev/mlx5/device.h
  head/sys/dev/mlx5/mlx5_core/mlx5_eq.c

Modified: head/sys/dev/mlx5/device.h
==
--- head/sys/dev/mlx5/device.h  Mon Oct 22 08:59:20 2018(r339583)
+++ head/sys/dev/mlx5/device.h  Mon Oct 22 10:38:38 2018(r339584)
@@ -549,6 +549,7 @@ enum {
MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5,
MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE  = 0x6,
MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED  = 0x7,
+   MLX5_MODULE_EVENT_ERROR_PCIE_SYSTEM_POWER_SLOT_EXCEEDED   = 0xc,
 };
 
 struct mlx5_eqe_port_module_event {

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c   Mon Oct 22 08:59:20 2018
(r339583)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c   Mon Oct 22 10:38:38 2018
(r339584)
@@ -615,6 +615,12 @@ static const char *mlx5_port_module_event_error_type_t
return "High Temperature";
case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED:
return "Cable is shorted";
+   case MLX5_MODULE_EVENT_ERROR_PCIE_SYSTEM_POWER_SLOT_EXCEEDED:
+   return "One or more network ports have been powered "
+   "down due to insufficient/unadvertised power on "
+   "the PCIe slot. Please refer to the card's user "
+   "manual for power specifications or contact "
+   "Mellanox support.";
 
default:
return "Unknown error type";
___
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: r339582 - head/sys/dev/sound/midi

2018-10-22 Thread Hans Petter Selasky

On 10/22/18 12:20 PM, Konstantin Belousov wrote:

Then why do you need to re-acquire the mutex after uiomove ?


Hi,

Because the code is factored this way:

mtx_lock();
while (uio->uio_resid > 0) {
do state checks()
mtx_unlock();
retval = uiomove();
mtx_lock();
}
mtx_unlock();

Yes, you're right the last mtx_lock() can be optimised away. I'm leaving 
that to somebody else. This code typically is processing MIDI events at 
very slow rates like 8KBytes/s and does not need to be very fast.


--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: r339582 - head/sys/dev/sound/midi

2018-10-22 Thread Konstantin Belousov
On Mon, Oct 22, 2018 at 12:09:54PM +0200, Hans Petter Selasky wrote:
> On 10/22/18 11:51 AM, Konstantin Belousov wrote:
> > On Mon, Oct 22, 2018 at 08:58:28AM +, Hans Petter Selasky wrote:
> >> Author: hselasky
> >> Date: Mon Oct 22 08:58:27 2018
> >> New Revision: 339582
> >> URL: https://svnweb.freebsd.org/changeset/base/339582
> >>
> >> Log:
> >>Drop sequencer mutex around uiomove() and make sure we don't move more 
> >> bytes
> >>than is available, else a panic might happen.
> > And why it is safe to drop the mutex ?
> > If it is safe to drop, why do you need the mutex at all ?
> > 
> 
> The seq mutex protects the queue state, which is entirely computed prior 
> or after uiomove().

Then why do you need to re-acquire the mutex after uiomove ?
___
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: r339582 - head/sys/dev/sound/midi

2018-10-22 Thread Hans Petter Selasky

On 10/22/18 11:51 AM, Konstantin Belousov wrote:

On Mon, Oct 22, 2018 at 08:58:28AM +, Hans Petter Selasky wrote:

Author: hselasky
Date: Mon Oct 22 08:58:27 2018
New Revision: 339582
URL: https://svnweb.freebsd.org/changeset/base/339582

Log:
   Drop sequencer mutex around uiomove() and make sure we don't move more bytes
   than is available, else a panic might happen.

And why it is safe to drop the mutex ?
If it is safe to drop, why do you need the mutex at all ?



The seq mutex protects the queue state, which is entirely computed prior 
or after uiomove().


--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: r339565 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf

2018-10-22 Thread René Ladan
Op ma 22 okt. 2018 om 10:29 schreef René Ladan :

> Op ma 22 okt. 2018 om 05:00 schreef Benjamin Kaduk :
>
>> On Sun, Oct 21, 2018 at 9:53 PM Warner Losh  wrote:
>>
>> >
>> >
>> > On Sun, Oct 21, 2018 at 8:47 PM Benjamin Kaduk 
>> wrote:
>> >
>> >> On Sun, Oct 21, 2018 at 9:35 PM Warner Losh  wrote:
>> >>
>> >>> Author: imp
>> >>> Date: Mon Oct 22 02:34:25 2018
>> >>> New Revision: 339565
>> >>> URL: https://svnweb.freebsd.org/changeset/base/339565
>> >>>
>> >>> Log:
>> >>>   Remove aha(4) from the tree.
>> >>>
>> >>>
>> >> The documentation build is now failing, as there's an entity reference
>> to
>> >> the autogenerated
>> >> hardware list, which does not exist anymore.  Will you be able to look
>> at
>> >> those as part of your
>> >> removals or does someone from the doc team need to handle it?
>> >>
>> >
>> > I'll take a look. What exactly is failing? The only place I see aha.4 is
>> > in doc/head/share/xml/man-refs.ent but there's several other drivers
>> that
>> > have been removed that are in there... So I'm confused and need some
>> > additional guidance.
>> >
>>
>> The build log is mailed out at (e.g.)
>> https://lists.freebsd.org/pipermail/freebsd-doc/2018-October/031621.html
>> Though looking slightly more closely, it seems to be complaining about the
>> 12.0 release notes (!), which might both (1) be awkward to solve, and (2)
>> be in re@'s territory.
>>
>
> The website build (in doc/head/en_US.ISO8859-1/htdocs) does a partial
> CURRENT checkout:
>
> /usr/local/bin/svn co svn://svn.freebsd.org/base/head/share/man/man4
> /usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/svn.N0lzOSqR
>
> so it is not specific for the 12.0-RELEASE notes, they are just part of
> the doc build. I guess the doc repository refers to now deleted man(4)
> entries.
>
> The full list seems to be:

/usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardware.xml:642:
parser error : Entity 'hwlist.adv' not defined
  
  ^
/usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardware.xml:644:
parser error : Entity 'hwlist.adw' not defined
  
  ^
/usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardware.xml:646:
parser error : Entity 'hwlist.aha' not defined
  
  ^
/usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardware.xml:654:
parser error : Entity 'hwlist.aic' not defined
  
  ^
/usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardware.xml:664:
parser error : Entity 'hwlist.dpt' not defined
  
  ^
/usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardware.xml:714:
parser error : Entity 'hwlist.ncr' not defined
  
  ^
/usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardware.xml:716:
parser error : Entity 'hwlist.ncv' not defined
  
  ^
/usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardware.xml:718:
parser error : Entity 'hwlist.nsp' not defined
  
  ^
/usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardware.xml:726:
parser error : Entity 'hwlist.stg' not defined
  
  ^
 René
___
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: r339582 - head/sys/dev/sound/midi

2018-10-22 Thread Konstantin Belousov
On Mon, Oct 22, 2018 at 08:58:28AM +, Hans Petter Selasky wrote:
> Author: hselasky
> Date: Mon Oct 22 08:58:27 2018
> New Revision: 339582
> URL: https://svnweb.freebsd.org/changeset/base/339582
> 
> Log:
>   Drop sequencer mutex around uiomove() and make sure we don't move more bytes
>   than is available, else a panic might happen.
And why it is safe to drop the mutex ?
If it is safe to drop, why do you need the mutex at all ?
___
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: r339583 - head/sys/dev/sound/midi

2018-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Oct 22 08:59:20 2018
New Revision: 339583
URL: https://svnweb.freebsd.org/changeset/base/339583

Log:
  The event bytes should be unsigned char.
  
  Found by: Peter Holm 
  MFC after:3 days
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/sound/midi/sequencer.c

Modified: head/sys/dev/sound/midi/sequencer.c
==
--- head/sys/dev/sound/midi/sequencer.c Mon Oct 22 08:58:27 2018
(r339582)
+++ head/sys/dev/sound/midi/sequencer.c Mon Oct 22 08:59:20 2018
(r339583)
@@ -434,7 +434,7 @@ static void
 seq_eventthread(void *arg)
 {
struct seq_softc *scp = arg;
-   char event[EV_SZ];
+   u_char event[EV_SZ];
 
mtx_lock(>seq_lock);
SEQ_DEBUG(2, printf("seq_eventthread started\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"


svn commit: r339582 - head/sys/dev/sound/midi

2018-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Oct 22 08:58:27 2018
New Revision: 339582
URL: https://svnweb.freebsd.org/changeset/base/339582

Log:
  Drop sequencer mutex around uiomove() and make sure we don't move more bytes
  than is available, else a panic might happen.
  
  Found by: Peter Holm 
  MFC after:3 days
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/sound/midi/sequencer.c

Modified: head/sys/dev/sound/midi/sequencer.c
==
--- head/sys/dev/sound/midi/sequencer.c Mon Oct 22 08:55:58 2018
(r339581)
+++ head/sys/dev/sound/midi/sequencer.c Mon Oct 22 08:58:27 2018
(r339582)
@@ -921,7 +921,9 @@ mseq_read(struct cdev *i_dev, struct uio *uio, int iof
 
SEQ_DEBUG(8, printf("midiread: uiomove cc=%d\n", used));
MIDIQ_DEQ(scp->in_q, buf, used);
+   mtx_unlock(>seq_lock);
retval = uiomove(buf, used, uio);
+   mtx_lock(>seq_lock);
if (retval)
goto err1;
}
@@ -996,7 +998,9 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io
retval = ENXIO;
goto err0;
}
+   mtx_unlock(>seq_lock);
retval = uiomove(event, used, uio);
+   mtx_lock(>seq_lock);
if (retval)
goto err0;
 
@@ -1034,7 +1038,9 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io
SEQ_DEBUG(2,
   printf("seq_write: SEQ_FULLSIZE flusing buffer.\n"));
while (uio->uio_resid > 0) {
-   retval = uiomove(event, EV_SZ, uio);
+   mtx_unlock(>seq_lock);
+   retval = uiomove(event, MIN(EV_SZ, 
uio->uio_resid), uio);
+   mtx_lock(>seq_lock);
if (retval)
goto err0;
 
@@ -1045,6 +1051,7 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io
}
retval = EINVAL;
if (ev_code >= 128) {
+   int error;
 
/*
 * Some sort of an extended event. The size is eight
@@ -1054,7 +1061,13 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io
SEQ_DEBUG(2, printf("seq_write: invalid level 
two event %x.\n", ev_code));
goto err0;
}
-   if (uiomove((caddr_t)[4], 4, uio)) {
+   mtx_unlock(>seq_lock);
+   if (uio->uio_resid < 4)
+   error = EINVAL;
+   else
+   error = uiomove((caddr_t)[4], 4, uio);
+   mtx_lock(>seq_lock);
+   if (error) {
SEQ_DEBUG(2,
   printf("seq_write: user memory mangled?\n"));
goto err0;
___
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: r339581 - head/sys/dev/sound/midi

2018-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Oct 22 08:55:58 2018
New Revision: 339581
URL: https://svnweb.freebsd.org/changeset/base/339581

Log:
  Fix off-by-one which can lead to panics.
  
  Found by: Peter Holm 
  MFC after:3 days
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/sound/midi/sequencer.c

Modified: head/sys/dev/sound/midi/sequencer.c
==
--- head/sys/dev/sound/midi/sequencer.c Mon Oct 22 07:04:44 2018
(r339580)
+++ head/sys/dev/sound/midi/sequencer.c Mon Oct 22 08:55:58 2018
(r339581)
@@ -730,7 +730,7 @@ static int
 seq_fetch_mid(struct seq_softc *scp, int unit, kobj_t *md)
 {
 
-   if (unit > scp->midi_number || unit < 0)
+   if (unit >= scp->midi_number || unit < 0)
return EINVAL;
 
*md = scp->midis[unit];
___
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: r339565 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf

2018-10-22 Thread René Ladan
Op ma 22 okt. 2018 om 05:00 schreef Benjamin Kaduk :

> On Sun, Oct 21, 2018 at 9:53 PM Warner Losh  wrote:
>
> >
> >
> > On Sun, Oct 21, 2018 at 8:47 PM Benjamin Kaduk 
> wrote:
> >
> >> On Sun, Oct 21, 2018 at 9:35 PM Warner Losh  wrote:
> >>
> >>> Author: imp
> >>> Date: Mon Oct 22 02:34:25 2018
> >>> New Revision: 339565
> >>> URL: https://svnweb.freebsd.org/changeset/base/339565
> >>>
> >>> Log:
> >>>   Remove aha(4) from the tree.
> >>>
> >>>
> >> The documentation build is now failing, as there's an entity reference
> to
> >> the autogenerated
> >> hardware list, which does not exist anymore.  Will you be able to look
> at
> >> those as part of your
> >> removals or does someone from the doc team need to handle it?
> >>
> >
> > I'll take a look. What exactly is failing? The only place I see aha.4 is
> > in doc/head/share/xml/man-refs.ent but there's several other drivers that
> > have been removed that are in there... So I'm confused and need some
> > additional guidance.
> >
>
> The build log is mailed out at (e.g.)
> https://lists.freebsd.org/pipermail/freebsd-doc/2018-October/031621.html
> Though looking slightly more closely, it seems to be complaining about the
> 12.0 release notes (!), which might both (1) be awkward to solve, and (2)
> be in re@'s territory.
>

The website build (in doc/head/en_US.ISO8859-1/htdocs) does a partial
CURRENT checkout:

/usr/local/bin/svn co svn://svn.freebsd.org/base/head/share/man/man4
/usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/svn.N0lzOSqR

so it is not specific for the 12.0-RELEASE notes, they are just part of the
doc build. I guess the doc repository refers to now deleted man(4) entries.

René
___
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: r339580 - stable/11/sys/netpfil/ipfw

2018-10-22 Thread Andrey V. Elsukov
Author: ae
Date: Mon Oct 22 07:04:44 2018
New Revision: 339580
URL: https://svnweb.freebsd.org/changeset/base/339580

Log:
  MFC r339357:
Add extra parentheses to fix "versrcreach" opcode, (oif != NULL) should
not be used as condition for ternary operator.
  
Submitted by:   Tatsuki Makino 

Modified:
  stable/11/sys/netpfil/ipfw/ip_fw2.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c
==
--- stable/11/sys/netpfil/ipfw/ip_fw2.c Mon Oct 22 06:44:20 2018
(r339579)
+++ stable/11/sys/netpfil/ipfw/ip_fw2.c Mon Oct 22 07:04:44 2018
(r339580)
@@ -2353,13 +2353,13 @@ do {
\
 
case O_VERSRCREACH:
/* Outgoing packets automatically pass/match */
-   match = (hlen > 0 && ((oif != NULL) ||
+   match = (hlen > 0 && ((oif != NULL) || (
 #ifdef INET6
is_ipv6 ?
verify_path6(&(args->f_id.src_ip6),
NULL, args->f_id.fib) :
 #endif
-   verify_path(src_ip, NULL, args->f_id.fib)));
+   verify_path(src_ip, NULL, 
args->f_id.fib;
break;
 
case O_ANTISPOOF:
___
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: r339579 - head/sys/amd64/amd64

2018-10-22 Thread Mateusz Guzik
Author: mjg
Date: Mon Oct 22 06:44:20 2018
New Revision: 339579
URL: https://svnweb.freebsd.org/changeset/base/339579

Log:
  amd64: finish the tail in memset with an overlapping store
  
  Instead of finding the exact size to fit in we can just shift the target
  by -8 + tail. Doing a blind write to a previously rep stosq'ed area comes
  with a penalty so do it conditionally.
  
  Sample win on EPYC when zeroing a 257 sized buffer (tail = 1) aligned to
  16 bytes:
  before: 44782846 ops/s
  after:  46118614 ops/s
  
  Idea stolen from NetBSD.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/amd64/amd64/support.S

Modified: head/sys/amd64/amd64/support.S
==
--- head/sys/amd64/amd64/support.S  Mon Oct 22 04:12:51 2018
(r339578)
+++ head/sys/amd64/amd64/support.S  Mon Oct 22 06:44:20 2018
(r339579)
@@ -524,9 +524,12 @@ END(memcpy_erms)
rep
stosq
movq%r9,%rax
-   movq%rdx,%rcx
-   andb$7,%cl
-   jne 1004b
+   andl$7,%edx
+   jnz 1f
+   POP_FRAME_POINTER
+   ret
+1:
+   movq%r10,-8(%rdi,%rdx)
 .endif
POP_FRAME_POINTER
ret
___
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"