Re: svn commit: r343566 - in head/lib/libthr: . thread

2019-02-04 Thread Michal Meloun


On 04.02.2019 8:00, Konstantin Belousov wrote:
> On Mon, Feb 04, 2019 at 07:31:19AM +0100, Michal Meloun wrote:
>> On 29.01.2019 23:46, Konstantin Belousov wrote:
>>> Author: kib
>>> Date: Tue Jan 29 22:46:44 2019
>>> New Revision: 343566
>>> URL: https://svnweb.freebsd.org/changeset/base/343566
>>>
>>> Log:
>>>   Untangle jemalloc and mutexes initialization.
>>>   
>>>   The need to use libc malloc(3) from some places in libthr always
>>>   caused issues.  For instance, per-thread key allocation was switched to
>>>   use plain mmap(2) to get storage, because some third party mallocs
>>>   used keys for implementation of calloc(3).
>>>   
>>>   Even more important, libthr calls calloc(3) during initialization of
>>>   pthread mutexes, and jemalloc uses pthread mutexes.  Jemalloc provides
>>>   some way to both postpone the initialization, and to make
>>>   initialization to use specialized allocator, but this is very fragile
>>>   and often breaks.  See the referenced PR for another example.
>>>   
>>>   Add the small malloc implementation used by rtld, to libthr. Use it in
>>>   thr_spec.c and for mutexes initialization. This avoids the issues with
>>>   mutual dependencies between malloc and libthr in principle.  The
>>>   drawback is that some more allocations are not interceptable for
>>>   alternate malloc implementations.  There should be not too much memory
>>>   use from this allocator, and the alternative, direct use of mmap(2) is
>>>   obviously worse.
>>>   
>>>   PR:   235211
>>>   MFC after:2 weeks
>>>   Sponsored by: The FreeBSD Foundation
>>>   Differential revision:https://reviews.freebsd.org/D18988
>>>
>> This broke ARM  static binaries (at least rescue/rescue). From first
>> look it seems that __pthread_mutex_init() invoked by atomic_init() is
>> called before curthread is set (before _thread_init_hack()).
>>
>>
>> root@tegra124:/usr/src # gdb --args
>> /usr/obj/usr/src/arm.armv7/rescue/rescue/rescue sh
>> ...
>> Reading symbols from /usr/obj/usr/src/arm.armv7/rescue/rescue/rescue...done.
>> (gdb) b _thread_init_hack
>> Breakpoint 1 at 0x67cad0: file /usr/src/lib/libthr/thread/thr_init.c,
>> line 296.
>> (gdb) r
>> Starting program: /usr/obj/usr/src/arm.armv7/rescue/rescue/rescue sh
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> __thr_calloc (num=1, size=) at
>> /usr/src/lib/libthr/thread/thr_malloc.c:82
>> 82  thr_malloc_lock(curthread);
>> (gdb) bt
>> #0  __thr_calloc (num=1, size=) at
>> /usr/src/lib/libthr/thread/thr_malloc.c:82
>> #1  0x00676e1c in mutex_init (mutex=,
>> mutex_attr=, calloc_cb=)
>> at /usr/src/lib/libthr/thread/thr_mutex.c:294
>> #2  __pthread_mutex_init (mutex=0xc6e948 ,
>> mutex_attr=) at /usr/src/lib/libthr/thread/thr_mutex.c:393
>> #3  0x001d41f0 in handle_static_init (argc=2, argv=,
>> env=) at /usr/src/lib/csu/common/ignore_init.c:124
>> #4  0x001d40e8 in __start (argc=2, argv=, env=> out>, ps_strings=, obj=0x0, cleanup=0x0)
>> at /usr/src/lib/csu/arm/crt1.c:112
>> #5  0x001d4000 in ?? ()
>> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
>> (gdb) f 3
>> #3  0x001d41f0 in handle_static_init (argc=2, argv=,
>> env=) at /usr/src/lib/csu/common/ignore_init.c:124
>> 124 fn(argc, argv, env);
>> (gdb) list
>> 119 _init();
>> 120 array_size = __init_array_end - __init_array_start;
>> 121 for (n = 0; n < array_size; n++) {
>> 122 fn = __init_array_start[n];
>> 123 if ((uintptr_t)fn != 0 && (uintptr_t)fn != 1)
>> 124 fn(argc, argv, env);
>> 125 }
>> 126 }
>> (gdb) p n
>> $1 = 20
>> (gdb) p fn
>> $6 = (void (*)(int, char **, char **)) 0x63f21c 
>> (gdb) p (void *)&__init_array_start
>> $19 = (void *) 0xa7ab60
>> (gdb) p (void *)&__init_array_end
>> $20 = (void *) 0xa7abc0
>> (gdb) x/24a &__init_array_start
>> 0xa7ab60:   0x1d4270 
>> 0x2d926c <_$$hide$$ ifconfig.lo ifconfig_ctor>
>> 0x2d98e0 <_$$hide$$ ifconfig.lo link_ctor>
>> 0x2d9cb4 <_$$hide$$ ifconfig.lo inet_ctor>
>> 0xa7ab70:   0x2da2e0 <_$$hide$$ ifconfig.lo inet6_ctor>
>> 0x2db790 <_$$hide$$ ifconfig.lo clone_ctor>
>> 0x2dbb8c <_$$hide$$ ifconfig.lo mac_ctor>
>> 0x2dbe70 <_$$hide$$ ifconfig.lo ifmedia_ctor>
>> 0xa7ab80:   0x2dced0 <_$$hide$$ ifconfig.lo fib_ctor>
>> 0x2dd118 <_$$hide$$ ifconfig.lo vlan_ctor>
>> 0x2dd668 <_$$hide$$ ifconfig.lo vxlan_ctor>
>> 0x2df45c <_$$hide$$ ifconfig.lo gre_ctor>
>> 0xa7ab90:   0x2df6d8 <_$$hide$$ ifconfig.lo gif_ctor>
>> 0x2df874 <_$$hide$$ ifconfig.lo ipsec_ctor>
>> 0x2e2144 <_$$hide$$ ifconfig.lo ieee80211_ctor>
>> 0x2f0a10 <_$$hide$$ ifconfig.lo carp_ctor>
>> 0xa7aba0:   0x2f0e6c <_$$hide$$ ifconfig.lo group_ctor>
>> 0x2f

svn commit: r343742 - head/lib/libsysdecode

2019-02-04 Thread Michael Tuexen
Author: tuexen
Date: Mon Feb  4 13:30:47 2019
New Revision: 343742
URL: https://svnweb.freebsd.org/changeset/base/343742

Log:
  Add missing SCTP_EOR entry.
  
  MFC after:3 days

Modified:
  head/lib/libsysdecode/flags.c

Modified: head/lib/libsysdecode/flags.c
==
--- head/lib/libsysdecode/flags.c   Mon Feb  4 10:25:29 2019
(r343741)
+++ head/lib/libsysdecode/flags.c   Mon Feb  4 13:30:47 2019
(r343742)
@@ -1208,7 +1208,7 @@ sysdecode_sctp_pr_policy(int policy)
 
 static struct name_table sctpsndflags[] = {
X(SCTP_EOF) X(SCTP_ABORT) X(SCTP_UNORDERED) X(SCTP_ADDR_OVER)
-   X(SCTP_SENDALL) X(SCTP_SACK_IMMEDIATELY) XEND
+   X(SCTP_SENDALL) X(SCTP_EOR) X(SCTP_SACK_IMMEDIATELY) XEND
 };
 
 bool
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343744 - head/sys/powerpc/aim

2019-02-04 Thread Leandro Lupori
Author: luporl
Date: Mon Feb  4 16:02:03 2019
New Revision: 343744
URL: https://svnweb.freebsd.org/changeset/base/343744

Log:
  powerpc64: Add a trap stack area
  
  Currently, the trap code switches to the the temporary stack in the dbtrap
  section. It works in most cases, but in the beginning of the execution, the
  temp stack is being used, as starting in the powerpc_init() code.
  
  In this current scenario, the stack is being overwritten, which causes the
  return of breakpoint() to take abnormal execution.
  
  This current patchset create a small stack to use by the dbtrap: codepath
  avoiding the corruption of the temporary stack.
  
  PR:   224872
  Submitted by: breno.leitao_gmail.com
  Reviewed by:  jhibbits
  Differential Revision:https://reviews.freebsd.org/D14484

Modified:
  head/sys/powerpc/aim/locore32.S
  head/sys/powerpc/aim/locore64.S
  head/sys/powerpc/aim/trap_subr32.S
  head/sys/powerpc/aim/trap_subr64.S

