svn commit: r310104 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs

2016-12-15 Thread Alexander Motin
Author: mav
Date: Thu Dec 15 08:03:16 2016
New Revision: 310104
URL: https://svnweb.freebsd.org/changeset/base/310104

Log:
  Revert r310023 for now.
  
  After another look my new variable mapping was not exactly right.

Modified:
  head/sys/cddl/compat/opensolaris/sys/kmem.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c

Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h
==
--- head/sys/cddl/compat/opensolaris/sys/kmem.h Thu Dec 15 05:36:48 2016
(r310103)
+++ head/sys/cddl/compat/opensolaris/sys/kmem.h Thu Dec 15 08:03:16 2016
(r310104)
@@ -37,7 +37,6 @@
 #include 
 #include 
 #include 
-#include 
 
 MALLOC_DECLARE(M_SOLARIS);
 
@@ -78,10 +77,8 @@ void kmem_reap(void);
 int kmem_debugging(void);
 void *calloc(size_t n, size_t s);
 
-#definefreemem (long)vm_cnt.v_free_count
-#definedesfree (long)vm_cnt.v_free_target
-#defineminfree (long)vm_cnt.v_free_min
-#defineneedfree(long)vm_pageout_deficit
+#definefreemem vm_cnt.v_free_count
+#defineminfree vm_cnt.v_free_min
 #defineheap_arena  kmem_arena
 #definekmem_alloc(size, kmflags)   zfs_kmem_alloc((size), 
(kmflags))
 #definekmem_zalloc(size, kmflags)  zfs_kmem_alloc((size), 
(kmflags) | M_ZERO)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Thu Dec 15 
05:36:48 2016(r310103)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Thu Dec 15 
08:03:16 2016(r310104)
@@ -357,7 +357,6 @@ int zfs_arc_shrink_shift = 0;
 int zfs_arc_p_min_shift = 0;
 uint64_t zfs_arc_average_blocksize = 8 * 1024; /* 8KB */
 u_int zfs_arc_free_target = 0;
-#definelotsfreezfs_arc_free_target
 
 /* Absolute min for arc min / max is 16MB. */
 static uint64_t arc_abs_min = 16 << 20;
@@ -3828,6 +3827,8 @@ arc_shrink(int64_t to_free)
}
 }
 
+static long needfree = 0;
+
 typedef enum free_memory_reason_t {
FMR_UNKNOWN,
FMR_NEEDFREE,
@@ -3874,6 +3875,17 @@ arc_available_memory(void)
}
 
/*
+* Cooperate with pagedaemon when it's time for it to scan
+* and reclaim some pages.
+*/
+   n = PAGESIZE * ((int64_t)freemem - zfs_arc_free_target);
+   if (n < lowest) {
+   lowest = n;
+   r = FMR_LOTSFREE;
+   }
+
+#ifdef illumos
+   /*
 * check that we're out of range of the pageout scanner.  It starts to
 * schedule paging if freemem is less than lotsfree and needfree.
 * lotsfree is the high-water mark for pageout, and needfree is the
@@ -3886,7 +3898,6 @@ arc_available_memory(void)
r = FMR_LOTSFREE;
}
 
-#ifdef illumos
/*
 * check to make sure that swapfs has enough space so that anon
 * reservations can still succeed. anon_resvmem() checks that the
@@ -4143,6 +4154,9 @@ arc_reclaim_thread(void *dummy __unused)
 * infinite loop.
 */
