svn commit: r346025 - head/lib/libvgl

2019-04-07 Thread Bruce Evans
Author: bde
Date: Mon Apr  8 04:54:15 2019
New Revision: 346025
URL: https://svnweb.freebsd.org/changeset/base/346025

Log:
  Fix copying of MEMBUFs to MEMBUFs.  This case was implemented by using
  the same code as the VIDBUF8 case, so it only worked for depths <= 8.
  The 2 directions for copying between VIDBUFs and MEMBUFs worked by using
  a Read/Write organization which makes the destination a VIDBUF so the
  MEMBUF case was not reached, and the VIDBUF cases have already been fixed.
  
  Fix this by removing "optimizations" for the VIDBUF8 case so that the
  MEMBUF case can fall through to the general (non-segmented) case.  The
  optimizations were to duplicate code for the VIDBUF8 case so as to
  avoid 2 multiplications by 1 at runtime.  This optimization is not useful
  since the multiplications are not in the inner loop.
  
  Remove the same "optimization" for the VIDBUF8S case.  It was even less
  useful there since it duplicated more to do relatively less.

Modified:
  head/lib/libvgl/bitmap.c

Modified: head/lib/libvgl/bitmap.c
==
--- head/lib/libvgl/bitmap.cMon Apr  8 04:07:37 2019(r346024)
+++ head/lib/libvgl/bitmap.cMon Apr  8 04:54:15 2019(r346025)
@@ -136,16 +136,6 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi
 }
 break;
   case VIDBUF8S:
-pos = dst->VXsize * y + x;
-while (width > 0) {
-  offset = VGLSetSegment(pos);
-  i = min(VGLAdpInfo.va_window_size - offset, width);
-  bcopy(line, dst->Bitmap + offset, i);
-  line += i;
-  pos += i;
-  width -= i;
-}
-break;
   case VIDBUF16S:
   case VIDBUF24S:
   case VIDBUF32S:
@@ -160,11 +150,8 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi
   width -= i;
 }
 break;
-  case VIDBUF8:
   case MEMBUF:
-address = dst->Bitmap + dst->VXsize * y + x;
-bcopy(line, address, width);
-break;
+  case VIDBUF8:
   case VIDBUF16:
   case VIDBUF24:
   case VIDBUF32:
@@ -251,16 +238,6 @@ read_planar:
 }
 break;
   case VIDBUF8S:
-pos = src->VXsize * y + x;
-while (width > 0) {
-  offset = VGLSetSegment(pos);
-  i = min(VGLAdpInfo.va_window_size - offset, width);
-  bcopy(src->Bitmap + offset, line, i);
-  line += i;
-  pos += i;
-  width -= i;
-}
-break;
   case VIDBUF16S:
   case VIDBUF24S:
   case VIDBUF32S:
@@ -275,11 +252,8 @@ read_planar:
   width -= i;
 }
 break;
-  case VIDBUF8:
   case MEMBUF:
-address = src->Bitmap + src->VXsize * y + x;
-bcopy(address, line, width);
-break;
+  case VIDBUF8:
   case VIDBUF16:
   case VIDBUF24:
   case VIDBUF32:
___
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: r346024 - head/usr.sbin/vidcontrol

2019-04-07 Thread Bruce Evans
Author: bde
Date: Mon Apr  8 04:07:37 2019
New Revision: 346024
URL: https://svnweb.freebsd.org/changeset/base/346024

Log:
  Fix restoring the geometry when recovering from an error.  Just restore the
  previous geometry, and don't do extra work to calculate the default geometry
  so as to reset to that.

Modified:
  head/usr.sbin/vidcontrol/vidcontrol.c

Modified: head/usr.sbin/vidcontrol/vidcontrol.c
==
--- head/usr.sbin/vidcontrol/vidcontrol.c   Mon Apr  8 03:35:47 2019
(r346023)
+++ head/usr.sbin/vidcontrol/vidcontrol.c   Mon Apr  8 04:07:37 2019
(r346024)
@@ -171,9 +171,8 @@ revert(void)
else
ioctl(0, _IO('S', cur_info.video_mode_number), NULL);
if (cur_info.video_mode_info.vi_flags & V_INFO_GRAPHICS) {
-   size[0] = cur_info.video_mode_info.vi_width / 8;
-   size[1] = cur_info.video_mode_info.vi_height /
-   cur_info.console_info.font_size;
+   size[0] = cur_info.console_info.mv_csz;
+   size[1] = cur_info.console_info.mv_rsz;
size[2] = cur_info.console_info.font_size;
ioctl(0, KDRASTER, size);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r346023 - head/usr.bin/strings

2019-04-07 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Apr  8 03:35:47 2019
New Revision: 346023
URL: https://svnweb.freebsd.org/changeset/base/346023

Log:
  strings: disable Casper support while building native-xtools
  
  Reported by:  Charlie Li
  Tested by:Charlie Li

Modified:
  head/usr.bin/strings/Makefile

Modified: head/usr.bin/strings/Makefile
==
--- head/usr.bin/strings/Makefile   Sun Apr  7 21:01:02 2019
(r346022)
+++ head/usr.bin/strings/Makefile   Mon Apr  8 03:35:47 2019
(r346023)
@@ -10,7 +10,7 @@ PROG= strings
 
 LIBADD=elftc elf
 
-.if ${MK_CASPER} != "no" && !defined(BOOTSTRAPPING)
+.if ${MK_CASPER} != "no" && !defined(BOOTSTRAPPING) && !defined(NXB_TARGET)
 LIBADD+=   casper
 LIBADD+=   cap_fileargs
 CFLAGS+=   -DWITH_CASPER
___
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: r346012 - head/sys/sys

2019-04-07 Thread Warner Losh
On Sun, Apr 7, 2019, 1:32 PM O. Hartmann  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Am Sun, 7 Apr 2019 16:07:41 + (UTC)
> Mariusz Zaborski  schrieb:
>
> > Author: oshogbo
> > Date: Sun Apr  7 16:07:41 2019
> > New Revision: 346012
> > URL: https://svnweb.freebsd.org/changeset/base/346012
> >
> > Log:
> >   Bump FreeBSD version after r345982.
> >
> >   Reported by:Shawn Webb 
> >   Discussed with: imp, cy, rgrimes
> >
> > Modified:
> >   head/sys/sys/param.h
> >
> > Modified: head/sys/sys/param.h
> >
> ==
> > --- head/sys/sys/param.h  Sun Apr  7 14:30:17 2019(r346011)
> > +++ head/sys/sys/param.h  Sun Apr  7 16:07:41 2019(r346012)
> > @@ -60,7 +60,7 @@
> >   *   in the range 5 to 9.
> >   */
> >  #undef __FreeBSD_version
> > -#define __FreeBSD_version 1300017/* Master, propagated to newvers */
> > +#define __FreeBSD_version 1300018/* Master, propagated to newvers */
> >
> >  /*
> >   * __FreeBSD_kernel__ indicates that this system uses the kernel of
> FreeBSD,
> > ___
> > 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"
>
> I find myself bugged by this error while compiling world after the update
> of CURRENT to
> r346020:
>
> [...]
> Building /usr/obj/usr/src/amd64.amd64/usr.sbin/blacklistd/conf.o
> - --- all_subdir_usr.sbin/amd ---
> - --- amd.o ---
> /usr/src/contrib/amd/amd/amd.c:275:17: error: use of undeclared identifier
> 'HOST_OS_NAME'
>   gopt.op_sys = HOST_OS_NAME;
> ^
> /usr/src/contrib/amd/amd/amd.c:278:21: error: use of undeclared identifier
> 'HOST_OS_VERSION'
>   gopt.op_sys_ver = HOST_OS_VERSION;
> ^
> /usr/src/contrib/amd/amd/amd.c:281:22: error: use of undeclared identifier
> 'HOST_OS'
>   gopt.op_sys_full = HOST_OS;
>  ^
> 3 errors generated.
>

That was my bad. A fix has committed as r346022.

Warner

[...]
>
> Regards,
>
> oh
> - --
> O. Hartmann
>
> Ich widerspreche der Nutzung oder Übermittlung meiner Daten für
> Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG).
> -BEGIN PGP SIGNATURE-
>
> iHUEARYIAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCXKpPHAAKCRA4N1ZZPba5
> R6PZAP9y2rW9vEqML5dcmknUUyYawEs8DeMd625N0IpwlJxs1AEA5JW/RAB+QwEE
> v47aAnROqGCMVHRixGGNLJa0vKooOA8=
> =1Vht
> -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"


Re: svn commit: r346018 - head/sys/conf

2019-04-07 Thread Warner Losh
On Sun, Apr 7, 2019, 3:16 PM Oliver Pinter 
wrote:

> Please revert this patch. If I'm not wrong, this will break the
> freebsd-version command's generation or output.
>

You are going to need to be a lot more specific about this. It makes no
sense to me at all how any of this could break that. The code is identical
logically and produces the same result.

Warner


On Sunday, April 7, 2019, Warner Losh  wrote:
>
>> Author: imp
>> Date: Sun Apr  7 18:39:55 2019
>> New Revision: 346018
>> URL: https://svnweb.freebsd.org/changeset/base/346018
>>
>> Log:
>>   Use default shell assignment rather more complicated if then
>>   construct.
>>
>>   Discussed with: emaste@, allanjude@ (changes (or not) based on their
>> feedback)
>>   Differential Revision: https://reviews.freebsd.org/D19797
>>
>> Modified:
>>   head/sys/conf/newvers.sh
>>
>> Modified: head/sys/conf/newvers.sh
>>
>> ==
>> --- head/sys/conf/newvers.shSun Apr  7 18:31:45 2019(r346017)
>> +++ head/sys/conf/newvers.shSun Apr  7 18:39:55 2019(r346018)
>> @@ -46,10 +46,7 @@
>>
>>  TYPE="FreeBSD"
>>  REVISION="13.0"
>> -BRANCH="CURRENT"
>> -if [ -n "${BRANCH_OVERRIDE}" ]; then
>> -   BRANCH=${BRANCH_OVERRIDE}
>> -fi
>> +BRANCH=${BRANCH_OVERRIDE:-CURRENT}
>>  RELEASE="${REVISION}-${BRANCH}"
>>  VERSION="${TYPE} ${RELEASE}"
>>
>> @@ -108,21 +105,16 @@ if [ -z "${SYSDIR}" ]; then
>>  SYSDIR=$(dirname $0)/..
>>  fi
>>
>> -if [ -n "${PARAMFILE}" ]; then
>> -   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print
>> $3}' \
>> -   ${PARAMFILE})
>> -else
>> -   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print
>> $3}' \
>> -   ${SYSDIR}/sys/param.h)
>> -fi
>> +RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \
>> + ${PARAMFILE:-${SYSDIR}/sys/param.h})
>>
>> -b=share/examples/etc/bsd-style-copyright
>>  if [ -r "${SYSDIR}/../COPYRIGHT" ]; then
>> year=$(sed -Ee '/^Copyright .* The FreeBSD
>> Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT)
>>  else
>> year=$(date +%Y)
>>  fi
>>  # look for copyright template
>> +b=share/examples/etc/bsd-style-copyright
>>  for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b
>>  do
>> if [ -r "$bsd_copyright" ]; then
>> @@ -150,9 +142,7 @@ COPYRIGHT="$COPYRIGHT
>>
>>  # VARS_ONLY means no files should be generated, this is just being
>>  # included.
>> -if [ -n "$VARS_ONLY" ]; then
>> -   return 0
>> -fi
>> +[ -n "$VARS_ONLY" ] && return 0
>>
>>  LC_ALL=C; export LC_ALL
>>  if [ ! -r version ]
>> ___
>> 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"
>>
>
___
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: r346017 - in head: libexec/rc libexec/rc/rc.d share/man/man5

2019-04-07 Thread Chris Rees
Hey,

On 7 April 2019 22:14:56 BST, Oliver Pinter  
wrote:
>On Sunday, April 7, 2019, Chris Rees  wrote:
>
>> Author: crees (doc,ports committer)
>> Date: Sun Apr  7 18:31:45 2019
>> New Revision: 346017
>> URL: https://svnweb.freebsd.org/changeset/base/346017
>>
>> Log:
>>   Remove now unnecessary kldstat check before attempting to load
>modules.
>>
>>   Since r233109, kldload has the -n option, which silently ignores
>options
>>   that are already loaded.
>>
>>  
>https://lists.freebsd.org/pipermail/freebsd-rc/2018-December/003899.html
>>
>>   Note that this script no longer reports if the module is already
>loaded,
>>   but it could be argued this wasn't particularly useful information.
>>
>>   PR:   docs/234248
>
>
>This is why a docs PR?

Followup from that PR.

>>   Reviewed by:  bcr (docs), kib, rgrimes (visual)
>
>
>I haven't seen kib on the reviewers list.

Please refer to the conversation on freebsd-rc that I linked in the commit 
message.

Chris
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
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: r346018 - head/sys/conf

2019-04-07 Thread Oliver Pinter
Please revert this patch. If I'm not wrong, this will break the
freebsd-version command's generation or output.

On Sunday, April 7, 2019, Warner Losh  wrote:

> Author: imp
> Date: Sun Apr  7 18:39:55 2019
> New Revision: 346018
> URL: https://svnweb.freebsd.org/changeset/base/346018
>
> Log:
>   Use default shell assignment rather more complicated if then
>   construct.
>
>   Discussed with: emaste@, allanjude@ (changes (or not) based on their
> feedback)
>   Differential Revision: https://reviews.freebsd.org/D19797
>
> Modified:
>   head/sys/conf/newvers.sh
>
> Modified: head/sys/conf/newvers.sh
> 
> ==
> --- head/sys/conf/newvers.shSun Apr  7 18:31:45 2019(r346017)
> +++ head/sys/conf/newvers.shSun Apr  7 18:39:55 2019(r346018)
> @@ -46,10 +46,7 @@
>
>  TYPE="FreeBSD"
>  REVISION="13.0"
> -BRANCH="CURRENT"
> -if [ -n "${BRANCH_OVERRIDE}" ]; then
> -   BRANCH=${BRANCH_OVERRIDE}
> -fi
> +BRANCH=${BRANCH_OVERRIDE:-CURRENT}
>  RELEASE="${REVISION}-${BRANCH}"
>  VERSION="${TYPE} ${RELEASE}"
>
> @@ -108,21 +105,16 @@ if [ -z "${SYSDIR}" ]; then
>  SYSDIR=$(dirname $0)/..
>  fi
>
> -if [ -n "${PARAMFILE}" ]; then
> -   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print
> $3}' \
> -   ${PARAMFILE})
> -else
> -   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print
> $3}' \
> -   ${SYSDIR}/sys/param.h)
> -fi
> +RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \
> + ${PARAMFILE:-${SYSDIR}/sys/param.h})
>
> -b=share/examples/etc/bsd-style-copyright
>  if [ -r "${SYSDIR}/../COPYRIGHT" ]; then
> year=$(sed -Ee '/^Copyright .* The FreeBSD
> Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT)
>  else
> year=$(date +%Y)
>  fi
>  # look for copyright template
> +b=share/examples/etc/bsd-style-copyright
>  for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b
>  do
> if [ -r "$bsd_copyright" ]; then
> @@ -150,9 +142,7 @@ COPYRIGHT="$COPYRIGHT
>
>  # VARS_ONLY means no files should be generated, this is just being
>  # included.
> -if [ -n "$VARS_ONLY" ]; then
> -   return 0
> -fi
> +[ -n "$VARS_ONLY" ] && return 0
>
>  LC_ALL=C; export LC_ALL
>  if [ ! -r version ]
> ___
> 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"
>
___
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: r346017 - in head: libexec/rc libexec/rc/rc.d share/man/man5

2019-04-07 Thread Oliver Pinter
On Sunday, April 7, 2019, Chris Rees  wrote:

> Author: crees (doc,ports committer)
> Date: Sun Apr  7 18:31:45 2019
> New Revision: 346017
> URL: https://svnweb.freebsd.org/changeset/base/346017
>
> Log:
>   Remove now unnecessary kldstat check before attempting to load modules.
>
>   Since r233109, kldload has the -n option, which silently ignores options
>   that are already loaded.
>
>   https://lists.freebsd.org/pipermail/freebsd-rc/2018-December/003899.html
>
>   Note that this script no longer reports if the module is already loaded,
>   but it could be argued this wasn't particularly useful information.
>
>   PR:   docs/234248


This is why a docs PR?


>   Reviewed by:  bcr (docs), kib, rgrimes (visual)


I haven't seen kib on the reviewers list.


>   Approved by:  jilles
>   Differential Revision:https://reviews.freebsd.org/D18670
>
> Modified:
>   head/libexec/rc/rc.d/abi
>   head/libexec/rc/rc.d/bthidd
>   head/libexec/rc/rc.d/cfumass
>   head/libexec/rc/rc.d/kld
>   head/libexec/rc/rc.d/mdconfig
>   head/libexec/rc/rc.d/mdconfig2
>   head/libexec/rc/rc.d/mountcritremote
>   head/libexec/rc/rc.d/syscons
>   head/libexec/rc/rc.subr
>   head/share/man/man5/rc.conf.5
>
> Modified: head/libexec/rc/rc.d/abi
> 
> ==
> --- head/libexec/rc/rc.d/abiSun Apr  7 18:24:26 2019(r346016)
> +++ head/libexec/rc/rc.d/abiSun Apr  7 18:31:45 2019(r346017)
> @@ -27,10 +27,10 @@ linux_start()
> local _tmpdir
>
> echo -n ' linux'
> -   load_kld -e 'linux(aout|elf)' linux
> +   load_kld linux
> case `sysctl -n hw.machine_arch` in
> amd64)
> -   load_kld -e 'linux64elf' linux64
> +   load_kld linux64
> ;;
> esac
> if [ -x /compat/linux/sbin/ldconfigDisabled ]; then
>
> Modified: head/libexec/rc/rc.d/bthidd
> 
> ==
> --- head/libexec/rc/rc.d/bthidd Sun Apr  7 18:24:26 2019(r346016)
> +++ head/libexec/rc/rc.d/bthidd Sun Apr  7 18:31:45 2019(r346017)
> @@ -34,11 +34,11 @@ evdev_enabled()
>  bthidd_prestart()
>  {
> if evdev_enabled; then
> -   load_kld -m uinput uinput
> +   load_kld uinput
> fi
> -   load_kld -m kbdmux kbdmux
> -   load_kld -m vkbd vkbd
> -   load_kld -m ng_btsocket ng_btsocket
> +   load_kld kbdmux
> +   load_kld vkbd
> +   load_kld ng_btsocket
> return 0
>  }
>
>
> Modified: head/libexec/rc/rc.d/cfumass
> 
> ==
> --- head/libexec/rc/rc.d/cfumassSun Apr  7 18:24:26 2019
> (r346016)
> +++ head/libexec/rc/rc.d/cfumassSun Apr  7 18:31:45 2019
> (r346017)
> @@ -75,7 +75,7 @@ cfumass_start()
> return "${err}"
> fi
>
> -   load_kld -e cfumass cfumass
> +   load_kld cfumass
>
> # If the template is already switched to Mass Storage, then reset
> # it to -1 to force the host to reenumerate it; otherwise it might
>
> Modified: head/libexec/rc/rc.d/kld
> 
> ==
> --- head/libexec/rc/rc.d/kldSun Apr  7 18:24:26 2019(r346016)
> +++ head/libexec/rc/rc.d/kldSun Apr  7 18:31:45 2019(r346017)
> @@ -46,7 +46,7 @@ kld_start()
>
> echo 'Loading kernel modules:'
> for _kld in $kld_list ; do
> -   load_kld -e ${_kld}.ko $_kld
> +   load_kld $_kld
> done
>  }
>
>
> Modified: head/libexec/rc/rc.d/mdconfig
> 
> ==
> --- head/libexec/rc/rc.d/mdconfig   Sun Apr  7 18:24:26 2019
> (r346016)
> +++ head/libexec/rc/rc.d/mdconfig   Sun Apr  7 18:31:45 2019
> (r346017)
> @@ -114,7 +114,7 @@ mdconfig_start()
> continue
> fi
> if [ "${_file}" != "${_file%.uzip}" ]; then
> -   load_kld -m g_uzip geom_uzip ||
> return 3
> +   load_kld geom_uzip || return 3
> # sleep a bit to allow creation of
> /dev/mdX.uzip
> sleep 2
> fi
>
> Modified: head/libexec/rc/rc.d/mdconfig2
> 
> ==
> --- head/libexec/rc/rc.d/mdconfig2  Sun Apr  7 18:24:26 2019
> (r346016)
> +++ head/libexec/rc/rc.d/mdconfig2  Sun Apr  7 18:31:45 2019
> (r346017)
> @@ -123,7 +123,7 @@ mdconfig2_start()
> # been created.
> if [ "${_type}" = "vnode" -a "${_fs}" != "/" ]; then
> if [ "${_file}" != 

svn commit: r346022 - head/sys/conf

2019-04-07 Thread Warner Losh
Author: imp
Date: Sun Apr  7 21:01:02 2019
New Revision: 346022
URL: https://svnweb.freebsd.org/changeset/base/346022

Log:
  Make RELDATE be on a single line.
  
  All variable assignments that start in column 1 have to be on a single
  line for amd to build due to as weird dependency there (most likely it
  can be fixed to use the new VARS_ONLY feature, but it isn't
  today). usr.sbin/amd/include/Makefile calls
  usr.sbin/amd/include/newvers.sh which does:
eval `LC_ALL=C egrep '^[A-Z]+=' $1 | grep -v COPYRIGHT`
  which is where that requirement comes from. It handles COPYRIGHT since
  that's an exception. Rather than add additional exceptions, cope with
  the long line in newvers.sh instead. Note: it no longer needs to
  filter COPYRIGHT because the assignment doesn't start in column 1
  anymore.
  
  I had done a universe when I had an earlier version of r346018 that
  had it as one line. When I changed it to multi-line as suggested in
  the review, I only built kernels on a couple of architectures to make
  sure it didn't break anything.
  
  Add comment to newvers.sh noting this.
  
  Obviously, this unbreaks the amd build.

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==
--- head/sys/conf/newvers.shSun Apr  7 20:12:24 2019(r346021)
+++ head/sys/conf/newvers.shSun Apr  7 21:01:02 2019(r346022)
@@ -44,6 +44,9 @@
 #  checkout from a version control system.  Metadata is
 #  included if the tree is modified.
 
+# Note: usr.sbin/amd/include/newvers.sh assumes all variable assignments of
+# upper case variables starting in column 1 are on one line w/o continuation.
+
 TYPE="FreeBSD"
 REVISION="13.0"
 BRANCH=${BRANCH_OVERRIDE:-CURRENT}
@@ -105,8 +108,7 @@ if [ -z "${SYSDIR}" ]; then
 SYSDIR=$(dirname $0)/..
 fi
 
-RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \
- ${PARAMFILE:-${SYSDIR}/sys/param.h})
+RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' 
${PARAMFILE:-${SYSDIR}/sys/param.h})
 
 if [ -r "${SYSDIR}/../COPYRIGHT" ]; then
year=$(sed -Ee '/^Copyright .* The FreeBSD 
Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT)
___
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: r346021 - in head/sys/riscv: include riscv

2019-04-07 Thread Mitchell Horne
Author: mhorne
Date: Sun Apr  7 20:12:24 2019
New Revision: 346021
URL: https://svnweb.freebsd.org/changeset/base/346021

Log:
  RISC-V: initialize pcpu slightly earlier
  
  In certain scenarios, it is possible for PCPU data to be
  accessed before it has been initialized (e.g. during printf
  if the kernel was built with the TSLOG option).
  
  Initialize the PCPU pointer for hart 0 at the beginning of
  initriscv() rather than near the end.
  
  Reviewed by:  markj
  Approved by:  markj (mentor)
  Differential Revision:https://reviews.freebsd.org/D19726

Modified:
  head/sys/riscv/include/pcpu.h
  head/sys/riscv/riscv/machdep.c

Modified: head/sys/riscv/include/pcpu.h
==
--- head/sys/riscv/include/pcpu.h   Sun Apr  7 19:08:07 2019
(r346020)
+++ head/sys/riscv/include/pcpu.h   Sun Apr  7 20:12:24 2019
(r346021)
@@ -53,7 +53,6 @@
 
 struct pcb;
 struct pcpu;
-extern struct pcpu *pcpup;
 
 static inline struct pcpu *
 get_pcpu(void)

Modified: head/sys/riscv/riscv/machdep.c
==
--- head/sys/riscv/riscv/machdep.c  Sun Apr  7 19:08:07 2019
(r346020)
+++ head/sys/riscv/riscv/machdep.c  Sun Apr  7 20:12:24 2019
(r346021)
@@ -120,8 +120,6 @@ int64_t idcache_line_size;  /* The minimum cache line s
 extern int *end;
 extern int *initstack_end;
 
-struct pcpu *pcpup;
-
 uintptr_t mcall_trap(uintptr_t mcause, uintptr_t* regs);
 
 uintptr_t
@@ -627,6 +625,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
 static void
 init_proc0(vm_offset_t kstack)
 {
+   struct pcpu *pcpup;
 
pcpup = &__pcpu[0];
 
@@ -798,6 +797,7 @@ void
 initriscv(struct riscv_bootparams *rvbp)
 {
struct mem_region mem_regions[FDT_MEM_REGIONS];
+   struct pcpu *pcpup;
vm_offset_t rstart, rend;
vm_offset_t s, e;
int mem_regions_sz;
@@ -806,6 +806,15 @@ initriscv(struct riscv_bootparams *rvbp)
caddr_t kmdp;
int i;
 
+   /* Set the pcpu data, this is needed by pmap_bootstrap */
+   pcpup = &__pcpu[0];
+   pcpu_init(pcpup, 0, sizeof(struct pcpu));
+
+   /* Set the pcpu pointer */
+   __asm __volatile("mv gp, %0" :: "r"(pcpup));
+
+   PCPU_SET(curthread, );
+
/* Set the module data location */
lastaddr = fake_preload_metadata(rvbp);
 
@@ -848,15 +857,6 @@ initriscv(struct riscv_bootparams *rvbp)
}
}
 #endif
