Re: svn commit: r316516 - head/etc

2017-04-04 Thread Cy Schubert
In message <201704050523.v355n9km082...@repo.freebsd.org>, Cy Schubert 
writes:
> Author: cy
> Date: Wed Apr  5 05:23:09 2017
> New Revision: 316516
> URL: https://svnweb.freebsd.org/changeset/base/316516
> 
> Log:
>   r316487 altered the defined values of rc_force from "yes" (for yes)
>   and NULL (for no) to "no" (for no) and no change to the definition
>   of yes. Two rc.d scripts, dhclient and bgfsck check rc_force for
>   yesi, using test -n, and no, using test -z. The redefinition of
>   yes and no by r316487 caused rc.d/dhclient, when invoked by devd
>   using a devd.conf rule, to assign DHCP assigned IP addresses for
>   interfaces with statically assigned interfaces, breaking boot.
>   Point of breakage was at line 25 of etc/rc.d/dhclient (r301068)
>   where $rc_force needs to be NULL.
>   
>   MFC after:  3 weeks
>   X-MFC with: r316487

discussed with: ngie
> 
> Modified:
>   head/etc/rc.subr
> 
> Modified: head/etc/rc.subr
> =
> =
> --- head/etc/rc.subr  Wed Apr  5 05:01:23 2017(r316515)
> +++ head/etc/rc.subr  Wed Apr  5 05:23:09 2017(r316516)
> @@ -929,6 +929,9 @@ run_rc_command()
>   eval ${rcvar}=YES
>   fi
>   fi
> + if ! checkyesno rc_force; then
> + rc_force=
> + fi
>   debug "_rc_prefix=${_rc_prefix}"
>  
>   eval _override_command=\$${name}_program
> 



-- 
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: r316516 - head/etc

2017-04-04 Thread Cy Schubert
Author: cy
Date: Wed Apr  5 05:23:09 2017
New Revision: 316516
URL: https://svnweb.freebsd.org/changeset/base/316516

Log:
  r316487 altered the defined values of rc_force from "yes" (for yes)
  and NULL (for no) to "no" (for no) and no change to the definition
  of yes. Two rc.d scripts, dhclient and bgfsck check rc_force for
  yesi, using test -n, and no, using test -z. The redefinition of
  yes and no by r316487 caused rc.d/dhclient, when invoked by devd
  using a devd.conf rule, to assign DHCP assigned IP addresses for
  interfaces with statically assigned interfaces, breaking boot.
  Point of breakage was at line 25 of etc/rc.d/dhclient (r301068)
  where $rc_force needs to be NULL.
  
  MFC after:3 weeks
  X-MFC with:   r316487

Modified:
  head/etc/rc.subr

Modified: head/etc/rc.subr
==
--- head/etc/rc.subrWed Apr  5 05:01:23 2017(r316515)
+++ head/etc/rc.subrWed Apr  5 05:23:09 2017(r316516)
@@ -929,6 +929,9 @@ run_rc_command()
eval ${rcvar}=YES
fi
fi
+   if ! checkyesno rc_force; then
+   rc_force=
+   fi
debug "_rc_prefix=${_rc_prefix}"
 
eval _override_command=\$${name}_program
___
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: r316515 - in head/sys: conf dev/hyperv/input

2017-04-04 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Apr  5 05:01:23 2017
New Revision: 316515
URL: https://svnweb.freebsd.org/changeset/base/316515

Log:
  hyperv/kbd: Add support for synthetic keyboard.
  
  Synthetic keyboard is the only supported keyboard on GEN2 Hyper-V.
  
  Submitted by: Hongjiang Zhang 
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D10196

Added:
  head/sys/dev/hyperv/input/
  head/sys/dev/hyperv/input/hv_kbd.c   (contents, props changed)
  head/sys/dev/hyperv/input/hv_kbdc.c   (contents, props changed)
  head/sys/dev/hyperv/input/hv_kbdc.h   (contents, props changed)
Modified:
  head/sys/conf/files.amd64

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Wed Apr  5 03:05:04 2017(r316514)
+++ head/sys/conf/files.amd64   Wed Apr  5 05:01:23 2017(r316515)
@@ -303,6 +303,8 @@ dev/hwpmc/hwpmc_uncore.coptionalhwpmc
 dev/hwpmc/hwpmc_piv.c  optionalhwpmc
 dev/hwpmc/hwpmc_tsc.c  optionalhwpmc
 dev/hwpmc/hwpmc_x86.c  optionalhwpmc
+dev/hyperv/input/hv_kbd.c  optionalhyperv
+dev/hyperv/input/hv_kbdc.c optionalhyperv
 dev/hyperv/pcib/vmbus_pcib.c   optionalhyperv 
pci
 dev/hyperv/netvsc/hn_nvs.c optionalhyperv
 dev/hyperv/netvsc/hn_rndis.c   optionalhyperv

Added: head/sys/dev/hyperv/input/hv_kbd.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/hyperv/input/hv_kbd.c  Wed Apr  5 05:01:23 2017
(r316515)
@@ -0,0 +1,564 @@
+/*-
+ * Copyright (c) 2017 Microsoft Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice unmodified, this list of conditions, and the following
+ *disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "dev/hyperv/input/hv_kbdc.h"
+
+#define HVKBD_MTX_LOCK(_m) do {\
+   mtx_lock(_m);   \
+} while (0)
+
+#define HVKBD_MTX_UNLOCK(_m) do {  \
+   mtx_unlock(_m); \
+} while (0)
+
+#define HVKBD_MTX_ASSERT(_m, _t) do {  \
+   mtx_assert(_m, _t); \
+} while (0)
+
+#defineHVKBD_LOCK()HVKBD_MTX_LOCK()
+#defineHVKBD_UNLOCK()  HVKBD_MTX_UNLOCK()
+#defineHVKBD_LOCK_ASSERT() HVKBD_MTX_ASSERT(, MA_OWNED)
+
+#define HVKBD_FLAG_POLLING 0x0002
+
+/* early keyboard probe, not supported */
+static int
+hvkbd_configure(int flags)
+{
+   return (0);
+}
+
+/* detect a keyboard, not used */
+static int
+hvkbd_probe(int unit, void *arg, int flags)
+{
+   return (ENXIO);
+}
+
+/* reset and initialize the device, not used */
+static int
+hvkbd_init(int unit, keyboard_t **kbdp, void *arg, int flags)
+{
+   DEBUG_HVKBD(*kbdp, "%s\n", __func__);
+   return (ENXIO);
+}
+
+/* test the interface to the device, not used */
+static int
+hvkbd_test_if(keyboard_t *kbd)
+{
+   DEBUG_HVKBD(kbd, "%s\n", __func__);
+   return (0);
+}
+
+/* finish using this keyboard, not used */
+static int
+hvkbd_term(keyboard_t *kbd)
+{
+   DEBUG_HVKBD(kbd, "%s\n", __func__);
+   return (ENXIO);
+}
+
+/* keyboard interrupt routine, not used */
+static int
+hvkbd_intr(keyboard_t *kbd, void 

Re: svn commit: r316487 - head/etc

2017-04-04 Thread Cy Schubert
In message <58cc0b95-0423-429e-ba73-0f0bd3a2a...@gmail.com>, Ngie Cooper 
writes
:
> 
> 
> > On Apr 4, 2017, at 20:05, Cy Schubert  wrote:
> > 
> > In message <201704041143.v34bhvna046...@repo.freebsd.org>, 
> > =?UTF-8?Q?Dag-Erling
> > _Sm=c3=b8rgrav?= writes:
> >> Author: des
> >> Date: Tue Apr  4 11:43:31 2017
> >> New Revision: 316487
> >> URL: https://svnweb.freebsd.org/changeset/base/316487
> >> 
> >> Log:
> >>  Allow command modifiers (fast, quiet etc.) to be stacked in any order.
> >>  Add a "debug" modifier that sets rc_debug.
> >> 
> >>  MFC after:3 weeks
> >> 
> >> Modified:
> >>  head/etc/rc.subr
> >> 
> >> Modified: head/etc/rc.subr
> >> ==
> ===
> >> =
> >> --- head/etc/rc.subrTue Apr  4 08:17:03 2017(r316486)
> >> +++ head/etc/rc.subrTue Apr  4 11:43:31 2017(r316487)
> >> @@ -703,10 +703,11 @@ check_startmsgs()
> >> #If argument has a given prefix, then change the operation as follows:
> >> #PrefixOperation
> >> #---
> >> -#fastSkip the pid check, and set rc_fast=yes, rc_quiet=yes
> >> -#forceSet ${rcvar} to YES, and set rc_force=yes
> >> -#oneSet ${rcvar} to YES
> >> -#quietDon't output some diagnostics, and set rc_quiet=yes
> >> +#debugEnable debugging messages and set rc_debug to yes
> >> +#fastSkip the pid check and set rc_fast and rc_quiet to yes
> >> +#forceSkip sanity checks and set ${rcvar} and rc_force to yes
> >> +#oneSet ${rcvar} and set rc_one to yes
> >> +#quietDon't output some diagnostics, and set rc_quiet to yes
> >> #
> >> #The following globals are used:
> >> #
> >> @@ -856,6 +857,8 @@ check_startmsgs()
> >> #rc_argArgument to command, after fast/force/one processing
> >> #performed
> >> #
> >> +#rc_debugTrue if "debug" was provided
> >> +#
> >> #rc_flagsFlags to start the default command with.
> >> #Defaults to ${name}_flags, unless overridden
> >> #by $flags from the environment.
> >> @@ -863,9 +866,11 @@ check_startmsgs()
> >> #
> >> #rc_pidPID of command (if appropriate)
> >> #
> >> -#rc_fastNot empty if "fast" was provided (q.v.)
> >> +#rc_fastNot empty if "fast" was provided
> >> +#
> >> +#rc_forceNot empty if "force" was provided
> >> #
> >> -#rc_forceNot empty if "force" was provided (q.v.)
> >> +#rc_oneNot empty if "one" was provided
> >> #
> >> #rc_quietNot empty if "quiet" was provided
> >> #
> >> @@ -884,34 +889,47 @@ run_rc_command()
> >>shift 1
> >>rc_extra_args="$*"
> >> 
> >> -_rc_prefix=
> >> -case "$rc_arg" in
> >> -fast*)# "fast" prefix; don't check pid
> >> -rc_arg=${rc_arg#fast}
> >> -rc_fast=yes
> >> -rc_quiet=yes
> >> -;;
> >> -force*)# "force" prefix; always run
> >> -rc_force=yes
> >> -_rc_prefix=force
> >> -rc_arg=${rc_arg#${_rc_prefix}}
> >> -if [ -n "${rcvar}" ]; then
> >> -eval ${rcvar}=YES
> >> -fi
> >> -;;
> >> -one*)# "one" prefix; set ${rcvar}=yes
> >> -_rc_prefix=one
> >> -rc_arg=${rc_arg#${_rc_prefix}}
> >> +: ${rc_debug:=no} ${rc_fast:=no} ${rc_force:=no} ${rc_one:=no} ${rc_q
> ui
> >> et:=no}
> >> +while :; do
> >> +case "$rc_arg" in
> >> +debug*)# "debug" prefix; enable debugging
> >> +rc_debug=yes
> >> +rc_quiet=no
> >> +rc_arg=${rc_arg#debug}
> >> +_rc_prefix="${_rc_prefix}debug"
> >> +;;
> >> +fast*)# "fast" prefix; don't check pid
> >> +rc_fast=yes
> >> +rc_quiet=yes
> >> +rc_arg=${rc_arg#fast}
> >> +_rc_prefix="${_rc_prefix}fast"
> >> +;;
> >> +force*)# "force" prefix; always run
> >> +rc_force=yes
> >> +rc_arg=${rc_arg#force}
> >> +_rc_prefix="${_rc_prefix}force"
> >> +;;
> >> +one*)# "one" prefix; set ${rcvar}=yes
> >> +rc_one=yes
> >> +rc_arg=${rc_arg#one}
> >> +_rc_prefix="${_rc_prefix}one"
> >> +;;
> >> +quiet*)# "quiet" prefix; omit some messages
> >> +rc_quiet=yes
> >> +rc_arg=${rc_arg#quiet}
> >> +_rc_prefix="${_rc_prefix}quiet"
> >> +;;
> >> +*)
> >> +break
> >> +;;
> >> +esac
> >> +done
> >> +if checkyesno rc_force || checkyesno rc_one ; then
> >>if [ -n "${rcvar}" ]; then
> >>eval ${rcvar}=YES
> >>fi
> >> -;;
> >> -quiet*)# "quiet" prefix; omit some messages
> >> -   

Re: svn commit: r316487 - head/etc

2017-04-04 Thread Ngie Cooper