if (arc_size <= arc_c || evicted == 0) {
+#ifdef _KERNEL
+   needfree = 0;
+#endif
/*
 * We're either no longer overflowing, or we
 * can't evict anything more, so we should wake
@@ -5869,6 +5883,8 @@ arc_lowmem(void *arg __unused, int howto
 {
 
mutex_enter(&arc_reclaim_lock);
+   /* XXX: Memory deficit should be passed as argument. */
+   needfree = btoc(arc_c >> arc_shrink_shift);
DTRACE_PROBE(arc__needfree);
cv_signal(&arc_reclaim_thread_cv);
 
___
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: r310105 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-12-15 Thread Alexander Motin
Author: mav
Date: Thu Dec 15 08:10:47 2016
New Revision: 310105
URL: https://svnweb.freebsd.org/changeset/base/310105

Log:
  MFC 309714: Fix spa_alloc_tree sorting by offset in r305331.
  
  Original commit "7090 zfs should improve allocation order" declares alloc
  queue sorted by time and offset.  But in practice io_offset is always zero,
  so sorting happened only by time, while order of writes with equal time was
  completely random.  On Illumos this did not affected much thanks to using
  high resolution timestamps.  On FreeBSD due to using much faster but low
  resolution timestamps it caused bad data placement on disks, affecting
  further read performance.
  
  This change switches zio_timestamp_compare() from comparing uninitialized
  io_offset to really populated io_bookmark values.  I haven't decided yet
  what to do with timestampts, but on simple tests this change gives the
  same peformance results by just making code to work as declared.

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c  Thu Dec 
15 08:03:16 2016(r310104)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c  Thu Dec 
15 08:10:47 2016(r310105)
@@ -563,9 +563,24 @@ zio_timestamp_compare(const void *x1, co
if (z1->io_queued_timestamp > z2->io_queued_timestamp)
return (1);
 
-   if (z1->io_offset < z2->io_offset)
+   if (z1->io_bookmark.zb_objset < z2->io_bookmark.zb_objset)
return (-1);
-   if (z1->io_offset > z2->io_offset)
+   if (z1->io_bookmark.zb_objset > z2->io_bookmark.zb_objset)
+   return (1);
+
+   if (z1->io_bookmark.zb_object < z2->io_bookmark.zb_object)
+   return (-1);
+   if (z1->io_bookmark.zb_object > z2->io_bookmark.zb_object)
+   return (1);
+
+   if (z1->io_bookmark.zb_level < z2->io_bookmark.zb_level)
+   return (-1);
+   if (z1->io_bookmark.zb_level > z2->io_bookmark.zb_level)
+   return (1);
+
+   if (z1->io_bookmark.zb_blkid < z2->io_bookmark.zb_blkid)
+   return (-1);
+   if (z1->io_bookmark.zb_blkid > z2->io_bookmark.zb_blkid)
return (1);
 
if (z1 < z2)
___
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: r310106 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-12-15 Thread Alexander Motin
Author: mav
Date: Thu Dec 15 08:11:32 2016
New Revision: 310106
URL: https://svnweb.freebsd.org/changeset/base/310106

Log:
  MFC 309714: Fix spa_alloc_tree sorting by offset in r305331.
  
  Original commit "7090 zfs should improve allocation order" declares alloc
  queue sorted by time and offset.  But in practice io_offset is always zero,
  so sorting happened only by time, while order of writes with equal time was
  completely random.  On Illumos this did not affected much thanks to using
  high resolution timestamps.  On FreeBSD due to using much faster but low
  resolution timestamps it caused bad data placement on disks, affecting
  further read performance.
  
  This change switches zio_timestamp_compare() from comparing uninitialized
  io_offset to really populated io_bookmark values.  I haven't decided yet
  what to do with timestampts, but on simple tests this change gives the
  same peformance results by just making code to work as declared.

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c  Thu Dec 
15 08:10:47 2016(r310105)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c  Thu Dec 
15 08:11:32 2016(r310106)
@@ -568,9 +568,24 @@ zio_timestamp_compare(const void *x1, co
if (z1->io_queued_timestamp > z2->io_queued_timestamp)
return (1);
 
-   if (z1->io_offset < z2->io_offset)
+   if (z1->io_bookmark.zb_objset < z2->io_bookmark.zb_objset)
return (-1);
-   if (z1->io_offset > z2->io_offset)
+   if (z1->io_bookmark.zb_objset > z2->io_bookmark.zb_objset)
+   return (1);
+
+   if (z1->io_bookmark.zb_object < z2->io_bookmark.zb_object)
+   return (-1);
+   if (z1->io_bookmark.zb_object > z2->io_bookmark.zb_object)
+   return (1);
+
+   if (z1->io_bookmark.zb_level < z2->io_bookmark.zb_level)
+   return (-1);
+   if (z1->io_bookmark.zb_level > z2->io_bookmark.zb_level)
+   return (1);
+
+   if (z1->io_bookmark.zb_blkid < z2->io_bookmark.zb_blkid)
+   return (-1);
+   if (z1->io_bookmark.zb_blkid > z2->io_bookmark.zb_blkid)
return (1);
 
if (z1 < z2)
___
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: r310108 - stable/11/sys/vm

2016-12-15 Thread Konstantin Belousov
Author: kib
Date: Thu Dec 15 10:42:14 2016
New Revision: 310108
URL: https://svnweb.freebsd.org/changeset/base/310108

Log:
  MFC r309708:
  Style.

Modified:
  stable/11/sys/vm/phys_pager.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/phys_pager.c
==
--- stable/11/sys/vm/phys_pager.c   Thu Dec 15 10:36:34 2016
(r310107)
+++ stable/11/sys/vm/phys_pager.c   Thu Dec 15 10:42:14 2016
(r310108)
@@ -56,9 +56,6 @@ phys_pager_init(void)
mtx_init(&phys_pager_mtx, "phys_pager list", NULL, MTX_DEF);
 }
 
-/*
- * MPSAFE
- */
 static vm_object_t
 phys_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
 vm_ooffset_t foff, struct ucred *cred)
@@ -101,8 +98,8 @@ phys_pager_alloc(void *handle, vm_ooffse
object = object1;
object1 = NULL;
object->handle = handle;
-   TAILQ_INSERT_TAIL(&phys_pager_object_list, 
object,
-   pager_object_list);
+   TAILQ_INSERT_TAIL(&phys_pager_object_list,
+   object, pager_object_list);
}
} else {
if (pindex > object->size)
@@ -117,9 +114,6 @@ phys_pager_alloc(void *handle, vm_ooffse
return (object);
 }
 
-/*
- * MPSAFE
- */
 static void
 phys_pager_dealloc(vm_object_t object)
 {
@@ -165,7 +159,7 @@ phys_pager_getpages(vm_object_t object, 
 
 static void
 phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t 
sync,
-   int *rtvals)
+int *rtvals)
 {
 
panic("phys_pager_putpage called");
@@ -183,7 +177,7 @@ phys_pager_putpages(vm_object_t object, 
 #endif
 static boolean_t
 phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before,
-  int *after)
+int *after)
 {
vm_pindex_t base, 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: r310109 - stable/11/sys/vm

2016-12-15 Thread Konstantin Belousov
Author: kib
Date: Thu Dec 15 10:44:45 2016
New Revision: 310109
URL: https://svnweb.freebsd.org/changeset/base/310109

Log:
  MFC r309709:
  Move map_generation snapshot value into struct faultstate.

Modified:
  stable/11/sys/vm/vm_fault.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/vm_fault.c
==
--- stable/11/sys/vm/vm_fault.c Thu Dec 15 10:42:14 2016(r310108)
+++ stable/11/sys/vm/vm_fault.c Thu Dec 15 10:44:45 2016(r310109)
@@ -122,6 +122,7 @@ struct faultstate {
vm_pindex_t first_pindex;
vm_map_t map;
vm_map_entry_t entry;
+   int map_generation;
bool lookup_still_valid;
struct vnode *vp;
 };
@@ -338,7 +339,7 @@ vm_fault_hold(vm_map_t map, vm_offset_t 
struct vnode *vp;
vm_offset_t e_end, e_start;
int ahead, alloc_req, behind, cluster_offset, error, era, faultcount;
-   int locked, map_generation, nera, result, rv;
+   int locked, nera, result, rv;
u_char behavior;
boolean_t wired;/* Passed by reference. */
bool dead, growstack, hardfault, is_first_object_locked;
@@ -372,7 +373,7 @@ RetryFault:;
return (result);
}
 
-   map_generation = fs.map->timestamp;
+   fs.map_generation = fs.map->timestamp;
 
if (fs.entry->eflags & MAP_ENTRY_NOFAULT) {
panic("vm_fault: fault on nofault entry, addr: %lx",
@@ -976,7 +977,7 @@ readrest:
goto RetryFault;
}
fs.lookup_still_valid = true;
-   if (fs.map->timestamp != map_generation) {
+   if (fs.map->timestamp != fs.map_generation) {
result = vm_map_lookup_locked(&fs.map, vaddr, 
fault_type,
&fs.entry, &retry_object, &retry_pindex, 
&retry_prot, &wired);
 
___
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: r310110 - stable/10/sys/vm

2016-12-15 Thread Konstantin Belousov
Author: kib
Date: Thu Dec 15 10:47:35 2016
New Revision: 310110
URL: https://svnweb.freebsd.org/changeset/base/310110

Log:
  MFC r309708:
  Style.

Modified:
  stable/10/sys/vm/phys_pager.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/vm/phys_pager.c
==
--- stable/10/sys/vm/phys_pager.c   Thu Dec 15 10:44:45 2016
(r310109)
+++ stable/10/sys/vm/phys_pager.c   Thu Dec 15 10:47:35 2016
(r310110)
@@ -56,9 +56,6 @@ phys_pager_init(void)
mtx_init(&phys_pager_mtx, "phys_pager list", NULL, MTX_DEF);
 }
 
-/*
- * MPSAFE
- */
 static vm_object_t
 phys_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
 vm_ooffset_t foff, struct ucred *cred)
@@ -101,8 +98,8 @@ phys_pager_alloc(void *handle, vm_ooffse
object = object1;
object1 = NULL;
object->handle = handle;
-   TAILQ_INSERT_TAIL(&phys_pager_object_list, 
object,
-   pager_object_list);
+   TAILQ_INSERT_TAIL(&phys_pager_object_list,
+   object, pager_object_list);
}
} else {
if (pindex > object->size)
@@ -117,9 +114,6 @@ phys_pager_alloc(void *handle, vm_ooffse
return (object);
 }
 
-/*
- * MPSAFE
- */
 static void
 phys_pager_dealloc(vm_object_t object)
 {
@@ -167,7 +161,7 @@ phys_pager_getpages(vm_object_t object, 
 
 static void
 phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t 
sync,
-   int *rtvals)
+int *rtvals)
 {
 
panic("phys_pager_putpage called");
@@ -185,7 +179,7 @@ phys_pager_putpages(vm_object_t object, 
 #endif
 static boolean_t
 phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before,
-  int *after)
+int *after)
 {
vm_pindex_t base, 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"


Re: svn commit: r309714 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-12-15 Thread Andriy Gapon
On 14/12/2016 21:49, Alexander Motin wrote:
> On 14.12.2016 14:03, Andriy Gapon wrote:
>> On 08/12/2016 17:58, Alexander Motin wrote:
>>>   This change switches zio_timestamp_compare() from comparing uninitialized
>>>   io_offset to really populated io_bookmark values.  I haven't decided yet
>>>   what to do with timestampts, but on simple tests this change gives the
>>>   same peformance results by just making code to work as declared.
>>
>> I think that we should just enable precise timestamps.
>> I just can't see them noticeably hurting performance given the amount of
>> calculations, memory allocations, locking, etc, that ZFS already has.
>> And there are layers above and below ZFS too.
> 
> It is orthogonal to this change and can be done any time, if decided.

Yes, indeed.

> I worried mostly about some older systems still using HPET or ACPI
> timecounters, where half dozen extra timer calls per single I/O may be
> quite expensive.
> 
> I've recently reviewed all places where ZFS calls gethrtime(), and found
> that in most of them precision is not needed, even 1 second would be
> enough, not even 1/hz.  I've found only two cases where precision is
> important, both about ZIO sorting in different places (this is one of
> the two), and both of them are now workarounded now by using offset as
> secondary key.

Thank you for looking into this and fixing the bug!

-- 
Andriy Gapon
___
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: r310111 - stable/10/sys/vm

2016-12-15 Thread Konstantin Belousov
Author: kib
Date: Thu Dec 15 10:51:35 2016
New Revision: 310111
URL: https://svnweb.freebsd.org/changeset/base/310111

Log:
  MFC r309709:
  Move map_generation snapshot value into struct faultstate.

Modified:
  stable/10/sys/vm/vm_fault.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/vm/vm_fault.c
==
--- stable/10/sys/vm/vm_fault.c Thu Dec 15 10:47:35 2016(r310110)
+++ stable/10/sys/vm/vm_fault.c Thu Dec 15 10:51:35 2016(r310111)
@@ -124,6 +124,7 @@ struct faultstate {
vm_map_t map;
vm_map_entry_t entry;
int lookup_still_valid;
+   int map_generation;
struct vnode *vp;
 };
 
@@ -336,7 +337,6 @@ vm_fault_hold(vm_map_t map, vm_offset_t 
long ahead, behind;
int alloc_req, era, faultcount, nera, reqpage, result;
boolean_t dead, growstack, is_first_object_locked, wired;
-   int map_generation;
vm_object_t next_object;
vm_page_t marray[VM_FAULT_READ_MAX];
int hardfault;
@@ -372,7 +372,7 @@ RetryFault:;
return (result);
}
 
-   map_generation = fs.map->timestamp;
+   fs.map_generation = fs.map->timestamp;
 
if (fs.entry->eflags & MAP_ENTRY_NOFAULT) {
panic("vm_fault: fault on nofault entry, addr: %lx",
@@ -950,7 +950,7 @@ readrest:
goto RetryFault;
}
fs.lookup_still_valid = TRUE;
-   if (fs.map->timestamp != map_generation) {
+   if (fs.map->timestamp != fs.map_generation) {
result = vm_map_lookup_locked(&fs.map, vaddr, 
fault_type,
&fs.entry, &retry_object, &retry_pindex, 
&retry_prot, &wired);
 
___
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: r310112 - head/sys/conf

2016-12-15 Thread Ed Maste
Author: emaste
Date: Thu Dec 15 12:57:03 2016
New Revision: 310112
URL: https://svnweb.freebsd.org/changeset/base/310112

Log:
  newvers.sh: add option to eliminate kernel build metadata
  
  Build metadata (username, hostname, etc.) prevents the FreeBSD kernel
  from building reproducibly. Add an option to disable inclusion of that
  metadata but retain the release information and SVN/git VCS details.
  See https://reproducible-builds.org/ for additional background.
  
  Reviewed by:  bapt
  Obtained from:NetBSD
  MFC after:1 month
  Sponsored by: Reproducible Builds World Summit 2, Berlin
  Differential Revision:https://reviews.freebsd.org/D4347

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==
--- head/sys/conf/newvers.shThu Dec 15 10:51:35 2016(r310111)
+++ head/sys/conf/newvers.shThu Dec 15 12:57:03 2016(r310112)
@@ -30,6 +30,14 @@
 #  @(#)newvers.sh  8.1 (Berkeley) 4/20/94
 # $FreeBSD$
 
+# Command line options:
+#
+# -r   Reproducible build.  Do not embed directory names, user
+#  names, time stamps or other dynamic information into
+#  the outuput file.  This is intended to allow two builds
+#  done at different times and even by different people on
+#  different hosts to produce identical output.
+
 TYPE="FreeBSD"
 REVISION="12.0"
 BRANCH="CURRENT"
@@ -250,10 +258,28 @@ if [ -n "$hg_cmd" ] ; then
fi
 fi
 
+include_metadata=true
+while getopts r opt; do
+   case "$opt" in
+   r)
+   include_metadata=
+   ;;
+   esac
+done
+shift $((OPTIND - 1))
+
+if [ -z "${include_metadata}" ]; then
+   VERINFO="${VERSION} ${svn}${git}${hg}${p4version}"
+   VERSTR="${VERINFO}\\n"
+else
+   VERINFO="${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}"
+   VERSTR="${VERINFO}\\n${u}@${h}:${d}\\n"
+fi
+
 cat << EOF > vers.c
 $COPYRIGHT
-#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}"
-#define VERSTR "${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}\\n
${u}@${h}:${d}\\n"
+#define SCCSSTR "@(#)${VERINFO}"
+#define VERSTR "${VERSTR}"
 #define RELSTR "${RELEASE}"
 
 char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;
___
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: r310112 - head/sys/conf

2016-12-15 Thread Steven Hartland

Thanks for doing this :)

On 15/12/2016 12:57, Ed Maste wrote:

Author: emaste
Date: Thu Dec 15 12:57:03 2016
New Revision: 310112
URL: https://svnweb.freebsd.org/changeset/base/310112

Log:
   newvers.sh: add option to eliminate kernel build metadata
   
   Build metadata (username, hostname, etc.) prevents the FreeBSD kernel

   from building reproducibly. Add an option to disable inclusion of that
   metadata but retain the release information and SVN/git VCS details.
   See https://reproducible-builds.org/ for additional background.
   
   Reviewed by:	bapt

   Obtained from:   NetBSD
   MFC after:   1 month
   Sponsored by:Reproducible Builds World Summit 2, Berlin
   Differential Revision:   https://reviews.freebsd.org/D4347

Modified:
   head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==
--- head/sys/conf/newvers.shThu Dec 15 10:51:35 2016(r310111)
+++ head/sys/conf/newvers.shThu Dec 15 12:57:03 2016(r310112)
@@ -30,6 +30,14 @@
  # @(#)newvers.sh  8.1 (Berkeley) 4/20/94
  # $FreeBSD$
  
+# Command line options:

+#
+# -r   Reproducible build.  Do not embed directory names, user
+#  names, time stamps or other dynamic information into
+#  the outuput file.  This is intended to allow two builds
+#  done at different times and even by different people on
+#  different hosts to produce identical output.
+
  TYPE="FreeBSD"
  REVISION="12.0"
  BRANCH="CURRENT"
@@ -250,10 +258,28 @@ if [ -n "$hg_cmd" ] ; then
fi
  fi
  
+include_metadata=true

+while getopts r opt; do
+   case "$opt" in
+   r)
+   include_metadata=
+   ;;
+   esac
+done
+shift $((OPTIND - 1))
+
+if [ -z "${include_metadata}" ]; then
+   VERINFO="${VERSION} ${svn}${git}${hg}${p4version}"
+   VERSTR="${VERINFO}\\n"
+else
+   VERINFO="${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}"
+   VERSTR="${VERINFO}\\n${u}@${h}:${d}\\n"
+fi
+
  cat << EOF > vers.c
  $COPYRIGHT
-#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}"
-#define VERSTR "${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}\\n
${u}@${h}:${d}\\n"
+#define SCCSSTR "@(#)${VERINFO}"
+#define VERSTR "${VERSTR}"
  #define RELSTR "${RELEASE}"
  
  char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;




___
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: r310113 - head/sys/arm/broadcom/bcm2835

2016-12-15 Thread Andrew Turner
Author: andrew
Date: Thu Dec 15 13:31:44 2016
New Revision: 310113
URL: https://svnweb.freebsd.org/changeset/base/310113

Log:
  Directly include openfirm.h rather than through fdt_common.h as none of the
  latter file is needed.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Thu Dec 15 12:57:03 
2016(r310112)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Thu Dec 15 13:31:44 
2016(r310113)
@@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
 #include 
 #include 
___
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: r310114 - head/sys/conf

2016-12-15 Thread Ed Maste
Author: emaste
Date: Thu Dec 15 15:14:02 2016
New Revision: 310114
URL: https://svnweb.freebsd.org/changeset/base/310114

Log:
  newvers.sh: correct typo in comment
  
  Submitted by: lidl

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==
--- head/sys/conf/newvers.shThu Dec 15 13:31:44 2016(r310113)
+++ head/sys/conf/newvers.shThu Dec 15 15:14:02 2016(r310114)
@@ -34,7 +34,7 @@
 #
 # -r   Reproducible build.  Do not embed directory names, user
 #  names, time stamps or other dynamic information into
-#  the outuput file.  This is intended to allow two builds
+#  the output file.  This is intended to allow two builds
 #  done at different times and even by different people on
 #  different hosts to produce identical output.
 
___
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: r310115 - in vendor/libarchive/dist: . build build/autoconf cat cpio cpio/test libarchive libarchive/test tar/test

2016-12-15 Thread Martin Matuska
Author: mm
Date: Thu Dec 15 15:35:53 2016
New Revision: 310115
URL: https://svnweb.freebsd.org/changeset/base/310115

Log:
  Update vendor/libarchive to git to 30528ed7a9f479f1c363ee8cfa1c5eb4c7d9be10
  
  Vendor bugfixes:
  
  PR 826: OpenSSL 1.1 support
  PR 830, 831, 833: Spelling fixes
  OSS-Fuzz 227, 230, 239: Fix possible memory leak in archive_read_free()
  OSS-Fuzz 237: Fix heap buffer overflow when reading invalid ar archives

Modified:
  vendor/libarchive/dist/.travis.yml
  vendor/libarchive/dist/Makefile.am
  vendor/libarchive/dist/build/autoconf/config.rpath
  vendor/libarchive/dist/build/ci_build.sh
  vendor/libarchive/dist/cat/bsdcat.c
  vendor/libarchive/dist/configure.ac
  vendor/libarchive/dist/cpio/cpio.c
  vendor/libarchive/dist/cpio/test/test_option_lz4.c
  vendor/libarchive/dist/libarchive/CMakeLists.txt
  vendor/libarchive/dist/libarchive/archive.h
  vendor/libarchive/dist/libarchive/archive_acl.c
  vendor/libarchive/dist/libarchive/archive_cryptor.c
  vendor/libarchive/dist/libarchive/archive_cryptor_private.h
  vendor/libarchive/dist/libarchive/archive_digest.c
  vendor/libarchive/dist/libarchive/archive_digest_private.h
  vendor/libarchive/dist/libarchive/archive_entry.c
  vendor/libarchive/dist/libarchive/archive_hmac.c
  vendor/libarchive/dist/libarchive/archive_hmac_private.h
  vendor/libarchive/dist/libarchive/archive_options.c
  vendor/libarchive/dist/libarchive/archive_read.c
  vendor/libarchive/dist/libarchive/archive_read_append_filter.c
  vendor/libarchive/dist/libarchive/archive_read_disk_posix.c
  vendor/libarchive/dist/libarchive/archive_read_disk_windows.c
  vendor/libarchive/dist/libarchive/archive_read_extract2.c
  vendor/libarchive/dist/libarchive/archive_read_open_memory.c
  vendor/libarchive/dist/libarchive/archive_read_private.h
  vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_ar.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c
  vendor/libarchive/dist/libarchive/archive_string.c
  vendor/libarchive/dist/libarchive/archive_windows.c
  vendor/libarchive/dist/libarchive/archive_write.c
  vendor/libarchive/dist/libarchive/archive_write_add_filter_lz4.c
  vendor/libarchive/dist/libarchive/archive_write_disk_posix.c
  vendor/libarchive/dist/libarchive/archive_write_disk_set_standard_lookup.c
  vendor/libarchive/dist/libarchive/archive_write_disk_windows.c
  vendor/libarchive/dist/libarchive/archive_write_open_memory.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_ar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_cpio_newc.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_shar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_ustar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_v7tar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c
  vendor/libarchive/dist/libarchive/test/test_archive_read_add_passphrase.c
  vendor/libarchive/dist/libarchive/test/test_pax_filename_encoding.c
  vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c
  vendor/libarchive/dist/tar/test/test_option_lz4.c

Modified: vendor/libarchive/dist/.travis.yml
==
--- vendor/libarchive/dist/.travis.yml  Thu Dec 15 15:14:02 2016
(r310114)
+++ vendor/libarchive/dist/.travis.yml  Thu Dec 15 15:35:53 2016
(r310115)
@@ -1,13 +1,23 @@
 language: C
 sudo: required
 dist: trusty
+os:
+  - linux
+  - osx
 compiler:
   - gcc
   - clang
 env:
   - BUILD_SYSTEM=cmake
   - BUILD_SYSTEM=autotools
+matrix:
+  exclude:
+- os: osx
+  compiler: gcc
+before_install:
+  - if [ `uname` = "Darwin" ]; then brew update; fi
+  - if [ `uname` = "Linux" ]; then sudo apt-get install -y libbz2-dev 
libzip-dev liblzma-dev liblzo2-dev; fi
 install:
-  - sudo apt-get install -y libbz2-dev libzip-dev liblzma-dev liblzo2-dev
+  - if [ `uname` = "Darwin" ]; then brew install xz lzo lz4; fi
 script:
   - build/ci_build.sh

Modified: vendor/libarchive/dist/Makefile.am
==
--- vendor/libarchive/dist/Makefile.am  Thu Dec 15 15:14:02 2016
(r310114)
+++ vendor/libarchive/dist/Makefile.am  Thu Dec 15 15:35:53 2016
(r310115)
@@ -118,6 +118,8 @@ libarchive_la_SOURCES= \
libarchive/archive_hmac.c \
libarchive/archive_hmac_private.h \
l

svn commit: r310116 - head/sys/kern

2016-12-15 Thread Ed Schouten
Author: ed
Date: Thu Dec 15 15:45:11 2016
New Revision: 310116
URL: https://svnweb.freebsd.org/changeset/base/310116

Log:
  Document the existence of the {0, 6, ...} sysctl.

Modified:
  head/sys/kern/kern_sysctl.c

Modified: head/sys/kern/kern_sysctl.c
==
--- head/sys/kern/kern_sysctl.c Thu Dec 15 15:35:53 2016(r310115)
+++ head/sys/kern/kern_sysctl.c Thu Dec 15 15:45:11 2016(r310116)
@@ -821,7 +821,8 @@ SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FI
  * {0,2,...}   return the next OID.
  * {0,3}   return the OID of the name in "new"
  * {0,4,...}   return the kind & format info for the "..." OID.
- * {0,5,...}   return the description the "..." OID.
+ * {0,5,...}   return the description of the "..." OID.
+ * {0,6,...}   return the aggregation label of the "..." OID.
  */
 
 #ifdef SYSCTL_DEBUG
___
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: r310117 - in head/sys/arm/allwinner: . a10 a13 a20 a31 a64 h3

2016-12-15 Thread Emmanuel Vadot
Author: manu
Date: Thu Dec 15 15:52:13 2016
New Revision: 310117
URL: https://svnweb.freebsd.org/changeset/base/310117

Log:
  Add information about interrupts in the Allwinner padconf files and
  correct some pin numbering.
  
  While here switch to my freebsd mail address in the copyright.
  
  MFC after:3 days

Modified:
  head/sys/arm/allwinner/a10/a10_padconf.c
  head/sys/arm/allwinner/a13/a13_padconf.c
  head/sys/arm/allwinner/a20/a20_padconf.c
  head/sys/arm/allwinner/a31/a31_padconf.c
  head/sys/arm/allwinner/a31/a31_r_padconf.c
  head/sys/arm/allwinner/a31/a31s_padconf.c
  head/sys/arm/allwinner/a64/a64_padconf.c
  head/sys/arm/allwinner/a64/a64_r_padconf.c
  head/sys/arm/allwinner/allwinner_pinctrl.h
  head/sys/arm/allwinner/h3/h3_padconf.c
  head/sys/arm/allwinner/h3/h3_r_padconf.c

Modified: head/sys/arm/allwinner/a10/a10_padconf.c
==
--- head/sys/arm/allwinner/a10/a10_padconf.cThu Dec 15 15:45:11 2016
(r310116)
+++ head/sys/arm/allwinner/a10/a10_padconf.cThu Dec 15 15:52:13 2016
(r310117)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2016 Emmanuel Vadot 
+ * Copyright (c) 2016 Emmanuel Vadot 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -170,28 +170,28 @@ const static struct allwinner_pins a10_p
{"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", 
NULL, NULL}},
{"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", 
NULL, NULL}},
 
-   {"PH0",  7,  0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, 
"eint", "csi1"}},
-   {"PH1",  7,  1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, 
"eint", "csi1"}},
-   {"PH2",  7,  2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, 
"eint", "csi1"}},
-   {"PH3",  7,  3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, 
"eint", "csi1"}},
-   {"PH4",  7,  4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, 
"eint", "csi1"}},
-   {"PH5",  7,  5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, 
"eint", "csi1"}},
-   {"PH6",  7,  6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", 
"eint", "csi1"}},
-   {"PH7",  7,  7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", 
"eint", "csi1"}},
-   {"PH8",  7,  8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", 
"eint", "csi1"}},
-   {"PH9",  7,  9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", 
"eint", "csi1"}},
-   {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", 
"eint", "csi1"}},
-   {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", 
"eint", "csi1"}},
-   {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, 
"eint", "csi1"}},
-   {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", 
"eint", "csi1"}},
-   {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", 
"sim", "eint", "csi1"}},
-   {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", 
"sim", "eint", "csi1"}},
-   {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, 
"eint", "csi1"}},
-   {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", 
"sim", "eint", "csi1"}},
-   {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", 
"sim", "eint", "csi1"}},
-   {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", 
"sim", "eint", "csi1"}},
-   {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, 
"eint", "csi1"}},
-   {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, 
"eint", "csi1"}},
+   {"PH0",  7,  0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, 
"eint0", "csi1"}, 6, 0},
+   {"PH1",  7,  1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, 
"eint1", "csi1"}, 6, 1},
+   {"PH2",  7,  2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, 
"eint2", "csi1"}, 6, 2},
+   {"PH3",  7,  3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, 
"eint3", "csi1"}, 6, 3},
+   {"PH4",  7,  4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, 
"eint4", "csi1"}, 6, 4},
+   {"PH5",  7,  5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, 
"eint5", "csi1"}, 6, 5},
+   {"PH6",  7,  6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", 
"eint6", "csi1"}, 6, 6},
+   {"PH7",  7,  7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", 
"eint7", "csi1"}, 6, 7},
+   {"PH8",  7,  8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", 
"eint8", "csi1"}, 6, 8},
+   {"PH9",  7,  9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", 
"eint9", "csi1"}, 6, 9},
+   {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", 
"eint10", "csi1"}, 6, 10},
+   {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", 
"eint11", "csi1"}, 