-
-   /* Set the pcpu data, this is needed by pmap_bootstrap */
-   pcpup = &__pcpu[0];
-   pcpu_init(pcpup, 0, sizeof(struct pcpu));
-
-   /* Set the pcpu pointer */
-   __asm __volatile("mv gp, %0" :: "r"(pcpup));
-
-   PCPU_SET(curthread, );
 
/* Do basic tuning, hz etc */
init_param1();
___
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: r346012 - head/sys/sys

2019-04-07 Thread Cy Schubert
In message <20190407212723.52279...@thor.intern.walstatt.dynvpn.de>, 
"O. Hartma
nn" writes:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Am Sun, 7 Apr 2019 16:07:41 + (UTC)
> Mariusz Zaborski  schrieb:
>
> > Author: oshogbo
> > Date: Sun Apr  7 16:07:41 2019
> > New Revision: 346012
> > URL: https://svnweb.freebsd.org/changeset/base/346012
> > 
> > Log:
> >   Bump FreeBSD version after r345982.
> >   
> >   Reported by:  Shawn Webb 
> >   Discussed with: imp, cy, rgrimes
> > 
> > Modified:
> >   head/sys/sys/param.h
> > 
> > Modified: head/sys/sys/param.h
> > ===
> ===
> > --- head/sys/sys/param.hSun Apr  7 14:30:17 2019(r346011)
> > +++ head/sys/sys/param.hSun Apr  7 16:07:41 2019(r346012)
> > @@ -60,7 +60,7 @@
> >   * in the range 5 to 9.
> >   */
> >  #undef __FreeBSD_version
> > -#define __FreeBSD_version 1300017  /* Master, propagated to newvers */
> > +#define __FreeBSD_version 1300018  /* Master, propagated to newvers */
> >  
> >  /*
> >   * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBS
> D,
> > ___
> > 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"
>
> I find myself bugged by this error while compiling world after the update of 
> CURRENT to
> r346020:
>
> [...]
> Building /usr/obj/usr/src/amd64.amd64/usr.sbin/blacklistd/conf.o
> - --- all_subdir_usr.sbin/amd ---
> - --- amd.o ---
> /usr/src/contrib/amd/amd/amd.c:275:17: error: use of undeclared identifier 'H
> OST_OS_NAME'
>   gopt.op_sys = HOST_OS_NAME;
> ^
> /usr/src/contrib/amd/amd/amd.c:278:21: error: use of undeclared identifier 'H
> OST_OS_VERSION'
>   gopt.op_sys_ver = HOST_OS_VERSION;
> ^
> /usr/src/contrib/amd/amd/amd.c:281:22: error: use of undeclared identifier 'H
> OST_OS'
>   gopt.op_sys_full = HOST_OS;
>  ^
> 3 errors generated.
>
> [...]

Can you grep or ag HOST_OS in /usr/obj/opt/src/svn-current/amd64.amd64/u
sr.sbin/amd/include/config_local.h please?


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.



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

2019-04-07 Thread O. Hartmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Am Sun, 7 Apr 2019 16:07:41 + (UTC)
Mariusz Zaborski  schrieb:

> Author: oshogbo
> Date: Sun Apr  7 16:07:41 2019
> New Revision: 346012
> URL: https://svnweb.freebsd.org/changeset/base/346012
> 
> Log:
>   Bump FreeBSD version after r345982.
>   
>   Reported by:Shawn Webb 
>   Discussed with: imp, cy, rgrimes
> 
> Modified:
>   head/sys/sys/param.h
> 
> Modified: head/sys/sys/param.h
> ==
> --- head/sys/sys/param.h  Sun Apr  7 14:30:17 2019(r346011)
> +++ head/sys/sys/param.h  Sun Apr  7 16:07:41 2019(r346012)
> @@ -60,7 +60,7 @@
>   *   in the range 5 to 9.
>   */
>  #undef __FreeBSD_version
> -#define __FreeBSD_version 1300017/* Master, propagated to newvers */
> +#define __FreeBSD_version 1300018/* Master, propagated to newvers */
>  
>  /*
>   * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
> ___
> 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"

I find myself bugged by this error while compiling world after the update of 
CURRENT to
r346020:

[...]
Building /usr/obj/usr/src/amd64.amd64/usr.sbin/blacklistd/conf.o
- --- all_subdir_usr.sbin/amd ---
- --- amd.o ---
/usr/src/contrib/amd/amd/amd.c:275:17: error: use of undeclared identifier 
'HOST_OS_NAME'
  gopt.op_sys = HOST_OS_NAME;
^
/usr/src/contrib/amd/amd/amd.c:278:21: error: use of undeclared identifier 
'HOST_OS_VERSION'
  gopt.op_sys_ver = HOST_OS_VERSION;
^
/usr/src/contrib/amd/amd/amd.c:281:22: error: use of undeclared identifier 
'HOST_OS'
  gopt.op_sys_full = HOST_OS;
 ^
3 errors generated.

[...]

Regards,

oh
- -- 
O. Hartmann

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

iHUEARYIAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCXKpPHAAKCRA4N1ZZPba5
R6PZAP9y2rW9vEqML5dcmknUUyYawEs8DeMd625N0IpwlJxs1AEA5JW/RAB+QwEE
v47aAnROqGCMVHRixGGNLJa0vKooOA8=
=1Vht
-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: r346020 - stable/11/sys/compat/freebsd32

2019-04-07 Thread Jason A. Harmening
Author: jah
Date: Sun Apr  7 19:08:07 2019
New Revision: 346020
URL: https://svnweb.freebsd.org/changeset/base/346020

Log:
  MFC r345741:
  
  freebsd32: fix padding of computed control message length for recvmsg()
  
  Each control message region must be aligned on a 4-byte boundary on 32-bit
  architectures. The 32-bit compat shim for recvmsg() gets the actual layout
  right, but doesn't pad the payload length when computing msg_controllen for
  the output message header. If a control message contains an unaligned
  payload, such as the 1-byte TTL field in the example attached to PR 236737,
  this can produce control message payload boundaries that extend beyond
  the boundary reported by msg_controllen.
  
  PR:   236737

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

Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c
==
--- stable/11/sys/compat/freebsd32/freebsd32_misc.c Sun Apr  7 19:02:33 
2019(r346019)
+++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Sun Apr  7 19:08:07 
2019(r346020)
@@ -1035,8 +1035,8 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf
cm = NULL;
}
 
-   msg->msg_controllen += FREEBSD32_ALIGN(sizeof(*cm)) +
-   datalen_out;
+   msg->msg_controllen +=
+   FREEBSD32_CMSG_SPACE(datalen_out);
}
}
if (len == 0 && m != NULL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r346019 - stable/12/sys/compat/freebsd32

2019-04-07 Thread Jason A. Harmening
Author: jah
Date: Sun Apr  7 19:02:33 2019
New Revision: 346019
URL: https://svnweb.freebsd.org/changeset/base/346019

Log:
  MFC r345741:
  
  freebsd32: fix padding of computed control message length for recvmsg()
  
  Each control message region must be aligned on a 4-byte boundary on 32-bit
  architectures. The 32-bit compat shim for recvmsg() gets the actual layout
  right, but doesn't pad the payload length when computing msg_controllen for
  the output message header. If a control message contains an unaligned
  payload, such as the 1-byte TTL field in the example attached to PR 236737,
  this can produce control message payload boundaries that extend beyond
  the boundary reported by msg_controllen.
  
  PR:   236737

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

Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c
==
--- stable/12/sys/compat/freebsd32/freebsd32_misc.c Sun Apr  7 18:39:55 
2019(r346018)
+++ stable/12/sys/compat/freebsd32/freebsd32_misc.c Sun Apr  7 19:02:33 
2019(r346019)
@@ -1183,8 +1183,8 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf
cm = NULL;
}
 
-   msg->msg_controllen += FREEBSD32_ALIGN(sizeof(*cm)) +
-   datalen_out;
+   msg->msg_controllen +=
+   FREEBSD32_CMSG_SPACE(datalen_out);
}
}
if (len == 0 && m != NULL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r346018 - head/sys/conf

2019-04-07 Thread Warner Losh
Author: imp
Date: Sun Apr  7 18:39:55 2019
New Revision: 346018
URL: https://svnweb.freebsd.org/changeset/base/346018

Log:
  Use default shell assignment rather more complicated if then
  construct.
  
  Discussed with: emaste@, allanjude@ (changes (or not) based on their feedback)
  Differential Revision: https://reviews.freebsd.org/D19797

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==
--- head/sys/conf/newvers.shSun Apr  7 18:31:45 2019(r346017)
+++ head/sys/conf/newvers.shSun Apr  7 18:39:55 2019(r346018)
@@ -46,10 +46,7 @@
 
 TYPE="FreeBSD"
 REVISION="13.0"
-BRANCH="CURRENT"
-if [ -n "${BRANCH_OVERRIDE}" ]; then
-   BRANCH=${BRANCH_OVERRIDE}
-fi
+BRANCH=${BRANCH_OVERRIDE:-CURRENT}
 RELEASE="${REVISION}-${BRANCH}"
 VERSION="${TYPE} ${RELEASE}"
 
@@ -108,21 +105,16 @@ if [ -z "${SYSDIR}" ]; then
 SYSDIR=$(dirname $0)/..
 fi
 
-if [ -n "${PARAMFILE}" ]; then
-   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \
-   ${PARAMFILE})
-else
-   RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \
-   ${SYSDIR}/sys/param.h)
-fi
+RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \
+ ${PARAMFILE:-${SYSDIR}/sys/param.h})
 
-b=share/examples/etc/bsd-style-copyright
 if [ -r "${SYSDIR}/../COPYRIGHT" ]; then
year=$(sed -Ee '/^Copyright .* The FreeBSD 
Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT)
 else
year=$(date +%Y)
 fi
 # look for copyright template
+b=share/examples/etc/bsd-style-copyright
 for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b
 do
if [ -r "$bsd_copyright" ]; then
@@ -150,9 +142,7 @@ COPYRIGHT="$COPYRIGHT
 
 # VARS_ONLY means no files should be generated, this is just being
 # included.
-if [ -n "$VARS_ONLY" ]; then
-   return 0
-fi
+[ -n "$VARS_ONLY" ] && return 0
 
 LC_ALL=C; export LC_ALL
 if [ ! -r version ]
___
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: r346017 - in head: libexec/rc libexec/rc/rc.d share/man/man5

2019-04-07 Thread Chris Rees
Author: crees (doc,ports committer)
Date: Sun Apr  7 18:31:45 2019
New Revision: 346017
URL: https://svnweb.freebsd.org/changeset/base/346017

Log:
  Remove now unnecessary kldstat check before attempting to load modules.
  
  Since r233109, kldload has the -n option, which silently ignores options
  that are already loaded.
  
  https://lists.freebsd.org/pipermail/freebsd-rc/2018-December/003899.html
  
  Note that this script no longer reports if the module is already loaded,
  but it could be argued this wasn't particularly useful information.
  
  PR:   docs/234248
  Reviewed by:  bcr (docs), kib, rgrimes (visual)
  Approved by:  jilles
  Differential Revision:https://reviews.freebsd.org/D18670

Modified:
  head/libexec/rc/rc.d/abi
  head/libexec/rc/rc.d/bthidd
  head/libexec/rc/rc.d/cfumass
  head/libexec/rc/rc.d/kld
  head/libexec/rc/rc.d/mdconfig
  head/libexec/rc/rc.d/mdconfig2
  head/libexec/rc/rc.d/mountcritremote
  head/libexec/rc/rc.d/syscons
  head/libexec/rc/rc.subr
  head/share/man/man5/rc.conf.5

Modified: head/libexec/rc/rc.d/abi
==
--- head/libexec/rc/rc.d/abiSun Apr  7 18:24:26 2019(r346016)
+++ head/libexec/rc/rc.d/abiSun Apr  7 18:31:45 2019(r346017)
@@ -27,10 +27,10 @@ linux_start()
local _tmpdir
 
echo -n ' linux'
-   load_kld -e 'linux(aout|elf)' linux
+   load_kld linux
case `sysctl -n hw.machine_arch` in
amd64)
-   load_kld -e 'linux64elf' linux64
+   load_kld linux64
;;
esac
if [ -x /compat/linux/sbin/ldconfigDisabled ]; then

Modified: head/libexec/rc/rc.d/bthidd
==
--- head/libexec/rc/rc.d/bthidd Sun Apr  7 18:24:26 2019(r346016)
+++ head/libexec/rc/rc.d/bthidd Sun Apr  7 18:31:45 2019(r346017)
@@ -34,11 +34,11 @@ evdev_enabled()
 bthidd_prestart()
 {
if evdev_enabled; then
-   load_kld -m uinput uinput
+   load_kld uinput
fi
-   load_kld -m kbdmux kbdmux
-   load_kld -m vkbd vkbd
-   load_kld -m ng_btsocket ng_btsocket
+   load_kld kbdmux
+   load_kld vkbd
+   load_kld ng_btsocket
return 0
 }
 

Modified: head/libexec/rc/rc.d/cfumass
==
--- head/libexec/rc/rc.d/cfumassSun Apr  7 18:24:26 2019
(r346016)
+++ head/libexec/rc/rc.d/cfumassSun Apr  7 18:31:45 2019
(r346017)
@@ -75,7 +75,7 @@ cfumass_start()
return "${err}"
fi
 
-   load_kld -e cfumass cfumass
+   load_kld cfumass
 
# If the template is already switched to Mass Storage, then reset
# it to -1 to force the host to reenumerate it; otherwise it might

Modified: head/libexec/rc/rc.d/kld
==
--- head/libexec/rc/rc.d/kldSun Apr  7 18:24:26 2019(r346016)
+++ head/libexec/rc/rc.d/kldSun Apr  7 18:31:45 2019(r346017)
@@ -46,7 +46,7 @@ kld_start()
 
echo 'Loading kernel modules:'
for _kld in $kld_list ; do
-   load_kld -e ${_kld}.ko $_kld
+   load_kld $_kld
done
 }
 

Modified: head/libexec/rc/rc.d/mdconfig
==
--- head/libexec/rc/rc.d/mdconfig   Sun Apr  7 18:24:26 2019
(r346016)
+++ head/libexec/rc/rc.d/mdconfig   Sun Apr  7 18:31:45 2019
(r346017)
@@ -114,7 +114,7 @@ mdconfig_start()
continue
fi
if [ "${_file}" != "${_file%.uzip}" ]; then
-   load_kld -m g_uzip geom_uzip || return 3
+   load_kld geom_uzip || return 3
# sleep a bit to allow creation of 
/dev/mdX.uzip
sleep 2
fi

Modified: head/libexec/rc/rc.d/mdconfig2
==
--- head/libexec/rc/rc.d/mdconfig2  Sun Apr  7 18:24:26 2019
(r346016)
+++ head/libexec/rc/rc.d/mdconfig2  Sun Apr  7 18:31:45 2019
(r346017)
@@ -123,7 +123,7 @@ mdconfig2_start()
# been created.
if [ "${_type}" = "vnode" -a "${_fs}" != "/" ]; then
if [ "${_file}" != "${_file%.uzip}" ]; then
-   load_kld -m g_uzip geom_uzip || return 3
+   load_kld geom_uzip || return 3
fi
if is_readonly ${_fs}; then
warn "${_fs} is mounted read-only, skipping 

svn commit: r346016 - in head: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options

2019-04-07 Thread Mitchell Horne
Author: mhorne
Date: Sun Apr  7 18:24:26 2019
New Revision: 346016
URL: https://svnweb.freebsd.org/changeset/base/346016

Log:
  Add option to build LLVM RISC-V target
  
  Reviewed by:  emaste, dim
  Approved by:  markj (mentor)
  MFC after:3 weeks
  Differential Revision:https://reviews.freebsd.org/D19759

Added:
  head/tools/build/options/WITHOUT_LLVM_TARGET_RISCV   (contents, props changed)
  head/tools/build/options/WITH_LLVM_TARGET_RISCV   (contents, props changed)
Modified:
  head/lib/clang/include/llvm/Config/AsmParsers.def
  head/lib/clang/include/llvm/Config/AsmPrinters.def
  head/lib/clang/include/llvm/Config/Disassemblers.def
  head/lib/clang/include/llvm/Config/Targets.def
  head/lib/clang/libllvm/Makefile
  head/lib/clang/llvm.build.mk
  head/share/man/man5/src.conf.5
  head/share/mk/src.opts.mk

Modified: head/lib/clang/include/llvm/Config/AsmParsers.def
==
--- head/lib/clang/include/llvm/Config/AsmParsers.def   Sun Apr  7 17:49:39 
2019(r346015)
+++ head/lib/clang/include/llvm/Config/AsmParsers.def   Sun Apr  7 18:24:26 
2019(r346016)
@@ -19,6 +19,9 @@ LLVM_ASM_PARSER(Mips)
 #ifdef LLVM_TARGET_ENABLE_POWERPC
 LLVM_ASM_PARSER(PowerPC)
 #endif
+#ifdef LLVM_TARGET_ENABLE_RISCV
+LLVM_ASM_PARSER(RISCV)
+#endif
 #ifdef LLVM_TARGET_ENABLE_SPARC
 LLVM_ASM_PARSER(Sparc)
 #endif

Modified: head/lib/clang/include/llvm/Config/AsmPrinters.def
==
--- head/lib/clang/include/llvm/Config/AsmPrinters.def  Sun Apr  7 17:49:39 
2019(r346015)
+++ head/lib/clang/include/llvm/Config/AsmPrinters.def  Sun Apr  7 18:24:26 
2019(r346016)
@@ -19,6 +19,9 @@ LLVM_ASM_PRINTER(Mips)
 #ifdef LLVM_TARGET_ENABLE_POWERPC
 LLVM_ASM_PRINTER(PowerPC)
 #endif
+#ifdef LLVM_TARGET_ENABLE_RISCV
+LLVM_ASM_PRINTER(RISCV)
+#endif
 #ifdef LLVM_TARGET_ENABLE_SPARC
 LLVM_ASM_PRINTER(Sparc)
 #endif

Modified: head/lib/clang/include/llvm/Config/Disassemblers.def
==
--- head/lib/clang/include/llvm/Config/Disassemblers.defSun Apr  7 
17:49:39 2019(r346015)
+++ head/lib/clang/include/llvm/Config/Disassemblers.defSun Apr  7 
18:24:26 2019(r346016)
@@ -19,6 +19,9 @@ LLVM_DISASSEMBLER(Mips)
 #ifdef LLVM_TARGET_ENABLE_POWERPC
 LLVM_DISASSEMBLER(PowerPC)
 #endif
+#ifdef LLVM_TARGET_ENABLE_RISCV
+LLVM_DISASSEMBLER(RISCV)
+#endif
 #ifdef LLVM_TARGET_ENABLE_SPARC
 LLVM_DISASSEMBLER(Sparc)
 #endif

Modified: head/lib/clang/include/llvm/Config/Targets.def
==
--- head/lib/clang/include/llvm/Config/Targets.def  Sun Apr  7 17:49:39 
2019(r346015)
+++ head/lib/clang/include/llvm/Config/Targets.def  Sun Apr  7 18:24:26 
2019(r346016)
@@ -19,6 +19,9 @@ LLVM_TARGET(Mips)
 #ifdef LLVM_TARGET_ENABLE_POWERPC
 LLVM_TARGET(PowerPC)
 #endif
+#ifdef LLVM_TARGET_ENABLE_RISCV
+LLVM_TARGET(RISCV)
+#endif
 #ifdef LLVM_TARGET_ENABLE_SPARC
 LLVM_TARGET(Sparc)
 #endif

Modified: head/lib/clang/libllvm/Makefile
==
--- head/lib/clang/libllvm/Makefile Sun Apr  7 17:49:39 2019
(r346015)
+++ head/lib/clang/libllvm/Makefile Sun Apr  7 18:24:26 2019
(r346016)
@@ -10,14 +10,15 @@ CFLAGS+=-I${.OBJDIR}
 
 .if ${MK_LLVM_TARGET_AARCH64} == "no" && ${MK_LLVM_TARGET_ARM} == "no" && \
 ${MK_LLVM_TARGET_BPF} == "no" && ${MK_LLVM_TARGET_MIPS} == "no" && \
-${MK_LLVM_TARGET_POWERPC} == "no" && ${MK_LLVM_TARGET_SPARC} == "no" && \
-${MK_LLVM_TARGET_X86} == "no"
+${MK_LLVM_TARGET_POWERPC} == "no" && ${MK_LLVM_TARGET_RISCV} == "no" && \
+${MK_LLVM_TARGET_SPARC} == "no" && ${MK_LLVM_TARGET_X86} == "no"
 .error Please enable at least one of: MK_LLVM_TARGET_AARCH64,\
  MK_LLVM_TARGET_ARM, MK_LLVM_TARGET_BPF, MK_LLVM_TARGET_MIPS, \
- MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_SPARC, or MK_LLVM_TARGET_X86
+ MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_RISCV, MK_LLVM_TARGET_SPARC, \
+ or MK_LLVM_TARGET_X86
 .endif
 
-.for arch in AArch64 ARM BPF Mips PowerPC Sparc X86
+.for arch in AArch64 ARM BPF Mips PowerPC RISCV Sparc X86
 . if ${MK_LLVM_TARGET_${arch:tu}} != "no"
 CFLAGS+=   -I${LLVM_SRCS}/lib/Target/${arch}
 . endif
@@ -1128,6 +1129,34 @@ SRCS_MIN+=   Target/PowerPC/PPCVSXFMAMutate.cpp
 SRCS_MIN+= Target/PowerPC/PPCVSXSwapRemoval.cpp
 SRCS_MIN+= Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp
 .endif # MK_LLVM_TARGET_POWERPC
+.if ${MK_LLVM_TARGET_RISCV} != "no"
+SRCS_MIN+= Target/RISCV/AsmParser/RISCVAsmParser.cpp
+SRCS_MIN+= Target/RISCV/Disassembler/RISCVDisassembler.cpp
+SRCS_MIN+= Target/RISCV/InstPrinter/RISCVInstPrinter.cpp
+SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
+SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp

svn commit: r346015 - svnadmin/conf

2019-04-07 Thread Eitan Adler
Author: eadler
Date: Sun Apr  7 17:49:39 2019
New Revision: 346015
URL: https://svnweb.freebsd.org/changeset/base/346015

Log:
  Release bcran
  
  Rebecca has not actually needed mentorship in some time.

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Sun Apr  7 17:22:31 2019(r346014)
+++ svnadmin/conf/mentors   Sun Apr  7 17:49:39 2019(r346015)
@@ -12,7 +12,6 @@
 # Mentee   Mentor  Optional comment
 achim  scottl  Co-mentor: emaste
 anish  jhb
-bcran  eadler
 brdallanjude   Co-mentor: bapt
 defpjd
 gordon delphij Co-mentor: emaste
___
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: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs

2019-04-07 Thread Shawn Webb
No worries. Thanks for the correction!

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

Tor-ified Signal:+1 443-546-8752
Tor+XMPP+OTR:latt...@is.a.hacker.sx
GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9  3633 C85B 0AF8 AB23 0FB2

On Sun, Apr 07, 2019 at 06:11:58PM +0200, Mariusz Zaborski wrote:
> In the https://wiki.freebsd.org/AddingSyscalls we mentions that we need to 
> bump
> __FreeBSD_version. I confirmed that with Warner. So this was my mistake.
> 
> Thanks Shawn.
> -- 
> Mariusz Zaborski
> oshogbo//vx   | http://oshogbo.vexillium.org
> FreeBSD committer | https://freebsd.org
> Software developer| http://wheelsystems.com
> If it's not broken, let's fix it till it is!!1
> 
> On Sun, Apr 07, 2019 at 08:35:07AM -0700, Cy Schubert wrote:
> > In message <201904071510.x37fa7tm050...@gndrsh.dnsmgr.net>, "Rodney W. 
> > Grimes"
> > writes:
> > > > On April 7, 2019 7:11:52 AM PDT, Shawn Webb 
> > > >  wr
> > > ote:
> > > > >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote:
> > > > >> Author: oshogbo
> > > > >> Date: Sat Apr  6 09:34:26 2019
> > > > >> New Revision: 345982
> > > > >> URL: https://svnweb.freebsd.org/changeset/base/345982
> > > > >> 
> > > > >> Log:
> > > > >>   Introduce funlinkat syscall that always us to check if we are
> > > > >removing
> > > > >>   the file associated with the given file descriptor.
> > > > >>   
> > > > >>   Reviewed by:   kib, asomers
> > > > >>   Reviewed by:   cem, jilles, brooks (they reviewed previous 
> > > > >> version)
> > > > >>   Discussed with:pjd, and many others
> > > > >>   Differential Revision: https://reviews.freebsd.org/D14567
> > > > >
> > > > >Hey Mariusz,
> > > > >
> > > > >Is __FreeBSD_version supposed to be bumped after adding new syscalls?
> > > > >I can't remember off-hand.
> > > > >
> > > > >Thanks,
> > > > 
> > > > I don't think so. Why force the rebuild of all ports through poudriere 
> > > > over
> > >  something that would never affect any of them?
> > >
> > > So that you can if version >= foo to know it is safe to use the new 
> > > syscal?
> > > Or if version  < foo you must use the old way.
> > 
> > Granted. However we do need something to avoid gratuitous rebuilds of 
> > ports.
> > 
> > Personally, my poudriere script adjusts the pkg version 
> > ($JAILPATH/data/packages/${JAIL}-${PORTS}/.building/.jailversion) with 
> > that of the jail version (reported by poudriere jail -i -j $JAIL), 
> > rebuilding all ports when I (the human) determines when the machine 
> > should rebuild all ports with -c.
> > 
> > In that regard FreeBSD version bumps occasionally seem a little 
> > gratuitous. Using the same indicator to tell whether software should be 
> > able to use a new feature and when ports build infrastructure should 
> > summarily delete all packages forcing a rebuild of absolutely 
> > everything is probably not the best.
> > 
> > Just throwing out an idea, what if poudriere considers the first N 
> > bytes of __FreeBSD_version significant? Having said that, looking at 
> > __FreeBSD_version, I don't think we have enough digits to do what I was 
> > planning on suggesting. But, you get the idea of what I'm driving at. 
> > Maybe a new macro such as __FreeBSD_ports that is incremented every 
> > time a change that affects ports?
> > 
> > Anyhow, I'm not too terribly concerned as what I have (selfishly 
> > speaking) works. But we may as a group might want to consider this at 
> > some point to build some efficiency into the ports part of the equation.
> > 
> > 
> > -- 
> > Cheers,
> > Cy Schubert 
> > FreeBSD UNIX: Web:  http://www.FreeBSD.org
> > 
> > The need of the many outweighs the greed of the few.
> >  
> > 




signature.asc
Description: PGP signature


Re: svn commit: r346012 - head/sys/sys

2019-04-07 Thread Rodney W. Grimes
> Author: oshogbo
> Date: Sun Apr  7 16:07:41 2019
> New Revision: 346012
> URL: https://svnweb.freebsd.org/changeset/base/346012
> 
> Log:
>   Bump FreeBSD version after r345982.
>   
>   Reported by:Shawn Webb 
>   Discussed with: imp, cy, rgrimes

This is just a note for future reference.

Though there was some email exchange on the list,
I am not sure that quantifies as what we call "discussed with",
for one I never sent to, nor responded to, any email from/to you
directly.


Regards,
Rod

> Modified:
>   head/sys/sys/param.h
> 
> Modified: head/sys/sys/param.h
> ==
> --- head/sys/sys/param.h  Sun Apr  7 14:30:17 2019(r346011)
> +++ head/sys/sys/param.h  Sun Apr  7 16:07:41 2019(r346012)
> @@ -60,7 +60,7 @@
>   *   in the range 5 to 9.
>   */
>  #undef __FreeBSD_version
> -#define __FreeBSD_version 1300017/* Master, propagated to newvers */
> +#define __FreeBSD_version 1300018/* Master, propagated to newvers */
>  
>  /*
>   * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
> 
> 

-- 
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: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs

2019-04-07 Thread Cy Schubert
In message 
, Warner Losh writes:
> --5c05ef0585f2f684
> Content-Type: text/plain; charset="UTF-8"
>
> On Sun, Apr 7, 2019 at 9:35 AM Cy Schubert 
> wrote:
>
> > In message <201904071510.x37fa7tm050...@gndrsh.dnsmgr.net>, "Rodney W.
> > Grimes"
> > writes:
> > > > On April 7, 2019 7:11:52 AM PDT, Shawn Webb <
> > shawn.w...@hardenedbsd.org> wr
> > > ote:
> > > > >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote:
> > > > >> Author: oshogbo
> > > > >> Date: Sat Apr  6 09:34:26 2019
> > > > >> New Revision: 345982
> > > > >> URL: https://svnweb.freebsd.org/changeset/base/345982
> > > > >>
> > > > >> Log:
> > > > >>   Introduce funlinkat syscall that always us to check if we are
> > > > >removing
> > > > >>   the file associated with the given file descriptor.
> > > > >>
> > > > >>   Reviewed by:   kib, asomers
> > > > >>   Reviewed by:   cem, jilles, brooks (they reviewed previous
> > version)
> > > > >>   Discussed with:pjd, and many others
> > > > >>   Differential Revision: https://reviews.freebsd.org/D14567
> > > > >
> > > > >Hey Mariusz,
> > > > >
> > > > >Is __FreeBSD_version supposed to be bumped after adding new syscalls?
> > > > >I can't remember off-hand.
> > > > >
> > > > >Thanks,
> > > >
> > > > I don't think so. Why force the rebuild of all ports through poudriere
> > over
> > >  something that would never affect any of them?
> > >
> > > So that you can if version >= foo to know it is safe to use the new
> > syscal?
> > > Or if version  < foo you must use the old way.
> >
> > Granted. However we do need something to avoid gratuitous rebuilds of
> > ports.
> >
> > Personally, my poudriere script adjusts the pkg version
> > ($JAILPATH/data/packages/${JAIL}-${PORTS}/.building/.jailversion) with
> > that of the jail version (reported by poudriere jail -i -j $JAIL),
> > rebuilding all ports when I (the human) determines when the machine
> > should rebuild all ports with -c.
> >
> > In that regard FreeBSD version bumps occasionally seem a little
> > gratuitous. Using the same indicator to tell whether software should be
> > able to use a new feature and when ports build infrastructure should
> > summarily delete all packages forcing a rebuild of absolutely
> > everything is probably not the best.
> >
> > Just throwing out an idea, what if poudriere considers the first N
> > bytes of __FreeBSD_version significant? Having said that, looking at
> > __FreeBSD_version, I don't think we have enough digits to do what I was
> > planning on suggesting. But, you get the idea of what I'm driving at.
> > Maybe a new macro such as __FreeBSD_ports that is incremented every
> > time a change that affects ports?
> >
> > Anyhow, I'm not too terribly concerned as what I have (selfishly
> > speaking) works. But we may as a group might want to consider this at
> > some point to build some efficiency into the ports part of the equation.
> >
>
> We generally bump the version around the time we add a syscall. This allows
> any wrappers to call it or not based on the kernel version and avoid a
> SIGSYS when we're doing forward compatibility hacks for whatever reason.
>
> The current overloading of __FreeBSD_version is unfortunate. We've been
> quite liberal over the past 2 decades at bumping it because it's free to do
> so. Or so the thinking has been. I personally think we should continue to
> do so, but maybe look at piggy-backing those changes we can if someone else
> bumped it in the last few days. To give some perspective, in the ~120 days
> since we branched, we've bumped it 17 times. This is more or less weekly,
> which suggests we don't have a problem that we need to optimize too much
> here.
>
> If Poudriere wants to optimize building, I'd suggest that you have a
> command line argument / config file thing that sets the maximum skew.
> Normally, you could set it up to be pretty tolerant, but if you knew
> something was a big deal, you could then crank down to intolerant. The
> current setting of '1' for this skew should be the default.

It's not that simple. A skew may miss an important change to base that 
will affect ports. Having resulting packages that segfault could be 
unacceptable outcome. An argument to ignore the jail/pkg version 
comparison or arbitrarily update it (like my script does) would solve 
this.

However someone not monitoring base commit log commits, an arbitrary 
argument to poudriere could result in unnecessary mailing list noise or 
bugzilla tickets, both of which are time wasters.

>
> I'm not sure a FreeBSD_ports would scale. How do you know a port won't need
> to know about the new syscall? It's from Linux, and there may be some ports
> that use it if available. As a src committer, I've not easy way to know
> (and no hard way to know that's not a full exprun).

That's the other problem. Not everyone will know how a change may 
affect applications. I suppose the best might be a poudriere flag or 
config option to ignore jail and pkg version differences 

svn commit: r346013 - head/sys/modules/geom/geom_label

2019-04-07 Thread Ian Lepore
Author: ian
Date: Sun Apr  7 16:33:22 2019
New Revision: 346013
URL: https://svnweb.freebsd.org/changeset/base/346013

Log:
  Add g_label_flashmap.c to the module, should have been part of r345480.
  
  Reported by:  Jia-Shiun Li 

Modified:
  head/sys/modules/geom/geom_label/Makefile

Modified: head/sys/modules/geom/geom_label/Makefile
==
--- head/sys/modules/geom/geom_label/Makefile   Sun Apr  7 16:07:41 2019
(r346012)
+++ head/sys/modules/geom/geom_label/Makefile   Sun Apr  7 16:33:22 2019
(r346013)
@@ -6,6 +6,7 @@ KMOD=   geom_label
 SRCS=  g_label.c
 SRCS+= g_label_disk_ident.c
 SRCS+= g_label_ext2fs.c
+SRCS+= g_label_flashmap.c
 SRCS+= g_label_gpt.c
 SRCS+= g_label_iso9660.c
 SRCS+= g_label_msdosfs.c
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs

2019-04-07 Thread Mariusz Zaborski
In the https://wiki.freebsd.org/AddingSyscalls we mentions that we need to bump
__FreeBSD_version. I confirmed that with Warner. So this was my mistake.

Thanks Shawn.
-- 
Mariusz Zaborski
oshogbo//vx | http://oshogbo.vexillium.org
FreeBSD committer   | https://freebsd.org
Software developer  | http://wheelsystems.com
If it's not broken, let's fix it till it is!!1

On Sun, Apr 07, 2019 at 08:35:07AM -0700, Cy Schubert wrote:
> In message <201904071510.x37fa7tm050...@gndrsh.dnsmgr.net>, "Rodney W. 
> Grimes"
> writes:
> > > On April 7, 2019 7:11:52 AM PDT, Shawn Webb  
> > > wr
> > ote:
> > > >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote:
> > > >> Author: oshogbo
> > > >> Date: Sat Apr  6 09:34:26 2019
> > > >> New Revision: 345982
> > > >> URL: https://svnweb.freebsd.org/changeset/base/345982
> > > >> 
> > > >> Log:
> > > >>   Introduce funlinkat syscall that always us to check if we are
> > > >removing
> > > >>   the file associated with the given file descriptor.
> > > >>   
> > > >>   Reviewed by: kib, asomers
> > > >>   Reviewed by: cem, jilles, brooks (they reviewed previous version)
> > > >>   Discussed with:  pjd, and many others
> > > >>   Differential Revision:   https://reviews.freebsd.org/D14567
> > > >
> > > >Hey Mariusz,
> > > >
> > > >Is __FreeBSD_version supposed to be bumped after adding new syscalls?
> > > >I can't remember off-hand.
> > > >
> > > >Thanks,
> > > 
> > > I don't think so. Why force the rebuild of all ports through poudriere 
> > > over
> >  something that would never affect any of them?
> >
> > So that you can if version >= foo to know it is safe to use the new syscal?
> > Or if version  < foo you must use the old way.
> 
> Granted. However we do need something to avoid gratuitous rebuilds of 
> ports.
> 
> Personally, my poudriere script adjusts the pkg version 
> ($JAILPATH/data/packages/${JAIL}-${PORTS}/.building/.jailversion) with 
> that of the jail version (reported by poudriere jail -i -j $JAIL), 
> rebuilding all ports when I (the human) determines when the machine 
> should rebuild all ports with -c.
> 
> In that regard FreeBSD version bumps occasionally seem a little 
> gratuitous. Using the same indicator to tell whether software should be 
> able to use a new feature and when ports build infrastructure should 
> summarily delete all packages forcing a rebuild of absolutely 
> everything is probably not the best.
> 
> Just throwing out an idea, what if poudriere considers the first N 
> bytes of __FreeBSD_version significant? Having said that, looking at 
> __FreeBSD_version, I don't think we have enough digits to do what I was 
> planning on suggesting. But, you get the idea of what I'm driving at. 
> Maybe a new macro such as __FreeBSD_ports that is incremented every 
> time a change that affects ports?
> 
> Anyhow, I'm not too terribly concerned as what I have (selfishly 
> speaking) works. But we may as a group might want to consider this at 
> some point to build some efficiency into the ports part of the equation.
> 
> 
> -- 
> Cheers,
> Cy Schubert 
> FreeBSD UNIX: Web:  http://www.FreeBSD.org
> 
>   The need of the many outweighs the greed of the few.
>  
> 


signature.asc
Description: PGP signature


Re: svn commit: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs

2019-04-07 Thread Warner Losh
On Sun, Apr 7, 2019 at 9:35 AM Cy Schubert 
wrote:

> In message <201904071510.x37fa7tm050...@gndrsh.dnsmgr.net>, "Rodney W.
> Grimes"
> writes:
> > > On April 7, 2019 7:11:52 AM PDT, Shawn Webb <
> shawn.w...@hardenedbsd.org> wr
> > ote:
> > > >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote:
> > > >> Author: oshogbo
> > > >> Date: Sat Apr  6 09:34:26 2019
> > > >> New Revision: 345982
> > > >> URL: https://svnweb.freebsd.org/changeset/base/345982
> > > >>
> > > >> Log:
> > > >>   Introduce funlinkat syscall that always us to check if we are
> > > >removing
> > > >>   the file associated with the given file descriptor.
> > > >>
> > > >>   Reviewed by:   kib, asomers
> > > >>   Reviewed by:   cem, jilles, brooks (they reviewed previous
> version)
> > > >>   Discussed with:pjd, and many others
> > > >>   Differential Revision: https://reviews.freebsd.org/D14567
> > > >
> > > >Hey Mariusz,
> > > >
> > > >Is __FreeBSD_version supposed to be bumped after adding new syscalls?
> > > >I can't remember off-hand.
> > > >
> > > >Thanks,
> > >
> > > I don't think so. Why force the rebuild of all ports through poudriere
> over
> >  something that would never affect any of them?
> >
> > So that you can if version >= foo to know it is safe to use the new
> syscal?
> > Or if version  < foo you must use the old way.
>
> Granted. However we do need something to avoid gratuitous rebuilds of
> ports.
>
> Personally, my poudriere script adjusts the pkg version
> ($JAILPATH/data/packages/${JAIL}-${PORTS}/.building/.jailversion) with
> that of the jail version (reported by poudriere jail -i -j $JAIL),
> rebuilding all ports when I (the human) determines when the machine
> should rebuild all ports with -c.
>
> In that regard FreeBSD version bumps occasionally seem a little
> gratuitous. Using the same indicator to tell whether software should be
> able to use a new feature and when ports build infrastructure should
> summarily delete all packages forcing a rebuild of absolutely
> everything is probably not the best.
>
> Just throwing out an idea, what if poudriere considers the first N
> bytes of __FreeBSD_version significant? Having said that, looking at
> __FreeBSD_version, I don't think we have enough digits to do what I was
> planning on suggesting. But, you get the idea of what I'm driving at.
> Maybe a new macro such as __FreeBSD_ports that is incremented every
> time a change that affects ports?
>
> Anyhow, I'm not too terribly concerned as what I have (selfishly
> speaking) works. But we may as a group might want to consider this at
> some point to build some efficiency into the ports part of the equation.
>

We generally bump the version around the time we add a syscall. This allows
any wrappers to call it or not based on the kernel version and avoid a
SIGSYS when we're doing forward compatibility hacks for whatever reason.

The current overloading of __FreeBSD_version is unfortunate. We've been
quite liberal over the past 2 decades at bumping it because it's free to do
so. Or so the thinking has been. I personally think we should continue to
do so, but maybe look at piggy-backing those changes we can if someone else
bumped it in the last few days. To give some perspective, in the ~120 days
since we branched, we've bumped it 17 times. This is more or less weekly,
which suggests we don't have a problem that we need to optimize too much
here.

If Poudriere wants to optimize building, I'd suggest that you have a
command line argument / config file thing that sets the maximum skew.
Normally, you could set it up to be pretty tolerant, but if you knew
something was a big deal, you could then crank down to intolerant. The
current setting of '1' for this skew should be the default.

I'm not sure a FreeBSD_ports would scale. How do you know a port won't need
to know about the new syscall? It's from Linux, and there may be some ports
that use it if available. As a src committer, I've not easy way to know
(and no hard way to know that's not a full exprun).

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


svn commit: r346012 - head/sys/sys

2019-04-07 Thread Mariusz Zaborski
Author: oshogbo
Date: Sun Apr  7 16:07:41 2019
New Revision: 346012
URL: https://svnweb.freebsd.org/changeset/base/346012

Log:
  Bump FreeBSD version after r345982.
  
  Reported by:  Shawn Webb 
  Discussed with: imp, cy, rgrimes

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hSun Apr  7 14:30:17 2019(r346011)
+++ head/sys/sys/param.hSun Apr  7 16:07:41 2019(r346012)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300017  /* Master, propagated to newvers */
+#define __FreeBSD_version 1300018  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs

2019-04-07 Thread Cy Schubert
In message <201904071510.x37fa7tm050...@gndrsh.dnsmgr.net>, "Rodney W. 
Grimes"
writes:
> > On April 7, 2019 7:11:52 AM PDT, Shawn Webb  wr
> ote:
> > >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote:
> > >> Author: oshogbo
> > >> Date: Sat Apr  6 09:34:26 2019
> > >> New Revision: 345982
> > >> URL: https://svnweb.freebsd.org/changeset/base/345982
> > >> 
> > >> Log:
> > >>   Introduce funlinkat syscall that always us to check if we are
> > >removing
> > >>   the file associated with the given file descriptor.
> > >>   
> > >>   Reviewed by:   kib, asomers
> > >>   Reviewed by:   cem, jilles, brooks (they reviewed previous version)
> > >>   Discussed with:pjd, and many others
> > >>   Differential Revision: https://reviews.freebsd.org/D14567
> > >
> > >Hey Mariusz,
> > >
> > >Is __FreeBSD_version supposed to be bumped after adding new syscalls?
> > >I can't remember off-hand.
> > >
> > >Thanks,
> > 
> > I don't think so. Why force the rebuild of all ports through poudriere over
>  something that would never affect any of them?
>
> So that you can if version >= foo to know it is safe to use the new syscal?
> Or if version  < foo you must use the old way.