Modified: head/sys/powerpc/aim/locore32.S
==
--- head/sys/powerpc/aim/locore32.S Mon Feb  4 14:10:31 2019
(r343743)
+++ head/sys/powerpc/aim/locore32.S Mon Feb  4 16:02:03 2019
(r343744)
@@ -60,6 +60,12 @@ GLOBAL(__endkernel)
 GLOBAL(tmpstk)
.space  TMPSTKSZ
 
+#ifdef KDB
+#define TRAPSTKSZ   4096/* 4k trap stack */
+GLOBAL(trapstk)
+.spaceTRAPSTKSZ
+#endif
+
.text
.globl  btext
 btext:

Modified: head/sys/powerpc/aim/locore64.S
==
--- head/sys/powerpc/aim/locore64.S Mon Feb  4 14:10:31 2019
(r343743)
+++ head/sys/powerpc/aim/locore64.S Mon Feb  4 16:02:03 2019
(r343744)
@@ -65,6 +65,14 @@ GLOBAL(tmpstk)
 TOC_ENTRY(tmpstk)
 TOC_ENTRY(can_wakeup)
 
+#ifdef KDB
+#define TRAPSTKSZ   4096/* 4k trap stack */
+GLOBAL(trapstk)
+.spaceTRAPSTKSZ
+TOC_ENTRY(trapstk)
+#endif
+
+
 /*
  * Entry point for bootloaders that do not fully implement ELF and start
  * at the beginning of the image (kexec, notably). In its own section so

Modified: head/sys/powerpc/aim/trap_subr32.S
==
--- head/sys/powerpc/aim/trap_subr32.S  Mon Feb  4 14:10:31 2019
(r343743)
+++ head/sys/powerpc/aim/trap_subr32.S  Mon Feb  4 16:02:03 2019
(r343744)
@@ -864,8 +864,8 @@ dbtrap:
mtsprg3 %r1
 
lwz %r1,TRAP_TOCBASE(0) /* get new SP */
-   lwz %r1,tmpstk@got(%r1)
-   addi%r1,%r1,TMPSTKSZ-16
+   lwz %r1,trapstk@got(%r1)
+   addi%r1,%r1,TRAPSTKSZ-16
 
FRAME_SETUP(PC_DBSAVE)
 /* Call C trap code: */

Modified: head/sys/powerpc/aim/trap_subr64.S
==
--- head/sys/powerpc/aim/trap_subr64.S  Mon Feb  4 14:10:31 2019
(r343743)
+++ head/sys/powerpc/aim/trap_subr64.S  Mon Feb  4 16:02:03 2019
(r343744)
@@ -897,8 +897,8 @@ dbtrap:
mtsprg3 %r1
 
GET_TOCBASE(%r1)/* get new SP */
-   ld  %r1,TOC_REF(tmpstk)(%r1)
-   addi%r1,%r1,(TMPSTKSZ-48)
+   ld  %r1,TOC_REF(trapstk)(%r1)
+   addi%r1,%r1,(TRAPSTKSZ-48)
 
FRAME_SETUP(PC_DBSAVE)
 /* Call C trap code: */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2019-02-04 Thread Alexander Motin
Author: mav
Date: Mon Feb  4 16:13:41 2019
New Revision: 343745
URL: https://svnweb.freebsd.org/changeset/base/343745

Log:
  Add missed tunables/sysctls for some new vdev variables.
  
  While there, make few existing sysctls writeable, since there is no reason
  not to.
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Mon Feb  4 
16:02:03 2019(r343744)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Mon Feb  4 
16:13:41 2019(r343745)
@@ -165,29 +165,38 @@ static vdev_ops_t *vdev_ops_table[] = {
 
 /* target number of metaslabs per top-level vdev */
 int vdev_max_ms_count = 200;
-SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_count, CTLFLAG_RDTUN,
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_count, CTLFLAG_RWTUN,
 &vdev_max_ms_count, 0,
-"Maximum number of metaslabs per top-level vdev");
+"Target number of metaslabs per top-level vdev");
 
 /* minimum number of metaslabs per top-level vdev */
 int vdev_min_ms_count = 16;
-SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, min_ms_count, CTLFLAG_RDTUN,
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, min_ms_count, CTLFLAG_RWTUN,
 &vdev_min_ms_count, 0,
 "Minimum number of metaslabs per top-level vdev");
 
 /* practical upper limit of total metaslabs per top-level vdev */
 int vdev_ms_count_limit = 1ULL << 17;
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_count_limit, CTLFLAG_RWTUN,
+&vdev_ms_count_limit, 0,
+"Maximum number of metaslabs per top-level vdev");
 
 /* lower limit for metaslab size (512M) */
 int vdev_default_ms_shift = 29;
-SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, default_ms_shift, CTLFLAG_RDTUN,
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, default_ms_shift, CTLFLAG_RWTUN,
 &vdev_default_ms_shift, 0,
-"Shift between vdev size and number of metaslabs");
+"Default shift between vdev size and number of metaslabs");
 
 /* upper limit for metaslab size (256G) */
 int vdev_max_ms_shift = 38;
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_shift, CTLFLAG_RWTUN,
+&vdev_max_ms_shift, 0,
+"Maximal shift between vdev size and number of metaslabs");
 
 boolean_t vdev_validate_skip = B_FALSE;
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, validate_skip, CTLFLAG_RWTUN,
+&vdev_validate_skip, 0,
+"Bypass vdev validation");
 
 /*
  * Since the DTL space map of a vdev is not expected to have a lot of
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2019-02-04 Thread Steven Hartland




On 04/02/2019 16:13, Alexander Motin wrote:

Author: mav
Date: Mon Feb  4 16:13:41 2019
New Revision: 343745
URL: https://svnweb.freebsd.org/changeset/base/343745

Log:
   Add missed tunables/sysctls for some new vdev variables.
   
   While there, make few existing sysctls writeable, since there is no reason

   not to.
   
   MFC after:	1 week


Modified:
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Mon Feb  4 
16:02:03 2019(r343744)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Mon Feb  4 
16:13:41 2019(r343745)
@@ -165,29 +165,38 @@ static vdev_ops_t *vdev_ops_table[] = {
  
  /* target number of metaslabs per top-level vdev */

  int vdev_max_ms_count = 200;
-SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_count, CTLFLAG_RDTUN,
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_count, CTLFLAG_RWTUN,
  &vdev_max_ms_count, 0,
-"Maximum number of metaslabs per top-level vdev");
+"Target number of metaslabs per top-level vdev");
  
  /* minimum number of metaslabs per top-level vdev */

  int vdev_min_ms_count = 16;
-SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, min_ms_count, CTLFLAG_RDTUN,
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, min_ms_count, CTLFLAG_RWTUN,
  &vdev_min_ms_count, 0,
  "Minimum number of metaslabs per top-level vdev");
  
  /* practical upper limit of total metaslabs per top-level vdev */

  int vdev_ms_count_limit = 1ULL << 17;
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_count_limit, CTLFLAG_RWTUN,
+&vdev_ms_count_limit, 0,
+"Maximum number of metaslabs per top-level vdev");
  
  /* lower limit for metaslab size (512M) */

  int vdev_default_ms_shift = 29;
-SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, default_ms_shift, CTLFLAG_RDTUN,
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, default_ms_shift, CTLFLAG_RWTUN,
  &vdev_default_ms_shift, 0,
-"Shift between vdev size and number of metaslabs");
+"Default shift between vdev size and number of metaslabs");
  
  /* upper limit for metaslab size (256G) */

  int vdev_max_ms_shift = 38;
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_shift, CTLFLAG_RWTUN,
+&vdev_max_ms_shift, 0,
+"Maximal shift between vdev size and number of metaslabs");
It's a just a nit but I believe this should Maximum, like the others, 
instead of Maximal.
  
  boolean_t vdev_validate_skip = B_FALSE;