> On Apr 4, 2017, at 20:05, Cy Schubert  wrote:
> 
> In message <201704041143.v34bhvna046...@repo.freebsd.org>, 
> =?UTF-8?Q?Dag-Erling
> _Sm=c3=b8rgrav?= writes:
>> Author: des
>> Date: Tue Apr  4 11:43:31 2017
>> New Revision: 316487
>> URL: https://svnweb.freebsd.org/changeset/base/316487
>> 
>> Log:
>>  Allow command modifiers (fast, quiet etc.) to be stacked in any order.
>>  Add a "debug" modifier that sets rc_debug.
>> 
>>  MFC after:3 weeks
>> 
>> Modified:
>>  head/etc/rc.subr
>> 
>> Modified: head/etc/rc.subr
>> =
>> =
>> --- head/etc/rc.subrTue Apr  4 08:17:03 2017(r316486)
>> +++ head/etc/rc.subrTue Apr  4 11:43:31 2017(r316487)
>> @@ -703,10 +703,11 @@ check_startmsgs()
>> #If argument has a given prefix, then change the operation as follows:
>> #PrefixOperation
>> #---
>> -#fastSkip the pid check, and set rc_fast=yes, rc_quiet=yes
>> -#forceSet ${rcvar} to YES, and set rc_force=yes
>> -#oneSet ${rcvar} to YES
>> -#quietDon't output some diagnostics, and set rc_quiet=yes
>> +#debugEnable debugging messages and set rc_debug to yes
>> +#fastSkip the pid check and set rc_fast and rc_quiet to yes
>> +#forceSkip sanity checks and set ${rcvar} and rc_force to yes
>> +#oneSet ${rcvar} and set rc_one to yes
>> +#quietDon't output some diagnostics, and set rc_quiet to yes
>> #
>> #The following globals are used:
>> #
>> @@ -856,6 +857,8 @@ check_startmsgs()
>> #rc_argArgument to command, after fast/force/one processing
>> #performed
>> #
>> +#rc_debugTrue if "debug" was provided
>> +#
>> #rc_flagsFlags to start the default command with.
>> #Defaults to ${name}_flags, unless overridden
>> #by $flags from the environment.
>> @@ -863,9 +866,11 @@ check_startmsgs()
>> #
>> #rc_pidPID of command (if appropriate)
>> #
>> -#rc_fastNot empty if "fast" was provided (q.v.)
>> +#rc_fastNot empty if "fast" was provided
>> +#
>> +#rc_forceNot empty if "force" was provided
>> #
>> -#rc_forceNot empty if "force" was provided (q.v.)
>> +#rc_oneNot empty if "one" was provided
>> #
>> #rc_quietNot empty if "quiet" was provided
>> #
>> @@ -884,34 +889,47 @@ run_rc_command()
>>shift 1
>>rc_extra_args="$*"
>> 
>> -_rc_prefix=
>> -case "$rc_arg" in
>> -fast*)# "fast" prefix; don't check pid
>> -rc_arg=${rc_arg#fast}
>> -rc_fast=yes
>> -rc_quiet=yes
>> -;;
>> -force*)# "force" prefix; always run
>> -rc_force=yes
>> -_rc_prefix=force
>> -rc_arg=${rc_arg#${_rc_prefix}}
>> -if [ -n "${rcvar}" ]; then
>> -eval ${rcvar}=YES
>> -fi
>> -;;
>> -one*)# "one" prefix; set ${rcvar}=yes
>> -_rc_prefix=one
>> -rc_arg=${rc_arg#${_rc_prefix}}
>> +: ${rc_debug:=no} ${rc_fast:=no} ${rc_force:=no} ${rc_one:=no} ${rc_qui
>> et:=no}
>> +while :; do
>> +case "$rc_arg" in
>> +debug*)# "debug" prefix; enable debugging
>> +rc_debug=yes
>> +rc_quiet=no
>> +rc_arg=${rc_arg#debug}
>> +_rc_prefix="${_rc_prefix}debug"
>> +;;
>> +fast*)# "fast" prefix; don't check pid
>> +rc_fast=yes
>> +rc_quiet=yes
>> +rc_arg=${rc_arg#fast}
>> +_rc_prefix="${_rc_prefix}fast"
>> +;;
>> +force*)# "force" prefix; always run
>> +rc_force=yes
>> +rc_arg=${rc_arg#force}
>> +_rc_prefix="${_rc_prefix}force"
>> +;;
>> +one*)# "one" prefix; set ${rcvar}=yes
>> +rc_one=yes
>> +rc_arg=${rc_arg#one}
>> +_rc_prefix="${_rc_prefix}one"
>> +;;
>> +quiet*)# "quiet" prefix; omit some messages
>> +rc_quiet=yes
>> +rc_arg=${rc_arg#quiet}
>> +_rc_prefix="${_rc_prefix}quiet"
>> +;;
>> +*)
>> +break
>> +;;
>> +esac
>> +done
>> +if checkyesno rc_force || checkyesno rc_one ; then
>>if [ -n "${rcvar}" ]; then
>>eval ${rcvar}=YES
>>fi
>> -;;
>> -quiet*)# "quiet" prefix; omit some messages
>> -_rc_prefix=quiet
>> -rc_arg=${rc_arg#${_rc_prefix}}
>> -rc_quiet=yes
>> -;;
>> -esac
>> +fi
>> +debug "_rc_prefix=${_rc_prefix}"
>> 
>>eval _override_command=\$${name}_program
>>command=${_override_command:-$command}
>> 
>> 
> 
> 
> Hi des,
> 
> This patch caused some boot failures because the 

Re: svn commit: r316487 - head/etc

2017-04-04 Thread Cy Schubert
In message <201704041143.v34bhvna046...@repo.freebsd.org>, 
=?UTF-8?Q?Dag-Erling
_Sm=c3=b8rgrav?= writes:
> Author: des
> Date: Tue Apr  4 11:43:31 2017
> New Revision: 316487
> URL: https://svnweb.freebsd.org/changeset/base/316487
> 
> Log:
>   Allow command modifiers (fast, quiet etc.) to be stacked in any order.
>   Add a "debug" modifier that sets rc_debug.
>   
>   MFC after:  3 weeks
> 
> Modified:
>   head/etc/rc.subr
> 
> Modified: head/etc/rc.subr
> =
> =
> --- head/etc/rc.subr  Tue Apr  4 08:17:03 2017(r316486)
> +++ head/etc/rc.subr  Tue Apr  4 11:43:31 2017(r316487)
> @@ -703,10 +703,11 @@ check_startmsgs()
>  #If argument has a given prefix, then change the operation as follows:
>  #Prefix  Operation
>  #--  -
> -#fastSkip the pid check, and set rc_fast=yes, rc_quiet=yes
> -#force   Set ${rcvar} to YES, and set rc_force=yes
> -#one Set ${rcvar} to YES
> -#quiet   Don't output some diagnostics, and set rc_quiet=yes
> +#debug   Enable debugging messages and set rc_debug to yes
> +#fastSkip the pid check and set rc_fast and rc_quiet to yes
> +#force   Skip sanity checks and set ${rcvar} and rc_force to yes
> +#one Set ${rcvar} and set rc_one to yes
> +#quiet   Don't output some diagnostics, and set rc_quiet to yes
>  #
>  #The following globals are used:
>  #
> @@ -856,6 +857,8 @@ check_startmsgs()
>  #rc_arg  Argument to command, after fast/force/one processing
>  #performed
>  #
> +#rc_debugTrue if "debug" was provided
> +#
>  #rc_flagsFlags to start the default command with.
>  #Defaults to ${name}_flags, unless overridden
>  #by $flags from the environment.
> @@ -863,9 +866,11 @@ check_startmsgs()
>  #
>  #rc_pid  PID of command (if appropriate)
>  #
> -#rc_fast Not empty if "fast" was provided (q.v.)
> +#rc_fast Not empty if "fast" was provided
> +#
> +#rc_forceNot empty if "force" was provided
>  #
> -#rc_forceNot empty if "force" was provided (q.v.)
> +#rc_one  Not empty if "one" was provided
>  #
>  #rc_quietNot empty if "quiet" was provided
>  #
> @@ -884,34 +889,47 @@ run_rc_command()
>   shift 1
>   rc_extra_args="$*"
>  
> - _rc_prefix=
> - case "$rc_arg" in
> - fast*)  # "fast" prefix; don't check pid
> - rc_arg=${rc_arg#fast}
> - rc_fast=yes
> - rc_quiet=yes
> - ;;
> - force*) # "force" prefix; always run
> - rc_force=yes
> - _rc_prefix=force
> - rc_arg=${rc_arg#${_rc_prefix}}
> - if [ -n "${rcvar}" ]; then
> - eval ${rcvar}=YES
> - fi
> - ;;
> - one*)   # "one" prefix; set ${rcvar}=yes
> - _rc_prefix=one
> - rc_arg=${rc_arg#${_rc_prefix}}
> + : ${rc_debug:=no} ${rc_fast:=no} ${rc_force:=no} ${rc_one:=no} ${rc_qui
> et:=no}
> + while :; do
> + case "$rc_arg" in
> + debug*) # "debug" prefix; enable debugging
> + rc_debug=yes
> + rc_quiet=no
> + rc_arg=${rc_arg#debug}
> + _rc_prefix="${_rc_prefix}debug"
> + ;;
> + fast*)  # "fast" prefix; don't check pid
> + rc_fast=yes
> + rc_quiet=yes
> + rc_arg=${rc_arg#fast}
> + _rc_prefix="${_rc_prefix}fast"
> + ;;
> + force*) # "force" prefix; always run
> + rc_force=yes
> + rc_arg=${rc_arg#force}
> + _rc_prefix="${_rc_prefix}force"
> + ;;
> + one*)   # "one" prefix; set ${rcvar}=yes
> + rc_one=yes
> + rc_arg=${rc_arg#one}
> + _rc_prefix="${_rc_prefix}one"
> + ;;
> + quiet*) # "quiet" prefix; omit some messages
> + rc_quiet=yes
> + rc_arg=${rc_arg#quiet}
> + _rc_prefix="${_rc_prefix}quiet"
> + ;;
> + *)
> + break
> + ;;
> + esac
> + done
> + if checkyesno rc_force || checkyesno rc_one ; then
>   if [ -n "${rcvar}" ]; then
>   eval ${rcvar}=YES
>   fi
> - ;;
> - quiet*) # "quiet" prefix; omit some messages
> - 

svn commit: r316514 - head/sys/conf

2017-04-04 Thread John Baldwin
Author: jhb
Date: Wed Apr  5 03:05:04 2017
New Revision: 316514
URL: https://svnweb.freebsd.org/changeset/base/316514

Log:
  Always pass the linker emulation via -m when linking modules and kernels.
  
  Previously the linker emulation was only passed when building binary
  objects for firmware modules.  This change always passes the desired
  output format for kernel modules and kernels rather than requiring the
  toolchain's default output format to match the desired output format.
  This in turn permits use of external toolchains whose default output
  format does not match the desired output format.
  
  Reviewed by:  imp, emaste
  Sponsored by: DARPA / AFRL
  Differential Revision:https://reviews.freebsd.org/D10085

Modified:
  head/sys/conf/Makefile.arm
  head/sys/conf/kern.mk
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/sys/conf/Makefile.arm
==
--- head/sys/conf/Makefile.arm  Wed Apr  5 03:00:52 2017(r316513)
+++ head/sys/conf/Makefile.arm  Wed Apr  5 03:05:04 2017(r316514)
@@ -56,8 +56,8 @@ CFLAGS += -mllvm -arm-enable-ehabi
 # hack because genassym.c includes sys/bus.h which includes these.
 genassym.o: bus_if.h device_if.h
 
-SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${_LDFLAGS} \
-   --no-warn-mismatch --warn-common --export-dynamic \
+SYSTEM_LD_ = ${LD} -m ${LD_EMULATION} -Bdynamic -T ldscript.$M.noheader \
+   ${_LDFLAGS} --no-warn-mismatch --warn-common --export-dynamic \
--dynamic-linker /red/herring \
-o ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o
 SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M\

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Wed Apr  5 03:00:52 2017(r316513)
+++ head/sys/conf/kern.mk   Wed Apr  5 03:05:04 2017(r316514)
@@ -254,8 +254,7 @@ CFLAGS+=-std=iso9899:1999
 CFLAGS+=-std=${CSTD}
 .endif # CSTD
 
-# Set target-specific linker emulation name. Used by ld -b binary to convert
-# binary files into ELF objects.
+# Set target-specific linker emulation name.
 LD_EMULATION_aarch64=aarch64elf
 LD_EMULATION_amd64=elf_x86_64_fbsd
 LD_EMULATION_arm=armelf_fbsd

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Wed Apr  5 03:00:52 2017(r316513)
+++ head/sys/conf/kern.pre.mk   Wed Apr  5 03:05:04 2017(r316514)
@@ -184,8 +184,9 @@ MD_ROOT_SIZE_CONFIGURED!=   grep MD_ROOT_S
 SYSTEM_OBJS+= embedfs_${MFS_IMAGE:T:R}.o
 .endif
 .endif
-SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} --no-warn-mismatch \
-   --warn-common --export-dynamic --dynamic-linker /red/herring \
+SYSTEM_LD= @${LD} -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \
+   --no-warn-mismatch --warn-common --export-dynamic \
+   --dynamic-linker /red/herring \
-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
 SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \
${SIZE} ${.TARGET} ; chmod 755 ${.TARGET}

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Wed Apr  5 03:00:52 2017(r316513)
+++ head/sys/conf/kmod.mk   Wed Apr  5 03:05:04 2017(r316514)
@@ -210,7 +210,8 @@ ${PROG}.debug: ${FULLPROG}
 .if ${__KLD_SHARED} == yes
 ${FULLPROG}: ${KMOD}.kld
 .if ${MACHINE_CPUARCH} != "aarch64"