Granted. However we do need something to avoid gratuitous rebuilds of 
ports.

Personally, my poudriere script adjusts the pkg version 
($JAILPATH/data/packages/${JAIL}-${PORTS}/.building/.jailversion) with 
that of the jail version (reported by poudriere jail -i -j $JAIL), 
rebuilding all ports when I (the human) determines when the machine 
should rebuild all ports with -c.

In that regard FreeBSD version bumps occasionally seem a little 
gratuitous. Using the same indicator to tell whether software should be 
able to use a new feature and when ports build infrastructure should 
summarily delete all packages forcing a rebuild of absolutely 
everything is probably not the best.

Just throwing out an idea, what if poudriere considers the first N 
bytes of __FreeBSD_version significant? Having said that, looking at 
__FreeBSD_version, I don't think we have enough digits to do what I was 
planning on suggesting. But, you get the idea of what I'm driving at. 
Maybe a new macro such as __FreeBSD_ports that is incremented every 
time a change that affects ports?

Anyhow, I'm not too terribly concerned as what I have (selfishly 
speaking) works. But we may as a group might want to consider this at 
some point to build some efficiency into the ports part of the equation.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.
 

___
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: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs

2019-04-07 Thread Rodney W. Grimes
> On April 7, 2019 7:11:52 AM PDT, Shawn Webb  
> wrote:
> >On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote:
> >> Author: oshogbo
> >> Date: Sat Apr  6 09:34:26 2019
> >> New Revision: 345982
> >> URL: https://svnweb.freebsd.org/changeset/base/345982
> >> 
> >> Log:
> >>   Introduce funlinkat syscall that always us to check if we are
> >removing
> >>   the file associated with the given file descriptor.
> >>   
> >>   Reviewed by: kib, asomers
> >>   Reviewed by: cem, jilles, brooks (they reviewed previous version)
> >>   Discussed with:  pjd, and many others
> >>   Differential Revision:   https://reviews.freebsd.org/D14567
> >
> >Hey Mariusz,
> >
> >Is __FreeBSD_version supposed to be bumped after adding new syscalls?
> >I can't remember off-hand.
> >
> >Thanks,
> 
> I don't think so. Why force the rebuild of all ports through poudriere over 
> something that would never affect any of them?

