Re: svn commit: r355379 - head/usr.sbin/mergemaster

2019-12-03 Thread Bryan Drewery
On 12/3/2019 7:55 PM, O. Hartmann wrote:
> Am Wed, 4 Dec 2019 03:44:50 + (UTC)
> Bryan Drewery  schrieb:
> 
>> Author: bdrewery
>> Date: Wed Dec  4 03:44:50 2019
>> New Revision: 355379
>> URL: https://svnweb.freebsd.org/changeset/base/355379
> 
>> Log:
>>   Run make in parallel.
> 
>>   This is mostly targetting the 'installconfig' phase of 'distribution'
>>   which does a full tree walk.
> 
>>   MFC after:  2 weeks
> 
>> Modified:
>>   head/usr.sbin/mergemaster/mergemaster.sh
> 
>> Modified: head/usr.sbin/mergemaster/mergemaster.sh
>> ==
>> --- head/usr.sbin/mergemaster/mergemaster.sh Wed Dec  4 03:41:55 2019
>> (r355378)
>> +++ head/usr.sbin/mergemaster/mergemaster.sh Wed Dec  4 03:44:50 2019
>> (r355379)
>> @@ -508,6 +508,7 @@ SOURCEDIR=$(realpath "$SOURCEDIR")
> 
>>  # Setup make to use system files from SOURCEDIR
>>  MM_MAKE="make ${ARCHSTRING} -m ${SOURCEDIR}/share/mk -DNO_FILEMON"
>> +MM_MAKE="${MM_MAKE} -j$(sysctl -n hw.ncpu)"
> 
>>  # Check DESTDIR against the mergemaster mtree database to see what
>>  # files the user changed from the reference files.
>> ___
>> svn-src-h...@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/svn-src-head
>> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
> 
> Whatever I do, mergemaster does not work anymore after this commit:
> 
> [...]
> # mergemaster
> 
> /usr/sbin/mergemaster: sysctl: not found
> *** The directory specified for the temporary root environment,
> /var/tmp/temproot, exists.  This can be a security risk if untrusted
> users have access to the system.
> 
>   Use 'd' to delete the old /var/tmp/temproot and continue
>   Use 't' to select a new temporary root directory
>   Use 'e' to exit mergemaster
> 
>   Default is to use /var/tmp/temproot as is
> 
> How should I deal with this? [Use the existing /var/tmp/temproot] d
> 
>*** Deleting the old /var/tmp/temproot
> 
> *** Creating the temporary root environment in /var/tmp/temproot
>  *** /var/tmp/temproot ready for use
>  *** Creating and populating directory structure in /var/tmp/temproot
> 
> make: illegal argument to -j -- must be positive integer!
> 
>   *** FATAL ERROR: Cannot 'cd' to /usr/src and install files to
>   the temproot environment
> 
> 
>

Should be fixed in r355381. Sorry about that and forgetting to mention
your report credit.

I admit I didn't test this as I was annoyed with my upgrade being stuck
in mergemaster and know that each of these invocations is -j safe. What
a silly script to not include /sbin in PATH.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r355381 - head/usr.sbin/mergemaster

2019-12-03 Thread Bryan Drewery
Author: bdrewery
Date: Wed Dec  4 04:01:53 2019
New Revision: 355381
URL: https://svnweb.freebsd.org/changeset/base/355381

Log:
  Use full path to sysctl(8) since /sbin is not in PATH.
  
  X-MFC-With:   r355379
  MFC after:2 weeks

Modified:
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==
--- head/usr.sbin/mergemaster/mergemaster.shWed Dec  4 03:51:30 2019
(r355380)
+++ head/usr.sbin/mergemaster/mergemaster.shWed Dec  4 04:01:53 2019
(r355381)
@@ -508,7 +508,7 @@ SOURCEDIR=$(realpath "$SOURCEDIR")
 
 # Setup make to use system files from SOURCEDIR
 MM_MAKE="make ${ARCHSTRING} -m ${SOURCEDIR}/share/mk -DNO_FILEMON"
-MM_MAKE="${MM_MAKE} -j$(sysctl -n hw.ncpu)"
+MM_MAKE="${MM_MAKE} -j$(/sbin/sysctl -n hw.ncpu)"
 
 # Check DESTDIR against the mergemaster mtree database to see what
 # files the user changed from the reference files.
___
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: r355379 - head/usr.sbin/mergemaster

2019-12-03 Thread O. Hartmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Am Wed, 4 Dec 2019 03:44:50 + (UTC)
Bryan Drewery  schrieb:

> Author: bdrewery
> Date: Wed Dec  4 03:44:50 2019
> New Revision: 355379
> URL: https://svnweb.freebsd.org/changeset/base/355379
> 
> Log:
>   Run make in parallel.
>   
>   This is mostly targetting the 'installconfig' phase of 'distribution'
>   which does a full tree walk.
>   
>   MFC after:   2 weeks
> 
> Modified:
>   head/usr.sbin/mergemaster/mergemaster.sh
> 
> Modified: head/usr.sbin/mergemaster/mergemaster.sh
> ==
> --- head/usr.sbin/mergemaster/mergemaster.sh  Wed Dec  4 03:41:55 2019
> (r355378)
> +++ head/usr.sbin/mergemaster/mergemaster.sh  Wed Dec  4 03:44:50 2019
> (r355379)
> @@ -508,6 +508,7 @@ SOURCEDIR=$(realpath "$SOURCEDIR")
>  
>  # Setup make to use system files from SOURCEDIR
>  MM_MAKE="make ${ARCHSTRING} -m ${SOURCEDIR}/share/mk -DNO_FILEMON"
> +MM_MAKE="${MM_MAKE} -j$(sysctl -n hw.ncpu)"
>  
>  # Check DESTDIR against the mergemaster mtree database to see what
>  # files the user changed from the reference files.
> ___
> svn-src-h...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Whatever I do, mergemaster does not work anymore after this commit:

[...]
# mergemaster

/usr/sbin/mergemaster: sysctl: not found
*** The directory specified for the temporary root environment,
/var/tmp/temproot, exists.  This can be a security risk if untrusted
users have access to the system.

  Use 'd' to delete the old /var/tmp/temproot and continue
  Use 't' to select a new temporary root directory
  Use 'e' to exit mergemaster

  Default is to use /var/tmp/temproot as is

How should I deal with this? [Use the existing /var/tmp/temproot] d

   *** Deleting the old /var/tmp/temproot

*** Creating the temporary root environment in /var/tmp/temproot
 *** /var/tmp/temproot ready for use
 *** Creating and populating directory structure in /var/tmp/temproot

make: illegal argument to -j -- must be positive integer!

  *** FATAL ERROR: Cannot 'cd' to /usr/src and install files to
  the temproot environment


- -- 
O. Hartmann

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

iHUEARYIAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCXecuNAAKCRA4N1ZZPba5
RyWgAQDevXV1bwx86CgwU7tOUYE3G+1PKz5fgntVnXT684ZJXAD/S4VXwBiQx7zC
Ioc0eJ1r3xyejYtDJAQojcAHSdmHygY=
=6NmG
-END PGP SIGNATURE-
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r355380 - head/sys/powerpc/booke

2019-12-03 Thread Justin Hibbits
Author: jhibbits
Date: Wed Dec  4 03:51:30 2019
New Revision: 355380
URL: https://svnweb.freebsd.org/changeset/base/355380

Log:
  powerpc/booke: Fix some formatting errors in debug printfs
  
  Use the right formats for the types given (vm_offset_t and vm_size_t are
  both uint32_t on 32-bit platforms, and uint64_t on 64-bit platforms, and
  match size_t in size, so we can use the size_t format as we do in other
  similar code).
  
  These were found by clang.

Modified:
  head/sys/powerpc/booke/pmap.c

Modified: head/sys/powerpc/booke/pmap.c
==
--- head/sys/powerpc/booke/pmap.c   Wed Dec  4 03:44:50 2019
(r355379)
+++ head/sys/powerpc/booke/pmap.c   Wed Dec  4 03:51:30 2019
(r355380)
@@ -1622,8 +1622,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o
/* Pre-round up to 1MB.  This wastes some space, but saves TLB entries 
*/
data_end = roundup2(data_end, 1 << 20);
debugf(" data_end: 0x%"PRI0ptrX"\n", data_end);
-   debugf(" kernstart: %p\n", kernstart);
-   debugf(" kernsize: %lx\n", kernsize);
+   debugf(" kernstart: %#zx\n", kernstart);
+   debugf(" kernsize: %#zx\n", kernsize);
 