-   ${LD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${KMOD}.kld
+   ${LD} -m ${LD_EMULATION} -Bshareable ${_LDFLAGS} -o ${.TARGET} \
+   ${KMOD}.kld
 .else
 #XXXKIB Relocatable linking in aarch64 ld from binutils 2.25.1 does
 #   not work.  The linker corrupts the references to the external
@@ -218,7 +219,7 @@ ${FULLPROG}: ${KMOD}.kld
 #   and should therefore loose the GOT entry.  The problem seems
 #   to be fixed in the binutils-gdb git HEAD as of 2015-10-04.  Hack
 #   below allows to get partially functioning modules for now.
-   ${LD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${OBJS}
+   ${LD} -m ${LD_EMULATION} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${OBJS}
 .endif
 .if !defined(DEBUG_FLAGS)
${OBJCOPY} --strip-debug ${.TARGET}
@@ -235,7 +236,7 @@ ${KMOD}.kld: ${OBJS}
 .else
 ${FULLPROG}: ${OBJS}
 .endif
-   ${LD} ${_LDFLAGS} -r -d -o ${.TARGET} ${OBJS}
+   ${LD} -m ${LD_EMULATION} ${_LDFLAGS} -r -d -o ${.TARGET} ${OBJS}
 .if ${MK_CTF} != "no"
${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316513 - head/sys/conf

2017-04-04 Thread John Baldwin
Author: jhb
Date: Wed Apr  5 03:00:52 2017
New Revision: 316513
URL: https://svnweb.freebsd.org/changeset/base/316513

Log:
  Sync SYSTEM_LD in Makefile.arm with kern.pre.mk.
  
  - Add --no-warn-mismatch.
  - Use same whitespace to make future updates simpler.
  
  Reviewed by:  imp (part of a larger change)
  Sponsored by: DARPA / AFRL
  Differential Revision:https://reviews.freebsd.org/D10085

Modified:
  head/sys/conf/Makefile.arm

Modified: head/sys/conf/Makefile.arm
==
--- head/sys/conf/Makefile.arm  Wed Apr  5 02:52:49 2017(r316512)
+++ head/sys/conf/Makefile.arm  Wed Apr  5 03:00:52 2017(r316513)
@@ -57,8 +57,9 @@ CFLAGS += -mllvm -arm-enable-ehabi
 genassym.o: bus_if.h device_if.h
 
 SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${_LDFLAGS} \
- -warn-common -export-dynamic -dynamic-linker /red/herring -o \
-  ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o
+   --no-warn-mismatch --warn-common --export-dynamic \
+   --dynamic-linker /red/herring \
+   -o ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o
 SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M\
>ldscript.$M.noheader; \
${SYSTEM_LD_}; \
___
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: r316512 - head/sys/conf

2017-04-04 Thread John Baldwin
Author: jhb
Date: Wed Apr  5 02:52:49 2017
New Revision: 316512
URL: https://svnweb.freebsd.org/changeset/base/316512

Log:
  Use correct linker emulation name for armeb.
  
  MFC after:1 week
  Sponsored by: DARPA / AFRL
  Differential Revision:https://reviews.freebsd.org/D10085

Modified:
  head/sys/conf/kern.mk

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Wed Apr  5 02:40:53 2017(r316511)
+++ head/sys/conf/kern.mk   Wed Apr  5 02:52:49 2017(r316512)
@@ -259,7 +259,7 @@ CFLAGS+=-std=${CSTD}
 LD_EMULATION_aarch64=aarch64elf
 LD_EMULATION_amd64=elf_x86_64_fbsd
 LD_EMULATION_arm=armelf_fbsd
-LD_EMULATION_armeb=armelf_fbsd
+LD_EMULATION_armeb=armelfb_fbsd
 LD_EMULATION_armv6=armelf_fbsd
 LD_EMULATION_i386=elf_i386_fbsd
 LD_EMULATION_mips= elf32btsmip_fbsd
___
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: r316511 - in head: contrib/compiler-rt/lib/builtins lib/libcompiler_rt

2017-04-04 Thread John Baldwin
Author: jhb
Date: Wed Apr  5 02:40:53 2017
New Revision: 316511
URL: https://svnweb.freebsd.org/changeset/base/316511

Log:
  Add an implementation of __ffssi2() derived from __ffsdi2().
  
  Newer versions of GCC include an __ffssi2() symbol in libgcc and the
  compiler can emit calls to it in generated code.  This is true for at
  least GCC 6.2 when compiling world for mips and mips64.
  
  Reviewed by:  jmallett, dim
  Sponsored by: DARPA / AFRL
  Differential Revision:https://reviews.freebsd.org/D10086

Added:
  head/contrib/compiler-rt/lib/builtins/ffssi2.c   (contents, props changed)
Modified:
  head/contrib/compiler-rt/lib/builtins/README.txt
  head/lib/libcompiler_rt/Makefile.inc

Modified: head/contrib/compiler-rt/lib/builtins/README.txt
==
--- head/contrib/compiler-rt/lib/builtins/README.txtWed Apr  5 01:46:41 
2017(r316510)
+++ head/contrib/compiler-rt/lib/builtins/README.txtWed Apr  5 02:40:53 
2017(r316511)
@@ -45,6 +45,7 @@ si_int __ctzsi2(si_int a);  // count tra
 si_int __ctzdi2(di_int a);  // count trailing zeros
 si_int __ctzti2(ti_int a);  // count trailing zeros
 
+si_int __ffssi2(si_int a);  // find least significant 1 bit
 si_int __ffsdi2(di_int a);  // find least significant 1 bit
 si_int __ffsti2(ti_int a);  // find least significant 1 bit
 

Added: head/contrib/compiler-rt/lib/builtins/ffssi2.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/compiler-rt/lib/builtins/ffssi2.c  Wed Apr  5 02:40:53 
2017(r316511)
@@ -0,0 +1,29 @@
+/* ===-- ffssi2.c - Implement __ffssi2 -===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===--===
+ *
+ * This file implements __ffssi2 for the compiler_rt library.
+ *
+ * ===--===
+ */
+
+#include "int_lib.h"
+
+/* Returns: the index of the least significant 1-bit in a, or
+ * the value zero if a is zero. The least significant bit is index one.
+ */
+
+COMPILER_RT_ABI si_int
+__ffssi2(si_int a)
+{
+if (a == 0)
+{
+return 0;
+}
+return __builtin_ctz(a) + 1;
+}

Modified: head/lib/libcompiler_rt/Makefile.inc
==
--- head/lib/libcompiler_rt/Makefile.incWed Apr  5 01:46:41 2017
(r316510)
+++ head/lib/libcompiler_rt/Makefile.incWed Apr  5 02:40:53 2017
(r316511)
@@ -38,6 +38,7 @@ SRCF+=divxc3
 SRCF+= enable_execute_stack
 SRCF+= eprintf
 SRCF+= extendhfsf2
+SRCF+= ffssi2
 SRCF+= ffsdi2
 SRCF+= ffsti2
 SRCF+= fixdfdi
___
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: r316492 - in head/usr.bin/grep: . regex

2017-04-04 Thread Ngie Cooper (yaneurabeya)

> On Apr 4, 2017, at 19:21, Pedro Giffuni  wrote:
> 
>> On Apr 4, 2017, at 14:48, Kyle Evans  wrote:
>> 
>> On Tue, Apr 4, 2017 at 2:45 PM, Ngie Cooper (yaneurabeya) 
>>  wrote:
>> 
>> > On Apr 4, 2017, at 12:04, Conrad Meyer  wrote:
>> >
>> > On Tue, Apr 4, 2017 at 11:56 AM, Dimitry Andric  wrote:
>> >> On 4 Apr 2017, at 19:14, Ngie Cooper (yaneurabeya) 
>> >>  wrote:
>> >>> Where did xmalloc.c originate from?
>> >>
>> >> GNU.
>> >
>> > I believe this to be completely incorrect.
>> >
>> >> Almost all software from the GNU project relies on malloc wrappers
>> >> which abort the program on allocation failures.
>> >
>> > That is not what bsdgrep's xmalloc() did, if you read the code. It
>> > simply tracks all allocations for basic leak analysis.
>> >
>> > Abort on allocation failure would be a perfectly reasonable behavior
>> > for bsdgrep(1), too.
>> 
>> There are multiple, competing definitions floating around the internet. I 
>> was genuinely curious where this variant came from because I wanted to make 
>> sure we weren’t just zapping a file that some upstream uses somewhere, in 
>> the event we were going to bring down further updates, again, from said 
>> upstream source.
>> 
>> FWIW- I did scour the internet for other bsdgrep implementations and did not 
>> find a trace of this in any of the others that I found, to include the OS X 
>> implementation. In fact, as I recall, most of them didn't even have the 
>> regex/ bits that we do, presumably they were using regex(3) but it's been a 
>> while since I was poking around.
> 
> Well, for the history of bsdgrep, you have to go back to freegrep:
> 
> https://jameshoward.us/software/freegrep/
> 
> but the most significant changes are likely to be due to Gabor:
> 
> https://wiki.freebsd.org/BSDgrep

So…. Gabor added xmalloc then ;p…
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r316492 - in head/usr.bin/grep: . regex

2017-04-04 Thread Pedro Giffuni

> On Apr 4, 2017, at 14:48, Kyle Evans  wrote:
> 
> On Tue, Apr 4, 2017 at 2:45 PM, Ngie Cooper (yaneurabeya) 
> > wrote:
> 
> > On Apr 4, 2017, at 12:04, Conrad Meyer  > > wrote:
> >
> > On Tue, Apr 4, 2017 at 11:56 AM, Dimitry Andric  > > wrote:
> >> On 4 Apr 2017, at 19:14, Ngie Cooper (yaneurabeya)  >> > wrote:
> >>> Where did xmalloc.c originate from?
> >>
> >> GNU.
> >
> > I believe this to be completely incorrect.
> >
> >> Almost all software from the GNU project relies on malloc wrappers
> >> which abort the program on allocation failures.
> >
> > That is not what bsdgrep's xmalloc() did, if you read the code. It
> > simply tracks all allocations for basic leak analysis.
> >
> > Abort on allocation failure would be a perfectly reasonable behavior
> > for bsdgrep(1), too.
> 
> There are multiple, competing definitions floating around the internet. I was 
> genuinely curious where this variant came from because I wanted to make sure 
> we weren’t just zapping a file that some upstream uses somewhere, in the 
> event we were going to bring down further updates, again, from said upstream 
> source.
> 
> FWIW- I did scour the internet for other bsdgrep implementations and did not 
> find a trace of this in any of the others that I found, to include the OS X 
> implementation. In fact, as I recall, most of them didn't even have the 
> regex/ bits that we do, presumably they were using regex(3) but it's been a 
> while since I was poking around.

Well, for the history of bsdgrep, you have to go back to freegrep:

https://jameshoward.us/software/freegrep/ 


but the most significant changes are likely to be due to Gabor:

https://wiki.freebsd.org/BSDgrep 

Pedro.

___
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: r316495 - head/usr.bin/grep/regex

2017-04-04 Thread Kyle Evans
On Tue, Apr 4, 2017 at 12:05 PM, Conrad Meyer  wrote:

> Author: cem
> Date: Tue Apr  4 17:05:37 2017
> New Revision: 316495
> URL: https://svnweb.freebsd.org/changeset/base/316495
>
> Log:
>   bsdgrep(1): Fix errors with invalid expressions
>
>   Invalid expressions with an ultimate compiled pattern length of 0 (e.g.,
>   "grep -E {") were not taken into account and caused a segfault while
> trying
>   to fill in the good suffix table.
>
>   Submitted by: Kyle Evans 
>   Reviewed by:  me
>   Differential Revision:https://reviews.freebsd.org/D10113


Hi =) FYI-

PR: 194823

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194823
___
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: r316510 - head/sys/opencrypto

2017-04-04 Thread John Baldwin
Author: jhb
Date: Wed Apr  5 01:46:41 2017
New Revision: 316510
URL: https://svnweb.freebsd.org/changeset/base/316510

Log:
  Don't leak a session and lock if a GMAC key has an invalid length.
  
  Reviewed by:  delphij (secteam)
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D10273

Modified:
  head/sys/opencrypto/cryptosoft.c

Modified: head/sys/opencrypto/cryptosoft.c
==
--- head/sys/opencrypto/cryptosoft.cWed Apr  5 01:44:03 2017
(r316509)
+++ head/sys/opencrypto/cryptosoft.cWed Apr  5 01:46:41 2017
(r316510)
@@ -930,8 +930,11 @@ swcr_newsession(device_t dev, u_int32_t 
axf = _hash_nist_gmac_aes_256;
auth4common:
len = cri->cri_klen / 8;
-   if (len != 16 && len != 24 && len != 32)
+   if (len != 16 && len != 24 && len != 32) {
+   swcr_freesession_locked(dev, i);
+   rw_runlock(_sessions_lock);
return EINVAL;
+   }
 
(*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA,
M_NOWAIT);
___
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: r316509 - in head/sys/ufs: ffs ufs

2017-04-04 Thread Ngie Cooper (yaneurabeya)

> On Apr 4, 2017, at 18:44, Conrad Meyer  wrote:
> 
> Author: cem
> Date: Wed Apr  5 01:44:03 2017
> New Revision: 316509
> URL: https://svnweb.freebsd.org/changeset/base/316509
> 
> Log:
>  ufs: Export UFS_MAXNAMLEN to pathconf, statfs
> 
>  Rather than the global NAME_MAX constant.  This change is required to
>  support systems with a NAME_MAX/MAXNAMLEN that differs from UFS_MAXNAMLEN.
> 
>  This was missed in r313475 due to the alternative spelling ("NAME_MAX") of
>  MAXNAMLEN.  This change is also similar in spirit to r313780.
> 
>  Reported by: ngie@
>  Sponsored by:Dell EMC Isilon

Thank you Conrad :)!!!
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r316509 - in head/sys/ufs: ffs ufs

2017-04-04 Thread Conrad Meyer
Author: cem
Date: Wed Apr  5 01:44:03 2017
New Revision: 316509
URL: https://svnweb.freebsd.org/changeset/base/316509

Log:
  ufs: Export UFS_MAXNAMLEN to pathconf, statfs
  
  Rather than the global NAME_MAX constant.  This change is required to
  support systems with a NAME_MAX/MAXNAMLEN that differs from UFS_MAXNAMLEN.
  
  This was missed in r313475 due to the alternative spelling ("NAME_MAX") of
  MAXNAMLEN.  This change is also similar in spirit to r313780.
  
  Reported by:  ngie@
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/ufs/ffs/ffs_vfsops.c
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==
--- head/sys/ufs/ffs/ffs_vfsops.c   Tue Apr  4 23:30:05 2017
(r316508)
+++ head/sys/ufs/ffs/ffs_vfsops.c   Wed Apr  5 01:44:03 2017
(r316509)
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -1434,7 +1435,7 @@ ffs_statfs(mp, sbp)
sbp->f_files =  fs->fs_ncg * fs->fs_ipg - UFS_ROOTINO;
sbp->f_ffree = fs->fs_cstotal.cs_nifree + fs->fs_pendinginodes;
UFS_UNLOCK(ump);
-   sbp->f_namemax = NAME_MAX;
+   sbp->f_namemax = UFS_MAXNAMLEN;
return (0);
 }
 

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cTue Apr  4 23:30:05 2017
(r316508)
+++ head/sys/ufs/ufs/ufs_vnops.cWed Apr  5 01:44:03 2017
(r316509)
@@ -2446,7 +2446,7 @@ ufs_pathconf(ap)
*ap->a_retval = LINK_MAX;
break;
case _PC_NAME_MAX:
-   *ap->a_retval = NAME_MAX;
+   *ap->a_retval = UFS_MAXNAMLEN;
break;
case _PC_PATH_MAX:
*ap->a_retval = PATH_MAX;
___
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: r316477 - head/usr.bin/grep

2017-04-04 Thread Ngie Cooper (yaneurabeya)

> On Apr 4, 2017, at 17:54, Kyle Evans  wrote:
> 
> On Tue, Apr 4, 2017 at 7:51 PM, Rodney W. Grimes 
>  wrote:
> Also it might be worth making NetBSD aware of the bad output, and fix
> it there, and the regression test, and everyone well be better off.

The color tests are new to FreeBSD/NetBSD. They don’t exist in NetBSD yet.

> FWIW- I've been in contact with ngie@ w.r.t regression testing and the color 
> tests, and it appears that he's willing to help with the upstream aspect.

*they/she ;).

Thank you!
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r316477 - head/usr.bin/grep

2017-04-04 Thread Kyle Evans
On Tue, Apr 4, 2017 at 7:51 PM, Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:
>
> Also it might be worth making NetBSD aware of the bad output, and fix
> it there, and the regression test, and everyone well be better off.
>

FWIW- I've been in contact with ngie@ w.r.t regression testing and the
color tests, and it appears that he's willing to help with the upstream
aspect.
___
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: r316477 - head/usr.bin/grep

2017-04-04 Thread Rodney W. Grimes
> On 04.04.2017 15:24, Kyle Evans wrote:
> > On Tue, Apr 4, 2017 at 7:07 AM, Andrey Chernov  > > wrote:
> > 
> > On 04.04.2017 2:16, Ed Maste wrote:
> > >   if (color)
> > > - fprintf(stdout, "\33[m\33[K");
> > > + fprintf(stdout, "\33[00m\33[K");
> > 
> > Please back that one out. We don't need to handle internally or print
> > remotely excessive 00.
> > At least according to
> > https://en.wikipedia.org/wiki/ANSI_escape_code
> > 
> > "With no parameters, CSI m is treated as CSI 0 m (reset / normal), which
> > is typical of most of the ANSI escape sequences."
> > 
> > 
> > Hi ache@,
> > 
> > This specific change was made in the name of explicitly matching colored
> > output of GNU grep for simplification of regression test purposes,
> > rather than for good form. Is it still unacceptable to do so?
> 
> IMHO everyday usage by everyone weights much more than occasional
> regression tests run which can be fixed instead of this place. F.e. we
> already do a lot of local fixes in the NetBSD regression tests instead
> of pretending to mimic NetBSD in 100% in the system itself.


Also it might be worth making NetBSD aware of the bad output, and fix
it there, and the regression test, and everyone well be better off.

-- 
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"


svn commit: r316508 - head/sbin/setkey

2017-04-04 Thread Andrey V. Elsukov
Author: ae
Date: Tue Apr  4 23:30:05 2017
New Revision: 316508
URL: https://svnweb.freebsd.org/changeset/base/316508

Log:
  Use unique SPI.
  
  MFC after:1 week

Modified:
  head/sbin/setkey/setkey.8

Modified: head/sbin/setkey/setkey.8
==
--- head/sbin/setkey/setkey.8   Tue Apr  4 23:28:22 2017(r316507)
+++ head/sbin/setkey/setkey.8   Tue Apr  4 23:30:05 2017(r316508)
@@ -696,7 +696,7 @@ spdadd 10.0.11.41/32[21] 10.0.11.33/32[a
 Use TCP MD5 between two numerically specified hosts:
 .Bd -literal -offset indent
 add 10.1.10.34 10.1.10.36 tcp 0x1000 -A tcp-md5 "TCP-MD5 BGP secret" ;
-add 10.1.10.36 10.1.10.34 tcp 0x1000 -A tcp-md5 "TCP-MD5 BGP secret" ;
+add 10.1.10.36 10.1.10.34 tcp 0x1001 -A tcp-md5 "TCP-MD5 BGP secret" ;
 .Ed
 .\"
 .Sh SEE ALSO
___
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: r316507 - head/sbin/setkey

2017-04-04 Thread Andrey V. Elsukov
Author: ae
Date: Tue Apr  4 23:28:22 2017
New Revision: 316507
URL: https://svnweb.freebsd.org/changeset/base/316507

Log:
  In the example section show that TCP-MD5 connection needs SA for both
  directions.
  
  Submitted by: Mike Tancsa 
  MFC after:1 week

Modified:
  head/sbin/setkey/setkey.8

Modified: head/sbin/setkey/setkey.8
==
--- head/sbin/setkey/setkey.8   Tue Apr  4 23:14:03 2017(r316506)
+++ head/sbin/setkey/setkey.8   Tue Apr  4 23:28:22 2017(r316507)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 7, 2017
+.Dd April 5, 2017
 .Dt SETKEY 8
 .Os
 .\"
@@ -696,6 +696,7 @@ spdadd 10.0.11.41/32[21] 10.0.11.33/32[a
 Use TCP MD5 between two numerically specified hosts:
 .Bd -literal -offset indent
 add 10.1.10.34 10.1.10.36 tcp 0x1000 -A tcp-md5 "TCP-MD5 BGP secret" ;
+add 10.1.10.36 10.1.10.34 tcp 0x1000 -A tcp-md5 "TCP-MD5 BGP secret" ;
 .Ed
 .\"
 .Sh SEE ALSO
___
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: r316506 - head/sys/dev/cxgbe

2017-04-04 Thread Navdeep Parhar
Author: np
Date: Tue Apr  4 23:14:03 2017
New Revision: 316506
URL: https://svnweb.freebsd.org/changeset/base/316506

Log:
  cxgbe(4): Program the global RSS key once instead of once per ifnet.
  
  MFC after:3 days
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cTue Apr  4 21:36:13 2017
(r316505)
+++ head/sys/dev/cxgbe/t4_main.cTue Apr  4 23:14:03 2017
(r316506)
@@ -4223,6 +4223,10 @@ int
 adapter_full_init(struct adapter *sc)
 {
int rc, i;
+#ifdef RSS
+   uint32_t raw_rss_key[RSS_KEYSIZE / sizeof(uint32_t)];
+   uint32_t rss_key[RSS_KEYSIZE / sizeof(uint32_t)];
+#endif
 
ASSERT_SYNCHRONIZED_OP(sc);
ADAPTER_LOCK_ASSERT_NOTOWNED(sc);
@@ -4248,6 +4252,14 @@ adapter_full_init(struct adapter *sc)
taskqueue_start_threads(>tq[i], 1, PI_NET, "%s tq%d",
device_get_nameunit(sc->dev), i);
}
+#ifdef RSS
+   MPASS(RSS_KEYSIZE == 40);
+   rss_getkey((void *)_rss_key[0]);
+   for (i = 0; i < nitems(rss_key); i++) {
+   rss_key[i] = htobe32(raw_rss_key[nitems(rss_key) - 1 - i]);
+   }
+   t4_write_rss_key(sc, _key[0], -1);
+#endif
 
if (!(sc->flags & IS_VF))
t4_intr_enable(sc);
@@ -4355,8 +4367,6 @@ vi_full_init(struct vi_info *vi)
int nbuckets = rss_getnumbuckets();
int hashconfig = rss_gethashconfig();
int extra;
-   uint32_t raw_rss_key[RSS_KEYSIZE / sizeof(uint32_t)];
-   uint32_t rss_key[RSS_KEYSIZE / sizeof(uint32_t)];
 #endif
 
ASSERT_SYNCHRONIZED_OP(sc);
@@ -4386,17 +4396,10 @@ vi_full_init(struct vi_info *vi)
vi->rss_size);
}
 #ifdef RSS
-   MPASS(RSS_KEYSIZE == 40);
if (vi->nrxq != nbuckets) {
if_printf(ifp, "nrxq (%d) != kernel RSS buckets (%d);"
"performance will be impacted.\n", vi->nrxq, nbuckets);
}
-
-   rss_getkey((void *)_rss_key[0]);
-   for (i = 0; i < nitems(rss_key); i++) {
-   rss_key[i] = htobe32(raw_rss_key[nitems(rss_key) - 1 - i]);
-   }
-   t4_write_rss_key(sc, _key[0], -1);
 #endif