So that you can if version >= foo to know it is safe to use the new syscal?
Or if version  < foo you must use the old way.

-- 
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: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs

2019-04-07 Thread Cy Schubert
On April 7, 2019 7:11:52 AM PDT, Shawn Webb  wrote:
>On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote:
>> Author: oshogbo
>> Date: Sat Apr  6 09:34:26 2019
>> New Revision: 345982
>> URL: https://svnweb.freebsd.org/changeset/base/345982
>> 
>> Log:
>>   Introduce funlinkat syscall that always us to check if we are
>removing
>>   the file associated with the given file descriptor.
>>   
>>   Reviewed by:   kib, asomers
>>   Reviewed by:   cem, jilles, brooks (they reviewed previous version)
>>   Discussed with:pjd, and many others
>>   Differential Revision: https://reviews.freebsd.org/D14567
>
>Hey Mariusz,
>
>Is __FreeBSD_version supposed to be bumped after adding new syscalls?
>I can't remember off-hand.
>
>Thanks,

I don't think so. Why force the rebuild of all ports through poudriere over 
something that would never affect any of them?


-- 
Pardon the typos and autocorrect, small keyboard in use.
Cheers,
Cy Schubert 
FreeBSD UNIX:  Web: http://www.FreeBSD.org

The need of the many outweighs the greed of the few.
___
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: r346011 - head/usr.sbin/bhyve

2019-04-07 Thread Mark Johnston
Author: markj
Date: Sun Apr  7 14:30:17 2019
New Revision: 346011
URL: https://svnweb.freebsd.org/changeset/base/346011

Log:
  Stop compiling bhyve(8) with -O0.
  
  DEBUG_FLAGS is always added to CFLAGS.  This setting appears to be
  accidental and came in with r243327.
  
  Reviewed by:  anish, emaste, jhb, rgrimes
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D19787

Modified:
  head/usr.sbin/bhyve/Makefile

Modified: head/usr.sbin/bhyve/Makefile
==
--- head/usr.sbin/bhyve/MakefileSun Apr  7 14:28:02 2019
(r346010)
+++ head/usr.sbin/bhyve/MakefileSun Apr  7 14:30:17 2019
(r346011)
@@ -9,8 +9,6 @@ CFLAGS+=-I${SRCTOP}/sys
 PROG=  bhyve
 PACKAGE=   bhyve
 
-DEBUG_FLAGS= -g -O0
-
 MAN=   bhyve.8
 
 BHYVE_SYSDIR?=${SRCTOP}
___
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: r346010 - head/usr.sbin/bhyve

2019-04-07 Thread Mark Johnston
Author: markj
Date: Sun Apr  7 14:28:02 2019
New Revision: 346010
URL: https://svnweb.freebsd.org/changeset/base/346010

Log:
  Fix indentation.
  
  No functional change intended.
  
  Reviewed by:  bcran, jhb, rgrimes
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D19786

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