svn commit: r310118 - head/bin/ls/tests

2016-12-15 Thread Alan Somers
Author: asomers
Date: Thu Dec 15 16:13:52 2016
New Revision: 310118
URL: https://svnweb.freebsd.org/changeset/base/310118

Log:
  Fix ls_tests:o_flag with ZFS TMPDIR
  
  Unlike UFS or TMPFS, ZFS sets uarch automatically whenever a file is
  updated. The test must explicitly clear uarch to be portable across
  filesystems. Also, it doesn't need to run as root.
  
  PR:   215179
  MFC after:4 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D8741

Modified:
  head/bin/ls/tests/ls_tests.sh

Modified: head/bin/ls/tests/ls_tests.sh
==
--- head/bin/ls/tests/ls_tests.sh   Thu Dec 15 15:52:13 2016
(r310117)
+++ head/bin/ls/tests/ls_tests.sh   Thu Dec 15 16:13:52 2016
(r310118)
@@ -697,7 +697,6 @@ atf_test_case o_flag
 o_flag_head()
 {
atf_set "descr" "Verify that the output from ls -o prints out the 
chflag values or '-' if none are set"
-   atf_set "require.user" "root"
 }
 
 o_flag_body()
@@ -711,6 +710,7 @@ o_flag_body()
atf_check -e ignore -o empty -s exit:0 dd if=/dev/zero of=b.file \
bs=$size count=1
atf_check -e empty -o empty -s exit:0 chflags uarch a.file
+   atf_check -e empty -o empty -s exit:0 chflags 0 b.file
 
atf_check -e empty -o 
match:"[[:space:]]+uarch[[:space:]]$size+.+a\\.file" \
-s exit:0 ls -lo a.file
___
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: r310119 - svnadmin/conf

2016-12-15 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Dec 15 16:27:39 2016
New Revision: 310119
URL: https://svnweb.freebsd.org/changeset/base/310119

Log:
  Give a warm welcome to Piotr Stefaniak to the src committer team.
  
  He will be working on much needed improvements to our indent(1) utility.
  
  Approved by:  core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessThu Dec 15 16:13:52 2016(r310118)
+++ svnadmin/conf/accessThu Dec 15 16:27:39 2016(r310119)
@@ -192,6 +192,7 @@ pjd
 pkelsey
 pluknet
 ps
+pstef
 qingli
 raj
 ray

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Thu Dec 15 16:13:52 2016(r310118)
+++ svnadmin/conf/mentors   Thu Dec 15 16:27:39 2016(r310119)
@@ -34,6 +34,7 @@ mizhkaadrian  Co-mentor: cognet
 monthadar  adrian
 peterj jhb Co-mentor: grog
 phil   theravenCo-mentor: sjg
+pstef  pfg
 slmken Co-mentor: scottl, ambrisko
 snbdwmalone
 stevek sjg
___
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: r310120 - in stable/11: bin/ps lib/libkvm sys/compat/freebsd32 sys/kern sys/sys usr.bin/procstat usr.bin/top

2016-12-15 Thread Eric van Gyzen
Author: vangyzen
Date: Thu Dec 15 16:51:33 2016
New Revision: 310120
URL: https://svnweb.freebsd.org/changeset/base/310120

Log:
  MFC r309676
  
  Export the whole thread name in kinfo_proc
  
  kinfo_proc::ki_tdname is three characters shorter than
  thread::td_name.  Add a ki_moretdname field for these three
  extra characters.  Add the new field to kinfo_proc32, as well.
  Update all in-tree consumers to read the new field and assemble
  the full name, except for lldb's HostThreadFreeBSD.cpp, which
  I will handle separately.  Bump __FreeBSD_version.
  
  Sponsored by: Dell EMC

Modified:
  stable/11/bin/ps/print.c
  stable/11/lib/libkvm/kvm_proc.c
  stable/11/sys/compat/freebsd32/freebsd32.h
  stable/11/sys/kern/kern_proc.c
  stable/11/sys/sys/param.h
  stable/11/sys/sys/user.h
  stable/11/usr.bin/procstat/procstat.c
  stable/11/usr.bin/procstat/procstat.h
  stable/11/usr.bin/procstat/procstat_cs.c
  stable/11/usr.bin/procstat/procstat_kstack.c
  stable/11/usr.bin/procstat/procstat_threads.c
  stable/11/usr.bin/top/machine.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/ps/print.c
==
--- stable/11/bin/ps/print.cThu Dec 15 16:27:39 2016(r310119)
+++ stable/11/bin/ps/print.cThu Dec 15 16:51:33 2016(r310120)
@@ -120,11 +120,12 @@ command(KINFO *k, VARENT *ve)
if (cflag) {
/* If it is the last field, then don't pad */
if (STAILQ_NEXT(ve, next_ve) == NULL) {
-   asprintf(&str, "%s%s%s%s",
+   asprintf(&str, "%s%s%s%s%s",
k->ki_d.prefix ? k->ki_d.prefix : "",
k->ki_p->ki_comm,
(showthreads && k->ki_p->ki_numthreads > 1) ? "/" : 
"",
-   (showthreads && k->ki_p->ki_numthreads > 1) ? 
k->ki_p->ki_tdname : "");
+   (showthreads && k->ki_p->ki_numthreads > 1) ? 
k->ki_p->ki_tdname : "",
+   (showthreads && k->ki_p->ki_numthreads > 1) ? 
k->ki_p->ki_moretdname : "");
} else
str = strdup(k->ki_p->ki_comm);
 
@@ -172,14 +173,16 @@ ucomm(KINFO *k, VARENT *ve)
char *str;
 
if (STAILQ_NEXT(ve, next_ve) == NULL) { /* last field, don't pad */
-   asprintf(&str, "%s%s%s%s",
+   asprintf(&str, "%s%s%s%s%s",
k->ki_d.prefix ? k->ki_d.prefix : "",
k->ki_p->ki_comm,
(showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "",
-   (showthreads && k->ki_p->ki_numthreads > 1) ? 
k->ki_p->ki_tdname : "");
+   (showthreads && k->ki_p->ki_numthreads > 1) ? 
k->ki_p->ki_tdname : "",
+   (showthreads && k->ki_p->ki_numthreads > 1) ? 
k->ki_p->ki_moretdname : "");
} else {
if (showthreads && k->ki_p->ki_numthreads > 1)
-   asprintf(&str, "%s/%s", k->ki_p->ki_comm, 
k->ki_p->ki_tdname);
+   asprintf(&str, "%s/%s%s", k->ki_p->ki_comm,
+   k->ki_p->ki_tdname, k->ki_p->ki_moretdname);
else
str = strdup(k->ki_p->ki_comm);
}
@@ -192,7 +195,8 @@ tdnam(KINFO *k, VARENT *ve __unused)
char *str;
 
if (showthreads && k->ki_p->ki_numthreads > 1)
-   str = strdup(k->ki_p->ki_tdname);
+   asprintf(&str, "%s%s", k->ki_p->ki_tdname,
+   k->ki_p->ki_moretdname);
else
str = strdup("  ");
 

Modified: stable/11/lib/libkvm/kvm_proc.c
==
--- stable/11/lib/libkvm/kvm_proc.c Thu Dec 15 16:27:39 2016
(r310119)
+++ stable/11/lib/libkvm/kvm_proc.c Thu Dec 15 16:51:33 2016
(r310120)
@@ -426,8 +426,6 @@ nopgrp:
kp->ki_pri.pri_native = mtd.td_base_pri;
kp->ki_lastcpu = mtd.td_lastcpu;
kp->ki_wchan = mtd.td_wchan;
-   if (mtd.td_name[0] != 0)
-   strlcpy(kp->ki_tdname, mtd.td_name, MAXCOMLEN);
kp->ki_oncpu = mtd.td_oncpu;
if (mtd.td_name[0] != '\0')
strlcpy(kp->ki_tdname, mtd.td_name, 
sizeof(kp->ki_tdname));

Modified: stable/11/sys/compat/freebsd32/freebsd32.h
==
--- stable/11/sys/compat/freebsd32/freebsd32.h  Thu Dec 15 16:27:39 2016
(r310119)
+++ stable/11/sys/compat/freebsd32/freebsd32.h  Thu Dec 15 16:51:33 2016
(r310120)
@@ -315,7 +315,8 @@ struct kinfo_proc32 {
charki_comm[COMMLEN+1];
charki_emul[KI_EMULNAMELEN+1];
charki_loginclass[LOGINCLASSLEN+1];
-   charki_sparestrin

svn commit: r310121 - in stable/10: bin/ps lib/libkvm sys/compat/freebsd32 sys/kern sys/sys usr.bin/procstat usr.bin/top

2016-12-15 Thread Eric van Gyzen
Author: vangyzen
Date: Thu Dec 15 16:52:17 2016
New Revision: 310121
URL: https://svnweb.freebsd.org/changeset/base/310121

Log:
  MFC r309676
  
  Export the whole thread name in kinfo_proc
  
  kinfo_proc::ki_tdname is three characters shorter than
  thread::td_name.  Add a ki_moretdname field for these three
  extra characters.  Add the new field to kinfo_proc32, as well.
  Update all in-tree consumers to read the new field and assemble
  the full name, except for lldb's HostThreadFreeBSD.cpp, which
  I will handle separately.  Bump __FreeBSD_version.
  
  Sponsored by: Dell EMC

Modified:
  stable/10/bin/ps/print.c
  stable/10/lib/libkvm/kvm_proc.c
  stable/10/sys/compat/freebsd32/freebsd32.h
  stable/10/sys/kern/kern_proc.c
  stable/10/sys/sys/param.h
  stable/10/sys/sys/user.h
  stable/10/usr.bin/procstat/procstat.c
  stable/10/usr.bin/procstat/procstat.h
  stable/10/usr.bin/procstat/procstat_cs.c
  stable/10/usr.bin/procstat/procstat_kstack.c
  stable/10/usr.bin/procstat/procstat_threads.c
  stable/10/usr.bin/top/machine.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/bin/ps/print.c
==
--- stable/10/bin/ps/print.cThu Dec 15 16:51:33 2016(r310120)
+++ stable/10/bin/ps/print.cThu Dec 15 16:52:17 2016(r310121)
@@ -119,11 +119,12 @@ command(KINFO *k, VARENT *ve)
if (cflag) {
/* If it is the last field, then don't pad */
if (STAILQ_NEXT(ve, next_ve) == NULL) {
-   asprintf(&str, "%s%s%s%s",
+   asprintf(&str, "%s%s%s%s%s",
k->ki_d.prefix ? k->ki_d.prefix : "",
k->ki_p->ki_comm,
(showthreads && k->ki_p->ki_numthreads > 1) ? "/" : 
"",
-   (showthreads && k->ki_p->ki_numthreads > 1) ? 
k->ki_p->ki_tdname : "");
+   (showthreads && k->ki_p->ki_numthreads > 1) ? 
k->ki_p->ki_tdname : "",
+   (showthreads && k->ki_p->ki_numthreads > 1) ? 
k->ki_p->ki_moretdname : "");
} else
str = strdup(k->ki_p->ki_comm);
 
@@ -171,14 +172,16 @@ ucomm(KINFO *k, VARENT *ve)
char *str;
 
if (STAILQ_NEXT(ve, next_ve) == NULL) { /* last field, don't pad */
-   asprintf(&str, "%s%s%s%s",
+   asprintf(&str, "%s%s%s%s%s",
k->ki_d.prefix ? k->ki_d.prefix : "",
k->ki_p->ki_comm,
(showthreads && k->ki_p->ki_numthreads > 1) ? "/" : "",
-   (showthreads && k->ki_p->ki_numthreads > 1) ? 
k->ki_p->ki_tdname : "");
+   (showthreads && k->ki_p->ki_numthreads > 1) ? 
k->ki_p->ki_tdname : "",
+   (showthreads && k->ki_p->ki_numthreads > 1) ? 
k->ki_p->ki_moretdname : "");
} else {
if (showthreads && k->ki_p->ki_numthreads > 1)
-   asprintf(&str, "%s/%s", k->ki_p->ki_comm, 
k->ki_p->ki_tdname);
+   asprintf(&str, "%s/%s%s", k->ki_p->ki_comm,
+   k->ki_p->ki_tdname, k->ki_p->ki_moretdname);
else
str = strdup(k->ki_p->ki_comm);
}
@@ -191,7 +194,8 @@ tdnam(KINFO *k, VARENT *ve __unused)
char *str;
 
if (showthreads && k->ki_p->ki_numthreads > 1)
-   str = strdup(k->ki_p->ki_tdname);
+   asprintf(&str, "%s%s", k->ki_p->ki_tdname,
+   k->ki_p->ki_moretdname);
else
str = strdup("  ");
 

Modified: stable/10/lib/libkvm/kvm_proc.c
==
--- stable/10/lib/libkvm/kvm_proc.c Thu Dec 15 16:51:33 2016
(r310120)
+++ stable/10/lib/libkvm/kvm_proc.c Thu Dec 15 16:52:17 2016
(r310121)
@@ -424,8 +424,6 @@ nopgrp:
kp->ki_pri.pri_native = mtd.td_base_pri;
kp->ki_lastcpu = mtd.td_lastcpu;
kp->ki_wchan = mtd.td_wchan;
-   if (mtd.td_name[0] != 0)
-   strlcpy(kp->ki_tdname, mtd.td_name, MAXCOMLEN);
kp->ki_oncpu = mtd.td_oncpu;
if (mtd.td_name[0] != '\0')
strlcpy(kp->ki_tdname, mtd.td_name, 
sizeof(kp->ki_tdname));

Modified: stable/10/sys/compat/freebsd32/freebsd32.h
==
--- stable/10/sys/compat/freebsd32/freebsd32.h  Thu Dec 15 16:51:33 2016
(r310120)
+++ stable/10/sys/compat/freebsd32/freebsd32.h  Thu Dec 15 16:52:17 2016
(r310121)
@@ -315,7 +315,8 @@ struct kinfo_proc32 {
charki_comm[COMMLEN+1];
charki_emul[KI_EMULNAMELEN+1];
charki_loginclass[LOGINCLASSLEN+1];
-   charki_sparestrin

svn commit: r310122 - head/sys/arm/allwinner/a64

2016-12-15 Thread Emmanuel Vadot
Author: manu
Date: Thu Dec 15 17:26:16 2016
New Revision: 310122
URL: https://svnweb.freebsd.org/changeset/base/310122

Log:
  Fix building arm64 kernel after r310117
  
  Pointy hat: me
  
  MFC after:3 days

Modified:
  head/sys/arm/allwinner/a64/a64_padconf.c
  head/sys/arm/allwinner/a64/a64_r_padconf.c

Modified: head/sys/arm/allwinner/a64/a64_padconf.c
==
--- head/sys/arm/allwinner/a64/a64_padconf.cThu Dec 15 16:52:17 2016
(r310121)
+++ head/sys/arm/allwinner/a64/a64_padconf.cThu Dec 15 17:26:16 2016
(r310122)
@@ -41,16 +41,16 @@ __FBSDID("$FreeBSD$");
 #ifdef SOC_ALLWINNER_A64
 
 static const struct allwinner_pins a64_pins[] = {
-   { "PB0",  1, 0,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", NULL, 
"pb_eint0" } 6, 0},
-   { "PB1",  1, 1,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", 
"sim", "pb_eint1" } 6, 1},
-   { "PB2",  1, 2,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", 
"sim", "pb_eint2" } 6, 2},
-   { "PB3",  1, 3,   { "gpio_in", "gpio_out", "uart2", "i2s0", "jtag", 
"sim", "pb_eint3" } 6, 3},
-   { "PB4",  1, 4,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", 
"pb_eint4" } 6, 4},
-   { "PB5",  1, 5,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", 
"pb_eint5" } 6, 5},
-   { "PB6",  1, 6,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", 
"pb_eint6" } 6, 6},
-   { "PB7",  1, 7,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", 
"pb_eint7" } 6, 7},
-   { "PB8",  1, 8,   { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, 
"pb_eint8" } 6, 8},
-   { "PB9",  1, 9,   { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, 
"pb_eint9" } 6, 9},
+   { "PB0",  1, 0,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", NULL, 
"pb_eint0" }, 6, 0},
+   { "PB1",  1, 1,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", 
"sim", "pb_eint1" }, 6, 1},
+   { "PB2",  1, 2,   { "gpio_in", "gpio_out", "uart2", NULL, "jtag", 
"sim", "pb_eint2" }, 6, 2},
+   { "PB3",  1, 3,   { "gpio_in", "gpio_out", "uart2", "i2s0", "jtag", 
"sim", "pb_eint3" }, 6, 3},
+   { "PB4",  1, 4,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", 
"pb_eint4" }, 6, 4},
+   { "PB5",  1, 5,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", 
"pb_eint5" }, 6, 5},
+   { "PB6",  1, 6,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", 
"pb_eint6" }, 6, 6},
+   { "PB7",  1, 7,   { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", 
"pb_eint7" }, 6, 7},
+   { "PB8",  1, 8,   { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, 
"pb_eint8" }, 6, 8},
+   { "PB9",  1, 9,   { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, 
"pb_eint9" }, 6, 9},
 
