svn commit: r356937 - head/sys/conf

2020-01-20 Thread Kyle Evans
Author: kevans
Date: Tue Jan 21 05:01:11 2020
New Revision: 356937
URL: https://svnweb.freebsd.org/changeset/base/356937

Log:
  sysent.mk: split interpreter out of target command
  
  The main objective here is to make it easy to identify what needs to change
  in order to use a different sysent generator than the current Lua-based one,
  which may be used to MFC some of the changes that have happened so we can
  avoid parallel accidents in stable branches, for instance.
  
  As a secondary objective, it's now feasible to override the generator on a
  per-Makefile basis if needed, so that one could refactor their Makefile to
  use this while pinning generation to the legacy makesyscalls.sh. I don't
  anticipate any consistent need for such a thing, but it's low-effort to
  achieve.

Modified:
  head/sys/conf/sysent.mk

Modified: head/sys/conf/sysent.mk
==
--- head/sys/conf/sysent.mk Tue Jan 21 00:12:57 2020(r356936)
+++ head/sys/conf/sysent.mk Tue Jan 21 05:01:11 2020(r356937)
@@ -21,8 +21,11 @@ SYSENT_CONF?=syscalls.conf
 # and set GENERATED.
 SRCS+= ${SYSENT_FILE}
 SRCS+= ${SYSENT_CONF}
-MAKESYSCALLS=  ${SYSDIR}/tools/makesyscalls.lua
 
+MAKESYSCALLS_INTERP?=  ${LUA}
+MAKESYSCALLS_SCRIPT?=  ${SYSDIR}/tools/makesyscalls.lua
+MAKESYSCALLS=  ${MAKESYSCALLS_INTERP} ${MAKESYSCALLS_SCRIPT}
+
 all:
@echo "make sysent only"
 
@@ -31,5 +34,5 @@ all:
 .ORDER: ${GENERATED}
 sysent: ${GENERATED}
 
-${GENERATED}: ${MAKESYSCALLS} ${SRCS}
-   ${LUA} ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF}
+${GENERATED}: ${MAKESYSCALLS_SCRIPT} ${SRCS}
+   ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF}
___
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: r356936 - head/sys/vm

2020-01-20 Thread Jeff Roberson
Author: jeff
Date: Tue Jan 21 00:12:57 2020
New Revision: 356936
URL: https://svnweb.freebsd.org/changeset/base/356936