Modified: head/usr.sbin/bhyve/uart_emul.c
==
--- head/usr.sbin/bhyve/uart_emul.c Sun Apr  7 14:26:14 2019
(r346009)
+++ head/usr.sbin/bhyve/uart_emul.c Sun Apr  7 14:28:02 2019
(r346010)
@@ -440,75 +440,75 @@ uart_write(struct uart_softc *sc, int offset, uint8_t 
 */
sc->ier = value & 0x0F;
break;
-   case REG_FCR:
-   /*
-* When moving from FIFO and 16450 mode and vice versa,
-* the FIFO contents are reset.
-*/
-   if ((sc->fcr & FCR_ENABLE) ^ (value & FCR_ENABLE)) {
-   fifosz = (value & FCR_ENABLE) ? FIFOSZ : 1;
-   rxfifo_reset(sc, fifosz);
-   }
+   case REG_FCR:
+   /*
+* When moving from FIFO and 16450 mode and vice versa,
+* the FIFO contents are reset.
+*/
+   if ((sc->fcr & FCR_ENABLE) ^ (value & FCR_ENABLE)) {
+   fifosz = (value & FCR_ENABLE) ? FIFOSZ : 1;
+   rxfifo_reset(sc, fifosz);
+   }
 
-   /*
-* The FCR_ENABLE bit must be '1' for the programming
-* of other FCR bits to be effective.
-*/
-   if ((value & FCR_ENABLE) == 0) {
-   sc->fcr = 0;
-   } else {
-   if ((value & FCR_RCV_RST) != 0)
-   rxfifo_reset(sc, FIFOSZ);
+   /*
+* The FCR_ENABLE bit must be '1' for the programming
+* of other FCR bits to be effective.
+*/
+   if ((value & FCR_ENABLE) == 0) {
+   sc->fcr = 0;
+   } else {
+   if ((value & FCR_RCV_RST) != 0)
+   rxfifo_reset(sc, FIFOSZ);
 
-   sc->fcr = value &
-(FCR_ENABLE | FCR_DMA | FCR_RX_MASK);
-   }
-   break;
-   case REG_LCR:
-   sc->lcr = value;
-   break;
-   case REG_MCR:
-   /* Apply mask so that bits 5-7 are 0 */
-   sc->mcr = value & 0x1F;
-   msr = modem_status(sc->mcr);
+   sc->fcr = value &
+(FCR_ENABLE | FCR_DMA | FCR_RX_MASK);
+   }
+   break;
+   case REG_LCR:
+   sc->lcr = value;
+   break;
+   case REG_MCR:
+   /* Apply mask so that bits 5-7 are 0 */
+   sc->mcr = value & 0x1F;
+   msr = modem_status(sc->mcr);
 
-   /*
-* Detect if there has been any change between the
-* previous and the new value of MSR. If there is
-* then assert the appropriate MSR delta bit.
-*/
-   if ((msr & MSR_CTS) ^ (sc->msr & MSR_CTS))
-   sc->msr |= MSR_DCTS;
-   if ((msr & MSR_DSR) ^ (sc->msr & MSR_DSR))
-   sc->msr |= MSR_DDSR;
-   if ((msr & MSR_DCD) ^ (sc->msr & MSR_DCD))
-   sc->msr |= MSR_DDCD;
-   if ((sc->msr & MSR_RI) != 0 && (msr & MSR_RI) == 0)
-   sc->msr |= MSR_TERI;
+   /*
+* Detect if there has been any change between the
+* previous and the new value of MSR. If there is
+* then assert the appropriate MSR delta bit.
+*/
+   if ((msr & MSR_CTS) ^ (sc->msr & MSR_CTS))
+   sc->msr |= MSR_DCTS;
+   if ((msr & MSR_DSR) ^ (sc->msr & MSR_DSR))
+   sc->msr |= MSR_DDSR;
+   if ((msr & MSR_DCD) ^ (sc->msr & MSR_DCD))
+   sc->msr |= MSR_DDCD;
+   if ((sc->msr & MSR_RI) != 0 && (msr & MSR_RI) == 0)
+   sc->msr |= MSR_TERI;
 
-   /*
-* Update the value of MSR while retaining the delta
-* bits.
-   

svn commit: r346009 - in head: sys/kern tests/sys/kern

2019-04-07 Thread Mark Johnston
Author: markj
Date: Sun Apr  7 14:26:14 2019
New Revision: 346009
URL: https://svnweb.freebsd.org/changeset/base/346009

Log:
  Set the p_oppid field of orphans when exiting.
  
  Such processes will be reparented to the reaper when the current
  parent is done with them (i.e., ptrace detached), so p_oppid must be
  updated accordingly.
  
  Add a regression test to exercise this code path.  Previously it
  would not be possible to reap an orphan with a stale oppid.
  
  Reviewed by:  kib, mjg
  Tested by:pho
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D19825

Modified:
  head/sys/kern/kern_exit.c
  head/tests/sys/kern/ptrace_test.c

Modified: head/sys/kern/kern_exit.c
==
--- head/sys/kern/kern_exit.c   Sun Apr  7 14:07:28 2019(r346008)
+++ head/sys/kern/kern_exit.c   Sun Apr  7 14:26:14 2019(r346009)
@@ -543,6 +543,11 @@ exit1(struct thread *td, int rval, int signo)
 */
while ((q = LIST_FIRST(>p_orphans)) != NULL) {
PROC_LOCK(q);
+   KASSERT(q->p_oppid == p->p_pid,
+   ("orphan %p of %p has unexpected oppid %d", q, p,
+   q->p_oppid));
+   q->p_oppid = q->p_reaper->p_pid;
+
/*
 * If we are the real parent of this process
 * but it has been reparented to a debugger, then

Modified: head/tests/sys/kern/ptrace_test.c
==
--- head/tests/sys/kern/ptrace_test.c   Sun Apr  7 14:07:28 2019
(r346008)
+++ head/tests/sys/kern/ptrace_test.c   Sun Apr  7 14:26:14 2019
(r346009)
@@ -452,6 +452,67 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_d
 }
 
 /*
+ * Make sure that we can collect the exit status of an orphaned process.
+ */
+ATF_TC_WITHOUT_HEAD(ptrace__parent_exits_before_child);
+ATF_TC_BODY(ptrace__parent_exits_before_child, tc)
+{
+   ssize_t n;
+   int cpipe1[2], cpipe2[2], gcpipe[2], status;
+   pid_t child, gchild;
+
+   ATF_REQUIRE(pipe(cpipe1) == 0);
+   ATF_REQUIRE(pipe(cpipe2) == 0);
+   ATF_REQUIRE(pipe(gcpipe) == 0);
+
+   ATF_REQUIRE(procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == 0);
+
+   ATF_REQUIRE((child = fork()) != -1);
+   if (child == 0) {
+   CHILD_REQUIRE((gchild = fork()) != -1);
+   if (gchild == 0) {
+   status = 1;
+   do {
+   n = read(gcpipe[0], , sizeof(status));
+   } while (n == -1 && errno == EINTR);
+   _exit(status);
+   }
+
+   CHILD_REQUIRE(write(cpipe1[1], , sizeof(gchild)) ==
+   sizeof(gchild));
+   CHILD_REQUIRE(read(cpipe2[0], , sizeof(status)) ==
+   sizeof(status));
+   _exit(status);
+   }
+
+   ATF_REQUIRE(read(cpipe1[0], , sizeof(gchild)) == sizeof(gchild));
+
+   ATF_REQUIRE(ptrace(PT_ATTACH, gchild, NULL, 0) == 0);
+
+   status = 0;
+   ATF_REQUIRE(write(cpipe2[1], , sizeof(status)) ==
+   sizeof(status));
+   ATF_REQUIRE(waitpid(child, , 0) == child);
+   ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 0);
+
+   status = 0;
+   ATF_REQUIRE(write(gcpipe[1], , sizeof(status)) ==
+   sizeof(status));
+   ATF_REQUIRE(waitpid(gchild, , 0) == gchild);
+   ATF_REQUIRE(WIFSTOPPED(status));
+   ATF_REQUIRE(ptrace(PT_DETACH, gchild, (caddr_t)1, 0) == 0);
+   ATF_REQUIRE(waitpid(gchild, , 0) == gchild);
+   ATF_REQUIRE(WIFEXITED(status) && WEXITSTATUS(status) == 0);
+
+   ATF_REQUIRE(close(cpipe1[0]) == 0);
+   ATF_REQUIRE(close(cpipe1[1]) == 0);
+   ATF_REQUIRE(close(cpipe2[0]) == 0);
+   ATF_REQUIRE(close(cpipe2[1]) == 0);
+   ATF_REQUIRE(close(gcpipe[0]) == 0);
+   ATF_REQUIRE(close(gcpipe[1]) == 0);
+}
+
+/*
  * The parent process should always act the same regardless of how the
  * debugger is attached to it.
  */
@@ -3850,6 +3911,7 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, ptrace__parent_wait_after_attach);
ATF_TP_ADD_TC(tp, ptrace__parent_sees_exit_after_child_debugger);
ATF_TP_ADD_TC(tp, ptrace__parent_sees_exit_after_unrelated_debugger);
+   ATF_TP_ADD_TC(tp, ptrace__parent_exits_before_child);
ATF_TP_ADD_TC(tp, ptrace__follow_fork_both_attached);
ATF_TP_ADD_TC(tp, ptrace__follow_fork_child_detached);
ATF_TP_ADD_TC(tp, ptrace__follow_fork_parent_detached);
___
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: r345982 - in head: include lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/freebsd32 sys/compat/linux sys/kern sys/sys sys/ufs/ffs

2019-04-07 Thread Shawn Webb
On Sat, Apr 06, 2019 at 09:34:26AM +, Mariusz Zaborski wrote:
> Author: oshogbo
> Date: Sat Apr  6 09:34:26 2019
> New Revision: 345982
> URL: https://svnweb.freebsd.org/changeset/base/345982
> 
> Log:
>   Introduce funlinkat syscall that always us to check if we are removing
>   the file associated with the given file descriptor.
>   
>   Reviewed by:kib, asomers
>   Reviewed by:cem, jilles, brooks (they reviewed previous version)
>   Discussed with: pjd, and many others
>   Differential Revision:  https://reviews.freebsd.org/D14567

Hey Mariusz,

Is __FreeBSD_version supposed to be bumped after adding new syscalls?
I can't remember off-hand.

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

Tor-ified Signal:+1 443-546-8752
Tor+XMPP+OTR:latt...@is.a.hacker.sx
GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9  3633 C85B 0AF8 AB23 0FB2


signature.asc
Description: PGP signature


svn commit: r346008 - head/stand/efi/loader

2019-04-07 Thread Toomas Soome
Author: tsoome
Date: Sun Apr  7 14:07:28 2019
New Revision: 346008
URL: https://svnweb.freebsd.org/changeset/base/346008

Log:
  loader: command_lsefi: ret can be used uninitialized
  
  MFC after:1w

Modified:
  head/stand/efi/loader/main.c