{ "PC0",  2, 0,   { "gpio_in", "gpio_out", "nand", NULL, "spi0" } },
{ "PC1",  2, 1,   { "gpio_in", "gpio_out", "nand", "mmc2", "spi0" } },
@@ -123,33 +123,33 @@ static const struct allwinner_pins a64_p
{ "PF5",  5, 5,   { "gpio_in", "gpio_out", "mmc0", "jtag" } },
{ "PF6",  5, 6,   { "gpio_in", "gpio_out" } },
 
-   { "PG0",  6, 0,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, 
"pg_eint0" } 6, 0},
-   { "PG1",  6, 1,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, 
"pg_eint1" } 6, 1},
-   { "PG2",  6, 2,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, 
"pg_eint2" } 6, 2},
-   { "PG3",  6, 3,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, 
"pg_eint3" } 6, 3},
-   { "PG4",  6, 4,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, 
"pg_eint4" } 6, 4},
-   { "PG5",  6, 5,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, 
"pg_eint5" } 6, 5},
-   { "PG6",  6, 6,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, 
"pg_eint6" } 6, 6},
-   { "PG7",  6, 7,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, 
"pg_eint7" } 6, 7},
-   { "PG8",  6, 8,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, 
"pg_eint8" } 6, 8},
-   { "PG9",  6, 9,   { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, 
"pg_eint9" } 6, 9},
-   { "PG10", 6, 10,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, 
"pg_eint10" } 6, 10},
-   { "PG11", 6, 11,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, 
"pg_eint11" } 6, 11},
-   { "PG12", 6, 12,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, 
"pg_eint12" } 6, 12},
-   { "PG13", 6, 13,  { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, 
"pg_eint13" } 6, 13},
-
-   { "PH0",  7, 0,   { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, 
"ph_eint0" } 6, 0},
-   { "PH1",  7, 1,   { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, 
"ph_eint1" } 6, 1},
-   { "PH2",  7, 2,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, 
"ph_eint2" } 6, 2},
-   { "PH3",  7, 3,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, 
"ph_eint3" } 6, 3},
-   { "PH4",  7, 4,   { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, 
"ph_ei

svn commit: r310124 - head/sys/boot/arm/uboot

2016-12-15 Thread Andrew Turner
Author: andrew
Date: Thu Dec 15 17:36:54 2016
New Revision: 310124
URL: https://svnweb.freebsd.org/changeset/base/310124

Log:
  Add -fPIC to the ubldr build. Without this the self relocation code will
  try to use an absolute address in a switch statement, jumping to an invalid
  memory location.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/boot/arm/uboot/Makefile

Modified: head/sys/boot/arm/uboot/Makefile
==
--- head/sys/boot/arm/uboot/MakefileThu Dec 15 17:34:18 2016
(r310123)
+++ head/sys/boot/arm/uboot/MakefileThu Dec 15 17:36:54 2016
(r310124)
@@ -109,6 +109,8 @@ CFLAGS+=-I${.OBJDIR}/../../uboot/lib
 # where to get libstand from
 CFLAGS+=   -I${.CURDIR}/../../../../lib/libstand/
 
+CFLAGS+=   -fPIC
+
 # clang doesn't understand %D as a specifier to printf
 NO_WERROR.clang=
 
___
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: r309818 - in head: etc/defaults etc/rc.d sbin sbin/decryptcore sbin/dumpon sbin/savecore share/man/man5 sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/ddb sys/dev/null sys/ge

2016-12-15 Thread Gleb Kurtsou
On (10/12/2016 16:20), Konrad Witaszczyk wrote:
> Author: def
> Date: Sat Dec 10 16:20:39 2016
> New Revision: 309818
> URL: https://svnweb.freebsd.org/changeset/base/309818
> 
> Log:
>   Add support for encrypted kernel crash dumps.

Thank you!

I'm very glad to see it committed.
___
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: r310086 - head/sys/dev/xen/blkfront

2016-12-15 Thread Dimitry Andric
On 15 Dec 2016, at 08:01, Colin Percival  wrote:
> 
> On 12/14/16 11:28, Dimitry Andric wrote:
>> Log:
>>  In xbd_connect(), use correct scanf conversion specifiers for the
>>  feature_barrier and feature_flush variables.  Otherwise, adjacent
>>  variables on the stack, such as sector_size, may be overwritten, with
>>  disastrous results.
> 
> Thanks!  Did you happen to notice what stack variable (if any?) was being
> overwritten under clang 3.8.0?  Just wondering if there might be some
> undiscovered issue lurking in FreeBSD releases which will cause other less
> obvious problems.

Here is a little overview of the locations on the stack (e.g. offsets
from %rbp) with different compiler versions:

clang 3.8.x and earlier:
[ -56: -48) sectors
[ -64: -56) sector_size
[ -72: -64) phys_sector_size
[ -76: -72) binfo
[ -80: -76) feature_barrier
[ -84: -80) feature_flush

Here, writing 8 bytes of data to feature_barrier will most likely
overwrite binfo with zeroes, but since that is usually zero already,
not much will happen.

Similarly, writing 8 bytes of data to feature_flush will most likely
overwrite feature_barrier with zeroes, effectively always turning off
that feature.

clang 3.9.0 and later:
[ -80: -72) phys_sector_size
[ -88: -80) sector_size
[ -92: -88) feature_flush
[ -96: -92) feature_barrier
[-104: -96) indirectpages
[-112:-104) sectors
[-132:-128) binfo

As is now known, here the effect was that sector_size is effectively
zeroed when feature_flush is written.  Not good. :)

gcc 4.2.1:
[ -44: -40) binfo
[ -48: -44) feature_barrier
[ -52: -48) feature_flush
[ -64: -56) sectors
[ -72: -64) sector_size
[ -80: -72) phys_sector_size

For our base gcc, the results are similar to clang 3.8.x and earlier:
writing 8 bytes of data to feature_barrier will most likely overwrite
binfo with zeroes, to not much effect.  Same story for feature_flush.

gcc 6.2.0:
[ -64: -56) phys_sector_size
[ -72: -64) sector_size
[ -80: -72) sectors
[ -84: -80) feature_flush
[ -88: -84) feature_barrier
[ -92: -88) binfo

With a more recent version of gcc, writing 8 bytes of data to
feature_flush will most likely zero least significant half of sectors.
Unless the virtual disk has 2^32 or more sectors, it will turn up as
zero length.

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


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

2016-12-15 Thread Conrad Meyer
Can we please slap names on these numbers?  Even if we keep the
existing numeric values?

Thanks,
Conrad

On Thu, Dec 15, 2016 at 7:45 AM, Ed Schouten  wrote:
> Author: ed
> Date: Thu Dec 15 15:45:11 2016
> New Revision: 310116
> URL: https://svnweb.freebsd.org/changeset/base/310116
>
> Log:
>   Document the existence of the {0, 6, ...} sysctl.
>
> Modified:
>   head/sys/kern/kern_sysctl.c
>
> Modified: head/sys/kern/kern_sysctl.c
> ==
> --- head/sys/kern/kern_sysctl.c Thu Dec 15 15:35:53 2016(r310115)
> +++ head/sys/kern/kern_sysctl.c Thu Dec 15 15:45:11 2016(r310116)
> @@ -821,7 +821,8 @@ SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FI
>   * {0,2,...}   return the next OID.
>   * {0,3}   return the OID of the name in "new"
>   * {0,4,...}   return the kind & format info for the "..." OID.
> - * {0,5,...}   return the description the "..." OID.
> + * {0,5,...}   return the description of the "..." OID.
> + * {0,6,...}   return the aggregation label of the "..." OID.
>   */
>
>  #ifdef SYSCTL_DEBUG
>
___
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: r310126 - stable/11/tools/build/mk

2016-12-15 Thread Ngie Cooper
Author: ngie
Date: Thu Dec 15 20:10:20 2016
New Revision: 310126
URL: https://svnweb.freebsd.org/changeset/base/310126

Log:
  MFC r309602:
  
  Remove svn[lite]{bench,fsfs} if either MK_SVN == no or MK_SVNLITE == no

Modified:
  stable/11/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc
==
--- stable/11/tools/build/mk/OptionalObsoleteFiles.inc  Thu Dec 15 17:41:30 
2016(r310125)
+++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc  Thu Dec 15 20:10:20 
2016(r310126)
@@ -8821,7 +8821,9 @@ OLD_FILES+=usr/share/man/man8/wpa_suppli
 .if ${MK_SVNLITE} == no || ${MK_SVN} == yes
 OLD_FILES+=usr/bin/svnlite
 OLD_FILES+=usr/bin/svnliteadmin
+OLD_FILES+=usr/bin/svnlitebench
 OLD_FILES+=usr/bin/svnlitedumpfilter
+OLD_FILES+=usr/bin/svnlitefsfs
 OLD_FILES+=usr/bin/svnlitelook
 OLD_FILES+=usr/bin/svnlitemucc
 OLD_FILES+=usr/bin/svnliterdump
@@ -8834,7 +8836,9 @@ OLD_FILES+=usr/share/man/man1/svnlite.1.
 .if ${MK_SVN} == no
 OLD_FILES+=usr/bin/svn
 OLD_FILES+=usr/bin/svnadmin
+OLD_FILES+=usr/bin/svnbench
 OLD_FILES+=usr/bin/svndumpfilter
+OLD_FILES+=usr/bin/svnfsfs
 OLD_FILES+=usr/bin/svnlook
 OLD_FILES+=usr/bin/svnmucc
 OLD_FILES+=usr/bin/svnrdump
___
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: r310127 - stable/10/tools/build/mk

2016-12-15 Thread Ngie Cooper
Author: ngie
Date: Thu Dec 15 20:13:40 2016
New Revision: 310127
URL: https://svnweb.freebsd.org/changeset/base/310127

Log:
  MFstable/11 r310126:
  
  MFC r309602:
  
  Remove svn[lite]{bench,fsfs} if either MK_SVN == no or MK_SVNLITE == no

Modified:
  stable/10/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc
==
--- stable/10/tools/build/mk/OptionalObsoleteFiles.inc  Thu Dec 15 20:10:20 
2016(r310126)
+++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc  Thu Dec 15 20:13:40 
2016(r310127)
@@ -5511,7 +5511,9 @@ OLD_FILES+=usr/share/man/man8/wpa_suppli
 .if ${MK_SVNLITE} == no || ${MK_SVN} == yes
 OLD_FILES+=usr/bin/svnlite
 OLD_FILES+=usr/bin/svnliteadmin
+OLD_FILES+=usr/bin/svnlitebench
 OLD_FILES+=usr/bin/svnlitedumpfilter
+OLD_FILES+=usr/bin/svnlitefsfs
 OLD_FILES+=usr/bin/svnlitelook
 OLD_FILES+=usr/bin/svnlitemucc
 OLD_FILES+=usr/bin/svnliterdump
@@ -5524,7 +5526,9 @@ OLD_FILES+=usr/share/man/man1/svnlite.1.
 .if ${MK_SVN} == no
 OLD_FILES+=usr/bin/svn
 OLD_FILES+=usr/bin/svnadmin
+OLD_FILES+=usr/bin/svnbench
 OLD_FILES+=usr/bin/svndumpfilter
+OLD_FILES+=usr/bin/svnfsfs
 OLD_FILES+=usr/bin/svnlook
 OLD_FILES+=usr/bin/svnmucc
 OLD_FILES+=usr/bin/svnrdump
___
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: r310116 - head/sys/kern

2016-12-15 Thread Ed Schouten
Hi Conrad,

[ + Christian Schwarz ]

2016-12-15 21:00 GMT+01:00 Conrad Meyer :
> Can we please slap names on these numbers?  Even if we keep the
> existing numeric values?

Christian and I exchanged some emails the other day in which we
discussed the option of adding libc wrappers/bindings for all of these
functions. That way these constants would only be hardcoded in two
places: kern_sysctl.c and the function in libc.

That said, adding numerical constants for them in sysctl.h would also
be a good idea. Right now there is already CTL_UNSPEC, but I guess
that should be renamed to something like CTL_INTERNAL or something.

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
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: r310128 - in head: sys/conf tools/build/options

2016-12-15 Thread Ed Maste
Author: emaste
Date: Thu Dec 15 21:26:58 2016
New Revision: 310128
URL: https://svnweb.freebsd.org/changeset/base/310128

Log:
  Add WITH_REPRODUCIBLE_BUILD src.conf(5) knob to disable kernel metadata
  
  The kernel builds reproducibly, except for the time, date, user, and
  hostname baked into the kernel (reported at startup and via the
  kern.version sysctl for uname).  Add a build knob to disable the
  inclusion of this metadata.
  
  Reviewed by:  jhb
  MFC after:1 month
  Relnotes: Yes
  Sponsored by: Reproducible Builds World Summit 2, Berlin
  Differential Revision:https://reviews.freebsd.org/D8809

Added:
  head/tools/build/options/WITH_REPRODUCIBLE_BUILD   (contents, props changed)
Modified:
  head/sys/conf/kern.opts.mk
  head/sys/conf/kern.post.mk

Modified: head/sys/conf/kern.opts.mk
==
--- head/sys/conf/kern.opts.mk  Thu Dec 15 20:13:40 2016(r310127)
+++ head/sys/conf/kern.opts.mk  Thu Dec 15 21:26:58 2016(r310128)
@@ -47,7 +47,8 @@ __DEFAULT_NO_OPTIONS = \
 EISA \
 EXTRA_TCP_STACKS \
 NAND \
-OFED
+OFED \
+REPRODUCIBLE_BUILD
 
 # Some options are totally broken on some architectures. We disable
 # them. If you need to enable them on an experimental basis, you

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Thu Dec 15 20:13:40 2016(r310127)
+++ head/sys/conf/kern.post.mk  Thu Dec 15 21:26:58 2016(r310128)
@@ -357,8 +357,11 @@ config.o env.o hints.o vers.o vnode_if.o
 config.ln env.ln hints.ln vers.ln vnode_if.ln:
${NORMAL_LINT}
 
+.if ${MK_REPRODUCIBLE_BUILD} != "no"
+REPRO_FLAG="-r"
+.endif
 vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP}