if (data_end - kernstart > kernsize) {
kernsize += tlb1_mapin_region(kernstart + kernsize,
___
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: r355241 - head/sys/kern

2019-12-03 Thread Mateusz Guzik
On 12/2/19, John Baldwin  wrote:
> On 11/30/19 11:33 AM, Mateusz Guzik wrote:
>> Author: mjg
>> Date: Sat Nov 30 19:33:02 2019
>> New Revision: 355241
>> URL: https://svnweb.freebsd.org/changeset/base/355241
>>
>> Log:
>>   smp: cast the read in quiesce_all_critical through void *
>>
>>   Fixes compilation on some 32-bit arm platforms.
>>
>>   Sponsored by:  The FreeBSD Foundation
>>
>> Modified:
>>   head/sys/kern/subr_smp.c
>>
>> Modified: head/sys/kern/subr_smp.c
>> ==
>> --- head/sys/kern/subr_smp.c Sat Nov 30 19:21:29 2019(r355240)
>> +++ head/sys/kern/subr_smp.c Sat Nov 30 19:33:02 2019(r355241)
>> @@ -952,7 +952,7 @@ quiesce_all_critical(void)
>>  break;
>>  cpu_spinwait();
>>  newtd = (struct thread *)
>> -atomic_load_acq_ptr((u_long *)pcpu->pc_curthread);
>> +atomic_load_acq_ptr((void *)pcpu->pc_curthread);
>
> Why not uintptr_t *?  I think that's the defined type for atomic_*_ptr
> anyway?
>

I have no strong opinion one way or the other. However, the real fix
would make these routines work without casting for cases like the
above.

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


svn commit: r355379 - head/usr.sbin/mergemaster

2019-12-03 Thread Bryan Drewery
Author: bdrewery
Date: Wed Dec  4 03:44:50 2019
New Revision: 355379
URL: https://svnweb.freebsd.org/changeset/base/355379

Log:
  Run make in parallel.
  
  This is mostly targetting the 'installconfig' phase of 'distribution'
  which does a full tree walk.
  
  MFC after: 2 weeks

Modified:
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==
--- head/usr.sbin/mergemaster/mergemaster.shWed Dec  4 03:41:55 2019
(r355378)
+++ head/usr.sbin/mergemaster/mergemaster.shWed Dec  4 03:44:50 2019
(r355379)
@@ -508,6 +508,7 @@ SOURCEDIR=$(realpath "$SOURCEDIR")
 
 # Setup make to use system files from SOURCEDIR
 MM_MAKE="make ${ARCHSTRING} -m ${SOURCEDIR}/share/mk -DNO_FILEMON"
+MM_MAKE="${MM_MAKE} -j$(sysctl -n hw.ncpu)"
 
 # Check DESTDIR against the mergemaster mtree database to see what
 # files the user changed from the reference files.
___
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: r355378 - head/sys/powerpc/booke

2019-12-03 Thread Justin Hibbits
Author: jhibbits
Date: Wed Dec  4 03:41:55 2019
New Revision: 355378
URL: https://svnweb.freebsd.org/changeset/base/355378

Log:
  powerpc/booke: Fix 32-bit Book-E SMP AP bringup
  
  r354266 changed the type of bp_kernload to vm_paddr_t in platform_mpc85xx.c,
  but not the variable itself in locore.S.  This caused the AP to not come up,
  due to overwriting the following variable (bp_virtaddr).  Also, properly
  load bp_kernload into MAS3 and MAS7.  Prior to r354266, we required loading
  into the low 4GB, but now we can load from anywhere in memory that ubldr can
  access.

Modified:
  head/sys/powerpc/booke/locore.S

Modified: head/sys/powerpc/booke/locore.S
==
--- head/sys/powerpc/booke/locore.S Wed Dec  4 03:36:54 2019
(r355377)
+++ head/sys/powerpc/booke/locore.S Wed Dec  4 03:41:55 2019
(r355378)
@@ -443,7 +443,7 @@ bp_trace:
 
.globl  bp_kernload
 bp_kernload:
-   ADDR(0) /* Kern phys. load address. */
+   .llong 0/* Kern phys. load address. */
 
.globl  bp_virtaddr
 bp_virtaddr:
@@ -548,14 +548,15 @@ bp_virtaddr:
 #else
clrrwi  %r3, %r3, PAGE_SHIFT/* trunc_page(%r3) */
 #endif
-   LOAD%r4, (bp_kernload - __boot_page)(%r3)
+   /* Load lower half of the kernel loadaddr. */
+   lwz %r4, (bp_kernload - __boot_page + 4)(%r3)
LOAD%r5, (bp_virtaddr - __boot_page)(%r3)
 
/* Set RPN and protection */
ori %r4, %r4, (MAS3_SX | MAS3_SW | MAS3_SR)@l
mtspr   SPR_MAS3, %r4
isync
-   li  %r4, 0
+   lwz %r4, (bp_kernload - __boot_page)(%r3)
mtspr   SPR_MAS7, %r4
isync
tlbwe
___
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: r355377 - head/sys/sys

2019-12-03 Thread Doug Moore
Author: dougm
Date: Wed Dec  4 03:36:54 2019
New Revision: 355377
URL: https://svnweb.freebsd.org/changeset/base/355377

Log:
  Change the implementation of bit_ffc_area_at so that, in the worst
  case, the number of operations spent on each b-bit word is
  proportional to lg b rather than b.
  
  For one word, shrink all regions of 0-bits by size-1 bit positions in
  no more than O(lg(min(b,size))) operations. In what remains, the first
  0-bit is either the start of an area of sufficient size contained
  within the original word, or the start of an area that could spill
  over into the next word, and prove to be of sufficient size once the
  start of that word is examined.
  
  Change bit_ffs_area_at similarly.
  
  Reviewed by: erj, jacob.e.keller_intel.com
  MFC with: r354977
  Differential Revision: https://reviews.freebsd.org/D22523

Modified:
  head/sys/sys/bitstring.h

Modified: head/sys/sys/bitstring.h
==
--- head/sys/sys/bitstring.hWed Dec  4 02:59:50 2019(r355376)
+++ head/sys/sys/bitstring.hWed Dec  4 03:36:54 2019(r355377)
@@ -277,66 +277,96 @@ bit_ffc(bitstr_t *_bitstr, int _nbits, int *_result)
 
 /* Find contiguous sequence of at least size set bits at or after start */
 static inline void
-bit_ffs_area_at(bitstr_t *_bitstr, int _start, int _nbits, int _size, int 
*_result)
+bit_ffs_area_at(bitstr_t *_bitstr, int _start, int _nbits, int _size,
+int *_result)
 {
-   int _index, _end, _i;
-again:
-   /* Find the first set bit */
-   bit_ffs_at(_bitstr, _start, _nbits, &_index);
-   if (_index < 0) {
-   *_result = -1;
-   return;
-   }
+   bitstr_t *_curbitstr;
+   bitstr_t _test;
+   int _value, _offset, _logsize, _b;
 
-   /* Make sure there is enough room left in the bitstr */
-   _end = _index + _size;
-   if (_end > _nbits) {
+   if (_start + _size > _nbits || _nbits <= 0) {
*_result = -1;
return;
}
 
-   /* Find the next cleared bit starting at _index, stopping at _end */
-   bit_ffc_at(_bitstr, _index, _end, &_i);
-   if (_i >= 0) {
-   /* we found a clear bit between _index and _end, so skip ahead
-* to the next bit and try again
-*/
-   _start = _i + 1;
-   goto again;
+   _logsize = fls(_size - 1);
+   _value = _start;
+   _curbitstr = _bitstr + _bit_idx(_start);
+   _test = ~*_curbitstr;
+   if (_bit_offset(_start) != 0)
+   _test |= _bit_make_mask(0, _start - 1);
+   for (_offset = 0;; _offset -= _BITSTR_BITS, _test = ~*++_curbitstr) {
+   if (_test != 0) {
+   /* If leading 0s in _test can finish 0-area, stop. */
+   if (_offset + _size < (int)_BITSTR_BITS &&
+   (_test & _bit_make_mask(0, _offset + _size)) == 0)
+   break;
+   /* Shrink-left every 0-area in _test by size-1 bits. */
+   _b = _logsize;
+   while ((_test & (_test + 1)) != 0 && _b-- > 0)
+   _test |= _test >> (((_size - 1) >> _b) + 1) / 2;
+   /* Find the start of the first 0-area in _test. */
+   _offset = (~_test == 0) ? _BITSTR_BITS :
+   ffsl(~_test) - 1;
+   _value = (_curbitstr - _bitstr) * _BITSTR_BITS +
+   _offset;
+   /* If there's insufficient space left, give up. */
+   if (_value + _size > _nbits) {
+   _value = -1;
+   break;
+   }
+   }
+   if (_offset + _size <= (int)_BITSTR_BITS)
+   break;
}
-   *_result = _index;
+   *_result = _value;
 }
 
 /* Find contiguous sequence of at least size cleared bits at or after start */
 static inline void
-bit_ffc_area_at(bitstr_t *_bitstr, int _start, int _nbits, int _size, int 
*_result)
+bit_ffc_area_at(bitstr_t *_bitstr, int _start, int _nbits, int _size,
+int *_result)
 {
-   int _index, _end, _i;
-again:
-   /* Find the first zero bit */
-   bit_ffc_at(_bitstr, _start, _nbits, &_index);
-   if (_index < 0) {
-   *_result = -1;
-   return;
-   }
+   bitstr_t *_curbitstr;
+   bitstr_t _test;
+   int _value, _offset, _logsize, _b;
 
-   /* Make sure there is enough room left in the bitstr */
-   _end = _index + _size;
-   if (_end > _nbits) {
+   if (_start + _size > _nbits || _nbits <= 0) {
*_result = -1;
return;
}
 
-   /* Find the next set bit starting at _index, stopping at _end */
-   bit_ffs_at(_bitstr, _index, _end, &_i);
-   if (_i >= 

Re: svn commit: r355373 - in head/sys: amd64/amd64 amd64/cloudabi32 amd64/cloudabi64 amd64/ia32 amd64/linux amd64/linux32 arm/arm arm/cloudabi32 arm64/arm64 arm64/cloudabi32 arm64/cloudabi64 arm64/lin

2019-12-03 Thread Ganbold Tsagaankhuu
On Wed, Dec 4, 2019 at 7:18 AM John Baldwin  wrote:

> Author: jhb
> Date: Tue Dec  3 23:17:54 2019
> New Revision: 355373
> URL: https://svnweb.freebsd.org/changeset/base/355373
>
> Log:
>   Use uintptr_t instead of register_t * for the stack base.
>
>   - Use ustringp for the location of the argv and environment strings
> and allow destp to travel further down the stack for the stackgap
> and auxv regions.
>   - Update the Linux copyout_strings variants to move destp down the
> stack as was done for the native ABIs in r263349.
>   - Stop allocating a space for a stack gap in the Linux ABIs.  This
> used to hold translated system call arguments, but hasn't been used
> since r159992.
>
>   Reviewed by:  kib
>   Tested on:md64 (amd64, i386, linux64), i386 (i386, linux)
>   Sponsored by: DARPA
>   Differential Revision:https://reviews.freebsd.org/D22501
>
> Modified:
>   head/sys/amd64/amd64/machdep.c
>   head/sys/amd64/cloudabi32/cloudabi32_sysvec.c
>   head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
>   head/sys/amd64/ia32/ia32_signal.c
>   head/sys/amd64/linux/linux_sysvec.c
>   head/sys/amd64/linux32/linux32_sysvec.c
>   head/sys/arm/arm/machdep.c
>   head/sys/arm/cloudabi32/cloudabi32_sysvec.c
>   head/sys/arm64/arm64/elf32_machdep.c
>   head/sys/arm64/arm64/machdep.c
>   head/sys/arm64/cloudabi32/cloudabi32_sysvec.c
>   head/sys/arm64/cloudabi64/cloudabi64_sysvec.c
>   head/sys/arm64/linux/linux_sysvec.c
>

This maybe breaks buildkernel on arm64:

--- all_subdir_linux64 ---
/usr/src/sys/arm64/linux/linux_sysvec.c:235:8: error: incompatible integer
to pointer conversion assigning to 'uintptr_t *' (aka 'unsigned long *')
from 'uintptr_t' (aka 'unsigned long') [-Werror,-Wint-conversion]
destp = (uintptr_t)arginfo;
  ^ ~~
/usr/src/sys/arm64/linux/linux_sysvec.c:239:11: error: invalid operands to
binary expression ('uintptr_t *' (aka 'unsigned long *') and 'unsigned
long')
destp = rounddown2(destp, sizeof(void *));
^
/usr/src/sys/sys/param.h:301:30: note: expanded from macro 'rounddown2'
--- all_subdir_mac_test ---
--- mac_test.o ---
--- all_subdir_linux64 ---
#define rounddown2(x, y) ((x)&(~((y)-1)))  /* if y is power of two
*/
  ~~~^~~
/usr/src/sys/arm64/linux/linux_sysvec.c:240:19: error: incompatible pointer
to integer conversion assigning to 'unsigned long' from 'uintptr_t *' (aka
'unsigned long *'); dereference with * [-Werror,-Wint-conversion]
imgp->execpathp = destp;
^ ~
  *
/usr/src/sys/arm64/linux/linux_sysvec.c:249:15: error: incompatible pointer
to integer conversion assigning to 'unsigned long' from 'uintptr_t *' (aka
'unsigned long *'); dereference with * [-Werror,-Wint-conversion]
imgp->canary = destp;
 ^ ~
   *
/usr/src/sys/arm64/linux/linux_sysvec.c:256:10: error: invalid operands to
binary expression ('uintptr_t *' (aka 'unsigned long *') and 'unsigned
long')
destp = rounddown2(destp, sizeof(void *));
^
/usr/src/sys/sys/param.h:301:30: note: expanded from macro 'rounddown2'
#define rounddown2(x, y) ((x)&(~((y)-1)))  /* if y is power of two
*/
  ~~~^~~
--- all_subdir_mac_test ---
cc -target aarch64-unknown-freebsd13.0
--sysroot=/usr/obj/usr/src/arm64.aarch64/tmp
-B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin  -O2 -pipe
 -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -DKLD_TIED -nostdinc
-DHAVE_KERNEL_OPTION_HEADERS -include
/usr/obj/usr/src/arm64.aarch64/sys/GENERIC/opt_global.h -I. -I/usr/src/sys
-I/usr/src/sys/contrib/ck/include -fno-common -g -fPIC
-fdebug-prefix-map=./machine=/usr/src/sys/arm64/include
-I/usr/obj/usr/src/arm64.aarch64/sys/GENERIC -MD  -MF.depend.mac_test.o
-MTmac_test.o -mgeneral-regs-only -ffixed-x18 -ffreestanding -fwrapv
-fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual
-Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__
-Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas
-Wno-error-tautological-compare -Wno-error-empty-body
-Wno-error-parentheses-equality -Wno-error-unused-function
-Wno-error-pointer-sign -Wno-error-shift-negative-value
-Wno-address-of-packed-member -Wno-format-zero-length -std=iso9899:1999
-c /usr/src/sys/security/mac_test/mac_test.c -o mac_test.o
--- all_subdir_linux64 ---
/usr/src/sys/arm64/linux/linux_sysvec.c:260:50: error: incompatible pointer
types passing 'uintptr_t **' (aka 'unsigned long **') to parameter of type
'uintptr_t *' (aka 'unsigned long *'); remove &
[-Werror,-Wincompatible-pointer-types]
error = imgp->sysent->sv_copyout_auxargs(imgp, );
 

svn commit: r355376 - head/secure/caroot/trusted

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Wed Dec  4 02:59:50 2019
New Revision: 355376
URL: https://svnweb.freebsd.org/changeset/base/355376

Log:
  caroot update to latest tip: one (1) addition, none (0) removed
  
  Added:
  - Entrust Root Certification Authority - G4

Added:
  head/secure/caroot/trusted/Entrust_Root_Certification_Authority_-_G4.pem   
(contents, props changed)

Added: head/secure/caroot/trusted/Entrust_Root_Certification_Authority_-_G4.pem
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/secure/caroot/trusted/Entrust_Root_Certification_Authority_-_G4.pem
Wed Dec  4 02:59:50 2019(r355376)
@@ -0,0 +1,137 @@
+##
+##  Entrust Root Certification Authority - G4
+##
+##  This is a single X.509 certificate for a public Certificate
+##  Authority (CA). It was automatically extracted from Mozilla's
+##  root CA list (the file `certdata.txt' in security/nss).
+##
+##  Extracted from nss
+##  with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 
01:27:50Z kevans $
+##
+##  @generated
+##
+Certificate:
+Data:
+Version: 3 (0x2)
+Serial Number:
+d9:b5:43:7f:af:a9:39:0f:00:00:00:00:55:65:ad:58
+Signature Algorithm: sha256WithRSAEncryption
+Issuer: C = US, O = "Entrust, Inc.", OU = See 
www.entrust.net/legal-terms, OU = "(c) 2015 Entrust, Inc. - for authorized use 
only", CN = Entrust Root Certification Authority - G4
+Validity
+Not Before: May 27 11:11:16 2015 GMT
+Not After : Dec 27 11:41:16 2037 GMT
+Subject: C = US, O = "Entrust, Inc.", OU = See 
www.entrust.net/legal-terms, OU = "(c) 2015 Entrust, Inc. - for authorized use 
only", CN = Entrust Root Certification Authority - G4
+Subject Public Key Info:
+Public Key Algorithm: rsaEncryption
+RSA Public-Key: (4096 bit)
+Modulus:
+00:b1:ec:2c:42:ee:e2:d1:30:ff:a5:92:47:e2:2d:
+c3:ba:64:97:6d:ca:f7:0d:b5:59:c1:b3:cb:a8:68:
+19:d8:af:84:6d:30:70:5d:7e:f3:2e:d2:53:99:e1:
+fe:1f:5e:d9:48:af:5d:13:8d:db:ff:63:33:4d:d3:
+00:02:bc:c4:f8:d1:06:08:94:79:58:8a:15:de:29:
+b3:fd:fd:c4:4f:e8:aa:e2:a0:3b:79:cd:bf:6b:43:
+32:dd:d9:74:10:b9:f7:f4:68:d4:bb:d0:87:d5:aa:
+4b:8a:2a:6f:2a:04:b5:b2:a6:c7:a0:7a:e6:48:ab:
+d2:d1:59:cc:d6:7e:23:e6:97:6c:f0:42:e5:dc:51:
+4b:15:41:ed:49:4a:c9:de:10:97:d6:76:c1:ef:a5:
+b5:36:14:97:35:d8:78:22:35:52:ef:43:bd:db:27:
+db:61:56:82:34:dc:cb:88:60:0c:0b:5a:e5:2c:01:
+c6:54:af:d7:aa:c1:10:7b:d2:05:5a:b8:40:9e:86:
+a7:c3:90:86:02:56:52:09:7a:9c:d2:27:82:53:4a:
+65:52:6a:f5:3c:e7:a8:f2:9c:af:8b:bd:d3:0e:d4:
+d4:5e:6e:87:9e:6a:3d:45:1d:d1:5d:1b:f4:e9:0a:
+ac:60:99:fb:89:b4:ff:98:2c:cf:7c:1d:e9:02:aa:
+04:9a:1e:b8:dc:88:6e:25:b3:6c:66:f7:3c:90:f3:
+57:c1:b3:2f:f5:6d:f2:fb:ca:a1:f8:29:9d:46:8b:
+b3:6a:f6:e6:67:07:be:2c:67:0a:2a:1f:5a:b2:3e:
+57:c4:d3:21:21:63:65:52:91:1b:b1:99:8e:79:7e:
+e6:eb:8d:00:d9:5a:aa:ea:73:e8:a4:82:02:47:96:
+fe:5b:8e:54:61:a3:eb:2f:4b:30:b0:8b:23:75:72:
+7c:21:3c:c8:f6:f1:74:d4:1c:7b:a3:05:55:ee:bb:
+4d:3b:32:be:9a:77:66:9e:ac:69:90:22:07:1f:61:
+3a:96:be:e5:9a:4f:cc:05:3c:28:59:d3:c1:0c:54:
+a8:59:61:bd:c8:72:4c:e8:dc:9f:87:7f:bd:9c:48:
+36:5e:95:a3:0e:b9:38:24:55:fc:75:66:eb:02:e3:
+08:34:29:4a:c6:e3:2b:2f:33:a0:da:a3:86:a5:12:
+97:fd:80:2b:da:14:42:e3:92:bd:3e:f2:5d:5e:67:
+74:2e:1c:88:47:29:34:5f:e2:32:a8:9c:25:37:8c:
+ba:98:00:97:8b:49:96:1e:fd:25:8a:ac:dc:da:d8:
+5d:74:6e:66:b0:ff:44:df:a1:18:c6:be:48:2f:37:
+94:78:f8:95:4a:3f:7f:13:5e:5d:59:fd:74:86:43:
+63:73:49
+Exponent: 65537 (0x10001)
+X509v3 extensions:
+X509v3 Basic Constraints: critical
+CA:TRUE
+X509v3 Key Usage: critical
+Certificate Sign, CRL Sign
+X509v3 Subject Key Identifier: 
+9F:38:C4:56:23:C3:39:E8:A0:71:6C:E8:54:4C:E4:E8:3A:B1:BF:67
+Signature Algorithm: sha256WithRSAEncryption
+ 12:e5:42:a6:7b:8b:0f:0c:e4:46:a5:b6:60:40:87:8c:25:7e:
+ ad:b8:68:2e:5b:c6:40:76:3c:03:f8:c9:59:f4:f3:ab:62:ce:
+ 10:8d:b4:5a:64:8c:68:c0:b0:72:43:34:d2:1b:0b:f6:2c:53:
+ d2:ca:90:4b:86:66:fc:aa:83:22:f4:8b:1a:6f:26:48:ac:76:
+ 

svn commit: r355375 - head/sys/x86/x86

2019-12-03 Thread Conrad Meyer
Author: cem
Date: Wed Dec  4 02:42:22 2019
New Revision: 355375
URL: https://svnweb.freebsd.org/changeset/base/355375

Log:
  x86: Add missed break to TAA status sysctl
  
  Just a typo that Coverity identified.
  
  Coverity also identified an unused store in the same functional area (x86 TAA
  stuff), but this commit does not address that issue (CID 1408334).
  
  Reported by:  Coverity
  CID:  1408328, 1408332

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

Modified: head/sys/x86/x86/cpu_machdep.c
==
--- head/sys/x86/x86/cpu_machdep.c  Tue Dec  3 23:20:19 2019
(r355374)
+++ head/sys/x86/x86/cpu_machdep.c  Wed Dec  4 02:42:22 2019
(r355375)
@@ -1332,6 +1332,7 @@ sysctl_taa_state_handler(SYSCTL_HANDLER_ARGS)
break;
case TAA_NOT_PRESENT:
state = "TSX not present";
+   break;
default:
state = "unknown";
}
___
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: r355374 - head/sys/sparc64/sparc64

2019-12-03 Thread John Baldwin
On 12/3/19 3:20 PM, John Baldwin wrote:
> Author: jhb
> Date: Tue Dec  3 23:20:19 2019
> New Revision: 355374
> URL: https://svnweb.freebsd.org/changeset/base/355374
> 
> Log:
>   Pass 0 to __builtin_frame_address() to appease modern GCC.
>   
>   Modern versions of GCC warn about passing non-zero values to
>   __builtin_frame_address().  Passing 1 is a cosmetic change to remove
>   the db_trace_self() frame from the printed stack trace.
>   
>   Reported by:marius, imp

Should be 'Reviewed by'

>   Differential Revision:  https://reviews.freebsd.org/D22600

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


svn commit: r355374 - head/sys/sparc64/sparc64

2019-12-03 Thread John Baldwin
Author: jhb
Date: Tue Dec  3 23:20:19 2019
New Revision: 355374
URL: https://svnweb.freebsd.org/changeset/base/355374

Log:
  Pass 0 to __builtin_frame_address() to appease modern GCC.
  
  Modern versions of GCC warn about passing non-zero values to
  __builtin_frame_address().  Passing 1 is a cosmetic change to remove
  the db_trace_self() frame from the printed stack trace.
  
  Reported by:  marius, imp
  Differential Revision:https://reviews.freebsd.org/D22600

Modified:
  head/sys/sparc64/sparc64/db_trace.c

Modified: head/sys/sparc64/sparc64/db_trace.c
==
--- head/sys/sparc64/sparc64/db_trace.c Tue Dec  3 23:17:54 2019
(r355373)
+++ head/sys/sparc64/sparc64/db_trace.c Tue Dec  3 23:20:19 2019
(r355374)
@@ -279,7 +279,7 @@ db_trace_self(void)
 {
 
db_backtrace(curthread,
-   (struct frame *)__builtin_frame_address(1), -1);
+   (struct frame *)__builtin_frame_address(0), -1);
 }
 
 int
___
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: r355373 - in head/sys: amd64/amd64 amd64/cloudabi32 amd64/cloudabi64 amd64/ia32 amd64/linux amd64/linux32 arm/arm arm/cloudabi32 arm64/arm64 arm64/cloudabi32 arm64/cloudabi64 arm64/linu...

2019-12-03 Thread John Baldwin
Author: jhb
Date: Tue Dec  3 23:17:54 2019
New Revision: 355373
URL: https://svnweb.freebsd.org/changeset/base/355373

Log:
  Use uintptr_t instead of register_t * for the stack base.
  
  - Use ustringp for the location of the argv and environment strings
and allow destp to travel further down the stack for the stackgap
and auxv regions.
  - Update the Linux copyout_strings variants to move destp down the
stack as was done for the native ABIs in r263349.
  - Stop allocating a space for a stack gap in the Linux ABIs.  This
used to hold translated system call arguments, but hasn't been used
since r159992.
  
  Reviewed by:  kib
  Tested on:md64 (amd64, i386, linux64), i386 (i386, linux)
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D22501

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/cloudabi32/cloudabi32_sysvec.c
  head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
  head/sys/amd64/ia32/ia32_signal.c
  head/sys/amd64/linux/linux_sysvec.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/arm/arm/machdep.c
  head/sys/arm/cloudabi32/cloudabi32_sysvec.c
  head/sys/arm64/arm64/elf32_machdep.c
  head/sys/arm64/arm64/machdep.c
  head/sys/arm64/cloudabi32/cloudabi32_sysvec.c
  head/sys/arm64/cloudabi64/cloudabi64_sysvec.c
  head/sys/arm64/linux/linux_sysvec.c
  head/sys/compat/cloudabi32/cloudabi32_module.c
  head/sys/compat/cloudabi32/cloudabi32_util.h
  head/sys/compat/cloudabi64/cloudabi64_module.c
  head/sys/compat/cloudabi64/cloudabi64_util.h
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/freebsd32_util.h
  head/sys/compat/ia32/ia32_signal.h
  head/sys/i386/cloudabi32/cloudabi32_sysvec.c
  head/sys/i386/i386/machdep.c
  head/sys/i386/linux/linux_sysvec.c
  head/sys/kern/imgact_aout.c
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_exec.c
  head/sys/mips/mips/freebsd32_machdep.c
  head/sys/mips/mips/pm_machdep.c
  head/sys/powerpc/include/reg.h
  head/sys/powerpc/powerpc/elf64_machdep.c
  head/sys/powerpc/powerpc/exec_machdep.c
  head/sys/riscv/riscv/machdep.c
  head/sys/sparc64/sparc64/machdep.c
  head/sys/sys/imgact.h
  head/sys/sys/imgact_elf.h
  head/sys/sys/sysent.h

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Tue Dec  3 23:11:40 2019
(r355372)
+++ head/sys/amd64/amd64/machdep.c  Tue Dec  3 23:17:54 2019
(r355373)
@@ -577,7 +577,7 @@ freebsd4_sigreturn(struct thread *td, struct freebsd4_
  * Reset registers to default values on exec.
  */
 void
-exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
+exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack)
 {
struct trapframe *regs;
struct pcb *pcb;

Modified: head/sys/amd64/cloudabi32/cloudabi32_sysvec.c
==
--- head/sys/amd64/cloudabi32/cloudabi32_sysvec.c   Tue Dec  3 23:11:40 
2019(r355372)
+++ head/sys/amd64/cloudabi32/cloudabi32_sysvec.c   Tue Dec  3 23:17:54 
2019(r355373)
@@ -53,7 +53,7 @@ extern struct sysent cloudabi32_sysent[];
 extern unsigned long ia32_maxssiz;
 
 static int
-cloudabi32_fixup_tcb(register_t **stack_base, struct image_params *imgp)
+cloudabi32_fixup_tcb(uintptr_t *stack_base, struct image_params *imgp)
 {
int error;
uint32_t args[2];
@@ -73,16 +73,16 @@ cloudabi32_fixup_tcb(register_t **stack_base, struct i
 * refer to the auxiliary vector, which is stored right after
 * the TCB.
 */
-   args[0] = (uintptr_t)*stack_base;
-   args[1] = (uintptr_t)*stack_base +
+   args[0] = *stack_base;
+   args[1] = *stack_base +
roundup(sizeof(cloudabi32_tcb_t), sizeof(register_t));
-   *stack_base -= howmany(sizeof(args), sizeof(register_t));
-   return (copyout(args, *stack_base, sizeof(args)));
+   *stack_base -= roundup2(sizeof(args), sizeof(register_t));
+   return (copyout(args, (void *)*stack_base, sizeof(args)));
 }
 
 static void
 cloudabi32_proc_setregs(struct thread *td, struct image_params *imgp,
-unsigned long stack)
+uintptr_t stack)
 {
 
ia32_setregs(td, imgp, stack);

Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
==
--- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c   Tue Dec  3 23:11:40 
2019(r355372)
+++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c   Tue Dec  3 23:17:54 
2019(r355373)
@@ -48,7 +48,7 @@ extern const char *cloudabi64_syscallnames[];
 extern struct sysent cloudabi64_sysent[];
 
 static int
-cloudabi64_fixup_tcb(register_t **stack_base, struct image_params *imgp)
+cloudabi64_fixup_tcb(uintptr_t *stack_base, struct image_params *imgp)
 {
int error;
register_t tcbptr;
@@ -64,12 +64,13 @@ 

svn commit: r355372 - stable/12/sys/compat/linux

2019-12-03 Thread Vladimir Kondratyev
Author: wulf
Date: Tue Dec  3 23:11:40 2019
New Revision: 355372
URL: https://svnweb.freebsd.org/changeset/base/355372

Log:
  MFC r355065 - r355068: Linux epoll improvements.
  
  r355065:
  Linux epoll: Don't deregister file descriptor after EPOLLONESHOT is fired
  
  Linux epoll does not remove descriptor after one-shot event has been 
triggered.
  Set EV_DISPATCH kqueue flag rather then EV_ONESHOT to get the same behavior.
  
  Required by Linux Steam client.
  
  PR:   240590
  Reported by:  Alex S 
  Reviewed by:  emaste, imp
  Differential Revision:https://reviews.freebsd.org/D22513
  
  r355066:
  Linux epoll: Check both read and write kqueue events existence in 
EPOLL_CTL_ADD
  
  Linux epoll EPOLL_CTL_ADD op handler should always check registration
  of both EVFILT_READ and EVFILT_WRITE kevents to deceide if supplied
  file descriptor fd is already registered with epoll instance.
  
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D22515
  
  r355067:
  Linux epoll: Register events with zero event mask
  
  Such an events are legal and should be interpreted as EPOLLERR | EPOLLHUP.
  Register a disabled kqueue event in that case as we do not support EPOLLHUP 
yet.
  
  Required by Linux Steam client.
  
  PR:   240590
  Reported by:  Alex S 
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D22516
  
  r355068:
  Linux epoll: Allow passing of any negative timeout value to epoll_wait
  
  Linux epoll allow passing of any negative timeout value to epoll_wait()
  to cause unbound blocking
  
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D22517

Modified:
  stable/12/sys/compat/linux/linux_event.c
  stable/12/sys/compat/linux/linux_event.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linux/linux_event.c
==
--- stable/12/sys/compat/linux/linux_event.cTue Dec  3 23:07:09 2019
(r355371)
+++ stable/12/sys/compat/linux/linux_event.cTue Dec  3 23:11:40 2019
(r355372)
@@ -98,14 +98,16 @@ __attribute__((packed))
 #defineLINUX_MAX_EVENTS(INT_MAX / sizeof(struct epoll_event))
 
 static voidepoll_fd_install(struct thread *td, int fd, epoll_udata_t 
udata);
-static int epoll_to_kevent(struct thread *td, struct file *epfp,
-   int fd, struct epoll_event *l_event, int *kev_flags,
-   struct kevent *kevent, int *nkevents);
+static int epoll_to_kevent(struct thread *td, int fd,
+   struct epoll_event *l_event, struct kevent *kevent,
+   int *nkevents);
 static voidkevent_to_epoll(struct kevent *kevent, struct epoll_event 
*l_event);
 static int epoll_kev_copyout(void *arg, struct kevent *kevp, int count);
 static int epoll_kev_copyin(void *arg, struct kevent *kevp, int count);
-static int epoll_delete_event(struct thread *td, struct file *epfp,
-   int fd, int filter);
+static int epoll_register_kevent(struct thread *td, struct file *epfp,
+   int fd, int filter, unsigned int flags);
+static int epoll_fd_registered(struct thread *td, struct file *epfp,
+   int fd);
 static int epoll_delete_all_events(struct thread *td, struct file *epfp,
int fd);
 
@@ -296,33 +298,38 @@ linux_epoll_create1(struct thread *td, struct linux_ep
 
 /* Structure converting function from epoll to kevent. */
 static int
-epoll_to_kevent(struct thread *td, struct file *epfp,
-int fd, struct epoll_event *l_event, int *kev_flags,
+epoll_to_kevent(struct thread *td, int fd, struct epoll_event *l_event,
 struct kevent *kevent, int *nkevents)
 {
uint32_t levents = l_event->events;
struct linux_pemuldata *pem;
struct proc *p;
+   unsigned short kev_flags = EV_ADD | EV_ENABLE;
 
/* flags related to how event is registered */
if ((levents & LINUX_EPOLLONESHOT) != 0)
-   *kev_flags |= EV_ONESHOT;
+   kev_flags |= EV_DISPATCH;
if ((levents & LINUX_EPOLLET) != 0)
-   *kev_flags |= EV_CLEAR;
+   kev_flags |= EV_CLEAR;
if ((levents & LINUX_EPOLLERR) != 0)
-   *kev_flags |= EV_ERROR;
+   kev_flags |= EV_ERROR;
if ((levents & LINUX_EPOLLRDHUP) != 0)
-   *kev_flags |= EV_EOF;
+   kev_flags |= EV_EOF;
 
/* flags related to what event is registered */
if ((levents & LINUX_EPOLL_EVRD) != 0) {
-   EV_SET(kevent++, fd, EVFILT_READ, *kev_flags, 0, 0, 0);
+   EV_SET(kevent++, fd, EVFILT_READ, kev_flags, 0, 0, 0);
++(*nkevents);
}
if ((levents & LINUX_EPOLL_EVWR) != 0) {
-   EV_SET(kevent++, fd, EVFILT_WRITE, *kev_flags, 0, 0, 0);
+   EV_SET(kevent++, fd, 

svn commit: r355371 - in head/sys: kern sys ufs/ffs

2019-12-03 Thread Kirk McKusick
Author: mckusick
Date: Tue Dec  3 23:07:09 2019
New Revision: 355371
URL: https://svnweb.freebsd.org/changeset/base/355371

Log:
  Currently the breadn_flags() and getblkx() interfaces are passed
  the vnode, logical block number, and size of data block that is
  being requested. They then use the VOP_BMAP function to calculate
  the mapping from logical block number to physical block number from
  which to access the data. This change expands the interface to also
  pass the physical block number in cases where the VOP_MAP function
  may no longer work, for example when a file is being truncated.
  
  No functional change.
  
  Reviewed by:  kib
  Tested by:Peter Holm
  Sponsored by: Netflix

Modified:
  head/sys/kern/vfs_bio.c
  head/sys/kern/vfs_cluster.c
  head/sys/sys/buf.h
  head/sys/ufs/ffs/ffs_alloc.c
  head/sys/ufs/ffs/ffs_inode.c
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ffs/ffs_vnops.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Tue Dec  3 22:59:55 2019(r355370)
+++ head/sys/kern/vfs_bio.c Tue Dec  3 23:07:09 2019(r355371)
@@ -2126,10 +2126,17 @@ breada(struct vnode * vp, daddr_t * rablkno, int * rab
  * getblk(). Also starts asynchronous I/O on read-ahead blocks.
  *
  * Always return a NULL buffer pointer (in bpp) when returning an error.
+ *
+ * The blkno parameter is the logical block being requested. Normally
+ * the mapping of logical block number to disk block address is done
+ * by calling VOP_BMAP(). However, if the mapping is already known, the
+ * disk block address can be passed using the dblkno parameter. If the
+ * disk block address is not known, then the same value should be passed
+ * for blkno and dblkno.
  */
 int
-breadn_flags(struct vnode *vp, daddr_t blkno, int size, daddr_t *rablkno,
-int *rabsize, int cnt, struct ucred *cred, int flags,
+breadn_flags(struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size,
+daddr_t *rablkno, int *rabsize, int cnt, struct ucred *cred, int flags,
 void (*ckhashfunc)(struct buf *), struct buf **bpp)
 {
struct buf *bp;
@@ -2142,11 +2149,14 @@ breadn_flags(struct vnode *vp, daddr_t blkno, int size
 * Can only return NULL if GB_LOCK_NOWAIT or GB_SPARSE flags
 * are specified.
 */
-   error = getblkx(vp, blkno, size, 0, 0, flags, );
+   error = getblkx(vp, blkno, dblkno, size, 0, 0, flags, );
if (error != 0) {
*bpp = NULL;
return (error);
}
+   KASSERT(blkno == bp->b_lblkno,
+   ("getblkx returned buffer for blkno %jd instead of blkno %jd",
+   (intmax_t)bp->b_lblkno, (intmax_t)blkno));
flags &= ~GB_NOSPARSE;
*bpp = bp;
 
@@ -3791,7 +3801,7 @@ getblk(struct vnode *vp, daddr_t blkno, int size, int 
struct buf *bp;
int error;
 
-   error = getblkx(vp, blkno, size, slpflag, slptimeo, flags, );
+   error = getblkx(vp, blkno, blkno, size, slpflag, slptimeo, flags, );
if (error != 0)
return (NULL);
return (bp);
@@ -3819,7 +3829,7 @@ getblk(struct vnode *vp, daddr_t blkno, int size, int 
  * case it is returned with B_INVAL clear and B_CACHE set based on the
  * backing VM.
  *
- * getblk() also forces a bwrite() for any B_DELWRI buffer whos
+ * getblk() also forces a bwrite() for any B_DELWRI buffer whose
  * B_CACHE bit is clear.
  * 
  * What this means, basically, is that the caller should use B_CACHE to
@@ -3832,10 +3842,17 @@ getblk(struct vnode *vp, daddr_t blkno, int size, int 
  * a write attempt or if it was a successful read.  If the caller 
  * intends to issue a READ, the caller must clear B_INVAL and BIO_ERROR
  * prior to issuing the READ.  biodone() will *not* clear B_INVAL.
+ *
+ * The blkno parameter is the logical block being requested. Normally
+ * the mapping of logical block number to disk block address is done
+ * by calling VOP_BMAP(). However, if the mapping is already known, the
+ * disk block address can be passed using the dblkno parameter. If the
+ * disk block address is not known, then the same value should be passed
+ * for blkno and dblkno.
  */
 int
-getblkx(struct vnode *vp, daddr_t blkno, int size, int slpflag, int slptimeo,
-int flags, struct buf **bpp)
+getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size, int slpflag,
+int slptimeo, int flags, struct buf **bpp)
 {
struct buf *bp;
struct bufobj *bo;
@@ -3854,7 +3871,7 @@ getblkx(struct vnode *vp, daddr_t blkno, int size, int
flags &= ~(GB_UNMAPPED | GB_KVAALLOC);
 
bo = >v_bufobj;
-   d_blkno = blkno;
+   d_blkno = dblkno;
 loop:
BO_RLOCK(bo);
bp = gbincore(bo, blkno);

Modified: head/sys/kern/vfs_cluster.c
==
--- 

svn commit: r355370 - stable/11/usr.bin/tip/tip

2019-12-03 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Dec  3 22:59:55 2019
New Revision: 355370
URL: https://svnweb.freebsd.org/changeset/base/355370

Log:
  MFC r354624
  
  tip/cu: check for EOF on input on the local side
  
  If cu reads an EOF on the input side, it goes into a tight loop
  sending a garbage byte to the remote.  With this change, it exits
  gracefully, along with its child.
  
  Sponsored by: Dell EMC Isilon

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

Modified: stable/11/usr.bin/tip/tip/tip.c
==
--- stable/11/usr.bin/tip/tip/tip.c Tue Dec  3 22:57:10 2019
(r355369)
+++ stable/11/usr.bin/tip/tip/tip.c Tue Dec  3 22:59:55 2019
(r355370)
@@ -250,7 +250,6 @@ cucommon:
tipin();
else
tipout();
-   /*NOTREACHED*/
exit(0);
 }
 
@@ -400,11 +399,16 @@ tipin(void)
}
 
while (1) {
-   gch = getchar()_PAR;
-   /* XXX does not check for EOF */
+   gch = getchar();
+   if (gch == EOF)
+   return;
+   gch = gch & STRIP_PAR;
if ((gch == character(value(ESCAPE))) && bol) {
if (!noesc) {
-   if (!(gch = escape()))
+   gch = escape();
+   if (gch == EOF)
+   return;
+   if (gch == 0)
continue;
}
} else if (!cumode && gch == character(value(RAISECHAR))) {
@@ -418,7 +422,10 @@ tipin(void)
printf("\r\n");
continue;
} else if (!cumode && gch == character(value(FORCE)))
-   gch = getchar()_PAR;
+   gch = getchar();
+   if (gch == EOF)
+   return;
+   gch = gch & STRIP_PAR;
bol = any(gch, value(EOL));
if (boolean(value(RAISE)) && islower(gch))
gch = toupper(gch);
@@ -442,8 +449,10 @@ escape(void)
esctable_t *p;
char c = character(value(ESCAPE));
 
-   gch = (getchar()_PAR);
-   /* XXX does not check for EOF */
+   gch = getchar();
+   if (gch == EOF)
+   return (EOF);
+   gch = gch & STRIP_PAR;
for (p = etable; p->e_char; p++)
if (p->e_char == gch) {
if ((p->e_flags) && uid)
___
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: r355369 - stable/12/usr.bin/tip/tip

2019-12-03 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Dec  3 22:57:10 2019
New Revision: 355369
URL: https://svnweb.freebsd.org/changeset/base/355369

Log:
  MFC r354624
  
  tip/cu: check for EOF on input on the local side
  
  If cu reads an EOF on the input side, it goes into a tight loop
  sending a garbage byte to the remote.  With this change, it exits
  gracefully, along with its child.
  
  Sponsored by: Dell EMC Isilon

Modified:
  stable/12/usr.bin/tip/tip/tip.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/tip/tip/tip.c
==
--- stable/12/usr.bin/tip/tip/tip.c Tue Dec  3 22:54:24 2019
(r355368)
+++ stable/12/usr.bin/tip/tip/tip.c Tue Dec  3 22:57:10 2019
(r355369)
@@ -252,7 +252,6 @@ cucommon:
tipin();
else
tipout();
-   /*NOTREACHED*/
exit(0);
 }
 
@@ -402,11 +401,16 @@ tipin(void)
}
 
while (1) {
-   gch = getchar()_PAR;
-   /* XXX does not check for EOF */
+   gch = getchar();
+   if (gch == EOF)
+   return;
+   gch = gch & STRIP_PAR;
if ((gch == character(value(ESCAPE))) && bol) {
if (!noesc) {
-   if (!(gch = escape()))
+   gch = escape();
+   if (gch == EOF)
+   return;
+   if (gch == 0)
continue;
}
} else if (!cumode && gch == character(value(RAISECHAR))) {
@@ -420,7 +424,10 @@ tipin(void)
printf("\r\n");
continue;
} else if (!cumode && gch == character(value(FORCE)))
-   gch = getchar()_PAR;
+   gch = getchar();
+   if (gch == EOF)
+   return;
+   gch = gch & STRIP_PAR;
bol = any(gch, value(EOL));
if (boolean(value(RAISE)) && islower(gch))
gch = toupper(gch);
@@ -444,8 +451,10 @@ escape(void)
esctable_t *p;
char c = character(value(ESCAPE));
 
-   gch = (getchar()_PAR);
-   /* XXX does not check for EOF */
+   gch = getchar();
+   if (gch == EOF)
+   return (EOF);
+   gch = gch & STRIP_PAR;
for (p = etable; p->e_char; p++)
if (p->e_char == gch) {
if ((p->e_flags) && uid)
___
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: r355368 - in stable/11/usr.sbin: rpc.lockd rpc.statd

2019-12-03 Thread Ravi Pokala
Author: rpokala
Date: Tue Dec  3 22:54:24 2019
New Revision: 355368
URL: https://svnweb.freebsd.org/changeset/base/355368

Log:
  MFC r355006:
  
  Add and document options to allow rpc.lockd and rpc.statd to run in the
  foreground.
  
  This allows a separate process to monitor when and how those programs exit.
  That process can then restart them if needed.

Modified:
  stable/11/usr.sbin/rpc.lockd/lockd.c
  stable/11/usr.sbin/rpc.lockd/rpc.lockd.8
  stable/11/usr.sbin/rpc.statd/rpc.statd.8
  stable/11/usr.sbin/rpc.statd/statd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/rpc.lockd/lockd.c
==
--- stable/11/usr.sbin/rpc.lockd/lockd.cTue Dec  3 22:54:08 2019
(r355367)
+++ stable/11/usr.sbin/rpc.lockd/lockd.cTue Dec  3 22:54:24 2019
(r355368)
@@ -118,6 +118,7 @@ main(int argc, char **argv)
char *endptr, **hosts_bak;
struct sigaction sigalarm;
int grace_period = 30;
+   int foreground = 0;
struct netconfig *nconf;
int have_v6 = 1;
int maxrec = RPC_MAXDATASIZE;
@@ -125,7 +126,7 @@ main(int argc, char **argv)
int attempt_cnt, port_len, port_pos, ret;
char **port_list;
 
-   while ((ch = getopt(argc, argv, "d:g:h:p:")) != (-1)) {
+   while ((ch = getopt(argc, argv, "d:Fg:h:p:")) != (-1)) {
switch (ch) {
case 'd':
debug_level = atoi(optarg);
@@ -134,6 +135,9 @@ main(int argc, char **argv)
/* NOTREACHED */
}
break;
+   case 'F':
+   foreground = 1;
+   break;
case 'g':
grace_period = atoi(optarg);
if (!grace_period) {
@@ -420,7 +424,7 @@ main(int argc, char **argv)
 * Note that it is NOT sensible to run this program from inetd - the
 * protocol assumes that it will run immediately at boot time.
 */
-   if (daemon(0, debug_level > 0)) {
+   if ((foreground == 0) && daemon(0, debug_level > 0)) {
err(1, "cannot fork");
/* NOTREACHED */
}
@@ -842,7 +846,7 @@ void
 usage()
 {
errx(1, "usage: rpc.lockd [-d ]"
-   " [-g ] [-h ] [-p ]");
+   " [-F] [-g ] [-h ] [-p ]");
 }
 
 /*

Modified: stable/11/usr.sbin/rpc.lockd/rpc.lockd.8
==
--- stable/11/usr.sbin/rpc.lockd/rpc.lockd.8Tue Dec  3 22:54:08 2019
(r355367)
+++ stable/11/usr.sbin/rpc.lockd/rpc.lockd.8Tue Dec  3 22:54:24 2019
(r355368)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 2, 2007
+.Dd November 21, 2019
 .Dt RPC.LOCKD 8
 .Os
 .Sh NAME
@@ -38,6 +38,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl d Ar debug_level
+.Op Fl F
 .Op Fl g Ar grace period
 .Op Fl h Ar bindip
 .Op Fl p Ar port
@@ -70,6 +71,17 @@ in the generation of one log line per protocol operati
 Higher
 debug levels can be specified, causing display of operation arguments
 and internal operations of the daemon.
+.It Fl F
+Run
+.Nm
+in the foreground, rather than going into daemon mode.
+This is useful if some other process uses
+.Xr fork 2
+and
+.Xr exec 3
+to run
+.Nm ,
+and wants to monitor when and how it exits.
 .It Fl g
 The
 .Fl g

Modified: stable/11/usr.sbin/rpc.statd/rpc.statd.8
==
--- stable/11/usr.sbin/rpc.statd/rpc.statd.8Tue Dec  3 22:54:08 2019
(r355367)
+++ stable/11/usr.sbin/rpc.statd/rpc.statd.8Tue Dec  3 22:54:24 2019
(r355368)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 1, 2007
+.Dd November 21, 2019
 .Dt RPC.STATD 8
 .Os
 .Sh NAME
@@ -38,6 +38,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl d
+.Op Fl F
 .Op Fl h Ar bindip
 .Op Fl p Ar port
 .Sh DESCRIPTION
@@ -71,6 +72,17 @@ These messages are logged with level
 LOG_DEBUG and facility LOG_DAEMON.
 Error conditions are logged irrespective
 of this option, using level LOG_ERR.
+.It Fl F
+Run
+.Nm
+in the foreground, rather than going into daemon mode.
+This is useful if some other process uses
+.Xr fork 2
+and
+.Xr exec 3
+to run
+.Nm ,
+and wants to monitor when and how it exits.
 .It Fl h Ar bindip
 Specify specific IP addresses to bind to.
 This option may be specified multiple times.

Modified: stable/11/usr.sbin/rpc.statd/statd.c
==
--- stable/11/usr.sbin/rpc.statd/statd.cTue Dec  3 22:54:08 2019
(r355367)
+++ stable/11/usr.sbin/rpc.statd/statd.cTue Dec  3 22:54:24 2019
(r355368)
@@ -86,15 +86,19 @@ main(int argc, char **argv)
   int ch, i, s;
   char *endptr, **hosts_bak;
   int have_v6 = 1;
+  int foreground = 0;
   int maxrec = RPC_MAXDATASIZE;
   int attempt_cnt, 

svn commit: r355366 - in stable/11: share/man/man4 sys/dev/imcsmb sys/dev/jedec_dimm

2019-12-03 Thread Ravi Pokala
Author: rpokala
Date: Tue Dec  3 22:53:50 2019
New Revision: 355366
URL: https://svnweb.freebsd.org/changeset/base/355366

Log:
  MFC r343583:
  
  Remove unecessary "All rights reserved" from files under my or Panasas's
  copyright.
  
  When all member nations of the Buenos Aires Convention adopted the Berne
  Convention, the phrase "All rights reserved" became unnecessary to assert
  copyright. Remove it from files under my or Panasas's copyright. The files
  related to jedec_dimm(4) also bear avg@'s copyright; he has approved this
  change.

Modified:
  stable/11/share/man/man4/imcsmb.4
  stable/11/share/man/man4/jedec_dimm.4
  stable/11/sys/dev/imcsmb/imcsmb.c
  stable/11/sys/dev/imcsmb/imcsmb_pci.c
  stable/11/sys/dev/imcsmb/imcsmb_reg.h
  stable/11/sys/dev/imcsmb/imcsmb_var.h
  stable/11/sys/dev/jedec_dimm/jedec_dimm.c
  stable/11/sys/dev/jedec_dimm/jedec_dimm.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/imcsmb.4
==
--- stable/11/share/man/man4/imcsmb.4   Tue Dec  3 22:53:22 2019
(r355365)
+++ stable/11/share/man/man4/imcsmb.4   Tue Dec  3 22:53:50 2019
(r355366)
@@ -2,7 +2,6 @@
 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
 .\"
 .\" Copyright (c) 2018 Panasas
-.\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: stable/11/share/man/man4/jedec_dimm.4
==
--- stable/11/share/man/man4/jedec_dimm.4   Tue Dec  3 22:53:22 2019
(r355365)
+++ stable/11/share/man/man4/jedec_dimm.4   Tue Dec  3 22:53:50 2019
(r355366)
@@ -3,7 +3,6 @@
 .\"
 .\" Copyright (c) 2016 Andriy Gapon 
 .\" Copyright (c) 2018 Ravi Pokala 
-.\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: stable/11/sys/dev/imcsmb/imcsmb.c
==
--- stable/11/sys/dev/imcsmb/imcsmb.c   Tue Dec  3 22:53:22 2019
(r355365)
+++ stable/11/sys/dev/imcsmb/imcsmb.c   Tue Dec  3 22:53:50 2019
(r355366)
@@ -4,7 +4,6 @@
  * Authors: Joe Kloss; Ravi Pokala (rpok...@freebsd.org)
  *
  * Copyright (c) 2017-2018 Panasas
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: stable/11/sys/dev/imcsmb/imcsmb_pci.c
==
--- stable/11/sys/dev/imcsmb/imcsmb_pci.c   Tue Dec  3 22:53:22 2019
(r355365)
+++ stable/11/sys/dev/imcsmb/imcsmb_pci.c   Tue Dec  3 22:53:50 2019
(r355366)
@@ -4,7 +4,6 @@
  * Authors: Joe Kloss; Ravi Pokala (rpok...@freebsd.org)
  *
  * Copyright (c) 2017-2018 Panasas
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: stable/11/sys/dev/imcsmb/imcsmb_reg.h
==
--- stable/11/sys/dev/imcsmb/imcsmb_reg.h   Tue Dec  3 22:53:22 2019
(r355365)
+++ stable/11/sys/dev/imcsmb/imcsmb_reg.h   Tue Dec  3 22:53:50 2019
(r355366)
@@ -4,7 +4,6 @@
  * Authors: Joe Kloss; Ravi Pokala (rpok...@freebsd.org)
  *
  * Copyright (c) 2017-2018 Panasas
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: stable/11/sys/dev/imcsmb/imcsmb_var.h
==
--- stable/11/sys/dev/imcsmb/imcsmb_var.h   Tue Dec  3 22:53:22 2019
(r355365)
+++ stable/11/sys/dev/imcsmb/imcsmb_var.h   Tue Dec  3 22:53:50 2019
(r355366)
@@ -4,7 +4,6 @@
  * Authors: Joe Kloss; Ravi Pokala (rpok...@freebsd.org)
  *
  * Copyright (c) 2017-2018 Panasas
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: stable/11/sys/dev/jedec_dimm/jedec_dimm.c
==
--- stable/11/sys/dev/jedec_dimm/jedec_dimm.c   Tue Dec  3 22:53:22 2019
(r355365)
+++ stable/11/sys/dev/jedec_dimm/jedec_dimm.c   Tue Dec  3 22:53:50 2019
(r355366)
@@ -5,7 +5,6 @@
  *
  * Copyright (c) 2016 Andriy Gapon 
  * Copyright (c) 2018 Panasas
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the 

svn commit: r355367 - stable/11/stand/libsa

2019-12-03 Thread Ravi Pokala
Author: rpokala
Date: Tue Dec  3 22:54:08 2019
New Revision: 355367
URL: https://svnweb.freebsd.org/changeset/base/355367

Log:
  MFC r354673:
  
  Logging improvements to loader::nfs
  
  Include the server IP address when logging nfs_open(), add a few missing
  "\n"s, and correct a typo.

Modified:
  stable/11/stand/libsa/nfs.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/libsa/nfs.c
==
--- stable/11/stand/libsa/nfs.c Tue Dec  3 22:53:50 2019(r355366)
+++ stable/11/stand/libsa/nfs.c Tue Dec  3 22:54:08 2019(r355367)
@@ -486,7 +486,8 @@ nfs_open(const char *upath, struct open_file *f)
 
 #ifdef NFS_DEBUG
if (debug)
-   printf("nfs_open: %s (rootpath=%s)\n", upath, rootpath);
+   printf("nfs_open: %s (rootip=%s rootpath=%s)\n", upath,
+   inet_ntoa(rootip), rootpath);
 #endif
if (!rootpath[0]) {
printf("no rootpath, no nfs\n");
@@ -691,14 +692,14 @@ nfs_read(struct open_file *f, void *buf, size_t size, 
if (cc == -1) {
 #ifdef NFS_DEBUG
if (debug)
-   printf("nfs_read: read: %s", strerror(errno));
+   printf("nfs_read: read: %s\n", strerror(errno));
 #endif
return (errno); /* XXX - from nfs_readdata */
}
if (cc == 0) {
 #ifdef NFS_DEBUG
if (debug)
-   printf("nfs_read: hit EOF unexpectantly");
+   printf("nfs_read: hit EOF unexpectedly\n");
 #endif
goto ret;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r355365 - in stable/12/usr.sbin: rpc.lockd rpc.statd

2019-12-03 Thread Ravi Pokala
Author: rpokala
Date: Tue Dec  3 22:53:22 2019
New Revision: 355365
URL: https://svnweb.freebsd.org/changeset/base/355365

Log:
  MFC r355006:
  
  Add and document options to allow rpc.lockd and rpc.statd to run in the
  foreground.
  
  This allows a separate process to monitor when and how those programs exit.
  That process can then restart them if needed.

Modified:
  stable/12/usr.sbin/rpc.lockd/lockd.c
  stable/12/usr.sbin/rpc.lockd/rpc.lockd.8
  stable/12/usr.sbin/rpc.statd/rpc.statd.8
  stable/12/usr.sbin/rpc.statd/statd.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/rpc.lockd/lockd.c
==
--- stable/12/usr.sbin/rpc.lockd/lockd.cTue Dec  3 22:53:07 2019
(r355364)
+++ stable/12/usr.sbin/rpc.lockd/lockd.cTue Dec  3 22:53:22 2019
(r355365)
@@ -120,6 +120,7 @@ main(int argc, char **argv)
char *endptr, **hosts_bak;
struct sigaction sigalarm;
int grace_period = 30;
+   int foreground = 0;
struct netconfig *nconf;
int have_v6 = 1;
int maxrec = RPC_MAXDATASIZE;
@@ -127,7 +128,7 @@ main(int argc, char **argv)
int attempt_cnt, port_len, port_pos, ret;
char **port_list;
 
-   while ((ch = getopt(argc, argv, "d:g:h:p:")) != (-1)) {
+   while ((ch = getopt(argc, argv, "d:Fg:h:p:")) != (-1)) {
switch (ch) {
case 'd':
debug_level = atoi(optarg);
@@ -136,6 +137,9 @@ main(int argc, char **argv)
/* NOTREACHED */
}
break;
+   case 'F':
+   foreground = 1;
+   break;
case 'g':
grace_period = atoi(optarg);
if (!grace_period) {
@@ -422,7 +426,7 @@ main(int argc, char **argv)
 * Note that it is NOT sensible to run this program from inetd - the
 * protocol assumes that it will run immediately at boot time.
 */
-   if (daemon(0, debug_level > 0)) {
+   if ((foreground == 0) && daemon(0, debug_level > 0)) {
err(1, "cannot fork");
/* NOTREACHED */
}
@@ -844,7 +848,7 @@ void
 usage()
 {
errx(1, "usage: rpc.lockd [-d ]"
-   " [-g ] [-h ] [-p ]");
+   " [-F] [-g ] [-h ] [-p ]");
 }
 
 /*

Modified: stable/12/usr.sbin/rpc.lockd/rpc.lockd.8
==
--- stable/12/usr.sbin/rpc.lockd/rpc.lockd.8Tue Dec  3 22:53:07 2019
(r355364)
+++ stable/12/usr.sbin/rpc.lockd/rpc.lockd.8Tue Dec  3 22:53:22 2019
(r355365)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 2, 2007
+.Dd November 21, 2019
 .Dt RPC.LOCKD 8
 .Os
 .Sh NAME
@@ -38,6 +38,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl d Ar debug_level
+.Op Fl F
 .Op Fl g Ar grace period
 .Op Fl h Ar bindip
 .Op Fl p Ar port
@@ -70,6 +71,17 @@ in the generation of one log line per protocol operati
 Higher
 debug levels can be specified, causing display of operation arguments
 and internal operations of the daemon.
+.It Fl F
+Run
+.Nm
+in the foreground, rather than going into daemon mode.
+This is useful if some other process uses
+.Xr fork 2
+and
+.Xr exec 3
+to run
+.Nm ,
+and wants to monitor when and how it exits.
 .It Fl g
 The
 .Fl g

Modified: stable/12/usr.sbin/rpc.statd/rpc.statd.8
==
--- stable/12/usr.sbin/rpc.statd/rpc.statd.8Tue Dec  3 22:53:07 2019
(r355364)
+++ stable/12/usr.sbin/rpc.statd/rpc.statd.8Tue Dec  3 22:53:22 2019
(r355365)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 1, 2007
+.Dd November 21, 2019
 .Dt RPC.STATD 8
 .Os
 .Sh NAME
@@ -38,6 +38,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl d
+.Op Fl F
 .Op Fl h Ar bindip
 .Op Fl p Ar port
 .Sh DESCRIPTION
@@ -71,6 +72,17 @@ These messages are logged with level
 LOG_DEBUG and facility LOG_DAEMON.
 Error conditions are logged irrespective
 of this option, using level LOG_ERR.
+.It Fl F
+Run
+.Nm
+in the foreground, rather than going into daemon mode.
+This is useful if some other process uses
+.Xr fork 2
+and
+.Xr exec 3
+to run
+.Nm ,
+and wants to monitor when and how it exits.
 .It Fl h Ar bindip
 Specify specific IP addresses to bind to.
 This option may be specified multiple times.

Modified: stable/12/usr.sbin/rpc.statd/statd.c
==
--- stable/12/usr.sbin/rpc.statd/statd.cTue Dec  3 22:53:07 2019
(r355364)
+++ stable/12/usr.sbin/rpc.statd/statd.cTue Dec  3 22:53:22 2019
(r355365)
@@ -88,15 +88,19 @@ main(int argc, char **argv)
   int ch, i, s;
   char *endptr, **hosts_bak;
   int have_v6 = 1;
+  int foreground = 0;
   int maxrec = RPC_MAXDATASIZE;
   int attempt_cnt, 

svn commit: r355364 - stable/12/stand/libsa

2019-12-03 Thread Ravi Pokala
Author: rpokala
Date: Tue Dec  3 22:53:07 2019
New Revision: 355364
URL: https://svnweb.freebsd.org/changeset/base/355364

Log:
  MFC r354673:
  
  Logging improvements to loader::nfs
  
  Include the server IP address when logging nfs_open(), add a few missing
  "\n"s, and correct a typo.

Modified:
  stable/12/stand/libsa/nfs.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/stand/libsa/nfs.c
==
--- stable/12/stand/libsa/nfs.c Tue Dec  3 22:51:25 2019(r355363)
+++ stable/12/stand/libsa/nfs.c Tue Dec  3 22:53:07 2019(r355364)
@@ -486,7 +486,8 @@ nfs_open(const char *upath, struct open_file *f)
 
 #ifdef NFS_DEBUG
if (debug)
-   printf("nfs_open: %s (rootpath=%s)\n", upath, rootpath);
+   printf("nfs_open: %s (rootip=%s rootpath=%s)\n", upath,
+   inet_ntoa(rootip), rootpath);
 #endif
if (!rootpath[0]) {
printf("no rootpath, no nfs\n");
@@ -691,14 +692,14 @@ nfs_read(struct open_file *f, void *buf, size_t size, 
if (cc == -1) {
 #ifdef NFS_DEBUG
if (debug)
-   printf("nfs_read: read: %s", strerror(errno));
+   printf("nfs_read: read: %s\n", strerror(errno));
 #endif
return (errno); /* XXX - from nfs_readdata */
}
if (cc == 0) {
 #ifdef NFS_DEBUG
if (debug)
-   printf("nfs_read: hit EOF unexpectantly");
+   printf("nfs_read: hit EOF unexpectedly\n");
 #endif
goto ret;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r355363 - stable/12/sys/sys

2019-12-03 Thread Ravi Pokala
Author: rpokala
Date: Tue Dec  3 22:51:25 2019
New Revision: 355363
URL: https://svnweb.freebsd.org/changeset/base/355363

Log:
  MFC r354102:
  
  Args for buf_track() might be unused
  
  If neither FULL_BUF_TRACKING nor BUF_TRACKING are defined, then the body of
  buf_track() becomes empty. Mark the arguments with "__unused" so the
  compiler doesn't complain about unused arguments in that case.

Modified:
  stable/12/sys/sys/buf.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/sys/buf.h
==
--- stable/12/sys/sys/buf.h Tue Dec  3 22:49:24 2019(r355362)
+++ stable/12/sys/sys/buf.h Tue Dec  3 22:51:25 2019(r355363)
@@ -450,7 +450,7 @@ buf_countdeps(struct buf *bp, int i)
 }
 
 static __inline void
-buf_track(struct buf *bp, const char *location)
+buf_track(struct buf *bp __unused, const char *location __unused)
 {
 
 #if defined(FULL_BUF_TRACKING)
___
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: r355362 - in stable/12: share/man/man4 sys/dev/imcsmb sys/dev/jedec_dimm

2019-12-03 Thread Ravi Pokala
Author: rpokala
Date: Tue Dec  3 22:49:24 2019
New Revision: 355362
URL: https://svnweb.freebsd.org/changeset/base/355362

Log:
  MFC r343583:
  
  Remove unecessary "All rights reserved" from files under my or Panasas's
  copyright.
  
  When all member nations of the Buenos Aires Convention adopted the Berne
  Convention, the phrase "All rights reserved" became unnecessary to assert
  copyright. Remove it from files under my or Panasas's copyright. The files
  related to jedec_dimm(4) also bear avg@'s copyright; he has approved this
  change.

Modified:
  stable/12/share/man/man4/imcsmb.4
  stable/12/share/man/man4/jedec_dimm.4
  stable/12/sys/dev/imcsmb/imcsmb.c
  stable/12/sys/dev/imcsmb/imcsmb_pci.c
  stable/12/sys/dev/imcsmb/imcsmb_reg.h
  stable/12/sys/dev/imcsmb/imcsmb_var.h
  stable/12/sys/dev/jedec_dimm/jedec_dimm.c
  stable/12/sys/dev/jedec_dimm/jedec_dimm.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/imcsmb.4
==
--- stable/12/share/man/man4/imcsmb.4   Tue Dec  3 22:26:55 2019
(r355361)
+++ stable/12/share/man/man4/imcsmb.4   Tue Dec  3 22:49:24 2019
(r355362)
@@ -2,7 +2,6 @@
 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
 .\"
 .\" Copyright (c) 2018 Panasas
-.\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: stable/12/share/man/man4/jedec_dimm.4
==
--- stable/12/share/man/man4/jedec_dimm.4   Tue Dec  3 22:26:55 2019
(r355361)
+++ stable/12/share/man/man4/jedec_dimm.4   Tue Dec  3 22:49:24 2019
(r355362)
@@ -3,7 +3,6 @@
 .\"
 .\" Copyright (c) 2016 Andriy Gapon 
 .\" Copyright (c) 2018 Ravi Pokala 
-.\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: stable/12/sys/dev/imcsmb/imcsmb.c
==
--- stable/12/sys/dev/imcsmb/imcsmb.c   Tue Dec  3 22:26:55 2019
(r355361)
+++ stable/12/sys/dev/imcsmb/imcsmb.c   Tue Dec  3 22:49:24 2019
(r355362)
@@ -4,7 +4,6 @@
  * Authors: Joe Kloss; Ravi Pokala (rpok...@freebsd.org)
  *
  * Copyright (c) 2017-2018 Panasas
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: stable/12/sys/dev/imcsmb/imcsmb_pci.c
==
--- stable/12/sys/dev/imcsmb/imcsmb_pci.c   Tue Dec  3 22:26:55 2019
(r355361)
+++ stable/12/sys/dev/imcsmb/imcsmb_pci.c   Tue Dec  3 22:49:24 2019
(r355362)
@@ -4,7 +4,6 @@
  * Authors: Joe Kloss; Ravi Pokala (rpok...@freebsd.org)
  *
  * Copyright (c) 2017-2018 Panasas
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: stable/12/sys/dev/imcsmb/imcsmb_reg.h
==
--- stable/12/sys/dev/imcsmb/imcsmb_reg.h   Tue Dec  3 22:26:55 2019
(r355361)
+++ stable/12/sys/dev/imcsmb/imcsmb_reg.h   Tue Dec  3 22:49:24 2019
(r355362)
@@ -4,7 +4,6 @@
  * Authors: Joe Kloss; Ravi Pokala (rpok...@freebsd.org)
  *
  * Copyright (c) 2017-2018 Panasas
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: stable/12/sys/dev/imcsmb/imcsmb_var.h
==
--- stable/12/sys/dev/imcsmb/imcsmb_var.h   Tue Dec  3 22:26:55 2019
(r355361)
+++ stable/12/sys/dev/imcsmb/imcsmb_var.h   Tue Dec  3 22:49:24 2019
(r355362)
@@ -4,7 +4,6 @@
  * Authors: Joe Kloss; Ravi Pokala (rpok...@freebsd.org)
  *
  * Copyright (c) 2017-2018 Panasas
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: stable/12/sys/dev/jedec_dimm/jedec_dimm.c
==
--- stable/12/sys/dev/jedec_dimm/jedec_dimm.c   Tue Dec  3 22:26:55 2019
(r355361)
+++ stable/12/sys/dev/jedec_dimm/jedec_dimm.c   Tue Dec  3 22:49:24 2019
(r355362)
@@ -5,7 +5,6 @@
  *
  * Copyright (c) 2016 Andriy Gapon 
  * Copyright (c) 2018 Panasas
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the 

svn commit: r355361 - head/sys/dev/cpufreq

2019-12-03 Thread Emmanuel Vadot
Author: manu
Date: Tue Dec  3 22:26:55 2019
New Revision: 355361
URL: https://svnweb.freebsd.org/changeset/base/355361

Log:
  cpufreq_dt: Do not fetch again hw.ncpu
  
  MD code already set the global variable mp_ncpus according to
  the tunable hw.ncpu so use the global variable directly.
  
  Reported by:  ian

Modified:
  head/sys/dev/cpufreq/cpufreq_dt.c

Modified: head/sys/dev/cpufreq/cpufreq_dt.c
==
--- head/sys/dev/cpufreq/cpufreq_dt.c   Tue Dec  3 22:08:54 2019
(r355360)
+++ head/sys/dev/cpufreq/cpufreq_dt.c   Tue Dec  3 22:26:55 2019
(r355361)
@@ -446,7 +446,7 @@ cpufreq_dt_attach(device_t dev)
struct cpufreq_dt_softc *sc;
phandle_t node;
phandle_t cnode, opp, copp;
-   int cpu, ncpu;
+   int cpu;
uint64_t freq;
int rv = 0;
enum opp_version version;
@@ -456,11 +456,9 @@ cpufreq_dt_attach(device_t dev)
node = ofw_bus_get_node(device_get_parent(dev));
cpu = device_get_unit(device_get_parent(dev));
 
-   if (TUNABLE_INT_FETCH("hw.ncpu", )) {
-   if (cpu >= ncpu) {
-   device_printf(dev, "Not attaching as cpu is not 
present\n");
-   return (ENXIO);
-   }
+   if (cpu >= mp_ncpus) {
+   device_printf(dev, "Not attaching as cpu is not present\n");
+   return (ENXIO);
}
 
if (regulator_get_by_ofw_property(dev, node,
___
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: r355360 - head/sys/dev/cpufreq

2019-12-03 Thread Emmanuel Vadot
Author: manu
Date: Tue Dec  3 22:08:54 2019
New Revision: 355360
URL: https://svnweb.freebsd.org/changeset/base/355360

Log:
  cpufreq_dt: Do not attach the device if the cpu isn't present
  
  If we boot with hw.ncpu=X (available on arm and arm64 at least) we
  shouldn't attach the cpufreq driver as cf_set_method will try to get
  the cpuid and it doesn't exists.
  This solves cpufreq panicing on RockChip RK3399 when booting with
  hw.ncpu=4
  
  MFC after:1 week

Modified:
  head/sys/dev/cpufreq/cpufreq_dt.c

Modified: head/sys/dev/cpufreq/cpufreq_dt.c
==
--- head/sys/dev/cpufreq/cpufreq_dt.c   Tue Dec  3 22:01:45 2019
(r355359)
+++ head/sys/dev/cpufreq/cpufreq_dt.c   Tue Dec  3 22:08:54 2019
(r355360)
@@ -446,7 +446,7 @@ cpufreq_dt_attach(device_t dev)
struct cpufreq_dt_softc *sc;
phandle_t node;
phandle_t cnode, opp, copp;
-   int cpu;
+   int cpu, ncpu;
uint64_t freq;
int rv = 0;
enum opp_version version;
@@ -454,7 +454,15 @@ cpufreq_dt_attach(device_t dev)
sc = device_get_softc(dev);
sc->dev = dev;
node = ofw_bus_get_node(device_get_parent(dev));
+   cpu = device_get_unit(device_get_parent(dev));
 
+   if (TUNABLE_INT_FETCH("hw.ncpu", )) {
+   if (cpu >= ncpu) {
+   device_printf(dev, "Not attaching as cpu is not 
present\n");
+   return (ENXIO);
+   }
+   }
+
if (regulator_get_by_ofw_property(dev, node,
"cpu-supply", >reg) != 0) {
if (regulator_get_by_ofw_property(dev, node,
@@ -496,7 +504,6 @@ cpufreq_dt_attach(device_t dev)
 * Find all CPUs that share the same opp table
 */
CPU_ZERO(>cpus);
-   cpu = device_get_unit(device_get_parent(dev));
for (cnode = node; cnode > 0; cnode = OF_peer(cnode), cpu++) {
copp = -1;
if (version == OPP_V1)
___
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: r355318 - head/sbin/newfs_msdos

2019-12-03 Thread Conrad Meyer
Hi Xin Li,

Is there a reason to prefer exit() over returning from main?  I have
not surveyed the source tree, but I suspect most programs in base exit
by returning from main rather than explicit exit(3).

Thanks,
Conrad

On Mon, Dec 2, 2019 at 11:03 PM Xin LI  wrote:
>
> Author: delphij
> Date: Tue Dec  3 07:03:25 2019
> New Revision: 355318
> URL: https://svnweb.freebsd.org/changeset/base/355318
>
> Log:
>   Explicitly exit() instead of return in main().
>
>   MFC after:2 weeks
>
> Modified:
>   head/sbin/newfs_msdos/newfs_msdos.c
>
> Modified: head/sbin/newfs_msdos/newfs_msdos.c
> ==
> --- head/sbin/newfs_msdos/newfs_msdos.c Tue Dec  3 07:01:28 2019
> (r355317)
> +++ head/sbin/newfs_msdos/newfs_msdos.c Tue Dec  3 07:03:25 2019
> (r355318)
> @@ -189,7 +189,7 @@ main(int argc, char *argv[])
> err(1, NULL);
>  }
>  dtype = *argv;
> -return !!mkfs_msdos(fname, dtype, );
> +exit(!!mkfs_msdos(fname, dtype, ));
>  }
>
>  /*
___
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: r355359 - in stable: 11/sys/dev/pci 12/sys/dev/pci

2019-12-03 Thread John Baldwin
Author: jhb
Date: Tue Dec  3 22:01:45 2019
New Revision: 355359
URL: https://svnweb.freebsd.org/changeset/base/355359

Log:
  MFC 342160: Work around BIOS quirks on HPE Proliant MicroServer Gen10
  
  PR:   221350

Modified:
  stable/12/sys/dev/pci/pci.c
Directory Properties:
  stable/12/   (props changed)

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

Modified: stable/12/sys/dev/pci/pci.c
==
--- stable/12/sys/dev/pci/pci.c Tue Dec  3 21:05:33 2019(r355358)
+++ stable/12/sys/dev/pci/pci.c Tue Dec  3 22:01:45 2019(r355359)
@@ -234,6 +234,7 @@ struct pci_quirk {
 #definePCI_QUIRK_UNMAP_REG 4 /* Ignore PCI map register */
 #definePCI_QUIRK_DISABLE_MSIX  5 /* MSI-X doesn't work */
 #definePCI_QUIRK_MSI_INTX_BUG  6 /* PCIM_CMD_INTxDIS disables MSI */
+#definePCI_QUIRK_REALLOC_BAR   7 /* Can't allocate memory at the 
default address */
int arg1;
int arg2;
 };
@@ -315,6 +316,12 @@ static const struct pci_quirk pci_quirks[] = {
{ 0x167814e4, PCI_QUIRK_MSI_INTX_BUG,   0,  0 }, /* BCM5715 */
{ 0x167914e4, PCI_QUIRK_MSI_INTX_BUG,   0,  0 }, /* BCM5715S */
 
+   /*
+* HPE Gen 10 VGA has a memory range that can't be allocated in the
+* expected place.
+*/
+   { 0x98741002, PCI_QUIRK_REALLOC_BAR,0,  0 },
+
{ 0 }
 };
 
@@ -3293,7 +3300,9 @@ pci_add_map(device_t bus, device_t dev, int reg, struc
 */
res = resource_list_reserve(rl, bus, dev, type, , start, end, count,
flags);
-   if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0)) {
+   if ((pci_do_realloc_bars
+   || pci_has_quirk(pci_get_devid(dev), PCI_QUIRK_REALLOC_BAR))
+   && res == NULL && (start != 0 || end != ~0)) {
/*
 * If the allocation fails, try to allocate a resource for
 * this BAR using any available range.  The firmware felt
___
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: r355359 - in stable: 11/sys/dev/pci 12/sys/dev/pci

2019-12-03 Thread John Baldwin
Author: jhb
Date: Tue Dec  3 22:01:45 2019
New Revision: 355359
URL: https://svnweb.freebsd.org/changeset/base/355359

Log:
  MFC 342160: Work around BIOS quirks on HPE Proliant MicroServer Gen10
  
  PR:   221350

Modified:
  stable/11/sys/dev/pci/pci.c
Directory Properties:
  stable/11/   (props changed)

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

Modified: stable/11/sys/dev/pci/pci.c
==
--- stable/11/sys/dev/pci/pci.c Tue Dec  3 21:05:33 2019(r355358)
+++ stable/11/sys/dev/pci/pci.c Tue Dec  3 22:01:45 2019(r355359)
@@ -229,6 +229,7 @@ struct pci_quirk {
 #definePCI_QUIRK_UNMAP_REG 4 /* Ignore PCI map register */
 #definePCI_QUIRK_DISABLE_MSIX  5 /* MSI-X doesn't work */
 #definePCI_QUIRK_MSI_INTX_BUG  6 /* PCIM_CMD_INTxDIS disables MSI */
+#definePCI_QUIRK_REALLOC_BAR   7 /* Can't allocate memory at the 
default address */
int arg1;
int arg2;
 };
@@ -310,6 +311,12 @@ static const struct pci_quirk pci_quirks[] = {
{ 0x167814e4, PCI_QUIRK_MSI_INTX_BUG,   0,  0 }, /* BCM5715 */
{ 0x167914e4, PCI_QUIRK_MSI_INTX_BUG,   0,  0 }, /* BCM5715S */
 
+   /*
+* HPE Gen 10 VGA has a memory range that can't be allocated in the
+* expected place.
+*/
+   { 0x98741002, PCI_QUIRK_REALLOC_BAR,0,  0 },
+
{ 0 }
 };
 
@@ -3280,7 +3287,9 @@ pci_add_map(device_t bus, device_t dev, int reg, struc
 */
res = resource_list_reserve(rl, bus, dev, type, , start, end, count,
flags);
-   if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0)) {
+   if ((pci_do_realloc_bars
+   || pci_has_quirk(pci_get_devid(dev), PCI_QUIRK_REALLOC_BAR))
+   && res == NULL && (start != 0 || end != ~0)) {
/*
 * If the allocation fails, try to allocate a resource for
 * this BAR using any available range.  The firmware felt
___
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: r355137 - head/sys/vm

2019-12-03 Thread Gleb Smirnoff
On Tue, Dec 03, 2019 at 12:59:18PM -0800, Ryan Libby wrote:
R> > If I understand the change correct, now items from UMA_ZONE_NOFREE zones
R> > will be trashed, too. That would undermine purpose of UMA_ZONE_NOFREE.
R> > Of course the flag is a hack, but some systems rely on it working.
R> >
R> The intent is not to change anything for NOFREE zones (i.e. still don't
R> trash them).  I didn't put all the detail in the commit log, but I did
R> reword the block comment in uma_zcreate:

I'm sorry - misread the diff.

-- 
Gleb Smirnoff
___
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: r355137 - head/sys/vm

2019-12-03 Thread Ryan Libby
On Tue, Dec 3, 2019 at 1:12 PM Ian Lepore  wrote:
>
> On Tue, 2019-12-03 at 12:59 -0800, Ryan Libby wrote:
> > > +* XXX UMA_ZONE_OFFPAGE.
>
> All over freebsd we have cryptic XXX comments that have no meaning to
> anyone except whoever wrote them (and, I suspect, no meaning to those
> people either after a couple months have elapsed).
>
> To the degree that XXX represents "possible trouble here" and/or "more
> work to do here", I would argue that any placement of a new XXX
> requires at least a sentence (and probably more like a paragraph) to
> describe why it's there.
>
> -- Ian

Yes, I agree it is cryptic.  This specific XXX is discussed in the
review and is a cookie crumb for planned future work:
https://reviews.freebsd.org/D20722?id=64944#inline-140550

In this case the problem is pre-existing and the comment calls it out so
that we don't miss it in a coming cleanup.  I wrote the block comment
directly above so that it would make sense when the correct flag check
is eventually inserted.

Ryan
___
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: r355301 - head/usr.sbin/bhyve

2019-12-03 Thread Vincenzo Maffione
I see, thanks for the pointers.
It looks like cfmakeraw() and tcsetattr() were what I was looking for.
A bhyve-specific printf wrapper looks the right solution to me.
I can try to sketch a patch for you guys to review, if that's useful.

Cheers,
  Vincenzo


Il giorno mar 3 dic 2019 alle ore 18:38 John Baldwin  ha
scritto:

> On 12/3/19 7:14 AM, Ian Lepore wrote:
> > On Mon, 2019-12-02 at 23:22 -0800, Rodney W. Grimes wrote:
> >>> On Mon, 2019-12-02 at 20:51 +, Vincenzo Maffione wrote:
>  Author: vmaffione
>  Date: Mon Dec  2 20:51:46 2019
>  New Revision: 355301
>  URL: https://svnweb.freebsd.org/changeset/base/355301
> 
>  Log:
>    bhyve: uniform printf format string newlines
> 
>    Some of the printf statements only use LF to get a newline.
>  However, a CR character is also required for the serial console to
>  print debug logs in a nice way.
>    Fix those code locations that only use LF, by adding a CR
>  character.
> 
>    Reviewed by: markj, aleksandr.fedo...@itglobal.com
>    MFC after:   1 week
>    Differential Revision:   https://reviews.freebsd.org/D22552
> 
>  Modified:
>    head/usr.sbin/bhyve/audio.c
>    head/usr.sbin/bhyve/hda_codec.c
>    head/usr.sbin/bhyve/net_backends.c
>    head/usr.sbin/bhyve/pci_ahci.c
>    head/usr.sbin/bhyve/pci_e82545.c
>    head/usr.sbin/bhyve/pci_hda.c
>    head/usr.sbin/bhyve/pci_nvme.c
>    head/usr.sbin/bhyve/pci_virtio_block.c
>    head/usr.sbin/bhyve/pci_virtio_console.c
>    head/usr.sbin/bhyve/pci_virtio_net.c
>    head/usr.sbin/bhyve/pci_virtio_rnd.c
>    head/usr.sbin/bhyve/pci_virtio_scsi.c
>    head/usr.sbin/bhyve/pci_xhci.c
>    head/usr.sbin/bhyve/rfb.c
> 
> >>>
> >>> These changes seem wrong in a couple ways...
> >>>
> >>>  - Lines are terminated by linefeeds in unix-like systems.  If
> >>> linefeeds need to be translated to include carriage returns, that's the
> >>> responsibility of the terminal/line-discipline layer, not the source
> >>> strings being printed.
> >>
> >> Fully agree, this change seems wrong to me for Ian's stated reason here.
> >>
> >>>
> >>>  - The sequence \n\r is very strange.  For systems that do prefer
> >>> carriage returns, the \r always comes before the \n (or stands alone on
> >>> Mac systems), not after.
> >>>
> >>> I have a feeling that the root of this is something like "lots of
> >>> people use bhyve for Windows, so they use Windows apps to look at logs,
> >>> so the logs should be formatted for Windows."  If that's the reasoning,
> >>> then why shouldn't we convert EVERY printf in the source base to
> >>> include carriage returns, just in case a windows user wants to browse a
> >>> log file?
> >>
> >> This is not that issue, it is something going on with the line
> >> discipline when using the bhyve console device.  I believe the
> >> line displine being different from what bhyve itself is expecting
> >> so when console output is intermixed with output from bhyve itself
> >> things go wrong.
> >>
> >> The printf's in this patch are coming from the bhyve process that
> >> has a fd open to the launching tty, the line discipline on that tty
> >> is changed to something different after you open the
> >> console device from that same controlling tty, or that is my hypothosis
> >> on what is going wrong.
> >
> > There is a cfmakeraw() call in usr.sbin/bhyve/consport.c; that would
> > definitely turn off nl->crnl translations.  I think that is the other
> > end of the bhyve console that I posted a patch for yesterday, and I
> > think the console driver is probably still the right place to do that
> > translation (because other console drivers do it that way).  But I'm
> > not set up to run bhyve here, so I can't test my theory.
>
> That patch won't work alone.  Most people don't use bvmcons, most people
> running bhyve use a standard uart as the console (bvmcons was an early
> console devices before bhyve had a ns8250 uart device model).  When using
> the uart as the device model you still have raw output in the bhyve
> process itself.  (See cfmakeraw() in uart_emul.c as well).  We don't
> get to change how guest OS's use a uart, so any changes have to be in
> usr.sbin/bhyve, not in sys/.
>
> However, to do that you have to actually do something more complicated to
> turn \r\n and \n\r sequences from the guest into plain \n to stdout while
> still DTRT for "bare" \r and \n characters.  You also have to make sure
> you do the right thing for input and not just output in the device models.
>
> I'm not quite a fan of this commit as-is since you will get spurious new
> lines now if you don't use a serial console.  I would perhaps rather have
> a custom printf() wrapper in bhyve that outputs the \r as needed for
> debug and error printfs only when stdio has been changed to be raw.  I
> was busy with family stuff and thanksgiving last week so didn't have time
> to review it 

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

2019-12-03 Thread Ian Lepore
On Tue, 2019-12-03 at 12:59 -0800, Ryan Libby wrote:
> > +* XXX UMA_ZONE_OFFPAGE.

All over freebsd we have cryptic XXX comments that have no meaning to
anyone except whoever wrote them (and, I suspect, no meaning to those
people either after a couple months have elapsed).

To the degree that XXX represents "possible trouble here" and/or "more
work to do here", I would argue that any placement of a new XXX
requires at least a sentence (and probably more like a paragraph) to
describe why it's there.

-- Ian


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


svn commit: r355358 - in head/sys: arm/allwinner arm/allwinner/a64 arm/allwinner/a83t dev/gpio dev/hdmi dev/iicbus dev/uart mips/ingenic

2019-12-03 Thread Emmanuel Vadot
Author: manu
Date: Tue Dec  3 21:05:33 2019
New Revision: 355358
URL: https://svnweb.freebsd.org/changeset/base/355358

Log:
  Remove "all rights reserved" from copyright for the file that Jared McNeill
  own. He gave me permission to do this.

Modified:
  head/sys/arm/allwinner/a10_fb.c
  head/sys/arm/allwinner/a10_hdmi.c
  head/sys/arm/allwinner/a10_hdmiaudio.c
  head/sys/arm/allwinner/a64/a64_padconf.c
  head/sys/arm/allwinner/a64/a64_r_padconf.c
  head/sys/arm/allwinner/a83t/a83t_padconf.c
  head/sys/arm/allwinner/a83t/a83t_r_padconf.c
  head/sys/arm/allwinner/aw_ccu.c
  head/sys/arm/allwinner/aw_gmacclk.c
  head/sys/arm/allwinner/aw_reset.c
  head/sys/arm/allwinner/aw_rsb.c
  head/sys/arm/allwinner/aw_sid.c
  head/sys/arm/allwinner/aw_sid.h
  head/sys/arm/allwinner/aw_thermal.c
  head/sys/arm/allwinner/aw_usbphy.c
  head/sys/arm/allwinner/if_awg.c
  head/sys/arm/allwinner/if_awgreg.h
  head/sys/dev/gpio/gpioregulator.c
  head/sys/dev/hdmi/dwc_hdmi.h
  head/sys/dev/iicbus/sy8106a.c
  head/sys/dev/uart/uart_dev_snps.c
  head/sys/mips/ingenic/jz4780_lcd.c
  head/sys/mips/ingenic/jz4780_lcd.h
  head/sys/mips/ingenic/jz4780_smb.c
  head/sys/mips/ingenic/jz4780_smb.h

Modified: head/sys/arm/allwinner/a10_fb.c
==
--- head/sys/arm/allwinner/a10_fb.c Tue Dec  3 21:00:45 2019
(r355357)
+++ head/sys/arm/allwinner/a10_fb.c Tue Dec  3 21:05:33 2019
(r355358)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 2016 Jared McNeill 
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: head/sys/arm/allwinner/a10_hdmi.c
==
--- head/sys/arm/allwinner/a10_hdmi.c   Tue Dec  3 21:00:45 2019
(r355357)
+++ head/sys/arm/allwinner/a10_hdmi.c   Tue Dec  3 21:05:33 2019
(r355358)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 2016 Jared McNeill 
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: head/sys/arm/allwinner/a10_hdmiaudio.c
==
--- head/sys/arm/allwinner/a10_hdmiaudio.c  Tue Dec  3 21:00:45 2019
(r355357)
+++ head/sys/arm/allwinner/a10_hdmiaudio.c  Tue Dec  3 21:05:33 2019
(r355358)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 2016 Jared McNeill 
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: head/sys/arm/allwinner/a64/a64_padconf.c
==
--- head/sys/arm/allwinner/a64/a64_padconf.cTue Dec  3 21:00:45 2019
(r355357)
+++ head/sys/arm/allwinner/a64/a64_padconf.cTue Dec  3 21:05:33 2019
(r355358)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 2016 Jared McNeill 
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: head/sys/arm/allwinner/a64/a64_r_padconf.c
==
--- head/sys/arm/allwinner/a64/a64_r_padconf.c  Tue Dec  3 21:00:45 2019
(r355357)
+++ head/sys/arm/allwinner/a64/a64_r_padconf.c  Tue Dec  3 21:05:33 2019
(r355358)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 2016 Jared McNeill 
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: head/sys/arm/allwinner/a83t/a83t_padconf.c
==
--- head/sys/arm/allwinner/a83t/a83t_padconf.c  Tue Dec  3 21:00:45 2019
(r355357)
+++ head/sys/arm/allwinner/a83t/a83t_padconf.c  Tue Dec  3 21:05:33 2019
(r355358)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 2016 Jared McNeill 
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: head/sys/arm/allwinner/a83t/a83t_r_padconf.c
==
--- head/sys/arm/allwinner/a83t/a83t_r_padconf.cTue Dec  3 21:00:45 
2019(r355357)
+++ head/sys/arm/allwinner/a83t/a83t_r_padconf.cTue Dec  3 21:05:33 
2019(r355358)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 2016 Jared McNeill 
- * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: 

svn commit: r355357 - in head: share/man/man4/man4.aarch64 share/man/man4/man4.arm sys/arm/allwinner sys/arm/allwinner/a10 sys/arm/allwinner/a13 sys/arm/allwinner/a20 sys/arm/allwinner/a31 sys/arm/...

2019-12-03 Thread Emmanuel Vadot
Author: manu
Date: Tue Dec  3 21:00:45 2019
New Revision: 355357
URL: https://svnweb.freebsd.org/changeset/base/355357

Log:
  Remove "all rights reserved" from copyright for the file I own.
  Some of the files have both me and Jared McNeill and he gave me
  permission to remove it from his files too.

Modified:
  head/share/man/man4/man4.aarch64/rk_gpio.4
  head/share/man/man4/man4.aarch64/rk_grf.4
  head/share/man/man4/man4.aarch64/rk_pinctrl.4
  head/share/man/man4/man4.arm/aw_gpio.4
  head/share/man/man4/man4.arm/aw_mmc.4
  head/share/man/man4/man4.arm/aw_rtc.4
  head/share/man/man4/man4.arm/aw_spi.4
  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/a33/a33_padconf.c
  head/sys/arm/allwinner/allwinner_pinctrl.h
  head/sys/arm/allwinner/aw_machdep.h
  head/sys/arm/allwinner/aw_mp.h
  head/sys/arm/allwinner/aw_nmi.c
  head/sys/arm/allwinner/aw_ts.c
  head/sys/arm/allwinner/axp209.c
  head/sys/arm/allwinner/axp209reg.h
  head/sys/arm/allwinner/axp81x.c
  head/sys/arm/allwinner/clkng/aw_clk.h
  head/sys/arm/allwinner/clkng/aw_clk_nkmp.c
  head/sys/arm/allwinner/clkng/aw_clk_nm.c
  head/sys/arm/allwinner/clkng/aw_clk_nm.h
  head/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c
  head/sys/arm/allwinner/clkng/aw_clk_prediv_mux.h
  head/sys/arm/allwinner/h3/h3_padconf.c
  head/sys/arm/allwinner/h3/h3_r_padconf.c
  head/sys/arm/broadcom/bcm2835/bcm2836_mp.h
  head/sys/arm64/rockchip/clk/rk3328_cru.c
  head/sys/arm64/rockchip/clk/rk_clk_armclk.c
  head/sys/arm64/rockchip/clk/rk_clk_armclk.h
  head/sys/arm64/rockchip/clk/rk_clk_composite.c
  head/sys/arm64/rockchip/clk/rk_clk_composite.h
  head/sys/arm64/rockchip/clk/rk_clk_gate.h
  head/sys/arm64/rockchip/clk/rk_clk_pll.c
  head/sys/arm64/rockchip/clk/rk_clk_pll.h
  head/sys/arm64/rockchip/clk/rk_cru.c
  head/sys/arm64/rockchip/clk/rk_cru.h
  head/sys/arm64/rockchip/if_dwc_rk.c
  head/sys/arm64/rockchip/rk805.c
  head/sys/arm64/rockchip/rk805reg.h
  head/sys/arm64/rockchip/rk_gpio.c
  head/sys/arm64/rockchip/rk_grf.c
  head/sys/arm64/rockchip/rk_pinctrl.c
  head/sys/dev/cpufreq/cpufreq_dt.c
  head/sys/dev/mmc/host/dwmmc_altera.c
  head/sys/dev/mmc/host/dwmmc_rockchip.c
  head/sys/dev/mmc/host/dwmmc_samsung.c
  head/sys/dev/pwm/ofw_pwm.c
  head/sys/dev/pwm/ofw_pwm.h
  head/sys/dev/pwm/pwmbus.c
  head/sys/dev/pwm/pwmc.c
  head/sys/dev/pwm/pwmc.h
  head/sys/dev/usb/controller/generic_usb_if.m
  head/usr.sbin/pwm/pwm.c

Modified: head/share/man/man4/man4.aarch64/rk_gpio.4
==
--- head/share/man/man4/man4.aarch64/rk_gpio.4  Tue Dec  3 19:18:32 2019
(r355356)
+++ head/share/man/man4/man4.aarch64/rk_gpio.4  Tue Dec  3 21:00:45 2019
(r355357)
@@ -1,6 +1,5 @@
 .\"-
 .\" Copyright (c) 2018 Emmanuel Vadot 
-.\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: head/share/man/man4/man4.aarch64/rk_grf.4
==
--- head/share/man/man4/man4.aarch64/rk_grf.4   Tue Dec  3 19:18:32 2019
(r355356)
+++ head/share/man/man4/man4.aarch64/rk_grf.4   Tue Dec  3 21:00:45 2019
(r355357)
@@ -1,6 +1,5 @@
 .\"-
 .\" Copyright (c) 2018 Emmanuel Vadot 
-.\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: head/share/man/man4/man4.aarch64/rk_pinctrl.4
==
--- head/share/man/man4/man4.aarch64/rk_pinctrl.4   Tue Dec  3 19:18:32 
2019(r355356)
+++ head/share/man/man4/man4.aarch64/rk_pinctrl.4   Tue Dec  3 21:00:45 
2019(r355357)
@@ -1,6 +1,5 @@
 .\"-
 .\" Copyright (c) 2018 Emmanuel Vadot 
-.\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: head/share/man/man4/man4.arm/aw_gpio.4
==
--- head/share/man/man4/man4.arm/aw_gpio.4  Tue Dec  3 19:18:32 2019
(r355356)
+++ head/share/man/man4/man4.arm/aw_gpio.4  Tue Dec  3 21:00:45 2019
(r355357)
@@ -1,6 +1,5 @@
 .\"-
 .\" Copyright (c) 2017 Emmanuel Vadot 
-.\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: head/share/man/man4/man4.arm/aw_mmc.4
==
--- 

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

2019-12-03 Thread Ryan Libby
On Tue, Dec 3, 2019 at 12:43 PM Gleb Smirnoff  wrote:
>
>   Ryan,
>
> On Wed, Nov 27, 2019 at 07:49:56PM +, Ryan Libby wrote:
> R> Author: rlibby
> R> Date: Wed Nov 27 19:49:55 2019
> R> New Revision: 355137
> R> URL: https://svnweb.freebsd.org/changeset/base/355137
> R>
> R> Log:
> R>   uma: trash memory when ctor/dtor supplied too
> R>
> R>   On INVARIANTS kernels, UMA has a use-after-free detection mechanism.
> R>   This mechanism previously required that all of the ctor/dtor/uminit/fini
> R>   arguments to uma_zcreate() be NULL in order to function.  Now, it only
> R>   requires that uminit and fini be NULL; now, the trash ctor and dtor will
> R>   be called in addition to any supplied ctor or dtor.
> R>
> R>   Also do a little refactoring for readability of the resulting logic.
> R>
> R>   This enables use-after-free detection for more zones, and will allow for
> R>   simplification of some callers that worked around the previous
> R>   restriction (see kern_mbuf.c).
> R>
> R>   Reviewed by:   jeff, markj
> R>   Sponsored by:  Dell EMC Isilon
> R>   Differential Revision: https://reviews.freebsd.org/D20722
>
> If I understand the change correct, now items from UMA_ZONE_NOFREE zones
> will be trashed, too. That would undermine purpose of UMA_ZONE_NOFREE.
> Of course the flag is a hack, but some systems rely on it working.
>
> --
> Gleb Smirnoff

The intent is not to change anything for NOFREE zones (i.e. still don't
trash them).  I didn't put all the detail in the commit log, but I did
reword the block comment in uma_zcreate:

> @@ -2302,14 +2307,17 @@ uma_zcreate(const char *name, size_t size, uma_ctor ct
> args.fini = fini;
>  #ifdef  INVARIANTS
> /*
> -* If a zone is being created with an empty constructor and
> -* destructor, pass UMA constructor/destructor which checks for
> -* memory use after free.
> +* Inject procedures which check for memory use after free if we are
> +* allowed to scramble the memory while it is not allocated.  This
> +* requires that: UMA is actually able to access the memory, no init
> +* or fini procedures, no dependency on the initial value of the
> +* memory, and no (legitimate) use of the memory after free.  Note,
> +* the ctor and dtor do not need to be empty.
> +*
> +* XXX UMA_ZONE_OFFPAGE.
>  */
> if ((!(flags & (UMA_ZONE_ZINIT | UMA_ZONE_NOFREE))) &&
> -   ctor == NULL && dtor == NULL && uminit == NULL && fini == NULL) {
> -   args.ctor = trash_ctor;
> -   args.dtor = trash_dtor;
> +   uminit == NULL && fini == NULL) {
> args.uminit = trash_init;
> args.fini = trash_fini;
> }

Ryan
___
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: r355137 - head/sys/vm

2019-12-03 Thread Gleb Smirnoff
  Ryan,

On Wed, Nov 27, 2019 at 07:49:56PM +, Ryan Libby wrote:
R> Author: rlibby
R> Date: Wed Nov 27 19:49:55 2019
R> New Revision: 355137
R> URL: https://svnweb.freebsd.org/changeset/base/355137
R> 
R> Log:
R>   uma: trash memory when ctor/dtor supplied too
R>   
R>   On INVARIANTS kernels, UMA has a use-after-free detection mechanism.
R>   This mechanism previously required that all of the ctor/dtor/uminit/fini
R>   arguments to uma_zcreate() be NULL in order to function.  Now, it only
R>   requires that uminit and fini be NULL; now, the trash ctor and dtor will
R>   be called in addition to any supplied ctor or dtor.
R>   
R>   Also do a little refactoring for readability of the resulting logic.
R>   
R>   This enables use-after-free detection for more zones, and will allow for
R>   simplification of some callers that worked around the previous
R>   restriction (see kern_mbuf.c).
R>   
R>   Reviewed by:   jeff, markj
R>   Sponsored by:  Dell EMC Isilon
R>   Differential Revision: https://reviews.freebsd.org/D20722

If I understand the change correct, now items from UMA_ZONE_NOFREE zones
will be trashed, too. That would undermine purpose of UMA_ZONE_NOFREE.
Of course the flag is a hack, but some systems rely on it working.

-- 
Gleb Smirnoff
___
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: r355102 - head/sys/netinet6

2019-12-03 Thread Gleb Smirnoff
  Ryan,

On Mon, Nov 25, 2019 at 10:25:10PM +, Ryan Libby wrote:
R> Author: rlibby
R> Date: Mon Nov 25 22:25:10 2019
R> New Revision: 355102
R> URL: https://svnweb.freebsd.org/changeset/base/355102
R> 
R> Log:
R>   in6_joingroup_locked: need if_addr_lock around in6m_disconnect_locked
R>   
R>   It looks like the call that requires the lock was introduced in r337866.
R>   
R>   Reviewed by:   hselasky
R>   Sponsored by:  Dell EMC Isilon
R>   Differential Revision: https://reviews.freebsd.org/D20739
R> 
R> Modified:
R>   head/sys/netinet6/in6_mcast.c
R> 
R> Modified: head/sys/netinet6/in6_mcast.c
R> 
==
R> --- head/sys/netinet6/in6_mcast.cMon Nov 25 21:21:37 2019
(r355101)
R> +++ head/sys/netinet6/in6_mcast.cMon Nov 25 22:25:10 2019
(r355102)
R> @@ -1267,6 +1267,7 @@ out_in6m_release:
R>  struct epoch_tracker et;
R>  
R>  CTR2(KTR_MLD, "%s: dropping ref on %p", __func__, inm);
R> +IF_ADDR_WLOCK(ifp);
R>  NET_EPOCH_ENTER(et);
R>  CK_STAILQ_FOREACH(ifma, >if_multiaddrs, ifma_link) {
R>  if (ifma->ifma_protospec == inm) {
R> @@ -1277,6 +1278,7 @@ out_in6m_release:
R>  in6m_disconnect_locked(, inm);
R>  in6m_rele_locked(, inm);
R>  NET_EPOCH_EXIT(et);
R> +IF_ADDR_WUNLOCK(ifp);
R>  } else {
R>  *pinm = inm;
R>  }

It looks like after this change the epoch entrance in this block is superfluous
and can be removed.

-- 
Gleb Smirnoff
___
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: r355356 - head/sys/arm64/rockchip/clk

2019-12-03 Thread Emmanuel Vadot
Author: manu
Date: Tue Dec  3 19:18:32 2019
New Revision: 355356
URL: https://svnweb.freebsd.org/changeset/base/355356

Log:
  arm64: rockchip: rl3399: Remove the ability to put the PLL in normal mode at 
boot
  
  RK3399 PLLs have three modes :
   - Normal, where they behave normally and their freq is calculated based on
 the registers values.
   - Slow, where the PLL freq is 24Mhz (well, the external oscillator).
   - Deep Slow, used for suspend where the freq is 32Khz.
  
  We used to put every CPU related PLL in normal mode but it can cause problem
  if the firmware didn't setup the clocks register correctly.
  And even if it did but left the pll in slow or deep slow mode that might be
  because the PMIC suppling voltage for the CPU haven't been configured yet
  and we cannot do that at this point.
  So remove the ability to set PLLs to normal mode at boot to avoid any 
problems.

Modified:
  head/sys/arm64/rockchip/clk/rk3399_cru.c
  head/sys/arm64/rockchip/clk/rk_clk_pll.c
  head/sys/arm64/rockchip/clk/rk_clk_pll.h

Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c
==
--- head/sys/arm64/rockchip/clk/rk3399_cru.cTue Dec  3 19:14:02 2019
(r355355)
+++ head/sys/arm64/rockchip/clk/rk3399_cru.cTue Dec  3 19:18:32 2019
(r355356)
@@ -692,7 +692,7 @@ static struct rk_clk_armclk_rates rk3399_cpu_b_rates[]
 
 
 /* Standard PLL. */
-#define PLL(_id, _name, _base,  _nm)   \
+#define PLL(_id, _name, _base) \
 {  \
.type = RK3399_CLK_PLL, \
.clk.pll = &(struct rk_clk_pll_def) {   \
@@ -703,7 +703,6 @@ static struct rk_clk_armclk_rates rk3399_cpu_b_rates[]
.clkdef.flags = CLK_NODE_STATIC_STRINGS,\
.base_offset = _base,   \
.rates = rk3399_pll_rates,  \
-   .normal_mode = _nm  \
},  \
 }
 
@@ -796,13 +795,13 @@ static struct rk_clk rk3399_clks[] = {
FFACT(0, "clk_ddrc_div2", "clk_ddrc", 1, 2),
 
/* PLLs */
-   PLL(PLL_APLLL, "lpll", 0x00, false),
-   PLL(PLL_APLLB, "bpll", 0x20, true),
-   PLL(PLL_DPLL,  "dpll", 0x40, false),
-   PLL(PLL_CPLL,  "cpll", 0x60, false),
-   PLL(PLL_GPLL,  "gpll", 0x80, false),
-   PLL(PLL_NPLL,  "npll", 0xA0, false),
-   PLL(PLL_VPLL,  "vpll", 0xC0, false),
+   PLL(PLL_APLLL, "lpll", 0x00),
+   PLL(PLL_APLLB, "bpll", 0x20),
+   PLL(PLL_DPLL,  "dpll", 0x40),
+   PLL(PLL_CPLL,  "cpll", 0x60),
+   PLL(PLL_GPLL,  "gpll", 0x80),
+   PLL(PLL_NPLL,  "npll", 0xA0),
+   PLL(PLL_VPLL,  "vpll", 0xC0),
 
/*  CRU_CLKSEL_CON0 */
CDIV(0, "aclkm_core_l_c", "armclkl", 0,

Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c
==
--- head/sys/arm64/rockchip/clk/rk_clk_pll.cTue Dec  3 19:14:02 2019
(r355355)
+++ head/sys/arm64/rockchip/clk/rk_clk_pll.cTue Dec  3 19:18:32 2019
(r355356)
@@ -54,8 +54,6 @@ struct rk_clk_pll_sc {
 
struct rk_clk_pll_rate  *rates;
struct rk_clk_pll_rate  *frac_rates;
-
-   boolnormal_mode;
 };
 
 #defineWRITE4(_clk, off, val)  
\
@@ -346,18 +344,8 @@ static int
 rk3399_clk_pll_init(struct clknode *clk, device_t dev)
 {
struct rk_clk_pll_sc *sc;
-   uint32_t reg;
 
sc = clknode_get_softc(clk);
-
-   if (sc->normal_mode) {
-   /* Setting to normal mode */
-   reg = RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT;
-   reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT;
-   WRITE4(clk, sc->base_offset + RK3399_CLK_PLL_MODE_OFFSET,
-   reg | RK3399_CLK_PLL_WRITE_MASK);
-   }
-
clknode_init_parent_idx(clk, 0);
 
return (0);
@@ -549,7 +537,6 @@ rk3399_clk_pll_register(struct clkdom *clkdom, struct 
sc->flags = clkdef->flags;
sc->rates = clkdef->rates;
sc->frac_rates = clkdef->frac_rates;
-   sc->normal_mode = clkdef->normal_mode;
 
clknode_register(clkdom, clk);
 

Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.h
==
--- head/sys/arm64/rockchip/clk/rk_clk_pll.hTue Dec  3 19:14:02 2019
(r355355)
+++ head/sys/arm64/rockchip/clk/rk_clk_pll.hTue Dec  3 19:18:32 2019
(r355356)
@@ -57,8 +57,6 @@ struct rk_clk_pll_def {
 
struct rk_clk_pll_rate  *rates;
struct rk_clk_pll_rate  *frac_rates;
-
-   

svn commit: r355355 - in stable: 11/sys/dev/snp 12/sys/dev/snp

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 19:14:02 2019
New Revision: 355355
URL: https://svnweb.freebsd.org/changeset/base/355355

Log:
  MFC r355205: snp: don't reference tp->t_mtx directly
  
  This is the only part of snp(4) that pokes around in struct tty directly;
  replace it with the tty_getlock accessor to avoid struct tty internals.

Modified:
  stable/12/sys/dev/snp/snp.c
Directory Properties:
  stable/12/   (props changed)

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

Modified: stable/12/sys/dev/snp/snp.c
==
--- stable/12/sys/dev/snp/snp.c Tue Dec  3 19:00:12 2019(r355354)
+++ stable/12/sys/dev/snp/snp.c Tue Dec  3 19:14:02 2019(r355355)
@@ -178,7 +178,7 @@ snp_read(struct cdev *dev, struct uio *uio, int flag)
error = EWOULDBLOCK;
break;
}
-   error = cv_wait_sig(>snp_outwait, tp->t_mtx);
+   error = cv_wait_sig(>snp_outwait, tty_getlock(tp));
if (error != 0)
break;
if (tty_gone(tp)) {
___
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: r355355 - in stable: 11/sys/dev/snp 12/sys/dev/snp

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 19:14:02 2019
New Revision: 355355
URL: https://svnweb.freebsd.org/changeset/base/355355

Log:
  MFC r355205: snp: don't reference tp->t_mtx directly
  
  This is the only part of snp(4) that pokes around in struct tty directly;
  replace it with the tty_getlock accessor to avoid struct tty internals.

Modified:
  stable/11/sys/dev/snp/snp.c
Directory Properties:
  stable/11/   (props changed)

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

Modified: stable/11/sys/dev/snp/snp.c
==
--- stable/11/sys/dev/snp/snp.c Tue Dec  3 19:00:12 2019(r355354)
+++ stable/11/sys/dev/snp/snp.c Tue Dec  3 19:14:02 2019(r355355)
@@ -174,7 +174,7 @@ snp_read(struct cdev *dev, struct uio *uio, int flag)
error = EWOULDBLOCK;
break;
}
-   error = cv_wait_sig(>snp_outwait, tp->t_mtx);
+   error = cv_wait_sig(>snp_outwait, tty_getlock(tp));
if (error != 0)
break;
if (tty_gone(tp)) {
___
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: r355354 - in stable: 11/sys/arm64/arm64 12/sys/arm64/arm64

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 19:00:12 2019
New Revision: 355354
URL: https://svnweb.freebsd.org/changeset/base/355354

Log:
  MFC r354712: arm64: fix BUS_DMA_ALLOCNOW for non-paged aligned sizes
  
  For any size that isn't page-aligned, we end up not pre-allocating enough
  for a single mapping because we truncate the size instead of rounding up to
  make sure the last bit is accounted for, leaving us one page shy of what we
  need to fulfill a request.

Modified:
  stable/11/sys/arm64/arm64/busdma_bounce.c
Directory Properties:
  stable/11/   (props changed)

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

Modified: stable/11/sys/arm64/arm64/busdma_bounce.c
==
--- stable/11/sys/arm64/arm64/busdma_bounce.c   Tue Dec  3 18:58:45 2019
(r355353)
+++ stable/11/sys/arm64/arm64/busdma_bounce.c   Tue Dec  3 19:00:12 2019
(r355354)
@@ -214,7 +214,7 @@ bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_si
if (ptoa(bz->total_bpages) < maxsize) {
int pages;
 
-   pages = atop(maxsize) - bz->total_bpages;
+   pages = atop(round_page(maxsize)) - bz->total_bpages;
 
/* Add pages to our bounce pool */
if (alloc_bounce_pages(newtag, pages) < pages)
___
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: r355354 - in stable: 11/sys/arm64/arm64 12/sys/arm64/arm64

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 19:00:12 2019
New Revision: 355354
URL: https://svnweb.freebsd.org/changeset/base/355354

Log:
  MFC r354712: arm64: fix BUS_DMA_ALLOCNOW for non-paged aligned sizes
  
  For any size that isn't page-aligned, we end up not pre-allocating enough
  for a single mapping because we truncate the size instead of rounding up to
  make sure the last bit is accounted for, leaving us one page shy of what we
  need to fulfill a request.

Modified:
  stable/12/sys/arm64/arm64/busdma_bounce.c
Directory Properties:
  stable/12/   (props changed)

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

Modified: stable/12/sys/arm64/arm64/busdma_bounce.c
==
--- stable/12/sys/arm64/arm64/busdma_bounce.c   Tue Dec  3 18:58:45 2019
(r355353)
+++ stable/12/sys/arm64/arm64/busdma_bounce.c   Tue Dec  3 19:00:12 2019
(r355354)
@@ -214,7 +214,7 @@ bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_si
if (ptoa(bz->total_bpages) < maxsize) {
int pages;
 
-   pages = atop(maxsize) - bz->total_bpages;
+   pages = atop(round_page(maxsize)) - bz->total_bpages;
 
/* Add pages to our bounce pool */
if (alloc_bounce_pages(newtag, pages) < pages)
___
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: r355353 - stable/12/lib/csu/common

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:58:45 2019
New Revision: 355353
URL: https://svnweb.freebsd.org/changeset/base/355353

Log:
  MFC r354541: csu: Fix dynamiclib/init_test:jcr_test on !HAVE_CTORS archs
  
  .jcr still needs a 0-entry added in crtend, even on !HAVE_CTORS archs, as
  we're still getting .jcr sections added -- presumably due to the reference
  in crtbegin. Without this terminal, the .jcr section (without data) overlaps
  with the next section and register_classes in crtbegin will be examining the
  wrong item.
  
  PR:   241439

Modified:
  stable/12/lib/csu/common/crtend.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/csu/common/crtend.c
==
--- stable/12/lib/csu/common/crtend.c   Tue Dec  3 18:57:32 2019
(r355352)
+++ stable/12/lib/csu/common/crtend.c   Tue Dec  3 18:58:45 2019
(r355353)
@@ -26,9 +26,14 @@ __FBSDID("$FreeBSD$");
 
 #include "crt.h"
 
-#ifdef HAVE_CTORS
 typedef void (*crt_func)(void);
 
+static crt_func __JCR_LIST__[] __section(".jcr") __used = {
+   (crt_func)0
+};
+
+#ifdef HAVE_CTORS
+
 /*
  * On some architectures and toolchains we may need to call the .ctors.
  * These are called in the reverse order they are in the ELF file.
@@ -39,9 +44,6 @@ static crt_func __CTOR_END__[] __section(".ctors") __u
(crt_func)0
 };
 static crt_func __DTOR_END__[] __section(".dtors") __used = {
-   (crt_func)0
-};
-static crt_func __JCR_LIST__[] __section(".jcr") __used = {
(crt_func)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: r355352 - stable/12/sys/conf

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:57:32 2019
New Revision: 355352
URL: https://svnweb.freebsd.org/changeset/base/355352

Log:
  MFC r354464: sys/conf/files.arm64: remove unnecessary soc_* dependencies
  
  These files already have 'device' lines that they require; adding a
  dependency on SOC_* options is an extra restriction that adds extra
  verbosity when future supported Broadcom-based SOC will also feature the
  same compatible device.
  
  Users wishing to not compile these devices in should remove the 'device'
  lines from their config.

Modified:
  stable/12/sys/conf/files.arm64
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/conf/files.arm64
==
--- stable/12/sys/conf/files.arm64  Tue Dec  3 18:55:09 2019
(r355351)
+++ stable/12/sys/conf/files.arm64  Tue Dec  3 18:57:32 2019
(r355352)
@@ -82,18 +82,18 @@ arm/arm/pmu.c   standard
 arm/arm/physmem.c  standard
 arm/broadcom/bcm2835/bcm2835_audio.c   optional sound vchiq fdt \
compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x0400 
-I$S/contrib/vchiq"
-arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc 
soc_brcm_bcm2837 fdt
+arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc fdt
 arm/broadcom/bcm2835/bcm2835_cpufreq.c optional soc_brcm_bcm2837 fdt
 arm/broadcom/bcm2835/bcm2835_dma.c optional soc_brcm_bcm2837 fdt
 arm/broadcom/bcm2835/bcm2835_fbd.c optional vt soc_brcm_bcm2837 fdt
-arm/broadcom/bcm2835/bcm2835_ft5406.c  optional evdev bcm2835_ft5406 
soc_brcm_bcm2837 fdt
+arm/broadcom/bcm2835/bcm2835_ft5406.c  optional evdev bcm2835_ft5406 
fdt
 arm/broadcom/bcm2835/bcm2835_gpio.coptional gpio soc_brcm_bcm2837 
fdt
 arm/broadcom/bcm2835/bcm2835_intr.coptional soc_brcm_bcm2837 fdt
 arm/broadcom/bcm2835/bcm2835_mbox.coptional soc_brcm_bcm2837 fdt
 arm/broadcom/bcm2835/bcm2835_rng.c optional random 
soc_brcm_bcm2837 fdt
 arm/broadcom/bcm2835/bcm2835_sdhci.c   optional sdhci soc_brcm_bcm2837 
fdt
 arm/broadcom/bcm2835/bcm2835_sdhost.c  optional sdhci soc_brcm_bcm2837 
fdt
-arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi 
soc_brcm_bcm2837 fdt
+arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi fdt
 arm/broadcom/bcm2835/bcm2835_vcio.coptional soc_brcm_bcm2837 fdt
 arm/broadcom/bcm2835/bcm2835_wdog.coptional soc_brcm_bcm2837 fdt
 arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 fdt
___
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: r355351 - in stable: 11/etc/mtree 11/usr.bin/patch 11/usr.bin/patch/tests 12/etc/mtree 12/usr.bin/patch 12/usr.bin/patch/tests

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:55:09 2019
New Revision: 355351
URL: https://svnweb.freebsd.org/changeset/base/355351

Log:
  MFC r351836, r351866, r354328: patch(1) /dev/null testing+improvement
  
  r351836: patch(1): add some basic tests
  
  Summary:
  - basic: test application of patches created by diff -u at the
beginning/middle/end of file, which have differing amounts of context
before and after chunks being added
  - limited_ctx: stems from PR 74127 in which a rogue line was getting added
when the patch should have been rejected. Similar behavior was
reproducible with larger contexts near the beginning/end of a file. See
r326084 for details
  - file_creation: patch sourced from /dev/null should create the file
  - file_nodupe: said patch sourced from /dev/null shouldn't dupe the contents
when re-applied (personal vendetta, WIP, see comment)
  - file_removal: this follows from nodupe; the reverse of a patch sourced
from /dev/null is most naturally deleting the file, as is expected based
on GNU patch behavior (WIP)
  
  r351866: patch(1): fix the file removal test, strengthen it a bit
  
  To remain compatible with GNU patch, we should ensure that once we're
  removing empty files after a reversed /dev/null patch we don't remove files
  that have been modified. GNU patch leaves these intact and just reverses the
  hunk that created the file, effectively implying --remove-empty-files for
  reversed /dev/null patches.
  
  r354328: patch(1): give /dev/null patches special treatment
  
  We have a bad habit of duplicating contents of files that are sourced from
  /dev/null and applied more than once... take the more sane (in most ways)
  GNU route and complain if the file exists and offer reversal options.
  
  This still falls short a little bit as selecting "don't reverse, apply
  anyway" will still give you duplicated file contents. There's probably other
  issues as well, but awareness is the first step to happiness.

Added:
  stable/12/usr.bin/patch/tests/
 - copied from r351836, head/usr.bin/patch/tests/
Modified:
  stable/12/etc/mtree/BSD.tests.dist
  stable/12/usr.bin/patch/Makefile
  stable/12/usr.bin/patch/patch.1
  stable/12/usr.bin/patch/patch.c
  stable/12/usr.bin/patch/pch.c
  stable/12/usr.bin/patch/pch.h
  stable/12/usr.bin/patch/tests/unified_patch_test.sh
  stable/12/usr.bin/patch/util.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Added:
  stable/11/usr.bin/patch/tests/
 - copied from r351836, head/usr.bin/patch/tests/
Modified:
  stable/11/etc/mtree/BSD.tests.dist
  stable/11/usr.bin/patch/Makefile
  stable/11/usr.bin/patch/patch.1
  stable/11/usr.bin/patch/patch.c
  stable/11/usr.bin/patch/pch.c
  stable/11/usr.bin/patch/pch.h
  stable/11/usr.bin/patch/tests/unified_patch_test.sh
  stable/11/usr.bin/patch/util.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/etc/mtree/BSD.tests.dist
==
--- stable/12/etc/mtree/BSD.tests.dist  Tue Dec  3 18:50:18 2019
(r355350)
+++ stable/12/etc/mtree/BSD.tests.dist  Tue Dec  3 18:55:09 2019
(r355351)
@@ -1010,6 +1010,8 @@
 ..
 opensm
 ..
+patch
+..
 pr
 ..
 printf

Modified: stable/12/usr.bin/patch/Makefile
==
--- stable/12/usr.bin/patch/MakefileTue Dec  3 18:50:18 2019
(r355350)
+++ stable/12/usr.bin/patch/MakefileTue Dec  3 18:55:09 2019
(r355351)
@@ -1,8 +1,13 @@
 #  $OpenBSD: Makefile,v 1.4 2005/05/16 15:22:46 espie Exp $
 # $FreeBSD$
 
+.include 
+
 PROG=  patch
 
 SRCS=  backupfile.c inp.c mkpath.c patch.c pch.c util.c
+
+HAS_TESTS=
+SUBDIR.${MK_TESTS}+= tests
 
 .include 

Modified: stable/12/usr.bin/patch/patch.1
==
--- stable/12/usr.bin/patch/patch.1 Tue Dec  3 18:50:18 2019
(r355350)
+++ stable/12/usr.bin/patch/patch.1 Tue Dec  3 18:55:09 2019
(r355351)
@@ -21,7 +21,7 @@
 .\"
 .\" $OpenBSD: patch.1,v 1.27 2014/04/15 06:26:54 jmc Exp $
 .\" $FreeBSD$
-.Dd August 15, 2015
+.Dd November 3, 2019
 .Dt PATCH 1
 .Os
 .Sh NAME
@@ -559,8 +559,10 @@ option as needed.
 .Pp
 Third, you can create a file by sending out a diff that compares a
 null file to the file you want to create.
-This will only work if the file you want to create does not exist already in
-the target directory.
+If the file you want to create already exists in the target directory when the
+diff is applied, then
+.Nm
+will identify the patch as potentially reversed and offer to reverse the patch.
 .Pp
 Fourth, take care not to send out reversed patches, since it makes people 
wonder
 whether they already applied the patch.

Modified: stable/12/usr.bin/patch/patch.c

svn commit: r355351 - in stable: 11/etc/mtree 11/usr.bin/patch 11/usr.bin/patch/tests 12/etc/mtree 12/usr.bin/patch 12/usr.bin/patch/tests

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:55:09 2019
New Revision: 355351
URL: https://svnweb.freebsd.org/changeset/base/355351

Log:
  MFC r351836, r351866, r354328: patch(1) /dev/null testing+improvement
  
  r351836: patch(1): add some basic tests
  
  Summary:
  - basic: test application of patches created by diff -u at the
beginning/middle/end of file, which have differing amounts of context
before and after chunks being added
  - limited_ctx: stems from PR 74127 in which a rogue line was getting added
when the patch should have been rejected. Similar behavior was
reproducible with larger contexts near the beginning/end of a file. See
r326084 for details
  - file_creation: patch sourced from /dev/null should create the file
  - file_nodupe: said patch sourced from /dev/null shouldn't dupe the contents
when re-applied (personal vendetta, WIP, see comment)
  - file_removal: this follows from nodupe; the reverse of a patch sourced
from /dev/null is most naturally deleting the file, as is expected based
on GNU patch behavior (WIP)
  
  r351866: patch(1): fix the file removal test, strengthen it a bit
  
  To remain compatible with GNU patch, we should ensure that once we're
  removing empty files after a reversed /dev/null patch we don't remove files
  that have been modified. GNU patch leaves these intact and just reverses the
  hunk that created the file, effectively implying --remove-empty-files for
  reversed /dev/null patches.
  
  r354328: patch(1): give /dev/null patches special treatment
  
  We have a bad habit of duplicating contents of files that are sourced from
  /dev/null and applied more than once... take the more sane (in most ways)
  GNU route and complain if the file exists and offer reversal options.
  
  This still falls short a little bit as selecting "don't reverse, apply
  anyway" will still give you duplicated file contents. There's probably other
  issues as well, but awareness is the first step to happiness.

Added:
  stable/11/usr.bin/patch/tests/
 - copied from r351836, head/usr.bin/patch/tests/
Modified:
  stable/11/etc/mtree/BSD.tests.dist
  stable/11/usr.bin/patch/Makefile
  stable/11/usr.bin/patch/patch.1
  stable/11/usr.bin/patch/patch.c
  stable/11/usr.bin/patch/pch.c
  stable/11/usr.bin/patch/pch.h
  stable/11/usr.bin/patch/tests/unified_patch_test.sh
  stable/11/usr.bin/patch/util.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Added:
  stable/12/usr.bin/patch/tests/
 - copied from r351836, head/usr.bin/patch/tests/
Modified:
  stable/12/etc/mtree/BSD.tests.dist
  stable/12/usr.bin/patch/Makefile
  stable/12/usr.bin/patch/patch.1
  stable/12/usr.bin/patch/patch.c
  stable/12/usr.bin/patch/pch.c
  stable/12/usr.bin/patch/pch.h
  stable/12/usr.bin/patch/tests/unified_patch_test.sh
  stable/12/usr.bin/patch/util.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/etc/mtree/BSD.tests.dist
==
--- stable/11/etc/mtree/BSD.tests.dist  Tue Dec  3 18:50:18 2019
(r355350)
+++ stable/11/etc/mtree/BSD.tests.dist  Tue Dec  3 18:55:09 2019
(r355351)
@@ -692,6 +692,8 @@
 ..
 opensm
 ..
+patch
+..
 pr
 ..
 printf

Modified: stable/11/usr.bin/patch/Makefile
==
--- stable/11/usr.bin/patch/MakefileTue Dec  3 18:50:18 2019
(r355350)
+++ stable/11/usr.bin/patch/MakefileTue Dec  3 18:55:09 2019
(r355351)
@@ -1,8 +1,13 @@
 #  $OpenBSD: Makefile,v 1.4 2005/05/16 15:22:46 espie Exp $
 # $FreeBSD$
 
+.include 
+
 PROG=  patch
 
 SRCS=  backupfile.c inp.c mkpath.c patch.c pch.c util.c
+
+HAS_TESTS=
+SUBDIR.${MK_TESTS}+= tests
 
 .include 

Modified: stable/11/usr.bin/patch/patch.1
==
--- stable/11/usr.bin/patch/patch.1 Tue Dec  3 18:50:18 2019
(r355350)
+++ stable/11/usr.bin/patch/patch.1 Tue Dec  3 18:55:09 2019
(r355351)
@@ -21,7 +21,7 @@
 .\"
 .\" $OpenBSD: patch.1,v 1.27 2014/04/15 06:26:54 jmc Exp $
 .\" $FreeBSD$
-.Dd August 15, 2015
+.Dd November 3, 2019
 .Dt PATCH 1
 .Os
 .Sh NAME
@@ -559,8 +559,10 @@ option as needed.
 .Pp
 Third, you can create a file by sending out a diff that compares a
 null file to the file you want to create.
-This will only work if the file you want to create does not exist already in
-the target directory.
+If the file you want to create already exists in the target directory when the
+diff is applied, then
+.Nm
+will identify the patch as potentially reversed and offer to reverse the patch.
 .Pp
 Fourth, take care not to send out reversed patches, since it makes people 
wonder
 whether they already applied the patch.

Modified: stable/11/usr.bin/patch/patch.c

svn commit: r355350 - in stable: 11/stand/liblua 12/stand/liblua

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:50:18 2019
New Revision: 355350
URL: https://svnweb.freebsd.org/changeset/base/355350

Log:
  MFC r354246: liblua: add loader.lua_path
  
  As described previously, loader.lua_path is absolute path where scripts are
  installed. A future commit will use this to build paths for dofile in
  try_include, rather than the current pcall/require setup that makes it more
  difficult to coordinate loader aborts from local.lua -- we do not need the
  flexibility of require(), and local.lua is in-fact not a 'module-like' file
  as we will not be referencing anything from it.

Modified:
  stable/11/stand/liblua/lutils.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/stand/liblua/lutils.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/stand/liblua/lutils.c
==
--- stable/11/stand/liblua/lutils.c Tue Dec  3 18:44:19 2019
(r355349)
+++ stable/11/stand/liblua/lutils.c Tue Dec  3 18:50:18 2019
(r355350)
@@ -384,6 +384,8 @@ luaopen_loader(lua_State *L)
lua_setfield(L, -2, "machine");
lua_pushstring(L, MACHINE_ARCH);
lua_setfield(L, -2, "machine_arch");
+   lua_pushstring(L, LUA_PATH);
+   lua_setfield(L, -2, "lua_path");
/* Set global printc to loader.printc */
lua_register(L, "printc", lua_printc);
return 1;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r355350 - in stable: 11/stand/liblua 12/stand/liblua

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:50:18 2019
New Revision: 355350
URL: https://svnweb.freebsd.org/changeset/base/355350

Log:
  MFC r354246: liblua: add loader.lua_path
  
  As described previously, loader.lua_path is absolute path where scripts are
  installed. A future commit will use this to build paths for dofile in
  try_include, rather than the current pcall/require setup that makes it more
  difficult to coordinate loader aborts from local.lua -- we do not need the
  flexibility of require(), and local.lua is in-fact not a 'module-like' file
  as we will not be referencing anything from it.

Modified:
  stable/12/stand/liblua/lutils.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/stand/liblua/lutils.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/stand/liblua/lutils.c
==
--- stable/12/stand/liblua/lutils.c Tue Dec  3 18:44:19 2019
(r355349)
+++ stable/12/stand/liblua/lutils.c Tue Dec  3 18:50:18 2019
(r355350)
@@ -384,6 +384,8 @@ luaopen_loader(lua_State *L)
lua_setfield(L, -2, "machine");
lua_pushstring(L, MACHINE_ARCH);
lua_setfield(L, -2, "machine_arch");
+   lua_pushstring(L, LUA_PATH);
+   lua_setfield(L, -2, "lua_path");
/* Set global printc to loader.printc */
lua_register(L, "printc", lua_printc);
return 1;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r355349 - head/stand/lua

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:44:19 2019
New Revision: 355349
URL: https://svnweb.freebsd.org/changeset/base/355349

Log:
  lualoader: correct a typo from r354247
  
  r354247 converted try_include to lfs + dofile with the loader.lua_path added
  just before. Fortunately, there was a hardcoded /boot/lua fallback in case
  loader.lua_path wasn't being set yet- I typo'd it as loader.lua_paths.
  
  Fix the typo.
  
  X-MFC-With:   r354247
  MFC after:3 days

Modified:
  head/stand/lua/core.lua

Modified: head/stand/lua/core.lua
==
--- head/stand/lua/core.lua Tue Dec  3 18:38:51 2019(r355348)
+++ head/stand/lua/core.lua Tue Dec  3 18:44:19 2019(r355349)
@@ -70,7 +70,7 @@ end
 -- message on failure.
 function try_include(module)
if module:sub(1, 1) ~= "/" then
-   local lua_path = loader.lua_paths
+   local lua_path = loader.lua_path
-- XXX Temporary compat shim; this should be removed once the
-- loader.lua_path export has sufficiently spread.
if lua_path == nil then
___
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: r355348 - in stable: 11/sbin/mdmfs 12/sbin/mdmfs

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:38:51 2019
New Revision: 355348
URL: https://svnweb.freebsd.org/changeset/base/355348

Log:
  MFC r354236: mdmfs(8): add -k skel option to populate fs from a skeleton
  
  mdmfs(8) lacks the ability to populate throwaway memory filesystems from an
  existing directory.
  
  This features permits an interesting setup where /var for instance lives on
  a device where wear-leveling is something you want to avoid as much as
  possible and nonetheless you don't want to lose your logs, ports metadata,
  etc. Here are the steps:
  
  1. Copy /var to /var.bak;
  2. Mount an mfs into /var using -k /var.bak at startup;
  3. Synchronize /var to /var.bak weekly and on shutdown.
  
  Note that this more or less mimics OpenBSD's mount_mfs(8) -P flag.
  
  PR:   146254

Modified:
  stable/12/sbin/mdmfs/mdmfs.8
  stable/12/sbin/mdmfs/mdmfs.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sbin/mdmfs/mdmfs.8
  stable/11/sbin/mdmfs/mdmfs.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/sbin/mdmfs/mdmfs.8
==
--- stable/12/sbin/mdmfs/mdmfs.8Tue Dec  3 18:36:39 2019
(r355347)
+++ stable/12/sbin/mdmfs/mdmfs.8Tue Dec  3 18:38:51 2019
(r355348)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 9, 2017
+.Dd October 31, 2019
 .Dt MDMFS 8
 .Os
 .Sh NAME
@@ -48,6 +48,7 @@ filesystem
 .Op Fl F Ar file
 .Op Fl f Ar frag-size
 .Op Fl i Ar bytes
+.Op Fl k Ar skel
 .Op Fl m Ar percent-free
 .Op Fl O Ar optimization
 .Op Fl o Ar mount-options
@@ -193,6 +194,11 @@ memory disk backed by
 The fragment size of the file system in bytes.
 .It Fl i Ar bytes
 Number of bytes per inode.
+.It Fl k Ar skel
+Copy the content of directory
+.Ar skel
+into
+.Ar mount-point .
 .It Fl l
 Enable multilabel MAC on the new file system.
 .It Fl L

Modified: stable/12/sbin/mdmfs/mdmfs.c
==
--- stable/12/sbin/mdmfs/mdmfs.cTue Dec  3 18:36:39 2019
(r355347)
+++ stable/12/sbin/mdmfs/mdmfs.cTue Dec  3 18:38:51 2019
(r355348)
@@ -88,6 +88,7 @@ static voiddo_mount_md(const char *, const char *);
 static void do_mount_tmpfs(const char *, const char *);
 static void do_mtptsetup(const char *, struct mtpt_info *);
 static void do_newfs(const char *);
+static void do_copy(const char *, const char *);
 static void extract_ugid(const char *, struct mtpt_info *);
 static int  run(int *, const char *, ...) __printflike(2, 3);
 static void usage(void);
@@ -102,7 +103,7 @@ main(int argc, char **argv)
enum md_types mdtype;   /* The type of our memory disk. */
bool have_mdtype, mlmac;
bool detach, softdep, autounit, newfs;
-   const char *mtpoint, *size_arg, *unitstr;
+   const char *mtpoint, *size_arg, *skel, *unitstr;
char *p;
int ch, idx;
void *set;
@@ -116,6 +117,7 @@ main(int argc, char **argv)
mlmac = false;
newfs = true;
have_mdtype = false;
+   skel = NULL;
mdtype = MD_SWAP;
mdname = MD_NAME;
mdnamelen = strlen(mdname);
@@ -140,7 +142,7 @@ main(int argc, char **argv)
}
 
while ((ch = getopt(argc, argv,
-   "a:b:Cc:Dd:E:e:F:f:hi:LlMm:NnO:o:Pp:Ss:tT:Uv:w:X")) != -1)
+   "a:b:Cc:Dd:E:e:F:f:hi:k:LlMm:NnO:o:Pp:Ss:tT:Uv:w:X")) != -1)
switch (ch) {
case 'a':
argappend(_arg, "-a %s", optarg);
@@ -182,6 +184,9 @@ main(int argc, char **argv)
case 'i':
argappend(_arg, "-i %s", optarg);
break;
+   case 'k':
+   skel = optarg;
+   break;
case 'L':
loudsubs = true;
break;
@@ -357,6 +362,8 @@ main(int argc, char **argv)
}
 
do_mtptsetup(mtpoint, );
+   if (skel != NULL)
+   do_copy(mtpoint, skel);
 
return (0);
 }
@@ -608,7 +615,24 @@ do_newfs(const char *args)
errx(1, "newfs exited with error code %d", rv);
 }
 
+
 /*
+ * Copy skel into the mountpoint.
+ */
+static void
+do_copy(const char *mtpoint, const char *skel)
+{
+   int rv;
+
+   rv = chdir(skel);
+   if (rv != 0)
+   err(1, "chdir to %s", skel);
+   rv = run(NULL, "/bin/pax -rw -pe . %s", mtpoint);
+   if (rv != 0)
+   errx(1, "skel copy failed");
+}
+
+/*
  * 'str' should be a user and group name similar to the last argument
  * to chown(1); i.e., a user, followed by a colon, followed by a
  * group.  The user and group in 'str' may be either a [ug]id or a
@@ -783,8 +807,8 @@ usage(void)
fprintf(stderr,
 "usage: %s [-DLlMNnPStUX] [-a maxcontig] [-b 

svn commit: r355348 - in stable: 11/sbin/mdmfs 12/sbin/mdmfs

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:38:51 2019
New Revision: 355348
URL: https://svnweb.freebsd.org/changeset/base/355348

Log:
  MFC r354236: mdmfs(8): add -k skel option to populate fs from a skeleton
  
  mdmfs(8) lacks the ability to populate throwaway memory filesystems from an
  existing directory.
  
  This features permits an interesting setup where /var for instance lives on
  a device where wear-leveling is something you want to avoid as much as
  possible and nonetheless you don't want to lose your logs, ports metadata,
  etc. Here are the steps:
  
  1. Copy /var to /var.bak;
  2. Mount an mfs into /var using -k /var.bak at startup;
  3. Synchronize /var to /var.bak weekly and on shutdown.
  
  Note that this more or less mimics OpenBSD's mount_mfs(8) -P flag.
  
  PR:   146254

Modified:
  stable/11/sbin/mdmfs/mdmfs.8
  stable/11/sbin/mdmfs/mdmfs.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sbin/mdmfs/mdmfs.8
  stable/12/sbin/mdmfs/mdmfs.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sbin/mdmfs/mdmfs.8
==
--- stable/11/sbin/mdmfs/mdmfs.8Tue Dec  3 18:36:39 2019
(r355347)
+++ stable/11/sbin/mdmfs/mdmfs.8Tue Dec  3 18:38:51 2019
(r355348)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 9, 2017
+.Dd October 31, 2019
 .Dt MDMFS 8
 .Os
 .Sh NAME
@@ -48,6 +48,7 @@ filesystem
 .Op Fl F Ar file
 .Op Fl f Ar frag-size
 .Op Fl i Ar bytes
+.Op Fl k Ar skel
 .Op Fl m Ar percent-free
 .Op Fl O Ar optimization
 .Op Fl o Ar mount-options
@@ -192,6 +193,11 @@ memory disk backed by
 The fragment size of the file system in bytes.
 .It Fl i Ar bytes
 Number of bytes per inode.
+.It Fl k Ar skel
+Copy the content of directory
+.Ar skel
+into
+.Ar mount-point .
 .It Fl l
 Enable multilabel MAC on the new file system.
 .It Fl L

Modified: stable/11/sbin/mdmfs/mdmfs.c
==
--- stable/11/sbin/mdmfs/mdmfs.cTue Dec  3 18:36:39 2019
(r355347)
+++ stable/11/sbin/mdmfs/mdmfs.cTue Dec  3 18:38:51 2019
(r355348)
@@ -88,6 +88,7 @@ static voiddo_mount_md(const char *, const char *);
 static void do_mount_tmpfs(const char *, const char *);
 static void do_mtptsetup(const char *, struct mtpt_info *);
 static void do_newfs(const char *);
+static void do_copy(const char *, const char *);
 static void extract_ugid(const char *, struct mtpt_info *);
 static int  run(int *, const char *, ...) __printflike(2, 3);
 static void usage(void);
@@ -102,7 +103,7 @@ main(int argc, char **argv)
enum md_types mdtype;   /* The type of our memory disk. */
bool have_mdtype, mlmac;
bool detach, softdep, autounit, newfs;
-   const char *mtpoint, *size_arg, *unitstr;
+   const char *mtpoint, *size_arg, *skel, *unitstr;
char *p;
int ch, idx;
void *set;
@@ -116,6 +117,7 @@ main(int argc, char **argv)
mlmac = false;
newfs = true;
have_mdtype = false;
+   skel = NULL;
mdtype = MD_SWAP;
mdname = MD_NAME;
mdnamelen = strlen(mdname);
@@ -140,7 +142,7 @@ main(int argc, char **argv)
}
 
while ((ch = getopt(argc, argv,
-   "a:b:Cc:Dd:E:e:F:f:hi:LlMm:NnO:o:Pp:Ss:tT:Uv:w:X")) != -1)
+   "a:b:Cc:Dd:E:e:F:f:hi:k:LlMm:NnO:o:Pp:Ss:tT:Uv:w:X")) != -1)
switch (ch) {
case 'a':
argappend(_arg, "-a %s", optarg);
@@ -182,6 +184,9 @@ main(int argc, char **argv)
case 'i':
argappend(_arg, "-i %s", optarg);
break;
+   case 'k':
+   skel = optarg;
+   break;
case 'L':
loudsubs = true;
break;
@@ -357,6 +362,8 @@ main(int argc, char **argv)
}
 
do_mtptsetup(mtpoint, );
+   if (skel != NULL)
+   do_copy(mtpoint, skel);
 
return (0);
 }
@@ -608,7 +615,24 @@ do_newfs(const char *args)
errx(1, "newfs exited with error code %d", rv);
 }
 
+
 /*
+ * Copy skel into the mountpoint.
+ */
+static void
+do_copy(const char *mtpoint, const char *skel)
+{
+   int rv;
+
+   rv = chdir(skel);
+   if (rv != 0)
+   err(1, "chdir to %s", skel);
+   rv = run(NULL, "/bin/pax -rw -pe . %s", mtpoint);
+   if (rv != 0)
+   errx(1, "skel copy failed");
+}
+
+/*
  * 'str' should be a user and group name similar to the last argument
  * to chown(1); i.e., a user, followed by a colon, followed by a
  * group.  The user and group in 'str' may be either a [ug]id or a
@@ -783,8 +807,8 @@ usage(void)
fprintf(stderr,
 "usage: %s [-DLlMNnPStUX] [-a maxcontig] [-b 

svn commit: r355347 - head/stand/efi/libefi

2019-12-03 Thread Toomas Soome
Author: tsoome
Date: Tue Dec  3 18:36:39 2019
New Revision: 355347
URL: https://svnweb.freebsd.org/changeset/base/355347

Log:
  loader: ReadKeyStrokeEx may return partial keystrokes
  
  In some systems we can receive no scancode nor unicodechar values.
  
  PR:   240760
  Reported by:  Ariel Millennium Thornton
  MFC after:1 week

Modified:
  head/stand/efi/libefi/efi_console.c

Modified: head/stand/efi/libefi/efi_console.c
==
--- head/stand/efi/libefi/efi_console.c Tue Dec  3 18:28:39 2019
(r355346)
+++ head/stand/efi/libefi/efi_console.c Tue Dec  3 18:36:39 2019
(r355347)
@@ -1126,10 +1126,11 @@ efi_readkey_ex(void)
kp->UnicodeChar++;
}
}
+   if (kp->ScanCode == 0 && kp->UnicodeChar == 0)
+   return (false);
+   keybuf_inschar(kp);
+   return (true);
}
-
-   keybuf_inschar(kp);
-   return (true);
}
return (false);
 }
___
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: r355346 - in stable: 11/sys/arm/arm 12/sys/arm/arm

2019-12-03 Thread Kyle Evans
On Tue, Dec 3, 2019 at 12:28 PM Kyle Evans  wrote:
>
> Author: kevans
> Date: Tue Dec  3 18:28:39 2019
> New Revision: 355346
> URL: https://svnweb.freebsd.org/changeset/base/355346
>
> Log:
>   MFC rarm: correct kernelstack allocation size
>
>   This appears to be a copy-pasto from previous lines that propagated to v6
>   over the years. Indeed, nothing references kernelstack beyond
>   USPACE_SVC_STACK_TOP and it would be odd if anything did.
>

This should have read: "MFC r353902"
___
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: r355346 - in stable: 11/sys/arm/arm 12/sys/arm/arm

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:28:39 2019
New Revision: 355346
URL: https://svnweb.freebsd.org/changeset/base/355346

Log:
  MFC rarm: correct kernelstack allocation size
  
  This appears to be a copy-pasto from previous lines that propagated to v6
  over the years. Indeed, nothing references kernelstack beyond
  USPACE_SVC_STACK_TOP and it would be odd if anything did.

Modified:
  stable/11/sys/arm/arm/machdep.c
Directory Properties:
  stable/11/   (props changed)

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

Modified: stable/11/sys/arm/arm/machdep.c
==
--- stable/11/sys/arm/arm/machdep.c Tue Dec  3 18:25:16 2019
(r355345)
+++ stable/11/sys/arm/arm/machdep.c Tue Dec  3 18:28:39 2019
(r355346)
@@ -908,7 +908,7 @@ initarm(struct arm_boot_params *abp)
valloc_pages(irqstack, IRQ_STACK_SIZE * MAXCPU);
valloc_pages(abtstack, ABT_STACK_SIZE * MAXCPU);
valloc_pages(undstack, UND_STACK_SIZE * MAXCPU);
-   valloc_pages(kernelstack, kstack_pages * MAXCPU);
+   valloc_pages(kernelstack, kstack_pages);
valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE);
 
/*
@@ -1173,7 +1173,7 @@ initarm(struct arm_boot_params *abp)
irqstack= pmap_preboot_get_vpages(IRQ_STACK_SIZE * MAXCPU);
abtstack= pmap_preboot_get_vpages(ABT_STACK_SIZE * MAXCPU);
undstack= pmap_preboot_get_vpages(UND_STACK_SIZE * MAXCPU );
-   kernelstack = pmap_preboot_get_vpages(kstack_pages * MAXCPU);
+   kernelstack = pmap_preboot_get_vpages(kstack_pages);
 
/* Allocate message buffer. */
msgbufp = (void *)pmap_preboot_get_vpages(
___
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: r355346 - in stable: 11/sys/arm/arm 12/sys/arm/arm

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:28:39 2019
New Revision: 355346
URL: https://svnweb.freebsd.org/changeset/base/355346

Log:
  MFC rarm: correct kernelstack allocation size
  
  This appears to be a copy-pasto from previous lines that propagated to v6
  over the years. Indeed, nothing references kernelstack beyond
  USPACE_SVC_STACK_TOP and it would be odd if anything did.

Modified:
  stable/12/sys/arm/arm/machdep.c
Directory Properties:
  stable/12/   (props changed)

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

Modified: stable/12/sys/arm/arm/machdep.c
==
--- stable/12/sys/arm/arm/machdep.c Tue Dec  3 18:25:16 2019
(r355345)
+++ stable/12/sys/arm/arm/machdep.c Tue Dec  3 18:28:39 2019
(r355346)
@@ -942,7 +942,7 @@ initarm(struct arm_boot_params *abp)
valloc_pages(irqstack, IRQ_STACK_SIZE * MAXCPU);
valloc_pages(abtstack, ABT_STACK_SIZE * MAXCPU);
valloc_pages(undstack, UND_STACK_SIZE * MAXCPU);
-   valloc_pages(kernelstack, kstack_pages * MAXCPU);
+   valloc_pages(kernelstack, kstack_pages);
valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE);
 
/*
@@ -1207,7 +1207,7 @@ initarm(struct arm_boot_params *abp)
irqstack= pmap_preboot_get_vpages(IRQ_STACK_SIZE * MAXCPU);
abtstack= pmap_preboot_get_vpages(ABT_STACK_SIZE * MAXCPU);
undstack= pmap_preboot_get_vpages(UND_STACK_SIZE * MAXCPU );
-   kernelstack = pmap_preboot_get_vpages(kstack_pages * MAXCPU);
+   kernelstack = pmap_preboot_get_vpages(kstack_pages);
 
/* Allocate message buffer. */
msgbufp = (void *)pmap_preboot_get_vpages(
___
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: r355345 - in stable: 11/libexec 11/libexec/flua 11/share/mk 11/stand 11/stand/common 11/stand/liblua 11/stand/lua 12/libexec 12/libexec/flua 12/share/mk 12/stand 12/stand/common 12/stan...

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:25:16 2019
New Revision: 355345
URL: https://svnweb.freebsd.org/changeset/base/355345

Log:
  MFC r354245, r354833, r354837: add flua to the base system
  
  r354245: stand: consolidate knowledge of lua path
  
  Multiple places coordinate to 'know' where lua scripts are installed. Knock
  this down to being formally defined (and overridable) in exactly one spot,
  defs.mk, and spread the knowledge to loaders and liblua alike. A future
  commit will expose this to lua as loader.lua_path, so it can build absolute
  paths to lua scripts as needed.
  
  r354833: Add flua to the base system, install to /usr/libexec
  
  FreeBSDlua ("flua") is a FreeBSD-private lua, flavored with whatever
  extensions we need for base system operations. We currently support a subset
  of lfs and lposix that are used in the rewrite of makesyscall.sh into lua,
  added in r354786.
  
  flua is intentionally written such that one can install standard lua and
  some set of lua modules from ports and achieve the same effect.
  
  linit_flua is a copy of linit.c from contrib/lua with lfs and lposix added
  in. This is similar to what we do in stand/. linit.c has been renamed to
  make it clear that this has flua-specific bits.
  
  luaconf has been slightly obfuscated to make extensions more difficult. Part
  of the problem is that flua is already hard enough to use as a bootstrap
  tool because it's not in PATH- attempting to do extension loading would
  require a special bootstrap version of flua with paths changed to protect
  the innocent.
  
  src.lua.mk has been added to make it easy for in-tree stuff to find flua,
  whether it's bootstrap-flua or relying on PATH frobbing by Makefile.inc1.
  
  r354837: flua: newer GCC complains about format-nonliteral at WARNS=2
  
  Disable that one, too.

Added:
  stable/12/libexec/flua/
 - copied from r354833, head/libexec/flua/
  stable/12/share/mk/src.lua.mk
 - copied unchanged from r354833, head/share/mk/src.lua.mk
Deleted:
  stable/12/stand/liblua/lfs.c
  stable/12/stand/liblua/lfs.h
Modified:
  stable/12/libexec/Makefile
  stable/12/libexec/flua/Makefile
  stable/12/stand/common/interp_lua.c
  stable/12/stand/defs.mk
  stable/12/stand/liblua/Makefile
  stable/12/stand/liblua/luaconf.h
  stable/12/stand/loader.mk
  stable/12/stand/lua/Makefile
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Added:
  stable/11/libexec/flua/
 - copied from r354833, head/libexec/flua/
  stable/11/share/mk/src.lua.mk
 - copied unchanged from r354833, head/share/mk/src.lua.mk
Deleted:
  stable/11/stand/liblua/lfs.c
  stable/11/stand/liblua/lfs.h
Modified:
  stable/11/libexec/Makefile
  stable/11/libexec/flua/Makefile
  stable/11/stand/common/interp_lua.c
  stable/11/stand/defs.mk
  stable/11/stand/liblua/Makefile
  stable/11/stand/liblua/luaconf.h
  stable/11/stand/loader.mk
  stable/11/stand/lua/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/libexec/Makefile
==
--- stable/12/libexec/Makefile  Tue Dec  3 17:43:57 2019(r355344)
+++ stable/12/libexec/Makefile  Tue Dec  3 18:25:16 2019(r355345)
@@ -8,6 +8,7 @@ SUBDIR= ${_atf} \
${_blacklistd-helper} \
${_comsat} \
${_dma} \
+   flua \
getty \
${_mail.local} \
${_makewhatis.local} \

Modified: stable/12/libexec/flua/Makefile
==
--- head/libexec/flua/Makefile  Mon Nov 18 23:21:13 2019(r354833)
+++ stable/12/libexec/flua/Makefile Tue Dec  3 18:25:16 2019
(r355345)
@@ -9,6 +9,8 @@ PROG=   flua
 WARNS?=2
 MAN=   # No manpage; this is internal.
 
+CWARNFLAGS.gcc+=   -Wno-format-nonliteral
+
 LIBADD=m
 
 # Core functions

Copied: stable/12/share/mk/src.lua.mk (from r354833, head/share/mk/src.lua.mk)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/share/mk/src.lua.mk   Tue Dec  3 18:25:16 2019
(r355345, copy of r354833, head/share/mk/src.lua.mk)
@@ -0,0 +1,45 @@
+# $FreeBSD$
+#
+# Lua helper file for FreeBSD /usr/src builds.
+#
+# This file provides any necessary assistance for consumers of Lua in the base
+# system.
+
+.if !target()
+:
+
+.include 
+
+#
+# LUA_INSTALL_PATH and LUA_CMD describe where the internal lua has been
+# installed to, along with the name of the internal command.  The default
+# name is flua.
+#
+# LUA_CMD can be overwritten to point to a Lua that isn't flua.  This is fine,
+# but parts of the src build that use it may have certain expectations that
+# may only be fulfilled by the in-tree Lua.  The user overwriting it is 
expected
+# to understand these and provide the expectations.
+#
+# flua is currently equivalent to 

svn commit: r355345 - in stable: 11/libexec 11/libexec/flua 11/share/mk 11/stand 11/stand/common 11/stand/liblua 11/stand/lua 12/libexec 12/libexec/flua 12/share/mk 12/stand 12/stand/common 12/stan...

2019-12-03 Thread Kyle Evans
Author: kevans
Date: Tue Dec  3 18:25:16 2019
New Revision: 355345
URL: https://svnweb.freebsd.org/changeset/base/355345

Log:
  MFC r354245, r354833, r354837: add flua to the base system
  
  r354245: stand: consolidate knowledge of lua path
  
  Multiple places coordinate to 'know' where lua scripts are installed. Knock
  this down to being formally defined (and overridable) in exactly one spot,
  defs.mk, and spread the knowledge to loaders and liblua alike. A future
  commit will expose this to lua as loader.lua_path, so it can build absolute
  paths to lua scripts as needed.
  
  r354833: Add flua to the base system, install to /usr/libexec
  
  FreeBSDlua ("flua") is a FreeBSD-private lua, flavored with whatever
  extensions we need for base system operations. We currently support a subset
  of lfs and lposix that are used in the rewrite of makesyscall.sh into lua,
  added in r354786.
  
  flua is intentionally written such that one can install standard lua and
  some set of lua modules from ports and achieve the same effect.
  
  linit_flua is a copy of linit.c from contrib/lua with lfs and lposix added
  in. This is similar to what we do in stand/. linit.c has been renamed to
  make it clear that this has flua-specific bits.
  
  luaconf has been slightly obfuscated to make extensions more difficult. Part
  of the problem is that flua is already hard enough to use as a bootstrap
  tool because it's not in PATH- attempting to do extension loading would
  require a special bootstrap version of flua with paths changed to protect
  the innocent.
  
  src.lua.mk has been added to make it easy for in-tree stuff to find flua,
  whether it's bootstrap-flua or relying on PATH frobbing by Makefile.inc1.
  
  r354837: flua: newer GCC complains about format-nonliteral at WARNS=2
  
  Disable that one, too.

Added:
  stable/11/libexec/flua/
 - copied from r354833, head/libexec/flua/
  stable/11/share/mk/src.lua.mk
 - copied unchanged from r354833, head/share/mk/src.lua.mk
Deleted:
  stable/11/stand/liblua/lfs.c
  stable/11/stand/liblua/lfs.h
Modified:
  stable/11/libexec/Makefile
  stable/11/libexec/flua/Makefile
  stable/11/stand/common/interp_lua.c
  stable/11/stand/defs.mk
  stable/11/stand/liblua/Makefile
  stable/11/stand/liblua/luaconf.h
  stable/11/stand/loader.mk
  stable/11/stand/lua/Makefile
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Added:
  stable/12/libexec/flua/
 - copied from r354833, head/libexec/flua/
  stable/12/share/mk/src.lua.mk
 - copied unchanged from r354833, head/share/mk/src.lua.mk
Deleted:
  stable/12/stand/liblua/lfs.c
  stable/12/stand/liblua/lfs.h
Modified:
  stable/12/libexec/Makefile
  stable/12/libexec/flua/Makefile
  stable/12/stand/common/interp_lua.c
  stable/12/stand/defs.mk
  stable/12/stand/liblua/Makefile
  stable/12/stand/liblua/luaconf.h
  stable/12/stand/loader.mk
  stable/12/stand/lua/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/libexec/Makefile
==
--- stable/11/libexec/Makefile  Tue Dec  3 17:43:57 2019(r355344)
+++ stable/11/libexec/Makefile  Tue Dec  3 18:25:16 2019(r355345)
@@ -8,6 +8,7 @@ SUBDIR= ${_atf} \
${_blacklistd-helper} \
${_comsat} \
${_dma} \
+   flua \
getty \
${_mail.local} \
${_makewhatis.local} \

Modified: stable/11/libexec/flua/Makefile
==
--- head/libexec/flua/Makefile  Mon Nov 18 23:21:13 2019(r354833)
+++ stable/11/libexec/flua/Makefile Tue Dec  3 18:25:16 2019
(r355345)
@@ -9,6 +9,8 @@ PROG=   flua
 WARNS?=2
 MAN=   # No manpage; this is internal.
 
+CWARNFLAGS.gcc+=   -Wno-format-nonliteral
+
 LIBADD=m
 
 # Core functions

Copied: stable/11/share/mk/src.lua.mk (from r354833, head/share/mk/src.lua.mk)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/share/mk/src.lua.mk   Tue Dec  3 18:25:16 2019
(r355345, copy of r354833, head/share/mk/src.lua.mk)
@@ -0,0 +1,45 @@
+# $FreeBSD$
+#
+# Lua helper file for FreeBSD /usr/src builds.
+#
+# This file provides any necessary assistance for consumers of Lua in the base
+# system.
+
+.if !target()
+:
+
+.include 
+
+#
+# LUA_INSTALL_PATH and LUA_CMD describe where the internal lua has been
+# installed to, along with the name of the internal command.  The default
+# name is flua.
+#
+# LUA_CMD can be overwritten to point to a Lua that isn't flua.  This is fine,
+# but parts of the src build that use it may have certain expectations that
+# may only be fulfilled by the in-tree Lua.  The user overwriting it is 
expected
+# to understand these and provide the expectations.
+#
+# flua is currently equivalent to 

svn commit: r355343 - head/sys/mips/mips

2019-12-03 Thread Ryan Libby
Author: rlibby
Date: Tue Dec  3 17:43:52 2019
New Revision: 355343
URL: https://svnweb.freebsd.org/changeset/base/355343

Log:
  mips busdma: bzero map on alloc
  
  Maps from the mips busdma dmamap_zone were not completely initialized.
  In particular, pagesneeded and pagesreserved were not initialized.  This
  could cause a crash.
  
  Remove some dead fields from mips struct bus_dmamap while here.
  
  Reported by:  brooks
  Reviewed by:  ian
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D22638

Modified:
  head/sys/mips/mips/busdma_machdep.c

Modified: head/sys/mips/mips/busdma_machdep.c
==
--- head/sys/mips/mips/busdma_machdep.c Tue Dec  3 17:06:48 2019
(r355342)
+++ head/sys/mips/mips/busdma_machdep.c Tue Dec  3 17:43:52 2019
(r355343)
@@ -156,8 +156,6 @@ struct bus_dmamap {
bus_dma_tag_t   dmat;
struct memdesc  mem;
int flags;
-   void*origbuffer;
-   void*allocbuffer;
TAILQ_ENTRY(bus_dmamap) freelist;
STAILQ_ENTRY(bus_dmamap) links;
bus_dmamap_callback_t *callback;
@@ -205,11 +203,8 @@ dmamap_ctor(void *mem, int size, void *arg, int flags)
 
dmat->map_count++;
 
+   bzero(map, sizeof(*map));
map->dmat = dmat;
-   map->flags = 0;
-   map->slist = NULL;
-   map->allocbuffer = NULL;
-   map->sync_count = 0;
STAILQ_INIT(>bpages);
 
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: r355344 - head/sys/sys

2019-12-03 Thread Ryan Libby
Author: rlibby
Date: Tue Dec  3 17:43:57 2019
New Revision: 355344
URL: https://svnweb.freebsd.org/changeset/base/355344

Log:
  bitset: avoid pessimized code when bitset size is not constant
  
  We have a couple optimizations for when the bitset is known to be just
  one word.  But with dynamically sized bitsets, it was actually more work
  to determine the size than just to do the necessary computation.  Now,
  only use the optimization when the size is known to be constant.
  
  Reviewed by:  markj
  Discussed with:   jeff
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D22639

Modified:
  head/sys/sys/bitset.h

Modified: head/sys/sys/bitset.h
==
--- head/sys/sys/bitset.h   Tue Dec  3 17:43:52 2019(r355343)
+++ head/sys/sys/bitset.h   Tue Dec  3 17:43:57 2019(r355344)
@@ -34,12 +34,19 @@
 #ifndef _SYS_BITSET_H_
 #define_SYS_BITSET_H_
 
+/*
+ * Whether expr is both constant and true.  Result is itself constant.
+ * Used to enable optimizations for sets with a known small size.
+ */
+#define__constexpr_cond(expr)  (__builtin_constant_p((expr)) && (expr))
+
 #define__bitset_mask(_s, n)
\
-   (1L << ((__bitset_words((_s)) == 1) ?   \
+   (1L << (__constexpr_cond(__bitset_words((_s)) == 1) ?   \
(__size_t)(n) : ((n) % _BITSET_BITS)))
 
 #define__bitset_word(_s, n)
\
-   ((__bitset_words((_s)) == 1) ? 0 : ((n) / _BITSET_BITS))
+   (__constexpr_cond(__bitset_words((_s)) == 1) ?  \
+0 : ((n) / _BITSET_BITS))
 
 #defineBIT_CLR(_s, n, p)   
\
((p)->__bits[__bitset_word(_s, n)] &= ~__bitset_mask((_s), (n)))
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r355301 - head/usr.sbin/bhyve

2019-12-03 Thread John Baldwin
On 12/3/19 7:14 AM, Ian Lepore wrote:
> On Mon, 2019-12-02 at 23:22 -0800, Rodney W. Grimes wrote:
>>> On Mon, 2019-12-02 at 20:51 +, Vincenzo Maffione wrote:
 Author: vmaffione
 Date: Mon Dec  2 20:51:46 2019
 New Revision: 355301
 URL: https://svnweb.freebsd.org/changeset/base/355301

 Log:
   bhyve: uniform printf format string newlines
   
   Some of the printf statements only use LF to get a newline.
 However, a CR character is also required for the serial console to
 print debug logs in a nice way.
   Fix those code locations that only use LF, by adding a CR
 character.
   
   Reviewed by: markj, aleksandr.fedo...@itglobal.com
   MFC after:   1 week
   Differential Revision:   https://reviews.freebsd.org/D22552

 Modified:
   head/usr.sbin/bhyve/audio.c
   head/usr.sbin/bhyve/hda_codec.c
   head/usr.sbin/bhyve/net_backends.c
   head/usr.sbin/bhyve/pci_ahci.c
   head/usr.sbin/bhyve/pci_e82545.c
   head/usr.sbin/bhyve/pci_hda.c
   head/usr.sbin/bhyve/pci_nvme.c
   head/usr.sbin/bhyve/pci_virtio_block.c
   head/usr.sbin/bhyve/pci_virtio_console.c
   head/usr.sbin/bhyve/pci_virtio_net.c
   head/usr.sbin/bhyve/pci_virtio_rnd.c
   head/usr.sbin/bhyve/pci_virtio_scsi.c
   head/usr.sbin/bhyve/pci_xhci.c
   head/usr.sbin/bhyve/rfb.c

>>>
>>> These changes seem wrong in a couple ways...
>>>
>>>  - Lines are terminated by linefeeds in unix-like systems.  If
>>> linefeeds need to be translated to include carriage returns, that's the
>>> responsibility of the terminal/line-discipline layer, not the source
>>> strings being printed.
>>
>> Fully agree, this change seems wrong to me for Ian's stated reason here.
>>
>>>
>>>  - The sequence \n\r is very strange.  For systems that do prefer
>>> carriage returns, the \r always comes before the \n (or stands alone on
>>> Mac systems), not after.
>>>
>>> I have a feeling that the root of this is something like "lots of
>>> people use bhyve for Windows, so they use Windows apps to look at logs,
>>> so the logs should be formatted for Windows."  If that's the reasoning,
>>> then why shouldn't we convert EVERY printf in the source base to
>>> include carriage returns, just in case a windows user wants to browse a
>>> log file?
>>
>> This is not that issue, it is something going on with the line
>> discipline when using the bhyve console device.  I believe the
>> line displine being different from what bhyve itself is expecting
>> so when console output is intermixed with output from bhyve itself
>> things go wrong.
>>
>> The printf's in this patch are coming from the bhyve process that
>> has a fd open to the launching tty, the line discipline on that tty
>> is changed to something different after you open the
>> console device from that same controlling tty, or that is my hypothosis
>> on what is going wrong.
> 
> There is a cfmakeraw() call in usr.sbin/bhyve/consport.c; that would
> definitely turn off nl->crnl translations.  I think that is the other
> end of the bhyve console that I posted a patch for yesterday, and I
> think the console driver is probably still the right place to do that
> translation (because other console drivers do it that way).  But I'm
> not set up to run bhyve here, so I can't test my theory.

That patch won't work alone.  Most people don't use bvmcons, most people
running bhyve use a standard uart as the console (bvmcons was an early
console devices before bhyve had a ns8250 uart device model).  When using
the uart as the device model you still have raw output in the bhyve
process itself.  (See cfmakeraw() in uart_emul.c as well).  We don't
get to change how guest OS's use a uart, so any changes have to be in
usr.sbin/bhyve, not in sys/.

However, to do that you have to actually do something more complicated to
turn \r\n and \n\r sequences from the guest into plain \n to stdout while
still DTRT for "bare" \r and \n characters.  You also have to make sure
you do the right thing for input and not just output in the device models.

I'm not quite a fan of this commit as-is since you will get spurious new
lines now if you don't use a serial console.  I would perhaps rather have
a custom printf() wrapper in bhyve that outputs the \r as needed for
debug and error printfs only when stdio has been changed to be raw.  I
was busy with family stuff and thanksgiving last week so didn't have time
to review it before it was committed unfortunately.

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


Re: svn commit: r355333 - stable/12/sys/cam

2019-12-03 Thread Alexander Motin
On 03.12.2019 12:00, Ian Lepore wrote:
> On Tue, 2019-12-03 at 11:54 -0500, Alexander Motin wrote:
>> On 03.12.2019 11:47, Ian Lepore wrote:
>>> On Tue, 2019-12-03 at 16:42 +, Alexander Motin wrote:
 Author: mav
 Date: Tue Dec  3 16:42:32 2019
 New Revision: 355333
 URL: https://svnweb.freebsd.org/changeset/base/355333

 Log:
   MFC r341756 (by scottl):
   Don't allocate the config_intrhook separately from the softc,
 it's
 small
   enough that it costs more code to handle the malloc/free than
 it
 saves.

>>>
>>> If it's a situation where the called hook routine always does a
>>> disestablish of the hook (and nothing else does so), just use
>>> config_intrhook_oneshot() and you don't need to manage the data
>>> struct
>>> yourself at all.
>>
>> Right.  That is what I have done in my later commit.  The only downside
>> of config_intrhook_oneshot() is that it require memory allocation unlike
>> previous.
> 
> Yeah, it's all about convenience rather than peformance.  Usually when
> I need an intrhook it's a "one device instance once at bootup" kind of
> thing where performance doesn't matter much.

I don't worry so much about performance as about need to have sleepable
context.

-- 
Alexander Motin
___
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: r355342 - in stable/12/sys: kern sys

2019-12-03 Thread Alexander Motin
Author: mav
Date: Tue Dec  3 17:06:48 2019
New Revision: 355342
URL: https://svnweb.freebsd.org/changeset/base/355342

Log:
  MFC r354986: Add variant of root_mount_hold() without allocation.
  
  It allows to use this KPI in non-sleepable contexts.

Modified:
  stable/12/sys/kern/vfs_mountroot.c
  stable/12/sys/sys/systm.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/vfs_mountroot.c
==
--- stable/12/sys/kern/vfs_mountroot.c  Tue Dec  3 16:52:39 2019
(r355341)
+++ stable/12/sys/kern/vfs_mountroot.c  Tue Dec  3 17:06:48 2019
(r355342)
@@ -110,14 +110,9 @@ char *rootdevnames[2] = {NULL, NULL};
 struct mtx root_holds_mtx;
 MTX_SYSINIT(root_holds, _holds_mtx, "root_holds", MTX_DEF);
 
-struct root_hold_token {
-   const char  *who;
-   LIST_ENTRY(root_hold_token) list;
-};
+static TAILQ_HEAD(, root_hold_token)   root_holds =
+TAILQ_HEAD_INITIALIZER(root_holds);
 
-static LIST_HEAD(, root_hold_token)root_holds =
-LIST_HEAD_INITIALIZER(root_holds);
-
 enum action {
A_CONTINUE,
A_PANIC,
@@ -125,6 +120,12 @@ enum action {
A_RETRY
 };
 
+enum rh_flags {
+   RH_FREE,
+   RH_ALLOC,
+   RH_ARG,
+};
+
 static enum action root_mount_onfail = A_CONTINUE;
 
 static int root_mount_mddev;
@@ -154,8 +155,8 @@ sysctl_vfs_root_mount_hold(SYSCTL_HANDLER_ARGS)
sbuf_new(, NULL, 256, SBUF_AUTOEXTEND | SBUF_INCLUDENUL);
 
mtx_lock(_holds_mtx);
-   LIST_FOREACH(h, _holds, list) {
-   if (h != LIST_FIRST(_holds))
+   TAILQ_FOREACH(h, _holds, list) {
+   if (h != TAILQ_FIRST(_holds))
sbuf_putc(, ' ');
sbuf_printf(, "%s", h->who);
}
@@ -174,27 +175,54 @@ root_mount_hold(const char *identifier)
struct root_hold_token *h;
 
h = malloc(sizeof *h, M_DEVBUF, M_ZERO | M_WAITOK);
+   h->flags = RH_ALLOC;
h->who = identifier;
mtx_lock(_holds_mtx);
TSHOLD("root mount");
-   LIST_INSERT_HEAD(_holds, h, list);
+   TAILQ_INSERT_TAIL(_holds, h, list);
mtx_unlock(_holds_mtx);
return (h);
 }
 
 void
+root_mount_hold_token(const char *identifier, struct root_hold_token *h)
+{
+#ifdef INVARIANTS
+   struct root_hold_token *t;
+#endif
+
+   h->flags = RH_ARG;
+   h->who = identifier;
+   mtx_lock(_holds_mtx);
+#ifdef INVARIANTS
+   TAILQ_FOREACH(t, _holds, list) {
+   if (t == h) {
+   panic("Duplicate mount hold by '%s' on %p",
+   identifier, h);
+   }
+   }
+#endif
+   TSHOLD("root mount");
+   TAILQ_INSERT_TAIL(_holds, h, list);
+   mtx_unlock(_holds_mtx);
+}
+
+void
 root_mount_rel(struct root_hold_token *h)
 {
 
-   if (h == NULL)
+   if (h == NULL || h->flags == RH_FREE)
return;
 
mtx_lock(_holds_mtx);
-   LIST_REMOVE(h, list);
+   TAILQ_REMOVE(_holds, h, list);
TSRELEASE("root mount");
wakeup(_holds);
mtx_unlock(_holds_mtx);
-   free(h, M_DEVBUF);
+   if (h->flags == RH_ALLOC) {
+   free(h, M_DEVBUF);
+   } else
+   h->flags = RH_FREE;
 }
 
 int
@@ -961,13 +989,13 @@ vfs_mountroot_wait(void)
while (1) {
g_waitidle();
mtx_lock(_holds_mtx);
-   if (LIST_EMPTY(_holds)) {
+   if (TAILQ_EMPTY(_holds)) {
mtx_unlock(_holds_mtx);
break;
}
if (ppsratecheck(, , 1)) {
printf("Root mount waiting for:");
-   LIST_FOREACH(h, _holds, list)
+   TAILQ_FOREACH(h, _holds, list)
printf(" %s", h->who);
printf("\n");
}

Modified: stable/12/sys/sys/systm.h
==
--- stable/12/sys/sys/systm.h   Tue Dec  3 16:52:39 2019(r355341)
+++ stable/12/sys/sys/systm.h   Tue Dec  3 17:06:48 2019(r355342)
@@ -503,9 +503,14 @@ int poll_no_poll(int events);
 void   DELAY(int usec);
 
 /* Root mount holdback API */
-struct root_hold_token;
+struct root_hold_token {
+   int flags;
+   const char  *who;
+   TAILQ_ENTRY(root_hold_token)list;
+};
 
 struct root_hold_token *root_mount_hold(const char *identifier);
+void root_mount_hold_token(const char *identifier, struct root_hold_token *h);
 void root_mount_rel(struct root_hold_token *h);
 int root_mounted(void);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r355333 - stable/12/sys/cam

2019-12-03 Thread Ian Lepore
On Tue, 2019-12-03 at 11:54 -0500, Alexander Motin wrote:
> On 03.12.2019 11:47, Ian Lepore wrote:
> > On Tue, 2019-12-03 at 16:42 +, Alexander Motin wrote:
> > > Author: mav
> > > Date: Tue Dec  3 16:42:32 2019
> > > New Revision: 355333
> > > URL: https://svnweb.freebsd.org/changeset/base/355333
> > > 
> > > Log:
> > >   MFC r341756 (by scottl):
> > >   Don't allocate the config_intrhook separately from the softc,
> > > it's
> > > small
> > >   enough that it costs more code to handle the malloc/free than
> > > it
> > > saves.
> > > 
> > 
> > If it's a situation where the called hook routine always does a
> > disestablish of the hook (and nothing else does so), just use
> > config_intrhook_oneshot() and you don't need to manage the data
> > struct
> > yourself at all.
> 
> Right.  That is what I have done in my later commit.  The only downside
> of config_intrhook_oneshot() is that it require memory allocation unlike
> previous.
> 

Yeah, it's all about convenience rather than peformance.  Usually when
I need an intrhook it's a "one device instance once at bootup" kind of
thing where performance doesn't matter much.

-- Ian

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


Re: svn commit: r355333 - stable/12/sys/cam

2019-12-03 Thread Alexander Motin
On 03.12.2019 11:47, Ian Lepore wrote:
> On Tue, 2019-12-03 at 16:42 +, Alexander Motin wrote:
>> Author: mav
>> Date: Tue Dec  3 16:42:32 2019
>> New Revision: 355333
>> URL: https://svnweb.freebsd.org/changeset/base/355333
>>
>> Log:
>>   MFC r341756 (by scottl):
>>   Don't allocate the config_intrhook separately from the softc, it's
>> small
>>   enough that it costs more code to handle the malloc/free than it
>> saves.
>>
> 
> If it's a situation where the called hook routine always does a
> disestablish of the hook (and nothing else does so), just use
> config_intrhook_oneshot() and you don't need to manage the data struct
> yourself at all.

Right.  That is what I have done in my later commit.  The only downside
of config_intrhook_oneshot() is that it require memory allocation unlike
previous.

-- 
Alexander Motin
___
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: r355341 - stable/11/sys/cam

2019-12-03 Thread Alexander Motin
Author: mav
Date: Tue Dec  3 16:52:39 2019
New Revision: 355341
URL: https://svnweb.freebsd.org/changeset/base/355341

Log:
  MFC r355023: Do not retry long ready waits if previous gave nothing.
  
  I have some disks reporting "Logical unit is in process of becoming ready"
  for about half an hour before finally reporting failure.  During that time
  CAM waits for the readiness during ~2 minutes for each request, that makes
  system boot take very long time.
  
  This change reduces wait times for the following requests to ~1 second if
  previously long wait for that device has timed out.

Modified:
  stable/11/sys/cam/cam_periph.c
  stable/11/sys/cam/cam_periph.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/cam_periph.c
==
--- stable/11/sys/cam/cam_periph.c  Tue Dec  3 16:52:03 2019
(r355340)
+++ stable/11/sys/cam/cam_periph.c  Tue Dec  3 16:52:39 2019
(r355341)
@@ -1345,6 +1345,14 @@ camperiphdone(struct cam_periph *periph, union ccb *do
xpt_async(AC_INQ_CHANGED, done_ccb->ccb_h.path, NULL);
}
 
+   /* If we tried long wait and still failed, remember that. */
+   if ((periph->flags & CAM_PERIPH_RECOVERY_WAIT) &&
+   (done_ccb->csio.cdb_io.cdb_bytes[0] == TEST_UNIT_READY)) {
+   periph->flags &= ~CAM_PERIPH_RECOVERY_WAIT;
+   if (error != 0 && done_ccb->ccb_h.retry_count == 0)
+   periph->flags |= CAM_PERIPH_RECOVERY_WAIT_FAILED;
+   }
+
/*
 * After recovery action(s) completed, return to the original CCB.
 * If the recovery CCB has failed, considering its own possible
@@ -1695,7 +1703,9 @@ camperiphscsisenseerror(union ccb *ccb, union ccb **or
 */
int retries;
 
-   if ((err_action & SSQ_MANY) != 0) {
+   if ((err_action & SSQ_MANY) != 0 && (periph->flags &
+CAM_PERIPH_RECOVERY_WAIT_FAILED) == 0) {
+   periph->flags |= CAM_PERIPH_RECOVERY_WAIT;
*action_string = "Polling device for readiness";
retries = 120;
} else {

Modified: stable/11/sys/cam/cam_periph.h
==
--- stable/11/sys/cam/cam_periph.h  Tue Dec  3 16:52:03 2019
(r355340)
+++ stable/11/sys/cam/cam_periph.h  Tue Dec  3 16:52:39 2019
(r355341)
@@ -129,6 +129,8 @@ struct cam_periph {
 #define CAM_PERIPH_RUN_TASK0x40
 #define CAM_PERIPH_FREE0x80
 #define CAM_PERIPH_ANNOUNCED   0x100
+#define CAM_PERIPH_RECOVERY_WAIT   0x200
+#define CAM_PERIPH_RECOVERY_WAIT_FAILED0x400
uint32_t scheduled_priority;
uint32_t immediate_priority;
int  periph_allocating;
___
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: r355340 - head/sys/dev/ctau

2019-12-03 Thread Ed Maste
Author: emaste
Date: Tue Dec  3 16:52:03 2019
New Revision: 355340
URL: https://svnweb.freebsd.org/changeset/base/355340

Log:
  ctau.c: convert from KOI8-R to UTF-8 encoding
  
  AFAICT this is the last source file (excluding contrib) that was not
  ASCII or UTF-8.

Modified:
  head/sys/dev/ctau/ctau.c

Modified: head/sys/dev/ctau/ctau.c
==
--- head/sys/dev/ctau/ctau.cTue Dec  3 16:51:26 2019(r355339)
+++ head/sys/dev/ctau/ctau.cTue Dec  3 16:52:03 2019(r355340)
@@ -190,9 +190,9 @@ int ct_download2 (port_t port, const unsigned char *fw
nconfig_set(port);
 
/*
-* � �� `fwaddr' � �� �� �� ��� ��
-* ���  firmware.  ��  ��� � ��
-* �� ��� `megaprog' � ���  (� Makefile).
+* С адреса `fwaddr' в памяти должны лежать упакованные данные
+* для загрузки firmware. Значение должно быть согласовано с параметром
+* вызова утилиты `megaprog' в скрипте загрузки (и Makefile).
 */
bytes = unpack_init (, fwaddr);
for (; bytes>0; --bytes) {
___
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: r355339 - stable/12/sys/cam

2019-12-03 Thread Alexander Motin
Author: mav
Date: Tue Dec  3 16:51:26 2019
New Revision: 355339
URL: https://svnweb.freebsd.org/changeset/base/355339

Log:
  MFC r355023: Do not retry long ready waits if previous gave nothing.
  
  I have some disks reporting "Logical unit is in process of becoming ready"
  for about half an hour before finally reporting failure.  During that time
  CAM waits for the readiness during ~2 minutes for each request, that makes
  system boot take very long time.
  
  This change reduces wait times for the following requests to ~1 second if
  previously long wait for that device has timed out.

Modified:
  stable/12/sys/cam/cam_periph.c
  stable/12/sys/cam/cam_periph.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/cam_periph.c
==
--- stable/12/sys/cam/cam_periph.c  Tue Dec  3 16:50:06 2019
(r355338)
+++ stable/12/sys/cam/cam_periph.c  Tue Dec  3 16:51:26 2019
(r355339)
@@ -1428,6 +1428,14 @@ camperiphdone(struct cam_periph *periph, union ccb *do
xpt_async(AC_INQ_CHANGED, done_ccb->ccb_h.path, NULL);
}
 
+   /* If we tried long wait and still failed, remember that. */
+   if ((periph->flags & CAM_PERIPH_RECOVERY_WAIT) &&
+   (done_ccb->csio.cdb_io.cdb_bytes[0] == TEST_UNIT_READY)) {
+   periph->flags &= ~CAM_PERIPH_RECOVERY_WAIT;
+   if (error != 0 && done_ccb->ccb_h.retry_count == 0)
+   periph->flags |= CAM_PERIPH_RECOVERY_WAIT_FAILED;
+   }
+
/*
 * After recovery action(s) completed, return to the original CCB.
 * If the recovery CCB has failed, considering its own possible
@@ -1783,7 +1791,9 @@ camperiphscsisenseerror(union ccb *ccb, union ccb **or
 */
int retries;
 
-   if ((err_action & SSQ_MANY) != 0) {
+   if ((err_action & SSQ_MANY) != 0 && (periph->flags &
+CAM_PERIPH_RECOVERY_WAIT_FAILED) == 0) {
+   periph->flags |= CAM_PERIPH_RECOVERY_WAIT;
*action_string = "Polling device for readiness";
retries = 120;
} else {

Modified: stable/12/sys/cam/cam_periph.h
==
--- stable/12/sys/cam/cam_periph.h  Tue Dec  3 16:50:06 2019
(r355338)
+++ stable/12/sys/cam/cam_periph.h  Tue Dec  3 16:51:26 2019
(r355339)
@@ -132,6 +132,8 @@ struct cam_periph {
 #define CAM_PERIPH_RUN_TASK0x40
 #define CAM_PERIPH_FREE0x80
 #define CAM_PERIPH_ANNOUNCED   0x100
+#define CAM_PERIPH_RECOVERY_WAIT   0x200
+#define CAM_PERIPH_RECOVERY_WAIT_FAILED0x400
uint32_t scheduled_priority;
uint32_t immediate_priority;
int  periph_allocating;
___
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: r355338 - stable/12/sys/cam

2019-12-03 Thread Alexander Motin
Author: mav
Date: Tue Dec  3 16:50:06 2019
New Revision: 355338
URL: https://svnweb.freebsd.org/changeset/base/355338

Log:
  MFC r355013: Remove xpt_lock mutex.
  
  CAM does not require SIM locks for years, and obviously does not require
  it for completely virtual XPT SIM.

Modified:
  stable/12/sys/cam/cam_xpt.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/cam_xpt.c
==
--- stable/12/sys/cam/cam_xpt.c Tue Dec  3 16:48:21 2019(r355337)
+++ stable/12/sys/cam/cam_xpt.c Tue Dec  3 16:50:06 2019(r355338)
@@ -128,7 +128,6 @@ struct xpt_softc {
struct root_hold_token  xpt_rootmount;
 
struct mtx  xpt_topo_lock;
-   struct mtx  xpt_lock;
struct taskqueue*xpt_taskq;
 };
 
@@ -895,7 +894,6 @@ xpt_init(void *dummy)
STAILQ_INIT();
xsoftc.num_highpower = CAM_MAX_HIGHPOWER;
 
-   mtx_init(_lock, "XPT lock", NULL, MTX_DEF);
mtx_init(_highpower_lock, "XPT highpower lock", NULL, 
MTX_DEF);
xsoftc.xpt_taskq = taskqueue_create("CAM XPT task", M_WAITOK,
taskqueue_thread_enqueue, /*context*/_taskq);
@@ -920,21 +918,18 @@ xpt_init(void *dummy)
"xpt",
/*softc*/NULL,
/*unit*/0,
-   /*mtx*/_lock,
+   /*mtx*/NULL,
/*max_dev_transactions*/0,
/*max_tagged_dev_transactions*/0,
devq);
if (xpt_sim == NULL)
return (ENOMEM);
 
-   mtx_lock(_lock);
if ((status = xpt_bus_register(xpt_sim, NULL, 0)) != CAM_SUCCESS) {
-   mtx_unlock(_lock);
printf("xpt_init: xpt_bus_register failed with status %#x,"
   " failing attach\n", status);
return (EINVAL);
}
-   mtx_unlock(_lock);
 
/*
 * Looking at the XPT from the SIM layer, the XPT is
___
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: r355337 - in stable/12/sys/cam: . scsi

2019-12-03 Thread Alexander Motin
Author: mav
Date: Tue Dec  3 16:48:21 2019
New Revision: 355337
URL: https://svnweb.freebsd.org/changeset/base/355337

Log:
  MFC r355010: Make CAM use root_mount_hold_token() to delay boot.
  
  Before this change CAM used config_intrhook_establish() for this purpose,
  but that approach does not allow to delay it again after releasing once.
  
  USB stack uses root_mount_hold() to delay boot until bus scan is complete.
  But once it is, CAM had no time to scan SCSI bus, registered by umass(4),
  if it already done other scans and called config_intrhook_disestablish().
  The new approach makes it work smooth, assuming the USB device is found
  during the initial bus scan.  Devices appearing on USB bus later may still
  require setting kern.cam.boot_delay, but hopefully those are minority.

Modified:
  stable/12/sys/cam/cam_xpt.c
  stable/12/sys/cam/scsi/scsi_enc.c
  stable/12/sys/cam/scsi/scsi_enc_internal.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/cam_xpt.c
==
--- stable/12/sys/cam/cam_xpt.c Tue Dec  3 16:47:04 2019(r355336)
+++ stable/12/sys/cam/cam_xpt.c Tue Dec  3 16:48:21 2019(r355337)
@@ -99,13 +99,6 @@ MALLOC_DEFINE(M_CAMDEV, "CAM DEV", "CAM devices");
 MALLOC_DEFINE(M_CAMCCB, "CAM CCB", "CAM CCBs");
 MALLOC_DEFINE(M_CAMPATH, "CAM path", "CAM paths");
 
-/* Object for defering XPT actions to a taskqueue */
-struct xpt_task {
-   struct task task;
-   void*data1;
-   uintptr_t   data2;
-};
-
 struct xpt_softc {
uint32_txpt_generation;
 
@@ -129,10 +122,10 @@ struct xpt_softc {
TAILQ_HEAD(,cam_eb) xpt_busses;
u_int   bus_generation;
 
-   struct intr_config_hook xpt_config_hook;
-
int boot_delay;
struct callout  boot_callout;
+   struct task boot_task;
+   struct root_hold_token  xpt_rootmount;
 
struct mtx  xpt_topo_lock;
struct mtx  xpt_lock;
@@ -273,6 +266,7 @@ static struct cam_et*
 static struct cam_ed*
 xpt_find_device(struct cam_et *target, lun_id_t lun_id);
 static void xpt_config(void *arg);
+static void xpt_hold_boot_locked(void);
 static int  xpt_schedule_dev(struct camq *queue, cam_pinfo *dev_pinfo,
 u_int32_t new_priority);
 static xpt_devicefunc_t xptpassannouncefunc;
@@ -881,7 +875,7 @@ xpt_rescan(union ccb *ccb)
}
}
TAILQ_INSERT_TAIL(_scanq, >ccb_h, sim_links.tqe);
-   xsoftc.buses_to_config++;
+   xpt_hold_boot_locked();
wakeup(_scanq);
xpt_unlock_buses();
 }
@@ -913,6 +907,7 @@ xpt_init(void *dummy)
 */
xsoftc.boot_delay = CAM_BOOT_DELAY;
 #endif
+
/*
 * The xpt layer is, itself, the equivalent of a SIM.
 * Allow 16 ccbs in the ccb pool for it.  This should
@@ -979,14 +974,11 @@ xpt_init(void *dummy)
   "- failing attach\n");
return (ENOMEM);
}
+
/*
 * Register a callback for when interrupts are enabled.
 */
-   xsoftc.xpt_config_hook.ich_func = xpt_config;
-   if (config_intrhook_establish(_config_hook) != 0) {
-   printf("xpt_init: config_intrhook_establish failed "
-  "- failing attach\n");
-   }
+   config_intrhook_oneshot(xpt_config, NULL);
 
return (0);
 }
@@ -5148,6 +5140,10 @@ xpt_stop_tags(struct cam_path *path)
xpt_action((union ccb *));
 }
 
+/*
+ * Assume all possible buses are detected by this time, so allow boot
+ * as soon as they all are scanned.
+ */
 static void
 xpt_boot_delay(void *arg)
 {
@@ -5155,12 +5151,26 @@ xpt_boot_delay(void *arg)
xpt_release_boot();
 }
 
+/*
+ * Now that all config hooks have completed, start boot_delay timer,
+ * waiting for possibly still undetected buses (USB) to appear.
+ */
 static void
+xpt_ch_done(void *arg)
+{
+
+   callout_init(_callout, 1);
+   callout_reset_sbt(_callout, SBT_1MS * xsoftc.boot_delay, 0,
+   xpt_boot_delay, NULL, 0);
+}
+SYSINIT(xpt_hw_delay, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, xpt_ch_done, 
NULL);
+
+/*
+ * Now that interrupts are enabled, go find our devices
+ */
+static void
 xpt_config(void *arg)
 {
-   /*
-* Now that interrupts are enabled, go find our devices
-*/
if (taskqueue_start_threads(_taskq, 1, PRIBIO, "CAM taskq"))
printf("xpt_config: failed to create taskqueue thread.\n");
 
@@ -5179,9 +5189,7 @@ xpt_config(void *arg)
 
periphdriver_init(1);
xpt_hold_boot();
-   callout_init(_callout, 1);
-   callout_reset_sbt(_callout, SBT_1MS * xsoftc.boot_delay, 0,
-   xpt_boot_delay, NULL, 0);
+
/* Fire up rescan thread. */
if (kproc_kthread_add(xpt_scanner_thread, NULL, _proc, NULL, 

Re: svn commit: r355333 - stable/12/sys/cam

2019-12-03 Thread Ian Lepore
On Tue, 2019-12-03 at 16:42 +, Alexander Motin wrote:
> Author: mav
> Date: Tue Dec  3 16:42:32 2019
> New Revision: 355333
> URL: https://svnweb.freebsd.org/changeset/base/355333
> 
> Log:
>   MFC r341756 (by scottl):
>   Don't allocate the config_intrhook separately from the softc, it's
> small
>   enough that it costs more code to handle the malloc/free than it
> saves.
> 

If it's a situation where the called hook routine always does a
disestablish of the hook (and nothing else does so), just use
config_intrhook_oneshot() and you don't need to manage the data struct
yourself at all.

-- Ian


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


svn commit: r355336 - stable/11/sys/cam/scsi

2019-12-03 Thread Alexander Motin
Author: mav
Date: Tue Dec  3 16:47:04 2019
New Revision: 355336
URL: https://svnweb.freebsd.org/changeset/base/355336

Log:
  MFC r354914: Set handling for some "Logical unit not ready" errors.

Modified:
  stable/11/sys/cam/scsi/scsi_all.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/scsi/scsi_all.c
==
--- stable/11/sys/cam/scsi/scsi_all.c   Tue Dec  3 16:46:44 2019
(r355335)
+++ stable/11/sys/cam/scsi/scsi_all.c   Tue Dec  3 16:47:04 2019
(r355336)
@@ -1110,7 +1110,7 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x08, SS_FATAL | EBUSY,
"Logical unit not ready, long write in progress") },
/* DTLPWROMAEBKVF */
-   { SST(0x04, 0x09, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x09, SS_FATAL | EBUSY,
"Logical unit not ready, self-test in progress") },
/* DTLPWROMAEBKVF */
{ SST(0x04, 0x0A, SS_WAIT | ENXIO,
@@ -1128,37 +1128,37 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x0E, SS_RDEF,  /* XXX TBD */
"Logical unit not ready, security session in progress") },
/* DT  WROM  B*/
-   { SST(0x04, 0x10, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x10, SS_FATAL | ENODEV,
"Logical unit not ready, auxiliary memory not accessible") },
/* DT  WRO AEB VF */
-   { SST(0x04, 0x11, SS_WAIT | EBUSY,
+   { SST(0x04, 0x11, SS_WAIT | ENXIO,
"Logical unit not ready, notify (enable spinup) required") },
/*MV  */
-   { SST(0x04, 0x12, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x12, SS_FATAL | ENXIO,
"Logical unit not ready, offline") },
/* DT   R MAEBKV  */
-   { SST(0x04, 0x13, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x13, SS_WAIT | EBUSY,
"Logical unit not ready, SA creation in progress") },
/* D B*/
-   { SST(0x04, 0x14, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x14, SS_WAIT | ENOSPC,
"Logical unit not ready, space allocation in progress") },
/*M   */
-   { SST(0x04, 0x15, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x15, SS_FATAL | ENXIO,
"Logical unit not ready, robotics disabled") },
/*M   */
-   { SST(0x04, 0x16, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x16, SS_FATAL | ENXIO,
"Logical unit not ready, configuration required") },
/*M   */
-   { SST(0x04, 0x17, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x17, SS_FATAL | ENXIO,
"Logical unit not ready, calibration required") },
/*M   */
-   { SST(0x04, 0x18, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x18, SS_FATAL | ENXIO,
"Logical unit not ready, a door is open") },
/*M   */
-   { SST(0x04, 0x19, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x19, SS_FATAL | ENODEV,
"Logical unit not ready, operating in sequential mode") },
/* DTB*/
-   { SST(0x04, 0x1A, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x1A, SS_WAIT | EBUSY,
"Logical unit not ready, START/STOP UNIT command in progress") },
/* D B*/
{ SST(0x04, 0x1B, SS_WAIT | EBUSY,
@@ -1167,7 +1167,7 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x1C, SS_RDEF,  /* XXX TBD */
"Logical unit not ready, additional power use not yet granted") },
/* D  */
-   { SST(0x04, 0x1D, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x1D, SS_WAIT | EBUSY,
"Logical unit not ready, configuration in progress") },
/* D  */
{ SST(0x04, 0x1E, SS_FATAL | ENXIO,
@@ -1176,14 +1176,20 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x1F, SS_FATAL | ENXIO,
"Logical unit not ready, microcode download required") },
/* DTLPWROMAEBKVF */
-   { SST(0x04, 0x20, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x20, SS_FATAL | ENXIO,
"Logical unit not ready, logical unit reset required") },
/* DTLPWROMAEBKVF */
-   { SST(0x04, 0x21, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x21, SS_FATAL | ENXIO,
"Logical unit not ready, hard reset required") },
/* DTLPWROMAEBKVF */
-   { SST(0x04, 0x22, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x22, SS_FATAL | ENXIO,
"Logical unit not ready, power cycle required") },
+   /* D  */
+   { SST(0x04, 0x23, SS_FATAL | ENXIO,
+   "Logical unit not ready, affiliation required") },
+   /* D  */
+   { SST(0x04, 0x24, SS_FATAL | EBUSY,
+   "Depopulation in progress") },
/* DTL WROMAEBKVF */
{ SST(0x05, 0x00, SS_RDEF,
"Logical unit does not respond to 

svn commit: r355335 - stable/12/sys/cam/scsi

2019-12-03 Thread Alexander Motin
Author: mav
Date: Tue Dec  3 16:46:44 2019
New Revision: 355335
URL: https://svnweb.freebsd.org/changeset/base/355335

Log:
  MFC r354914: Set handling for some "Logical unit not ready" errors.

Modified:
  stable/12/sys/cam/scsi/scsi_all.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/scsi/scsi_all.c
==
--- stable/12/sys/cam/scsi/scsi_all.c   Tue Dec  3 16:45:53 2019
(r355334)
+++ stable/12/sys/cam/scsi/scsi_all.c   Tue Dec  3 16:46:44 2019
(r355335)
@@ -1112,7 +1112,7 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x08, SS_FATAL | EBUSY,
"Logical unit not ready, long write in progress") },
/* DTLPWROMAEBKVF */
-   { SST(0x04, 0x09, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x09, SS_FATAL | EBUSY,
"Logical unit not ready, self-test in progress") },
/* DTLPWROMAEBKVF */
{ SST(0x04, 0x0A, SS_WAIT | ENXIO,
@@ -1130,37 +1130,37 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x0E, SS_RDEF,  /* XXX TBD */
"Logical unit not ready, security session in progress") },
/* DT  WROM  B*/
-   { SST(0x04, 0x10, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x10, SS_FATAL | ENODEV,
"Logical unit not ready, auxiliary memory not accessible") },
/* DT  WRO AEB VF */
-   { SST(0x04, 0x11, SS_WAIT | EBUSY,
+   { SST(0x04, 0x11, SS_WAIT | ENXIO,
"Logical unit not ready, notify (enable spinup) required") },
/*MV  */
-   { SST(0x04, 0x12, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x12, SS_FATAL | ENXIO,
"Logical unit not ready, offline") },
/* DT   R MAEBKV  */
-   { SST(0x04, 0x13, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x13, SS_WAIT | EBUSY,
"Logical unit not ready, SA creation in progress") },
/* D B*/
-   { SST(0x04, 0x14, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x14, SS_WAIT | ENOSPC,
"Logical unit not ready, space allocation in progress") },
/*M   */
-   { SST(0x04, 0x15, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x15, SS_FATAL | ENXIO,
"Logical unit not ready, robotics disabled") },
/*M   */
-   { SST(0x04, 0x16, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x16, SS_FATAL | ENXIO,
"Logical unit not ready, configuration required") },
/*M   */
-   { SST(0x04, 0x17, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x17, SS_FATAL | ENXIO,
"Logical unit not ready, calibration required") },
/*M   */
-   { SST(0x04, 0x18, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x18, SS_FATAL | ENXIO,
"Logical unit not ready, a door is open") },
/*M   */
-   { SST(0x04, 0x19, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x19, SS_FATAL | ENODEV,
"Logical unit not ready, operating in sequential mode") },
/* DTB*/
-   { SST(0x04, 0x1A, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x1A, SS_WAIT | EBUSY,
"Logical unit not ready, START/STOP UNIT command in progress") },
/* D B*/
{ SST(0x04, 0x1B, SS_WAIT | EBUSY,
@@ -1169,7 +1169,7 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x1C, SS_START | SSQ_DECREMENT_COUNT | ENXIO,
"Logical unit not ready, additional power use not yet granted") },
/* D  */
-   { SST(0x04, 0x1D, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x1D, SS_WAIT | EBUSY,
"Logical unit not ready, configuration in progress") },
/* D  */
{ SST(0x04, 0x1E, SS_FATAL | ENXIO,
@@ -1178,14 +1178,20 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x1F, SS_FATAL | ENXIO,
"Logical unit not ready, microcode download required") },
/* DTLPWROMAEBKVF */
-   { SST(0x04, 0x20, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x20, SS_FATAL | ENXIO,
"Logical unit not ready, logical unit reset required") },
/* DTLPWROMAEBKVF */
-   { SST(0x04, 0x21, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x21, SS_FATAL | ENXIO,
"Logical unit not ready, hard reset required") },
/* DTLPWROMAEBKVF */
-   { SST(0x04, 0x22, SS_RDEF,  /* XXX TBD */
+   { SST(0x04, 0x22, SS_FATAL | ENXIO,
"Logical unit not ready, power cycle required") },
+   /* D  */
+   { SST(0x04, 0x23, SS_FATAL | ENXIO,
+   "Logical unit not ready, affiliation required") },
+   /* D  */
+   { SST(0x04, 0x24, SS_FATAL | EBUSY,
+   "Depopulation in progress") },
/* DTL WROMAEBKVF */
{ SST(0x05, 0x00, SS_RDEF,
"Logical unit does not 

svn commit: r355334 - head/sys/dev/syscons

2019-12-03 Thread Ed Maste
Author: emaste
Date: Tue Dec  3 16:45:53 2019
New Revision: 355334
URL: https://svnweb.freebsd.org/changeset/base/355334

Log:
  scterm-sc.c: convert source file to UTF-8 encoding
  
  Most source files are already ASCII or UTF-8 but this one was not previously
  converted.

Modified:
  head/sys/dev/syscons/scterm-sc.c

Modified: head/sys/dev/syscons/scterm-sc.c
==
--- head/sys/dev/syscons/scterm-sc.cTue Dec  3 16:42:32 2019
(r355333)
+++ head/sys/dev/syscons/scterm-sc.cTue Dec  3 16:45:53 2019
(r355334)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 1999 Kazutaka YOKOTA 
- * Copyright (c) 1992-1998 S�ren Schmidt
+ * Copyright (c) 1992-1998 Søren Schmidt
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
___
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: r355333 - stable/12/sys/cam

2019-12-03 Thread Alexander Motin
Author: mav
Date: Tue Dec  3 16:42:32 2019
New Revision: 355333
URL: https://svnweb.freebsd.org/changeset/base/355333

Log:
  MFC r341756 (by scottl):
  Don't allocate the config_intrhook separately from the softc, it's small
  enough that it costs more code to handle the malloc/free than it saves.

Modified:
  stable/12/sys/cam/cam_xpt.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/cam_xpt.c
==
--- stable/12/sys/cam/cam_xpt.c Tue Dec  3 16:33:35 2019(r355332)
+++ stable/12/sys/cam/cam_xpt.c Tue Dec  3 16:42:32 2019(r355333)
@@ -129,7 +129,7 @@ struct xpt_softc {
TAILQ_HEAD(,cam_eb) xpt_busses;
u_int   bus_generation;
 
-   struct intr_config_hook *xpt_config_hook;
+   struct intr_config_hook xpt_config_hook;
 
int boot_delay;
struct callout  boot_callout;
@@ -982,17 +982,8 @@ xpt_init(void *dummy)
/*
 * Register a callback for when interrupts are enabled.
 */
-   xsoftc.xpt_config_hook =
-   (struct intr_config_hook *)malloc(sizeof(struct intr_config_hook),
- M_CAMXPT, M_NOWAIT | M_ZERO);
-   if (xsoftc.xpt_config_hook == NULL) {
-   printf("xpt_init: Cannot malloc config hook "
-  "- failing attach\n");
-   return (ENOMEM);
-   }
-   xsoftc.xpt_config_hook->ich_func = xpt_config;
-   if (config_intrhook_establish(xsoftc.xpt_config_hook) != 0) {
-   free (xsoftc.xpt_config_hook, M_CAMXPT);
+   xsoftc.xpt_config_hook.ich_func = xpt_config;
+   if (config_intrhook_establish(_config_hook) != 0) {
printf("xpt_init: config_intrhook_establish failed "
   "- failing attach\n");
}
@@ -5262,9 +5253,7 @@ xpt_finishconfig_task(void *context, int pending)
xpt_for_all_devices(xptpassannouncefunc, NULL);
 
/* Release our hook so that the boot can continue. */
-   config_intrhook_disestablish(xsoftc.xpt_config_hook);
-   free(xsoftc.xpt_config_hook, M_CAMXPT);
-   xsoftc.xpt_config_hook = NULL;
+   config_intrhook_disestablish(_config_hook);
 
free(context, M_CAMXPT);
 }
___
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: r355332 - stable/11/sys/compat/linprocfs

2019-12-03 Thread Olivier Houchard
Author: cognet
Date: Tue Dec  3 16:33:35 2019
New Revision: 355332
URL: https://svnweb.freebsd.org/changeset/base/355332

Log:
  MFC r354602
  
linprocfs: Make sure to report -1 as tty when we have no controlling tty.
  
When reporting a process' stats, we can't just provide the tty as an
unsigned long, as if we have no controlling tty, the tty would be NODEV, or
-1. Instaed, just special-case NODEV.

Modified:
  stable/11/sys/compat/linprocfs/linprocfs.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linprocfs/linprocfs.c
==
--- stable/11/sys/compat/linprocfs/linprocfs.c  Tue Dec  3 16:32:30 2019
(r355331)
+++ stable/11/sys/compat/linprocfs/linprocfs.c  Tue Dec  3 16:33:35 2019
(r355332)
@@ -618,7 +618,10 @@ linprocfs_doprocstat(PFS_FILL_ARGS)
PS_ADD("pgrp",  "%d",   p->p_pgid);
PS_ADD("session",   "%d",   p->p_session->s_sid);
PROC_UNLOCK(p);
-   PS_ADD("tty",   "%ju",  (uintmax_t)kp.ki_tdev);
+   if (kp.ki_tdev == NODEV)
+   PS_ADD("tty",   "%s",   "-1");
+   else
+   PS_ADD("tty",   "%ju",  (uintmax_t)kp.ki_tdev);
PS_ADD("tpgid", "%d",   kp.ki_tpgid);
PS_ADD("flags", "%u",   0); /* XXX */
PS_ADD("minflt","%lu",  kp.ki_rusage.ru_minflt);
___
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: r355331 - stable/12/sys/compat/linprocfs

2019-12-03 Thread Olivier Houchard
Author: cognet
Date: Tue Dec  3 16:32:30 2019
New Revision: 355331
URL: https://svnweb.freebsd.org/changeset/base/355331

Log:
  MFC r354602
  
linprocfs: Make sure to report -1 as tty when we have no controlling tty.
  
When reporting a process' stats, we can't just provide the tty as an
unsigned long, as if we have no controlling tty, the tty would be NODEV, or
-1. Instaed, just special-case NODEV.

Modified:
  stable/12/sys/compat/linprocfs/linprocfs.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linprocfs/linprocfs.c
==
--- stable/12/sys/compat/linprocfs/linprocfs.c  Tue Dec  3 15:48:28 2019
(r355330)
+++ stable/12/sys/compat/linprocfs/linprocfs.c  Tue Dec  3 16:32:30 2019
(r355331)
@@ -737,7 +737,10 @@ linprocfs_doprocstat(PFS_FILL_ARGS)
PS_ADD("pgrp",  "%d",   p->p_pgid);
PS_ADD("session",   "%d",   p->p_session->s_sid);
PROC_UNLOCK(p);
-   PS_ADD("tty",   "%ju",  (uintmax_t)kp.ki_tdev);
+   if (kp.ki_tdev == NODEV)
+   PS_ADD("tty",   "%s",   "-1");
+   else
+   PS_ADD("tty",   "%ju",  (uintmax_t)kp.ki_tdev);
PS_ADD("tpgid", "%d",   kp.ki_tpgid);
PS_ADD("flags", "%u",   0); /* XXX */
PS_ADD("minflt","%lu",  kp.ki_rusage.ru_minflt);
___
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: r355330 - head/share/man/man9

2019-12-03 Thread Warner Losh
Author: imp
Date: Tue Dec  3 15:48:28 2019
New Revision: 355330
URL: https://svnweb.freebsd.org/changeset/base/355330

Log:
  Regularize copyright notices for me.
  
  Remove stray All Rights Reserved and other non-license stuff. Make sure all
  copyrights have year.

Modified:
  head/share/man/man9/BUS_ADD_CHILD.9
  head/share/man/man9/bus_activate_resource.9
  head/share/man/man9/bus_child_present.9
  head/share/man/man9/bus_set_resource.9
  head/share/man/man9/bus_space.9
  head/share/man/man9/config_intrhook.9
  head/share/man/man9/device_get_name.9
  head/share/man/man9/device_get_parent.9
  head/share/man/man9/device_get_sysctl.9
  head/share/man/man9/device_printf.9
  head/share/man/man9/device_set_driver.9
  head/share/man/man9/owll.9
  head/share/man/man9/own.9
  head/share/man/man9/resource_int_value.9

Modified: head/share/man/man9/BUS_ADD_CHILD.9
==
--- head/share/man/man9/BUS_ADD_CHILD.9 Tue Dec  3 14:48:13 2019
(r355329)
+++ head/share/man/man9/BUS_ADD_CHILD.9 Tue Dec  3 15:48:28 2019
(r355330)
@@ -1,10 +1,6 @@
 .\" -*- nroff -*-
 .\"
-.\" Copyright (c) 2004 M. Warner Losh.
-.\"
-.\" All rights reserved.
-.\"
-.\" This program is free software.
+.\" Copyright (c) 2004 M. Warner Losh 
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: head/share/man/man9/bus_activate_resource.9
==
--- head/share/man/man9/bus_activate_resource.9 Tue Dec  3 14:48:13 2019
(r355329)
+++ head/share/man/man9/bus_activate_resource.9 Tue Dec  3 15:48:28 2019
(r355330)
@@ -1,10 +1,6 @@
 .\" -*- nroff -*-
 .\"
-.\" Copyright (c) 2003 M. Warner Losh
-.\"
-.\" All rights reserved.
-.\"
-.\" This program is free software.
+.\" Copyright (c) 2004 M. Warner Losh 
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: head/share/man/man9/bus_child_present.9
==
--- head/share/man/man9/bus_child_present.9 Tue Dec  3 14:48:13 2019
(r355329)
+++ head/share/man/man9/bus_child_present.9 Tue Dec  3 15:48:28 2019
(r355330)
@@ -1,10 +1,6 @@
 .\" -*- nroff -*-
 .\"
-.\" Copyright (c) 2003 M. Warner Losh
-.\"
-.\" All rights reserved.
-.\"
-.\" This program is free software.
+.\" Copyright (c) 2003 M. Warner Losh 
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: head/share/man/man9/bus_set_resource.9
==
--- head/share/man/man9/bus_set_resource.9  Tue Dec  3 14:48:13 2019
(r355329)
+++ head/share/man/man9/bus_set_resource.9  Tue Dec  3 15:48:28 2019
(r355330)
@@ -1,10 +1,6 @@
 .\" -*- nroff -*-
 .\"
-.\" Copyright (c) 2003 M. Warner Losh
-.\"
-.\" All rights reserved.
-.\"
-.\" This program is free software.
+.\" Copyright (c) 2003 M. Warner Losh 
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: head/share/man/man9/bus_space.9
==
--- head/share/man/man9/bus_space.9 Tue Dec  3 14:48:13 2019
(r355329)
+++ head/share/man/man9/bus_space.9 Tue Dec  3 15:48:28 2019
(r355330)
@@ -1,6 +1,6 @@
 .\" $NetBSD: bus_space.9,v 1.9 1999/03/06 22:09:29 mycroft Exp $
 .\"
-.\" Copyright (c) 2005 M. Warner Losh.
+.\" Copyright (c) 2005 M. Warner Losh 
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: head/share/man/man9/config_intrhook.9
==
--- head/share/man/man9/config_intrhook.9   Tue Dec  3 14:48:13 2019
(r355329)
+++ head/share/man/man9/config_intrhook.9   Tue Dec  3 15:48:28 2019
(r355330)
@@ -1,5 +1,5 @@
 .\"
-.\" Copyright (C) 2006 M. Warner Losh .
+.\" Copyright (C) 2006 M. Warner Losh 
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions

Modified: head/share/man/man9/device_get_name.9
==
--- head/share/man/man9/device_get_name.9   Tue Dec  3 14:48:13 2019
(r355329)
+++ head/share/man/man9/device_get_name.9   Tue Dec  3 15:48:28 2019
(r355330)
@@ -1,10 +1,6 @@
 .\" -*- nroff -*-
 .\"
-.\" Copyright (c) 2003 M. Warner Losh
-.\"
-.\" All rights 

Re: svn commit: r355301 - head/usr.sbin/bhyve

2019-12-03 Thread Rodney W. Grimes
> On Mon, 2019-12-02 at 23:22 -0800, Rodney W. Grimes wrote:
> > > On Mon, 2019-12-02 at 20:51 +, Vincenzo Maffione wrote:
> > > > Author: vmaffione
> > > > Date: Mon Dec  2 20:51:46 2019
> > > > New Revision: 355301
> > > > URL: https://svnweb.freebsd.org/changeset/base/355301
> > > > 
> > > > Log:
> > > >   bhyve: uniform printf format string newlines
> > > >   
> > > >   Some of the printf statements only use LF to get a newline.
> > > > However, a CR character is also required for the serial console to
> > > > print debug logs in a nice way.
> > > >   Fix those code locations that only use LF, by adding a CR
> > > > character.
> > > >   
> > > >   Reviewed by:  markj, aleksandr.fedo...@itglobal.com
> > > >   MFC after:1 week
> > > >   Differential Revision:https://reviews.freebsd.org/D22552
> > > > 
> > > > Modified:
> > > >   head/usr.sbin/bhyve/audio.c
> > > >   head/usr.sbin/bhyve/hda_codec.c
> > > >   head/usr.sbin/bhyve/net_backends.c
> > > >   head/usr.sbin/bhyve/pci_ahci.c
> > > >   head/usr.sbin/bhyve/pci_e82545.c
> > > >   head/usr.sbin/bhyve/pci_hda.c
> > > >   head/usr.sbin/bhyve/pci_nvme.c
> > > >   head/usr.sbin/bhyve/pci_virtio_block.c
> > > >   head/usr.sbin/bhyve/pci_virtio_console.c
> > > >   head/usr.sbin/bhyve/pci_virtio_net.c
> > > >   head/usr.sbin/bhyve/pci_virtio_rnd.c
> > > >   head/usr.sbin/bhyve/pci_virtio_scsi.c
> > > >   head/usr.sbin/bhyve/pci_xhci.c
> > > >   head/usr.sbin/bhyve/rfb.c
> > > > 
> > > 
> > > These changes seem wrong in a couple ways...
> > > 
> > >  - Lines are terminated by linefeeds in unix-like systems.  If
> > > linefeeds need to be translated to include carriage returns, that's the
> > > responsibility of the terminal/line-discipline layer, not the source
> > > strings being printed.
> > 
> > Fully agree, this change seems wrong to me for Ian's stated reason here.
> > 
> > > 
> > >  - The sequence \n\r is very strange.  For systems that do prefer
> > > carriage returns, the \r always comes before the \n (or stands alone on
> > > Mac systems), not after.
> > > 
> > > I have a feeling that the root of this is something like "lots of
> > > people use bhyve for Windows, so they use Windows apps to look at logs,
> > > so the logs should be formatted for Windows."  If that's the reasoning,
> > > then why shouldn't we convert EVERY printf in the source base to
> > > include carriage returns, just in case a windows user wants to browse a
> > > log file?
> > 
> > This is not that issue, it is something going on with the line
> > discipline when using the bhyve console device.  I believe the
> > line displine being different from what bhyve itself is expecting
> > so when console output is intermixed with output from bhyve itself
> > things go wrong.
> > 
> > The printf's in this patch are coming from the bhyve process that
> > has a fd open to the launching tty, the line discipline on that tty
> > is changed to something different after you open the
> > console device from that same controlling tty, or that is my hypothosis
> > on what is going wrong.
> 
> There is a cfmakeraw() call in usr.sbin/bhyve/consport.c; that would
> definitely turn off nl->crnl translations.  I think that is the other
> end of the bhyve console that I posted a patch for yesterday, and I
> think the console driver is probably still the right place to do that
> translation (because other console drivers do it that way).  But I'm
> not set up to run bhyve here, so I can't test my theory.

If no body gets it done by the time I return to Portland I'll test
your patch to see if it fixes the issues I have seen with use of
the console and bhyve mixing output.

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


Re: svn commit: r355301 - head/usr.sbin/bhyve

2019-12-03 Thread Ian Lepore
On Mon, 2019-12-02 at 23:22 -0800, Rodney W. Grimes wrote:
> > On Mon, 2019-12-02 at 20:51 +, Vincenzo Maffione wrote:
> > > Author: vmaffione
> > > Date: Mon Dec  2 20:51:46 2019
> > > New Revision: 355301
> > > URL: https://svnweb.freebsd.org/changeset/base/355301
> > > 
> > > Log:
> > >   bhyve: uniform printf format string newlines
> > >   
> > >   Some of the printf statements only use LF to get a newline.
> > > However, a CR character is also required for the serial console to
> > > print debug logs in a nice way.
> > >   Fix those code locations that only use LF, by adding a CR
> > > character.
> > >   
> > >   Reviewed by:markj, aleksandr.fedo...@itglobal.com
> > >   MFC after:  1 week
> > >   Differential Revision:  https://reviews.freebsd.org/D22552
> > > 
> > > Modified:
> > >   head/usr.sbin/bhyve/audio.c
> > >   head/usr.sbin/bhyve/hda_codec.c
> > >   head/usr.sbin/bhyve/net_backends.c
> > >   head/usr.sbin/bhyve/pci_ahci.c
> > >   head/usr.sbin/bhyve/pci_e82545.c
> > >   head/usr.sbin/bhyve/pci_hda.c
> > >   head/usr.sbin/bhyve/pci_nvme.c
> > >   head/usr.sbin/bhyve/pci_virtio_block.c
> > >   head/usr.sbin/bhyve/pci_virtio_console.c
> > >   head/usr.sbin/bhyve/pci_virtio_net.c
> > >   head/usr.sbin/bhyve/pci_virtio_rnd.c
> > >   head/usr.sbin/bhyve/pci_virtio_scsi.c
> > >   head/usr.sbin/bhyve/pci_xhci.c
> > >   head/usr.sbin/bhyve/rfb.c
> > > 
> > 
> > These changes seem wrong in a couple ways...
> > 
> >  - Lines are terminated by linefeeds in unix-like systems.  If
> > linefeeds need to be translated to include carriage returns, that's the
> > responsibility of the terminal/line-discipline layer, not the source
> > strings being printed.
> 
> Fully agree, this change seems wrong to me for Ian's stated reason here.
> 
> > 
> >  - The sequence \n\r is very strange.  For systems that do prefer
> > carriage returns, the \r always comes before the \n (or stands alone on
> > Mac systems), not after.
> > 
> > I have a feeling that the root of this is something like "lots of
> > people use bhyve for Windows, so they use Windows apps to look at logs,
> > so the logs should be formatted for Windows."  If that's the reasoning,
> > then why shouldn't we convert EVERY printf in the source base to
> > include carriage returns, just in case a windows user wants to browse a
> > log file?
> 
> This is not that issue, it is something going on with the line
> discipline when using the bhyve console device.  I believe the
> line displine being different from what bhyve itself is expecting
> so when console output is intermixed with output from bhyve itself
> things go wrong.
> 
> The printf's in this patch are coming from the bhyve process that
> has a fd open to the launching tty, the line discipline on that tty
> is changed to something different after you open the
> console device from that same controlling tty, or that is my hypothosis
> on what is going wrong.

There is a cfmakeraw() call in usr.sbin/bhyve/consport.c; that would
definitely turn off nl->crnl translations.  I think that is the other
end of the bhyve console that I posted a patch for yesterday, and I
think the console driver is probably still the right place to do that
translation (because other console drivers do it that way).  But I'm
not set up to run bhyve here, so I can't test my theory.

-- Ian

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


svn commit: r355329 - in stable/11/sys/dev: ahci usb/controller

2019-12-03 Thread Alexander Motin
Author: mav
Date: Tue Dec  3 14:48:13 2019
New Revision: 355329
URL: https://svnweb.freebsd.org/changeset/base/355329

Log:
  MFC r355113: Add some IDs of Intel Wildcat Point-LP.

Modified:
  stable/11/sys/dev/ahci/ahci_pci.c
  stable/11/sys/dev/usb/controller/ehci_pci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/ahci/ahci_pci.c
==
--- stable/11/sys/dev/ahci/ahci_pci.c   Tue Dec  3 14:47:50 2019
(r355328)
+++ stable/11/sys/dev/ahci/ahci_pci.c   Tue Dec  3 14:48:13 2019
(r355329)
@@ -212,6 +212,10 @@ static const struct {
{0x9c078086, 0x00, "Intel Lynx Point-LP (RAID)",0},
{0x9c0e8086, 0x00, "Intel Lynx Point-LP (RAID)",0},
{0x9c0f8086, 0x00, "Intel Lynx Point-LP (RAID)",0},
+   {0x9c838086, 0x00, "Intel Wildcat Point-LP",0},
+   {0x9c858086, 0x00, "Intel Wildcat Point-LP (RAID)", 0},
+   {0x9c878086, 0x00, "Intel Wildcat Point-LP (RAID)", 0},
+   {0x9c8f8086, 0x00, "Intel Wildcat Point-LP (RAID)", 0},
{0x9d038086, 0x00, "Intel Sunrise Point-LP",0},
{0x9d058086, 0x00, "Intel Sunrise Point-LP (RAID)", 0},
{0x9d078086, 0x00, "Intel Sunrise Point-LP (RAID)", 0},

Modified: stable/11/sys/dev/usb/controller/ehci_pci.c
==
--- stable/11/sys/dev/usb/controller/ehci_pci.c Tue Dec  3 14:47:50 2019
(r355328)
+++ stable/11/sys/dev/usb/controller/ehci_pci.c Tue Dec  3 14:48:13 2019
(r355329)
@@ -180,6 +180,8 @@ ehci_pci_match(device_t self)
return ("Intel Wellsburg USB 2.0 controller");
case 0x9c268086:
return ("Intel Lynx Point-LP USB 2.0 controller");
+   case 0x9ca68086:
+   return ("Intel Wildcat Point-LP USB 2.0 controller");
 
case 0x00e01033:
return ("NEC uPD 72010x USB 2.0 controller");
___
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: r355328 - in stable/12/sys/dev: ahci usb/controller

2019-12-03 Thread Alexander Motin
Author: mav
Date: Tue Dec  3 14:47:50 2019
New Revision: 355328
URL: https://svnweb.freebsd.org/changeset/base/355328

Log:
  MFC r355113: Add some IDs of Intel Wildcat Point-LP.

Modified:
  stable/12/sys/dev/ahci/ahci_pci.c
  stable/12/sys/dev/usb/controller/ehci_pci.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/ahci/ahci_pci.c
==
--- stable/12/sys/dev/ahci/ahci_pci.c   Tue Dec  3 14:46:38 2019
(r355327)
+++ stable/12/sys/dev/ahci/ahci_pci.c   Tue Dec  3 14:47:50 2019
(r355328)
@@ -212,6 +212,10 @@ static const struct {
{0x9c078086, 0x00, "Intel Lynx Point-LP (RAID)",0},
{0x9c0e8086, 0x00, "Intel Lynx Point-LP (RAID)",0},
{0x9c0f8086, 0x00, "Intel Lynx Point-LP (RAID)",0},
+   {0x9c838086, 0x00, "Intel Wildcat Point-LP",0},
+   {0x9c858086, 0x00, "Intel Wildcat Point-LP (RAID)", 0},
+   {0x9c878086, 0x00, "Intel Wildcat Point-LP (RAID)", 0},
+   {0x9c8f8086, 0x00, "Intel Wildcat Point-LP (RAID)", 0},
{0x9d038086, 0x00, "Intel Sunrise Point-LP",0},
{0x9d058086, 0x00, "Intel Sunrise Point-LP (RAID)", 0},
{0x9d078086, 0x00, "Intel Sunrise Point-LP (RAID)", 0},

Modified: stable/12/sys/dev/usb/controller/ehci_pci.c
==
--- stable/12/sys/dev/usb/controller/ehci_pci.c Tue Dec  3 14:46:38 2019
(r355327)
+++ stable/12/sys/dev/usb/controller/ehci_pci.c Tue Dec  3 14:47:50 2019
(r355328)
@@ -182,6 +182,8 @@ ehci_pci_match(device_t self)
return ("Intel Wellsburg USB 2.0 controller");
case 0x9c268086:
return ("Intel Lynx Point-LP USB 2.0 controller");
+   case 0x9ca68086:
+   return ("Intel Wildcat Point-LP USB 2.0 controller");
 
case 0x00e01033:
return ("NEC uPD 72010x USB 2.0 controller");
___
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: r355327 - in head/sys: netinet netinet6

2019-12-03 Thread Bjoern A. Zeeb
Author: bz
Date: Tue Dec  3 14:46:38 2019
New Revision: 355327
URL: https://svnweb.freebsd.org/changeset/base/355327

Log:
  Make icmp6_reflect() static.
  
  icmp6_reflect() is not used anywhere outside icmp6.c, no reason to
  export it.
  
  Sponsored by: Netflix

Modified:
  head/sys/netinet/icmp6.h
  head/sys/netinet6/icmp6.c

Modified: head/sys/netinet/icmp6.h
==
--- head/sys/netinet/icmp6.hTue Dec  3 13:47:46 2019(r355326)
+++ head/sys/netinet/icmp6.hTue Dec  3 14:46:38 2019(r355327)
@@ -701,7 +701,6 @@ voidicmp6_error2(struct mbuf *, int, int, int, 
struct
 inticmp6_input(struct mbuf **, int *, int);
 void   icmp6_fasttimo(void);
 void   icmp6_slowtimo(void);
-void   icmp6_reflect(struct mbuf *, size_t);
 void   icmp6_prepare(struct mbuf *);
 void   icmp6_redirect_input(struct mbuf *, int);
 void   icmp6_redirect_output(struct mbuf *, struct rtentry *);

Modified: head/sys/netinet6/icmp6.c
==
--- head/sys/netinet6/icmp6.c   Tue Dec  3 13:47:46 2019(r355326)
+++ head/sys/netinet6/icmp6.c   Tue Dec  3 14:46:38 2019(r355327)
@@ -137,6 +137,7 @@ VNET_DECLARE(int, icmp6_nodeinfo);
 
 static void icmp6_errcount(int, int);
 static int icmp6_rip6_input(struct mbuf **, int);
+static void icmp6_reflect(struct mbuf *, size_t);
 static int icmp6_ratelimit(const struct in6_addr *, const int, const int);
 static const char *icmp6_redirect_diag(struct in6_addr *,
struct in6_addr *, struct in6_addr *);
@@ -2034,7 +2035,7 @@ icmp6_rip6_input(struct mbuf **mp, int off)
  * Reflect the ip6 packet back to the source.
  * OFF points to the icmp6 header, counted from the top of the mbuf.
  */
-void
+static void
 icmp6_reflect(struct mbuf *m, size_t off)
 {
struct in6_addr src6, *srcp;
___
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: r355326 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic

2019-12-03 Thread Cy Schubert
Author: cy
Date: Tue Dec  3 13:47:46 2019
New Revision: 355326
URL: https://svnweb.freebsd.org/changeset/base/355326

Log:
  MFC r354269:
  
  MFV r354257:
  
  Update sqlite3-3.29.0 (329) --> sqlite3-3.30.1 (3300100)

Modified:
  stable/11/contrib/sqlite3/Makefile.msc
  stable/11/contrib/sqlite3/configure
  stable/11/contrib/sqlite3/configure.ac
  stable/11/contrib/sqlite3/shell.c
  stable/11/contrib/sqlite3/sqlite3.c
  stable/11/contrib/sqlite3/sqlite3.h
  stable/11/contrib/sqlite3/sqlite3ext.h
  stable/11/contrib/sqlite3/tea/configure
  stable/11/contrib/sqlite3/tea/configure.ac
  stable/11/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/contrib/sqlite3/Makefile.msc
  stable/12/contrib/sqlite3/configure
  stable/12/contrib/sqlite3/configure.ac
  stable/12/contrib/sqlite3/shell.c
  stable/12/contrib/sqlite3/sqlite3.c
  stable/12/contrib/sqlite3/sqlite3.h
  stable/12/contrib/sqlite3/sqlite3ext.h
  stable/12/contrib/sqlite3/tea/configure
  stable/12/contrib/sqlite3/tea/configure.ac
  stable/12/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/contrib/sqlite3/Makefile.msc
==
--- stable/11/contrib/sqlite3/Makefile.msc  Tue Dec  3 09:48:43 2019
(r355325)
+++ stable/11/contrib/sqlite3/Makefile.msc  Tue Dec  3 13:47:46 2019
(r355326)
@@ -73,7 +73,7 @@ API_ARMOR = 0
 !IFNDEF NO_WARN
 !IF $(USE_FULLWARN)!=0
 NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206
-NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706
+NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706
 !ENDIF
 !ENDIF
 

Modified: stable/11/contrib/sqlite3/configure
==
--- stable/11/contrib/sqlite3/configure Tue Dec  3 09:48:43 2019
(r355325)
+++ stable/11/contrib/sqlite3/configure Tue Dec  3 13:47:46 2019
(r355326)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.29.0.
+# Generated by GNU Autoconf 2.69 for sqlite 3.30.1.
 #
 # Report bugs to .
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.29.0'
-PACKAGE_STRING='sqlite 3.29.0'
+PACKAGE_VERSION='3.30.1'
+PACKAGE_STRING='sqlite 3.30.1'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 PACKAGE_URL=''
 
@@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.29.0 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.30.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1412,7 +1412,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of sqlite 3.29.0:";;
+ short | recursive ) echo "Configuration of sqlite 3.30.1:";;
esac
   cat <<\_ACEOF
 
@@ -1537,7 +1537,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.29.0
+sqlite configure 3.30.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.29.0, which was
+It was created by sqlite $as_me 3.30.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2818,7 +2818,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='sqlite'
- VERSION='3.29.0'
+ VERSION='3.30.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.29.0, which was
+This file was extended by sqlite $as_me 3.30.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -14495,7 +14495,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-sqlite config.status 3.29.0
+sqlite config.status 3.30.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: stable/11/contrib/sqlite3/configure.ac
==
--- stable/11/contrib/sqlite3/configure.ac  

svn commit: r355326 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic

2019-12-03 Thread Cy Schubert
Author: cy
Date: Tue Dec  3 13:47:46 2019
New Revision: 355326
URL: https://svnweb.freebsd.org/changeset/base/355326

Log:
  MFC r354269:
  
  MFV r354257:
  
  Update sqlite3-3.29.0 (329) --> sqlite3-3.30.1 (3300100)

Modified:
  stable/12/contrib/sqlite3/Makefile.msc
  stable/12/contrib/sqlite3/configure
  stable/12/contrib/sqlite3/configure.ac
  stable/12/contrib/sqlite3/shell.c
  stable/12/contrib/sqlite3/sqlite3.c
  stable/12/contrib/sqlite3/sqlite3.h
  stable/12/contrib/sqlite3/sqlite3ext.h
  stable/12/contrib/sqlite3/tea/configure
  stable/12/contrib/sqlite3/tea/configure.ac
  stable/12/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/contrib/sqlite3/Makefile.msc
  stable/11/contrib/sqlite3/configure
  stable/11/contrib/sqlite3/configure.ac
  stable/11/contrib/sqlite3/shell.c
  stable/11/contrib/sqlite3/sqlite3.c
  stable/11/contrib/sqlite3/sqlite3.h
  stable/11/contrib/sqlite3/sqlite3ext.h
  stable/11/contrib/sqlite3/tea/configure
  stable/11/contrib/sqlite3/tea/configure.ac
  stable/11/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/contrib/sqlite3/Makefile.msc
==
--- stable/12/contrib/sqlite3/Makefile.msc  Tue Dec  3 09:48:43 2019
(r355325)
+++ stable/12/contrib/sqlite3/Makefile.msc  Tue Dec  3 13:47:46 2019
(r355326)
@@ -73,7 +73,7 @@ API_ARMOR = 0
 !IFNDEF NO_WARN
 !IF $(USE_FULLWARN)!=0
 NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206
-NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706
+NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706
 !ENDIF
 !ENDIF
 

Modified: stable/12/contrib/sqlite3/configure
==
--- stable/12/contrib/sqlite3/configure Tue Dec  3 09:48:43 2019
(r355325)
+++ stable/12/contrib/sqlite3/configure Tue Dec  3 13:47:46 2019
(r355326)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.29.0.
+# Generated by GNU Autoconf 2.69 for sqlite 3.30.1.
 #
 # Report bugs to .
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.29.0'
-PACKAGE_STRING='sqlite 3.29.0'
+PACKAGE_VERSION='3.30.1'
+PACKAGE_STRING='sqlite 3.30.1'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 PACKAGE_URL=''
 
@@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.29.0 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.30.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1412,7 +1412,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of sqlite 3.29.0:";;
+ short | recursive ) echo "Configuration of sqlite 3.30.1:";;
esac
   cat <<\_ACEOF
 
@@ -1537,7 +1537,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.29.0
+sqlite configure 3.30.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.29.0, which was
+It was created by sqlite $as_me 3.30.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2818,7 +2818,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='sqlite'
- VERSION='3.29.0'
+ VERSION='3.30.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.29.0, which was
+This file was extended by sqlite $as_me 3.30.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -14495,7 +14495,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-sqlite config.status 3.29.0
+sqlite config.status 3.30.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: stable/12/contrib/sqlite3/configure.ac
==
--- stable/12/contrib/sqlite3/configure.ac  

svn commit: r355325 - head/lib/libdevstat

2019-12-03 Thread Andriy Gapon
Author: avg
Date: Tue Dec  3 09:48:43 2019
New Revision: 355325
URL: https://svnweb.freebsd.org/changeset/base/355325

Log:
  devstat_selectdevs: resize dev_select only after copying data out of it
  
  The resizing could be a downsizing so some data would be lost and we
  could attempt to read past the end of the new memory allocation.
  
  MFC after:2 weeks
  Sponsored by: Panzura

Modified:
  head/lib/libdevstat/devstat.c

Modified: head/lib/libdevstat/devstat.c
==
--- head/lib/libdevstat/devstat.c   Tue Dec  3 09:12:53 2019
(r355324)
+++ head/lib/libdevstat/devstat.c   Tue Dec  3 09:48:43 2019
(r355325)
@@ -584,10 +584,10 @@ devstat_selectdevs(struct device_selection **dev_selec
 * In this case, we have selected devices before, but the device
 * list has changed since we last selected devices, so we need to
 * either enlarge or reduce the size of the device selection list.
+* But delay the resizing until after copying the data to old_dev_select
+* as to not lose any data in the case of reducing the size.
 */
} else if (*num_selections != numdevs) {
-   *dev_select = (struct device_selection *)reallocf(*dev_select,
-   numdevs * sizeof(struct device_selection));
*select_generation = current_generation;
init_selections = 1;
/*
@@ -643,6 +643,11 @@ devstat_selectdevs(struct device_selection **dev_selec
old_num_selections = *num_selections;
bcopy(*dev_select, old_dev_select, 
sizeof(struct device_selection) * *num_selections);
+   }
+
+   if (!changed && *num_selections != numdevs) {
+   *dev_select = (struct device_selection *)reallocf(*dev_select,
+   numdevs * sizeof(struct device_selection));
}
 
if (init_selections != 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"


Re: svn commit: r355188 - in head/riscv: . sifive

2019-12-03 Thread Ravi Pokala
-Original Message-
From: Emmanuel Vadot 
Date: 2019-12-03, Tuesday at 01:13
To: Ravi Pokala 
Cc: Emmanuel Vadot , , 
, 
Subject: Re: svn commit: r355188 - in head/riscv: . sifive

On Mon, 02 Dec 2019 13:36:06 -0800
Ravi Pokala  wrote:

> Hi Manu,
> 
> This creates a top-level "riscv" directory, but there are no other 
top-level ${TARGET} directories.
> 
> It looks like other *.dts and *.dtsi files live in either
> 
> sys/dts/${TARGET}
> 
> or
> 
> sys/gnu/dts/${TARGET}/(vendor/)?
> 
> So perhaps these should be moved to one of those directories, as 
appropriate?
> 
> Thanks,
> 
> Ravi (rpokala@)

 Thanks, I don't know how I didn't see that ... fixed with revert +
r355324.

Thank you!

-Ravi (rpokala@)

> ?-Original Message-
> From:  on behalf of Emmanuel Vadot 

> Date: 2019-11-28, Thursday at 11:38
> To: , , 

> Subject: svn commit: r355188 - in head/riscv: . sifive
> 
> Author: manu
> Date: Thu Nov 28 19:38:57 2019
> New Revision: 355188
> URL: https://svnweb.freebsd.org/changeset/base/355188
> 
> Log:
>   Import riscv DTS files
>   
>   Requested by: mhorne
> 
> Added:
>   head/riscv/
>  - copied from r355184, vendor/device-tree/dist/src/riscv/
> Replaced:
>   head/riscv/sifive/fu540-c000.dtsi
>  - copied unchanged from r355185, 
vendor/device-tree/dist/src/riscv/sifive/fu540-c000.dtsi
>   head/riscv/sifive/hifive-unleashed-a00.dts
>  - copied unchanged from r355185, 
vendor/device-tree/dist/src/riscv/sifive/hifive-unleashed-a00.dts
> 
> Copied: head/riscv/sifive/fu540-c000.dtsi (from r355185, 
vendor/device-tree/dist/src/riscv/sifive/fu540-c000.dtsi)
> 
==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/riscv/sifive/fu540-c000.dtsi Thu Nov 28 19:38:57 2019
(r355188, copy of r355185, 
vendor/device-tree/dist/src/riscv/sifive/fu540-c000.dtsi)
> @@ -0,0 +1,251 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/* Copyright (c) 2018-2019 SiFive, Inc */
> +
> +/dts-v1/;
> +
> +#include 
> +
> +/ {
> + #address-cells = <2>;
> + #size-cells = <2>;
> + compatible = "sifive,fu540-c000", "sifive,fu540";
> +
> + aliases {
> + serial0 = 
> + serial1 = 
> + ethernet0 = 
> + };
> +
> + chosen {
> + };
> +
> + cpus {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + cpu0: cpu@0 {
> + compatible = "sifive,e51", "sifive,rocket0", 
"riscv";
> + device_type = "cpu";
> + i-cache-block-size = <64>;
> + i-cache-sets = <128>;
> + i-cache-size = <16384>;
> + reg = <0>;
> + riscv,isa = "rv64imac";
> + status = "disabled";
> + cpu0_intc: interrupt-controller {
> + #interrupt-cells = <1>;
> + compatible = "riscv,cpu-intc";
> + interrupt-controller;
> + };
> + };
> + cpu1: cpu@1 {
> + compatible = "sifive,u54-mc", "sifive,rocket0", 
"riscv";
> + d-cache-block-size = <64>;
> + d-cache-sets = <64>;
> + d-cache-size = <32768>;
> + d-tlb-sets = <1>;
> + d-tlb-size = <32>;
> + device_type = "cpu";
> + i-cache-block-size = <64>;
> + i-cache-sets = <64>;
> + i-cache-size = <32768>;
> + i-tlb-sets = <1>;
> + i-tlb-size = <32>;
> + mmu-type = "riscv,sv39";
> + reg = <1>;
> + riscv,isa = "rv64imafdc";
> + tlb-split;
> + cpu1_intc: interrupt-controller {
> + #interrupt-cells = <1>;
> + compatible = "riscv,cpu-intc";
> + interrupt-controller;
> + };
> +  

Re: svn commit: r355188 - in head/riscv: . sifive

2019-12-03 Thread Emmanuel Vadot
On Mon, 02 Dec 2019 13:36:06 -0800
Ravi Pokala  wrote:

> Hi Manu,
> 
> This creates a top-level "riscv" directory, but there are no other top-level 
> ${TARGET} directories.
> 
> It looks like other *.dts and *.dtsi files live in either
> 
> sys/dts/${TARGET}
> 
> or
> 
> sys/gnu/dts/${TARGET}/(vendor/)?
> 
> So perhaps these should be moved to one of those directories, as appropriate?
> 
> Thanks,
> 
> Ravi (rpokala@)

 Thanks, I don't know how I didn't see that ... fixed with revert +
r355324.

> ?-Original Message-
> From:  on behalf of Emmanuel Vadot 
> 
> Date: 2019-11-28, Thursday at 11:38
> To: , , 
> 
> Subject: svn commit: r355188 - in head/riscv: . sifive
> 
> Author: manu
> Date: Thu Nov 28 19:38:57 2019
> New Revision: 355188
> URL: https://svnweb.freebsd.org/changeset/base/355188
> 
> Log:
>   Import riscv DTS files
>   
>   Requested by: mhorne
> 
> Added:
>   head/riscv/
>  - copied from r355184, vendor/device-tree/dist/src/riscv/
> Replaced:
>   head/riscv/sifive/fu540-c000.dtsi
>  - copied unchanged from r355185, 
> vendor/device-tree/dist/src/riscv/sifive/fu540-c000.dtsi
>   head/riscv/sifive/hifive-unleashed-a00.dts
>  - copied unchanged from r355185, 
> vendor/device-tree/dist/src/riscv/sifive/hifive-unleashed-a00.dts
> 
> Copied: head/riscv/sifive/fu540-c000.dtsi (from r355185, 
> vendor/device-tree/dist/src/riscv/sifive/fu540-c000.dtsi)
> 
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/riscv/sifive/fu540-c000.dtsi Thu Nov 28 19:38:57 2019
> (r355188, copy of r355185, 
> vendor/device-tree/dist/src/riscv/sifive/fu540-c000.dtsi)
> @@ -0,0 +1,251 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/* Copyright (c) 2018-2019 SiFive, Inc */
> +
> +/dts-v1/;
> +
> +#include 
> +
> +/ {
> + #address-cells = <2>;
> + #size-cells = <2>;
> + compatible = "sifive,fu540-c000", "sifive,fu540";
> +
> + aliases {
> + serial0 = 
> + serial1 = 
> + ethernet0 = 
> + };
> +
> + chosen {
> + };
> +
> + cpus {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + cpu0: cpu@0 {
> + compatible = "sifive,e51", "sifive,rocket0", "riscv";
> + device_type = "cpu";
> + i-cache-block-size = <64>;
> + i-cache-sets = <128>;
> + i-cache-size = <16384>;
> + reg = <0>;
> + riscv,isa = "rv64imac";
> + status = "disabled";
> + cpu0_intc: interrupt-controller {
> + #interrupt-cells = <1>;
> + compatible = "riscv,cpu-intc";
> + interrupt-controller;
> + };
> + };
> + cpu1: cpu@1 {
> + compatible = "sifive,u54-mc", "sifive,rocket0", "riscv";
> + d-cache-block-size = <64>;
> + d-cache-sets = <64>;
> + d-cache-size = <32768>;
> + d-tlb-sets = <1>;
> + d-tlb-size = <32>;
> + device_type = "cpu";
> + i-cache-block-size = <64>;
> + i-cache-sets = <64>;
> + i-cache-size = <32768>;
> + i-tlb-sets = <1>;
> + i-tlb-size = <32>;
> + mmu-type = "riscv,sv39";
> + reg = <1>;
> + riscv,isa = "rv64imafdc";
> + tlb-split;
> + cpu1_intc: interrupt-controller {
> + #interrupt-cells = <1>;
> + compatible = "riscv,cpu-intc";
> + interrupt-controller;
> + };
> + };
> + cpu2: cpu@2 {
> + compatible = "sifive,u54-mc", "sifive,rocket0", "riscv";
> + d-cache-block-size = <64>;
> + d-cache-sets = <64>;
> + d-cache-size = <32768>;
> + d-tlb-sets = <1>;
> + d-tlb-size = <32>;
> + device_type = "cpu";
> + i-cache-block-size = <64>;
> + i-cache-sets = <64>;
> + i-cache-size = <32768>;
> + i-tlb-sets = <1>;
> + i-tlb-size = <32>;
> + mmu-type = "riscv,sv39";
> + reg = <2>;
> + riscv,isa = "rv64imafdc";
> + tlb-split;
> + cpu2_intc: interrupt-controller {
> + 

svn commit: r355324 - head/sys/gnu/dts/riscv

2019-12-03 Thread Emmanuel Vadot
Author: manu
Date: Tue Dec  3 09:12:53 2019
New Revision: 355324
URL: https://svnweb.freebsd.org/changeset/base/355324

Log:
  Import DTS files for riscv from Linux 5.4
  
  Requested by:  mhorne

Added:
  head/sys/gnu/dts/riscv/
 - copied from r355323, vendor/device-tree/dist/src/riscv/
___
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: r355323 - head/riscv

2019-12-03 Thread Emmanuel Vadot
Author: manu
Date: Tue Dec  3 09:06:37 2019
New Revision: 355323
URL: https://svnweb.freebsd.org/changeset/base/355323

Log:
  Revert r355188 as it shouldn't have created the risc-v directory at
  the top level.
  
  Reported by:  rpokala

Deleted:
  head/riscv/
___
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: r355322 - in head/sys: netinet netinet6

2019-12-03 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Dec  3 08:46:59 2019
New Revision: 355322
URL: https://svnweb.freebsd.org/changeset/base/355322

Log:
  Use refcount from "in_joingroup_locked()" when joining multicast
  groups. Do not acquire additional references. This makes the IPv4 IGMP
  code in line with the IPv6 MLD code.
  
  Background:
  The IPv4 multicast code puts an extra reference on the in_multi struct
  when joining groups.  This becomes visible when using daemons like
  igmpproxy from ports, that multicast entries do not disappear from the
  output of ifmcstat(8) when multicast streams are disconnected.
  
  This fixes a regression issue after r349762.
  
  While at it factor the ip_mfilter_insert() and ip6_mfilter_insert() calls
  to avoid repeated "is_new" check.
  
  Differential Revision:https://reviews.freebsd.org/D22595
  Tested by:Guido van Rooij 
  Reviewed by:  rgrimes (network)
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/netinet/in_mcast.c
  head/sys/netinet6/in6_mcast.c

Modified: head/sys/netinet/in_mcast.c
==
--- head/sys/netinet/in_mcast.c Tue Dec  3 07:22:16 2019(r355321)
+++ head/sys/netinet/in_mcast.c Tue Dec  3 08:46:59 2019(r355322)
@@ -2211,7 +2211,11 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt
 __func__);
goto out_inp_locked;
}
-   inm_acquire(imf->imf_inm);
+   /*
+* NOTE: Refcount from in_joingroup_locked()
+* is protecting membership.
+*/
+   ip_mfilter_insert(>imo_head, imf);
} else {
CTR1(KTR_IGMPV3, "%s: merge inm state", __func__);
IN_MULTI_LIST_LOCK();
@@ -2235,8 +2239,6 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt
goto out_inp_locked;
}
}
-   if (is_new)
-   ip_mfilter_insert(>imo_head, imf);
 
imf_commit(imf);
imf = NULL;

Modified: head/sys/netinet6/in6_mcast.c
==
--- head/sys/netinet6/in6_mcast.c   Tue Dec  3 07:22:16 2019
(r355321)
+++ head/sys/netinet6/in6_mcast.c   Tue Dec  3 08:46:59 2019
(r355322)
@@ -2111,6 +2111,7 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop
 * NOTE: Refcount from in6_joingroup_locked()
 * is protecting membership.
 */
+   ip6_mfilter_insert(>im6o_head, imf);
} else {
CTR1(KTR_MLD, "%s: merge inm state", __func__);
IN6_MULTI_LIST_LOCK();
@@ -2135,9 +2136,6 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop
goto out_in6p_locked;
}
}
-
-   if (is_new)
-   ip6_mfilter_insert(>im6o_head, imf);
 
im6f_commit(imf);
imf = 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"