Modified: head/stand/efi/loader/main.c
==
--- head/stand/efi/loader/main.cSun Apr  7 13:36:17 2019
(r346007)
+++ head/stand/efi/loader/main.cSun Apr  7 14:07:28 2019
(r346008)
@@ -1217,7 +1217,7 @@ command_lsefi(int argc __unused, char *argv[] __unused
EFI_HANDLE handle;
UINTN bufsz = 0, i, j;
EFI_STATUS status;
-   int ret;
+   int ret = 0;
 
status = BS->LocateHandle(AllHandles, NULL, NULL, , buffer);
if (status != EFI_BUFFER_TOO_SMALL) {
___
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: r346007 - head/stand/common

2019-04-07 Thread Toomas Soome
Author: tsoome
Date: Sun Apr  7 13:36:17 2019
New Revision: 346007
URL: https://svnweb.freebsd.org/changeset/base/346007

Log:
  loader: add file_remove() function to undo file_insert_tail().
  
  346002 did miss the fact that we do not only undo the loadaddr, but also
  we need to remove the inserted module. Implement file_remove() to do the job.
  
  MFC after:1w

Modified:
  head/stand/common/module.c

Modified: head/stand/common/module.c
==
--- head/stand/common/module.c  Sun Apr  7 13:26:45 2019(r346006)
+++ head/stand/common/module.c  Sun Apr  7 13:36:17 2019(r346007)
@@ -52,16 +52,18 @@ struct moduledir {
STAILQ_ENTRY(moduledir) d_link;
 };
 
-static int file_load(char *filename, vm_offset_t dest, 
struct preloaded_file **result);
-static int file_load_dependencies(struct preloaded_file 
*base_mod);
-static char *  file_search(const char *name, char **extlist);
-static struct kernel_module *  file_findmodule(struct preloaded_file *fp, char 
*modname, struct mod_depend *verinfo);
-static int file_havepath(const char *name);
-static char*mod_searchmodule(char *name, struct mod_depend 
*verinfo);
-static voidfile_insert_tail(struct preloaded_file *mp);
-struct file_metadata*  metadata_next(struct file_metadata *base_mp, 
int type);
-static voidmoduledir_readhints(struct moduledir *mdp);
-static voidmoduledir_rebuild(void);
+static int file_load(char *, vm_offset_t, struct preloaded_file **);
+static int file_load_dependencies(struct preloaded_file *);
+static char * file_search(const char *, char **);
+static struct kernel_module *file_findmodule(struct preloaded_file *, char *,
+struct mod_depend *);
+static int file_havepath(const char *);
+static char *mod_searchmodule(char *, struct mod_depend *);
+static void file_insert_tail(struct preloaded_file *);
+static void file_remove(struct preloaded_file *);
+struct file_metadata *metadata_next(struct file_metadata *, int);
+static void moduledir_readhints(struct moduledir *);
+static void moduledir_rebuild(void);
 
 /* load address should be tweaked by first module loaded (kernel) */
 static vm_offset_t loadaddr = 0;
@@ -70,10 +72,11 @@ static vm_offset_t  loadaddr = 0;
 static const char  *default_searchpath =
 "/boot/kernel;/boot/modules;/boot/dtb";
 #else
-static const char  *default_searchpath ="/boot/kernel;/boot/modules";
+static const char  *default_searchpath = "/boot/kernel;/boot/modules";
 #endif
 
-static STAILQ_HEAD(, moduledir) moduledir_list = 
STAILQ_HEAD_INITIALIZER(moduledir_list);
+static STAILQ_HEAD(, moduledir) moduledir_list =
+STAILQ_HEAD_INITIALIZER(moduledir_list);
 
 struct preloaded_file *preloaded_files = NULL;
 
@@ -591,10 +594,10 @@ mod_loadkld(const char *kldname, int argc, char *argv[
fp->f_args = unargv(argc, argv);
loadaddr_saved = loadaddr;
loadaddr = fp->f_addr + fp->f_size;
-   file_insert_tail(fp);   /* Add to the list of loaded 
files */
+   file_insert_tail(fp);   /* Add to the list of loaded files */
if (file_load_dependencies(fp) != 0) {
err = ENOENT;
-   last_file->f_next = NULL;
+   file_remove(fp);
loadaddr = loadaddr_saved;
fp = NULL;
break;
@@ -998,6 +1001,29 @@ file_insert_tail(struct preloaded_file *fp)
for (cm = preloaded_files; cm->f_next != NULL; cm = cm->f_next)
;
cm->f_next = fp;
+   }
+}
+
+/*
+ * Remove module from the chain
+ */
+static void
+file_remove(struct preloaded_file *fp)
+{
+   struct preloaded_file   *cm;
+
+   if (preloaded_files == NULL)
+   return;
+
+   if (preloaded_files == fp) {
+   preloaded_files = fp->f_next;
+   return;
+}
+for (cm = preloaded_files; cm->f_next != NULL; cm = cm->f_next) {
+   if (cm->f_next == fp) {
+   cm->f_next = fp->f_next;
+   return;
+   }
}
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r346006 - in stable: 11/sys/dev/usb/wlan 12/sys/dev/usb/wlan

2019-04-07 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Apr  7 13:26:45 2019
New Revision: 346006
URL: https://svnweb.freebsd.org/changeset/base/346006

Log:
  MFC r345754:
  run(4): properly set F_DATAPAD radiotap flag if frame has padding between
  frame header and data.
  
  This will fix 'Mysterious OLPC stuff' for received frames and wrong
  CCMP / TKIP / data decoding for transmitted frames in net/wireshark
  dissector.
  
  While here, drop unneeded comment - net80211 handles padding requirements
  for Tx & Rx without driver adjustment.
  
  Was tested with D-Link DWA-140 rev B3, STA mode.

Modified:
  stable/11/sys/dev/usb/wlan/if_run.c
Directory Properties:
  stable/11/   (props changed)

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

Modified: stable/11/sys/dev/usb/wlan/if_run.c
==
--- stable/11/sys/dev/usb/wlan/if_run.c Sun Apr  7 13:11:40 2019
(r346005)
+++ stable/11/sys/dev/usb/wlan/if_run.c Sun Apr  7 13:26:45 2019
(r346006)
@@ -2783,10 +2783,6 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin
}
 
if (flags & RT2860_RX_L2PAD) {
-   /*
-* XXX OpenBSD removes padding between header
-* and payload here...
-*/
DPRINTFN(8, "received RT2860_RX_L2PAD frame\n");
len += 2;
}
@@ -2826,6 +2822,8 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin
uint16_t phy;
 
tap->wr_flags = 0;
+   if (flags & RT2860_RX_L2PAD)
+   tap->wr_flags |= IEEE80211_RADIOTAP_F_DATAPAD;
tap->wr_antsignal = rssi;
tap->wr_antenna = ant;
tap->wr_dbm_antsignal = run_rssi2dbm(sc, rssi, ant);
@@ -3085,14 +3083,23 @@ tr_setup:
 
vap = data->ni->ni_vap;
if (ieee80211_radiotap_active_vap(vap)) {
+   const struct ieee80211_frame *wh;
struct run_tx_radiotap_header *tap = >sc_txtap;
struct rt2860_txwi *txwi = 
(struct rt2860_txwi *)(>desc + sizeof(struct 
rt2870_txd));
+   int has_l2pad;
+
+   wh = mtod(m, struct ieee80211_frame *);
+   has_l2pad = IEEE80211_HAS_ADDR4(wh) !=
+   IEEE80211_QOS_HAS_SEQ(wh);
+
tap->wt_flags = 0;
tap->wt_rate = rt2860_rates[data->ridx].rate;
tap->wt_hwqueue = index;
if (le16toh(txwi->phy) & RT2860_PHY_SHPRE)
tap->wt_flags |= IEEE80211_RADIOTAP_F_SHORTPRE;
+   if (has_l2pad)
+   tap->wt_flags |= IEEE80211_RADIOTAP_F_DATAPAD;
 
ieee80211_radiotap_tx(vap, m);
}
___
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: r346006 - in stable: 11/sys/dev/usb/wlan 12/sys/dev/usb/wlan

2019-04-07 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Apr  7 13:26:45 2019
New Revision: 346006
URL: https://svnweb.freebsd.org/changeset/base/346006

Log:
  MFC r345754:
  run(4): properly set F_DATAPAD radiotap flag if frame has padding between
  frame header and data.
  
  This will fix 'Mysterious OLPC stuff' for received frames and wrong
  CCMP / TKIP / data decoding for transmitted frames in net/wireshark
  dissector.
  
  While here, drop unneeded comment - net80211 handles padding requirements
  for Tx & Rx without driver adjustment.
  
  Was tested with D-Link DWA-140 rev B3, STA mode.

Modified:
  stable/12/sys/dev/usb/wlan/if_run.c
Directory Properties:
  stable/12/   (props changed)

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

Modified: stable/12/sys/dev/usb/wlan/if_run.c
==
--- stable/12/sys/dev/usb/wlan/if_run.c Sun Apr  7 13:11:40 2019
(r346005)
+++ stable/12/sys/dev/usb/wlan/if_run.c Sun Apr  7 13:26:45 2019
(r346006)
@@ -2851,10 +2851,6 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin
}
 
if (flags & RT2860_RX_L2PAD) {
-   /*
-* XXX OpenBSD removes padding between header
-* and payload here...
-*/
RUN_DPRINTF(sc, RUN_DEBUG_RECV,
"received RT2860_RX_L2PAD frame\n");
len += 2;
@@ -2896,6 +2892,8 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin
uint16_t phy;
 
tap->wr_flags = 0;
+   if (flags & RT2860_RX_L2PAD)
+   tap->wr_flags |= IEEE80211_RADIOTAP_F_DATAPAD;
tap->wr_antsignal = rssi;
tap->wr_antenna = ant;
tap->wr_dbm_antsignal = run_rssi2dbm(sc, rssi, ant);
@@ -3162,14 +3160,23 @@ tr_setup:
 
vap = data->ni->ni_vap;
if (ieee80211_radiotap_active_vap(vap)) {
+   const struct ieee80211_frame *wh;
struct run_tx_radiotap_header *tap = >sc_txtap;
struct rt2860_txwi *txwi = 
(struct rt2860_txwi *)(>desc + sizeof(struct 
rt2870_txd));
+   int has_l2pad;
+
+   wh = mtod(m, struct ieee80211_frame *);
+   has_l2pad = IEEE80211_HAS_ADDR4(wh) !=
+   IEEE80211_QOS_HAS_SEQ(wh);
+
tap->wt_flags = 0;
tap->wt_rate = rt2860_rates[data->ridx].rate;
tap->wt_hwqueue = index;
if (le16toh(txwi->phy) & RT2860_PHY_SHPRE)
tap->wt_flags |= IEEE80211_RADIOTAP_F_SHORTPRE;
+   if (has_l2pad)
+   tap->wt_flags |= IEEE80211_RADIOTAP_F_DATAPAD;
 
ieee80211_radiotap_tx(vap, m);
}
___
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: r346005 - in stable: 11/sys/dev/usb/wlan 12/sys/dev/usb/wlan

2019-04-07 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Apr  7 13:11:40 2019
New Revision: 346005
URL: https://svnweb.freebsd.org/changeset/base/346005

Log:
  MFC r345751:
  uath(4), urtw(4): restart driver if device does not respond after Tx request

Modified:
  stable/12/sys/dev/usb/wlan/if_uath.c
  stable/12/sys/dev/usb/wlan/if_urtw.c
Directory Properties:
  stable/12/   (props changed)

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

Modified: stable/12/sys/dev/usb/wlan/if_uath.c
==
--- stable/12/sys/dev/usb/wlan/if_uath.cSun Apr  7 13:04:25 2019
(r346004)
+++ stable/12/sys/dev/usb/wlan/if_uath.cSun Apr  7 13:11:40 2019
(r346005)
@@ -1276,8 +1276,8 @@ uath_watchdog(void *arg)
if (sc->sc_tx_timer > 0) {
if (--sc->sc_tx_timer == 0) {
device_printf(sc->sc_dev, "device timeout\n");
-   /*uath_init(sc); XXX needs a process context! */
counter_u64_add(ic->ic_oerrors, 1);
+   ieee80211_restart_all(ic);
return;
}
callout_reset(>watchdog_ch, hz, uath_watchdog, sc);

Modified: stable/12/sys/dev/usb/wlan/if_urtw.c
==
--- stable/12/sys/dev/usb/wlan/if_urtw.cSun Apr  7 13:04:25 2019
(r346004)
+++ stable/12/sys/dev/usb/wlan/if_urtw.cSun Apr  7 13:11:40 2019
(r346005)
@@ -1891,11 +1891,13 @@ static void
 urtw_watchdog(void *arg)
 {
struct urtw_softc *sc = arg;
+   struct ieee80211com *ic = >sc_ic;
 
if (sc->sc_txtimer > 0) {
if (--sc->sc_txtimer == 0) {
device_printf(sc->sc_dev, "device timeout\n");
-   counter_u64_add(sc->sc_ic.ic_oerrors, 1);
+   counter_u64_add(ic->ic_oerrors, 1);
+   ieee80211_restart_all(ic);
return;
}
callout_reset(>sc_watchdog_ch, hz, urtw_watchdog, sc);
___
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: r346005 - in stable: 11/sys/dev/usb/wlan 12/sys/dev/usb/wlan

2019-04-07 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Apr  7 13:11:40 2019
New Revision: 346005
URL: https://svnweb.freebsd.org/changeset/base/346005

Log:
  MFC r345751:
  uath(4), urtw(4): restart driver if device does not respond after Tx request

Modified:
  stable/11/sys/dev/usb/wlan/if_uath.c
  stable/11/sys/dev/usb/wlan/if_urtw.c
Directory Properties:
  stable/11/   (props changed)

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

Modified: stable/11/sys/dev/usb/wlan/if_uath.c
==
--- stable/11/sys/dev/usb/wlan/if_uath.cSun Apr  7 13:04:25 2019
(r346004)
+++ stable/11/sys/dev/usb/wlan/if_uath.cSun Apr  7 13:11:40 2019
(r346005)
@@ -1271,8 +1271,8 @@ uath_watchdog(void *arg)
if (sc->sc_tx_timer > 0) {
if (--sc->sc_tx_timer == 0) {
device_printf(sc->sc_dev, "device timeout\n");
-   /*uath_init(sc); XXX needs a process context! */
counter_u64_add(ic->ic_oerrors, 1);
+   ieee80211_restart_all(ic);
return;
}
callout_reset(>watchdog_ch, hz, uath_watchdog, sc);

Modified: stable/11/sys/dev/usb/wlan/if_urtw.c
==
--- stable/11/sys/dev/usb/wlan/if_urtw.cSun Apr  7 13:04:25 2019
(r346004)
+++ stable/11/sys/dev/usb/wlan/if_urtw.cSun Apr  7 13:11:40 2019
(r346005)
@@ -1883,11 +1883,13 @@ static void
 urtw_watchdog(void *arg)
 {
struct urtw_softc *sc = arg;
+   struct ieee80211com *ic = >sc_ic;
 
if (sc->sc_txtimer > 0) {
if (--sc->sc_txtimer == 0) {
device_printf(sc->sc_dev, "device timeout\n");
-   counter_u64_add(sc->sc_ic.ic_oerrors, 1);
+   counter_u64_add(ic->ic_oerrors, 1);
+   ieee80211_restart_all(ic);
return;
}
callout_reset(>sc_watchdog_ch, hz, urtw_watchdog, sc);
___
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: r346004 - in stable: 11/sys/dev/usb/wlan 12/sys/dev/usb/wlan

2019-04-07 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Apr  7 13:04:25 2019
New Revision: 346004
URL: https://svnweb.freebsd.org/changeset/base/346004

Log:
  MFC r345753:
  run(4): do not clear PROTECTED bit if frame was not decrypted by NIC.
  
  Was tested with D-Link DWA-140 rev B3, STA / MONITOR modes.

Modified:
  stable/11/sys/dev/usb/wlan/if_run.c
Directory Properties:
  stable/11/   (props changed)

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

Modified: stable/11/sys/dev/usb/wlan/if_run.c
==
--- stable/11/sys/dev/usb/wlan/if_run.c Sun Apr  7 12:57:38 2019
(r346003)
+++ stable/11/sys/dev/usb/wlan/if_run.c Sun Apr  7 13:04:25 2019
(r346004)
@@ -2796,8 +2796,8 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin
 
wh = mtod(m, struct ieee80211_frame *);
 
-   /* XXX wrong for monitor mode */
-   if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
+   if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) != 0 &&
+   (flags & RT2860_RX_DEC) != 0) {
wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED;
m->m_flags |= M_WEP;
}
___
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: r346004 - in stable: 11/sys/dev/usb/wlan 12/sys/dev/usb/wlan

2019-04-07 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Apr  7 13:04:25 2019
New Revision: 346004
URL: https://svnweb.freebsd.org/changeset/base/346004

Log:
  MFC r345753:
  run(4): do not clear PROTECTED bit if frame was not decrypted by NIC.
  
  Was tested with D-Link DWA-140 rev B3, STA / MONITOR modes.

Modified:
  stable/12/sys/dev/usb/wlan/if_run.c
Directory Properties:
  stable/12/   (props changed)

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

Modified: stable/12/sys/dev/usb/wlan/if_run.c
==
--- stable/12/sys/dev/usb/wlan/if_run.c Sun Apr  7 12:57:38 2019
(r346003)
+++ stable/12/sys/dev/usb/wlan/if_run.c Sun Apr  7 13:04:25 2019
(r346004)
@@ -2865,8 +2865,8 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin
 
wh = mtod(m, struct ieee80211_frame *);
 
-   /* XXX wrong for monitor mode */
-   if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
+   if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) != 0 &&
+   (flags & RT2860_RX_DEC) != 0) {
wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED;
m->m_flags |= M_WEP;
}
___
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: r346003 - in stable: 11/sys/dev/usb/wlan 12/sys/dev/usb/wlan

2019-04-07 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Apr  7 12:57:38 2019
New Revision: 346003
URL: https://svnweb.freebsd.org/changeset/base/346003

Log:
  MFC r345729:
  urtw(4): export TSF timestamp for received frames via radiotap
  
  Was tested with Netgear WG111 v3 (RTL8187B), STA mode.

Modified:
  stable/11/sys/dev/usb/wlan/if_urtw.c
  stable/11/sys/dev/usb/wlan/if_urtwvar.h
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sys/dev/usb/wlan/if_urtw.c
  stable/12/sys/dev/usb/wlan/if_urtwvar.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sys/dev/usb/wlan/if_urtw.c
==
--- stable/11/sys/dev/usb/wlan/if_urtw.cSun Apr  7 12:20:17 2019
(r346002)
+++ stable/11/sys/dev/usb/wlan/if_urtw.cSun Apr  7 12:57:38 2019
(r346003)
@@ -3937,6 +3937,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da
struct urtw_softc *sc = data->sc;
struct ieee80211com *ic = >sc_ic;
uint8_t noise = 0, rate;
+   uint64_t mactime;
 
usbd_xfer_status(xfer, , NULL, NULL, NULL);
 
@@ -3956,6 +3957,9 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da
/* XXX correct? */
rssi = rx->rssi & URTW_RX_RSSI_MASK;
noise = rx->noise;
+
+   if (ieee80211_radiotap_active(ic))
+   mactime = rx->mactime;
} else {
struct urtw_8187l_rxhdr *rx;
 
@@ -3972,6 +3976,9 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da
/* XXX correct? */
rssi = rx->rssi & URTW_RX_8187L_RSSI_MASK;
noise = rx->noise;
+
+   if (ieee80211_radiotap_active(ic))
+   mactime = rx->mactime;
}
 
if (flen < IEEE80211_ACK_LEN)
@@ -3991,6 +3998,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da
if (ieee80211_radiotap_active(ic)) {
struct urtw_rx_radiotap_header *tap = >sc_rxtap;
 
+   tap->wr_tsf = mactime;
tap->wr_flags = 0;
tap->wr_dbm_antsignal = (int8_t)rssi;
}

Modified: stable/11/sys/dev/usb/wlan/if_urtwvar.h
==
--- stable/11/sys/dev/usb/wlan/if_urtwvar.h Sun Apr  7 12:20:17 2019
(r346002)
+++ stable/11/sys/dev/usb/wlan/if_urtwvar.h Sun Apr  7 12:57:38 2019
(r346003)
@@ -55,6 +55,7 @@ typedef STAILQ_HEAD(, urtw_data) urtw_datahead;
 
 struct urtw_rx_radiotap_header {
struct ieee80211_radiotap_header wr_ihdr;
+   uint64_twr_tsf;
uint8_t wr_flags;
uint8_t wr_pad;
uint16_twr_chan_freq;
@@ -63,7 +64,8 @@ struct urtw_rx_radiotap_header {
 } __packed __aligned(8);
 
 #define URTW_RX_RADIOTAP_PRESENT   \
-   ((1 << IEEE80211_RADIOTAP_FLAGS) |  \
+   ((1 << IEEE80211_RADIOTAP_TSFT) |   \
+(1 << IEEE80211_RADIOTAP_FLAGS) |  \
 (1 << IEEE80211_RADIOTAP_CHANNEL) |\
 (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL))
 
___
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: r346003 - in stable: 11/sys/dev/usb/wlan 12/sys/dev/usb/wlan

2019-04-07 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Apr  7 12:57:38 2019
New Revision: 346003
URL: https://svnweb.freebsd.org/changeset/base/346003

Log:
  MFC r345729:
  urtw(4): export TSF timestamp for received frames via radiotap
  
  Was tested with Netgear WG111 v3 (RTL8187B), STA mode.

Modified:
  stable/12/sys/dev/usb/wlan/if_urtw.c
  stable/12/sys/dev/usb/wlan/if_urtwvar.h
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/usb/wlan/if_urtw.c
  stable/11/sys/dev/usb/wlan/if_urtwvar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/sys/dev/usb/wlan/if_urtw.c
==
--- stable/12/sys/dev/usb/wlan/if_urtw.cSun Apr  7 12:20:17 2019
(r346002)
+++ stable/12/sys/dev/usb/wlan/if_urtw.cSun Apr  7 12:57:38 2019
(r346003)
@@ -3932,6 +3932,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da
struct urtw_softc *sc = data->sc;
struct ieee80211com *ic = >sc_ic;
uint8_t noise = 0, rate;
+   uint64_t mactime;
 
usbd_xfer_status(xfer, , NULL, NULL, NULL);
 
@@ -3951,6 +3952,9 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da
/* XXX correct? */
rssi = rx->rssi & URTW_RX_RSSI_MASK;
noise = rx->noise;
+
+   if (ieee80211_radiotap_active(ic))
+   mactime = rx->mactime;
} else {
struct urtw_8187l_rxhdr *rx;
 
@@ -3967,6 +3971,9 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da
/* XXX correct? */
rssi = rx->rssi & URTW_RX_8187L_RSSI_MASK;
noise = rx->noise;
+
+   if (ieee80211_radiotap_active(ic))
+   mactime = rx->mactime;
}
 
if (flen < IEEE80211_ACK_LEN)
@@ -3986,6 +3993,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da
if (ieee80211_radiotap_active(ic)) {
struct urtw_rx_radiotap_header *tap = >sc_rxtap;
 
+   tap->wr_tsf = mactime;
tap->wr_flags = 0;
tap->wr_dbm_antsignal = (int8_t)rssi;
}

Modified: stable/12/sys/dev/usb/wlan/if_urtwvar.h
==
--- stable/12/sys/dev/usb/wlan/if_urtwvar.h Sun Apr  7 12:20:17 2019
(r346002)
+++ stable/12/sys/dev/usb/wlan/if_urtwvar.h Sun Apr  7 12:57:38 2019
(r346003)
@@ -55,6 +55,7 @@ typedef STAILQ_HEAD(, urtw_data) urtw_datahead;
 
 struct urtw_rx_radiotap_header {
struct ieee80211_radiotap_header wr_ihdr;
+   uint64_twr_tsf;
uint8_t wr_flags;
uint8_t wr_pad;
uint16_twr_chan_freq;
@@ -63,7 +64,8 @@ struct urtw_rx_radiotap_header {
 } __packed __aligned(8);
 
 #define URTW_RX_RADIOTAP_PRESENT   \
-   ((1 << IEEE80211_RADIOTAP_FLAGS) |  \
+   ((1 << IEEE80211_RADIOTAP_TSFT) |   \
+(1 << IEEE80211_RADIOTAP_FLAGS) |  \
 (1 << IEEE80211_RADIOTAP_CHANNEL) |\
 (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL))
 
___
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: r346002 - head/stand/common

2019-04-07 Thread Toomas Soome
Author: tsoome
Date: Sun Apr  7 12:20:17 2019
New Revision: 346002
URL: https://svnweb.freebsd.org/changeset/base/346002

Log:
  loader: mod_loadkld() error: we previously assumed 'last_file' could be null
  
  The last_file variable is used to reset the loadaddr variable back to original
  value; however, it is possible the last_file is NULL, so we can not blindly
  trust it. But then again, we can just save the original loadaddr and use
  the saved value for recovery.
  
  MFC after:1w

Modified:
  head/stand/common/module.c

Modified: head/stand/common/module.c
==
--- head/stand/common/module.c  Sun Apr  7 12:10:19 2019(r346001)
+++ head/stand/common/module.c  Sun Apr  7 12:20:17 2019(r346002)
@@ -559,9 +559,10 @@ mod_load(char *modname, struct mod_depend *verinfo, in
 int
 mod_loadkld(const char *kldname, int argc, char *argv[])
 {
-   struct preloaded_file   *fp, *last_file;
-   int err;
+   struct preloaded_file   *fp;
+   int err;
char*filename;
+   vm_offset_t loadaddr_saved;
 
/*
 * Get fully qualified KLD name
@@ -582,22 +583,19 @@ mod_loadkld(const char *kldname, int argc, char *argv[
free(filename);
return (0);
}
-   for (last_file = preloaded_files;
-last_file != NULL && last_file->f_next != NULL;
-last_file = last_file->f_next)
-   ;
 
do {
err = file_load(filename, loadaddr, );
if (err)
break;
fp->f_args = unargv(argc, argv);
+   loadaddr_saved = loadaddr;
loadaddr = fp->f_addr + fp->f_size;
file_insert_tail(fp);   /* Add to the list of loaded 
files */
if (file_load_dependencies(fp) != 0) {
err = ENOENT;
last_file->f_next = NULL;
-   loadaddr = last_file->f_addr + last_file->f_size;
+   loadaddr = loadaddr_saved;
fp = NULL;
break;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r346001 - head/stand/common

2019-04-07 Thread Toomas Soome
Author: tsoome
Date: Sun Apr  7 12:10:19 2019
New Revision: 346001
URL: https://svnweb.freebsd.org/changeset/base/346001

Log:
  loader: file_addmetadata() should check for memory allocation
  
  malloc() can return NULL.
  
  MFC after:1w

Modified:
  head/stand/common/module.c

Modified: head/stand/common/module.c
==
--- head/stand/common/module.c  Sun Apr  7 11:55:11 2019(r346000)
+++ head/stand/common/module.c  Sun Apr  7 12:10:19 2019(r346001)
@@ -677,10 +677,12 @@ file_addmetadata(struct preloaded_file *fp, int type, 
struct file_metadata*md;
 
md = malloc(sizeof(struct file_metadata) - sizeof(md->md_data) + size);
-   md->md_size = size;
-   md->md_type = type;
-   bcopy(p, md->md_data, size);
-   md->md_next = fp->f_metadata;
+   if (md != NULL) {
+   md->md_size = size;
+   md->md_type = type;
+   bcopy(p, md->md_data, size);
+   md->md_next = fp->f_metadata;
+   }
fp->f_metadata = md;
 }
 
___
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: r346000 - head/stand/common

2019-04-07 Thread Toomas Soome
Author: tsoome
Date: Sun Apr  7 11:55:11 2019
New Revision: 346000
URL: https://svnweb.freebsd.org/changeset/base/346000

Log:
  loader: remove pointer checks before free() in module.c
  
  free() does check for NULL argument, remove duplicate checks.
  
  MFC after:1w

Modified:
  head/stand/common/module.c

Modified: head/stand/common/module.c
==
--- head/stand/common/module.c  Sun Apr  7 11:50:41 2019(r345999)
+++ head/stand/common/module.c  Sun Apr  7 11:55:11 2019(r346000)
@@ -534,8 +534,7 @@ mod_load(char *modname, struct mod_depend *verinfo, in
mp = file_findmodule(NULL, modname, verinfo);
if (mp) {
 #ifdef moduleargs
-   if (mp->m_args)
-   free(mp->m_args);
+   free(mp->m_args);
mp->m_args = unargv(argc, argv);
 #endif
snprintf(command_errbuf, sizeof(command_errbuf),
@@ -961,18 +960,14 @@ file_discard(struct preloaded_file *fp)
}
mp = fp->f_modules;
while (mp) {
-   if (mp->m_name)
-   free(mp->m_name);
+   free(mp->m_name);
mp1 = mp;
mp = mp->m_next;
free(mp1);
}
-   if (fp->f_name != NULL)
-   free(fp->f_name);
-   if (fp->f_type != NULL)
-   free(fp->f_type);
-   if (fp->f_args != NULL)
-   free(fp->f_args);
+   free(fp->f_name);
+   free(fp->f_type);
+   free(fp->f_args);
free(fp);
 }
 
@@ -1055,10 +1050,8 @@ moduledir_readhints(struct moduledir *mdp)
return;
 bad:
close(fd);
-   if (mdp->d_hints) {
-   free(mdp->d_hints);
-   mdp->d_hints = NULL;
-   }
+   free(mdp->d_hints);
+   mdp->d_hints = NULL;
mdp->d_flags |= MDIR_NOHINTS;
return;
 }
@@ -1119,8 +1112,7 @@ moduledir_rebuild(void)
if ((mdp->d_flags & MDIR_REMOVED) == 0) {
mdp = STAILQ_NEXT(mdp, d_link);
} else {
-   if (mdp->d_hints)
-   free(mdp->d_hints);
+   free(mdp->d_hints);
mtmp = mdp;
mdp = STAILQ_NEXT(mdp, d_link);
STAILQ_REMOVE(_list, mtmp, moduledir, d_link);
___
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: r345999 - head/stand/common

2019-04-07 Thread Toomas Soome
Author: tsoome
Date: Sun Apr  7 11:50:41 2019
New Revision: 345999
URL: https://svnweb.freebsd.org/changeset/base/345999

Log:
  loader: file_addmodule should check for memory allocation
  
  strdup() can return NULL.
  
  MFC after:1w

Modified:
  head/stand/common/module.c

Modified: head/stand/common/module.c
==
--- head/stand/common/module.c  Sun Apr  7 11:48:41 2019(r345998)
+++ head/stand/common/module.c  Sun Apr  7 11:50:41 2019(r345999)
@@ -930,6 +930,10 @@ file_addmodule(struct preloaded_file *fp, char *modnam
if (mp == NULL)
return (ENOMEM);
mp->m_name = strdup(modname);
+   if (mp->m_name == NULL) {
+   free(mp);
+   return (ENOMEM);
+   }
mp->m_version = version;
mp->m_fp = fp;
mp->m_next = fp->f_modules;
___
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: r345998 - head/stand/common

2019-04-07 Thread Toomas Soome
Author: tsoome
Date: Sun Apr  7 11:48:41 2019
New Revision: 345998
URL: https://svnweb.freebsd.org/changeset/base/345998

Log:
  loader: malloc+bzero is calloc
  
  Replace malloc+bzero in module.c with calloc.
  
  MFC after:1w

Modified:
  head/stand/common/module.c

Modified: head/stand/common/module.c
==
--- head/stand/common/module.c  Sun Apr  7 08:58:09 2019(r345997)
+++ head/stand/common/module.c  Sun Apr  7 11:48:41 2019(r345998)
@@ -926,10 +926,9 @@ file_addmodule(struct preloaded_file *fp, char *modnam
mp = file_findmodule(fp, modname, );
if (mp)
return (EEXIST);
-   mp = malloc(sizeof(struct kernel_module));
+   mp = calloc(1, sizeof(struct kernel_module));
if (mp == NULL)
return (ENOMEM);
-   bzero(mp, sizeof(struct kernel_module));
mp->m_name = strdup(modname);
mp->m_version = version;
mp->m_fp = fp;
@@ -980,12 +979,8 @@ file_discard(struct preloaded_file *fp)
 struct preloaded_file *
 file_alloc(void)
 {
-   struct preloaded_file   *fp;
 
-   if ((fp = malloc(sizeof(struct preloaded_file))) != NULL) {
-   bzero(fp, sizeof(struct preloaded_file));
-   }
-   return (fp);
+   return (calloc(1, sizeof(struct preloaded_file)));
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r345997 - head/sys/dev/pci

2019-04-07 Thread Konstantin Belousov
Author: kib
Date: Sun Apr  7 08:58:09 2019
New Revision: 345997
URL: https://svnweb.freebsd.org/changeset/base/345997

Log:
  Give new home to the comment from ppt_pci_reset(), explaining a nuance
  of power reset.
  
  Noted by: sor...@cydem.org
  Sponsored by: Mellanox Technologies
  MFC after:12 days

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

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Sat Apr  6 23:35:23 2019(r345996)
+++ head/sys/dev/pci/pci.c  Sun Apr  7 08:58:09 2019(r345997)
@@ -6394,6 +6394,11 @@ pcie_flr(device_t dev, u_int max_delay, bool force)
return (true);
 }
 
+/*
+ * Attempt a power-management reset by cycling the device in/out of D3
+ * state.  PCI spec says we can only go into D3 state from D0 state.
+ * Transition from D[12] into D0 before going to D3 state.
+ */
 int
 pci_power_reset(device_t dev)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"