rss = malloc(vi->rss_size * sizeof (*rss), M_CXGBE, M_ZERO | M_WAITOK);
for (i = 0; i < vi->rss_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: r316505 - head/usr.sbin/extattr/tests

2017-04-04 Thread Ngie Cooper
Author: ngie
Date: Tue Apr  4 21:36:13 2017
New Revision: 316505
URL: https://svnweb.freebsd.org/changeset/base/316505

Log:
  Don't assume NAME_MAX is 255
  
  Query the filesystem limit via getconf(3) instead
  
  MFC after:2 months
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.sbin/extattr/tests/extattr_test.sh

Modified: head/usr.sbin/extattr/tests/extattr_test.sh
==
--- head/usr.sbin/extattr/tests/extattr_test.sh Tue Apr  4 21:30:24 2017
(r316504)
+++ head/usr.sbin/extattr/tests/extattr_test.sh Tue Apr  4 21:36:13 2017
(r316505)
@@ -70,10 +70,15 @@ long_name_head() {
 }
 long_name_body() {
check_fs
+
+   if ! NAME_MAX=$(getconf NAME_MAX .); then
+   atf_skip "Filesystem not reporting NAME_MAX; skipping testcase"
+   fi
+
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208965
atf_expect_fail "BUG 208965 extattr(2) doesn't allow maxlen attr names"
 
-   ATTRNAME=`jot -b X -s "" 255 0`
+   ATTRNAME=`jot -b X -s "" $NAME_MAX 0`
touch foo
atf_check -s exit:0 -o empty setextattr user $ATTRNAME myvalue foo
atf_check -s exit:0 -o inline:"${ATTRNAME}\n" lsextattr -q user foo
___
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: r316504 - head/usr.sbin/extattr/tests

2017-04-04 Thread Ngie Cooper
Author: ngie
Date: Tue Apr  4 21:30:24 2017
New Revision: 316504
URL: https://svnweb.freebsd.org/changeset/base/316504

Log:
  Clean up more trailing whitespace in the licensing tort that
  happened to be spaces, not tabs
  
  MFC after:2 months
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.sbin/extattr/tests/extattr_test.sh

Modified: head/usr.sbin/extattr/tests/extattr_test.sh
==
--- head/usr.sbin/extattr/tests/extattr_test.sh Tue Apr  4 21:29:37 2017
(r316503)
+++ head/usr.sbin/extattr/tests/extattr_test.sh Tue Apr  4 21:30:24 2017
(r316504)
@@ -10,7 +10,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #notice, this list of conditions and the following disclaimer in the
 #documentation and/or other materials provided with the distribution.
-#   
+#
 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
___
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: r316503 - head/usr.sbin/extattr/tests

2017-04-04 Thread Ngie Cooper
Author: ngie
Date: Tue Apr  4 21:29:37 2017
New Revision: 316503
URL: https://svnweb.freebsd.org/changeset/base/316503

Log:
  Clean up trailing whitespace
  
  MFC after:2 months
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.sbin/extattr/tests/extattr_test.sh

Modified: head/usr.sbin/extattr/tests/extattr_test.sh
==
--- head/usr.sbin/extattr/tests/extattr_test.sh Tue Apr  4 21:03:34 2017
(r316502)
+++ head/usr.sbin/extattr/tests/extattr_test.sh Tue Apr  4 21:29:37 2017
(r316503)
@@ -36,7 +36,7 @@ bad_namespace_body() {
setextattr badnamespace myattr X foo
atf_check -s not-exit:0 -e match:"Invalid argument" \
lsextattr -q badnamespace foo
-}  
+}
 
 atf_test_case hex
 hex_head() {
@@ -48,7 +48,7 @@ hex_body() {
atf_check -s exit:0 -o empty setextattr user myattr XYZ foo
atf_check -s exit:0 -o inline:"58 59 5a\n" \
getextattr -qx user myattr foo
-}  
+}
 
 atf_test_case hex_nonascii
 hex_nonascii_head() {
@@ -62,7 +62,7 @@ hex_nonascii_body() {
getextattr user myattr foo
atf_check -s exit:0 -o inline:"20 30 40 55 66 70 81 a2 b3 ee ff\n" \
getextattr -qx user myattr foo
-}  
+}
 
 atf_test_case long_name
 long_name_head() {
@@ -81,7 +81,7 @@ long_name_body() {
getextattr -q user ${ATTRNAME} foo
atf_check -s exit:0 -o empty rmextattr user ${ATTRNAME} foo
atf_check -s exit:0 -o empty lsextattr -q user foo
-}  
+}
 
 atf_test_case loud
 loud_head() {
@@ -99,7 +99,7 @@ loud_body() {
printf "%s %s" $(getextattr user myattr foo)
atf_check -s exit:0 -o empty rmextattr user myattr foo
atf_check -s exit:0 -o inline:"foo" printf %s $(lsextattr user foo)
-}  
+}
 
 atf_test_case noattrs
 noattrs_head() {
@@ -109,7 +109,7 @@ noattrs_body() {
check_fs
touch foo
atf_check -s exit:0 -o empty lsextattr -q user foo
-}  
+}
 
 atf_test_case nonexistent_file
 nonexistent_file_head() {
@@ -125,7 +125,7 @@ nonexistent_file_body() {
getextattr user myattr foo
atf_check -s exit:1 -e match:"No such file or directory" \
rmextattr user myattr foo
-}  
+}
 
 atf_test_case null
 null_head() {
@@ -136,7 +136,7 @@ null_body() {
touch foo
atf_check -s exit:0 -o empty setextattr -n user myattr myvalue foo
atf_check -s exit:0 -o inline:"myvalue\0\n" getextattr -q user myattr 
foo
-}  
+}
 
 atf_test_case one_user_attr
 one_user_attr_head() {
@@ -150,7 +150,7 @@ one_user_attr_body() {
atf_check -s exit:0 -o inline:"myvalue\n" getextattr -q user myattr foo
atf_check -s exit:0 -o empty rmextattr user myattr foo
atf_check -s exit:0 -o empty lsextattr -q user foo
-}  
+}
 
 atf_test_case one_system_attr
 one_system_attr_head() {
@@ -165,7 +165,7 @@ one_system_attr_body() {
atf_check -s exit:0 -o inline:"myvalue\n" getextattr -q system myattr 
foo
atf_check -s exit:0 -o empty rmextattr system myattr foo
atf_check -s exit:0 -o empty lsextattr -q system foo
-}  
+}
 
 atf_test_case stdin
 stdin_head() {
@@ -179,7 +179,7 @@ stdin_body() {
atf_check -s exit:0 -o inline:"myattr\n" lsextattr -q user foo
getextattr -qq user myattr foo > outfile || atf_fail "getextattr failed"
atf_check -s exit:0 cmp -s infile outfile
-}  
+}
 
 atf_test_case stringify
 stringify_head() {
@@ -191,7 +191,7 @@ stringify_body() {
atf_check -s exit:0 -o empty setextattr user myattr "my value" foo
atf_check -s exit:0 -o inline:"\"my\\\040value\"\n" \
getextattr -qs user myattr foo
-}  
+}
 
 atf_test_case symlink
 symlink_head() {
@@ -248,7 +248,7 @@ system_and_user_attrs_body() {
atf_check -s exit:0 -o empty rmextattr system sysattr foo
atf_check -s exit:0 -o empty lsextattr -q user foo
atf_check -s exit:0 -o empty lsextattr -q system foo
-}  
+}
 
 atf_test_case two_files
 two_files_head() {
@@ -315,7 +315,7 @@ two_user_attrs_body() {
atf_check -s exit:0 -o empty rmextattr user myattr2 foo
atf_check -s exit:0 -o empty rmextattr user myattr1 foo
atf_check -s exit:0 -o empty lsextattr -q user foo
-}  
+}
 
 atf_test_case unprivileged_user_cannot_set_system_attr
 unprivileged_user_cannot_set_system_attr_head() {
@@ -327,7 +327,7 @@ unprivileged_user_cannot_set_system_attr
touch foo
atf_check -s exit:1 -e match:"Operation not permitted" \
setextattr system myattr myvalue foo
-}  
+}
 
 
 atf_init_test_cases() {
___
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: r316502 - head/sys/net

2017-04-04 Thread Sean Bruno
Author: sbruno
Date: Tue Apr  4 21:03:34 2017
New Revision: 316502
URL: https://svnweb.freebsd.org/changeset/base/316502

Log:
  Allow MSIX to be turned off by tuneable per interface, per driver.
  
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c
  head/sys/net/iflib.h

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Apr  4 20:03:57 2017(r316501)
+++ head/sys/net/iflib.cTue Apr  4 21:03:34 2017(r316502)
@@ -521,8 +521,6 @@ rxd_info_zero(if_rxd_info_t ri)
 #define MAX_SINGLE_PACKET_FRACTION 12
 #define IF_BAD_DMA (bus_addr_t)-1
 
-static int enable_msix = 1;
-
 #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING))
 
 #define CTX_LOCK_INIT(_sc, _name)  mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx 
lock", MTX_DEF)
@@ -5187,7 +5185,7 @@ iflib_msix_init(if_ctx_t ctx)
bar = ctx->ifc_softc_ctx.isc_msix_bar;
admincnt = sctx->isc_admin_intrcnt;
/* Override by tuneable */
-   if (enable_msix == 0)
+   if (scctx->isc_disable_msix)
goto msi;
 
/*
@@ -5428,6 +5426,9 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx
SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "override_qs_enable",
   CTLFLAG_RWTUN, >ifc_sysctl_qs_eq_override, 0,
"permit #txq != #rxq");
+   SYSCTL_ADD_INT(ctx_list, oid_list, OID_AUTO, "disable_msix",
+  CTLFLAG_RWTUN, >ifc_softc_ctx.isc_disable_msix, 0,
+  "disable MSIX (default 0)");
 
/* XXX change for per-queue sizes */
SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_ntxds",

Modified: head/sys/net/iflib.h
==
--- head/sys/net/iflib.hTue Apr  4 20:03:57 2017(r316501)
+++ head/sys/net/iflib.hTue Apr  4 21:03:34 2017(r316502)
@@ -216,6 +216,7 @@ typedef struct if_softc_ctx {
iflib_intr_mode_t isc_intr;
uint16_t isc_max_frame_size; /* set at init time by driver */
pci_vendor_info_t isc_vendor_info;  /* set by iflib prior to 
attach_pre */
+   int isc_disable_msix;
if_txrx_t isc_txrx;
 } *if_softc_ctx_t;
 
___
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: r316501 - in head: etc/mtree usr.bin/pr usr.bin/pr/tests

2017-04-04 Thread Alan Somers
Author: asomers
Date: Tue Apr  4 20:03:57 2017
New Revision: 316501
URL: https://svnweb.freebsd.org/changeset/base/316501

Log:
  Fix file descriptor and memory leaks in pr(1)
  
  Also, hook NetBSD's pr test into the build, and add three more test cases.
  
  Reported by:  Coverity, Valgrind
  CID:  271650 271651 271652 271653 271654 271655 271656 271656
  CID:  271657 271658 271659 1006939 1006940 1006941 1006942 1009098
  Reviewed by:  ngie
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D9137

Added:
  head/usr.bin/pr/tests/
  head/usr.bin/pr/tests/Makefile   (contents, props changed)
  head/usr.bin/pr/tests/across.out   (contents, props changed)
  head/usr.bin/pr/tests/basic2_test.sh   (contents, props changed)
  head/usr.bin/pr/tests/merge.out   (contents, props changed)
  head/usr.bin/pr/tests/other.in   (contents, props changed)
  head/usr.bin/pr/tests/threecol.out   (contents, props changed)
Modified:
  head/etc/mtree/BSD.tests.dist
  head/usr.bin/pr/Makefile
  head/usr.bin/pr/pr.c

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Tue Apr  4 19:46:23 2017
(r316500)
+++ head/etc/mtree/BSD.tests.dist   Tue Apr  4 20:03:57 2017
(r316501)
@@ -642,6 +642,8 @@
 ..
 opensm
 ..
+pr
+..
 printf
 ..
 sdiff

Modified: head/usr.bin/pr/Makefile
==
--- head/usr.bin/pr/MakefileTue Apr  4 19:46:23 2017(r316500)
+++ head/usr.bin/pr/MakefileTue Apr  4 20:03:57 2017(r316501)
@@ -1,7 +1,13 @@
 #  @(#)Makefile8.1 (Berkeley) 6/6/93
 # $FreeBSD$
 
+.include 
+
 PROG=  pr
 SRCS=  pr.c egetopt.c
 
+.if ${MK_TESTS} != "no"
+SUBDIR+=tests
+.endif
+
 .include 

Modified: head/usr.bin/pr/pr.c
==
--- head/usr.bin/pr/pr.cTue Apr  4 19:46:23 2017(r316500)
+++ head/usr.bin/pr/pr.cTue Apr  4 20:03:57 2017(r316501)
@@ -103,7 +103,7 @@ static char schar;  /* text column separ
 static int sflag;  /* -s option for multiple columns */
 static int nohead; /* do not write head and trailer */
 static int pgwd;   /* page width with multiple col output */
-static const char *timefrmt;   /* time conversion string */
+static char*timefrmt;  /* time conversion string */
 
 /*
  * misc globals
@@ -135,6 +135,7 @@ main(int argc, char *argv[])
ret_val = horzcol(argc, argv);
else
ret_val = vertcol(argc, argv);
+   free(timefrmt);
} else
usage();
flsh_errs();
@@ -207,6 +208,7 @@ onecol(int argc, char *argv[])
 * allocate header buffer
 */
if ((hbuf = malloc((unsigned)(HDBUF + offst)*sizeof(char))) == NULL) {
+   free(obuf);
mfail();
return(1);
}
@@ -259,7 +261,7 @@ onecol(int argc, char *argv[])
break;
if (!linecnt && !nohead &&
prhead(hbuf, fname, pagecnt))
-   return(1);
+   goto err;
 
/*
 * start of new line.
@@ -268,9 +270,9 @@ onecol(int argc, char *argv[])
if (num)
addnum(nbuf, num, ++lncnt);
if (otln(obuf,cnt+off, , , mor))
-   return(1);
+   goto err;
} else if (otln(lbuf, cnt, , , mor))
-   return(1);
+   goto err;
 
/*
 * if line bigger than buffer, get more
@@ -293,7 +295,7 @@ onecol(int argc, char *argv[])
 * fill to end of page
 */
if (linecnt && prtail(lines-linecnt-lrgln, lrgln))
-   return(1);
+   goto err;
 
/*
 * On EOF go to next file
@@ -306,8 +308,14 @@ onecol(int argc, char *argv[])
(void)fclose(inf);
}
if (eoptind < argc)
-   return(1);
+   goto err;
+   free(hbuf);
+   free(obuf);
return(0);
+err:
+   free(hbuf);
+   free(obuf);
+   return(1);
 }
 
 /*
@@ -317,27 +325,27 @@ int
 vertcol(int argc, char *argv[])
 {
 

Re: svn commit: r316492 - in head/usr.bin/grep: . regex

2017-04-04 Thread Kyle Evans
On Tue, Apr 4, 2017 at 2:45 PM, Ngie Cooper (yaneurabeya) <
yaneurab...@gmail.com> wrote:

>
> > On Apr 4, 2017, at 12:04, Conrad Meyer  wrote:
> >
> > On Tue, Apr 4, 2017 at 11:56 AM, Dimitry Andric  wrote:
> >> On 4 Apr 2017, at 19:14, Ngie Cooper (yaneurabeya) <
> yaneurab...@gmail.com> wrote:
> >>> Where did xmalloc.c originate from?
> >>
> >> GNU.
> >
> > I believe this to be completely incorrect.
> >
> >> Almost all software from the GNU project relies on malloc wrappers
> >> which abort the program on allocation failures.
> >
> > That is not what bsdgrep's xmalloc() did, if you read the code. It
> > simply tracks all allocations for basic leak analysis.
> >
> > Abort on allocation failure would be a perfectly reasonable behavior
> > for bsdgrep(1), too.
>
> There are multiple, competing definitions floating around the internet. I
> was genuinely curious where this variant came from because I wanted to make
> sure we weren’t just zapping a file that some upstream uses somewhere, in
> the event we were going to bring down further updates, again, from said
> upstream source.


FWIW- I did scour the internet for other bsdgrep implementations and did
not find a trace of this in any of the others that I found, to include the
OS X implementation. In fact, as I recall, most of them didn't even have
the regex/ bits that we do, presumably they were using regex(3) but it's
been a while since I was poking around.
___
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: r316500 - in head/usr.bin: banner fortune/strfile limits rpcinfo

2017-04-04 Thread Alan Somers
Author: asomers
Date: Tue Apr  4 19:46:23 2017
New Revision: 316500
URL: https://svnweb.freebsd.org/changeset/base/316500

Log:
  strcpy => strlcpy, strcat => strlcat
  
  Reported by:  Coverity
  CID:  1006703 978863 1006745 1347163
  Reviewed by:  cem
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D10192

Modified:
  head/usr.bin/banner/banner.c
  head/usr.bin/fortune/strfile/strfile.c
  head/usr.bin/limits/limits.c
  head/usr.bin/rpcinfo/rpcinfo.c

Modified: head/usr.bin/banner/banner.c
==
--- head/usr.bin/banner/banner.cTue Apr  4 18:01:35 2017
(r316499)
+++ head/usr.bin/banner/banner.cTue Apr  4 19:46:23 2017
(r316500)
@@ -1064,8 +1064,8 @@ main(int argc, char *argv[])
err(1, "malloc");
strcpy(message, *argv);
while (*++argv) {
-   strcat(message, " ");
-   strcat(message, *argv);
+   strlcat(message, " ", j);
+   strlcat(message, *argv, j);
}
nchars = strlen(message);
} else {

Modified: head/usr.bin/fortune/strfile/strfile.c
==
--- head/usr.bin/fortune/strfile/strfile.c  Tue Apr  4 18:01:35 2017
(r316499)
+++ head/usr.bin/fortune/strfile/strfile.c  Tue Apr  4 19:46:23 2017
(r316500)
@@ -303,8 +303,8 @@ getargs(int argc, char **argv)
usage();
}
if (*Outfile == '\0') {
-   strcpy(Outfile, Infile);
-   strcat(Outfile, ".dat");
+   strlcpy(Outfile, Infile, sizeof(Outfile));
+   strlcat(Outfile, ".dat", sizeof(Outfile));
}
 }
 

Modified: head/usr.bin/limits/limits.c
==
--- head/usr.bin/limits/limits.cTue Apr  4 18:01:35 2017
(r316499)
+++ head/usr.bin/limits/limits.cTue Apr  4 19:46:23 2017
(r316500)
@@ -561,7 +561,7 @@ print_limit(rlim_t limit, unsigned divis
 char numbr[64];
 
 if (limit == RLIM_INFINITY)
-   strcpy(numbr, inf);
+   strlcpy(numbr, inf, sizeof(numbr));
 else
sprintf(numbr, "%jd", (intmax_t)((limit + divisor/2) / divisor));
 printf(pfx, which, numbr);

Modified: head/usr.bin/rpcinfo/rpcinfo.c
==
--- head/usr.bin/rpcinfo/rpcinfo.c  Tue Apr  4 18:01:35 2017
(r316499)
+++ head/usr.bin/rpcinfo/rpcinfo.c  Tue Apr  4 19:46:23 2017
(r316500)
@@ -856,9 +856,9 @@ failed:
printf("%-10s", buf);
buf[0] = '\0';
for (nl = rs->nlist; nl; nl = nl->next) {
-   strcat(buf, nl->netid);
+   strlcat(buf, nl->netid, sizeof(buf));
if (nl->next)
-   strcat(buf, ",");
+   strlcat(buf, ",", sizeof(buf));
}
printf("%-32s", buf);
rpc = getrpcbynumber(rs->prog);
___
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: r316492 - in head/usr.bin/grep: . regex

2017-04-04 Thread Ngie Cooper (yaneurabeya)

> On Apr 4, 2017, at 12:04, Conrad Meyer  wrote:
> 
> On Tue, Apr 4, 2017 at 11:56 AM, Dimitry Andric  wrote:
>> On 4 Apr 2017, at 19:14, Ngie Cooper (yaneurabeya)  
>> wrote:
>>> Where did xmalloc.c originate from?
>> 
>> GNU.
> 
> I believe this to be completely incorrect.
> 
>> Almost all software from the GNU project relies on malloc wrappers
>> which abort the program on allocation failures.
> 
> That is not what bsdgrep's xmalloc() did, if you read the code. It
> simply tracks all allocations for basic leak analysis.
> 
> Abort on allocation failure would be a perfectly reasonable behavior
> for bsdgrep(1), too.

There are multiple, competing definitions floating around the internet. I was 
genuinely curious where this variant came from because I wanted to make sure we 
weren’t just zapping a file that some upstream uses somewhere, in the event we 
were going to bring down further updates, again, from said upstream source.
Thanks,
-Ngie



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r316492 - in head/usr.bin/grep: . regex

2017-04-04 Thread Conrad Meyer
On Tue, Apr 4, 2017 at 11:56 AM, Dimitry Andric  wrote:
> On 4 Apr 2017, at 19:14, Ngie Cooper (yaneurabeya)  
> wrote:
>> Where did xmalloc.c originate from?
>
> GNU.

I believe this to be completely incorrect.

> Almost all software from the GNU project relies on malloc wrappers
> which abort the program on allocation failures.

That is not what bsdgrep's xmalloc() did, if you read the code. It
simply tracks all allocations for basic leak analysis.

Abort on allocation failure would be a perfectly reasonable behavior
for bsdgrep(1), too.

Best,
Conrad
___
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: r316492 - in head/usr.bin/grep: . regex

2017-04-04 Thread Conrad Meyer
On Tue, Apr 4, 2017 at 12:16 PM, Kyle Evans  wrote:
> On Tue, Apr 4, 2017 at 1:56 PM, Dimitry Andric  wrote:
>>
>> > Where did xmalloc.c originate from?
>>
>> GNU.  Almost all software from the GNU project relies on malloc wrappers
>> which abort the program on allocation failures.
>
>
> This also explains the grep_* versions of `malloc`, `calloc`, `realloc`, and
> `strdup` that I've developed a slight distaste for. The "xmalloc" flavor
> also had some hash table bits to allow failing after $n allocations -- is
> that a slightly less common GNU-ism?

Aborting-on-failure malloc wrappers didn't begin or end at GNU.  I
don't think bsdgrep's malloc wrappers have anything to do with GNU.
(xmalloc didn't at least; I haven't looked at the grep_malloc stuff).

Best,
Conrad
___
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: r316492 - in head/usr.bin/grep: . regex

2017-04-04 Thread Kyle Evans
On Tue, Apr 4, 2017 at 1:56 PM, Dimitry Andric  wrote:
>
> > Where did xmalloc.c originate from?
>
> GNU.  Almost all software from the GNU project relies on malloc wrappers
> which abort the program on allocation failures.


This also explains the grep_* versions of `malloc`, `calloc`, `realloc`,
and `strdup` that I've developed a slight distaste for. The "xmalloc"
flavor also had some hash table bits to allow failing after $n allocations
-- is that a slightly less common GNU-ism?

Thanks,

Kyle Evans
___
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: r316492 - in head/usr.bin/grep: . regex

2017-04-04 Thread Dimitry Andric
On 4 Apr 2017, at 19:14, Ngie Cooper (yaneurabeya)  
wrote:
> 
>> On Apr 4, 2017, at 09:08, Conrad Meyer  wrote:
>> 
>> Author: cem
>> Date: Tue Apr  4 16:08:51 2017
>> New Revision: 316492
>> URL: https://svnweb.freebsd.org/changeset/base/316492
>> 
>> Log:
>> bsdgrep(1): Rip out "xmalloc" bits
>> 
>> xmalloc was a debug malloc implementation, but the x{malloc,calloc,free}
>> functions default to calling the malloc(3) equivalents.
>> 
>> Instead of relying on this malloc shim, we can devise better ways to debug
>> malloc issues that aren't misleading upon initial inspection.  (I.e., using
>> jemalloc's various built-in debugging capabilities.)
>> 
>> Submitted by:Kyle Evans 
>> Reviewed by: emaste, cem
>> Differential Revision:   https://reviews.freebsd.org/D10269
>> 
>> Deleted:
>> head/usr.bin/grep/regex/xmalloc.c
>> head/usr.bin/grep/regex/xmalloc.h
>> Modified:
>> head/usr.bin/grep/Makefile
>> head/usr.bin/grep/regex/fastmatch.c
>> head/usr.bin/grep/regex/tre-compile.c
>> head/usr.bin/grep/regex/tre-fastmatch.c
> 
> Where did xmalloc.c originate from?

GNU.  Almost all software from the GNU project relies on malloc wrappers
which abort the program on allocation failures.


> I can’t find any references to it in OpenBSD’s grep implementation (I’m 
> pretty sure this copy of grep started there).

Not sure, they must have disliked the GNUisms too, probably. :)

-Dimitry



signature.asc
Description: Message signed with OpenPGP


svn commit: r316499 - in stable/10/sys: cam sys

2017-04-04 Thread Alexander Motin
Author: mav
Date: Tue Apr  4 18:01:35 2017
New Revision: 316499
URL: https://svnweb.freebsd.org/changeset/base/316499

Log:
  MFC r315673, r315674: Make CAM SIM lock optional.
  
  For three years now CAM does not use SIM lock, but still enforces SIM to
  use it.  Remove this requirement, allowing SIMs to have any locking they
  prefer, if they pass no mutex to cam_sim_alloc().

Modified:
  stable/10/sys/cam/cam_sim.c
  stable/10/sys/cam/cam_xpt.c
  stable/10/sys/sys/param.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/cam_sim.c
==
--- stable/10/sys/cam/cam_sim.c Tue Apr  4 17:59:10 2017(r316498)
+++ stable/10/sys/cam/cam_sim.c Tue Apr  4 18:01:35 2017(r316499)
@@ -46,6 +46,9 @@ __FBSDID("$FreeBSD$");
 
 static MALLOC_DEFINE(M_CAMSIM, "CAM SIM", "CAM SIM buffers");
 
+static struct mtx cam_sim_free_mtx;
+MTX_SYSINIT(cam_sim_free_init, _sim_free_mtx, "CAM SIM free lock", 
MTX_DEF);
+
 struct cam_devq *
 cam_simq_alloc(u_int32_t max_sim_transactions)
 {
@@ -66,9 +69,6 @@ cam_sim_alloc(sim_action_func sim_action
 {
struct cam_sim *sim;
 
-   if (mtx == NULL)
-   return (NULL);
-
sim = (struct cam_sim *)malloc(sizeof(struct cam_sim),
M_CAMSIM, M_ZERO | M_NOWAIT);
 
@@ -101,16 +101,23 @@ cam_sim_alloc(sim_action_func sim_action
 void
 cam_sim_free(struct cam_sim *sim, int free_devq)
 {
+   struct mtx *mtx = sim->mtx;
int error;
 
-   mtx_assert(sim->mtx, MA_OWNED);
+   if (mtx) {
+   mtx_assert(mtx, MA_OWNED);
+   } else {
+   mtx = _sim_free_mtx;
+   mtx_lock(mtx);
+   }
sim->refcount--;
if (sim->refcount > 0) {
-   error = msleep(sim, sim->mtx, PRIBIO, "simfree", 0);
+   error = msleep(sim, mtx, PRIBIO, "simfree", 0);
KASSERT(error == 0, ("invalid error value for msleep(9)"));
}
-
KASSERT(sim->refcount == 0, ("sim->refcount == 0"));
+   if (sim->mtx == NULL)
+   mtx_unlock(mtx);
 
if (free_devq)
cam_simq_free(sim->devq);
@@ -120,31 +127,43 @@ cam_sim_free(struct cam_sim *sim, int fr
 void
 cam_sim_release(struct cam_sim *sim)
 {
-   int lock;
+   struct mtx *mtx = sim->mtx;
 
-   lock = (mtx_owned(sim->mtx) == 0);
-   if (lock)
-   CAM_SIM_LOCK(sim);
+   if (mtx) {
+   if (!mtx_owned(mtx))
+   mtx_lock(mtx);
+   else
+   mtx = NULL;
+   } else {
+   mtx = _sim_free_mtx;
+   mtx_lock(mtx);
+   }
KASSERT(sim->refcount >= 1, ("sim->refcount >= 1"));
sim->refcount--;
if (sim->refcount == 0)
wakeup(sim);
-   if (lock)
-   CAM_SIM_UNLOCK(sim);
+   if (mtx)
+   mtx_unlock(mtx);
 }
 
 void
 cam_sim_hold(struct cam_sim *sim)
 {
-   int lock;
+   struct mtx *mtx = sim->mtx;
 
-   lock = (mtx_owned(sim->mtx) == 0);
-   if (lock)
-   CAM_SIM_LOCK(sim);
+   if (mtx) {
+   if (!mtx_owned(mtx))
+   mtx_lock(mtx);
+   else
+   mtx = NULL;
+   } else {
+   mtx = _sim_free_mtx;
+   mtx_lock(mtx);
+   }
KASSERT(sim->refcount >= 1, ("sim->refcount >= 1"));
sim->refcount++;
-   if (lock)
-   CAM_SIM_UNLOCK(sim);
+   if (mtx)
+   mtx_unlock(mtx);
 }
 
 void

Modified: stable/10/sys/cam/cam_xpt.c
==
--- stable/10/sys/cam/cam_xpt.c Tue Apr  4 17:59:10 2017(r316498)
+++ stable/10/sys/cam/cam_xpt.c Tue Apr  4 18:01:35 2017(r316499)
@@ -2483,7 +2483,7 @@ xpt_action_default(union ccb *start_ccb)
 {
struct cam_path *path;
struct cam_sim *sim;
-   int lock;
+   struct mtx *mtx;
 
path = start_ccb->ccb_h.path;
CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_action_default\n"));
@@ -2637,12 +2637,14 @@ xpt_action_default(union ccb *start_ccb)
case XPT_PATH_INQ:
 call_sim:
sim = path->bus->sim;
-   lock = (mtx_owned(sim->mtx) == 0);
-   if (lock)
-   CAM_SIM_LOCK(sim);
+   mtx = sim->mtx;
+   if (mtx && !mtx_owned(mtx))
+   mtx_lock(mtx);
+   else
+   mtx = NULL;
(*(sim->sim_action))(sim, start_ccb);
-   if (lock)
-   CAM_SIM_UNLOCK(sim);
+   if (mtx)
+   mtx_unlock(mtx);
break;
case XPT_PATH_STATS:
start_ccb->cpis.last_reset = path->bus->last_reset;
@@ -2864,8 +2866,8 @@ call_sim:
break;
}
 

svn commit: r316498 - in stable/11/sys: cam sys

2017-04-04 Thread Alexander Motin
Author: mav
Date: Tue Apr  4 17:59:10 2017
New Revision: 316498
URL: https://svnweb.freebsd.org/changeset/base/316498

Log:
  MFC r315673, r315674: Make CAM SIM lock optional.
  
  For three years now CAM does not use SIM lock, but still enforces SIM to
  use it.  Remove this requirement, allowing SIMs to have any locking they
  prefer, if they pass no mutex to cam_sim_alloc().

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

Modified: stable/11/sys/cam/cam_sim.c
==
--- stable/11/sys/cam/cam_sim.c Tue Apr  4 17:32:08 2017(r316497)
+++ stable/11/sys/cam/cam_sim.c Tue Apr  4 17:59:10 2017(r316498)
@@ -46,6 +46,9 @@ __FBSDID("$FreeBSD$");
 
 static MALLOC_DEFINE(M_CAMSIM, "CAM SIM", "CAM SIM buffers");
 
+static struct mtx cam_sim_free_mtx;
+MTX_SYSINIT(cam_sim_free_init, _sim_free_mtx, "CAM SIM free lock", 
MTX_DEF);
+
 struct cam_devq *
 cam_simq_alloc(u_int32_t max_sim_transactions)
 {
@@ -66,9 +69,6 @@ cam_sim_alloc(sim_action_func sim_action
 {
struct cam_sim *sim;
 
-   if (mtx == NULL)
-   return (NULL);
-
sim = (struct cam_sim *)malloc(sizeof(struct cam_sim),
M_CAMSIM, M_ZERO | M_NOWAIT);
 
@@ -101,16 +101,23 @@ cam_sim_alloc(sim_action_func sim_action
 void
 cam_sim_free(struct cam_sim *sim, int free_devq)
 {
+   struct mtx *mtx = sim->mtx;
int error;
 
-   mtx_assert(sim->mtx, MA_OWNED);
+   if (mtx) {
+   mtx_assert(mtx, MA_OWNED);
+   } else {
+   mtx = _sim_free_mtx;
+   mtx_lock(mtx);
+   }
sim->refcount--;
if (sim->refcount > 0) {
-   error = msleep(sim, sim->mtx, PRIBIO, "simfree", 0);
+   error = msleep(sim, mtx, PRIBIO, "simfree", 0);
KASSERT(error == 0, ("invalid error value for msleep(9)"));
}
-
KASSERT(sim->refcount == 0, ("sim->refcount == 0"));
+   if (sim->mtx == NULL)
+   mtx_unlock(mtx);
 
if (free_devq)
cam_simq_free(sim->devq);
@@ -120,31 +127,43 @@ cam_sim_free(struct cam_sim *sim, int fr
 void
 cam_sim_release(struct cam_sim *sim)
 {
-   int lock;
+   struct mtx *mtx = sim->mtx;
 
-   lock = (mtx_owned(sim->mtx) == 0);
-   if (lock)
-   CAM_SIM_LOCK(sim);
+   if (mtx) {
+   if (!mtx_owned(mtx))
+   mtx_lock(mtx);
+   else
+   mtx = NULL;
+   } else {
+   mtx = _sim_free_mtx;
+   mtx_lock(mtx);
+   }
KASSERT(sim->refcount >= 1, ("sim->refcount >= 1"));
sim->refcount--;
if (sim->refcount == 0)
wakeup(sim);
-   if (lock)
-   CAM_SIM_UNLOCK(sim);
+   if (mtx)
+   mtx_unlock(mtx);
 }
 
 void
 cam_sim_hold(struct cam_sim *sim)
 {
-   int lock;
+   struct mtx *mtx = sim->mtx;
 
-   lock = (mtx_owned(sim->mtx) == 0);
-   if (lock)
-   CAM_SIM_LOCK(sim);
+   if (mtx) {
+   if (!mtx_owned(mtx))
+   mtx_lock(mtx);
+   else
+   mtx = NULL;
+   } else {
+   mtx = _sim_free_mtx;
+   mtx_lock(mtx);
+   }
KASSERT(sim->refcount >= 1, ("sim->refcount >= 1"));
sim->refcount++;
-   if (lock)
-   CAM_SIM_UNLOCK(sim);
+   if (mtx)
+   mtx_unlock(mtx);
 }
 
 void

Modified: stable/11/sys/cam/cam_xpt.c
==
--- stable/11/sys/cam/cam_xpt.c Tue Apr  4 17:32:08 2017(r316497)
+++ stable/11/sys/cam/cam_xpt.c Tue Apr  4 17:59:10 2017(r316498)
@@ -2486,7 +2486,7 @@ xpt_action_default(union ccb *start_ccb)
 {
struct cam_path *path;
struct cam_sim *sim;
-   int lock;
+   struct mtx *mtx;
 
path = start_ccb->ccb_h.path;
CAM_DEBUG(path, CAM_DEBUG_TRACE,
@@ -2647,16 +2647,18 @@ xpt_action_default(union ccb *start_ccb)
case XPT_PATH_INQ:
 call_sim:
sim = path->bus->sim;
-   lock = (mtx_owned(sim->mtx) == 0);
-   if (lock)
-   CAM_SIM_LOCK(sim);
+   mtx = sim->mtx;
+   if (mtx && !mtx_owned(mtx))
+   mtx_lock(mtx);
+   else
+   mtx = NULL;
CAM_DEBUG(path, CAM_DEBUG_TRACE,
("sim->sim_action: func=%#x\n", 
start_ccb->ccb_h.func_code));
(*(sim->sim_action))(sim, start_ccb);
CAM_DEBUG(path, CAM_DEBUG_TRACE,
("sim->sim_action: status=%#x\n", start_ccb->ccb_h.status));
-   if (lock)
-   CAM_SIM_UNLOCK(sim);
+   if (mtx)
+   

svn commit: r316497 - head/sys/kern

2017-04-04 Thread Brooks Davis
Author: brooks
Date: Tue Apr  4 17:32:08 2017
New Revision: 316497
URL: https://svnweb.freebsd.org/changeset/base/316497

Log:
  Correct a kernel stack leak in 32-bit compat when vfc_name is short.
  
  Don't zero unused pointer members again.
  
  Per discussion with secteam we are not issuing an advisory for this
  issue as we have no current evidence it leaks exploitable information.
  
  Reviewed by:  rwatson, glebius, delphij
  MFC after:1 day
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D10227

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cTue Apr  4 17:18:45 2017(r316496)
+++ head/sys/kern/vfs_subr.cTue Apr  4 17:32:08 2017(r316497)
@@ -3781,12 +3781,11 @@ vfsconf2x32(struct sysctl_req *req, stru
 {
struct xvfsconf32 xvfsp;
 
+   bzero(, sizeof(xvfsp));
strcpy(xvfsp.vfc_name, vfsp->vfc_name);
xvfsp.vfc_typenum = vfsp->vfc_typenum;
xvfsp.vfc_refcount = vfsp->vfc_refcount;
xvfsp.vfc_flags = vfsp->vfc_flags;
-   xvfsp.vfc_vfsops = 0;
-   xvfsp.vfc_next = 0;
return (SYSCTL_OUT(req, , sizeof(xvfsp)));
 }
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r316486 - head/sys/mips/mips

2017-04-04 Thread Edward Napierala
2017-04-04 17:20 GMT+01:00 John Baldwin :

> On Tuesday, April 04, 2017 08:17:03 AM Edward Tomasz Napierala wrote:
> > Author: trasz
> > Date: Tue Apr  4 08:17:03 2017
> > New Revision: 316486
> > URL: https://svnweb.freebsd.org/changeset/base/316486
> >
> > Log:
> >   Remove dead code/ifdef.
> >
> >   MFC after:  2 weeks
> >   Sponsored by:   DARPA, AFRL
>
> I'm not quite sure how dead this.  We do reserve space in 'struct reg'
> for IC in regnum.h:
>
> /*
>  * IC is valid only on RM7K and RM9K processors. Access to this is
>  * controlled by IC_INT_REG which defined in kernel config
>  */
> #define IC  38
>
> OTOH, I can't find other references to IC outside of regnum.h and what
> you just removed.
>

I've only grepped the sources for the #ifdef, and that it was added with
the initial commit that added the MIPS port.  I didn't do anything with IC,
because I'm not sure if something doesn't depend on the structure size.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r316486 - head/sys/mips/mips

2017-04-04 Thread John Baldwin
On Tuesday, April 04, 2017 08:17:03 AM Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Tue Apr  4 08:17:03 2017
> New Revision: 316486
> URL: https://svnweb.freebsd.org/changeset/base/316486
> 
> Log:
>   Remove dead code/ifdef.
>   
>   MFC after:  2 weeks
>   Sponsored by:   DARPA, AFRL

I'm not quite sure how dead this.  We do reserve space in 'struct reg'
for IC in regnum.h:

/*
 * IC is valid only on RM7K and RM9K processors. Access to this is
 * controlled by IC_INT_REG which defined in kernel config
 */
#define IC  38

OTOH, I can't find other references to IC outside of regnum.h and what
you just removed.

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


Re: svn commit: r316488 - head/share/man/man4

2017-04-04 Thread Sevan Janiyan


On 04/04/2017 16:58, Ian Lepore wrote:
> 'An' was correct for these usages.  The choice should be based on the
> sound of the word that follows, which in this case is 'ar'.

Fixed :)
Thanks for the heads up.