-   MAKE=${MAKE} sh $S/conf/newvers.sh ${KERN_IDENT}
+   MAKE=${MAKE} sh $S/conf/newvers.sh ${REPRO_FLAG} ${KERN_IDENT}
 
 vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src
${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -c

Added: head/tools/build/options/WITH_REPRODUCIBLE_BUILD
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITH_REPRODUCIBLE_BUILDThu Dec 15 21:26:58 
2016(r310128)
@@ -0,0 +1,3 @@
+$FreeBSD$
+Set to exclude build metadata (build time, user, host and path) from the
+kernel and uname output.
___
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: r310129 - stable/11/sys/kern

2016-12-15 Thread John Baldwin
Author: jhb
Date: Thu Dec 15 22:39:52 2016
New Revision: 310129
URL: https://svnweb.freebsd.org/changeset/base/310129

Log:
  MFC 308565: Allow scheduling during early boot.
  
  - Send IPI wakeups once SMP is started even if cold is true.
  - Permit preemptions when cold is true.
  
  These changes are needed for EARLY_AP_STARTUP.

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

Modified: stable/11/sys/kern/sched_4bsd.c
==
--- stable/11/sys/kern/sched_4bsd.c Thu Dec 15 21:26:58 2016
(r310128)
+++ stable/11/sys/kern/sched_4bsd.c Thu Dec 15 22:39:52 2016
(r310129)
@@ -326,7 +326,6 @@ maybe_preempt(struct thread *td)
 *  - The current thread has a higher (numerically lower) or
 *equivalent priority.  Note that this prevents curthread from
 *trying to preempt to itself.
-*  - It is too early in the boot for context switches (cold is set).
 *  - The current thread has an inhibitor set or is in the process of
 *exiting.  In this case, the current thread is about to switch
 *out anyways, so there's no point in preempting.  If we did,
@@ -347,7 +346,7 @@ maybe_preempt(struct thread *td)
("maybe_preempt: trying to run inhibited thread"));
pri = td->td_priority;
cpri = ctd->td_priority;
-   if (panicstr != NULL || pri >= cpri || cold /* || dumping */ ||
+   if (panicstr != NULL || pri >= cpri /* || dumping */ ||
TD_IS_INHIBITED(ctd))
return (0);
 #ifndef FULL_PREEMPTION
@@ -1105,7 +1104,7 @@ forward_wakeup(int cpunum)
if ((!forward_wakeup_enabled) ||
 (forward_wakeup_use_mask == 0 && forward_wakeup_use_loop == 0))
return (0);
-   if (!smp_started || cold || panicstr)
+   if (!smp_started || panicstr)
return (0);
 
forward_wakeups_requested++;
___
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: r310130 - head/sys/mips/conf

2016-12-15 Thread Adrian Chadd
Author: adrian
Date: Fri Dec 16 00:04:32 2016
New Revision: 310130
URL: https://svnweb.freebsd.org/changeset/base/310130

Log:
  [ar933x] don't waste memory/flash; drop the UMTX_CHAINS count down to 16.

Modified:
  head/sys/mips/conf/std.AR933X

Modified: head/sys/mips/conf/std.AR933X
==
--- head/sys/mips/conf/std.AR933X   Thu Dec 15 22:39:52 2016
(r310129)
+++ head/sys/mips/conf/std.AR933X   Fri Dec 16 00:04:32 2016
(r310130)
@@ -27,6 +27,8 @@ options   KDB
 optionsALQ
 options ALT_BREAK_TO_DEBUGGER
 
+optionsUMTX_CHAINS=16
+
 optionsSCHED_4BSD  #4BSD scheduler
 optionsINET#InterNETworking
 #options   INET6   #InterNETworking
___
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: r310131 - head/contrib/binutils/bfd

2016-12-15 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Dec 16 00:23:59 2016
New Revision: 310131
URL: https://svnweb.freebsd.org/changeset/base/310131

Log:
  libbfd: drop unnecessary variable increment.
  
  Do not increment `s' before it is initialized. At the time
  of the increment, `s' is otherwise unused anyway.
  
  Obtained from:OpenBSD (CVS rev 1.11)

Modified:
  head/contrib/binutils/bfd/elf.c

Modified: head/contrib/binutils/bfd/elf.c
==
--- head/contrib/binutils/bfd/elf.c Fri Dec 16 00:04:32 2016
(r310130)
+++ head/contrib/binutils/bfd/elf.c Fri Dec 16 00:23:59 2016
(r310131)
@@ -8826,7 +8826,7 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd
   count = relplt->size / hdr->sh_entsize;
   size = count * sizeof (asymbol);
   p = relplt->relocation;
-  for (i = 0; i < count; i++, s++, p++)
+  for (i = 0; i < count; i++, p++)
 size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt");
 
   s = *ret = bfd_malloc (size);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r310132 - head/contrib/binutils/bfd

2016-12-15 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Dec 16 00:35:59 2016
New Revision: 310132
URL: https://svnweb.freebsd.org/changeset/base/310132

Log:
  libbfd: make sure variables are initialized before using them.
  
  Initialize l_sec_contents to make sure that free(l_sec_contents) is called
  on valid pointers.
  
  Obtained from:OpenBSD (partial CVS rev 1.18)
  MFC after:5 days

Modified:
  head/contrib/binutils/bfd/elflink.c

Modified: head/contrib/binutils/bfd/elflink.c
==
--- head/contrib/binutils/bfd/elflink.c Fri Dec 16 00:23:59 2016
(r310131)
+++ head/contrib/binutils/bfd/elflink.c Fri Dec 16 00:35:59 2016
(r310132)
@@ -11487,7 +11487,7 @@ _bfd_elf_section_already_linked (bfd *ab
   abfd, sec);
  else if (sec->size != 0)
{
- bfd_byte *sec_contents, *l_sec_contents;
+ bfd_byte *sec_contents, *l_sec_contents = NULL;
 
  if (!bfd_malloc_and_get_section (abfd, sec, &sec_contents))
(*_bfd_error_handler)
___
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: r310133 - in stable: 10/sys/mips/mips 11/sys/mips/mips

2016-12-15 Thread John Baldwin
Author: jhb
Date: Fri Dec 16 01:06:35 2016
New Revision: 310133
URL: https://svnweb.freebsd.org/changeset/base/310133

Log:
  MFC 308690: Sync instruction cache's after writing user breakpoints on MIPS.
  
  Add an implementation for pmaps_sync_icache() on MIPS that sync's the
  instruction cache on all CPUs via smp_rendezvous() after a debugger
  inserts a breakpoint via ptrace(PT_IO).

Modified:
  stable/11/sys/mips/mips/pmap.c
Directory Properties:
  stable/11/   (props changed)

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

Modified: stable/11/sys/mips/mips/pmap.c
==
--- stable/11/sys/mips/mips/pmap.c  Fri Dec 16 00:35:59 2016
(r310132)
+++ stable/11/sys/mips/mips/pmap.c  Fri Dec 16 01:06:35 2016
(r310133)
@@ -74,11 +74,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef SMP
 #include 
-#else
-#include 
-#endif
 #include 
 #include 
 
@@ -3284,9 +3280,19 @@ pmap_activate(struct thread *td)
critical_exit();
 }
 
+static void
+pmap_sync_icache_one(void *arg __unused)
+{
+
+   mips_icache_sync_all();
+   mips_dcache_wbinv_all();
+}
+
 void
 pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
 {
+
+   smp_rendezvous(NULL, pmap_sync_icache_one, NULL, 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: r310133 - in stable: 10/sys/mips/mips 11/sys/mips/mips

2016-12-15 Thread John Baldwin
Author: jhb
Date: Fri Dec 16 01:06:35 2016
New Revision: 310133
URL: https://svnweb.freebsd.org/changeset/base/310133

Log:
  MFC 308690: Sync instruction cache's after writing user breakpoints on MIPS.
  
  Add an implementation for pmaps_sync_icache() on MIPS that sync's the
  instruction cache on all CPUs via smp_rendezvous() after a debugger
  inserts a breakpoint via ptrace(PT_IO).

Modified:
  stable/10/sys/mips/mips/pmap.c
Directory Properties:
  stable/10/   (props changed)

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

Modified: stable/10/sys/mips/mips/pmap.c
==
--- stable/10/sys/mips/mips/pmap.c  Fri Dec 16 00:35:59 2016
(r310132)
+++ stable/10/sys/mips/mips/pmap.c  Fri Dec 16 01:06:35 2016
(r310133)
@@ -74,11 +74,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef SMP
 #include 
-#else
-#include 
-#endif
 #include 
 #include 
 
@@ -3203,9 +3199,19 @@ pmap_activate(struct thread *td)
critical_exit();
 }
 
+static void
+pmap_sync_icache_one(void *arg __unused)
+{
+
+   mips_icache_sync_all();
+   mips_dcache_wbinv_all();
+}
+
 void
 pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
 {
+
+   smp_rendezvous(NULL, pmap_sync_icache_one, NULL, 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: r310134 - in stable: 10/include 11/include

2016-12-15 Thread John Baldwin
Author: jhb
Date: Fri Dec 16 01:14:00 2016
New Revision: 310134
URL: https://svnweb.freebsd.org/changeset/base/310134

Log:
  MFC 309274:
  Use the correct name for the GCC macro indicating max_align_t is defined.

Modified:
  stable/10/include/stddef.h
Directory Properties:
  stable/10/   (props changed)

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

Modified: stable/10/include/stddef.h
==
--- stable/10/include/stddef.h  Fri Dec 16 01:06:35 2016(r310133)
+++ stable/10/include/stddef.h  Fri Dec 16 01:14:00 2016(r310134)
@@ -63,7 +63,7 @@ typedef   ___wchar_t  wchar_t;
 #ifndef __CLANG_MAX_ALIGN_T_DEFINED
 typedef__max_align_t   max_align_t;
 #define __CLANG_MAX_ALIGN_T_DEFINED
-#define __GCC_MAX_ALIGN_T
+#define _GCC_MAX_ALIGN_T
 #endif
 #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: r310134 - in stable: 10/include 11/include

2016-12-15 Thread John Baldwin
Author: jhb
Date: Fri Dec 16 01:14:00 2016
New Revision: 310134
URL: https://svnweb.freebsd.org/changeset/base/310134

Log:
  MFC 309274:
  Use the correct name for the GCC macro indicating max_align_t is defined.

Modified:
  stable/11/include/stddef.h
Directory Properties:
  stable/11/   (props changed)

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

Modified: stable/11/include/stddef.h
==
--- stable/11/include/stddef.h  Fri Dec 16 01:06:35 2016(r310133)
+++ stable/11/include/stddef.h  Fri Dec 16 01:14:00 2016(r310134)
@@ -66,7 +66,7 @@ typedef   ___wchar_t  wchar_t;
 #ifndef __CLANG_MAX_ALIGN_T_DEFINED
 typedef__max_align_t   max_align_t;
 #define __CLANG_MAX_ALIGN_T_DEFINED
-#define __GCC_MAX_ALIGN_T
+#define _GCC_MAX_ALIGN_T
 #endif
 #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: r310135 - head/lib/libcapsicum

2016-12-15 Thread Conrad E. Meyer
Author: cem
Date: Fri Dec 16 01:37:44 2016
New Revision: 310135
URL: https://svnweb.freebsd.org/changeset/base/310135

Log:
  capsicum_helpers: Add LOOKUP flag
  
  Add a helper routine for opening a directory that is restricted to being
  used for opening relative files as stdio streams.
  
  I think this will really help basic adaptation of multi-file programs to
  Capsicum. Rather than having each program initialize a rights object and
  ioctl/fcntl arrays for their root fd for relative opens, consolidate in the
  logical place.
  
  Reviewed by:  oshogbo@
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8743

Modified:
  head/lib/libcapsicum/capsicum_helpers.h

Modified: head/lib/libcapsicum/capsicum_helpers.h
==
--- head/lib/libcapsicum/capsicum_helpers.h Fri Dec 16 01:14:00 2016
(r310134)
+++ head/lib/libcapsicum/capsicum_helpers.h Fri Dec 16 01:37:44 2016
(r310135)
@@ -41,6 +41,7 @@
 #defineCAPH_IGNORE_EBADF   0x0001
 #defineCAPH_READ   0x0002
 #defineCAPH_WRITE  0x0004
+#defineCAPH_LOOKUP 0x0008
 
 static __inline int
 caph_limit_stream(int fd, int flags)
@@ -54,6 +55,8 @@ caph_limit_stream(int fd, int flags)
cap_rights_set(&rights, CAP_READ);
if ((flags & CAPH_WRITE) != 0)
cap_rights_set(&rights, CAP_WRITE);
+   if ((flags & CAPH_LOOKUP) != 0)
+   cap_rights_set(&rights, CAP_LOOKUP);
 
if (cap_rights_limit(fd, &rights) < 0 && errno != ENOSYS) {
if (errno == EBADF && (flags & CAPH_IGNORE_EBADF) != 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: r310136 - head/contrib/elftoolchain/libelf

2016-12-15 Thread Conrad E. Meyer
Author: cem
Date: Fri Dec 16 01:39:06 2016
New Revision: 310136
URL: https://svnweb.freebsd.org/changeset/base/310136

Log:
  libelf: Fix extended numbering detection
  
  Extended numbering is used for any of these fields overflowing.
  
  Reviewed by:  emaste@
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8701

Modified:
  head/contrib/elftoolchain/libelf/libelf_ehdr.c

Modified: head/contrib/elftoolchain/libelf/libelf_ehdr.c
==
--- head/contrib/elftoolchain/libelf/libelf_ehdr.c  Fri Dec 16 01:37:44 
2016(r310135)
+++ head/contrib/elftoolchain/libelf/libelf_ehdr.c  Fri Dec 16 01:39:06 
2016(r310136)
@@ -170,10 +170,6 @@ _libelf_ehdr(Elf *e, int ec, int allocat
(*xlator)((unsigned char*) ehdr, msz, e->e_rawfile, (size_t) 1,
e->e_byteorder != LIBELF_PRIVATE(byteorder));
 
-   /*
-* If extended numbering is being used, read the correct
-* number of sections and program header entries.
-*/
if (ec == ELFCLASS32) {
phnum = ((Elf32_Ehdr *) ehdr)->e_phnum;
shnum = ((Elf32_Ehdr *) ehdr)->e_shnum;
@@ -193,12 +189,19 @@ _libelf_ehdr(Elf *e, int ec, int allocat
return (NULL);
}
 
-   if (shnum != 0 || shoff == 0LL) { /* not using extended numbering */
+   /*
+* If extended numbering is being used, read the correct
+* number of sections and program header entries.
+*/
+   if ((shnum == 0 && shoff != 0) || phnum == PN_XNUM || strndx == 
SHN_XINDEX) {
+   if (_libelf_load_extended(e, ec, shoff, phnum, strndx) == 0)
+   return (NULL);
+   } else {
+   /* not using extended numbering */
e->e_u.e_elf.e_nphdr = phnum;
e->e_u.e_elf.e_nscn = shnum;
e->e_u.e_elf.e_strndx = strndx;
-   } else if (_libelf_load_extended(e, ec, shoff, phnum, strndx) == 0)
-   return (NULL);
+   }
 
return (ehdr);
 }
___
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: r310137 - head/contrib/elftoolchain/libelf

2016-12-15 Thread Conrad E. Meyer
Author: cem
Date: Fri Dec 16 01:42:51 2016
New Revision: 310137
URL: https://svnweb.freebsd.org/changeset/base/310137

Log:
  gelf_getphdr: Allow extended indices
  
  Needed for 'readelf -l' of extended phnum files.  (Parity with GNU
  binutils.)
  
  Reviewed by:  no one, unfortunately
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8703

Modified:
  head/contrib/elftoolchain/libelf/gelf_phdr.c

Modified: head/contrib/elftoolchain/libelf/gelf_phdr.c
==
--- head/contrib/elftoolchain/libelf/gelf_phdr.cFri Dec 16 01:39:06 
2016(r310136)
+++ head/contrib/elftoolchain/libelf/gelf_phdr.cFri Dec 16 01:42:51 
2016(r310137)
@@ -53,10 +53,17 @@ gelf_getphdr(Elf *e, int index, GElf_Phd
Elf64_Ehdr *eh64;
Elf32_Phdr *ep32;
Elf64_Phdr *ep64;
+   size_t phnum;
 
if (d == NULL || e == NULL ||
((ec = e->e_class) != ELFCLASS32 && ec != ELFCLASS64) ||
-   (e->e_kind != ELF_K_ELF) || index < 0) {
+   (e->e_kind != ELF_K_ELF) || index < 0 ||
+   elf_getphdrnum(e, &phnum) < 0) {
+   LIBELF_SET_ERROR(ARGUMENT, 0);
+   return (NULL);
+   }
+
+   if ((size_t)index >= phnum) {
LIBELF_SET_ERROR(ARGUMENT, 0);
return (NULL);
}
@@ -66,11 +73,6 @@ gelf_getphdr(Elf *e, int index, GElf_Phd
((ep32 = _libelf_getphdr(e, ELFCLASS32)) == NULL))
return (NULL);
 
-   if (index >= eh32->e_phnum) {
-   LIBELF_SET_ERROR(ARGUMENT, 0);
-   return (NULL);
-   }
-
ep32 += index;
 
d->p_type   = ep32->p_type;
@@ -87,11 +89,6 @@ gelf_getphdr(Elf *e, int index, GElf_Phd
(ep64 = _libelf_getphdr(e, ELFCLASS64)) == NULL)
return (NULL);
 
-   if (index >= eh64->e_phnum) {
-   LIBELF_SET_ERROR(ARGUMENT, 0);
-   return (NULL);
-   }
-
ep64 += index;
 
*d = *ep64;
@@ -125,13 +122,15 @@ gelf_newphdr(Elf *e, size_t count)
 int
 gelf_update_phdr(Elf *e, int ndx, GElf_Phdr *s)
 {
-   int ec, phnum;
+   int ec;
+   size_t phnum;
void *ehdr;
Elf32_Phdr *ph32;
Elf64_Phdr *ph64;
 
if (s == NULL || e == NULL || e->e_kind != ELF_K_ELF ||
-   ((ec = e->e_class) != ELFCLASS32 && ec != ELFCLASS64)) {
+   ((ec = e->e_class) != ELFCLASS32 && ec != ELFCLASS64) ||
+   elf_getphdrnum(e, &phnum) < 0) {
LIBELF_SET_ERROR(ARGUMENT, 0);
return (0);
}
@@ -144,12 +143,7 @@ gelf_update_phdr(Elf *e, int ndx, GElf_P
if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL)
return (0);
 
-   if (ec == ELFCLASS32)
-   phnum = ((Elf32_Ehdr *) ehdr)->e_phnum;
-   else
-   phnum = ((Elf64_Ehdr *) ehdr)->e_phnum;
-
-   if (ndx < 0 || ndx > phnum) {
+   if (ndx < 0 || (size_t)ndx > phnum) {
LIBELF_SET_ERROR(ARGUMENT, 0);
return (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: r310138 - head/lib/libc/stdio

2016-12-15 Thread Conrad E. Meyer
Author: cem
Date: Fri Dec 16 01:44:50 2016
New Revision: 310138
URL: https://svnweb.freebsd.org/changeset/base/310138

Log:
  vfprintf(3): Add support for kernel %b format
  
  This is a direct port of the kernel %b format.
  
  I'm unclear on if (more) non-portable printf extensions will be a
  problem. I think it's desirable to have userspace formats include all
  kernel formats, but there may be competing goals I'm not aware of.
  
  Reviewed by:  no one, unfortunately
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8426

Modified:
  head/lib/libc/stdio/vfprintf.c

Modified: head/lib/libc/stdio/vfprintf.c
==
--- head/lib/libc/stdio/vfprintf.c  Fri Dec 16 01:42:51 2016
(r310137)
+++ head/lib/libc/stdio/vfprintf.c  Fri Dec 16 01:44:50 2016
(r310138)
@@ -611,6 +611,37 @@ reswitch:  switch (ch) {
case 'z':
flags |= SIZET;
goto rflag;
+   case 'b':
+   {
+   const char *q;
+   int anybitset, bit;
+
+   ulval = (u_int)GETARG(int);
+   cp = GETARG(char *);
+
+   q = __ultoa(ulval, buf + BUF, *cp++, 0, xdigs_lower);
+   PRINT(q, buf + BUF - q);
+
+   if (ulval == 0)
+   break;
+
+   for (anybitset = 0; *cp;) {
+   bit = *cp++;
+   if (ulval & (1 << (bit - 1))) {
+   PRINT(anybitset ? "," : "<", 1);
+   q = cp;
+   for (; (bit = *cp) > ' '; ++cp)
+   continue;
+   PRINT(q, cp - q);
+   anybitset = 1;
+   } else
+   for (; *cp > ' '; ++cp)
+   continue;
+   }
+   if (anybitset)
+   PRINT(">", 1);
+   }
+   continue;
case 'C':
flags |= LONGINT;
/*FALLTHROUGH*/
___
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: r310139 - head/usr.bin/last

2016-12-15 Thread Conrad E. Meyer
Author: cem
Date: Fri Dec 16 01:47:08 2016
New Revision: 310139
URL: https://svnweb.freebsd.org/changeset/base/310139

Log:
  Capsicumify last(1)
  
  Reviewed by:  ed (earlier version), emaste (earlier version)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8001

Modified:
  head/usr.bin/last/last.c

Modified: head/usr.bin/last/last.c
==
--- head/usr.bin/last/last.cFri Dec 16 01:44:50 2016(r310138)
+++ head/usr.bin/last/last.cFri Dec 16 01:47:08 2016(r310139)
@@ -40,8 +40,11 @@ static const char sccsid[] = "@(#)last.c
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
+#include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -56,7 +59,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #defineNO  0   /* false/no */
 #defineYES 1   /* true/yes */
@@ -176,6 +178,19 @@ main(int argc, char *argv[])
usage();
}
 
+   if (caph_limit_stdio() < 0)
+   err(1, "can't limit stdio rights");
+
+   caph_cache_catpages();
+   caph_cache_tzdata();
+
+   /* Cache UTX database. */
+   if (setutxdb(UTXDB_LOG, file) != 0)
+   err(1, "%s", file != NULL ? file : "(default utx db)");
+
+   if (cap_enter() < 0 && errno != ENOSYS)
+   err(1, "cap_enter");
+
if (sflag && width == 8) usage();
 
if (argc) {
@@ -213,8 +228,6 @@ wtmp(void)
(void)time(&t);
 
/* Load the last entries from the file. */
-   if (setutxdb(UTXDB_LOG, file) != 0)
-   err(1, "%s", file);
while ((ut = getutxent()) != NULL) {
if (amount % 128 == 0) {
buf = realloc(buf, (amount + 128) * sizeof *ut);
___
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: r310140 - head/contrib/dma

2016-12-15 Thread Conrad E. Meyer
Author: cem
Date: Fri Dec 16 01:48:55 2016
New Revision: 310140
URL: https://svnweb.freebsd.org/changeset/base/310140

Log:
  dma-mbox-create: Restrict with Capsicum
  
  The restriction here is pretty late and pretty minimal. We need a lot
  of authority to open password databases, and don't do much after that
  point.
  
  Feedback from:lifanov at mail.lifanov.com (earlier version), emaste 
(earlier version)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D7988

Modified:
  head/contrib/dma/dma-mbox-create.c

Modified: head/contrib/dma/dma-mbox-create.c
==
--- head/contrib/dma/dma-mbox-create.c  Fri Dec 16 01:47:08 2016
(r310139)
+++ head/contrib/dma/dma-mbox-create.c  Fri Dec 16 01:48:55 2016
(r310140)
@@ -38,9 +38,18 @@
  * user-supplied information.  Keep the root window as small as possible.
  */
 
+#ifdef __FreeBSD__
+#defineUSE_CAPSICUM1
+#endif
+
 #include 
+#if USE_CAPSICUM
+#include 
+#endif
 #include 
 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -84,6 +93,9 @@ logfail(int exitcode, const char *fmt, .
 int
 main(int argc, char **argv)
 {
+#if USE_CAPSICUM
+   cap_rights_t rights;
+#endif
const char *user;
struct passwd *pw;
struct group *gr;
@@ -91,7 +103,10 @@ main(int argc, char **argv)
gid_t mail_gid;
int f, maildirfd;
 
-   openlog("dma-mbox-create", 0, LOG_MAIL);
+   /*
+* Open log fd now for capability sandbox.
+*/
+   openlog("dma-mbox-create", LOG_NDELAY, LOG_MAIL);
 
errno = 0;
gr = getgrnam(DMA_GROUP);
@@ -133,6 +148,28 @@ main(int argc, char **argv)
if (maildirfd < 0)
logfail(EX_NOINPUT, "cannot open maildir %s", _PATH_MAILDIR);
 
+   /*
+* Cache NLS data, for strerror, for err(3), before entering capability
+* mode.
+*/
+   caph_cache_catpages();
+
+   /*
+* Cache local time before entering Capsicum capability sandbox.
+*/
+   caph_cache_tzdata();
+
+#if USE_CAPSICUM
+   cap_rights_init(&rights, CAP_CREATE, CAP_FCHMOD, CAP_FCHOWN,
+   CAP_LOOKUP, CAP_READ);
+   if (cap_rights_limit(maildirfd, &rights) < 0 && errno != ENOSYS)
+   err(EX_OSERR, "can't limit maildirfd rights");
+
+   /* Enter Capsicum capability sandbox */
+   if (cap_enter() < 0 && errno != ENOSYS)
+   err(EX_OSERR, "cap_enter");
+#endif
+
user_uid = pw->pw_uid;
 
f = openat(maildirfd, user, O_RDONLY|O_CREAT|O_NOFOLLOW, 0600);
___
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: r310141 - head/usr.bin/ministat

2016-12-15 Thread Conrad E. Meyer
Author: cem
Date: Fri Dec 16 01:51:12 2016
New Revision: 310141
URL: https://svnweb.freebsd.org/changeset/base/310141

Log:
  ministat(1): Capsicumify
  
  Separate dataset opening from reading/parsing. The number of input
  files is already capped to a small number, so just open all input files
  before sandboxing.
  
  Feedback from:allanjude@ (earlier version), emaste@ (earlier version)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D7925

Modified:
  head/usr.bin/ministat/ministat.c

Modified: head/usr.bin/ministat/ministat.c
==
--- head/usr.bin/ministat/ministat.cFri Dec 16 01:48:55 2016
(r310140)
+++ head/usr.bin/ministat/ministat.cFri Dec 16 01:51:12 2016
(r310141)
@@ -11,16 +11,20 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
-#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 #include 
+#include 
 #include 
-#include 
-#include 
-#include 
 
 #define NSTUDENT 100
 #define NCONF 6
@@ -455,26 +459,14 @@ dbl_cmp(const void *a, const void *b)
 }
 
 static struct dataset *
-ReadSet(const char *n, int column, const char *delim)
+ReadSet(FILE *f, const char *n, int column, const char *delim)
 {
-   FILE *f;
char buf[BUFSIZ], *p, *t;
struct dataset *s;
double d;
int line;
int i;
 
-   if (n == NULL) {
-   f = stdin;
-   n = "";
-   } else if (!strcmp(n, "-")) {
-   f = stdin;
-   n = "";
-   } else {
-   f = fopen(n, "r");
-   }
-   if (f == NULL)
-   err(1, "Cannot open %s", n);
s = NewSet();
s->name = strdup(n);
line = 0;
@@ -499,7 +491,6 @@ ReadSet(const char *n, int column, const
if (*buf != '\0')
AddPoint(s, d);
}
-   fclose(f);
if (s->n < 3) {
fprintf(stderr,
"Dataset %s must contain at least 3 data points\n", n);
@@ -536,7 +527,9 @@ usage(char const *whine)
 int
 main(int argc, char **argv)
 {
-   struct dataset *ds[7];
+   const char *setfilenames[MAX_DS - 1];
+   struct dataset *ds[MAX_DS - 1];
+   FILE *setfiles[MAX_DS - 1];
int nds;
double a;
const char *delim = " \t";
@@ -609,14 +602,36 @@ main(int argc, char **argv)
argv += optind;
 
if (argc == 0) {
-   ds[0] = ReadSet("-", column, delim);
+   setfilenames[0] = "";
+   setfiles[0] = stdin;
nds = 1;
} else {
if (argc > (MAX_DS - 1))
usage("Too many datasets.");
nds = argc;
-   for (i = 0; i < nds; i++)
-   ds[i] = ReadSet(argv[i], column, delim);
+   for (i = 0; i < nds; i++) {
+   setfilenames[i] = argv[i];
+   setfiles[i] = fopen(argv[i], "r");
+   if (setfiles[i] == NULL)
+   err(2, "Cannot open %s", argv[i]);
+   }
+   }
+
+   if (caph_limit_stdio() < 0)
+   err(2, "capsicum");
+
+   for (i = 0; i < nds; i++)
+   if (caph_limit_stream(fileno(setfiles[i]), CAPH_READ) < 0)
+   err(2, "unable to limit rights for %s",
+   setfilenames[i]);
+
+   /* Enter Capsicum sandbox. */
+   if (cap_enter() < 0 && errno != ENOSYS)
+   err(2, "unable to enter capability mode");
+
+   for (i = 0; i < nds; i++) {
+   ds[i] = ReadSet(setfiles[i], setfilenames[i], column, delim);
+   fclose(setfiles[i]);
}
 
for (i = 0; i < nds; i++) 
___
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: r310142 - head/usr.bin/ktrdump

2016-12-15 Thread Conrad E. Meyer
Author: cem
Date: Fri Dec 16 01:59:28 2016
New Revision: 310142
URL: https://svnweb.freebsd.org/changeset/base/310142

Log:
  ktrdump(8): Capsicumify
  
  We restrict the (optional) input file and output files. It would be
  nice to restrict the KVM files, but that's up to libkvm.
  
  We wait until after kvm_nlist() is invoked to cap_enter() because
  kldsym() isn't supported in the Capsicum sandbox.
  
  Feedback from:emaste@ (earlier versions)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D7921

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

Modified: head/usr.bin/ktrdump/ktrdump.c
==
--- head/usr.bin/ktrdump/ktrdump.c  Fri Dec 16 01:51:12 2016
(r310141)
+++ head/usr.bin/ktrdump/ktrdump.c  Fri Dec 16 01:59:28 2016
(r310142)
@@ -29,11 +29,14 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 #include 
 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -70,6 +73,7 @@ static int hflag;
 
 static char corefile[PATH_MAX];
 static char execfile[PATH_MAX];
+static char outfile[PATH_MAX] = "stdout";
 
 static char desc[SBUFLEN];
 static char errbuf[_POSIX2_LINE_MAX];
@@ -87,6 +91,7 @@ main(int ac, char **av)
struct ktr_entry *buf;
uintmax_t tlast, tnow;
unsigned long bufptr;
+   cap_rights_t rights;
struct stat sb;
kvm_t *kd;
FILE *out;
@@ -122,6 +127,11 @@ main(int ac, char **av)
iflag = 1;
if ((in = open(optarg, O_RDONLY)) == -1)
err(1, "%s", optarg);
+   cap_rights_init(&rights, CAP_FSTAT, CAP_MMAP_R);
+   if (cap_rights_limit(in, &rights) < 0 &&
+   errno != ENOSYS)
+   err(1, "unable to limit rights for %s",
+   optarg);
break;
case 'M':
case 'm':
@@ -133,6 +143,7 @@ main(int ac, char **av)
case 'o':
if ((out = fopen(optarg, "w")) == NULL)
err(1, "%s", optarg);
+   strlcpy(outfile, optarg, sizeof(outfile));
break;
case 'q':
qflag++;
@@ -155,6 +166,10 @@ main(int ac, char **av)
if (ac != 0)
usage();
 
+   cap_rights_init(&rights, CAP_FSTAT, CAP_WRITE);
+   if (cap_rights_limit(fileno(out), &rights) < 0 && errno != ENOSYS)
+   err(1, "unable to limit rights for %s", outfile);
+
/*
 * Open our execfile and corefile, resolve needed symbols and read in
 * the trace buffer.
@@ -162,11 +177,28 @@ main(int ac, char **av)
if ((kd = kvm_openfiles(Nflag ? execfile : NULL,
Mflag ? corefile : NULL, NULL, O_RDONLY, errbuf)) == NULL)
errx(1, "%s", errbuf);
+
+   /*
+* Cache NLS data, for strerror, for err(3), before entering capability
+* mode.
+*/
+   caph_cache_catpages();
+
if (kvm_nlist(kd, nl) != 0 ||
kvm_read(kd, nl[0].n_value, &version, sizeof(version)) == -1)
errx(1, "%s", kvm_geterr(kd));
if (version != KTR_VERSION)
errx(1, "ktr version mismatch");
+
+   /*
+* Enter Capsicum sandbox.
+*
+* kvm_nlist() above uses kldsym(2) for native kernels, and that isn't
+* allowed in the sandbox.
+*/
+   if (cap_enter() < 0 && errno != ENOSYS)
+   err(1, "unable to enter capability mode");
+
if (iflag) {
if (fstat(in, &sb) == -1)
errx(1, "stat");
___
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: r310143 - head/usr.bin/hexdump

2016-12-15 Thread Conrad E. Meyer
Author: cem
Date: Fri Dec 16 02:03:40 2016
New Revision: 310143
URL: https://svnweb.freebsd.org/changeset/base/310143

Log:
  hexdump(1): First cut capsicumification
  
  For now, only enter the sandbox for the last file processed (including
  stdin for zero-argument mode).
  
  Sandboxing all inputs will require a little restructuring of the
  program.
  
  Feedback by:  emaste@ (earlier versions)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D7915

Modified:
  head/usr.bin/hexdump/display.c
  head/usr.bin/hexdump/hexdump.c

Modified: head/usr.bin/hexdump/display.c
==
--- head/usr.bin/hexdump/display.c  Fri Dec 16 01:59:28 2016
(r310142)
+++ head/usr.bin/hexdump/display.c  Fri Dec 16 02:03:40 2016
(r310143)
@@ -36,10 +36,13 @@ static char sccsid[] = "@(#)display.c   8.
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -355,6 +358,19 @@ next(char **argv)
return(0);
statok = 0;
}
+
+   if (caph_limit_stream(fileno(stdin), CAPH_READ) < 0)
+   err(1, "unable to restrict %s",
+   statok ? _argv[-1] : "stdin");
+
+   /*
+* We've opened our last input file; enter capsicum sandbox.
+*/
+   if (*_argv == NULL) {
+   if (cap_enter() < 0 && errno != ENOSYS)
+   err(1, "unable to enter capability mode");
+   }
+
if (skip)
doskip(statok ? *_argv : "stdin", statok);
if (*_argv)

Modified: head/usr.bin/hexdump/hexdump.c
==
--- head/usr.bin/hexdump/hexdump.c  Fri Dec 16 01:59:28 2016
(r310142)
+++ head/usr.bin/hexdump/hexdump.c  Fri Dec 16 02:03:40 2016
(r310143)
@@ -42,6 +42,9 @@ static char sccsid[] = "@(#)hexdump.c 8.
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -76,6 +79,14 @@ main(int argc, char *argv[])
for (tfs = fshead; tfs; tfs = tfs->nextfs)
rewrite(tfs);
 
+   /*
+* Cache NLS data, for strerror, for err(3), before entering capability
+* mode.
+*/
+   caph_cache_catpages();
+   if (caph_limit_stdio() < 0)
+   err(1, "capsicum");
+
(void)next(argv);
display();
exit(exitval);
___
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: r310144 - head/usr.bin/iconv

2016-12-15 Thread Conrad E. Meyer
Author: cem
Date: Fri Dec 16 02:06:34 2016
New Revision: 310144
URL: https://svnweb.freebsd.org/changeset/base/310144

Log:
  iconv(1): Capsicumify
  
  This takes the usual shortcut of only sandboxing the last input file.
  It's a first cut and this program will be easy to adapt to sandbox all
  files in the future.
  
  iconv(1) has been changed to only open the conversion descriptor once,
  since the input and output encodings are fixed over all inputs.
  Instead, the descriptor is simply reset after each use (documented in
  iconv(3) API).
  
  Reviewed by:  no one, unfortunately
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D7917

Modified:
  head/usr.bin/iconv/iconv.c

Modified: head/usr.bin/iconv/iconv.c
==
--- head/usr.bin/iconv/iconv.c  Fri Dec 16 02:03:40 2016(r310143)
+++ head/usr.bin/iconv/iconv.c  Fri Dec 16 02:06:34 2016(r310144)
@@ -28,7 +28,9 @@
  */
 
 #include 
+#include 
 
+#include 
 #include 
 #include 
 #include 
@@ -41,7 +43,7 @@
 #include 
 #include 
 
-static int do_conv(FILE *, const char *, const char *, bool, bool);
+static int do_conv(FILE *, iconv_t, bool, bool);
 static int do_list(unsigned int, const char * const *, void *);
 static voidusage(void) __dead2;
 
@@ -67,23 +69,16 @@ usage(void)
 #define INBUFSIZE 1024
 #define OUTBUFSIZE (INBUFSIZE * 2)
 static int
-do_conv(FILE *fp, const char *from, const char *to, bool silent,
-bool hide_invalid)
+do_conv(FILE *fp, iconv_t cd, bool silent, bool hide_invalid)
 {
-   iconv_t cd;
char inbuf[INBUFSIZE], outbuf[OUTBUFSIZE], *in, *out;
unsigned long long invalids;
size_t inbytes, outbytes, ret;
 
-   if ((cd = iconv_open(to, from)) == (iconv_t)-1)
-   err(EXIT_FAILURE, "iconv_open(%s, %s)", to, from);
-
-   if (hide_invalid) {
-   int arg = 1;
+   int arg = (int)hide_invalid;
+   if (iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, (void *)&arg) == -1)
+   err(EXIT_FAILURE, "iconvctl(DISCARD_ILSEQ, %d)", arg);
 
-   if (iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, (void *)&arg) == -1)
-   err(EXIT_FAILURE, NULL);
-   }
invalids = 0;
while ((inbytes = fread(inbuf, 1, INBUFSIZE, fp)) > 0) {
in = inbuf;
@@ -133,7 +128,6 @@ do_conv(FILE *fp, const char *from, cons
if (invalids > 0 && !silent)
warnx("warning: invalid characters: %llu", invalids);
 
-   iconv_close(cd);
return (invalids > 0);
 }
 
@@ -155,6 +149,7 @@ do_list(unsigned int n, const char * con
 int
 main(int argc, char **argv)
 {
+   iconv_t cd;
FILE *fp;
const char *opt_f, *opt_t;
int ch, i, res;
@@ -201,9 +196,28 @@ main(int argc, char **argv)
argv += optind;
if ((strcmp(opt_f, "") == 0) && (strcmp(opt_t, "") == 0))
usage();
-   if (argc == 0)
-   res = do_conv(stdin, opt_f, opt_t, opt_s, opt_c);
-   else {
+
+   if (caph_limit_stdio() < 0)
+   err(EXIT_FAILURE, "capsicum");
+
+   /*
+* Cache NLS data, for strerror, for err(3), before entering capability
+* mode.
+*/
+   caph_cache_catpages();
+
+   /*
+* Cache iconv conversion handle before entering sandbox.
+*/
+   cd = iconv_open(opt_t, opt_f);
+   if (cd == (iconv_t)-1)
+   err(EXIT_FAILURE, "iconv_open(%s, %s)", opt_t, opt_f);
+
+   if (argc == 0) {
+   if (cap_enter() < 0 && errno != ENOSYS)
+   err(EXIT_FAILURE, "unable to enter capability mode");
+   res = do_conv(stdin, cd, opt_s, opt_c);
+   } else {
res = 0;
for (i = 0; i < argc; i++) {
fp = (strcmp(argv[i], "-") != 0) ?
@@ -211,9 +225,17 @@ main(int argc, char **argv)
if (fp == NULL)
err(EXIT_FAILURE, "Cannot open `%s'",
argv[i]);
-   res |= do_conv(fp, opt_f, opt_t, opt_s, opt_c);
+   /* Enter Capsicum sandbox for final input file. */
+   if (i + 1 == argc && cap_enter() < 0 && errno != ENOSYS)
+   err(EXIT_FAILURE,
+   "unable to enter capability mode");
+   res |= do_conv(fp, cd, opt_s, opt_c);
(void)fclose(fp);
+
+   /* Reset iconv descriptor state. */
+   (void)iconv(cd, NULL, NULL, NULL, NULL);
}
}
+   iconv_close(cd);
return (res == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
T

svn commit: r310145 - head/usr.bin/ident

2016-12-15 Thread Conrad E. Meyer
Author: cem
Date: Fri Dec 16 02:09:48 2016
New Revision: 310145
URL: https://svnweb.freebsd.org/changeset/base/310145

Log:
  ident(1): Capsicumify
  
  Preopen input file list before entering Capsicum capability mode.
  
  Feedback by:  allanjude@, bapt@, emaste@ (earlier versions)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D7918

Modified:
  head/usr.bin/ident/ident.c

Modified: head/usr.bin/ident/ident.c
==
--- head/usr.bin/ident/ident.c  Fri Dec 16 02:06:34 2016(r310144)
+++ head/usr.bin/ident/ident.c  Fri Dec 16 02:09:48 2016(r310145)
@@ -28,11 +28,14 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
 #include 
 #include 
 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -202,8 +205,9 @@ int
 main(int argc, char **argv)
 {
bool quiet = false;
-   int ch, i;
+   int ch, i, *fds, fd;
int ret = EXIT_SUCCESS;
+   size_t nfds;
FILE *fp;
 
while ((ch = getopt(argc, argv, "qV")) != -1) {
@@ -223,17 +227,50 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
 
-   if (argc == 0)
-   return (scan(stdin, NULL, quiet));
+   if (caph_limit_stdio() < 0)
+   err(EXIT_FAILURE, "unable to limit stdio");
 
-   for (i = 0; i < argc; i++) {
-   fp = fopen(argv[i], "r");
+   if (argc == 0) {
+   nfds = 1;
+   fds = malloc(sizeof(*fds));
+   if (fds == NULL)
+   err(EXIT_FAILURE, "unable to allocate fds array");
+   fds[0] = STDIN_FILENO;
+   } else {
+   nfds = argc;
+   fds = malloc(sizeof(*fds) * nfds);
+   if (fds == NULL)
+   err(EXIT_FAILURE, "unable to allocate fds array");
+
+   for (i = 0; i < argc; i++) {
+   fds[i] = fd = open(argv[i], O_RDONLY);
+   if (fd < 0) {
+   warn("%s", argv[i]);
+   ret = EXIT_FAILURE;
+   continue;
+   }
+   if (caph_limit_stream(fd, CAPH_READ) < 0)
+   err(EXIT_FAILURE,
+   "unable to limit fcntls/rights for %s",
+   argv[i]);
+   }
+   }
+
+   /* Enter Capsicum sandbox. */
+   if (cap_enter() < 0 && errno != ENOSYS)
+   err(EXIT_FAILURE, "unable to enter capability mode");
+
+   for (i = 0; i < (int)nfds; i++) {
+   if (fds[i] < 0)
+   continue;
+
+   fp = fdopen(fds[i], "r");
if (fp == NULL) {
warn("%s", argv[i]);
ret = EXIT_FAILURE;
continue;
}
-   if (scan(fp, argv[i], quiet) != EXIT_SUCCESS)
+   if (scan(fp, argc == 0 ? NULL : argv[i], quiet) != EXIT_SUCCESS)
ret = EXIT_FAILURE;
fclose(fp);
}
___
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: r310146 - head/sys/powerpc/powerpc

2016-12-15 Thread Justin Hibbits
Author: jhibbits
Date: Fri Dec 16 04:38:53 2016
New Revision: 310146
URL: https://svnweb.freebsd.org/changeset/base/310146

Log:
  Use the right bitwise OR operation for clearing single-step at trap time.
  
  DBCR0_IDM || DBCRO_IC yields 1, which in this register is DBCR0_FT, not what 
we
  want.
  Reported by:  Mark Millard
  MFC after:2 weeks

Modified:
  head/sys/powerpc/powerpc/trap.c

Modified: head/sys/powerpc/powerpc/trap.c
==
--- head/sys/powerpc/powerpc/trap.c Fri Dec 16 02:09:48 2016
(r310145)
+++ head/sys/powerpc/powerpc/trap.c Fri Dec 16 04:38:53 2016
(r310146)
@@ -280,7 +280,7 @@ trap(struct trapframe *frame)
case EXC_DEBUG: /* Single stepping */
mtspr(SPR_DBSR, mfspr(SPR_DBSR));
frame->srr1 &= ~PSL_DE;
-   frame->cpu.booke.dbcr0 &= ~(DBCR0_IDM || DBCR0_IC);
+   frame->cpu.booke.dbcr0 &= ~(DBCR0_IDM | DBCR0_IC);
sig = SIGTRAP;
ucode = TRAP_TRACE;
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: r310147 - in head/sys: net net80211

2016-12-15 Thread Adrian Chadd
Author: adrian
Date: Fri Dec 16 04:43:31 2016
New Revision: 310147
URL: https://svnweb.freebsd.org/changeset/base/310147

Log:
  [net80211] start laying down the foundation for 11ac support.
  
  This is a work in progress and some of this stuff may change;
  but hopefully I'm laying down enough stuff and space in fields
  to allow it to grow without another major recompile.
  
  We'll see!
  
  * Add a net80211 PHY type for VHT 2G and VHT 5G.
  
Note - yes, VHT is supposed to be for 5GHZ, however some vendors
(*cough* most of them) support some subset of VHT rate support
in 2GHz.  No - not 80MHz wide channels, but at least some MCS8-9
support, maybe some beamforming, and maybe some longer A-MPDU
aggregates.  I don't want to even think about MU-MIMO on 2GHz.
  
  * Add an ifmedia placeholder type for VHT rates.
  
  * Add channel flags for VHT, VHT20/40U/40D/80/80+80/160
  * Add channel macros for the above
  * Add ieee80211_channel fields for the VHT information and flags,
along with some padding (so this struct definitely grows.)
  * Add a phy type flag for VHT - 'v'
  
  * Bump the number of channels to a much higher amount - until we get
something like the linux mac80211 chanctx abstraction (where the
stack provides a current channel configuration via callbacks,
versus the driver ever checking ic->ic_curchan or similar) we'll
have to populate VHT+HT combinations.
  
  Eg, there'll likely be a full set of duplicate VHT20/40 channels to match
  HT channels.  There will also be a full set of duplicate VHT80 channels -
  note that for VHT80, its assumed you're doing VHT40 as a base, so we
  don't need a duplicate of VHT80 + 20MHz only primary channels, only
  a duplicate of all the VHT40 combinations.
  
  I don't want to think about VHT80+80 or VHT160 for now - and I won't,
  as the current device I'm doing 11ac bringup on (QCA9880) only does
  VHT80.
  
  I'll likely revisit the channel configuration and scanning related
  stuff after I get VHT20/40 up.
  
  * Add vht flags and the basic MCS rate setup to ieee80211com, ieee80211vap
and ieee80211_node in preparation for 11ac configuration.
There is zero code that uses this right now.
  * Whilst here, add some more placeholders in case I need to extend
out things by some uint32_t flag sized fields.  Hopefully I won't!
  
  What I haven't yet done:
  
  * any of the code that uses this
  * any of the beamforming related fields
  * any of the MU-MIMO fields required for STA/AP operation
  * any of the IE fields in beacon frame / probe request/response handling
and the calculations required for shifting beacon contents around
when the TIM grows/shrinks
  
  This will require a full rebuild of net80211 related programs -
  ifconfig, hostapd, wpa_supplicant.

Modified:
  head/sys/net/if_media.h
  head/sys/net80211/_ieee80211.h
  head/sys/net80211/ieee80211_node.h
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/net/if_media.h
==
--- head/sys/net/if_media.h Fri Dec 16 04:38:53 2016(r310146)
+++ head/sys/net/if_media.h Fri Dec 16 04:43:31 2016(r310147)
@@ -264,6 +264,7 @@ uint64_tifmedia_baudrate(int);
 #defineIFM_IEEE80211_OFDM2723  /* OFDM 27Mbps */
 /* NB: not enough bits to express MCS fully */
 #defineIFM_IEEE80211_MCS   24  /* HT MCS rate */
+#defineIFM_IEEE80211_VHT   25  /* HT MCS rate */
 
 #defineIFM_IEEE80211_ADHOC 0x0100  /* Operate in Adhoc 
mode */
 #defineIFM_IEEE80211_HOSTAP0x0200  /* Operate in Host AP 
mode */
@@ -280,6 +281,8 @@ uint64_tifmedia_baudrate(int);
 #defineIFM_IEEE80211_FH0x0004  /* 2Ghz, GFSK mode */
 #defineIFM_IEEE80211_11NA  0x0005  /* 5Ghz, HT mode */
 #defineIFM_IEEE80211_11NG  0x0006  /* 2Ghz, HT mode */
+#defineIFM_IEEE80211_VHT5G 0x0007  /* 5Ghz, VHT mode */
+#defineIFM_IEEE80211_VHT2G 0x0008  /* 2Ghz, VHT mode */
 
 /*
  * ATM

Modified: head/sys/net80211/_ieee80211.h
==
--- head/sys/net80211/_ieee80211.h  Fri Dec 16 04:38:53 2016
(r310146)
+++ head/sys/net80211/_ieee80211.h  Fri Dec 16 04:43:31 2016
(r310147)
@@ -45,6 +45,7 @@ enum ieee80211_phytype {
IEEE80211_T_HT, /* high throughput */
IEEE80211_T_OFDM_HALF,  /* 1/2 rate OFDM */
IEEE80211_T_OFDM_QUARTER,   /* 1/4 rate OFDM */
+   IEEE80211_T_VHT,/* VHT PHY */
 };
 #defineIEEE80211_T_CCK IEEE80211_T_DS  /* more common nomenclature */
 
@@ -68,8 +69,10 @@ enum ieee80211_phymode {
IEEE80211_MODE_11NG = 9,/* 2GHz, w/ HT */
IEEE80211_MODE_HALF = 10,   /* OFDM, 1/2x clock */
IEEE80211_MODE_QUARTER  = 11,

svn commit: r310149 - head/sys/sys

2016-12-15 Thread Adrian Chadd
Author: adrian
Date: Fri Dec 16 04:44:46 2016
New Revision: 310149
URL: https://svnweb.freebsd.org/changeset/base/310149

Log:
  Bump FreeBSD_version .

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hFri Dec 16 04:44:14 2016(r310148)
+++ head/sys/sys/param.hFri Dec 16 04:44:46 2016(r310149)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200018  /* Master, propagated to newvers */
+#define __FreeBSD_version 1200019  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
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: r310148 - head/sys/net80211

2016-12-15 Thread Adrian Chadd
Author: adrian
Date: Fri Dec 16 04:44:14 2016
New Revision: 310148
URL: https://svnweb.freebsd.org/changeset/base/310148

Log:
  [net80211] sigh, course I would miss a commit from the 11ac prep commit.

Modified:
  head/sys/net80211/ieee80211.c

Modified: head/sys/net80211/ieee80211.c
==
--- head/sys/net80211/ieee80211.c   Fri Dec 16 04:43:31 2016
(r310147)
+++ head/sys/net80211/ieee80211.c   Fri Dec 16 04:44:14 2016
(r310148)
@@ -2020,6 +2020,10 @@ ieee80211_rate2media(struct ieee80211com
case IEEE80211_MODE_11NG:
case IEEE80211_MODE_TURBO_G:
return findmedia(rates, nitems(rates), rate | 
IFM_IEEE80211_11G);
+   case IEEE80211_MODE_VHT_2GHZ:
+   case IEEE80211_MODE_VHT_5GHZ:
+   /* XXX TODO: need to figure out mapping for VHT rates */
+   return IFM_AUTO;
}
return IFM_AUTO;
 }
@@ -2053,6 +2057,7 @@ ieee80211_media2rate(int mword)
9,  /* IFM_IEEE80211_OFDM4 */
54, /* IFM_IEEE80211_OFDM27 */
-1, /* IFM_IEEE80211_MCS */
+   -1, /* IFM_IEEE80211_VHT */
};
return IFM_SUBTYPE(mword) < nitems(ieeerates) ?
ieeerates[IFM_SUBTYPE(mword)] : 0;
@@ -2103,6 +2108,8 @@ ieee80211_channel_type_char(const struct
return 'T';
if (IEEE80211_IS_CHAN_108G(c))
return 'G';
+   if (IEEE80211_IS_CHAN_VHT(c))
+   return 'v';
if (IEEE80211_IS_CHAN_HT(c))
return 'n';
if (IEEE80211_IS_CHAN_A(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: r310150 - head/sys/powerpc/powerpc

2016-12-15 Thread Justin Hibbits
Author: jhibbits
Date: Fri Dec 16 04:47:29 2016
New Revision: 310150
URL: https://svnweb.freebsd.org/changeset/base/310150

Log:
  Fix disassembly by adding back some deleted lines.
  
  When importing for r309309, as part of conflict resolution, too much extra was
  removed, resulting in bad disassembly for branches.  Correct this.
  
  Also re-apply the 0->NULL change from r298052.
  
  X-MFC-With:   r309309

Modified:
  head/sys/powerpc/powerpc/db_disasm.c

Modified: head/sys/powerpc/powerpc/db_disasm.c
==
--- head/sys/powerpc/powerpc/db_disasm.cFri Dec 16 04:44:46 2016
(r310149)
+++ head/sys/powerpc/powerpc/db_disasm.cFri Dec 16 04:47:29 2016
(r310150)
@@ -871,8 +871,11 @@ disasm_fields(const struct opcode *popco
func &= ~Op_crbB;
}
if (func & Op_LI) {
-   u_int LI;
+   int LI;
LI = extract_field(instr, 31 - 29, 24);
+   LI = LI << 8;
+   LI = LI >> 6;
+   LI += loc;
APP_PSTR("0x%x", LI);
func &= ~Op_LI;
}
@@ -897,8 +900,11 @@ disasm_fields(const struct opcode *popco
;
}
if (func & Op_BD) {
-   u_int BD;
+   int BD;
BD = extract_field(instr, 31 - 29, 14);
+   BD = BD << 18;
+   BD = BD >> 16;
+   BD += loc;
/* Need to sign extend and shift up 2, then add addr */
APP_PSTR("0x%x", BD);
func &= ~Op_BD;
@@ -968,9 +974,9 @@ disasm_fields(const struct opcode *popco
reg = "tbu";
break;
default:
-   reg = 0;
+   reg = NULL;
}
-   if (reg == 0)
+   if (reg == NULL)
APP_PSTR(", [unknown tbr %d ]", tbr);
else
APP_PSTR(", %s", reg);
___
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: r310151 - head/sys/dev/cxgbe/firmware

2016-12-15 Thread Navdeep Parhar
Author: np
Date: Fri Dec 16 06:25:51 2016
New Revision: 310151
URL: https://svnweb.freebsd.org/changeset/base/310151

Log:
  cxgbe(4): Changes to the default T6 firmware configuration file.
  
  - Disable features that are not supported or not used on FreeBSD.
  - Increase the RSS table slice per interface.
  - Increase the share of the TCAM reserved for filtering.
  
  MFH:  2 weeks
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/firmware/t6fw_cfg.txt

Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg.txt
==
--- head/sys/dev/cxgbe/firmware/t6fw_cfg.txtFri Dec 16 04:47:29 2016
(r310150)
+++ head/sys/dev/cxgbe/firmware/t6fw_cfg.txtFri Dec 16 06:25:51 2016
(r310151)
@@ -1,63 +1,12 @@
-# Chelsio T6 Factory Default configuration file.
+# Firmware configuration file.
 #
-# Copyright (C) 2014-2016 Chelsio Communications.  All rights reserved.
-#
-#   DO NOT MODIFY THIS FILE UNDER ANY CIRCUMSTANCES.  MODIFICATION OF THIS FILE
-#   WILL RESULT IN A NON-FUNCTIONAL ADAPTER AND MAY RESULT IN PHYSICAL DAMAGE
-#   TO ADAPTERS.
-
-
-# This file provides the default, power-on configuration for 2-port T6-based
-# adapters shipped from the factory.  These defaults are designed to address
-# the needs of the vast majority of Terminator customers.  The basic idea is to
-# have a default configuration which allows a customer to plug a Terminator
-# adapter in and have it work regardless of OS, driver or application except in
-# the most unusual and/or demanding customer applications.
-#
-# Many of the Terminator resources which are described by this configuration
-# are finite.  This requires balancing the configuration/operation needs of
-# device drivers across OSes and a large number of customer application.
-#
-# Some of the more important resources to allocate and their constaints are:
-#  1. Virtual Interfaces: 256.
-#  2. Ingress Queues with Free Lists: 1024.
-#  3. Egress Queues: 128K.
-#  4. MSI-X Vectors: 1088.
-#  5. Multi-Port Support (MPS) TCAM: 336 entries to support MAC destination
-# address matching on Ingress Packets.
-#
-# Some of the important OS/Driver resource needs are:
-#  6. Some OS Drivers will manage all resources through a single Physical
-# Function (currently PF4 but it could be any Physical Function).
-#  7. Some OS Drivers will manage different ports and functions (NIC,
-# storage, etc.) on different Physical Functions.  For example, NIC
-# functions for ports 0-1 on PF0-1, FCoE on PF4, iSCSI on PF5, etc.
-#
-# Some of the customer application needs which need to be accommodated:
-#  8. Some customers will want to support large CPU count systems with
-# good scaling.  Thus, we'll need to accommodate a number of
-# Ingress Queues and MSI-X Vectors to allow up to some number of CPUs
-# to be involved per port and per application function.  For example,
-# in the case where all ports and application functions will be
-# managed via a single Unified PF and we want to accommodate scaling up
-# to 8 CPUs, we would want:
-#
-# 2 ports *
-# 3 application functions (NIC, FCoE, iSCSI) per port *
-# 16 Ingress Queue/MSI-X Vectors per application function
-#
-# for a total of 96 Ingress Queues and MSI-X Vectors on the Unified PF.
-# (Plus a few for Firmware Event Queues, etc.)
-#
-#  9. Some customers will want to use PCI-E SR-IOV Capability to allow Virtual
-# Machines to directly access T6 functionality via SR-IOV Virtual Functions
-# and "PCI Device Passthrough" -- this is especially true for the NIC
-# application functionality.
-#
-
+# Global limits (some are hardware limits, others are due to the firmware).
+# nvi = 128virtual interfaces
+# niqflint = 1023  ingress queues with freelists and/or interrupts
+# nethctrl = 64K   Ethernet or ctrl egress queues
+# neq = 64Kegress queues of all kinds, including freelists
+# nexactf = 512MPS TCAM entries, can oversubscribe.
 
-# Global configuration settings.
-#
 [global]
rss_glb_config_mode = basicvirtual
rss_glb_config_options = tnlmapen,hashtoeplitz,tnlalllkp
@@ -65,75 +14,29 @@
# PL_TIMEOUT register
pl_timeout_value = 200  # the timeout value in units of us
 
-   # The following Scatter Gather Engine (SGE) settings assume a 4KB Host
-   # Page Size and a 64B L1 Cache Line Size. It programs the
-   # EgrStatusPageSize and IngPadBoundary to 64B and the PktShift to 2.
-   # If a Master PF Driver finds itself on a machine with different
-   # parameters, then the Master PF Driver is responsible for initializing
-   # these parameters to appropriate values.
-   #
-   # Notes:
-   #  1. The Free List Buffer Sizes below are raw and the firmware will
-   # round them up to the Ingress Padding Boundary.
-   #  2. The SGE T

svn commit: r310152 - head/sys/dev/cxgbe/common

2016-12-15 Thread Navdeep Parhar
Author: np
Date: Fri Dec 16 06:30:07 2016
New Revision: 310152
URL: https://svnweb.freebsd.org/changeset/base/310152

Log:
  cxgbe(4): Fix typo in an unused macro.
  
  MFC after:3 days
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/common/t4_msg.h

Modified: head/sys/dev/cxgbe/common/t4_msg.h
==
--- head/sys/dev/cxgbe/common/t4_msg.h  Fri Dec 16 06:25:51 2016
(r310151)
+++ head/sys/dev/cxgbe/common/t4_msg.h  Fri Dec 16 06:30:07 2016
(r310152)
@@ -2026,7 +2026,7 @@ struct cpl_rx_pkt {
  * RX_ERROR_IP_HDR_LEN, RX_ERROR_ETH_HDR_LEN
  */
 #define S_T6_COMPR_RXERR_LEN1
-#define V_T6_COMPR_RXERR_LEN(x) ((x) << S_COMPR_T6_RXERR_LEN)
+#define V_T6_COMPR_RXERR_LEN(x) ((x) << S_T6_COMPR_RXERR_LEN)
 #define F_T6_COMPR_RXERR_LENV_COMPR_T6_RXERR_LEN(1U)
 
 #define S_T6_COMPR_RXERR_TCP_OPT2
___
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"