+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, validate_skip, CTLFLAG_RWTUN,
+&vdev_validate_skip, 0,
+"Bypass vdev validation");
  
  /*

   * Since the DTL space map of a vdev is not expected to have a lot of



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


svn commit: r343746 - head/sys/conf

2019-02-04 Thread Andrew Turner
Author: andrew
Date: Mon Feb  4 16:55:24 2019
New Revision: 343746
URL: https://svnweb.freebsd.org/changeset/base/343746

Log:
  Only enable trace-cmp on Clang and modern GCC.
  
  It's was only added to GCC 8.1 so don't try to enable it for earlier
  releases.
  
  Reported by:  lwhsu
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/conf/files
  head/sys/conf/kern.pre.mk

Modified: head/sys/conf/files
==
--- head/sys/conf/files Mon Feb  4 16:13:41 2019(r343745)
+++ head/sys/conf/files Mon Feb  4 16:55:24 2019(r343746)
@@ -3808,7 +3808,7 @@ kern/kern_idle.c  standard
 kern/kern_intr.c   standard
 kern/kern_jail.c   standard
 kern/kern_kcov.c   optional kcov   \
-   compile-with"${NORMAL_C} 
-fno-sanitize-coverage=trace-pc,trace-cmp"
+   compile-with"${NORMAL_C} -fno-sanitize=all"
 kern/kern_khelp.c  standard
 kern/kern_kthread.cstandard
 kern/kern_ktr.coptional ktr

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Mon Feb  4 16:13:41 2019(r343745)
+++ head/sys/conf/kern.pre.mk   Mon Feb  4 16:55:24 2019(r343746)
@@ -120,7 +120,12 @@ SAN_CFLAGS+=   -fsanitize=undefined
 
 COVERAGE_ENABLED!= grep COVERAGE opt_global.h || true ; echo
 .if !empty(COVERAGE_ENABLED)
+.if ${COMPILER_TYPE} == "clang" || \
+(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80100)
 SAN_CFLAGS+=   -fsanitize-coverage=trace-pc,trace-cmp
+.else
+SAN_CFLAGS+=   -fsanitize-coverage=trace-pc
+.endif
 .endif
 
 CFLAGS+=   ${SAN_CFLAGS}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r343713 - in head/sys: amd64/conf arm64/conf

2019-02-04 Thread Andrew Turner
This should be fixed in r343746.

Andrew

> On 4 Feb 2019, at 05:28, Li-Wen Hsu  wrote:
> 
> On Sun, Feb 3, 2019 at 8:46 PM Andrew Turner  wrote:
>> 
>> Author: andrew
>> Date: Sun Feb  3 12:46:27 2019
>> New Revision: 343713
>> URL: https://svnweb.freebsd.org/changeset/base/343713
>> 
>> Log:
>>  Enable COVERAGE and KCOV by default on arm64 and amd64.
>> 
>>  This allows userspace to trace the kernel using the coverage sanitizer
>>  found in clang. It will also allow other coverage tools to be built as
>>  modules and attach into the same framework.
>> 
>>  Sponsored by: DARPA, AFRL
>> 
>> Modified:
>>  head/sys/amd64/conf/GENERIC
>>  head/sys/arm64/conf/GENERIC
>> 
>> Modified: head/sys/amd64/conf/GENERIC
>> ==
>> --- head/sys/amd64/conf/GENERIC Sun Feb  3 11:41:43 2019(r343712)
>> +++ head/sys/amd64/conf/GENERIC Sun Feb  3 12:46:27 2019(r343713)
>> @@ -102,8 +102,8 @@ options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9)
>> optionsVERBOSE_SYSINIT=0   # Support debug.verbose_sysinit, off 
>> by default
>> 
>> # Kernel Sanitizers
>> -#options   COVERAGE# Generic kernel coverage. Used by 
>> KCOV
>> -#options   KCOV# Kernel Coverage Sanitizer
>> +optionsCOVERAGE# Generic kernel coverage. Used by 
>> KCOV
>> +optionsKCOV# Kernel Coverage Sanitizer
>> # Warning: KUBSAN can result in a kernel too large for loader to load
>> #options   KUBSAN  # Kernel Undefined Behavior Sanitizer
>> 
>> 
>> Modified: head/sys/arm64/conf/GENERIC
>> ==
>> --- head/sys/arm64/conf/GENERIC Sun Feb  3 11:41:43 2019(r343712)
>> +++ head/sys/arm64/conf/GENERIC Sun Feb  3 12:46:27 2019(r343713)
>> @@ -94,8 +94,8 @@ options   USB_DEBUG   # enable debug msgs
>> optionsVERBOSE_SYSINIT=0   # Support debug.verbose_sysinit, off 
>> by default
>> 
>> # Kernel Sanitizers
>> -#options   COVERAGE# Generic kernel coverage. Used by 
>> KCOV
>> -#options   KCOV# Kernel Coverage Sanitizer
>> +optionsCOVERAGE# Generic kernel coverage. Used by 
>> KCOV
>> +optionsKCOV# Kernel Coverage Sanitizer
>> # Warning: KUBSAN can result in a kernel too large for loader to load
>> #options   KUBSAN  # Kernel Undefined Behavior Sanitizer
> 
> This breaks gcc build:
> https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/8781/console :
> 
> x86_64-unknown-freebsd12.0-gcc: error: unrecognized command line
> option '-fsanitize-coverage=trace-pc,trace-cmp'; did you mean
> '-fsanitize-coverage=trace-pc'?
> 
> We probably need to adjust arguments passed to gcc.
> 
> Li-Wen
> 

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


svn commit: r343748 - head/sys/i386/i386

2019-02-04 Thread Dimitry Andric
Author: dim
Date: Mon Feb  4 18:07:03 2019
New Revision: 343748
URL: https://svnweb.freebsd.org/changeset/base/343748

Log:
  Use NLDT to get number of LDTs on i386
  
  Compiling a GENERIC kernel for i386 with clang 8.0 results in the
  following warning:
  
  /usr/src/sys/i386/i386/sys_machdep.c:542:40: error: 'sizeof ((ldt))' will 
return the size of the pointer, not the array itself 
[-Werror,-Wsizeof-pointer-div]
  nldt = pldt != NULL ? pldt->ldt_len : nitems(ldt);
^~~
  /usr/src/sys/sys/param.h:299:32: note: expanded from macro 'nitems'
  #define nitems(x)   (sizeof((x)) / sizeof((x)[0]))
   ~~~ ^
  
  Indeed, 'ldt' is declared as 'union descriptor *', so nitems() is not
  the right way to determine the number of LDTs.  Instead, the NLDT define
  from sys/x86/include/segments.h should be used.
  
  Reviewed by:  kib
  MFC after:3 days
  Differential Revision: https://reviews.freebsd.org/D19074

Modified:
  head/sys/i386/i386/sys_machdep.c

Modified: head/sys/i386/i386/sys_machdep.c
==
--- head/sys/i386/i386/sys_machdep.cMon Feb  4 17:53:29 2019
(r343747)
+++ head/sys/i386/i386/sys_machdep.cMon Feb  4 18:07:03 2019
(r343748)
@@ -539,7 +539,7 @@ i386_get_ldt(struct thread *td, struct i386_ldt_args *
data = malloc(num * sizeof(union descriptor), M_TEMP, M_WAITOK);
mtx_lock_spin(&dt_lock);
pldt = td->td_proc->p_md.md_ldt;
-   nldt = pldt != NULL ? pldt->ldt_len : nitems(ldt);
+   nldt = pldt != NULL ? pldt->ldt_len : NLDT;
if (uap->start >= nldt) {
num = 0;
} else {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343749 - head/release/arm64

2019-02-04 Thread Emmanuel Vadot
Author: manu
Date: Mon Feb  4 18:29:23 2019
New Revision: 343749
URL: https://svnweb.freebsd.org/changeset/base/343749

Log:
  release: arm64: rpi3: Install the RPI3B+ DTB file
  
  We should use the correct DTB file otherwise the firmware uses
  the RPI3B one.
  
  MFC after:1 week

Modified:
  head/release/arm64/RPI3.conf

Modified: head/release/arm64/RPI3.conf
==
--- head/release/arm64/RPI3.confMon Feb  4 18:07:03 2019
(r343748)
+++ head/release/arm64/RPI3.confMon Feb  4 18:29:23 2019
(r343749)
@@ -4,7 +4,7 @@
 #
 
 DTB_DIR="/usr/local/share/rpi-firmware"
-DTB="bcm2710-rpi-3-b.dtb"
+DTB="bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb"
 EMBEDDED_TARGET_ARCH="aarch64"
 EMBEDDED_TARGET="arm64"
 EMBEDDEDBUILD=1
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343750 - head/release/arm64

2019-02-04 Thread Emmanuel Vadot
Author: manu
Date: Mon Feb  4 18:30:47 2019
New Revision: 343750
URL: https://svnweb.freebsd.org/changeset/base/343750

Log:
  release: arm64: pine64-lts: Use the newly created u-boot-pine64-lts port
  
  In U-Boot 2019.01 there is now a config for this board, use it for the
  release image.
  
  MFC after:1 week

Modified:
  head/release/arm64/PINE64-LTS.conf

Modified: head/release/arm64/PINE64-LTS.conf
==
--- head/release/arm64/PINE64-LTS.conf  Mon Feb  4 18:29:23 2019
(r343749)
+++ head/release/arm64/PINE64-LTS.conf  Mon Feb  4 18:30:47 2019
(r343750)
@@ -6,7 +6,7 @@
 EMBEDDED_TARGET_ARCH="aarch64"
 EMBEDDED_TARGET="arm64"
 EMBEDDEDBUILD=1
-EMBEDDEDPORTS="sysutils/u-boot-sopine"
+EMBEDDEDPORTS="sysutils/u-boot-pine64-lts"
 FAT_SIZE="54m -b 1m"
 FAT_TYPE="16"
 IMAGE_SIZE="2560M"
@@ -18,7 +18,7 @@ FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64
 export BOARDNAME="PINE64-LTS"
 
 arm_install_uboot() {
-   UBOOT_DIR="/usr/local/share/u-boot/u-boot-sopine"
+   UBOOT_DIR="/usr/local/share/u-boot/u-boot-pine64-lts"
UBOOT_FILES="u-boot-sunxi-with-spl.bin"
chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \
of=/dev/${mddev} bs=1k seek=8 conv=sync
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343751 - head/lib/libc/tests/sys

2019-02-04 Thread Enji Cooper
Author: ngie
Date: Mon Feb  4 19:12:45 2019
New Revision: 343751
URL: https://svnweb.freebsd.org/changeset/base/343751

Log:
  Avoid the DNS lookup for "localhost"
  
  ci.FreeBSD.org does not have access to a DNS resolver/network (unlike my test
  VM), so in order for the test to pass on the host, it needs to avoid the DNS
  lookup by using the numeric host address representation.
  
  PR:   235200
  Reviewed by:  asomers, lwhsu
  Approved by:  emaste (mentor)
  MFC after:2 weeks
  MFC with: r343362, r343365, r343367-r343368, r343461
  Differential Revision: https://reviews.freebsd.org/D19026

Modified:
  head/lib/libc/tests/sys/sendfile_test.c

Modified: head/lib/libc/tests/sys/sendfile_test.c
==
--- head/lib/libc/tests/sys/sendfile_test.c Mon Feb  4 18:30:47 2019
(r343750)
+++ head/lib/libc/tests/sys/sendfile_test.c Mon Feb  4 19:12:45 2019
(r343751)
@@ -97,22 +97,31 @@ generate_random_port(int seed)
 static void
 resolve_localhost(struct addrinfo **res, int domain, int type, int port)
 {
+   const char *host;
char *serv;
struct addrinfo hints;
int error;
 
-   ATF_REQUIRE_MSG(domain == AF_INET || domain == AF_INET6,
-   "unhandled domain: %d", domain);
+   switch (domain) {
+   case AF_INET:
+   host = "127.0.0.1";
+   break;
+   case AF_INET6:
+   host = "::1";
+   break;
+   default:
+   atf_tc_fail("unhandled domain: %d", domain);
+   }
 
ATF_REQUIRE_MSG(asprintf(&serv, "%d", port) >= 0,
"asprintf failed: %s", strerror(errno));
 
memset(&hints, 0, sizeof(hints));
hints.ai_family = domain;
-   hints.ai_flags = AI_ADDRCONFIG|AI_NUMERICSERV;
+   hints.ai_flags = AI_ADDRCONFIG|AI_NUMERICSERV|AI_NUMERICHOST;
hints.ai_socktype = type;
 
-   error = getaddrinfo("localhost", serv, &hints, res);
+   error = getaddrinfo(host, serv, &hints, res);
ATF_REQUIRE_EQ_MSG(error, 0,
"getaddrinfo failed: %s", gai_strerror(error));
free(serv);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r343751 - head/lib/libc/tests/sys

2019-02-04 Thread Rodney W. Grimes
> Author: ngie
> Date: Mon Feb  4 19:12:45 2019
> New Revision: 343751
> URL: https://svnweb.freebsd.org/changeset/base/343751
> 
> Log:
>   Avoid the DNS lookup for "localhost"
>   
>   ci.FreeBSD.org does not have access to a DNS resolver/network (unlike my 
> test
>   VM), so in order for the test to pass on the host, it needs to avoid the DNS
>   lookup by using the numeric host address representation.

If it can not get to a resolver, it should be falling back to
/etc/hosts whch does have the correct entries for localhost.


>   
>   PR: 235200
>   Reviewed by:asomers, lwhsu
>   Approved by:emaste (mentor)
>   MFC after:  2 weeks
>   MFC with:   r343362, r343365, r343367-r343368, r343461
>   Differential Revision: https://reviews.freebsd.org/D19026
> 
> Modified:
>   head/lib/libc/tests/sys/sendfile_test.c
> 
> Modified: head/lib/libc/tests/sys/sendfile_test.c
> ==
> --- head/lib/libc/tests/sys/sendfile_test.c   Mon Feb  4 18:30:47 2019
> (r343750)
> +++ head/lib/libc/tests/sys/sendfile_test.c   Mon Feb  4 19:12:45 2019
> (r343751)
> @@ -97,22 +97,31 @@ generate_random_port(int seed)
>  static void
>  resolve_localhost(struct addrinfo **res, int domain, int type, int port)
>  {
> + const char *host;
>   char *serv;
>   struct addrinfo hints;
>   int error;
>  
> - ATF_REQUIRE_MSG(domain == AF_INET || domain == AF_INET6,
> - "unhandled domain: %d", domain);
> + switch (domain) {
> + case AF_INET:
> + host = "127.0.0.1";
> + break;
> + case AF_INET6:
> + host = "::1";
> + break;
> + default:
> + atf_tc_fail("unhandled domain: %d", domain);
> + }
>  
>   ATF_REQUIRE_MSG(asprintf(&serv, "%d", port) >= 0,
>   "asprintf failed: %s", strerror(errno));
>  
>   memset(&hints, 0, sizeof(hints));
>   hints.ai_family = domain;
> - hints.ai_flags = AI_ADDRCONFIG|AI_NUMERICSERV;
> + hints.ai_flags = AI_ADDRCONFIG|AI_NUMERICSERV|AI_NUMERICHOST;
>   hints.ai_socktype = type;
>  
> - error = getaddrinfo("localhost", serv, &hints, res);
> + error = getaddrinfo(host, serv, &hints, res);
>   ATF_REQUIRE_EQ_MSG(error, 0,
>   "getaddrinfo failed: %s", gai_strerror(error));
>   free(serv);

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


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

2019-02-04 Thread Alexander Motin
Author: mav
Date: Mon Feb  4 20:09:22 2019
New Revision: 343752
URL: https://svnweb.freebsd.org/changeset/base/343752

Log:
  s/Maximal/Maximum/ in sysctl description.
  
  Submitted by: smh
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Mon Feb  4 
19:12:45 2019(r343751)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Mon Feb  4 
20:09:22 2019(r343752)
@@ -191,7 +191,7 @@ SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, default_ms_shift, 
 int vdev_max_ms_shift = 38;
 SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_shift, CTLFLAG_RWTUN,
 &vdev_max_ms_shift, 0,
-"Maximal shift between vdev size and number of metaslabs");
+"Maximum shift between vdev size and number of metaslabs");
 
 boolean_t vdev_validate_skip = B_FALSE;
 SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, validate_skip, CTLFLAG_RWTUN,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r343751 - head/lib/libc/tests/sys

2019-02-04 Thread Enji Cooper


> On Feb 4, 2019, at 12:09 PM, Rodney W. Grimes 
>  wrote:
> 
>> Author: ngie
>> Date: Mon Feb  4 19:12:45 2019
>> New Revision: 343751
>> URL: https://svnweb.freebsd.org/changeset/base/343751
>> 
>> Log:
>>  Avoid the DNS lookup for "localhost"
>> 
>>  ci.FreeBSD.org does not have access to a DNS resolver/network (unlike my 
>> test
>>  VM), so in order for the test to pass on the host, it needs to avoid the DNS
>>  lookup by using the numeric host address representation.
> 
> If it can not get to a resolver, it should be falling back to
> /etc/hosts whch does have the correct entries for localhost.

Please continue this thread of discussion on Phabricator.

This was already discussed sort of there. As I said before (when it was 
commented on by @emaste):

>> In D19026#407184, @emaste wrote:
>> I don't object to this patch but shouldn't we be able to prevent any DNS use 
>> via nsswitch.conf?
>> That would require everyone make a corresponding change to prevent any DNS 
>> use when running this test.

> It's better to focus on what needs to be tested, instead of what's nice to 
> test by side-effect. There are other tests that exercise DNS lookups (which 
> currently fail after a long timeout due to a lacking external connection).

> This is a quick hack to set this test on a working path. The right path is 
> the suggestion @asomers provided in the previous review, to use if_tap.

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


svn commit: r343753 - head/sys/net

2019-02-04 Thread Marius Strobl
Author: marius
Date: Mon Feb  4 20:46:57 2019
New Revision: 343753
URL: https://svnweb.freebsd.org/changeset/base/343753

Log:
  o As illustrated by e. g. figure 7-14 of the Intel 82599 10 GbE
controller datasheet revision 3.3, in the context of Ethernet
MACs the control data describing the packet buffers typically
are named "descriptors". Each of these descriptors references
one buffer, multiple of which a packet can be composed of.
By contrast, in comments, messages and the names of structure
members, iflib(4) refers to DMA resources employed for RX and
TX buffers (rather than control data) as "desc(riptors)".
This odd naming convention of iflib(4) made reviewing r343085
and identifying wrong and missing bus_dmamap_sync(9) calls in
particular way harder than it already is. This convention may
also explain why the netmap(4) part of iflib(4) pairs the DMA
tags for control data with DMA maps of buffers and vice versa
in calls to bus_dma(9) functions.
Therefore, change iflib(4) to refer to buf(fers) when buffers
and not the usual understanding of descriptors is meant. This
change does not include corrections to the DMA resources used
in the netmap(4) parts. However, it revises error messages to
state which kind of allocation/creation failed. Specifically,
the "Unable to allocate tx_buffer (map) memory" copy & pasted
inappropriately on several occasions was replaced with proper
messages.
  o Enhance some other error messages to indicate which half - RX
or TX - they apply to instead of using identical text in both
cases and generally canonicalize them.
  o Correct the descriptions of iflib_{r,t}xsd_alloc() to reflect
reality; current code doesn't use {r,t}x_buffer structures.
  o In iflib_queues_alloc():
- Remove redundant BUS_DMA_NOWAIT of iflib_dma_alloc() calls,
- change the M_WAITOK from malloc(9) calls into M_NOWAIT. The
  return values are already checked, deferred DMA allocations
  not being an option at this point, BUS_DMA_NOWAIT has to be
  used anyway and prior malloc(9) calls in this function also
  specify M_NOWAIT.
  
  Reviewed by:  shurd
  Differential Revision:https://reviews.freebsd.org/D19067

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cMon Feb  4 20:09:22 2019(r343752)
+++ head/sys/net/iflib.cMon Feb  4 20:46:57 2019(r343753)
@@ -353,8 +353,8 @@ struct iflib_txq {
uint8_t ift_closed;
uint8_t ift_update_freq;
struct iflib_filter_info ift_filter_info;
-   bus_dma_tag_t   ift_desc_tag;
-   bus_dma_tag_t   ift_tso_desc_tag;
+   bus_dma_tag_t   ift_buf_tag;
+   bus_dma_tag_t   ift_tso_buf_tag;
iflib_dma_info_tift_ifdi;
 #define MTX_NAME_LEN 16
charift_mtx_name[MTX_NAME_LEN];
@@ -389,7 +389,7 @@ struct iflib_fl {
iflib_rxsd_array_t  ifl_sds;
iflib_rxq_t ifl_rxq;
uint8_t ifl_id;
-   bus_dma_tag_t   ifl_desc_tag;
+   bus_dma_tag_t   ifl_buf_tag;
iflib_dma_info_tifl_ifdi;
uint64_tifl_bus_addrs[IFLIB_MAX_RX_REFRESH] 
__aligned(CACHE_LINE_SIZE);
caddr_t ifl_vm_addrs[IFLIB_MAX_RX_REFRESH];
@@ -922,10 +922,9 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl
if_ctx_t ctx = ifp->if_softc;
iflib_txq_t txq = &ctx->ifc_txqs[kring->ring_id];
 
-   bus_dmamap_sync(txq->ift_desc_tag, txq->ift_ifdi->idi_map,
+   bus_dmamap_sync(txq->ift_buf_tag, txq->ift_ifdi->idi_map,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 
-
/*
 * First part: process new packets to send.
 * nm_i is the current index in the netmap kring,
@@ -992,7 +991,8 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl
 
if (slot->flags & NS_BUF_CHANGED) {
/* buffer has changed, reload map */
-   netmap_reload_map(na, 
txq->ift_desc_tag, txq->ift_sds.ifsd_map[nic_i], addr);
+   netmap_reload_map(na, txq->ift_buf_tag,
+   txq->ift_sds.ifsd_map[nic_i], addr);
}
/* make sure changes to the buffer are synced */
bus_dmamap_sync(txq->ift_ifdi->idi_tag, 
txq->ift_sds.ifsd_map[nic_i],
@@ -1005,7 +1005,7 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl
kring->nr_hwcur = nm_i;
 
/* synchronize the NIC ring */
-   bus_dmamap_sync(txq->ift_desc_tag, txq->ift_ifdi->idi_map,
+   bus_dmamap_sync(txq->ift_buf_tag, txq->ift_ifdi->idi_map,
BUS

Re: svn commit: r325728 - head/lib/libkvm

2019-02-04 Thread Ed Maste
On Sat, 11 Nov 2017 at 18:31, Will Andrews  wrote:
>
> Author: will
> Date: Sat Nov 11 23:30:58 2017
> New Revision: 325728
> URL: https://svnweb.freebsd.org/changeset/base/325728
>
> Log:
>   libkvm: add kvm_walk_pages API.
>
> Modified: head/lib/libkvm/kvm.h
> ==
> --- head/lib/libkvm/kvm.h   Sat Nov 11 22:50:14 2017(r325727)
> +++ head/lib/libkvm/kvm.h   Sat Nov 11 23:30:58 2017(r325728)
> @@ -36,6 +36,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  /* Default version symbol. */
>  #defineVRS_SYM "_version"
> @@ -73,7 +74,19 @@ struct kvm_swap {
> u_int   ksw_reserved2;
>  };
>
> +struct kvm_page {
> +   unsigned int version;
> +   u_long paddr;

This should probably be uin64_t to support cross-debugging cores from
64-bit machines on 32-bit hosts; also for i386 PAE. Or, on IRC jhb
suggested we introduce a kpaddr_t typedef akin to kvaddr_t.

> +   u_long kmap_vaddr;
> +   u_long dmap_vaddr;

These two should be kvaddr_t.

> +   vm_prot_t prot;
> +   u_long offset;

off_t?

> +   size_t len;
> +   /* end of version 1 */
> +};
> +
>  #define SWIF_DEV_PREFIX0x0002
> +#defineLIBKVM_WALK_PAGES_VERSION   1
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343754 - head/lib/libthr/thread

2019-02-04 Thread Konstantin Belousov
Author: kib
Date: Mon Feb  4 21:16:15 2019
New Revision: 343754
URL: https://svnweb.freebsd.org/changeset/base/343754

Log:
  Fixes for very early use of the pthread_mutex_* and libthr malloc.
  
  When libthr is statically linked into the binary, order of the
  constructors execution is not deterministic.  It is possible for the
  application constructor to use pthread_mutex_* functions before the
  libthr initialization was done.
  
  Handle it by:
  - making thr_malloc.c locking functions operational when curthread is not
yet set;
  - making __thr_malloc_init() idempotent, allowing more than one call to it;
  - unconditionally calling __thr_malloc_init() before initializing
a process-private mutex.
  
  Reported and tested by:   mmel
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/lib/libthr/thread/thr_malloc.c
  head/lib/libthr/thread/thr_mutex.c

Modified: head/lib/libthr/thread/thr_malloc.c
==
--- head/lib/libthr/thread/thr_malloc.c Mon Feb  4 20:46:57 2019
(r343753)
+++ head/lib/libthr/thread/thr_malloc.c Mon Feb  4 21:16:15 2019
(r343754)
@@ -46,6 +46,8 @@ void
 __thr_malloc_init(void)
 {
 
+   if (npagesizes != 0)
+   return;
npagesizes = getpagesizes(pagesizes_d, nitems(pagesizes_d));
if (npagesizes == -1) {
npagesizes = 1;
@@ -59,6 +61,8 @@ static void
 thr_malloc_lock(struct pthread *curthread)
 {
 
+   if (curthread == NULL)
+   return;
curthread->locklevel++;
_thr_umutex_lock(&thr_malloc_umtx, TID(curthread));
 }
@@ -67,6 +71,8 @@ static void
 thr_malloc_unlock(struct pthread *curthread)
 {
 
+   if (curthread == NULL)
+   return;
_thr_umutex_unlock(&thr_malloc_umtx, TID(curthread));
curthread->locklevel--;
_thr_ast(curthread);

Modified: head/lib/libthr/thread/thr_mutex.c
==
--- head/lib/libthr/thread/thr_mutex.c  Mon Feb  4 20:46:57 2019
(r343753)
+++ head/lib/libthr/thread/thr_mutex.c  Mon Feb  4 21:16:15 2019
(r343754)
@@ -390,6 +390,7 @@ __pthread_mutex_init(pthread_mutex_t * __restrict mute
}
if (mutex_attr == NULL ||
(*mutex_attr)->m_pshared == PTHREAD_PROCESS_PRIVATE) {
+   __thr_malloc_init();
return (mutex_init(mutex, mutex_attr ? *mutex_attr : NULL,
__thr_calloc));
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343755 - in head: lib/libefivar sbin/devmatch sbin/nvmecontrol sbin/nvmecontrol/modules/wdc share/man/man4 share/man/man9 stand/efi/libefi stand/efi/loader stand/forth stand/i386/libi3...

2019-02-04 Thread Warner Losh
Author: imp
Date: Mon Feb  4 21:28:25 2019
New Revision: 343755
URL: https://svnweb.freebsd.org/changeset/base/343755

Log:
  Regularize the Netflix copyright
  
  Use recent best practices for Copyright form at the top of
  the license:
  1. Remove all the All Rights Reserved clauses on our stuff. Where we
 piggybacked others, use a separate line to make things clear.
  2. Use "Netflix, Inc." everywhere.
  3. Use a single line for the copyright for grep friendliness.
  4. Use date ranges in all places for our stuff.
  
  Approved by: Netflix Legal (who gave me the form), adrian@ (pmc files)

Modified:
  head/lib/libefivar/efi-osdep.h
  head/lib/libefivar/efivar-dp-format.c
  head/lib/libefivar/efivar-dp-parse.c
  head/lib/libefivar/efivar-dp-xlate.c
  head/lib/libefivar/efivar-dp.h
  head/lib/libefivar/efivar.3
  head/lib/libefivar/efivar.c
  head/lib/libefivar/efivar.h
  head/lib/libefivar/uefi-dplib.h
  head/lib/libefivar/uefi-dputil.c
  head/sbin/devmatch/devmatch.8
  head/sbin/devmatch/devmatch.c
  head/sbin/nvmecontrol/modules/wdc/wdc.c
  head/sbin/nvmecontrol/nc_util.c
  head/sbin/nvmecontrol/ns.c
  head/sbin/nvmecontrol/nvmecontrol_ext.h
  head/sbin/nvmecontrol/power.c
  head/share/man/man4/nda.4
  head/share/man/man9/kern_testfrwk.9
  head/stand/efi/libefi/efienv.c
  head/stand/efi/libefi/env.c
  head/stand/efi/libefi/wchar.c
  head/stand/efi/loader/main.c
  head/stand/forth/efi.4th
  head/stand/i386/libi386/biospci.c
  head/stand/libsa/abort.c
  head/stand/libsa/xlocale_private.h
  head/sys/cam/nvme/nvme_all.c
  head/sys/cam/nvme/nvme_all.h
  head/sys/cam/nvme/nvme_da.c
  head/sys/crypto/aesni/aesencdec.h
  head/sys/dev/efidev/efidev.c
  head/sys/dev/nvme/nvme_sim.c
  head/sys/dev/tcp_log/tcp_log_dev.c
  head/sys/dev/tcp_log/tcp_log_dev.h
  head/sys/kern/subr_boot.c
  head/sys/netinet/tcp_hpts.c
  head/sys/netinet/tcp_hpts.h
  head/sys/netinet/tcp_log_buf.c
  head/sys/netinet/tcp_log_buf.h
  head/sys/netinet/tcp_stacks/rack.c
  head/sys/netinet/tcp_stacks/rack_bbr_common.h
  head/sys/netinet/tcp_stacks/sack_filter.c
  head/sys/netinet/tcp_stacks/sack_filter.h
  head/sys/netinet/tcp_stacks/tcp_rack.h
  head/sys/sys/boot.h
  head/sys/sys/efiio.h
  head/sys/sys/kern_prefetch.h
  head/sys/tests/callout_test.h
  head/sys/tests/callout_test/callout_test.c
  head/sys/tests/framework/kern_testfrwk.c
  head/sys/tests/kern_testfrwk.h
  head/usr.sbin/efibootmgr/efibootmgr.8
  head/usr.sbin/efibootmgr/efibootmgr.c
  head/usr.sbin/efidp/efidp.8
  head/usr.sbin/efidp/efidp.c
  head/usr.sbin/efivar/efiutil.c
  head/usr.sbin/efivar/efiutil.h
  head/usr.sbin/efivar/efivar.8
  head/usr.sbin/efivar/efivar.c
  head/usr.sbin/mpsutil/mps_cmd.c
  head/usr.sbin/mpsutil/mps_debug.c
  head/usr.sbin/mpsutil/mps_show.c
  head/usr.sbin/mpsutil/mpsutil.c
  head/usr.sbin/pmcstat/pmcpl_annotate_cg.c
  head/usr.sbin/pmcstat/pmcpl_annotate_cg.h
  head/usr.sbin/pmcstudy/eval_expr.c
  head/usr.sbin/pmcstudy/eval_expr.h
  head/usr.sbin/pmcstudy/pmcstudy.8
  head/usr.sbin/pmcstudy/pmcstudy.c

Modified: head/lib/libefivar/efi-osdep.h
==
--- head/lib/libefivar/efi-osdep.h  Mon Feb  4 21:16:15 2019
(r343754)
+++ head/lib/libefivar/efi-osdep.h  Mon Feb  4 21:28:25 2019
(r343755)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 2017 Netflix, Inc.
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: head/lib/libefivar/efivar-dp-format.c
==
--- head/lib/libefivar/efivar-dp-format.c   Mon Feb  4 21:16:15 2019
(r343754)
+++ head/lib/libefivar/efivar-dp-format.c   Mon Feb  4 21:28:25 2019
(r343755)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 2017 Netflix, Inc.
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: head/lib/libefivar/efivar-dp-parse.c
==
--- head/lib/libefivar/efivar-dp-parse.cMon Feb  4 21:16:15 2019
(r343754)
+++ head/lib/libefivar/efivar-dp-parse.cMon Feb  4 21:28:25 2019
(r343755)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 2017 Netflix, Inc.
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: head/lib/libefivar/efivar-dp-xlate.c
==
--- head/lib/libefivar/efivar-dp-xlate.cMon Feb  4 21:16:15 2019
(r343754)
+++ head/lib/libefivar/efivar-dp-xlate.cMon Feb  4 21:28:25 2019
(r343755)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 2017 Netflix, Inc.
- * All rights r

Re: svn commit: r343755 - in head: lib/libefivar sbin/devmatch sbin/nvmecontrol sbin/nvmecontrol/modules/wdc share/man/man4 share/man/man9 stand/efi/libefi stand/efi/loader stand/forth stand/i386/libi

2019-02-04 Thread Rodney W. Grimes
> Author: imp
> Date: Mon Feb  4 21:28:25 2019
> New Revision: 343755
> URL: https://svnweb.freebsd.org/changeset/base/343755
> 
> Log:
>   Regularize the Netflix copyright
>   
>   Use recent best practices for Copyright form at the top of
>   the license:
>   1. Remove all the All Rights Reserved clauses on our stuff. Where we
>  piggybacked others, use a separate line to make things clear.
Thank you, I think you missed at least one though.
And a few other comments inline, I defanitly think we need to pull
what was done here into an update of style(9), including the proper
way to attribute "work done for hire".

>   2. Use "Netflix, Inc." everywhere.
>   3. Use a single line for the copyright for grep friendliness.
>   4. Use date ranges in all places for our stuff.
>   
>   Approved by: Netflix Legal (who gave me the form), adrian@ (pmc files)
> 
> Modified:
>   head/lib/libefivar/efi-osdep.h
>   head/lib/libefivar/efivar-dp-format.c
>   head/lib/libefivar/efivar-dp-parse.c
>   head/lib/libefivar/efivar-dp-xlate.c
>   head/lib/libefivar/efivar-dp.h
>   head/lib/libefivar/efivar.3
>   head/lib/libefivar/efivar.c
>   head/lib/libefivar/efivar.h
>   head/lib/libefivar/uefi-dplib.h
>   head/lib/libefivar/uefi-dputil.c
>   head/sbin/devmatch/devmatch.8
>   head/sbin/devmatch/devmatch.c
>   head/sbin/nvmecontrol/modules/wdc/wdc.c
>   head/sbin/nvmecontrol/nc_util.c
>   head/sbin/nvmecontrol/ns.c
>   head/sbin/nvmecontrol/nvmecontrol_ext.h
>   head/sbin/nvmecontrol/power.c
>   head/share/man/man4/nda.4
>   head/share/man/man9/kern_testfrwk.9
>   head/stand/efi/libefi/efienv.c
>   head/stand/efi/libefi/env.c
>   head/stand/efi/libefi/wchar.c
>   head/stand/efi/loader/main.c
>   head/stand/forth/efi.4th
>   head/stand/i386/libi386/biospci.c
>   head/stand/libsa/abort.c
>   head/stand/libsa/xlocale_private.h
>   head/sys/cam/nvme/nvme_all.c
>   head/sys/cam/nvme/nvme_all.h
>   head/sys/cam/nvme/nvme_da.c
>   head/sys/crypto/aesni/aesencdec.h
>   head/sys/dev/efidev/efidev.c
>   head/sys/dev/nvme/nvme_sim.c
>   head/sys/dev/tcp_log/tcp_log_dev.c
>   head/sys/dev/tcp_log/tcp_log_dev.h
>   head/sys/kern/subr_boot.c
>   head/sys/netinet/tcp_hpts.c
>   head/sys/netinet/tcp_hpts.h
>   head/sys/netinet/tcp_log_buf.c
>   head/sys/netinet/tcp_log_buf.h
>   head/sys/netinet/tcp_stacks/rack.c
>   head/sys/netinet/tcp_stacks/rack_bbr_common.h
>   head/sys/netinet/tcp_stacks/sack_filter.c
>   head/sys/netinet/tcp_stacks/sack_filter.h
>   head/sys/netinet/tcp_stacks/tcp_rack.h
>   head/sys/sys/boot.h
>   head/sys/sys/efiio.h
>   head/sys/sys/kern_prefetch.h
>   head/sys/tests/callout_test.h
>   head/sys/tests/callout_test/callout_test.c
>   head/sys/tests/framework/kern_testfrwk.c
>   head/sys/tests/kern_testfrwk.h
>   head/usr.sbin/efibootmgr/efibootmgr.8
>   head/usr.sbin/efibootmgr/efibootmgr.c
>   head/usr.sbin/efidp/efidp.8
>   head/usr.sbin/efidp/efidp.c
>   head/usr.sbin/efivar/efiutil.c
>   head/usr.sbin/efivar/efiutil.h
>   head/usr.sbin/efivar/efivar.8
>   head/usr.sbin/efivar/efivar.c
>   head/usr.sbin/mpsutil/mps_cmd.c
>   head/usr.sbin/mpsutil/mps_debug.c
>   head/usr.sbin/mpsutil/mps_show.c
>   head/usr.sbin/mpsutil/mpsutil.c
>   head/usr.sbin/pmcstat/pmcpl_annotate_cg.c
>   head/usr.sbin/pmcstat/pmcpl_annotate_cg.h
>   head/usr.sbin/pmcstudy/eval_expr.c
>   head/usr.sbin/pmcstudy/eval_expr.h
>   head/usr.sbin/pmcstudy/pmcstudy.8
>   head/usr.sbin/pmcstudy/pmcstudy.c
> 
> Modified: head/lib/libefivar/efi-osdep.h
> ==
> --- head/lib/libefivar/efi-osdep.hMon Feb  4 21:16:15 2019
> (r343754)
> +++ head/lib/libefivar/efi-osdep.hMon Feb  4 21:28:25 2019
> (r343755)
> @@ -1,6 +1,5 @@
>  /*-
>   * Copyright (c) 2017 Netflix, Inc.
> - * All rights reserved.
>   *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions
> 
> Modified: head/lib/libefivar/efivar-dp-format.c
> ==
> --- head/lib/libefivar/efivar-dp-format.c Mon Feb  4 21:16:15 2019
> (r343754)
> +++ head/lib/libefivar/efivar-dp-format.c Mon Feb  4 21:28:25 2019
> (r343755)
> @@ -1,6 +1,5 @@
>  /*-
>   * Copyright (c) 2017 Netflix, Inc.
> - * All rights reserved.
>   *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions
> 
> Modified: head/lib/libefivar/efivar-dp-parse.c
> ==
> --- head/lib/libefivar/efivar-dp-parse.c  Mon Feb  4 21:16:15 2019
> (r343754)
> +++ head/lib/libefivar/efivar-dp-parse.c  Mon Feb  4 21:28:25 2019
> (r343755)
> @@ -1,6 +1,5 @@
>  /*-
>   * Copyright (c) 2017 Netflix, Inc.
> - * All rights reserved.
>   *
>   * Redistribution and use in source and binary for

svn commit: r343757 - in head/sys/x86: include x86

2019-02-04 Thread Konstantin Belousov
Author: kib
Date: Mon Feb  4 23:57:59 2019
New Revision: 343757
URL: https://svnweb.freebsd.org/changeset/base/343757

Log:
  Update CPUID bits definitions and CPU identification based on changes
  in SDM rev. 069.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/sys/x86/include/specialreg.h
  head/sys/x86/x86/identcpu.c

Modified: head/sys/x86/include/specialreg.h
==
--- head/sys/x86/include/specialreg.h   Mon Feb  4 22:38:34 2019
(r343756)
+++ head/sys/x86/include/specialreg.h   Mon Feb  4 23:57:59 2019
(r343757)
@@ -436,7 +436,12 @@
 #defineCPUID_STDEXT2_UMIP  0x0004
 #defineCPUID_STDEXT2_PKU   0x0008
 #defineCPUID_STDEXT2_OSPKE 0x0010
+#defineCPUID_STDEXT2_WAITPKG   0x0020
+#defineCPUID_STDEXT2_GFNI  0x0100
 #defineCPUID_STDEXT2_RDPID 0x0040
+#defineCPUID_STDEXT2_CLDEMOTE  0x0200
+#defineCPUID_STDEXT2_MOVDIRI   0x0800
+#defineCPUID_STDEXT2_MOVDIRI64B0x1000
 #defineCPUID_STDEXT2_SGXLC 0x4000
 
 /*
@@ -446,6 +451,7 @@
 #defineCPUID_STDEXT3_STIBP 0x0800
 #defineCPUID_STDEXT3_L1D_FLUSH 0x1000
 #defineCPUID_STDEXT3_ARCH_CAP  0x2000
+#defineCPUID_STDEXT3_CORE_CAP  0x4000
 #defineCPUID_STDEXT3_SSBD  0x8000
 
 /* MSR IA32_ARCH_CAP(ABILITIES) bits */

Modified: head/sys/x86/x86/identcpu.c
==
--- head/sys/x86/x86/identcpu.c Mon Feb  4 22:38:34 2019(r343756)
+++ head/sys/x86/x86/identcpu.c Mon Feb  4 23:57:59 2019(r343757)
@@ -981,7 +981,12 @@ printcpuinfo(void)
   "\003UMIP"
   "\004PKU"
   "\005OSPKE"
+  "\006WAITPKG"
+  "\011GFNI"
   "\027RDPID"
+  "\032CLDEMOTE"
+  "\034MOVDIRI"
+  "\035MOVDIRI64B"
   "\037SGXLC"
   );
}
@@ -994,6 +999,7 @@ printcpuinfo(void)
   "\034STIBP"
   "\035L1DFL"
   "\036ARCH_CAP"
+  "\037CORE_CAP"
   "\040SSBD"
   );
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343758 - head/lib/libpmc/pmu-events

2019-02-04 Thread Matt Macy
Author: mmacy
Date: Tue Feb  5 00:31:25 2019
New Revision: 343758
URL: https://svnweb.freebsd.org/changeset/base/343758

Log:
  Fix deterministic builds by sorting input to fts in jevents
  
  Reported by: emaste@

Modified:
  head/lib/libpmc/pmu-events/jevents.c

Modified: head/lib/libpmc/pmu-events/jevents.c
==
--- head/lib/libpmc/pmu-events/jevents.cMon Feb  4 23:57:59 2019
(r343757)
+++ head/lib/libpmc/pmu-events/jevents.cTue Feb  5 00:31:25 2019
(r343758)
@@ -54,6 +54,10 @@
 #include "json.h"
 #include "jevents.h"
 
+static int
+nftw_ordered(const char *path, int (*fn)(const char *, const struct stat *, 
int,
+   struct FTW *), int nfds, int ftwflags);
+
 _Noreturn void  _Exit(int);
 
 int verbose;
@@ -1122,7 +1126,7 @@ int main(int argc, char *argv[])
 
maxfds = get_maxfds();
mapfile = NULL;
-   rc = nftw(ldirname, preprocess_arch_std_files, maxfds, 0);
+   rc = nftw_ordered(ldirname, preprocess_arch_std_files, maxfds, 0);
if (rc && verbose) {
pr_info("%s: Error preprocessing arch standard files %s: %s\n",
prog, ldirname, strerror(errno));
@@ -1135,7 +1139,7 @@ int main(int argc, char *argv[])
goto empty_map;
}
 
-   rc = nftw(ldirname, process_one_file, maxfds, 0);
+   rc = nftw_ordered(ldirname, process_one_file, maxfds, 0);
if (rc && verbose) {
pr_info("%s: Error walking file tree %s\n", prog, ldirname);
goto empty_map;
@@ -1168,4 +1172,91 @@ empty_map:
create_empty_mapping(output_file);
free_arch_std_events();
return 0;
+}
+
+#include 
+
+static int
+fts_compare(const FTSENT * const *a, const FTSENT * const *b)
+{
+   return (strcmp((*a)->fts_name, (*b)->fts_name));
+}
+
+static int
+nftw_ordered(const char *path, int (*fn)(const char *, const struct stat *, 
int,
+ struct FTW *), int nfds, int ftwflags)
+{
+   char * const paths[2] = { (char *)path, NULL };
+   struct FTW ftw;
+   FTSENT *cur;
+   FTS *ftsp;
+   int error = 0, ftsflags, fnflag, postorder, sverrno;
+
+   /* XXX - nfds is currently unused */
+   if (nfds < 1) {
+   errno = EINVAL;
+   return (-1);
+   }
+
+   ftsflags = FTS_COMFOLLOW;
+   if (!(ftwflags & FTW_CHDIR))
+   ftsflags |= FTS_NOCHDIR;
+   if (ftwflags & FTW_MOUNT)
+   ftsflags |= FTS_XDEV;
+   if (ftwflags & FTW_PHYS)
+   ftsflags |= FTS_PHYSICAL;
+   else
+   ftsflags |= FTS_LOGICAL;
+   postorder = (ftwflags & FTW_DEPTH) != 0;
+   ftsp = fts_open(paths, ftsflags, fts_compare);
+   if (ftsp == NULL)
+   return (-1);
+   while ((cur = fts_read(ftsp)) != NULL) {
+   switch (cur->fts_info) {
+   case FTS_D:
+   if (postorder)
+   continue;
+   fnflag = FTW_D;
+   break;
+   case FTS_DC:
+   continue;
+   case FTS_DNR:
+   fnflag = FTW_DNR;
+   break;
+   case FTS_DP:
+   if (!postorder)
+   continue;
+   fnflag = FTW_DP;
+   break;
+   case FTS_F:
+   case FTS_DEFAULT:
+   fnflag = FTW_F;
+   break;
+   case FTS_NS:
+   case FTS_NSOK:
+   fnflag = FTW_NS;
+   break;
+   case FTS_SL:
+   fnflag = FTW_SL;
+   break;
+   case FTS_SLNONE:
+   fnflag = FTW_SLN;
+   break;
+   default:
+   error = -1;
+   goto done;
+   }
+   ftw.base = cur->fts_pathlen - cur->fts_namelen;
+   ftw.level = cur->fts_level;
+   error = fn(cur->fts_path, cur->fts_statp, fnflag, &ftw);
+   if (error != 0)
+   break;
+   }
+done:
+   sverrno = errno;
+   if (fts_close(ftsp) != 0 && error == 0)
+   error = -1;
+   else
+   errno = sverrno;
+   return (error);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343761 - head/sys/kern

2019-02-04 Thread Conrad Meyer
Author: cem
Date: Tue Feb  5 03:32:58 2019
New Revision: 343761
URL: https://svnweb.freebsd.org/changeset/base/343761

Log:
  extattr_list_vp: Only take shared vnode lock
  
  List is a 'read'-type operation that does not modify shared state; it's safe
  for multiple thread to proceed concurrently.  This is reflected in the vnode
  operation LISTEXTATTR locking protocol specification, which only requires a
  shared lock.
  
  (Similar to previous r248933.)
  
  Reported by:  Case van Rij 
  Reviewed by:  kib, mjg
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D19082

Modified:
  head/sys/kern/vfs_extattr.c

Modified: head/sys/kern/vfs_extattr.c
==
--- head/sys/kern/vfs_extattr.c Tue Feb  5 03:01:10 2019(r343760)
+++ head/sys/kern/vfs_extattr.c Tue Feb  5 03:32:58 2019(r343761)
@@ -633,7 +633,7 @@ extattr_list_vp(struct vnode *vp, int attrnamespace, v
if (nbytes > IOSIZE_MAX)
return (EINVAL);
 
-   vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+   vn_lock(vp, LK_SHARED | LK_RETRY);
 
auiop = NULL;
sizep = NULL;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343762 - head/sys/kern

2019-02-04 Thread Conrad Meyer
Author: cem
Date: Tue Feb  5 04:47:21 2019
New Revision: 343762
URL: https://svnweb.freebsd.org/changeset/base/343762

Log:
  extattr_list_vp: Narrow locked section somewhat
  
  Suggested by: mjg
  Reviewed by:  kib, mjg
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D19083

Modified:
  head/sys/kern/vfs_extattr.c

Modified: head/sys/kern/vfs_extattr.c
==
--- head/sys/kern/vfs_extattr.c Tue Feb  5 03:32:58 2019(r343761)
+++ head/sys/kern/vfs_extattr.c Tue Feb  5 04:47:21 2019(r343762)
@@ -633,8 +633,6 @@ extattr_list_vp(struct vnode *vp, int attrnamespace, v
if (nbytes > IOSIZE_MAX)
return (EINVAL);
 
-   vn_lock(vp, LK_SHARED | LK_RETRY);
-
auiop = NULL;
sizep = NULL;
cnt = 0;
@@ -653,24 +651,25 @@ extattr_list_vp(struct vnode *vp, int attrnamespace, v
} else
sizep = &size;
 
+   vn_lock(vp, LK_SHARED | LK_RETRY);
+
 #ifdef MAC
error = mac_vnode_check_listextattr(td->td_ucred, vp, attrnamespace);
-   if (error)
-   goto done;
+   if (error) {
+   VOP_UNLOCK(vp, 0);
+   return (error);
+   }
 #endif
 
error = VOP_LISTEXTATTR(vp, attrnamespace, auiop, sizep,
td->td_ucred, td);
+   VOP_UNLOCK(vp, 0);
 
if (auiop != NULL) {
cnt -= auio.uio_resid;
td->td_retval[0] = cnt;
} else
td->td_retval[0] = size;
-#ifdef MAC
-done:
-#endif
-   VOP_UNLOCK(vp, 0);
return (error);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343763 - head/sys/powerpc/powerpc

2019-02-04 Thread Justin Hibbits
Author: jhibbits
Date: Tue Feb  5 04:47:41 2019
New Revision: 343763
URL: https://svnweb.freebsd.org/changeset/base/343763

Log:
  powerpc: Don't idle with the wait instruction on booke
  
  It appears idling via 'wait' on e5500 causes strange behaviors, such as
  top(1) simply hanging sporadically, until input.  Until this can possibly be
  sorted out (interrupt issue?), just don't idle on this hardware.  The SoCs
  are low power already, and the wait state doesn't save much anyway.

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

Modified: head/sys/powerpc/powerpc/cpu.c
==
--- head/sys/powerpc/powerpc/cpu.c  Tue Feb  5 04:47:21 2019
(r343762)
+++ head/sys/powerpc/powerpc/cpu.c  Tue Feb  5 04:47:41 2019
(r343763)
@@ -767,11 +767,6 @@ cpu_idle_booke(sbintime_t sbt)
case FSL_E500mc:
case FSL_E5500:
case FSL_E6500:
-   /*
-* Base binutils doesn't know what the 'wait' instruction is, so
-* use the opcode encoding here.
-*/
-   __asm __volatile(".long 0x7c7c");
break;
default:
powerpc_sync();
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343764 - head/sys/arm/arm

2019-02-04 Thread Jayachandran C.
Author: jchandra
Date: Tue Feb  5 06:25:35 2019
New Revision: 343764
URL: https://svnweb.freebsd.org/changeset/base/343764

Log:
  arm, acpi: increase size of memory region arrays
  
  Bump up MAX_HWCNT and MAX_EXCNT to 32 when ACPI is enabled. These are
  the sizes of the hwregions and exregions arrays respectively. ACPI
  firmware typically has more memory regions and the current value of
  16 is not sufficient for some platforms.
  
  This commit fixes a failure seen with AMI firmware on Cavium's Sabre
  ThunderX2 reference platform. This platform needs 21 physical memory
  regions and 18 excluded regions to boot correctly with the current
  firmware release.
  
  Reviewed by:  andrew
  Differential Revision:https://reviews.freebsd.org/D19073

Modified:
  head/sys/arm/arm/physmem.c

Modified: head/sys/arm/arm/physmem.c
==
--- head/sys/arm/arm/physmem.c  Tue Feb  5 04:47:41 2019(r343763)
+++ head/sys/arm/arm/physmem.c  Tue Feb  5 06:25:35 2019(r343764)
@@ -29,6 +29,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_acpi.h"
 #include "opt_ddb.h"
 
 /*
@@ -48,8 +49,13 @@ __FBSDID("$FreeBSD$");
  * that can be allocated, or both, depending on the exclusion flags associated
  * with the region.
  */
+#ifdef DEV_ACPI
+#defineMAX_HWCNT   32  /* ACPI needs more regions */
+#defineMAX_EXCNT   32
+#else
 #defineMAX_HWCNT   16
 #defineMAX_EXCNT   16
+#endif
 
 #if defined(__arm__)
 #defineMAX_PHYS_ADDR   0xull
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"