Sevan
___
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: r316496 - head/share/man/man4

2017-04-04 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Tue Apr  4 17:18:45 2017
New Revision: 316496
URL: https://svnweb.freebsd.org/changeset/base/316496

Log:
  Correct the grammar mistakes introduced by me in the previous commit.
  The original sentence used the correct article to reference the MAC & radio.
  
  Reported by:  ian
  MFC after:5 days

Modified:
  head/share/man/man4/ral.4

Modified: head/share/man/man4/ral.4
==
--- head/share/man/man4/ral.4   Tue Apr  4 17:05:37 2017(r316495)
+++ head/share/man/man4/ral.4   Tue Apr  4 17:18:45 2017(r316496)
@@ -45,7 +45,7 @@ driver supports PCI/PCIe/CardBus wireles
 RT2501, RT2600, RT2700, RT2800, RT3090 and RT3900E chipsets.
 .Pp
 The RT2500 chipset is the first generation of 802.11b/g adapters from Ralink.
-It consists of two integrated chips, a RT2560 MAC/BBP and a RT2525 radio
+It consists of two integrated chips, an RT2560 MAC/BBP and an RT2525 radio
 transceiver.
 .Pp
 The RT2501 chipset is the second generation of 802.11a/b/g adapters from
___
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: r316492 - in head/usr.bin/grep: . regex