Log:
  Move readahead and dropbehind fault functionality into a helper routine for
  clarity.
  
  Reviewed by:  dougm, kib, markj
  Differential Revision:https://reviews.freebsd.org/D23282

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Mon Jan 20 23:44:10 2020(r356935)
+++ head/sys/vm/vm_fault.c  Tue Jan 21 00:12:57 2020(r356936)
@@ -120,6 +120,7 @@ __FBSDID("$FreeBSD$");
 #defineVM_FAULT_DONTNEED_MIN   1048576
 
 struct faultstate {
+   vm_offset_t vaddr;
vm_page_t m;
vm_page_t m_cow;
vm_object_t object;
@@ -680,6 +681,59 @@ vm_fault_lock_vnode(struct faultstate *fs, bool objloc
 }
 
 /*
+ * Calculate the desired readahead.  Handle drop-behind.
+ *
+ * Returns the number of readahead blocks to pass to the pager.
+ */
+static int
+vm_fault_readahead(struct faultstate *fs)
+{
+   int era, nera;
+   u_char behavior;
+
+   KASSERT(fs->lookup_still_valid, ("map unlocked"));
+   era = fs->entry->read_ahead;
+   behavior = vm_map_entry_behavior(fs->entry);
+   if (behavior == MAP_ENTRY_BEHAV_RANDOM) {
+   nera = 0;
+   } else if (behavior == MAP_ENTRY_BEHAV_SEQUENTIAL) {
+   nera = VM_FAULT_READ_AHEAD_MAX;
+   if (fs->vaddr == fs->entry->next_read)
+   vm_fault_dontneed(fs, fs->vaddr, nera);
+   } else if (fs->vaddr == fs->entry->next_read) {
+   /*
+* This is a sequential fault.  Arithmetically
+* increase the requested number of pages in
+* the read-ahead window.  The requested
+* number of pages is "# of sequential faults
+* x (read ahead min + 1) + read ahead min"
+*/
+   nera = VM_FAULT_READ_AHEAD_MIN;
+   if (era > 0) {
+   nera += era + 1;
+   if (nera > VM_FAULT_READ_AHEAD_MAX)
+   nera = VM_FAULT_READ_AHEAD_MAX;
+   }
+   if (era == VM_FAULT_READ_AHEAD_MAX)
+   vm_fault_dontneed(fs, fs->vaddr, nera);
+   } else {
+   /*
+* This is a non-sequential fault.
+*/
+   nera = 0;
+   }
+   if (era != nera) {
+   /*
+* A read lock on the map suffices to update
+* the read ahead count safely.
+*/
+   fs->entry->read_ahead = nera;
+   }
+
+   return (nera);
+}
+
+/*
  * Wait/Retry if the page is busy.  We have to do this if the page is
  * either exclusive or shared busy because the vm_pager may be using
  * read busy for pageouts (and even pageins if it is the vnode pager),
@@ -725,7 +779,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa
vm_offset_t e_end, e_start;
vm_pindex_t retry_pindex;
vm_prot_t prot, retry_prot;
-   int ahead, alloc_req, behind, cluster_offset, era, faultcount;
+   int ahead, alloc_req, behind, cluster_offset, faultcount;
int nera, oom, result, rv;
u_char behavior;
boolean_t wired;/* Passed by reference. */
@@ -737,6 +791,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa
return (KERN_PROTECTION_FAILURE);
 
fs.vp = NULL;
+   fs.vaddr = vaddr;
faultcount = 0;
nera = -1;
hardfault = false;
@@ -989,45 +1044,7 @@ readrest:
 * apply to subsequent objects in the shadow chain.
 */
if (nera == -1 && !P_KILLED(curproc)) {
-   KASSERT(fs.lookup_still_valid, ("map unlocked"));
-   era = fs.entry->read_ahead;
-   behavior = vm_map_entry_behavior(fs.entry);
-   if (behavior == MAP_ENTRY_BEHAV_RANDOM) {
-   nera = 0;
-   } else if (behavior == MAP_ENTRY_BEHAV_SEQUENTIAL) {
-   nera = VM_FAULT_READ_AHEAD_MAX;
-   if (vaddr == fs.entry->next_read)
-   vm_fault_dontneed(, vaddr, nera);
-   } else if (vaddr == fs.entry->next_read) {
-   /*
-* This is a sequential fault.  Arithmetically
-* increase the requested number of pages in
-* the read-ahead window.  The requested
-* number of pages is "# of sequential faults
-* x (read ahead min + 1) + read ahead min"
-*/
-   

svn commit: r356934 - head/lib/libc/stdlib

2020-01-20 Thread Conrad Meyer
Author: cem
Date: Mon Jan 20 23:43:47 2020
New Revision: 356934
URL: https://svnweb.freebsd.org/changeset/base/356934

Log:
  libc: Delete unused rand.c ifdef TEST code

Modified:
  head/lib/libc/stdlib/rand.c

Modified: head/lib/libc/stdlib/rand.c
==
--- head/lib/libc/stdlib/rand.c Mon Jan 20 22:49:52 2020(r356933)
+++ head/lib/libc/stdlib/rand.c Mon Jan 20 23:43:47 2020(r356934)
@@ -45,10 +45,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "un-namespace.h"
 
-#ifdef TEST
-#include 
-#endif /* TEST */
-
 static int
 do_rand(unsigned long *ctx)
 {
@@ -116,33 +112,3 @@ __sranddev_fbsd12(void)
}
 }
 __sym_compat(sranddev, __sranddev_fbsd12, FBSD_1.0);
-
-
-#ifdef TEST
-
-main()
-{
-int i;
-unsigned myseed;
-
-printf("seeding rand with 0x19610910: \n");
-srand(0x19610910);
-
-printf("generating three pseudo-random numbers:\n");
-for (i = 0; i < 3; i++)
-{
-   printf("next random number = %d\n", rand());
-}
-
-printf("generating the same sequence with rand_r:\n");
-myseed = 0x19610910;
-for (i = 0; i < 3; i++)
-{
-   printf("next random number = %d\n", rand_r());
-}
-
-return 0;
-}
-
-#endif /* TEST */
-
___
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: r356935 - head/lib/libc/stdlib

2020-01-20 Thread Conrad Meyer
Author: cem
Date: Mon Jan 20 23:44:10 2020
New Revision: 356935
URL: https://svnweb.freebsd.org/changeset/base/356935

Log:
  random.3: Some minor improvements to wording/clarity

Modified:
  head/lib/libc/stdlib/random.3

Modified: head/lib/libc/stdlib/random.3
==
--- head/lib/libc/stdlib/random.3   Mon Jan 20 23:43:47 2020
(r356934)
+++ head/lib/libc/stdlib/random.3   Mon Jan 20 23:44:10 2020
(r356935)
@@ -28,7 +28,7 @@
 .\" @(#)random.3   8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd April 22, 2019
+.Dd January 20, 2020
 .Dt RANDOM 3
 .Os
 .Sh NAME
@@ -60,7 +60,7 @@ Applications which require unpredictable random number
 instead.
 .Ef
 .Pp
-The
+Unless initialized with less than 32 bytes of state, the
 .Fn random
 function
 uses a non-linear additive feedback random number generator employing a
@@ -72,53 +72,51 @@ The period of this random number generator is very lar
 .if t 16\(mu(2\u\s731\s10\d\(mi1).
 .if n 16*((2**31)\(mi1).
 .Pp
+If initialized with less than 32 bytes of state,
+.Fn random
+uses the same poor-quality Park-Miller LCG as
+.Xr rand 3 .
+.Pp
 The
 .Fn random
 and
 .Fn srandom
-functions have (almost) the same calling sequence and initialization 
properties as the
+functions are analagous to
 .Xr rand 3
 and
-.Xr srand 3
-functions.
+.Xr srand 3 .
 The difference is that
 .Xr rand 3
-produces a much less random sequence \(em in fact, the low dozen bits
-generated by rand go through a cyclic pattern.
-All the bits generated by
-.Fn random
-are usable.
-For example,
-.Sq Li random()&01
-will produce a random binary
-value.
+is a worse pseudo-random number generator.
 .Pp
 Like
 .Xr rand 3 ,
 .Fn random
-will by default produce a sequence of numbers that can be duplicated
-by calling
-.Fn srandom
-with
-.Ql 1
-as the seed.
+is implicitly initialized as if
+.Fn srandom "1"
+had been invoked explicitly.
 .Pp
 The
 .Fn srandomdev
-routine initializes a state array using
-pseudo-random numbers obtained from the kernel.
-Note that this particular seeding
-procedure can generate states which are impossible to reproduce by
-calling
-.Fn srandom
-with any value, since the succeeding terms in the
-state buffer are no longer derived from the LC algorithm applied to
-a fixed seed.
+routine initializes the state array using random numbers obtained from the
+kernel.
+This can generate states which are impossible to reproduce by calling
+.Fn srandom ,
+because the succeeding terms in the state buffer are no longer derived from the
+Park-Miller LCG algorithm applied to a fixed seed.
 .Pp
 The
 .Fn initstate
-routine allows a state array, passed in as an argument, to be initialized
-for future use.
+routine initializes the provided state array of
+.Vt uint32_t
+values and uses it in future
+.Fn random
+invocations.
+(Despite the
+.Vt char *
+type of
+.Fa state ,
+the underlying object must be a naturally aligned array of 32-bit values.)
 The size of the state array (in bytes) is used by
 .Fn initstate
 to decide how sophisticated a random number generator it should use \(em the
@@ -127,26 +125,21 @@ more state, the better the random numbers will be.
 8, 32, 64, 128, and 256 bytes; other amounts will be rounded down to
 the nearest known amount.
 Using less than 8 bytes will cause an error.)
-The seed for the initialization (which specifies a starting point for
-the random number sequence, and provides for restarting at the same
-point) is also an argument.
 The
+.Fa seed
+is used as in
+.Fn srandom .
+The
 .Fn initstate
 function
 returns a pointer to the previous state information array.
 .Pp
-Once a state has been initialized, the
-.Fn setstate
-routine provides for rapid switching between states.
 The
 .Fn setstate
-function
-returns a pointer to the previous state array; its
-argument state array is used for further random number generation
-until the next call to
-.Fn initstate
-or
-.Fn setstate .
+routine switches
+.Fn random
+to using the provided state.
+It returns a pointer to the previous state.
 .Pp
 Once a state array has been initialized, it may be restarted at a
 different point either by calling
___
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: r356933 - head/sys/vm

2020-01-20 Thread Jeff Roberson
Author: jeff
Date: Mon Jan 20 22:49:52 2020
New Revision: 356933
URL: https://svnweb.freebsd.org/changeset/base/356933

Log:
  Reduce object locking in vm_fault.  Once we have an exclusively busied page we
  no longer need an object lock.  This reduces the longest hold times and
  eliminates some trylock code blocks.
  
  Reviewed by:  kib, markj
  Differential Revision:https://reviews.freebsd.org/D23034

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Mon Jan 20 22:15:33 2020(r356932)
+++ head/sys/vm/vm_fault.c  Mon Jan 20 22:49:52 2020(r356933)
@@ -342,10 +342,10 @@ vm_fault_soft_fast(struct faultstate *fs, vm_offset_t 
*m_hold = m;
vm_page_wire(m);
}
-   vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags);
if (psind == 0 && !wired)
vm_fault_prefault(fs, vaddr, PFBAK, PFFOR, true);
VM_OBJECT_RUNLOCK(fs->first_object);
+   vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags);
vm_map_lookup_done(fs->map, fs->entry);
curthread->td_ru.ru_minflt++;
 
@@ -632,7 +632,7 @@ vm_fault_trap(vm_map_t map, vm_offset_t vaddr, vm_prot
 }
 
 static int
-vm_fault_lock_vnode(struct faultstate *fs)
+vm_fault_lock_vnode(struct faultstate *fs, bool objlocked)
 {
struct vnode *vp;
int error, locked;
@@ -668,7 +668,10 @@ vm_fault_lock_vnode(struct faultstate *fs)
}
 
vhold(vp);
-   unlock_and_deallocate(fs);
+   if (objlocked)
+   unlock_and_deallocate(fs);
+   else
+   fault_deallocate(fs);
error = vget(vp, locked | LK_RETRY | LK_CANRECURSE, curthread);
vdrop(vp);
fs->vp = vp;
@@ -863,9 +866,11 @@ RetryFault_oom:
 */
if (!vm_page_all_valid(fs.m))
goto readrest;
-   break; /* break to PAGE HAS BEEN FOUND */
+   VM_OBJECT_WUNLOCK(fs.object);
+   break; /* break to PAGE HAS BEEN FOUND. */
}
KASSERT(fs.m == NULL, ("fs.m should be NULL, not %p", fs.m));
+   VM_OBJECT_ASSERT_WLOCKED(fs.object);
 
/*
 * Page is not resident.  If the pager might contain the page
@@ -876,7 +881,7 @@ RetryFault_oom:
if (fs.object->type != OBJT_DEFAULT ||
fs.object == fs.first_object) {
if ((fs.object->flags & OBJ_SIZEVNLOCK) != 0) {
-   rv = vm_fault_lock_vnode();
+   rv = vm_fault_lock_vnode(, true);
MPASS(rv == KERN_SUCCESS ||
rv == KERN_RESOURCE_SHORTAGE);
if (rv == KERN_RESOURCE_SHORTAGE)
@@ -956,12 +961,23 @@ RetryFault_oom:
 
 readrest:
/*
+* Default objects have no pager so no exclusive busy exists
+* to protect this page in the chain.  Skip to the next
+* object without dropping the lock to preserve atomicity of
+* shadow faults.
+*/
+   if (fs.object->type == OBJT_DEFAULT)
+   goto next;
+
+   /*
 * At this point, we have either allocated a new page or found
 * an existing page that is only partially valid.
 *
 * We hold a reference on the current object and the page is
-* exclusive busied.
+* exclusive busied.  The exclusive busy prevents simultaneous
+* faults and collapses while the object lock is dropped.
 */
+   VM_OBJECT_WUNLOCK(fs.object);
 
/*
 * If the pager for the current object might have the page,
@@ -972,8 +988,7 @@ readrest:
 * have the page, the number of additional pages to read will
 * apply to subsequent objects in the shadow chain.
 */
-   if (fs.object->type != OBJT_DEFAULT && nera == -1 &&
-   !P_KILLED(curproc)) {
+   if (nera == -1 && !P_KILLED(curproc)) {
KASSERT(fs.lookup_still_valid, ("map unlocked"));
era = fs.entry->read_ahead;
behavior = vm_map_entry_behavior(fs.entry);
@@ -1039,7 +1054,7 @@ readrest:
 */
unlock_map();
 
-   rv = vm_fault_lock_vnode();
+   rv = vm_fault_lock_vnode(, false);
MPASS(rv == KERN_SUCCESS ||
rv == KERN_RESOURCE_SHORTAGE);
if (rv == KERN_RESOURCE_SHORTAGE)
@@ -1080,15 +1095,14 @@ 

svn commit: r356932 - stable/12/sys/dev/vmware/vmxnet3

2020-01-20 Thread Vincenzo Maffione
Author: vmaffione
Date: Mon Jan 20 22:15:33 2020
New Revision: 356932
URL: https://svnweb.freebsd.org/changeset/base/356932

Log:
  MFC r356703
  
  vmx: fix initialization of TSO related descriptor fields
  
  Fix a mistake introduced by r343291, which ported the vmx(4)
  driver to iflib.
  In case of TSO, the hlen field of the (first) tx descriptor must
  be initialized to the cumulative length of Ethernet, IP and TCP
  headers. The length of the TCP header was missing.
  
  PR: 236999
  Reported by:pkelsey
  Reviewed by:avg
  Differential Revision:  https://reviews.freebsd.org/D22967

Modified:
  stable/12/sys/dev/vmware/vmxnet3/if_vmx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmx.c
==
--- stable/12/sys/dev/vmware/vmxnet3/if_vmx.c   Mon Jan 20 20:27:51 2020
(r356931)
+++ stable/12/sys/dev/vmware/vmxnet3/if_vmx.c   Mon Jan 20 22:15:33 2020
(r356932)
@@ -1320,7 +1320,7 @@ vmxnet3_isc_txd_encap(void *vsc, if_pkt_info_t pi)
hdrlen = pi->ipi_ehdrlen + pi->ipi_ip_hlen;
if (pi->ipi_csum_flags & CSUM_TSO) {
sop->offload_mode = VMXNET3_OM_TSO;
-   sop->hlen = hdrlen;
+   sop->hlen = hdrlen + pi->ipi_tcp_hlen;
sop->offload_pos = pi->ipi_tso_segsz;
} else if (pi->ipi_csum_flags & (VMXNET3_CSUM_OFFLOAD |
VMXNET3_CSUM_OFFLOAD_IPV6)) {
___
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: r356930 - in head/contrib/llvm-project: clang compiler-rt libcxx libunwind lld lldb llvm openmp

2020-01-20 Thread Dimitry Andric
Author: dim
Date: Mon Jan 20 20:26:04 2020
New Revision: 356930
URL: https://svnweb.freebsd.org/changeset/base/356930

Log:
  Add more Subversion mergeinfo bootstrap information, to hopefully
  increase the probability of merging in vendor changes.

Modified:
Directory Properties:
  head/contrib/llvm-project/clang/   (props changed)
  head/contrib/llvm-project/compiler-rt/   (props changed)
  head/contrib/llvm-project/libcxx/   (props changed)
  head/contrib/llvm-project/libunwind/   (props changed)
  head/contrib/llvm-project/lld/   (props changed)
  head/contrib/llvm-project/lldb/   (props changed)
  head/contrib/llvm-project/llvm/   (props changed)
  head/contrib/llvm-project/openmp/   (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: r356929 - in head/contrib/llvm-project: clang/lib/Basic/Targets clang/lib/Driver/ToolChains/Arch llvm/include/llvm/ADT llvm/lib/Support llvm/lib/Target/PowerPC

2020-01-20 Thread Dimitry Andric
Author: dim
Date: Mon Jan 20 20:10:28 2020
New Revision: 356929
URL: https://svnweb.freebsd.org/changeset/base/356929

Log:
  Merge commit bc4bc5aa0 from llvm git (by Justin Hibbits):
  
Add 8548 CPU definition and attributes
  
8548 CPU is GCC's name for the e500v2, so accept this in clang.  The
e500v2 doesn't support lwsync, so define __NO_LWSYNC__ for this as
well, as GCC does.
  
Differential Revision:  https://reviews.llvm.org/D67787
  
  Merge commit ff0311c4b from llvm git (by Justin Hibbits):
  
[PowerPC]: Add powerpcspe target triple subarch component
  
Summary:
This allows the use of '-target powerpcspe-unknown-linux-gnu' or
'powerpcspe-unknown-freebsd' to be used, instead of '-target
powerpc-unknown-linux-gnu -mspe'.
  
Reviewed By: dim
Differential Revision: https://reviews.llvm.org/D72014
  
  Merge commit ba91dffaf from llvm git (by Fangrui Song):
  
[Driver][PowerPC] Move powerpcspe logic from cc1 to Driver
  
Follow-up of D72014. It is more appropriate to use a target feature
instead of a SubTypeArch to express the difference.
  
Reviewed By: #powerpc, jhibbits
  
Differential Revision: https://reviews.llvm.org/D72433
  
  commit 36eedfcb3 from llvm git (by Justin Hibbits):
  
[PowerPC] Fix powerpcspe subtarget enablement in llvm backend
  
Summary:
  
As currently written, -target powerpcspe will enable SPE regardless
of disabling the feature later on in the command line.  Instead,
change this to just set a default CPU to 'e500' instead of a generic
CPU.
  
As part of this, add FeatureSPE to the e500 definition.
  
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D72673
  
  These are needed to unbreak the build for powerpcspe.
  
  Requested by: jhibbits
  MFC after:1 week

Modified:
  head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp
  head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h
  head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/PPC.cpp
  head/contrib/llvm-project/llvm/include/llvm/ADT/Triple.h
  head/contrib/llvm-project/llvm/lib/Support/Triple.cpp
  head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPC.td
  head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp

Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp
==
--- head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp   Mon Jan 20 
19:56:22 2020(r356928)
+++ head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp   Mon Jan 20 
20:10:28 2020(r356929)
@@ -157,6 +157,8 @@ void PPCTargetInfo::getTargetDefines(const LangOptions
 Builder.defineMacro("_ARCH_A2Q");
 Builder.defineMacro("_ARCH_QP");
   }
+  if (ArchDefs & ArchDefineE500)
+Builder.defineMacro("__NO_LWSYNC__");
 
   if (getTriple().getVendor() == llvm::Triple::BGQ) {
 Builder.defineMacro("__bg__");
@@ -312,6 +314,11 @@ bool PPCTargetInfo::initFeatureMap(
 .Case("pwr8", true)
 .Default(false);
 
+  Features["spe"] = llvm::StringSwitch(CPU)
+.Case("8548", true)
+.Case("e500", true)
+.Default(false);
+
   if (!ppcUserFeaturesCheck(Diags, FeaturesVec))
 return false;
 
@@ -449,16 +456,16 @@ ArrayRef PPCTargetInfo::getGC
 }
 
 static constexpr llvm::StringLiteral ValidCPUNames[] = {
-{"generic"}, {"440"}, {"450"}, {"601"},{"602"},
-{"603"}, {"603e"},{"603ev"},   {"604"},{"604e"},
-{"620"}, {"630"}, {"g3"},  {"7400"},   {"g4"},
-{"7450"},{"g4+"}, {"750"}, {"970"},{"g5"},
-{"a2"},  {"a2q"}, {"e500mc"},  {"e5500"},  {"power3"},
-{"pwr3"},{"power4"},  {"pwr4"},{"power5"}, {"pwr5"},
-{"power5x"}, {"pwr5x"},   {"power6"},  {"pwr6"},   {"power6x"},
-{"pwr6x"},   {"power7"},  {"pwr7"},{"power8"}, {"pwr8"},
-{"power9"},  {"pwr9"},{"powerpc"}, {"ppc"},{"powerpc64"},
-{"ppc64"},   {"powerpc64le"}, {"ppc64le"},
+{"generic"},   {"440"},   {"450"}, {"601"}, {"602"},
+{"603"},   {"603e"},  {"603ev"},   {"604"}, {"604e"},
+{"620"},   {"630"},   {"g3"},  {"7400"},{"g4"},
+{"7450"},  {"g4+"},   {"750"}, {"8548"},{"970"},
+{"g5"},{"a2"},{"a2q"}, {"e500"},{"e500mc"},
+{"e5500"}, {"power3"},{"pwr3"},{"power4"},  {"pwr4"},
+{"power5"},{"pwr5"},  {"power5x"}, {"pwr5x"},   {"power6"},
+{"pwr6"},  {"power6x"},   {"pwr6x"},   {"power7"},  {"pwr7"},
+{"power8"},{"pwr8"},  {"power9"},  {"pwr9"},
{"powerpc"},
+{"ppc"},   {"powerpc64"}, {"ppc64"},   {"powerpc64le"}, 
{"ppc64le"},
 };
 
 bool 

svn commit: r356928 - head/tools/build/mk

2020-01-20 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Jan 20 19:56:22 2020
New Revision: 356928
URL: https://svnweb.freebsd.org/changeset/base/356928

Log:
  When MK_CASPER=no is set remove files which are not needed to run system.
  
  PR:   242971

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Jan 20 19:52:23 
2020(r356927)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Jan 20 19:56:22 
2020(r356928)
@@ -1141,6 +1141,15 @@ OLD_DIRS+=usr/tests/usr.bin/calendar
 .endif
 
 .if ${MK_CASPER} == no
+OLD_LIBS+=lib/libcasper.so.1
+OLD_LIBS+=lib/casper/libcap_dns.so.2
+OLD_LIBS+=lib/casper/libcap_fileargs.so.1
+OLD_LIBS+=lib/casper/libcap_grp.so.1
+OLD_LIBS+=lib/casper/libcap_net.so.1
+OLD_LIBS+=lib/casper/libcap_pwd.so.1
+OLD_LIBS+=lib/casper/libcap_sysctl.so.1
+OLD_LIBS+=lib/casper/libcap_sysctl.so.2
+OLD_LIBS+=lib/casper/libcap_syslog.so.1
 .endif
 
 .if ${MK_CCD} == no
___
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: r356927 - head/sys/kern

2020-01-20 Thread Mateusz Guzik
Author: mjg
Date: Mon Jan 20 19:52:23 2020
New Revision: 356927
URL: https://svnweb.freebsd.org/changeset/base/356927

Log:
  cache: revert r352613 now that vhold does not take locks

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Mon Jan 20 19:51:53 2020(r356926)
+++ head/sys/kern/vfs_cache.c   Mon Jan 20 19:52:23 2020(r356927)
@@ -1701,7 +1701,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
uint32_t hash;
int flag;
int len;
-   bool held_dvp;
u_long lnumcache;
 
CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr);
@@ -1738,13 +1737,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
ndd = NULL;
ncp_ts = NULL;
 
-   held_dvp = false;
-   if (LIST_EMPTY(>v_cache_src) && flag != NCF_ISDOTDOT) {
-   vhold(dvp);
-   counter_u64_add(numcachehv, 1);
-   held_dvp = true;
-   }
-
/*
 * Calculate the hash key and setup as much of the new
 * namecache entry as possible before acquiring the lock.
@@ -1834,21 +1826,8 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
 
if (flag != NCF_ISDOTDOT) {
if (LIST_EMPTY(>v_cache_src)) {
-   if (!held_dvp) {
-   vhold(dvp);
-   counter_u64_add(numcachehv, 1);
-   }
-   } else {
-   if (held_dvp) {
-   /*
-* This will not take the interlock as someone
-* else already holds the vnode on account of
-* the namecache and we hold locks preventing
-* this from changing.
-*/
-   vdrop(dvp);
-   counter_u64_add(numcachehv, -1);
-   }
+   vhold(dvp);
+   counter_u64_add(numcachehv, 1);
}
LIST_INSERT_HEAD(>v_cache_src, ncp, nc_src);
}
@@ -1883,10 +1862,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
 out_unlock_free:
cache_enter_unlock();
cache_free(ncp);
-   if (held_dvp) {
-   vdrop(dvp);
-   counter_u64_add(numcachehv, -1);
-   }
return;
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r356926 - head/tools/build/mk

2020-01-20 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Jan 20 19:51:53 2020
New Revision: 356926
URL: https://svnweb.freebsd.org/changeset/base/356926

Log:
  Even when the MK_CASPER is set to "no" we still want to install man pages
  and the headers. If the user decides to install the system without Casper
  support, then the Casper functions are mocked, but they still exist in
  the system.
  
  PR:   242971
  MFC after:2 weeks

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Jan 20 19:47:58 
2020(r356925)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Jan 20 19:51:53 
2020(r356926)
@@ -1141,19 +1141,6 @@ OLD_DIRS+=usr/tests/usr.bin/calendar
 .endif
 
 .if ${MK_CASPER} == no
-OLD_FILES+=usr/include/libcasper.h
-OLD_FILES+=usr/share/man/man3/cap_clone.3.gz
-OLD_FILES+=usr/share/man/man3/cap_close.3.gz
-OLD_FILES+=usr/share/man/man3/cap_init.3.gz
-OLD_FILES+=usr/share/man/man3/cap_limit_get.3.gz
-OLD_FILES+=usr/share/man/man3/cap_limit_set.3.gz
-OLD_FILES+=usr/share/man/man3/cap_recv_nvlist.3.gz
-OLD_FILES+=usr/share/man/man3/cap_send_nvlist.3.gz
-OLD_FILES+=usr/share/man/man3/cap_service_open.3.gz
-OLD_FILES+=usr/share/man/man3/cap_sock.3.gz
-OLD_FILES+=usr/share/man/man3/cap_unwrap.3.gz
-OLD_FILES+=usr/share/man/man3/cap_wrap.3.gz
-OLD_FILES+=usr/share/man/man3/cap_xfer_nvlist.3.gz
 .endif
 
 .if ${MK_CCD} == no
___
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: r356925 - head/tools/build/mk

2020-01-20 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Jan 20 19:47:58 2020
New Revision: 356925
URL: https://svnweb.freebsd.org/changeset/base/356925

Log:
  Those files are already removed in ObsoleteFiles.\
  There is no need to remove them twice.
  
  PR:   242971
  MFC after:2 weeks

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Jan 20 19:38:29 
2020(r356924)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Jan 20 19:47:58 
2020(r356925)
@@ -1141,44 +1141,7 @@ OLD_DIRS+=usr/tests/usr.bin/calendar
 .endif
 
 .if ${MK_CASPER} == no
-OLD_FILES+=etc/casper/system.dns
-OLD_FILES+=etc/casper/system.grp
-OLD_FILES+=etc/casper/system.pwd
-OLD_FILES+=etc/casper/system.random
-OLD_FILES+=etc/casper/system.sysctl
-OLD_DIRS+=etc/casper
-OLD_FILES+=etc/rc.d/casperd
-OLD_LIBS+=lib/libcapsicum.so.0
-OLD_LIBS+=lib/libcasper.so.0
-OLD_FILES+=libexec/casper/dns
-OLD_FILES+=libexec/casper/grp
-OLD_FILES+=libexec/casper/pwd
-OLD_FILES+=libexec/casper/random
-OLD_FILES+=libexec/casper/sysctl
-OLD_FILES+=sbin/casper
-OLD_FILES+=sbin/casperd
-OLD_FILES+=usr/include/libcapsicum.h
-OLD_FILES+=usr/include/libcapsicum_dns.h
-OLD_FILES+=usr/include/libcapsicum_grp.h
-OLD_FILES+=usr/include/libcapsicum_pwd.h
-OLD_FILES+=usr/include/libcapsicum_random.h
-OLD_FILES+=usr/include/libcapsicum_service.h
-OLD_FILES+=usr/include/libcapsicum_sysctl.h
 OLD_FILES+=usr/include/libcasper.h
-OLD_FILES+=usr/lib/libcapsicum.a
-OLD_FILES+=usr/lib/libcapsicum.so
-OLD_FILES+=usr/lib/libcapsicum_p.a
-OLD_FILES+=usr/lib/libcasper.a
-OLD_FILES+=usr/lib/libcasper.so
-OLD_FILES+=usr/lib/libcasper_p.a
-OLD_FILES+=usr/lib32/libcapsicum.a
-OLD_FILES+=usr/lib32/libcapsicum.so
-OLD_LIBS+=usr/lib32/libcapsicum.so.0
-OLD_FILES+=usr/lib32/libcapsicum_p.a
-OLD_FILES+=usr/lib32/libcasper.a
-OLD_FILES+=usr/lib32/libcasper.so
-OLD_LIBS+=usr/lib32/libcasper.so.0
-OLD_FILES+=usr/lib32/libcasper_p.a
 OLD_FILES+=usr/share/man/man3/cap_clone.3.gz
 OLD_FILES+=usr/share/man/man3/cap_close.3.gz
 OLD_FILES+=usr/share/man/man3/cap_init.3.gz
@@ -1191,8 +1154,6 @@ OLD_FILES+=usr/share/man/man3/cap_sock.3.gz
 OLD_FILES+=usr/share/man/man3/cap_unwrap.3.gz
 OLD_FILES+=usr/share/man/man3/cap_wrap.3.gz
 OLD_FILES+=usr/share/man/man3/cap_xfer_nvlist.3.gz
-OLD_FILES+=usr/share/man/man3/libcapsicum.3.gz
-OLD_FILES+=usr/share/man/man8/casperd.8.gz
 .endif
 
 .if ${MK_CCD} == no
___
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: r356924 - head/share/misc

2020-01-20 Thread Mikael Urankar
Author: mikael (ports committer)
Date: Mon Jan 20 19:38:29 2020
New Revision: 356924
URL: https://svnweb.freebsd.org/changeset/base/356924

Log:
  Add myself (mikael) as a ports committer
  
  Approved by:  manu (mentor)
  Differential Revision:https://reviews.freebsd.org/D23227

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

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotMon Jan 20 18:54:19 2020
(r356923)
+++ head/share/misc/committers-ports.dotMon Jan 20 19:38:29 2020
(r356924)
@@ -193,6 +193,7 @@ meta [label="Koichiro Iwao\nm...@freebsd.org\n2018/03/
 mezz [label="Jeremy Messenger\nm...@freebsd.org\n2004/04/30"]
 mfechner [label="Matthias Fechner\nmfech...@freebsd.org\n2018/03/01"]
 mharo [label="Michael Haro\nmh...@freebsd.org\n1999/04/13"]
+mikael [label="Mikael Urankar\nmik...@freebsd.org\n2020/01/16"]
 milki [label="Jonathan Chu\nmi...@freebsd.org\n2013/12/15"]
 misha [label="Mikhail Pchelin\nmi...@freebsd.org\n2016/11/15"]
 miwi [label="Martin Wilke\nm...@freebsd.org\n2006/06/04"]
@@ -539,6 +540,8 @@ lwhsu -> yzlin
 
 maho -> stephen
 maho -> tota
+
+manu -> mikael
 
 marcus -> ahze
 marcus -> bland
___
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: r356923 - stable/11/sys/dev/uart

2020-01-20 Thread Luiz Otavio O Souza
Author: loos
Date: Mon Jan 20 18:54:19 2020
New Revision: 356923
URL: https://svnweb.freebsd.org/changeset/base/356923

Log:
  MFC r336623 by mmacy:
  
  Fixes the interrupt storm in UART during the boot on ARMADA38X.  The missing
  attribution of ns8250->busy_detect breaks the UART support.
  
  Original commit log:
  
  Add busy detect quirk to list of console options
  
  This change allows one to set the busy_detect flag
  required by the synopsys UART at the loader prompt.
  This is needed by the EPYC 3000 SoC.
  
  This will give users a working console up to the point where getty is 
required:
  hw.uart.console="mm:0xfedc9000,rs:2,bd:1"
  
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  stable/11/sys/dev/uart/uart_dev_ns8250.c
  stable/11/sys/dev/uart/uart_subr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c
==
--- stable/11/sys/dev/uart/uart_dev_ns8250.cMon Jan 20 18:43:10 2020
(r356922)
+++ stable/11/sys/dev/uart/uart_dev_ns8250.cMon Jan 20 18:54:19 2020
(r356923)
@@ -479,6 +479,7 @@ ns8250_bus_attach(struct uart_softc *sc)
 
bas = >sc_bas;
 
+   ns8250->busy_detect = bas->busy_detect;
ns8250->mcr = uart_getreg(bas, REG_MCR);
ns8250->fcr = FCR_ENABLE;
if (!resource_int_value("uart", device_get_unit(sc->sc_dev), "flags",

Modified: stable/11/sys/dev/uart/uart_subr.c
==
--- stable/11/sys/dev/uart/uart_subr.c  Mon Jan 20 18:43:10 2020
(r356922)
+++ stable/11/sys/dev/uart/uart_subr.c  Mon Jan 20 18:54:19 2020
(r356923)
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #defineUART_TAG_RS 7
 #defineUART_TAG_SB 8
 #defineUART_TAG_XO 9
+#defineUART_TAG_BD 10
 
 static struct uart_class *uart_classes[] = {
_ns8250_class,
@@ -122,6 +123,10 @@ uart_parse_tag(const char **p)
 {
int tag;
 
+   if ((*p)[0] == 'b' && (*p)[1] == 'd') {
+   tag = UART_TAG_BD;
+   goto out;
+   }
if ((*p)[0] == 'b' && (*p)[1] == 'r') {
tag = UART_TAG_BR;
goto out;
@@ -177,6 +182,7 @@ out:
  * separated by commas. Each attribute is a tag-value pair with the tag and
  * value separated by a colon. Supported tags are:
  *
+ * bd = Busy Detect
  * br = Baudrate
  * ch = Channel
  * db = Data bits
@@ -240,6 +246,9 @@ uart_getenv(int devtype, struct uart_devinfo *di, stru
spec = cp;
for (;;) {
switch (uart_parse_tag()) {
+   case UART_TAG_BD:
+   di->bas.busy_detect = uart_parse_long();
+   break;
case UART_TAG_BR:
di->baudrate = uart_parse_long();
break;
___
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: r356922 - head/lib/libc/stdlib

2020-01-20 Thread Conrad Meyer
Author: cem
Date: Mon Jan 20 18:43:10 2020
New Revision: 356922
URL: https://svnweb.freebsd.org/changeset/base/356922

Log:
  qsort.3: Bump Dd and note that Annex K is optional

Modified:
  head/lib/libc/stdlib/qsort.3

Modified: head/lib/libc/stdlib/qsort.3
==
--- head/lib/libc/stdlib/qsort.3Mon Jan 20 18:21:55 2020
(r356921)
+++ head/lib/libc/stdlib/qsort.3Mon Jan 20 18:43:10 2020
(r356922)
@@ -32,7 +32,7 @@
 .\" @(#)qsort.38.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd January 14, 2020
+.Dd January 20, 2020
 .Dt QSORT 3
 .Os
 .Sh NAME
@@ -342,6 +342,13 @@ to replace
 with
 .Fn qsort_s
 to work around this problem.
+.Pp
+.Fn qsort_s
+is part of the
+.Em optional
+Annex K portion of
+.St -isoC-2011
+and may not be portable to other standards-conforming platforms.
 .Pp
 Previous versions of
 .Fn qsort
___
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: r356758 - in head/usr.sbin/bsdinstall: . scripts

2020-01-20 Thread Alexey Dokuchaev
On Tue, Jan 21, 2020 at 12:33:11AM +0700, Eugene Grosbein wrote:
> 21.01.2020 0:22, Alexey Dokuchaev wrote:
> > On Fri, Jan 17, 2020 at 08:17:11PM +0700, Eugene Grosbein wrote:
> >> ...
> >> It was fine before clang-[78]. Buy nowadays, yes, I'm forced to use
> >> multiple knobs for src.conf
> >>
> >> WITHOUT_LLVM_TARGET_ALL=
> >> WITH_LLVM_TARGET_X86=
> >> WITHOUT_CLANG_FULL=
> > 
> > Thanks, I've added them (with =yes part) to my /etc/src.conf as well.
> > I've noticed I also have WITHOUT_CLANG_EXTRAS=yes there, is this one
> > still needed/does any good?
> 
> Take a look at src/usr.bin/clang/Makefile, it seems WITH_CLANG_EXTRAS
> enables building multiple utilities like llvm versions of ar, as, nm,
> objcopy, objdump etc.

Hmm, I do have those (under /usr/bin) and they don't seem like being
*extras* but rather essential part of the toolchain.  I'll take a closer
look, perhaps I've added WITHOUT_CLANG_EXTRAS=yes *after* my last build
of the world, thanks.

./danfe
___
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: r356758 - in head/usr.sbin/bsdinstall: . scripts

2020-01-20 Thread Eugene Grosbein
21.01.2020 0:22, Alexey Dokuchaev wrote:
> On Fri, Jan 17, 2020 at 08:17:11PM +0700, Eugene Grosbein wrote:
>> ...
>> It was fine before clang-[78]. Buy nowadays, yes, I'm forced to use
>> multiple knobs for src.conf
>>
>> WITHOUT_LLVM_TARGET_ALL=
>> WITH_LLVM_TARGET_X86=
>> WITHOUT_CLANG_FULL=
> 
> Thanks, I've added them (with =yes part) to my /etc/src.conf as well.
> I've noticed I also have WITHOUT_CLANG_EXTRAS=yes there, is this one
> still needed/does any good?

Take a look at src/usr.bin/clang/Makefile, it seems WITH_CLANG_EXTRAS
enables building multiple utilities like llvm versions of ar, as, nm, objcopy, 
objdump etc.


___
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: r356919 - head/sys/x86/x86

2020-01-20 Thread Konstantin Belousov
Author: kib
Date: Mon Jan 20 17:23:03 2020
New Revision: 356919
URL: https://svnweb.freebsd.org/changeset/base/356919

Log:
  x86: Wait for curthread to be set up as an indicator that the boot stack
  is no longer used.
  
  pc_curthread is set by cpu_switch after it stopped using the old
  thread (or boot) stack.  This makes the smp_after_idle_runnable()
  function not dependent on the internals of the scheduler operations.
  
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D23276

Modified:
  head/sys/x86/x86/mp_x86.c

Modified: head/sys/x86/x86/mp_x86.c
==
--- head/sys/x86/x86/mp_x86.c   Mon Jan 20 16:59:39 2020(r356918)
+++ head/sys/x86/x86/mp_x86.c   Mon Jan 20 17:23:03 2020(r356919)
@@ -1092,13 +1092,12 @@ init_secondary_tail(void)
 static void
 smp_after_idle_runnable(void *arg __unused)
 {
-   struct thread *idle_td;
+   struct pcpu *pc;
int cpu;
 
for (cpu = 1; cpu < mp_ncpus; cpu++) {
-   idle_td = pcpu_find(cpu)->pc_idlethread;
-   while (atomic_load_int(_td->td_lastcpu) == NOCPU &&
-   atomic_load_int(_td->td_oncpu) == NOCPU)
+   pc = pcpu_find(cpu);
+   while (atomic_load_ptr(>pc_curthread) == (uintptr_t)NULL)
cpu_spinwait();
kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages *
PAGE_SIZE);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r356758 - in head/usr.sbin/bsdinstall: . scripts

2020-01-20 Thread Alexey Dokuchaev
On Fri, Jan 17, 2020 at 08:17:11PM +0700, Eugene Grosbein wrote:
> ...
> It was fine before clang-[78]. Buy nowadays, yes, I'm forced to use
> multiple knobs for src.conf
> 
> WITHOUT_LLVM_TARGET_ALL=
> WITH_LLVM_TARGET_X86=
> WITHOUT_CLANG_FULL=

Thanks, I've added them (with =yes part) to my /etc/src.conf as well.
I've noticed I also have WITHOUT_CLANG_EXTRAS=yes there, is this one
still needed/does any good?

./danfe
___
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: r356918 - head/share/man/man7

2020-01-20 Thread Baptiste Daroussin
Author: bapt
Date: Mon Jan 20 16:59:39 2020
New Revision: 356918
URL: https://svnweb.freebsd.org/changeset/base/356918

Log:
  The ports tree now accepts /usr/local/share/man as a directory for manpage
  and will slowly transition from /usr/local/man to it. To reflect this remove
  the documentation of the manpages being an exception in the layout of 
/usr/local
  
  Reported by:  Dan Nelson  (via IRC)
  MFC after:3 days

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

Modified: head/share/man/man7/hier.7
==
--- head/share/man/man7/hier.7  Mon Jan 20 15:38:05 2020(r356917)
+++ head/share/man/man7/hier.7  Mon Jan 20 16:59:39 2020(r356918)
@@ -28,7 +28,7 @@
 .\"@(#)hier.7  8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd September 10, 2019
+.Dd January 20, 2020
 .Dt HIER 7
 .Os
 .Sh NAME
@@ -420,12 +420,6 @@ for
 .Pa /usr
 should be used.
 Exceptions are the
-.Pa man
-directory
-.Po directly under
-.Pa local/
-rather than under
-.Pa local/share/ Ns Pc ,
 ports documentation
 .Po in
 .Pa share/doc// Ns Pc ,
___
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: r356915 - head/sys/kern

2020-01-20 Thread Konstantin Belousov
On Mon, Jan 20, 2020 at 02:42:11PM +, Mateusz Guzik wrote:
> Author: mjg
> Date: Mon Jan 20 14:42:11 2020
> New Revision: 356915
> URL: https://svnweb.freebsd.org/changeset/base/356915
> 
> Log:
>   cache: make numcachehv use counter(9) on all archs
>   
>   Requested by:   kib
Thank you.

> 
> Modified:
>   head/sys/kern/vfs_cache.c
> 
> Modified: head/sys/kern/vfs_cache.c
> ==
> --- head/sys/kern/vfs_cache.c Mon Jan 20 13:46:09 2020(r356914)
> +++ head/sys/kern/vfs_cache.c Mon Jan 20 14:42:11 2020(r356915)
> @@ -340,16 +340,6 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG
>  sizeof(struct namecache), "sizeof(struct namecache)");
>  
>  /*
> - * Use counter(9) for numcachehv if the machine is 64-bit.
> - *
> - * Stick to an atomic for the rest since there is no long-sized equivalent 
> and
> - * 64-bit size is both way more than needed and a pessimization.
> - */
> -#ifdef __LP64__
> -#define CACHE_NUMCACHEHV_U64
> -#endif
> -
> -/*
>   * The new name cache statistics
>   */
>  static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 0,
> @@ -361,12 +351,7 @@ static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 
>   SYSCTL_COUNTER_U64(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, , 
> descr);
>  STATNODE_ULONG(numneg, "Number of negative cache entries");
>  STATNODE_ULONG(numcache, "Number of cache entries");
> -#ifdef CACHE_NUMCACHEHV_U64
>  STATNODE_COUNTER(numcachehv, "Number of namecache entries with vnodes held");
> -#else
> -static u_long __exclusive_cache_line numcachehv;/* number of cache entries 
> with vnodes held */
> -STATNODE_ULONG(numcachehv, "Number of namecache entries with vnodes held");
> -#endif
>  STATNODE_COUNTER(numcalls, "Number of cache lookups");
>  STATNODE_COUNTER(dothits, "Number of '.' hits");
>  STATNODE_COUNTER(dotdothits, "Number of '..' hits");
> @@ -407,36 +392,6 @@ static int vn_fullpath1(struct thread *td, struct vnod
>  
>  static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries");
>  
> -#ifdef CACHE_NUMCACHEHV_U64
> -static void
> -cache_numcachehv_inc(void)
> -{
> -
> - counter_u64_add(numcachehv, 1);
> -}
> -
> -static void
> -cache_numcachehv_dec(void)
> -{
> -
> - counter_u64_add(numcachehv, -1);
> -}
> -#else
> -static void
> -cache_numcachehv_inc(void)
> -{
> -
> - atomic_add_long(, 1);
> -}
> -
> -static void
> -cache_numcachehv_dec(void)
> -{
> -
> - atomic_subtract_long(, 1);
> -}
> -#endif
> -
>  static int cache_yield;
>  SYSCTL_INT(_vfs_cache, OID_AUTO, yield, CTLFLAG_RD, _yield, 0,
>  "Number of times cache called yield");
> @@ -917,7 +872,7 @@ cache_zap_locked(struct namecache *ncp, bool neg_locke
>   LIST_REMOVE(ncp, nc_src);
>   if (LIST_EMPTY(>nc_dvp->v_cache_src)) {
>   ncp->nc_flag |= NCF_DVDROP;
> - cache_numcachehv_dec();
> + counter_u64_add(numcachehv, -1);
>   }
>   }
>   atomic_subtract_rel_long(, 1);
> @@ -1786,7 +1741,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
>   held_dvp = false;
>   if (LIST_EMPTY(>v_cache_src) && flag != NCF_ISDOTDOT) {
>   vhold(dvp);
> - cache_numcachehv_inc();
> + counter_u64_add(numcachehv, 1);
>   held_dvp = true;
>   }
>  
> @@ -1881,7 +1836,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
>   if (LIST_EMPTY(>v_cache_src)) {
>   if (!held_dvp) {
>   vhold(dvp);
> - cache_numcachehv_inc();
> + counter_u64_add(numcachehv, 1);
>   }
>   } else {
>   if (held_dvp) {
> @@ -1892,7 +1847,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
>* this from changing.
>*/
>   vdrop(dvp);
> - cache_numcachehv_dec();
> + counter_u64_add(numcachehv, -1);
>   }
>   }
>   LIST_INSERT_HEAD(>v_cache_src, ncp, nc_src);
> @@ -1930,7 +1885,7 @@ out_unlock_free:
>   cache_free(ncp);
>   if (held_dvp) {
>   vdrop(dvp);
> - cache_numcachehv_dec();
> + counter_u64_add(numcachehv, -1);
>   }
>   return;
>  }
> @@ -2001,9 +1956,7 @@ nchinit(void *dummy __unused)
>  
>   mtx_init(_shrink_lock, "ncnegs", NULL, MTX_DEF);
>  
> -#ifdef CACHE_NUMCACHEHV_U64
>   numcachehv = counter_u64_alloc(M_WAITOK);
> -#endif
>   numcalls = counter_u64_alloc(M_WAITOK);
>   dothits = counter_u64_alloc(M_WAITOK);
>   dotdothits = counter_u64_alloc(M_WAITOK);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To 

svn commit: r356917 - in stable: 11/share/man/man7 12/share/man/man7

2020-01-20 Thread Glen Barber
Author: gjb
Date: Mon Jan 20 15:38:05 2020
New Revision: 356917
URL: https://svnweb.freebsd.org/changeset/base/356917

Log:
  MFC r356792:
   Update release(7) to note OSRELEASE is only relevant when the
   'install' target is invoked.
  
   While here, bump the sample output version name, and explicitly
   add the 'obj' target to avoid polluting the src checkout.
  
  PR:   243287 (related)
  Sponsored by: Rubicon Communications, LLC (netgate.com)

Modified:
  stable/11/share/man/man7/release.7
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/share/man/man7/release.7
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/share/man/man7/release.7
==
--- stable/11/share/man/man7/release.7  Mon Jan 20 15:19:56 2020
(r356916)
+++ stable/11/share/man/man7/release.7  Mon Jan 20 15:38:05 2020
(r356917)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 28, 2018
+.Dd January 16, 2020
 .Dt RELEASE 7
 .Os
 .Sh NAME
@@ -570,8 +570,10 @@ target invoked by
 Optional variables:
 .Bl -tag -width ".Ev TARGET_ARCH"
 .It Ev OSRELEASE
-Optional base name for generated media images
-.Pq e.g., FreeBSD-9.0-RC2-amd64 .
+Optional base name for generated media images when invoking the
+.Cm install
+target
+.Pq e.g., FreeBSD-12.1-RELEASE-amd64 .
 Defaults to the output of
 .Ic `uname -s`-`uname -r`-`uname -p`
 within the chroot.
@@ -659,6 +661,7 @@ svn co svn://svn.freebsd.org/base/head src
 cd src
 make buildworld buildkernel
 cd release
+make obj
 make release
 make install DESTDIR=/var/freebsd-snapshot
 .Ed
___
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: r356917 - in stable: 11/share/man/man7 12/share/man/man7

2020-01-20 Thread Glen Barber
Author: gjb
Date: Mon Jan 20 15:38:05 2020
New Revision: 356917
URL: https://svnweb.freebsd.org/changeset/base/356917

Log:
  MFC r356792:
   Update release(7) to note OSRELEASE is only relevant when the
   'install' target is invoked.
  
   While here, bump the sample output version name, and explicitly
   add the 'obj' target to avoid polluting the src checkout.
  
  PR:   243287 (related)
  Sponsored by: Rubicon Communications, LLC (netgate.com)

Modified:
  stable/12/share/man/man7/release.7
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/share/man/man7/release.7
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/share/man/man7/release.7
==
--- stable/12/share/man/man7/release.7  Mon Jan 20 15:19:56 2020
(r356916)
+++ stable/12/share/man/man7/release.7  Mon Jan 20 15:38:05 2020
(r356917)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 28, 2018
+.Dd January 16, 2020
 .Dt RELEASE 7
 .Os
 .Sh NAME
@@ -570,8 +570,10 @@ target invoked by
 Optional variables:
 .Bl -tag -width ".Ev TARGET_ARCH"
 .It Ev OSRELEASE
-Optional base name for generated media images
-.Pq e.g., FreeBSD-9.0-RC2-amd64 .
+Optional base name for generated media images when invoking the
+.Cm install
+target
+.Pq e.g., FreeBSD-12.1-RELEASE-amd64 .
 Defaults to the output of
 .Ic `uname -s`-`uname -r`-`uname -p`
 within the chroot.
@@ -659,6 +661,7 @@ svn co svn://svn.freebsd.org/base/head src
 cd src
 make buildworld buildkernel
 cd release
+make obj
 make release
 make install DESTDIR=/var/freebsd-snapshot
 .Ed
___
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: r356916 - head/tools/build/options

2020-01-20 Thread Ed Maste
Author: emaste
Date: Mon Jan 20 15:19:56 2020
New Revision: 356916
URL: https://svnweb.freebsd.org/changeset/base/356916

Log:
  remove unused WITHOUT_PC_SYSINSTALL description
  
  pc-sysinstall was moved from the base system to ports in r351781.
  
  Submitted by: driesm.michiels gmail com
  Differential Revision:https://reviews.freebsd.org/D21647

Deleted:
  head/tools/build/options/WITHOUT_PC_SYSINSTALL
___
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: r356915 - head/sys/kern

2020-01-20 Thread Mateusz Guzik
Author: mjg
Date: Mon Jan 20 14:42:11 2020
New Revision: 356915
URL: https://svnweb.freebsd.org/changeset/base/356915

Log:
  cache: make numcachehv use counter(9) on all archs
  
  Requested by: kib

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Mon Jan 20 13:46:09 2020(r356914)
+++ head/sys/kern/vfs_cache.c   Mon Jan 20 14:42:11 2020(r356915)
@@ -340,16 +340,6 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG
 sizeof(struct namecache), "sizeof(struct namecache)");
 
 /*
- * Use counter(9) for numcachehv if the machine is 64-bit.
- *
- * Stick to an atomic for the rest since there is no long-sized equivalent and
- * 64-bit size is both way more than needed and a pessimization.
- */
-#ifdef __LP64__
-#define CACHE_NUMCACHEHV_U64
-#endif
-
-/*
  * The new name cache statistics
  */
 static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 0,
@@ -361,12 +351,7 @@ static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 
SYSCTL_COUNTER_U64(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, , 
descr);
 STATNODE_ULONG(numneg, "Number of negative cache entries");
 STATNODE_ULONG(numcache, "Number of cache entries");
-#ifdef CACHE_NUMCACHEHV_U64
 STATNODE_COUNTER(numcachehv, "Number of namecache entries with vnodes held");
-#else
-static u_long __exclusive_cache_line   numcachehv;/* number of cache entries 
with vnodes held */
-STATNODE_ULONG(numcachehv, "Number of namecache entries with vnodes held");
-#endif
 STATNODE_COUNTER(numcalls, "Number of cache lookups");
 STATNODE_COUNTER(dothits, "Number of '.' hits");
 STATNODE_COUNTER(dotdothits, "Number of '..' hits");
@@ -407,36 +392,6 @@ static int vn_fullpath1(struct thread *td, struct vnod
 
 static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries");
 
-#ifdef CACHE_NUMCACHEHV_U64
-static void
-cache_numcachehv_inc(void)
-{
-
-   counter_u64_add(numcachehv, 1);
-}
-
-static void
-cache_numcachehv_dec(void)
-{
-
-   counter_u64_add(numcachehv, -1);
-}
-#else
-static void
-cache_numcachehv_inc(void)
-{
-
-   atomic_add_long(, 1);
-}
-
-static void
-cache_numcachehv_dec(void)
-{
-
-   atomic_subtract_long(, 1);
-}
-#endif
-
 static int cache_yield;
 SYSCTL_INT(_vfs_cache, OID_AUTO, yield, CTLFLAG_RD, _yield, 0,
 "Number of times cache called yield");
@@ -917,7 +872,7 @@ cache_zap_locked(struct namecache *ncp, bool neg_locke
LIST_REMOVE(ncp, nc_src);
if (LIST_EMPTY(>nc_dvp->v_cache_src)) {
ncp->nc_flag |= NCF_DVDROP;
-   cache_numcachehv_dec();
+   counter_u64_add(numcachehv, -1);
}
}
atomic_subtract_rel_long(, 1);
@@ -1786,7 +1741,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
held_dvp = false;
if (LIST_EMPTY(>v_cache_src) && flag != NCF_ISDOTDOT) {
vhold(dvp);
-   cache_numcachehv_inc();
+   counter_u64_add(numcachehv, 1);
held_dvp = true;
}
 
@@ -1881,7 +1836,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
if (LIST_EMPTY(>v_cache_src)) {
if (!held_dvp) {
vhold(dvp);
-   cache_numcachehv_inc();
+   counter_u64_add(numcachehv, 1);
}
} else {
if (held_dvp) {
@@ -1892,7 +1847,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
 * this from changing.
 */
vdrop(dvp);
-   cache_numcachehv_dec();
+   counter_u64_add(numcachehv, -1);
}
}
LIST_INSERT_HEAD(>v_cache_src, ncp, nc_src);
@@ -1930,7 +1885,7 @@ out_unlock_free:
cache_free(ncp);
if (held_dvp) {
vdrop(dvp);
-   cache_numcachehv_dec();
+   counter_u64_add(numcachehv, -1);
}
return;
 }
@@ -2001,9 +1956,7 @@ nchinit(void *dummy __unused)
 
mtx_init(_shrink_lock, "ncnegs", NULL, MTX_DEF);
 
-#ifdef CACHE_NUMCACHEHV_U64
numcachehv = counter_u64_alloc(M_WAITOK);
-#endif
numcalls = counter_u64_alloc(M_WAITOK);
dothits = counter_u64_alloc(M_WAITOK);
dotdothits = counter_u64_alloc(M_WAITOK);
___
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: r356914 - in stable: 11/contrib/unbound 11/lib/libunbound 11/usr.sbin/unbound 11/usr.sbin/unbound/anchor 11/usr.sbin/unbound/checkconf 11/usr.sbin/unbound/control 11/usr.sbin/unbound/da...

2020-01-20 Thread Cy Schubert
Author: cy
Date: Mon Jan 20 13:46:09 2020
New Revision: 356914
URL: https://svnweb.freebsd.org/changeset/base/356914

Log:
  MFC r356676:
  
  Unbound's config.h is manually maintained, using a ./configure produced
  config.h as a guide. In practice contributed software maintains a copy
  of config.h within its build directory tree containing its Makefile.
  usr.sbin/unbound is the home for its config.h.
  
  Differential Revision:https://reviews.freebsd.org/D22983

Added:
  stable/12/usr.sbin/unbound/config.h
 - copied unchanged from r356676, head/usr.sbin/unbound/config.h
Deleted:
  stable/12/contrib/unbound/config.h
Modified:
  stable/12/lib/libunbound/Makefile
  stable/12/usr.sbin/unbound/anchor/Makefile
  stable/12/usr.sbin/unbound/checkconf/Makefile
  stable/12/usr.sbin/unbound/control/Makefile
  stable/12/usr.sbin/unbound/daemon/Makefile
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Added:
  stable/11/usr.sbin/unbound/config.h   (contents, props changed)
 - copied, changed from r356913, stable/11/contrib/unbound/config.h
Deleted:
  stable/11/contrib/unbound/config.h
Modified:
  stable/11/lib/libunbound/Makefile
  stable/11/usr.sbin/unbound/anchor/Makefile
  stable/11/usr.sbin/unbound/checkconf/Makefile
  stable/11/usr.sbin/unbound/control/Makefile
  stable/11/usr.sbin/unbound/daemon/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/lib/libunbound/Makefile
==
--- stable/12/lib/libunbound/Makefile   Mon Jan 20 12:53:02 2020
(r356913)
+++ stable/12/lib/libunbound/Makefile   Mon Jan 20 13:46:09 2020
(r356914)
@@ -13,6 +13,7 @@ PRIVATELIB=
 PACKAGE=   unbound
 
 CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} -I${.OBJDIR}
+CFLAGS+= -I${SRCTOP}/usr.sbin/unbound
 
 SRCS=  alloc.c as112.c authzone.c autotrust.c cachedb.c config_file.c \
configlexer.l configparser.y context.c dname.c dns.c dns64.c \

Modified: stable/12/usr.sbin/unbound/anchor/Makefile
==
--- stable/12/usr.sbin/unbound/anchor/Makefile  Mon Jan 20 12:53:02 2020
(r356913)
+++ stable/12/usr.sbin/unbound/anchor/Makefile  Mon Jan 20 13:46:09 2020
(r356914)
@@ -10,6 +10,7 @@ EXPATDIR= ${SRCTOP}/contrib/expat
 PROG=  local-unbound-anchor
 SRCS=  unbound-anchor.c
 CFLAGS+=   -I${UNBOUNDDIR} -I${LDNSDIR} -I${EXPATDIR}/lib
+CFLAGS+=   -I${.CURDIR:H} -I${.CURDIR}
 LIBADD=unbound bsdxml ssl crypto pthread
 MAN=   local-unbound-anchor.8
 

Modified: stable/12/usr.sbin/unbound/checkconf/Makefile
==
--- stable/12/usr.sbin/unbound/checkconf/Makefile   Mon Jan 20 12:53:02 
2020(r356913)
+++ stable/12/usr.sbin/unbound/checkconf/Makefile   Mon Jan 20 13:46:09 
2020(r356914)
@@ -9,6 +9,7 @@ UNBOUNDDIR= ${SRCTOP}/contrib/unbound
 PROG=  local-unbound-checkconf
 SRCS=  ub_event.c unbound-checkconf.c worker_cb.c
 CFLAGS+=   -I${UNBOUNDDIR} -I${LDNSDIR}
+CFLAGS+=   -I${.CURDIR:H} -I${.CURDIR}
 LIBADD=unbound pthread
 MAN=   local-unbound-checkconf.8
 

Copied: stable/12/usr.sbin/unbound/config.h (from r356676, 
head/usr.sbin/unbound/config.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/usr.sbin/unbound/config.h Mon Jan 20 13:46:09 2020
(r356914, copy of r356676, head/usr.sbin/unbound/config.h)
@@ -0,0 +1,1338 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+/* $FreeBSD$ */
+
+/* apply the noreturn attribute to a function that exits the program */
+#define ATTR_NORETURN __attribute__((__noreturn__))
+
+/* apply the weak attribute to a symbol */
+#define ATTR_WEAK __attribute__((weak))
+
+/* Directory to chroot to */
+#define CHROOT_DIR "/var/unbound"
+
+/* Define this to enable client subnet option. */
+/* #undef CLIENT_SUBNET */
+
+/* Do sha512 definitions in config.h */
+/* #undef COMPAT_SHA512 */
+
+/* Command line arguments used with configure */
+#define CONFCMDLINE "--with-ssl=/usr --with-libexpat=/usr --disable-dnscrypt 
--disable-dnstap --enable-ecdsa --disable-event-api --enable-gost 
--with-libevent --disable-subnet --disable-tfo-client --disable-tfo-server 
--with-pthreads--prefix=/usr --localstatedir=/var/unbound 
--mandir=/usr/share/man --build=freebsd"
+
+/* Pathname to the Unbound configuration file */
+#define CONFIGFILE "/var/unbound/unbound.conf"
+
+/* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work
+   */
+/* #undef DARWIN_BROKEN_SETREUID */
+
+/* Whether daemon is deprecated */
+/* #undef DEPRECATED_DAEMON */
+
+/* default dnstap socket path */
+/* #undef DNSTAP_SOCKET_PATH */
+
+/* Define if you want to 

svn commit: r356914 - in stable: 11/contrib/unbound 11/lib/libunbound 11/usr.sbin/unbound 11/usr.sbin/unbound/anchor 11/usr.sbin/unbound/checkconf 11/usr.sbin/unbound/control 11/usr.sbin/unbound/da...

2020-01-20 Thread Cy Schubert
Author: cy
Date: Mon Jan 20 13:46:09 2020
New Revision: 356914
URL: https://svnweb.freebsd.org/changeset/base/356914

Log:
  MFC r356676:
  
  Unbound's config.h is manually maintained, using a ./configure produced
  config.h as a guide. In practice contributed software maintains a copy
  of config.h within its build directory tree containing its Makefile.
  usr.sbin/unbound is the home for its config.h.
  
  Differential Revision:https://reviews.freebsd.org/D22983

Added:
  stable/11/usr.sbin/unbound/config.h   (contents, props changed)
 - copied, changed from r356913, stable/11/contrib/unbound/config.h
Deleted:
  stable/11/contrib/unbound/config.h
Modified:
  stable/11/lib/libunbound/Makefile
  stable/11/usr.sbin/unbound/anchor/Makefile
  stable/11/usr.sbin/unbound/checkconf/Makefile
  stable/11/usr.sbin/unbound/control/Makefile
  stable/11/usr.sbin/unbound/daemon/Makefile
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Added:
  stable/12/usr.sbin/unbound/config.h
 - copied unchanged from r356676, head/usr.sbin/unbound/config.h
Deleted:
  stable/12/contrib/unbound/config.h
Modified:
  stable/12/lib/libunbound/Makefile
  stable/12/usr.sbin/unbound/anchor/Makefile
  stable/12/usr.sbin/unbound/checkconf/Makefile
  stable/12/usr.sbin/unbound/control/Makefile
  stable/12/usr.sbin/unbound/daemon/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/lib/libunbound/Makefile
==
--- stable/11/lib/libunbound/Makefile   Mon Jan 20 12:53:02 2020
(r356913)
+++ stable/11/lib/libunbound/Makefile   Mon Jan 20 13:46:09 2020
(r356914)
@@ -13,6 +13,7 @@ PRIVATELIB=
 PACKAGE=   unbound
 
 CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} -I${.OBJDIR}
+CFLAGS+= -I${SRCTOP}/usr.sbin/unbound
 
 SRCS=  alloc.c as112.c authzone.c autotrust.c cachedb.c config_file.c \
configlexer.l configparser.y context.c dname.c dns.c dns64.c \

Modified: stable/11/usr.sbin/unbound/anchor/Makefile
==
--- stable/11/usr.sbin/unbound/anchor/Makefile  Mon Jan 20 12:53:02 2020
(r356913)
+++ stable/11/usr.sbin/unbound/anchor/Makefile  Mon Jan 20 13:46:09 2020
(r356914)
@@ -10,6 +10,7 @@ EXPATDIR= ${SRCTOP}/contrib/expat
 PROG=  local-unbound-anchor
 SRCS=  unbound-anchor.c
 CFLAGS+=   -I${UNBOUNDDIR} -I${LDNSDIR} -I${EXPATDIR}/lib
+CFLAGS+=   -I${.CURDIR:H} -I${.CURDIR}
 LIBADD=unbound bsdxml ssl crypto pthread
 MAN=   local-unbound-anchor.8
 

Modified: stable/11/usr.sbin/unbound/checkconf/Makefile
==
--- stable/11/usr.sbin/unbound/checkconf/Makefile   Mon Jan 20 12:53:02 
2020(r356913)
+++ stable/11/usr.sbin/unbound/checkconf/Makefile   Mon Jan 20 13:46:09 
2020(r356914)
@@ -9,6 +9,7 @@ UNBOUNDDIR= ${SRCTOP}/contrib/unbound
 PROG=  local-unbound-checkconf
 SRCS=  ub_event.c unbound-checkconf.c worker_cb.c
 CFLAGS+=   -I${UNBOUNDDIR} -I${LDNSDIR}
+CFLAGS+=   -I${.CURDIR:H} -I${.CURDIR}
 LIBADD=unbound pthread
 MAN=   local-unbound-checkconf.8
 

Copied and modified: stable/11/usr.sbin/unbound/config.h (from r356913, 
stable/11/contrib/unbound/config.h)
==
--- stable/11/contrib/unbound/config.h  Mon Jan 20 12:53:02 2020
(r356913, copy source)
+++ stable/11/usr.sbin/unbound/config.h Mon Jan 20 13:46:09 2020
(r356914)
@@ -1,5 +1,6 @@
 /* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
+/* $FreeBSD$ */
 
 /* apply the noreturn attribute to a function that exits the program */
 #define ATTR_NORETURN __attribute__((__noreturn__))

Modified: stable/11/usr.sbin/unbound/control/Makefile
==
--- stable/11/usr.sbin/unbound/control/Makefile Mon Jan 20 12:53:02 2020
(r356913)
+++ stable/11/usr.sbin/unbound/control/Makefile Mon Jan 20 13:46:09 2020
(r356914)
@@ -9,6 +9,7 @@ UNBOUNDDIR= ${SRCTOP}/contrib/unbound
 PROG=  local-unbound-control
 SRCS=  ub_event.c unbound-control.c worker_cb.c
 CFLAGS+=   -I${UNBOUNDDIR} -I${LDNSDIR}
+CFLAGS+=   -I${.CURDIR:H} -I${.CURDIR}
 LIBADD=unbound crypto ssl pthread
 MAN=   local-unbound-control.8
 

Modified: stable/11/usr.sbin/unbound/daemon/Makefile
==
--- stable/11/usr.sbin/unbound/daemon/Makefile  Mon Jan 20 12:53:02 2020
(r356913)
+++ stable/11/usr.sbin/unbound/daemon/Makefile  Mon Jan 20 13:46:09 2020
(r356914)
@@ -10,6 +10,7 @@ PROG= local-unbound
 SRCS=  acl_list.c cachedump.c daemon.c remote.c shm_main.c stats.c \
ub_event.c unbound.c worker.c
 

svn commit: r356913 - head/sys/dev/e1000

2020-01-20 Thread George V. Neville-Neil
Author: gnn
Date: Mon Jan 20 12:53:02 2020
New Revision: 356913
URL: https://svnweb.freebsd.org/changeset/base/356913

Log:
  Add support for latest Intel I219 device, supported in Lenovo Carbon X1 v7
  
  MFC after:2 weeks

Modified:
  head/sys/dev/e1000/e1000_api.c
  head/sys/dev/e1000/e1000_hw.h
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/e1000_api.c
==
--- head/sys/dev/e1000/e1000_api.c  Mon Jan 20 12:16:32 2020
(r356912)
+++ head/sys/dev/e1000/e1000_api.c  Mon Jan 20 12:53:02 2020
(r356913)
@@ -319,6 +319,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
case E1000_DEV_ID_PCH_ICP_I219_V8:
case E1000_DEV_ID_PCH_ICP_I219_LM9:
case E1000_DEV_ID_PCH_ICP_I219_V9:
+   case E1000_DEV_ID_PCH_ICP_I219_V10:
mac->type = e1000_pch_cnp;
break;
case E1000_DEV_ID_82575EB_COPPER:

Modified: head/sys/dev/e1000/e1000_hw.h
==
--- head/sys/dev/e1000/e1000_hw.h   Mon Jan 20 12:16:32 2020
(r356912)
+++ head/sys/dev/e1000/e1000_hw.h   Mon Jan 20 12:53:02 2020
(r356913)
@@ -155,6 +155,7 @@ struct e1000_hw;
 #define E1000_DEV_ID_PCH_ICP_I219_V8   0x15E0
 #define E1000_DEV_ID_PCH_ICP_I219_LM9  0x15E1
 #define E1000_DEV_ID_PCH_ICP_I219_V9   0x15E2
+#define E1000_DEV_ID_PCH_ICP_I219_V10  0x0D4F
 #define E1000_DEV_ID_82576 0x10C9
 #define E1000_DEV_ID_82576_FIBER   0x10E6
 #define E1000_DEV_ID_82576_SERDES  0x10E7

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Mon Jan 20 12:16:32 2020(r356912)
+++ head/sys/dev/e1000/if_em.c  Mon Jan 20 12:53:02 2020(r356913)
@@ -174,6 +174,7 @@ static pci_vendor_info_t em_vendor_info_array[] =
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) PRO/1000 Network 
Connection"),
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) PRO/1000 Network 
Connection"),
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) PRO/1000 Network 
Connection"),
+   PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V10, "Intel(R) PRO/1000 Network 
Connection"),
/* required last entry */
PVID_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: r356912 - head/sys/compat/linux

2020-01-20 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Jan 20 12:16:32 2020
New Revision: 356912
URL: https://svnweb.freebsd.org/changeset/base/356912

Log:
  Properly translate MNT_FORCE flag to Linux umount2(2).  Previously
  it worked by accident.
  
  MFC after:2 weeks
  Sponsored by: DARPA

Modified:
  head/sys/compat/linux/linux_file.c
  head/sys/compat/linux/linux_file.h

Modified: head/sys/compat/linux/linux_file.c
==
--- head/sys/compat/linux/linux_file.c  Mon Jan 20 11:54:00 2020
(r356911)
+++ head/sys/compat/linux/linux_file.c  Mon Jan 20 12:16:32 2020
(r356912)
@@ -1078,9 +1078,14 @@ int
 linux_umount(struct thread *td, struct linux_umount_args *args)
 {
struct unmount_args bsd;
+   int flags;
 
+   flags = 0;
+   if ((args->flags & LINUX_MNT_FORCE) != 0)
+   flags |= MNT_FORCE;
+
bsd.path = args->path;
-   bsd.flags = args->flags;/* XXX correct? */
+   bsd.flags = flags;
return (sys_unmount(td, ));
 }
 #endif

Modified: head/sys/compat/linux/linux_file.h
==
--- head/sys/compat/linux/linux_file.h  Mon Jan 20 11:54:00 2020
(r356911)
+++ head/sys/compat/linux/linux_file.h  Mon Jan 20 12:16:32 2020
(r356912)
@@ -57,6 +57,11 @@
 #defineLINUX_MS_REMOUNT0x0020
 
 /*
+ * umount2 flags
+ */
+#defineLINUX_MNT_FORCE 0x0001
+
+/*
  * common open/fcntl flags
  */
 #defineLINUX_O_RDONLY  
___
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: r356911 - stable/12/sys/opencrypto

2020-01-20 Thread John Baldwin
Author: jhb
Date: Mon Jan 20 11:54:00 2020
New Revision: 356911
URL: https://svnweb.freebsd.org/changeset/base/356911

Log:
  MFC 356561: Add stricter checking on mac key lengths.
  
  Negative lengths are always invalid.  The key length should also
  be zero for hash algorithms that do not accept a key.
  
  admbugs:  949

Modified:
  stable/12/sys/opencrypto/cryptodev.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/opencrypto/cryptodev.c
==
--- stable/12/sys/opencrypto/cryptodev.cMon Jan 20 11:45:18 2020
(r356910)
+++ stable/12/sys/opencrypto/cryptodev.cMon Jan 20 11:54:00 2020
(r356911)
@@ -585,8 +585,8 @@ cryptof_ioctl(
if (thash) {
cria.cri_alg = thash->type;
cria.cri_klen = sop->mackeylen * 8;
-   if (thash->keysize != 0 &&
-   sop->mackeylen > thash->keysize) {
+   if (sop->mackeylen > thash->keysize ||
+   sop->mackeylen < 0) {
CRYPTDEB("invalid mac key length");
error = EINVAL;
SDT_PROBE1(opencrypto, dev, ioctl, error,
___
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: r356910 - head/lib/libc/tests/stdlib

2020-01-20 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Jan 20 11:45:18 2020
New Revision: 356910
URL: https://svnweb.freebsd.org/changeset/base/356910

Log:
  Add qsort_r(3) regression test.
  
  MFC after:2 weeks
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D23206

Added:
  head/lib/libc/tests/stdlib/qsort_r_test.c   (contents, props changed)
Modified:
  head/lib/libc/tests/stdlib/Makefile

Modified: head/lib/libc/tests/stdlib/Makefile
==
--- head/lib/libc/tests/stdlib/Makefile Mon Jan 20 11:40:07 2020
(r356909)
+++ head/lib/libc/tests/stdlib/Makefile Mon Jan 20 11:45:18 2020
(r356910)
@@ -6,6 +6,7 @@ ATF_TESTS_C+=   dynthr_test
 ATF_TESTS_C+=  heapsort_test
 ATF_TESTS_C+=  mergesort_test
 ATF_TESTS_C+=  qsort_test
+ATF_TESTS_C+=  qsort_r_test
 ATF_TESTS_C+=  qsort_s_test
 ATF_TESTS_C+=  set_constraint_handler_s_test
 ATF_TESTS_C+=  strfmon_test

Added: head/lib/libc/tests/stdlib/qsort_r_test.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/tests/stdlib/qsort_r_test.c   Mon Jan 20 11:45:18 2020
(r356910)
@@ -0,0 +1,92 @@
+/*-
+ * Copyright (C) 2020 Edward Tomasz Napierala 
+ * Copyright (C) 2004 Maxim Sobolev 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Test for qsort_r(3) routine.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include "test-sort.h"
+
+#defineTHUNK 42
+
+static int
+sorthelp_r(void *thunk, const void *a, const void *b)
+{
+   const int *oa, *ob;
+
+   ATF_REQUIRE_EQ(*(int *)thunk, THUNK);
+
+   oa = a;
+   ob = b;
+   /* Don't use "return *oa - *ob" since it's easy to cause overflow! */
+   if (*oa > *ob)
+   return (1);
+   if (*oa < *ob)
+   return (-1);
+   return (0);
+}
+
+ATF_TC_WITHOUT_HEAD(qsort_r_test);
+ATF_TC_BODY(qsort_r_test, tc)
+{
+   int testvector[IVEC_LEN];
+   int sresvector[IVEC_LEN];
+   int i, j;
+   int thunk = THUNK;
+
+   for (j = 2; j < IVEC_LEN; j++) {
+   /* Populate test vectors */
+   for (i = 0; i < j; i++)
+   testvector[i] = sresvector[i] = initvector[i];
+
+   /* Sort using qsort_r(3) */
+   qsort_r(testvector, j, sizeof(testvector[0]), ,
+   sorthelp_r);
+   /* Sort using reference slow sorting routine */
+   ssort(sresvector, j);
+
+   /* Compare results */
+   for (i = 0; i < j; i++)
+   ATF_CHECK_MSG(testvector[i] == sresvector[i],
+   "item at index %d didn't match: %d != %d",
+   i, testvector[i], sresvector[i]);
+   }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+   ATF_TP_ADD_TC(tp, qsort_r_test);
+
+   return (atf_no_error());
+}
___
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: r356909 - in head: include lib/libc/stdlib lib/libc/tests/stdlib

2020-01-20 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Jan 20 11:40:07 2020
New Revision: 356909
URL: https://svnweb.freebsd.org/changeset/base/356909

Log:
  Add qsort_s(3).  Apart from the constraints, it also makes it easier
  to port software written for Linux variant of qsort_r(3).
  
  Reviewed by:  kib, arichardson
  MFC after:2 weeks
  Relnotes: yes
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D23174

Added:
  head/lib/libc/stdlib/qsort_s.c   (contents, props changed)
  head/lib/libc/tests/stdlib/qsort_s_test.c   (contents, props changed)
Modified:
  head/include/stdlib.h
  head/lib/libc/stdlib/Makefile.inc
  head/lib/libc/stdlib/Symbol.map
  head/lib/libc/stdlib/qsort.3
  head/lib/libc/stdlib/qsort.c
  head/lib/libc/tests/stdlib/Makefile

Modified: head/include/stdlib.h
==
--- head/include/stdlib.h   Mon Jan 20 11:19:55 2020(r356908)
+++ head/include/stdlib.h   Mon Jan 20 11:40:07 2020(r356909)
@@ -324,6 +324,11 @@ extern char *suboptarg;/* getsubopt(3) 
external var
 
 #if __EXT1_VISIBLE
 
+#ifndef _RSIZE_T_DEFINED
+#define _RSIZE_T_DEFINED
+typedef size_t rsize_t;
+#endif
+
 #ifndef _ERRNO_T_DEFINED
 #define _ERRNO_T_DEFINED
 typedef int errno_t;
@@ -339,6 +344,9 @@ _Noreturn void abort_handler_s(const char * __restrict
 errno_t);
 /* K3.6.1.3 */
 void ignore_handler_s(const char * __restrict, void * __restrict, errno_t);
+/* K.3.6.3.2 */
+errno_t qsort_s(void *, rsize_t, rsize_t,
+int (*)(const void *, const void *, void *), void *);
 #endif /* __EXT1_VISIBLE */
 
 __END_DECLS

Modified: head/lib/libc/stdlib/Makefile.inc
==
--- head/lib/libc/stdlib/Makefile.inc   Mon Jan 20 11:19:55 2020
(r356908)
+++ head/lib/libc/stdlib/Makefile.inc   Mon Jan 20 11:40:07 2020
(r356909)
@@ -11,8 +11,8 @@ MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof.
getsubopt.c hcreate.c hcreate_r.c hdestroy_r.c heapsort.c heapsort_b.c \
hsearch_r.c imaxabs.c imaxdiv.c \
insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \
-   merge.c mergesort_b.c ptsname.c qsort.c qsort_r.c quick_exit.c \
-   radixsort.c rand.c \
+   merge.c mergesort_b.c ptsname.c qsort.c qsort_r.c qsort_s.c \
+   quick_exit.c radixsort.c rand.c \
random.c reallocarray.c reallocf.c realpath.c remque.c \
set_constraint_handler_s.c strfmon.c strtoimax.c \
strtol.c strtold.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \
@@ -51,7 +51,8 @@ MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 h
 MLINKS+=insque.3 remque.3
 MLINKS+=lsearch.3 lfind.3
 MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3
-MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3
+MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3 \
+   qsort.3 qsort_s.3
 MLINKS+=rand.3 rand_r.3 rand.3 srand.3
 MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \
random.3 srandomdev.3

Modified: head/lib/libc/stdlib/Symbol.map
==
--- head/lib/libc/stdlib/Symbol.map Mon Jan 20 11:19:55 2020
(r356908)
+++ head/lib/libc/stdlib/Symbol.map Mon Jan 20 11:40:07 2020
(r356909)
@@ -123,6 +123,10 @@ FBSD_1.5 {
set_constraint_handler_s;
 };
 
+FBSD_1.6 {
+   qsort_s;
+};
+
 FBSDprivate_1.0 {
__system;
_system;

Modified: head/lib/libc/stdlib/qsort.3
==
--- head/lib/libc/stdlib/qsort.3Mon Jan 20 11:19:55 2020
(r356908)
+++ head/lib/libc/stdlib/qsort.3Mon Jan 20 11:40:07 2020
(r356909)
@@ -32,7 +32,7 @@
 .\" @(#)qsort.38.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd February 20, 2013
+.Dd January 14, 2020
 .Dt QSORT 3
 .Os
 .Sh NAME
@@ -98,6 +98,15 @@
 .Fa "size_t size"
 .Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]"
 .Fc
+.Fd #define __STDC_WANT_LIB_EXT1__ 1
+.Ft errno_t
+.Fo qsort_s
+.Fa "void *base"
+.Fa "rsize_t nmemb"
+.Fa "rsize_t size"
+.Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *, void *\*[rp]"
+.Fa "void *thunk"
+.Fc
 .Sh DESCRIPTION
 The
 .Fn qsort
@@ -238,6 +247,36 @@ is faster than
 .Fn heapsort .
 Memory availability and pre-existing order in the data can make this
 untrue.
+.Pp
+The
+.Fn qsort_s
+function behaves the same as
+.Fn qsort_r , except that:
+.Bl -dash
+.It
+The order of arguments is different
+.It
+The order of arguments to
+.Fa compar
+is different
+.It
+if
+.Fa nmemb
+or
+.Fa size
+are greater than
+.Dv RSIZE_MAX ,
+or
+.Fa nmemb
+is not zero and
+.Fa compar
+is NULL, then the runtime-constraint handler is called, and
+.Fn qsort_s
+returns an error.
+Note that the handler is called before
+.Fn qsort_s
+returns the error, and the handler function 

svn commit: r356908 - in stable: 11/sys/opencrypto 12/sys/opencrypto

2020-01-20 Thread John Baldwin
Author: jhb
Date: Mon Jan 20 11:19:55 2020
New Revision: 356908
URL: https://svnweb.freebsd.org/changeset/base/356908

Log:
  MFC 356507,356520: Add a reference count to cryptodev sessions.
  
  356507:
  Add a reference count to cryptodev sessions.
  
  This prevents use-after-free races with crypto requests (which may
  sleep) and CIOCFSESSION as well as races from current CIOCFSESSION
  requests.
  
  356520:
  Remove no-longer-used function prototype.
  
  admbugs:  949
  Sponsored by: Chelsio Communications

Modified:
  stable/12/sys/opencrypto/cryptodev.c
Directory Properties:
  stable/12/   (props changed)

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

Modified: stable/12/sys/opencrypto/cryptodev.c
==
--- stable/12/sys/opencrypto/cryptodev.cMon Jan 20 09:16:06 2020
(r356907)
+++ stable/12/sys/opencrypto/cryptodev.cMon Jan 20 11:19:55 2020
(r356908)
@@ -266,6 +266,7 @@ crypt_kop_to_32(const struct crypt_kop *from, struct c
 struct csession {
TAILQ_ENTRY(csession) next;
crypto_session_t cses;
+   volatile u_int  refs;
u_int32_t   ses;
struct mtx  lock;   /* for op submission */
 
@@ -292,6 +293,7 @@ struct cryptop_data {
 struct fcrypt {
TAILQ_HEAD(csessionlist, csession) csessions;
int sesn;
+   struct mtx  lock;
 };
 
 static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 };
@@ -323,8 +325,7 @@ static struct fileops cryptofops = {
 };
 
 static struct csession *csefind(struct fcrypt *, u_int);
-static int csedelete(struct fcrypt *, struct csession *);
-static struct csession *cseadd(struct fcrypt *, struct csession *);
+static bool csedelete(struct fcrypt *, u_int);
 static struct csession *csecreate(struct fcrypt *, crypto_session_t, caddr_t,
 u_int64_t, caddr_t, u_int64_t, u_int32_t, u_int32_t, struct enc_xform *,
 struct auth_hash *);
@@ -668,13 +669,10 @@ bail:
break;
case CIOCFSESSION:
ses = *(u_int32_t *)data;
-   cse = csefind(fcr, ses);
-   if (cse == NULL) {
+   if (!csedelete(fcr, ses)) {
SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__);
return (EINVAL);
}
-   csedelete(fcr, cse);
-   csefree(cse);
break;
case CIOCCRYPT:
 #ifdef COMPAT_FREEBSD32
@@ -691,6 +689,7 @@ bail:
return (EINVAL);
}
error = cryptodev_op(cse, cop, active_cred, td);
+   csefree(cse);
 #ifdef COMPAT_FREEBSD32
if (error == 0 && cmd == CIOCCRYPT32)
crypt_op_to_32(cop, data);
@@ -757,6 +756,7 @@ bail:
return (EINVAL);
}
error = cryptodev_aead(cse, caead, active_cred, td);
+   csefree(cse);
break;
default:
error = EINVAL;
@@ -1375,6 +1375,9 @@ cryptof_close(struct file *fp, struct thread *td)
 
while ((cse = TAILQ_FIRST(>csessions))) {
TAILQ_REMOVE(>csessions, cse, next);
+   KASSERT(cse->refs == 1,
+   ("%s: crypto session %p with %d refs", __func__, cse,
+   cse->refs));
csefree(cse);
}
free(fcr, M_XDATA);
@@ -1395,34 +1398,36 @@ csefind(struct fcrypt *fcr, u_int ses)
 {
struct csession *cse;
 
-   TAILQ_FOREACH(cse, >csessions, next)
-   if (cse->ses == ses)
+   mtx_lock(>lock);
+   TAILQ_FOREACH(cse, >csessions, next) {
+   if (cse->ses == ses) {
+   refcount_acquire(>refs);
+   mtx_unlock(>lock);
return (cse);
+   }
+   }
+   mtx_unlock(>lock);
return (NULL);
 }
 
-static int
-csedelete(struct fcrypt *fcr, struct csession *cse_del)
+static bool
+csedelete(struct fcrypt *fcr, u_int ses)
 {
struct csession *cse;
 
+   mtx_lock(>lock);
TAILQ_FOREACH(cse, >csessions, next) {
-   if (cse == cse_del) {
+   if (cse->ses == ses) {
TAILQ_REMOVE(>csessions, cse, next);
-   return (1);
+   mtx_unlock(>lock);
+   csefree(cse);
+   return (true);
}
}
-   return (0);
+   mtx_unlock(>lock);
+   return (false);
 }

-static struct csession *
-cseadd(struct fcrypt *fcr, struct csession *cse)
-{
-   TAILQ_INSERT_TAIL(>csessions, cse, next);
-   cse->ses = fcr->sesn++;
-   return (cse);
-}
-
 struct csession *
 csecreate(struct fcrypt *fcr, crypto_session_t cses, caddr_t key, u_int64_t 

svn commit: r356908 - in stable: 11/sys/opencrypto 12/sys/opencrypto

2020-01-20 Thread John Baldwin
Author: jhb
Date: Mon Jan 20 11:19:55 2020
New Revision: 356908
URL: https://svnweb.freebsd.org/changeset/base/356908

Log:
  MFC 356507,356520: Add a reference count to cryptodev sessions.
  
  356507:
  Add a reference count to cryptodev sessions.
  
  This prevents use-after-free races with crypto requests (which may
  sleep) and CIOCFSESSION as well as races from current CIOCFSESSION
  requests.
  
  356520:
  Remove no-longer-used function prototype.
  
  admbugs:  949
  Sponsored by: Chelsio Communications

Modified:
  stable/11/sys/opencrypto/cryptodev.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sys/opencrypto/cryptodev.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sys/opencrypto/cryptodev.c
==
--- stable/11/sys/opencrypto/cryptodev.cMon Jan 20 09:16:06 2020
(r356907)
+++ stable/11/sys/opencrypto/cryptodev.cMon Jan 20 11:19:55 2020
(r356908)
@@ -268,6 +268,7 @@ crypt_kop_to_32(const struct crypt_kop *from, struct c
 struct csession {
TAILQ_ENTRY(csession) next;
u_int64_t   sid;
+   volatile u_int  refs;
u_int32_t   ses;
struct mtx  lock;   /* for op submission */
 
@@ -294,6 +295,7 @@ struct cryptop_data {
 struct fcrypt {
TAILQ_HEAD(csessionlist, csession) csessions;
int sesn;
+   struct mtx  lock;
 };
 
 static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 };
@@ -325,8 +327,7 @@ static struct fileops cryptofops = {
 };
 
 static struct csession *csefind(struct fcrypt *, u_int);
-static int csedelete(struct fcrypt *, struct csession *);
-static struct csession *cseadd(struct fcrypt *, struct csession *);
+static int csedelete(struct fcrypt *, u_int);
 static struct csession *csecreate(struct fcrypt *, u_int64_t, caddr_t,
 u_int64_t, caddr_t, u_int64_t, u_int32_t, u_int32_t, struct enc_xform *,
 struct auth_hash *);
@@ -617,13 +618,9 @@ bail:
break;
case CIOCFSESSION:
ses = *(u_int32_t *)data;
-   cse = csefind(fcr, ses);
-   if (cse == NULL) {
+   error = csedelete(fcr, ses);
+   if (error != 0)
SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__);
-   return (EINVAL);
-   }
-   csedelete(fcr, cse);
-   error = csefree(cse);
break;
case CIOCCRYPT:
 #ifdef COMPAT_FREEBSD32
@@ -640,6 +637,7 @@ bail:
return (EINVAL);
}
error = cryptodev_op(cse, cop, active_cred, td);
+   (void)csefree(cse);
 #ifdef COMPAT_FREEBSD32
if (error == 0 && cmd == CIOCCRYPT32)
crypt_op_to_32(cop, data);
@@ -706,6 +704,7 @@ bail:
return (EINVAL);
}
error = cryptodev_aead(cse, caead, active_cred, td);
+   (void)csefree(cse);
break;
default:
error = EINVAL;
@@ -1323,6 +1322,9 @@ cryptof_close(struct file *fp, struct thread *td)
 
while ((cse = TAILQ_FIRST(>csessions))) {
TAILQ_REMOVE(>csessions, cse, next);
+   KASSERT(cse->refs == 1,
+   ("%s: crypto session %p with %d refs", __func__, cse,
+   cse->refs));
(void)csefree(cse);
}
free(fcr, M_XDATA);
@@ -1343,34 +1345,35 @@ csefind(struct fcrypt *fcr, u_int ses)
 {
struct csession *cse;
 
-   TAILQ_FOREACH(cse, >csessions, next)
-   if (cse->ses == ses)
+   mtx_lock(>lock);
+   TAILQ_FOREACH(cse, >csessions, next) {
+   if (cse->ses == ses) {
+   refcount_acquire(>refs);
+   mtx_unlock(>lock);
return (cse);
+   }
+   }
+   mtx_unlock(>lock);
return (NULL);
 }
 
 static int
-csedelete(struct fcrypt *fcr, struct csession *cse_del)
+csedelete(struct fcrypt *fcr, u_int ses)
 {
struct csession *cse;
 
+   mtx_lock(>lock);
TAILQ_FOREACH(cse, >csessions, next) {
-   if (cse == cse_del) {
+   if (cse->ses == ses) {
TAILQ_REMOVE(>csessions, cse, next);
-   return (1);
+   mtx_unlock(>lock);
+   return (csefree(cse));
}
}
-   return (0);
+   mtx_unlock(>lock);
+   return (EINVAL);
 }

-static struct csession *
-cseadd(struct fcrypt *fcr, struct csession *cse)
-{
-   TAILQ_INSERT_TAIL(>csessions, cse, next);
-   cse->ses = fcr->sesn++;
-   return (cse);
-}
-
 struct csession *
 csecreate(struct fcrypt *fcr, u_int64_t sid, caddr_t key, u_int64_t 

svn commit: r356907 - stable/11/sys/compat/linuxkpi/common/src

2020-01-20 Thread Konstantin Belousov
Author: kib
Date: Mon Jan 20 09:16:06 2020
New Revision: 356907
URL: https://svnweb.freebsd.org/changeset/base/356907

Log:
  MFC r356682:
  Code must not unlock a mutex while owning the thread lock.

Modified:
  stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c
==
--- stable/11/sys/compat/linuxkpi/common/src/linux_rcu.cMon Jan 20 
08:55:27 2020(r356906)
+++ stable/11/sys/compat/linuxkpi/common/src/linux_rcu.cMon Jan 20 
09:16:06 2020(r356907)
@@ -296,14 +296,13 @@ linux_synchronize_rcu(void)
"linux_synchronize_rcu() can sleep");
 
td = curthread;
+   DROP_GIANT();
 
/*
 * Synchronizing RCU might change the CPU core this function
 * is running on. Save current values:
 */
thread_lock(td);
-
-   DROP_GIANT();
 
old_cpu = PCPU_GET(cpuid);
old_pinned = td->td_pinned;
___
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: r356906 - in stable/12/sys: compat/linuxkpi/common/src kern

2020-01-20 Thread Konstantin Belousov
Author: kib
Date: Mon Jan 20 08:55:27 2020
New Revision: 356906
URL: https://svnweb.freebsd.org/changeset/base/356906

Log:
  MFC r356682:
  Code must not unlock a mutex while owning the thread lock.

Modified:
  stable/12/sys/compat/linuxkpi/common/src/linux_rcu.c
  stable/12/sys/kern/subr_epoch.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linuxkpi/common/src/linux_rcu.c
==
--- stable/12/sys/compat/linuxkpi/common/src/linux_rcu.cMon Jan 20 
08:28:54 2020(r356905)
+++ stable/12/sys/compat/linuxkpi/common/src/linux_rcu.cMon Jan 20 
08:55:27 2020(r356906)
@@ -297,14 +297,13 @@ linux_synchronize_rcu(void)
"linux_synchronize_rcu() can sleep");
 
td = curthread;
+   DROP_GIANT();
 
/*
 * Synchronizing RCU might change the CPU core this function
 * is running on. Save current values:
 */
thread_lock(td);
-
-   DROP_GIANT();
 
old_cpu = PCPU_GET(cpuid);
old_pinned = td->td_pinned;

Modified: stable/12/sys/kern/subr_epoch.c
==
--- stable/12/sys/kern/subr_epoch.c Mon Jan 20 08:28:54 2020
(r356905)
+++ stable/12/sys/kern/subr_epoch.c Mon Jan 20 08:55:27 2020
(r356906)
@@ -499,8 +499,8 @@ epoch_wait_preempt(epoch_t epoch)
KASSERT(!in_epoch(epoch), ("epoch_wait_preempt() called in the middle "
"of an epoch section of the same epoch"));
 #endif
-   thread_lock(td);
DROP_GIANT();
+   thread_lock(td);
 
old_cpu = PCPU_GET(cpuid);
old_pinned = td->td_pinned;
___
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: r356905 - in stable/11: sbin/fsck_ffs sbin/newfs sys/ufs/ffs

2020-01-20 Thread Eugene Grosbein
Author: eugen
Date: Mon Jan 20 08:28:54 2020
New Revision: 356905
URL: https://svnweb.freebsd.org/changeset/base/356905

Log:
  MFC r323157 by 323157: fix recovery information with sector sizes up to 64K.
  
  Original commit log:
  
The new fsck recovery information to enable it to find backup
superblocks created in revision 322297 only works on disks
with sector sizes up to 4K. This update allows the recovery
information to be created by newfs and used by fsck on disks
with sector sizes up to 64K. Note that FFS currently limits
filesystem to be mounted from disks with up to 8K sectors.
Expanding this limitation will be the subject of another
commit.
  
  For example, this allows newfs to work on GELI volumes with 8K sectors.
  
  PR:   243413
  Approved by:  mckusick
  Relnotes: Yes

Modified:
  stable/11/sbin/fsck_ffs/setup.c
  stable/11/sbin/newfs/mkfs.c
  stable/11/sys/ufs/ffs/fs.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/fsck_ffs/setup.c
==
--- stable/11/sbin/fsck_ffs/setup.c Mon Jan 20 04:01:35 2020
(r356904)
+++ stable/11/sbin/fsck_ffs/setup.c Mon Jan 20 08:28:54 2020
(r356905)
@@ -36,6 +36,7 @@ static const char sccsid[] = "@(#)setup.c 8.10 (Berkel
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #define FSTYPENAMES
 #include 
@@ -466,7 +467,9 @@ sblock_init(void)
 static int
 calcsb(char *dev, int devfd, struct fs *fs)
 {
-   struct fsrecovery fsr;
+   struct fsrecovery *fsr;
+   char *fsrbuf;
+   u_int secsize;
 
/*
 * We need fragments-per-group and the partition-size.
@@ -476,32 +479,62 @@ calcsb(char *dev, int devfd, struct fs *fs)
 * overwritten by a boot block, we fail. But usually they are
 * there and we can use them.
 */
-   if (blread(devfd, (char *),
-   (SBLOCK_UFS2 - sizeof(fsr)) / dev_bsize, sizeof(fsr)) ||
-   fsr.fsr_magic != FS_UFS2_MAGIC)
+   if (ioctl(devfd, DIOCGSECTORSIZE, ) == -1)
return (0);
+   fsrbuf = Malloc(secsize);
+   if (fsrbuf == NULL)
+   errx(EEXIT, "calcsb: cannot allocate recovery buffer");
+   if (blread(devfd, fsrbuf,
+   (SBLOCK_UFS2 - secsize) / dev_bsize, secsize) != 0)
+   return (0);
+   fsr = (struct fsrecovery *)[secsize - sizeof *fsr];
+   if (fsr->fsr_magic != FS_UFS2_MAGIC)
+   return (0);
memset(fs, 0, sizeof(struct fs));
-   fs->fs_fpg = fsr.fsr_fpg;
-   fs->fs_fsbtodb = fsr.fsr_fsbtodb;
-   fs->fs_sblkno = fsr.fsr_sblkno;
-   fs->fs_magic = fsr.fsr_magic;
-   fs->fs_ncg = fsr.fsr_ncg;
+   fs->fs_fpg = fsr->fsr_fpg;
+   fs->fs_fsbtodb = fsr->fsr_fsbtodb;
+   fs->fs_sblkno = fsr->fsr_sblkno;
+   fs->fs_magic = fsr->fsr_magic;
+   fs->fs_ncg = fsr->fsr_ncg;
+   free(fsrbuf);
return (1);
 }
 
 /*
  * Check to see if recovery information exists.
+ * Return 1 if it exists or cannot be created.
+ * Return 0 if it does not exist and can be created.
  */
 static int
 chkrecovery(int devfd)
 {
-   struct fsrecovery fsr;
+   struct fsrecovery *fsr;
+   char *fsrbuf;
+   u_int secsize;
 
-   if (blread(devfd, (char *),
-   (SBLOCK_UFS2 - sizeof(fsr)) / dev_bsize, sizeof(fsr)) ||
-   fsr.fsr_magic != FS_UFS2_MAGIC)
-   return (0);
-   return (1);
+   /*
+* Could not determine if backup material exists, so do not
+* offer to create it.
+*/
+   if (ioctl(devfd, DIOCGSECTORSIZE, ) == -1 ||
+   (fsrbuf = Malloc(secsize)) == NULL ||
+   blread(devfd, fsrbuf, (SBLOCK_UFS2 - secsize) / dev_bsize,
+ secsize) != 0)
+   return (1);
+   /*
+* Recovery material has already been created, so do not
+* need to create it again.
+*/
+   fsr = (struct fsrecovery *)[secsize - sizeof *fsr];
+   if (fsr->fsr_magic == FS_UFS2_MAGIC) {
+   free(fsrbuf);
+   return (1);
+   }
+   /*
+* Recovery material has not been created and can be if desired.
+*/
+   free(fsrbuf);
+   return (0);
 }
 
 /*
@@ -512,17 +545,24 @@ chkrecovery(int devfd)
 static void
 saverecovery(int readfd, int writefd)
 {
-   struct fsrecovery fsr;
+   struct fsrecovery *fsr;
+   char *fsrbuf;
+   u_int secsize;
 
if (sblock.fs_magic != FS_UFS2_MAGIC ||
-   blread(readfd, (char *),
-   (SBLOCK_UFS2 - sizeof(fsr)) / dev_bsize, sizeof(fsr)))
+   ioctl(readfd, DIOCGSECTORSIZE, ) == -1 ||
+   (fsrbuf = Malloc(secsize)) == NULL ||
+   blread(readfd, fsrbuf, (SBLOCK_UFS2 - secsize) / dev_bsize,
+ secsize) != 0) {
+   printf("RECOVERY DATA COULD NOT BE CREATED\n");
return;
-   fsr.fsr_magic =