2017-04-04 Thread Ngie Cooper (yaneurabeya)

> On Apr 4, 2017, at 09:08, Conrad Meyer  wrote:
> 
> Author: cem
> Date: Tue Apr  4 16:08:51 2017
> New Revision: 316492
> URL: https://svnweb.freebsd.org/changeset/base/316492
> 
> Log:
>  bsdgrep(1): Rip out "xmalloc" bits
> 
>  xmalloc was a debug malloc implementation, but the x{malloc,calloc,free}
>  functions default to calling the malloc(3) equivalents.
> 
>  Instead of relying on this malloc shim, we can devise better ways to debug
>  malloc issues that aren't misleading upon initial inspection.  (I.e., using
>  jemalloc's various built-in debugging capabilities.)
> 
>  Submitted by:Kyle Evans 
>  Reviewed by: emaste, cem
>  Differential Revision:   https://reviews.freebsd.org/D10269
> 
> Deleted:
>  head/usr.bin/grep/regex/xmalloc.c
>  head/usr.bin/grep/regex/xmalloc.h
> Modified:
>  head/usr.bin/grep/Makefile
>  head/usr.bin/grep/regex/fastmatch.c
>  head/usr.bin/grep/regex/tre-compile.c
>  head/usr.bin/grep/regex/tre-fastmatch.c

Where did xmalloc.c originate from? I can’t find any references to it in 
OpenBSD’s grep implementation (I’m pretty sure this copy of grep started there).
Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r316495 - head/usr.bin/grep/regex

2017-04-04 Thread Conrad Meyer
Author: cem
Date: Tue Apr  4 17:05:37 2017
New Revision: 316495
URL: https://svnweb.freebsd.org/changeset/base/316495

Log:
  bsdgrep(1): Fix errors with invalid expressions
  
  Invalid expressions with an ultimate compiled pattern length of 0 (e.g.,
  "grep -E {") were not taken into account and caused a segfault while trying
  to fill in the good suffix table.
  
  Submitted by: Kyle Evans 
  Reviewed by:  me
  Differential Revision:https://reviews.freebsd.org/D10113

Modified:
  head/usr.bin/grep/regex/tre-fastmatch.c

Modified: head/usr.bin/grep/regex/tre-fastmatch.c
==
--- head/usr.bin/grep/regex/tre-fastmatch.c Tue Apr  4 16:54:46 2017
(r316494)
+++ head/usr.bin/grep/regex/tre-fastmatch.c Tue Apr  4 17:05:37 2017
(r316495)
@@ -337,7 +337,7 @@ static int  fastcmp(const fastmatch_t *fg
  * Fills in the good suffix table for SB/MB strings.
  */
 #define FILL_BMGS  \
-  if (!fg->hasdot) \
+  if (fg->len > 0 && !fg->hasdot)  \
 {  \
   fg->sbmGs = malloc(fg->len * sizeof(int));   \
   if (!fg->sbmGs)  \
@@ -353,7 +353,7 @@ static int  fastcmp(const fastmatch_t *fg
  * Fills in the good suffix table for wide strings.
  */
 #define FILL_BMGS_WIDE \
-  if (!fg->hasdot) \
+  if (fg->wlen > 0 && !fg->hasdot) \
 {  \
   fg->bmGs = malloc(fg->wlen * sizeof(int));   \
   if (!fg->bmGs)   \
___
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: r316494 - head/sys/dev/e1000

2017-04-04 Thread Sean Bruno
Author: sbruno
Date: Tue Apr  4 16:54:46 2017
New Revision: 316494
URL: https://svnweb.freebsd.org/changeset/base/316494

Log:
  no_desc_avail is tracked in iflib now making this redundant.
  
  Sponsored by: Limelight Networks

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

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Tue Apr  4 16:26:46 2017(r316493)
+++ head/sys/dev/e1000/if_em.c  Tue Apr  4 16:54:46 2017(r316494)
@@ -3883,9 +3883,6 @@ em_add_hw_stats(struct adapter *adapter)
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "tx_irq",
CTLFLAG_RD, >tx_irq,
"Queue MSI-X Transmit Interrupts");
-   SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "no_desc_avail",
-   CTLFLAG_RD, >no_desc_avail,
-   "Queue No Descriptor Available");
}
 
for (int j = 0; j < adapter->rx_num_queues; j++, rx_que++) {

Modified: head/sys/dev/e1000/if_em.h
==
--- head/sys/dev/e1000/if_em.h  Tue Apr  4 16:26:46 2017(r316493)
+++ head/sys/dev/e1000/if_em.h  Tue Apr  4 16:54:46 2017(r316494)
@@ -368,7 +368,6 @@ struct tx_ring {
void*tag;
struct resource *res;
 unsigned long  tx_irq;
-unsigned long  no_desc_avail;
 
/* Saved csum offloading context information */
int csum_flags;
___
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: r316493 - head/sys/vm

2017-04-04 Thread John Baldwin
Author: jhb
Date: Tue Apr  4 16:26:46 2017
New Revision: 316493
URL: https://svnweb.freebsd.org/changeset/base/316493

Log:
  Assert that the align parameter to uma_zcreate() is valid.
  
  Reviewed by:  kib
  MFC after:1 week
  Sponsored by: DARPA / AFRL
  Differential Revision:https://reviews.freebsd.org/D10100

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Tue Apr  4 16:08:51 2017(r316492)
+++ head/sys/vm/uma_core.c  Tue Apr  4 16:26:46 2017(r316493)
@@ -1888,6 +1888,9 @@ uma_zcreate(const char *name, size_t siz
uma_zone_t res;
bool locked;
 
+   KASSERT(powerof2(align + 1), ("invalid zone alignment %d for \"%s\"",
+   align, name));
+
/* This stuff is essential for the zone ctor */
memset(, 0, sizeof(args));
args.name = name;
___
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: r316492 - in head/usr.bin/grep: . regex

2017-04-04 Thread Conrad Meyer
Author: cem
Date: Tue Apr  4 16:08:51 2017
New Revision: 316492
URL: https://svnweb.freebsd.org/changeset/base/316492

Log:
  bsdgrep(1): Rip out "xmalloc" bits
  
  xmalloc was a debug malloc implementation, but the x{malloc,calloc,free}
  functions default to calling the malloc(3) equivalents.
  
  Instead of relying on this malloc shim, we can devise better ways to debug
  malloc issues that aren't misleading upon initial inspection.  (I.e., using
  jemalloc's various built-in debugging capabilities.)
  
  Submitted by: Kyle Evans 
  Reviewed by:  emaste, cem
  Differential Revision:https://reviews.freebsd.org/D10269

Deleted:
  head/usr.bin/grep/regex/xmalloc.c
  head/usr.bin/grep/regex/xmalloc.h
Modified:
  head/usr.bin/grep/Makefile
  head/usr.bin/grep/regex/fastmatch.c
  head/usr.bin/grep/regex/tre-compile.c
  head/usr.bin/grep/regex/tre-fastmatch.c

Modified: head/usr.bin/grep/Makefile
==
--- head/usr.bin/grep/Makefile  Tue Apr  4 14:17:50 2017(r316491)
+++ head/usr.bin/grep/Makefile  Tue Apr  4 16:08:51 2017(r316492)
@@ -17,7 +17,7 @@ SRCS= file.c grep.c queue.c util.c
 
 # Extra files ported backported form some regex improvements
 .PATH: ${.CURDIR}/regex
-SRCS+= fastmatch.c hashtable.c tre-compile.c tre-fastmatch.c xmalloc.c
+SRCS+= fastmatch.c hashtable.c tre-compile.c tre-fastmatch.c
 CFLAGS+=-I${.CURDIR}/regex
 
 CFLAGS.gcc+= --param max-inline-insns-single=500

Modified: head/usr.bin/grep/regex/fastmatch.c
==
--- head/usr.bin/grep/regex/fastmatch.c Tue Apr  4 14:17:50 2017
(r316491)
+++ head/usr.bin/grep/regex/fastmatch.c Tue Apr  4 16:08:51 2017
(r316492)
@@ -34,7 +34,6 @@
 #include 
 
 #include "tre-fastmatch.h"
-#include "xmalloc.h"
 
 int
 tre_fixncomp(fastmatch_t *preg, const char *regex, size_t n, int cflags)

Modified: head/usr.bin/grep/regex/tre-compile.c
==
--- head/usr.bin/grep/regex/tre-compile.c   Tue Apr  4 14:17:50 2017
(r316491)
+++ head/usr.bin/grep/regex/tre-compile.c   Tue Apr  4 16:08:51 2017
(r316492)
@@ -9,8 +9,6 @@
 #include 
 #include 
 
-#include "xmalloc.h"
-
 int
 tre_convert_pattern(const char *regex, size_t n, tre_char_t **w,
size_t *wn)
@@ -19,7 +17,7 @@ tre_convert_pattern(const char *regex, s
   tre_char_t *wregex;
   size_t wlen;
 
-  wregex = xmalloc(sizeof(tre_char_t) * (n + 1));
+  wregex = malloc(sizeof(tre_char_t) * (n + 1));
   if (wregex == NULL)
 return REG_ESPACE;
 
@@ -60,13 +58,13 @@ tre_convert_pattern(const char *regex, s
consumed = 1;
  else
{
- xfree(wregex);
+ free(wregex);
  return REG_BADPAT;
}
  break;
case -1:
  DPRINT(("mbrtowc: error %d: %s.\n", errno, strerror(errno)));
- xfree(wregex);
+ free(wregex);
  return REG_BADPAT;
case -2:
  /* The last character wasn't complete.  Let's not call it a
@@ -98,6 +96,6 @@ void
 tre_free_pattern(tre_char_t *wregex)
 {
 #if TRE_WCHAR
-  xfree(wregex);
+  free(wregex);
 #endif
 }

Modified: head/usr.bin/grep/regex/tre-fastmatch.c
==
--- head/usr.bin/grep/regex/tre-fastmatch.c Tue Apr  4 14:17:50 2017
(r316491)
+++ head/usr.bin/grep/regex/tre-fastmatch.c Tue Apr  4 16:08:51 2017
(r316492)
@@ -42,7 +42,6 @@
 
 #include "hashtable.h"
 #include "tre-fastmatch.h"
-#include "xmalloc.h"
 
 static int fastcmp(const fastmatch_t *fg, const void *data,
tre_str_type_t type);
@@ -53,9 +52,9 @@ static intfastcmp(const fastmatch_t *fg
 #define FAIL_COMP(errcode) \
   {\
 if (fg->pattern)   \
-  xfree(fg->pattern);  \
+  free(fg->pattern);   \
 if (fg->wpattern)  \
-  xfree(fg->wpattern); \
+  free(fg->wpattern);  \
 if (fg->qsBc_table)
\
   hashtable_free(fg->qsBc_table);  \
 fg = NULL; \
@@ -92,7 +91,7 @@ static intfastcmp(const fastmatch_t *fg
 if (siz == (size_t)-1) \
   return REG_BADPAT;   \
 fg->len = siz;   

Re: svn commit: r316488 - head/share/man/man4

2017-04-04 Thread Ian Lepore
On Tue, 2017-04-04 at 13:18 +, Sevan Janiyan wrote:
> Author: sevan (doc committer)
> Date: Tue Apr  4 13:18:56 2017
> New Revision: 316488
> URL: https://svnweb.freebsd.org/changeset/base/316488
> 
> Log:
>   Replace an with a
>   Reword caveat on PCI 2.2 requirement.
>   
>   PR: 218070
>   Submitted by:   
>   Approved by:bcr
>   MFC after:  5 days
>   Differential Revision:   https://reviews.freebsd.org/D10262
> 
> Modified:
>   head/share/man/man4/ral.4
> 
> Modified: head/share/man/man4/ral.4
> ==
> --- head/share/man/man4/ral.4 Tue Apr  4 11:43:31 2017(r316487)
> +++ head/share/man/man4/ral.4 Tue Apr  4 13:18:56 2017(r316488)
> @@ -14,7 +14,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd August 4, 2015
> +.Dd April 4, 2017
>  .Dt RAL 4
>  .Os
>  .Sh NAME
> @@ -45,7 +45,7 @@ driver supports PCI/PCIe/CardBus wireles
>  RT2501, RT2600, RT2700, RT2800, RT3090 and RT3900E chipsets.
>  .Pp
>  The RT2500 chipset is the first generation of 802.11b/g adapters from Ralink.
> -It consists of two integrated chips, an RT2560 MAC/BBP and an RT2525 radio
> +It consists of two integrated chips, a RT2560 MAC/BBP and a RT2525 radio

'An' was correct for these usages.  The choice should be based on the
sound of the word that follows, which in this case is 'ar'.

-- Ian

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


RE: svn commit: r316485 - in head: share/man/man4 sys/conf sys/dev/qlnx sys/dev/qlnx/qlnxe sys/modules sys/modules/qlnx sys/modules/qlnx/qlnxe

2017-04-04 Thread Somayajulu, David
> Looks like this driver contains source-less microcode and should thus honour 
> WITHOUT_SOURCELESS_UCODE.
Sure will fix.
Thanks
David S.

-Original Message-
From: Fabian Keil [mailto:freebsd-lis...@fabiankeil.de] 
Sent: Tuesday, April 04, 2017 5:58 AM
To: David C Somayajulu 
Cc: svn-src-all@freebsd.org
Subject: Re: svn commit: r316485 - in head: share/man/man4 sys/conf 
sys/dev/qlnx sys/dev/qlnx/qlnxe sys/modules sys/modules/qlnx 
sys/modules/qlnx/qlnxe

David C Somayajulu  wrote:

> Author: davidcs
> Date: Tue Apr  4 06:16:59 2017
> New Revision: 316485
> URL: https://svnweb.freebsd.org/changeset/base/316485
> 
> Log:
>   Add 25/40/100Gigabit Ethernet Driver version v1.3.0 for Cavium Inc's.
>   Qlogic 45000 Series Adapters
>   
>   MFC after:2 weeks

Looks like this driver contains source-less microcode and should thus honour 
WITHOUT_SOURCELESS_UCODE.

As pointed out previously, qlxbge has the same issue:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204749

Some of the copyright headers imply that parts of this driver were written in 
the future (2018) which seems unlikely ...

Fabian
___
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: r316477 - head/usr.bin/grep

2017-04-04 Thread Andrey Chernov
On 04.04.2017 16:41, Kyle Evans wrote:
> Upon further review, newer versions of GNU grep(1) drop the explicit
> '00' and add the \33[K dropped in this commit a few lines above the
> mentioned one. In that case, we might as well revert those two lines and
> consider this an improvement. I guess it depends on the overall outlook
> of the tests, though -- should we introduce more tests that fail by
> default as they go in, or adapt similar (not strictly buggy, but not
> ideal) behavior to start with and then improve after we can grant
> bsdgrep(1) replacement status?

It seems new GNU grep takes right course, so I vote to make our thing
like there and not as in its obsoleted version.

\33[K clears from cursor to the rest of the line (with background color,
in case terminal have "ut" termcap capability). Consider how multi-line
pattern will look with it and without.

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


svn commit: r316491 - head/usr.bin/grep

2017-04-04 Thread Ed Maste
Author: emaste
Date: Tue Apr  4 14:17:50 2017
New Revision: 316491
URL: https://svnweb.freebsd.org/changeset/base/316491

Log:
  bsdgrep: revert color changes from r316477
  
  r316477 changed the color output to match exactly the in-tree GNU grep,
  but introduces unnecessary escape sequences.
  
  Submitted by: Kyle Evans 
  Reported by:  ache
  MFC after:1 month
  MFC with: r316477

Modified:
  head/usr.bin/grep/util.c

Modified: head/usr.bin/grep/util.c
==
--- head/usr.bin/grep/util.cTue Apr  4 13:41:50 2017(r316490)
+++ head/usr.bin/grep/util.cTue Apr  4 14:17:50 2017(r316491)
@@ -512,13 +512,13 @@ printline(struct str *line, int sep, reg
fwrite(line->dat + a, matches[i].rm_so - a, 1,
stdout);
if (color) 
-   fprintf(stdout, "\33[%sm", color);
+   fprintf(stdout, "\33[%sm\33[K", color);
 
fwrite(line->dat + matches[i].rm_so, 
matches[i].rm_eo - matches[i].rm_so, 1,
stdout);
if (color) 
-   fprintf(stdout, "\33[00m\33[K");
+   fprintf(stdout, "\33[m\33[K");
a = matches[i].rm_eo;
if (oflag)
putchar('\n');
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r316477 - head/usr.bin/grep

2017-04-04 Thread Kyle Evans
On Tue, Apr 4, 2017 at 8:53 AM, Ed Maste  wrote:

> In this case I'd rather we remove the 00 and have the test verify
> that. I think it's fine if there are a few tests that fail when run
> with GNU grep where it has the undesired, differing behaviour.
>

Excellent- can you please revert this entire bit then:

@@ -474,13 +509,13 @@ printline(struct str *line, int sep, reg
fwrite(line->dat + a, matches[i].rm_so - a,
1,
stdout);
if (color)
-   fprintf(stdout, "\33[%sm\33[K", color);
+   fprintf(stdout, "\33[%sm", color);

fwrite(line->dat + matches[i].rm_so,
matches[i].rm_eo - matches[i].rm_so, 1,
stdout);
if (color)
-   fprintf(stdout, "\33[m\33[K");
+   fprintf(stdout, "\33[00m\33[K");
a = matches[i].rm_eo;
if (oflag)
putchar('\n');

I'll address this in the unit tests review shortly.
___
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: r316477 - head/usr.bin/grep

2017-04-04 Thread Ed Maste
On 4 April 2017 at 09:09, Kyle Evans  wrote:
>
> This is where it gets kind of finnicky, and I'll step out and let others
> weigh in -- the test I refer to was specifically written by me
> (https://reviews.freebsd.org/D10112), and it's entirely to make it easier
> for me to check and quantify to others where we're actually regressing or
> improving as I continue fixing things in bsdgrep(1).

In this case I'd rather we remove the 00 and have the test verify
that. I think it's fine if there are a few tests that fail when run
with GNU grep where it has the undesired, differing behaviour.
___
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: r316490 - head/sys/netipsec

2017-04-04 Thread Andrey V. Elsukov
Author: ae
Date: Tue Apr  4 13:41:50 2017
New Revision: 316490
URL: https://svnweb.freebsd.org/changeset/base/316490

Log:
  When we are doing SA lookup for TCP-MD5, check both source and
  destination addresses. Previous code has used only destination address
  for lookup. But for inbound packets the source address was used as SA
  destination address. Thus only outbound SA were used for both directions.
  Now we use addresses from a packet as is, thus SAs for both directions are
  needed.
  
  Reported by:  Mike Tancsa
  MFC after:1 week

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==
--- head/sys/netipsec/key.c Tue Apr  4 13:34:19 2017(r316489)
+++ head/sys/netipsec/key.c Tue Apr  4 13:41:50 2017(r316490)
@@ -863,7 +863,8 @@ key_allocsa_tcpmd5(struct secasindex *sa
kdebug_secash(sah, "  "));
if (sah->saidx.proto != IPPROTO_TCP)
continue;
-   if (!key_sockaddrcmp(>dst.sa, >saidx.dst.sa, 0))
+   if (!key_sockaddrcmp(>dst.sa, >saidx.dst.sa, 0) &&
+   !key_sockaddrcmp(>src.sa, >saidx.src.sa, 0))
break;
}
if (sah != NULL) {
@@ -4962,7 +4963,8 @@ key_getsav_tcpmd5(struct secasindex *sai
LIST_FOREACH(sah, SAHADDRHASH_HASH(saidx), addrhash) {
if (sah->saidx.proto != IPPROTO_TCP)
continue;
-   if (!key_sockaddrcmp(>dst.sa, >saidx.dst.sa, 0))
+   if (!key_sockaddrcmp(>dst.sa, >saidx.dst.sa, 0) &&
+   !key_sockaddrcmp(>src.sa, >saidx.src.sa, 0))
break;
}
if (sah != 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"


Re: svn commit: r316477 - head/usr.bin/grep

2017-04-04 Thread Kyle Evans
On Tue, Apr 4, 2017 at 8:19 AM, Andrey Chernov  wrote:

> On 04.04.2017 16:09, Kyle Evans wrote:
> >
> > First, apologies, I must rewind: what did you  mean initially by "We
> > don't need to handle internally [...]"
> >  -- the second half I understand, but it occurs to me that we should
> > already be internally handling \33[m = \33[00m as defined by ANSI.
>
> Of course we must handle (and already handle) both according to ANSI,
> but few CPU cycles here, then in another place, yet another, etc. making
> big time in sum when CPU does nothing useful but resource eating.


I'm omitting a response to this due to the previously mentioned "letting
others weigh in," but I do see where you're coming from. =)

I see another problem, but it sounds a bit artificially. What if someone
> decides to parse grep-colored output and assumes gnu grep only (which is
> usual in Linux). I can't determine probability of such situation.
> Usually people use generic ANSI parser which understand both cases (f.e.
> to convert it to HTML).


I agree that this sounds like an artificially conceived situation. On the
other hand, we've seen a lot of people make *a lot* of bad assumptions
biased towards Linux over in ports. I would hope that the probability of
one relying on this exact output to be really really really really close to
0%.

Upon further review, newer versions of GNU grep(1) drop the explicit '00'
and add the \33[K dropped in this commit a few lines above the mentioned
one. In that case, we might as well revert those two lines and consider
this an improvement. I guess it depends on the overall outlook of the
tests, though -- should we introduce more tests that fail by default as
they go in, or adapt similar (not strictly buggy, but not ideal) behavior
to start with and then improve after we can grant bsdgrep(1) replacement
status?
___
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: r316489 - head/usr.bin/grep

2017-04-04 Thread Ed Maste
Author: emaste
Date: Tue Apr  4 13:34:19 2017
New Revision: 316489
URL: https://svnweb.freebsd.org/changeset/base/316489

Log:
  bsdgrep: Initialize vars to avoid a false positive GCC warning
  
  Reported by:  lwhsu
  MFC after:1 month
  MFC with: r316477

Modified:
  head/usr.bin/grep/util.c

Modified: head/usr.bin/grep/util.c
==
--- head/usr.bin/grep/util.cTue Apr  4 13:18:56 2017(r316488)
+++ head/usr.bin/grep/util.cTue Apr  4 13:34:19 2017(r316489)
@@ -282,6 +282,9 @@ procline(struct str *l, int nottext)
int c = 0, m = 0, r = 0, lastmatches = 0, leflags = eflags;
int startm = 0;
 
+   /* Initialize to avoid a false positive warning from GCC. */
+   lastmatch.rm_so = lastmatch.rm_eo = 0;
+
/* Loop to process the whole line */
while (st <= l->len) {
lastmatches = 0;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r316477 - head/usr.bin/grep

2017-04-04 Thread Andrey Chernov
On 04.04.2017 16:05, Bruce Evans wrote:
> This might be to work around a bug in a terminal driver.  I needed the
> 0 (but just one) to reset the attributes in my attribute tests, on at
> least 1 of the tested terminals (current sc, current vt, old sc, old
> xterm, old cygwin xterm).  CSI m seems to be working for sc now, and the
> teken code looks OK.

I never meet such one. Even most earlier specs tells about CSI m and it
works in sc from its first day. You can check how often CSI m used by
inspecting /etc/termcap changes, there is no 00 too.

___
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: r316485 - in head: share/man/man4 sys/conf sys/dev/qlnx sys/dev/qlnx/qlnxe sys/modules sys/modules/qlnx sys/modules/qlnx/qlnxe

2017-04-04 Thread Fabian Keil
David C Somayajulu  wrote:

> Author: davidcs
> Date: Tue Apr  4 06:16:59 2017
> New Revision: 316485
> URL: https://svnweb.freebsd.org/changeset/base/316485
> 
> Log:
>   Add 25/40/100Gigabit Ethernet Driver version v1.3.0 for Cavium Inc's.
>   Qlogic 45000 Series Adapters
>   
>   MFC after:2 weeks

Looks like this driver contains source-less microcode and should thus
honour WITHOUT_SOURCELESS_UCODE.

As pointed out previously, qlxbge has the same issue:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204749

Some of the copyright headers imply that parts of this driver
were written in the future (2018) which seems unlikely ...

Fabian


pgpgf9x18J6RB.pgp
Description: OpenPGP digital signature


svn commit: r316488 - head/share/man/man4

2017-04-04 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Tue Apr  4 13:18:56 2017
New Revision: 316488
URL: https://svnweb.freebsd.org/changeset/base/316488

Log:
  Replace an with a
  Reword caveat on PCI 2.2 requirement.
  
  PR:   218070
  Submitted by: 
  Approved by:  bcr
  MFC after:5 days
  Differential Revision: https://reviews.freebsd.org/D10262

Modified:
  head/share/man/man4/ral.4

Modified: head/share/man/man4/ral.4
==
--- head/share/man/man4/ral.4   Tue Apr  4 11:43:31 2017(r316487)
+++ head/share/man/man4/ral.4   Tue Apr  4 13:18:56 2017(r316488)
@@ -14,7 +14,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 4, 2015
+.Dd April 4, 2017
 .Dt RAL 4
 .Os
 .Sh NAME
@@ -45,7 +45,7 @@ driver supports PCI/PCIe/CardBus wireles
 RT2501, RT2600, RT2700, RT2800, RT3090 and RT3900E chipsets.
 .Pp
 The RT2500 chipset is the first generation of 802.11b/g adapters from Ralink.
-It consists of two integrated chips, an RT2560 MAC/BBP and an RT2525 radio
+It consists of two integrated chips, a RT2560 MAC/BBP and a RT2525 radio
 transceiver.
 .Pp
 The RT2501 chipset is the second generation of 802.11a/b/g adapters from
@@ -292,13 +292,13 @@ driver does not support any of the 802.1
 the RT2700 and RT2800 chipsets.
 Additional work is required in before those features can be supported.
 .Pp
-Host AP mode doesn't support power saving.
+Host AP mode does not support power saving.
 Clients attempting to use power saving mode may experience significant
 packet loss (disabling power saving on the client will fix this).
 .Pp
 Some PCI
 .Nm
-adapters seem to strictly require a system supporting PCI 2.2 or greater and
-will likely not work in systems based on older revisions of the PCI
+adapters strictly require a system supporting PCI 2.2 or greater.
+Check the board's PCI version before purchasing the card as it is likely these
+adapters will not work in systems based on older revisions of the PCI
 specification.
-Check the board's PCI version before purchasing the card.
___
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: r316477 - head/usr.bin/grep

2017-04-04 Thread Andrey Chernov
On 04.04.2017 16:09, Kyle Evans wrote:
> 
> First, apologies, I must rewind: what did you  mean initially by "We
> don't need to handle internally [...]"
>  -- the second half I understand, but it occurs to me that we should
> already be internally handling \33[m = \33[00m as defined by ANSI.

Of course we must handle (and already handle) both according to ANSI,
but few CPU cycles here, then in another place, yet another, etc. making
big time in sum when CPU does nothing useful but resource eating.

> On Tue, Apr 4, 2017 at 7:37 AM, Andrey Chernov  > wrote:
> 
> IMHO everyday usage by everyone weights much more than occasional
> regression tests run which can be fixed instead of this place. F.e. we
> already do a lot of local fixes in the NetBSD regression tests instead
> of pretending to mimic NetBSD in 100% in the system itself.
> 
> 
> This is where it gets kind of finnicky, and I'll step out and let others
> weigh in -- the test I refer to was specifically written by me
> (https://reviews.freebsd.org/D10112), and it's entirely to make it
> easier for me to check and quantify to others where we're actually
> regressing or improving as I continue fixing things in bsdgrep(1). This
> is easier to do so when we don't have trivial failures due to minor
> formatting differences when they should ultimately be interpreted
> equivalently either way, such as in this case. I expect to be find other
> quirky bugs in gnugrep(1) while reviewing the remaining PRs in Bugzilla,
> and thus expect this to be more important in the months to come.

I see another problem, but it sounds a bit artificially. What if someone
decides to parse grep-colored output and assumes gnu grep only (which is
usual in Linux). I can't determine probability of such situation.
Usually people use generic ANSI parser which understand both cases (f.e.
to convert it to HTML).

___
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: r316477 - head/usr.bin/grep

2017-04-04 Thread Kyle Evans
First, apologies, I must rewind: what did you  mean initially by "We don't
need to handle internally [...]"
 -- the second half I understand, but it occurs to me that we should
already be internally handling \33[m = \33[00m as defined by ANSI.

On Tue, Apr 4, 2017 at 7:37 AM, Andrey Chernov  wrote:
>
> IMHO everyday usage by everyone weights much more than occasional
> regression tests run which can be fixed instead of this place. F.e. we
> already do a lot of local fixes in the NetBSD regression tests instead
> of pretending to mimic NetBSD in 100% in the system itself.


This is where it gets kind of finnicky, and I'll step out and let others
weigh in -- the test I refer to was specifically written by me (
https://reviews.freebsd.org/D10112), and it's entirely to make it easier
for me to check and quantify to others where we're actually regressing or
improving as I continue fixing things in bsdgrep(1). This is easier to do
so when we don't have trivial failures due to minor formatting differences
when they should ultimately be interpreted equivalently either way, such as
in this case. I expect to be find other quirky bugs in gnugrep(1) while
reviewing the remaining PRs in Bugzilla, and thus expect this to be more
important in the months to come.
___
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: r316477 - head/usr.bin/grep

2017-04-04 Thread Bruce Evans

On Tue, 4 Apr 2017, Andrey Chernov wrote:


On 04.04.2017 2:16, Ed Maste wrote:

if (color)
-   fprintf(stdout, "\33[m\33[K");
+   fprintf(stdout, "\33[00m\33[K");


Please back that one out. We don't need to handle internally or print
remotely excessive 00.
At least according to
https://en.wikipedia.org/wiki/ANSI_escape_code
"With no parameters, CSI m is treated as CSI 0 m (reset / normal), which
is typical of most of the ANSI escape sequences."


This might be to work around a bug in a terminal driver.  I needed the
0 (but just one) to reset the attributes in my attribute tests, on at
least 1 of the tested terminals (current sc, current vt, old sc, old
xterm, old cygwin xterm).  CSI m seems to be working for sc now, and the
teken code looks OK.

I first thought that this was a misplaced 0 for \033.  2 digits for
octal looks strange.  I would use hex in C anyway.  In my user attribute
tests, I have to use printf(1), and noticed that printf(1) is missing too
many features in printf(3), or worse, is incompatible, especially for hex
escape sequences and %c format.

Bruce
___
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: r316477 - head/usr.bin/grep

2017-04-04 Thread Andrey Chernov
On 04.04.2017 15:24, Kyle Evans wrote:
> On Tue, Apr 4, 2017 at 7:07 AM, Andrey Chernov  > wrote:
> 
> On 04.04.2017 2:16, Ed Maste wrote:
> >   if (color)
> > - fprintf(stdout, "\33[m\33[K");
> > + fprintf(stdout, "\33[00m\33[K");
> 
> Please back that one out. We don't need to handle internally or print
> remotely excessive 00.
> At least according to
> https://en.wikipedia.org/wiki/ANSI_escape_code
> 
> "With no parameters, CSI m is treated as CSI 0 m (reset / normal), which
> is typical of most of the ANSI escape sequences."
> 
> 
> Hi ache@,
> 
> This specific change was made in the name of explicitly matching colored
> output of GNU grep for simplification of regression test purposes,
> rather than for good form. Is it still unacceptable to do so?

IMHO everyday usage by everyone weights much more than occasional
regression tests run which can be fixed instead of this place. F.e. we
already do a lot of local fixes in the NetBSD regression tests instead
of pretending to mimic NetBSD in 100% in the system itself.

___
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: r316477 - head/usr.bin/grep

2017-04-04 Thread Kyle Evans
On Tue, Apr 4, 2017 at 7:07 AM, Andrey Chernov  wrote:

> On 04.04.2017 2:16, Ed Maste wrote:
> >   if (color)
> > - fprintf(stdout, "\33[m\33[K");
> > + fprintf(stdout, "\33[00m\33[K");
>
> Please back that one out. We don't need to handle internally or print
> remotely excessive 00.
> At least according to
> https://en.wikipedia.org/wiki/ANSI_escape_code
> "With no parameters, CSI m is treated as CSI 0 m (reset / normal), which
> is typical of most of the ANSI escape sequences."


Hi ache@,

This specific change was made in the name of explicitly matching colored
output of GNU grep for simplification of regression test purposes, rather
than for good form. Is it still unacceptable to do so?

Thanks,

Kyle Evans
___
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: r316477 - head/usr.bin/grep

2017-04-04 Thread Andrey Chernov
On 04.04.2017 2:16, Ed Maste wrote:
>   if (color) 
> - fprintf(stdout, "\33[m\33[K");
> + fprintf(stdout, "\33[00m\33[K");

Please back that one out. We don't need to handle internally or print
remotely excessive 00.
At least according to
https://en.wikipedia.org/wiki/ANSI_escape_code
"With no parameters, CSI m is treated as CSI 0 m (reset / normal), which
is typical of most of the ANSI escape sequences."

___
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: r316487 - head/etc

2017-04-04 Thread Dag-Erling Smørgrav
Author: des
Date: Tue Apr  4 11:43:31 2017
New Revision: 316487
URL: https://svnweb.freebsd.org/changeset/base/316487

Log:
  Allow command modifiers (fast, quiet etc.) to be stacked in any order.
  Add a "debug" modifier that sets rc_debug.
  
  MFC after:3 weeks

Modified:
  head/etc/rc.subr

Modified: head/etc/rc.subr
==
--- head/etc/rc.subrTue Apr  4 08:17:03 2017(r316486)
+++ head/etc/rc.subrTue Apr  4 11:43:31 2017(r316487)
@@ -703,10 +703,11 @@ check_startmsgs()
 #  If argument has a given prefix, then change the operation as follows:
 #  Prefix  Operation
 #  --  -
-#  fastSkip the pid check, and set rc_fast=yes, rc_quiet=yes
-#  force   Set ${rcvar} to YES, and set rc_force=yes
-#  one Set ${rcvar} to YES
-#  quiet   Don't output some diagnostics, and set rc_quiet=yes
+#  debug   Enable debugging messages and set rc_debug to yes
+#  fastSkip the pid check and set rc_fast and rc_quiet to yes
+#  force   Skip sanity checks and set ${rcvar} and rc_force to yes
+#  one Set ${rcvar} and set rc_one to yes
+#  quiet   Don't output some diagnostics, and set rc_quiet to yes
 #
 #  The following globals are used:
 #
@@ -856,6 +857,8 @@ check_startmsgs()
 #  rc_arg  Argument to command, after fast/force/one processing
 #  performed
 #
+#  rc_debugTrue if "debug" was provided
+#
 #  rc_flagsFlags to start the default command with.
 #  Defaults to ${name}_flags, unless overridden
 #  by $flags from the environment.
@@ -863,9 +866,11 @@ check_startmsgs()
 #
 #  rc_pid  PID of command (if appropriate)
 #
-#  rc_fast Not empty if "fast" was provided (q.v.)
+#  rc_fast Not empty if "fast" was provided
+#
+#  rc_forceNot empty if "force" was provided
 #
-#  rc_forceNot empty if "force" was provided (q.v.)
+#  rc_one  Not empty if "one" was provided
 #
 #  rc_quietNot empty if "quiet" was provided
 #
@@ -884,34 +889,47 @@ run_rc_command()
shift 1
rc_extra_args="$*"
 
-   _rc_prefix=
-   case "$rc_arg" in
-   fast*)  # "fast" prefix; don't check pid
-   rc_arg=${rc_arg#fast}
-   rc_fast=yes
-   rc_quiet=yes
-   ;;
-   force*) # "force" prefix; always run
-   rc_force=yes
-   _rc_prefix=force
-   rc_arg=${rc_arg#${_rc_prefix}}
-   if [ -n "${rcvar}" ]; then
-   eval ${rcvar}=YES
-   fi
-   ;;
-   one*)   # "one" prefix; set ${rcvar}=yes
-   _rc_prefix=one
-   rc_arg=${rc_arg#${_rc_prefix}}
+   : ${rc_debug:=no} ${rc_fast:=no} ${rc_force:=no} ${rc_one:=no} 
${rc_quiet:=no}
+   while :; do
+   case "$rc_arg" in
+   debug*) # "debug" prefix; enable debugging
+   rc_debug=yes
+   rc_quiet=no
+   rc_arg=${rc_arg#debug}
+   _rc_prefix="${_rc_prefix}debug"
+   ;;
+   fast*)  # "fast" prefix; don't check pid
+   rc_fast=yes
+   rc_quiet=yes
+   rc_arg=${rc_arg#fast}
+   _rc_prefix="${_rc_prefix}fast"
+   ;;
+   force*) # "force" prefix; always run
+   rc_force=yes
+   rc_arg=${rc_arg#force}
+   _rc_prefix="${_rc_prefix}force"
+   ;;
+   one*)   # "one" prefix; set ${rcvar}=yes
+   rc_one=yes
+   rc_arg=${rc_arg#one}
+   _rc_prefix="${_rc_prefix}one"
+   ;;
+   quiet*) # "quiet" prefix; omit some messages
+   rc_quiet=yes
+   rc_arg=${rc_arg#quiet}
+   _rc_prefix="${_rc_prefix}quiet"
+   ;;
+   *)
+   break
+   ;;
+   esac
+   done
+   if checkyesno rc_force || checkyesno rc_one ; then
if [ -n "${rcvar}" ]; then
eval ${rcvar}=YES
fi
-   ;;
-   quiet*) # "quiet" prefix; omit some messages
-   _rc_prefix=quiet
-   rc_arg=${rc_arg#${_rc_prefix}}
-   rc_quiet=yes
-   ;;
-   esac
+   fi
+   debug 

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

2017-04-04 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Apr  4 08:17:03 2017
New Revision: 316486
URL: https://svnweb.freebsd.org/changeset/base/316486

Log:
  Remove dead code/ifdef.
  
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL

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

Modified: head/sys/mips/mips/trap.c
==
--- head/sys/mips/mips/trap.c   Tue Apr  4 06:16:59 2017(r316485)
+++ head/sys/mips/mips/trap.c   Tue Apr  4 08:17:03 2017(r316486)
@@ -1334,13 +1334,8 @@ log_frame_dump(struct trapframe *frame)
log(LOG_ERR, "\tsr: %#jx\tmullo: %#jx\tmulhi: %#jx\tbadvaddr: %#jx\n",
(intmax_t)frame->sr, (intmax_t)frame->mullo, 
(intmax_t)frame->mulhi, (intmax_t)frame->badvaddr);
 
-#ifdef IC_REG
-   log(LOG_ERR, "\tcause: %#jx\tpc: %#jx\tic: %#jx\n",
-   (intmax_t)frame->cause, (intmax_t)frame->pc, (intmax_t)frame->ic);
-#else
log(LOG_ERR, "\tcause: %#jx\tpc: %#jx\n",
(intmax_t)frame->cause, (intmax_t)frame->pc);
-#endif
 }
 
 #ifdef TRAP_DEBUG
@@ -1381,13 +1376,8 @@ trap_frame_dump(struct trapframe *frame)
printf("\tsr: %#jx\tmullo: %#jx\tmulhi: %#jx\tbadvaddr: %#jx\n",
(intmax_t)frame->sr, (intmax_t)frame->mullo, 
(intmax_t)frame->mulhi, (intmax_t)frame->badvaddr);
 
-#ifdef IC_REG
-   printf("\tcause: %#jx\tpc: %#jx\tic: %#jx\n",
-   (intmax_t)frame->cause, (intmax_t)frame->pc, (intmax_t)frame->ic);
-#else
printf("\tcause: %#jx\tpc: %#jx\n",
(intmax_t)frame->cause, (intmax_t)frame->pc);
-#endif
 }
 
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r316485 - in head: share/man/man4 sys/conf sys/dev/qlnx sys/dev/qlnx/qlnxe sys/modules sys/modules/qlnx sys/modules/qlnx/qlnxe

2017-04-04 Thread David C Somayajulu
Author: davidcs
Date: Tue Apr  4 06:16:59 2017
New Revision: 316485
URL: https://svnweb.freebsd.org/changeset/base/316485

Log:
  Add 25/40/100Gigabit Ethernet Driver version v1.3.0 for Cavium Inc's.
  Qlogic 45000 Series Adapters
  
  MFC after:2 weeks

Added:
  head/share/man/man4/qlnxe.4   (contents, props changed)
  head/sys/dev/qlnx/
  head/sys/dev/qlnx/qlnxe/
  head/sys/dev/qlnx/qlnxe/bcm_osal.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/common_hsi.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_chain.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_cxt.c   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_cxt.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_cxt_api.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_dbg_values.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_dcbx.c   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_dcbx.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_dcbx_api.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_dev.c   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_dev_api.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_fcoe.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_fcoe_api.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_gtt_reg_addr.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_gtt_values.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hsi_common.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hsi_debug_tools.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hsi_eth.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hsi_fcoe.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hsi_init_func.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hsi_init_tool.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hsi_iscsi.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hsi_iwarp.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hsi_rdma.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hsi_roce.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hw.c   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hw.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_hw_defs.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.c   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_init_ops.c   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_init_ops.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_init_values.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_int.c   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_int.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_int_api.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_iov_api.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_iro.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_iro_values.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_iscsi.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_iscsi_api.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_l2.c   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_l2.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_l2_api.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_ll2.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_ll2_api.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_mcp.c   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_mcp.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_mcp_api.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_ooo.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_proto_if.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_roce.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_roce_api.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_rt_defs.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_sp_api.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_sp_commands.c   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_sp_commands.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_spq.c   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_spq.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_sriov.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_status.h   (contents, props changed)
  head/sys/dev/qlnx/qlnxe/ecore_utils.h   (contents, props changed)