svn commit: r330312 - stable/11/release/doc/share/xml

2018-03-03 Thread Xin LI
Author: delphij
Date: Sat Mar  3 08:45:56 2018
New Revision: 330312
URL: https://svnweb.freebsd.org/changeset/base/330312

Log:
  Document SA-17:12 and correct EN-17:09 link [1]
  
  Reported by:  eadler [1]

Modified:
  stable/11/release/doc/share/xml/errata.xml
  stable/11/release/doc/share/xml/security.xml

Modified: stable/11/release/doc/share/xml/errata.xml
==
--- stable/11/release/doc/share/xml/errata.xml  Sat Mar  3 06:37:53 2018
(r330311)
+++ stable/11/release/doc/share/xml/errata.xml  Sat Mar  3 08:45:56 2018
(r330312)
@@ -36,7 +36,7 @@
 
   
FreeBSD-EN-17:10.tzdata
+   
xlink:href="&security.url;/FreeBSD-EN-17:09.tzdata.asc">FreeBSD-EN-17:09.tzdata
2 November 2017
Timezone database information
update

Modified: stable/11/release/doc/share/xml/security.xml
==
--- stable/11/release/doc/share/xml/security.xmlSat Mar  3 06:37:53 
2018(r330311)
+++ stable/11/release/doc/share/xml/security.xmlSat Mar  3 08:45:56 
2018(r330312)
@@ -53,6 +53,13 @@
29 November 2017
Multiple vulnerabilities
   
+
+  
+   FreeBSD-SA-17:12.openssl
+   09 December 2017
+   Multiple vulnerabilities
+  
 
   
 
___
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: r309017 - in head/sys: cddl/compat/opensolaris/sys compat/linprocfs fs/tmpfs sys vm

2018-03-03 Thread Alexey Dokuchaev
On Tue, Nov 22, 2016 at 06:13:46PM +, Alan Cox wrote:
> New Revision: 309017
> URL: https://svnweb.freebsd.org/changeset/base/309017
> 
> Log:
>   Remove PG_CACHED-related fields from struct vmmeter, because they are no
>   longer used.  More precisely, they are always zero because the code that
>   decremented and incremented them no longer exists.
>   
>   Bump __FreeBSD_version to mark this change.
>   
>   Reviewed by:kib, markj
>   Sponsored by:   Dell EMC Isilon
>   Differential Revision:  https://reviews.freebsd.org/D8583
> 
> Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h
> ...
> -#define  freemem (vm_cnt.v_free_count + 
> vm_cnt.v_cache_count)
> +#define  freemem vm_cnt.v_free_count

This looks correct now.

> Modified: head/sys/compat/linprocfs/linprocfs.c
> ...
> @@ -176,7 +176,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS)
>* like unstaticizing it just for linprocfs's sake.
>*/
>   buffers = 0;
> - cached = vm_cnt.v_cache_count * PAGE_SIZE;
> + cached = vm_cnt.v_inactive_count * PAGE_SIZE;

Some applications that make calculations based on the readings from the
/usr/compat/linux/proc/meminfo are broken after this change, e.g. those
that do things like:

return (totalMem - (freeMem + buffers + cache)) / totalMem;

because now free memory includes cached one, and above formula gives
bogus negative result.

In `sys/compat/linprocfs/linprocfs.c', memfree is calculated as follows:

memtotal = physmem * PAGE_SIZE;
/*
 * The correct thing here would be:
 *
memfree = vm_cnt.v_free_count * PAGE_SIZE;
memused = memtotal - memfree;
 *
 * but it might mislead linux binaries into thinking there
 * is very little memory left, so we cheat and tell them that
 * all memory that isn't wired down is free.
 */
memused = vm_cnt.v_wire_count * PAGE_SIZE;
memfree = memtotal - memused;

So, when vm.stats.vm.v_cache_count was yielding some (typically small)
result, using the aforementioned trick made sense (because even when
vm_cnt.v_free_count added to vm.stats.vm.v_cache_count it would still
be rather small).  This logic no longer applies after this change.

On my 12-CURRENT i386 system, /usr/compat/linux/proc/meminfo reports:

% cat /usr/compat/linux/proc/meminfo | head -4
MemTotal:   3132504 kB
MemFree:2925936 kB  <<< that's a lot
Buffers:  0 kB
Cached: 2212196 kB  <<< that's also a lot

On an older 4.11-STABLE box (also i386), it reports:

MemTotal:521828 kB
MemFree: 383976 kB
MemShared: 7480 kB
Buffers:  0 kB
Cached:   22732 kB (can be added to MemFree and still < MemTotal)

So either the "cheat" have to go away and vm_cnt.v_free_count used as it
should, or cached memory should not be read from vm_cnt.v_inactive_count
but estimated somehow else.  Which approach would be more correct?

./danfe
___
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: r330313 - stable/10/release/doc/share/xml

2018-03-03 Thread Xin LI
Author: delphij
Date: Sat Mar  3 08:52:02 2018
New Revision: 330313
URL: https://svnweb.freebsd.org/changeset/base/330313

Log:
  Document SA-17:12 and correct EN-17:09 link [1]
  
  Reported by:  eadler [1]

Modified:
  stable/10/release/doc/share/xml/errata.xml
  stable/10/release/doc/share/xml/security.xml

Modified: stable/10/release/doc/share/xml/errata.xml
==
--- stable/10/release/doc/share/xml/errata.xml  Sat Mar  3 08:45:56 2018
(r330312)
+++ stable/10/release/doc/share/xml/errata.xml  Sat Mar  3 08:52:02 2018
(r330313)
@@ -20,7 +20,7 @@
 
   
FreeBSD-EN-17:10.tzdata
+   
xlink:href="&security.url;/FreeBSD-EN-17:09.tzdata.asc">FreeBSD-EN-17:09.tzdata
2 November 2017
Timezone database information
update

Modified: stable/10/release/doc/share/xml/security.xml
==
--- stable/10/release/doc/share/xml/security.xmlSat Mar  3 08:45:56 
2018(r330312)
+++ stable/10/release/doc/share/xml/security.xmlSat Mar  3 08:52:02 
2018(r330313)
@@ -61,6 +61,13 @@
29 November 2017
Multiple vulnerabilities
   
+
+  
+   FreeBSD-SA-17:12.openssl
+   09 December 2017
+   Multiple vulnerabilities
+  
 
   
 
___
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: r330314 - stable/11/usr.bin/units

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 09:59:04 2018
New Revision: 330314
URL: https://svnweb.freebsd.org/changeset/base/330314

Log:
  MFC r322424:
  
  Correct the -H longopt equivillant
  
  PR:   209876

Modified:
  stable/11/usr.bin/units/units.1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/units/units.1
==
--- stable/11/usr.bin/units/units.1 Sat Mar  3 08:52:02 2018
(r330313)
+++ stable/11/usr.bin/units/units.1 Sat Mar  3 09:59:04 2018
(r330314)
@@ -1,5 +1,5 @@
 .\" $FreeBSD$
-.Dd July 4, 2014
+.Dd August 12, 2017
 .Dt UNITS 1
 .Os
 .Sh NAME
@@ -18,7 +18,7 @@ The following options are available:
 Show an overview of options
 .It Fl f Ar filename \&No , Fl -file Ar filename
 Specify the name of the units data file to load.
-.It Fl H Ar filename \&No , Fl -historyfile Ar filename
+.It Fl H Ar filename \&No , Fl -history Ar filename
 Ignored, for compatibility with GNU units.
 .It Fl e , Fl -exponential
 Behave as if -o '%6e' was typed.
___
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: r330315 - in stable/11/usr.bin: calendar calendar/calendars/pt_BR.UTF-8 fortune/datfiles mkcsmapper unifdef units

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:01:12 2018
New Revision: 330315
URL: https://svnweb.freebsd.org/changeset/base/330315

Log:
  MFC r325095:
  
  Update URLs in usr.bin
  
  - http -> https
  - contents have moved locations
  - removal of URL if I could not find new location

Modified:
  stable/11/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative
  stable/11/usr.bin/calendar/sunpos.c
  stable/11/usr.bin/fortune/datfiles/fortunes
  stable/11/usr.bin/mkcsmapper/mkcsmapper.1
  stable/11/usr.bin/unifdef/unifdef.1
  stable/11/usr.bin/unifdef/unifdef.c
  stable/11/usr.bin/units/definitions.units
Directory Properties:
  stable/11/   (props changed)

Modified: 
stable/11/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative
==
--- stable/11/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative 
Sat Mar  3 09:59:04 2018(r330314)
+++ stable/11/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative 
Sat Mar  3 10:01:12 2018(r330315)
@@ -4,8 +4,6 @@
  * Originally submitted by Renato Tambellini 
  *
  * Brazilian commemorative days
- *
- * http://www.ibge.gov.br/ibgeteen/datas/home.html
  */
 
 #ifndef _pt_BR_UTF_8_commemorative_

Modified: stable/11/usr.bin/calendar/sunpos.c
==
--- stable/11/usr.bin/calendar/sunpos.c Sat Mar  3 09:59:04 2018
(r330314)
+++ stable/11/usr.bin/calendar/sunpos.c Sat Mar  3 10:01:12 2018
(r330315)
@@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$");
 /*
  * This code is created to match the formulas available at:
  * Formula and examples obtained from "How to Calculate alt/az: SAAO" at
- * 
http://www.saao.ac.za/public-info/sun-moon-stars/sun-index/how-to-calculate-altaz/
+ * 
http://old.saao.ac.za/public-info/sun-moon-stars/sun-index/how-to-calculate-altaz/
  */
 
 #include 

Modified: stable/11/usr.bin/fortune/datfiles/fortunes
==
--- stable/11/usr.bin/fortune/datfiles/fortunes Sat Mar  3 09:59:04 2018
(r330314)
+++ stable/11/usr.bin/fortune/datfiles/fortunes Sat Mar  3 10:01:12 2018
(r330315)
@@ -46260,7 +46260,7 @@ error:
 The operation completed successfully.
 
 For more information, see Help and Support Center at
-http://go.microsoft.com/fwlink/events.asp.
+https://go.microsoft.com/fwlink/events.asp.
 %
 The minute a man is convinced that he is interesting, he isn't.
 %

Modified: stable/11/usr.bin/mkcsmapper/mkcsmapper.1
==
--- stable/11/usr.bin/mkcsmapper/mkcsmapper.1   Sat Mar  3 09:59:04 2018
(r330314)
+++ stable/11/usr.bin/mkcsmapper/mkcsmapper.1   Sat Mar  3 10:01:12 2018
(r330315)
@@ -29,8 +29,8 @@
 .\" Electrical and Electronics Engineers, Inc and The Open Group.  In the
 .\" event of any discrepancy between this version and the original IEEE and
 .\" The Open Group Standard, the original IEEE and The Open Group Standard is
-.\" the referee document.  The original Standard can be obtained online at
-.\" http://www.opengroup.org/unix/online.html.
+.\" the referee document.  The original Standard can be obtained at
+.\" http://www.opengroup.org/standards/unix.
 .\"
 .\" $FreeBSD$
 .\"

Modified: stable/11/usr.bin/unifdef/unifdef.1
==
--- stable/11/usr.bin/unifdef/unifdef.1 Sat Mar  3 09:59:04 2018
(r330314)
+++ stable/11/usr.bin/unifdef/unifdef.1 Sat Mar  3 10:01:12 2018
(r330315)
@@ -477,7 +477,7 @@ Unterminated char or string literal
 .Xr diff 1
 .Pp
 The unifdef home page is
-.Pa http://dotat.at/prog/unifdef
+.Pa https://dotat.at/prog/unifdef
 .Sh HISTORY
 The
 .Nm

Modified: stable/11/usr.bin/unifdef/unifdef.c
==
--- stable/11/usr.bin/unifdef/unifdef.c Sat Mar  3 09:59:04 2018
(r330314)
+++ stable/11/usr.bin/unifdef/unifdef.c Sat Mar  3 10:01:12 2018
(r330315)
@@ -49,7 +49,7 @@ static const char copyright[] =
 "@(#) $Version: unifdef-2.11 $\n"
 "@(#) $FreeBSD$\n"
 "@(#) $Author: Tony Finch (d...@dotat.at) $\n"
-"@(#) $URL: http://dotat.at/prog/unifdef $\n"
+"@(#) $URL: https://dotat.at/prog/unifdef $\n"
 ;
 
 /* types of input lines: */

Modified: stable/11/usr.bin/units/definitions.units
==
--- stable/11/usr.bin/units/definitions.units   Sat Mar  3 09:59:04 2018
(r330314)
+++ stable/11/usr.bin/units/definitions.units   Sat Mar  3 10:01:12 2018
(r330315)
@@ -332,7 +332,7 @@ lumen   cd sr
 luxcd sr/m2
 
 # EMU currencies have constant exchange rate against Euro since 1.1.1999.
-# See http://en.wikipedia.org/wiki/Euro for details.
+# See https://

svn commit: r330316 - stable/11/etc

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:15:37 2018
New Revision: 330316
URL: https://svnweb.freebsd.org/changeset/base/330316

Log:
  MFC r313276:
  
  Use kldload -n when loading if_deqna
  
  This fixes if_deqna from being loaded by accident twice if it's already loaded
  in the kernel.

Modified:
  stable/11/etc/devd.conf
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/devd.conf
==
--- stable/11/etc/devd.conf Sat Mar  3 10:01:12 2018(r330315)
+++ stable/11/etc/devd.conf Sat Mar  3 10:15:37 2018(r330316)
@@ -272,7 +272,7 @@ nomatch 10 {
match "bus" "pccard[0-9]+";
match "manufacturer" "0x1234";
match "product" "0x2323";
-   action "kldload if_deqna";
+   action "kldload -n if_deqna";
 };
 attach 10 {
device-name "deqna[0-9]+";
___
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: r330317 - stable/11/usr.bin/dc

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:18:32 2018
New Revision: 330317
URL: https://svnweb.freebsd.org/changeset/base/330317

Log:
  MFC r314409:
  
  dc(1): Introduce e command, equivalent to p, but writes to stderr
  
  Obtained from:OpenBSD
  MFC after:2 weeks

Modified:
  stable/11/usr.bin/dc/bcode.c
  stable/11/usr.bin/dc/dc.1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/dc/bcode.c
==
--- stable/11/usr.bin/dc/bcode.cSat Mar  3 10:15:37 2018
(r330316)
+++ stable/11/usr.bin/dc/bcode.cSat Mar  3 10:18:32 2018
(r330317)
@@ -69,6 +69,7 @@ static __inline struct number *pop_number(void);
 static __inline char   *pop_string(void);
 static __inline voidclear_stack(void);
 static __inline voidprint_tos(void);
+static void print_err(void);
 static void pop_print(void);
 static void pop_printn(void);
 static __inline voidprint_stack(void);
@@ -198,6 +199,7 @@ static const struct jump_entry jump_table_data[] = {
{ 'a',  to_ascii},
{ 'c',  clear_stack },
{ 'd',  dup },
+   { 'e',  print_err   },
{ 'f',  print_stack },
{ 'i',  set_ibase   },
{ 'k',  set_scale   },
@@ -502,6 +504,18 @@ print_tos(void)
if (value != NULL) {
print_value(stdout, value, "", bmachine.obase);
putchar('\n');
+   }
+   else
+   warnx("stack empty");
+}
+
+static void
+print_err(void)
+{
+   struct value *value = tos();
+   if (value != NULL) {
+   print_value(stderr, value, "", bmachine.obase);
+   (void)putc('\n', stderr);
}
else
warnx("stack empty");

Modified: stable/11/usr.bin/dc/dc.1
==
--- stable/11/usr.bin/dc/dc.1   Sat Mar  3 10:15:37 2018(r330316)
+++ stable/11/usr.bin/dc/dc.1   Sat Mar  3 10:18:32 2018(r330317)
@@ -35,7 +35,7 @@
 .\"
 .\"@(#)dc.18.1 (Berkeley) 6/6/93
 .\"
-.Dd April 16, 2014
+.Dd February 27, 2017
 .Dt DC 1
 .Os
 .Sh NAME
@@ -196,6 +196,10 @@ operator is a non-portable extension.
 All values on the stack are popped.
 .It Ic d
 The top value on the stack is duplicated.
+.It Ic e
+Equivalent to
+.Ic p ,
+except that the output is written to the standard error stream.
 .It Ic f
 All values on the stack are printed, separated by newlines.
 .It Ic G
___
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: r330285 - head/sys/sys

2018-03-03 Thread Konstantin Belousov
On Sat, Mar 03, 2018 at 01:47:41PM +1100, Bruce Evans wrote:
> On Fri, 2 Mar 2018, Konstantin Belousov wrote:
> 
> > On Fri, Mar 02, 2018 at 12:43:34PM -0500, Pedro Giffuni wrote:
> >> ...
> >> I think use of _Nonnull attributes in the threading functions may also
> >> be a waste (I introduced them mostly to be compatible with Android).
> >> FWIW, Dragonfly sprinkled some restrict there recently:
> >>
> >> http://gitweb.dragonflybsd.org/dragonfly.git/commit/d33005aaee6af52c80428b59b52aee522c002492
> >>
> >> Just in case someone is considering more cleanups.
> >
> > This is not a cleanup for me, but a needed change. Right now x86
> > copyouts are implemented in asm, so whatever damage is done to the
> > prototypes, only effect is at the caller side. In my work, i386 copyouts
> > are done in C, so it starts matter.
> 
> That seems slow, especially for small sizes as are common for syscall args
> (in 1 of my versions, copyin() of args is optimized to fuword() in a loop,
> and fuword() is optimized to not use pcb_onfault, so it is not much more
> than 1 memory access.  However, in your i386 version this optimization
> would be negative since the slow part is switching the map, so fuword()
> should never be used to access multiple words).
Yes. I already explained it in private, the current choice for i386 is
either to be neglected very fast, or to get this change to still be a
Tier 1 32 bit platform. The change is to make 4/4g split for UVA/KVA.
In particular, the change ensures that it is possible to self-host i386
for forthcoming years, which is not practical for armv7 now and would be
less so with clang grow.

In other news, my system already boots single-user on SMP machine and
I have torture tests like setting invalid %ss segment by sigreturn(2),
work.  There is (much) more to come, but I am happy how the patch
progressed so far.

> However, copyinstr() and
> copystr() should never have been "optimized" by writing them in asm.  On
> x86, their asm is badly written so they are slower than simple C versions
> except on 8088's and maybe 8086's and maybe on the original i386.  (8088's
> were limited mainly by instruction bandwidth and the original i386 wasn't
> much better, so short CISC instructions like lodsb and stosb tended to be
> faster than larger separate instructions despite their large setup overheads.
Sure, copyinstr() is rewritten in C.  The current version of copyout stuff
is there:
https://kib.kiev.ua/git/gitweb.cgi?p=deviant2.git;a=blob;f=sys/i386/i386/copyout.c;h=9747c06a84d7d2b5faac946f5de57f6a34d96c8c;hb=refs/heads/pcid

> 
> > Also I looked at the dragonfly commit because I become curious what do you
> > mean by threading functions.  The first example was
> > intpthread_attr_getguardsize(const pthread_attr_t * __restrict,
> > -   size_t *);
> > +   size_t * __restrict);
> > POSIX agrees with the dragonfly change, but I do not understand it.
> > Aliasing rules already disallow the first and second arguments to point
> > to the same memory, because they have different types.
> 
> (1) thread_attr_t is opaque, so the types might be the same.
> (2) pthread_attr_t might be a pointer to a struct/union containing a size_t.
> (3) perhaps other reasons.  I'm not sure how 'restrict interacts with global
>  variables or even it it prevents the interaction in (2).  A previous
>  discussion showed that const doesn't make types different enough to
>  prevent aliasing.  Similarly for volatile.
> 
> Similarly for other pointers to {opaque, struct/union, or even integer} types.
> size_t can't be aliased to int, but it can be aliased to any unsigned type
> in C and to any unsigned type not smaller than uint16_t in POSIX (POSIX
> but not C requires u_char == uint8_t, so size_t can't be u_char in POSIX
> but it can be u_char in C).

I can only summarize it as 'there is no use to have restrict on the
pthread_attr_getguardsize() arguments'.
___
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: r330318 - in stable/11/usr.sbin/bsdconfig: console share

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:27:33 2018
New Revision: 330318
URL: https://svnweb.freebsd.org/changeset/base/330318

Log:
  MFC r318891:
  
  Fix long standing issue in bsdconfig's keymap selection
  
  Since the translation to vt as terminal emulator, the keymaps files
  path has changed and this change does not get followed in bsdconfig.
  This implicates boot time warnings about a wrong keymap file, what
  is very confusing for the new users and for me too, so initialize
  the default keymaps search path depending on terminal type.

Modified:
  stable/11/usr.sbin/bsdconfig/console/keymap
  stable/11/usr.sbin/bsdconfig/share/keymap.subr
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bsdconfig/console/keymap
==
--- stable/11/usr.sbin/bsdconfig/console/keymap Sat Mar  3 10:18:32 2018
(r330317)
+++ stable/11/usr.sbin/bsdconfig/console/keymap Sat Mar  3 10:27:33 2018
(r330318)
@@ -172,6 +172,7 @@ dialog_menu_main()
uk.iso)defaultitem="$msg_uk_iso"  ;;
ua.koi8-u) defaultitem="$msg_ukrainian_koi8_u";;
ua.koi8-u.shift.alt)   defaultitem="$msg_ukrainian_koi8_u_koi8_r" ;;
+   us.ctrl)   defaultitem="$msg_usa_capslock_ctrl"   ;;
us.pc-ctrl)defaultitem="$msg_usa_capslock_ctrl"   ;;
us.dvorak) defaultitem="$msg_usa_dvorak"  ;;
us.dvorakl)defaultitem="$msg_usa_dvorak_left" ;;
@@ -307,7 +308,12 @@ while :; do
uk_iso)  keymap_to_set="uk.iso";;
ukrainian_koi8_u)keymap_to_set="ua.koi8-u" ;;
ukrainian_koi8_u_koi8_r) keymap_to_set="ua.koi8-u.shift.alt"   ;;
-   usa_capslock_ctrl)   keymap_to_set="us.pc-ctrl";;
+   usa_capslock_ctrl)
+   case "$( sysctl -n kern.vty )" in
+   vt)  keymap_to_set="us.ctrl"   ;;
+   *)   keymap_to_set="us.pc-ctrl";;
+   esac
+   ;;
usa_dvorak)  keymap_to_set="us.dvorak" ;;
usa_dvorak_left) keymap_to_set="us.dvorakl";;
usa_dvorak_right)keymap_to_set="us.dvorakr";;

Modified: stable/11/usr.sbin/bsdconfig/share/keymap.subr
==
--- stable/11/usr.sbin/bsdconfig/share/keymap.subr  Sat Mar  3 10:18:32 
2018(r330317)
+++ stable/11/usr.sbin/bsdconfig/share/keymap.subr  Sat Mar  3 10:27:33 
2018(r330318)
@@ -39,7 +39,10 @@ f_include $BSDCFG_SHARE/struct.subr
 # Defaults taken from usr.sbin/kbdmap/kbdmap.h
 #
 : ${DEFAULT_LANG:=en}
-: ${DEFAULT_KEYMAP_DIR:=/usr/share/syscons/keymaps}
+case "$( sysctl -n kern.vty )" in
+vt): ${DEFAULT_KEYMAP_DIR:=/usr/share/vt/keymaps}  ;;
+*) : ${DEFAULT_KEYMAP_DIR:=/usr/share/syscons/keymaps} ;;
+esac
 
  GLOBALS
 
___
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: r330319 - stable/11/bin/pkill

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:29:29 2018
New Revision: 330319
URL: https://svnweb.freebsd.org/changeset/base/330319

Log:
  MFC r319602:
  
  Clarify -q is only for pgrep.

Modified:
  stable/11/bin/pkill/pkill.1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/pkill/pkill.1
==
--- stable/11/bin/pkill/pkill.1 Sat Mar  3 10:27:33 2018(r330318)
+++ stable/11/bin/pkill/pkill.1 Sat Mar  3 10:29:29 2018(r330319)
@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 21, 2015
+.Dd June 5, 2017
 .Dt PKILL 1
 .Os
 .Sh NAME
@@ -176,6 +176,8 @@ Select only the newest (most recently started) of the 
 .It Fl o
 Select only the oldest (least recently started) of the matching processes.
 .It Fl q
+For
+.Nm pgrep ,
 Do not write anything to standard output.
 .It Fl s Ar sid
 Restrict matches to processes with a session ID in the comma-separated
___
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: r330320 - stable/11/sys/compat/linux

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:30:54 2018
New Revision: 330320
URL: https://svnweb.freebsd.org/changeset/base/330320

Log:
  MFC 319851:
  
  Remove the outdated definition.

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

Modified: stable/11/sys/compat/linux/linux_file.c
==
--- stable/11/sys/compat/linux/linux_file.c Sat Mar  3 10:29:29 2018
(r330319)
+++ stable/11/sys/compat/linux/linux_file.c Sat Mar  3 10:30:54 2018
(r330320)
@@ -307,8 +307,6 @@ struct l_dirent64 {
 roundup(offsetof(struct l_dirent64, d_name) + (namlen) + 1,
\
 sizeof(uint64_t))
 
-#defineLINUX_DIRBLKSIZ 512
-
 /*
  * Linux l_dirent is bigger than FreeBSD dirent, thus the buffer size
  * passed to kern_getdirentries() must be smaller than the one passed
___
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: r330321 - stable/11/etc/rc.d

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:32:00 2018
New Revision: 330321
URL: https://svnweb.freebsd.org/changeset/base/330321

Log:
  MFC r319843:
  
  Fix 'restart' action: rc.subr only expects to restart one service, not two.
  
  PR:   217393

Modified:
  stable/11/etc/rc.d/sendmail
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/rc.d/sendmail
==
--- stable/11/etc/rc.d/sendmail Sat Mar  3 10:30:54 2018(r330320)
+++ stable/11/etc/rc.d/sendmail Sat Mar  3 10:32:00 2018(r330321)
@@ -206,12 +206,14 @@ required_files=
 if checkyesno sendmail_submit_enable; then
name="sendmail_submit"
rcvar="sendmail_submit_enable"
+   _rc_restart_done=false
run_rc_command "$1"
 fi
 
 if checkyesno sendmail_outbound_enable; then
name="sendmail_outbound"
rcvar="sendmail_outbound_enable"
+   _rc_restart_done=false
run_rc_command "$1"
 fi
 
@@ -219,4 +221,5 @@ name="sendmail_msp_queue"
 rcvar="sendmail_msp_queue_enable"
 pidfile="${sendmail_msp_queue_pidfile:-/var/spool/clientmqueue/sm-client.pid}"
 required_files="/etc/mail/submit.cf"
+_rc_restart_done=false
 run_rc_command "$1"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330322 - stable/11/libexec/rshd

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:35:00 2018
New Revision: 330322
URL: https://svnweb.freebsd.org/changeset/base/330322

Log:
  MFC r320406:
  
  A little tweak for performance

Modified:
  stable/11/libexec/rshd/rshd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/libexec/rshd/rshd.c
==
--- stable/11/libexec/rshd/rshd.c   Sat Mar  3 10:32:00 2018
(r330321)
+++ stable/11/libexec/rshd/rshd.c   Sat Mar  3 10:35:00 2018
(r330322)
@@ -191,7 +191,7 @@ doit(struct sockaddr *fromp)
struct passwd *pwd;
u_short port;
fd_set ready, readfrom;
-   int cc, fd, nfd, pv[2], pid, s;
+   int cc, nfd, pv[2], pid, s;
int one = 1;
const char *cp, *errorstr;
char sig, buf[BUFSIZ];
@@ -493,8 +493,7 @@ doit(struct sockaddr *fromp)
 #ifdef USE_BLACKLIST
blacklist(0, STDIN_FILENO, "success");
 #endif
-   for (fd = getdtablesize(); fd > 2; fd--)
-   (void) close(fd);
+   closefrom(3);
if (setsid() == -1)
syslog(LOG_ERR, "setsid() failed: %m");
if (setlogin(pwd->pw_name) < 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330323 - stable/11/share/mk

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:37:53 2018
New Revision: 330323
URL: https://svnweb.freebsd.org/changeset/base/330323

Log:
  MFC r321426:
  
  cleanobj: Unhide removal of directory.

Modified:
  stable/11/share/mk/bsd.obj.mk
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/mk/bsd.obj.mk
==
--- stable/11/share/mk/bsd.obj.mk   Sat Mar  3 10:35:00 2018
(r330322)
+++ stable/11/share/mk/bsd.obj.mk   Sat Mar  3 10:37:53 2018
(r330323)
@@ -159,7 +159,7 @@ whereobj:
 
 .if ${CANONICALOBJDIR} != ${.CURDIR} && exists(${CANONICALOBJDIR}/)
 cleanobj:
-   @-rm -rf ${CANONICALOBJDIR}
+   -rm -rf ${CANONICALOBJDIR}
 .else
 cleanobj: clean cleandepend
 .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: r330324 - stable/11/bin/pkill

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:43:41 2018
New Revision: 330324
URL: https://svnweb.freebsd.org/changeset/base/330324

Log:
  MFC r322210,r322613,r322831:
  
  pgrep naively appends the delimiter to all PIDs including the last
  e.g. "pgrep -d, getty" outputs "1399,1386,1309,1308,1307,1306,1305,1302,"
  Ensure the list is correctly delimited by suppressing the emission of the
  delimiter after the final PID.
  
  The r322210 change to pgrep's PID delimiting behaviour causes pgrep's default
  output to not include a trailing new line, which is a potential POLA violation
  for existing consumers. Change pgrep to always emit a trailing new line on
  completion of its output, regardless of the delimeter in use (which 
technically
  is also a potential POLA violation for existing consumers that rely on the
  pre-r322210 buggy behaviour, but a line has to be drawn somewhere).
  
  Only emit the trailing new line added in r322613 when not operating in quiet
  mode.
  
  PR:   221534 (r322613)

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

Modified: stable/11/bin/pkill/pkill.c
==
--- stable/11/bin/pkill/pkill.c Sat Mar  3 10:37:53 2018(r330323)
+++ stable/11/bin/pkill/pkill.c Sat Mar  3 10:43:41 2018(r330324)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -567,6 +568,8 @@ main(int argc, char **argv)
continue;
rv |= (*action)(kp);
}
+   if (rv && pgrep && !quiet)
+   putchar('\n');
if (!did_action && !pgrep && longfmt)
fprintf(stderr,
"No matching processes belonging to you were found\n");
@@ -656,10 +659,12 @@ killact(const struct kinfo_proc *kp)
 static int
 grepact(const struct kinfo_proc *kp)
 {
+   static bool first = true;
 
-   show_process(kp);
-   if (!quiet)
+   if (!quiet && !first)
printf("%s", delim);
+   show_process(kp);
+   first = false;
return (1);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330325 - stable/11/usr.bin/mkesdb

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:45:19 2018
New Revision: 330325
URL: https://svnweb.freebsd.org/changeset/base/330325

Log:
  MFC r322428:
  
  Set usage() to show -d flag
  mkesdb supports the -d flag for enabling debug mode, as documented in the 
manual.
  
  PR:   209865
  Submitted by: Maya Rashish 
  Reviewed by:  imp
  Approved by:  bcr (mentor)
  Obtained from:NetBSD
  MFC after:7 days
  Differential Revision:https://reviews.freebsd.org/D11987

Modified:
  stable/11/usr.bin/mkesdb/yacc.y
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/mkesdb/yacc.y
==
--- stable/11/usr.bin/mkesdb/yacc.y Sat Mar  3 10:43:41 2018
(r330324)
+++ stable/11/usr.bin/mkesdb/yacc.y Sat Mar  3 10:45:19 2018
(r330325)
@@ -278,8 +278,8 @@ usage(void)
 {
errx(EXIT_FAILURE,
"usage:\n"
-   "\t%s [-o outfile] [infile]\n"
-   "\t%s -m [-o outfile] [infile]",
+   "\t%s [-d] [-o outfile] [infile]\n"
+   "\t%s -m [-d] [-o outfile] [infile]",
getprogname(), getprogname());
 }
 
___
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: r330326 - stable/11/contrib/mdocml

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:47:30 2018
New Revision: 330326
URL: https://svnweb.freebsd.org/changeset/base/330326

Log:
  MFC r322657:
  
  typo
  
  PR:   211160

Modified:
  stable/11/contrib/mdocml/lib.in
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/mdocml/lib.in
==
--- stable/11/contrib/mdocml/lib.in Sat Mar  3 10:45:19 2018
(r330325)
+++ stable/11/contrib/mdocml/lib.in Sat Mar  3 10:47:30 2018
(r330326)
@@ -34,7 +34,7 @@ LINE("libc",  "Standard C\\~Library (libc, \\-lc)")
 LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)")
 LINE("libcalendar","Calendar Arithmetic Library (libcalendar, 
\\-lcalendar)")
 LINE("libcam", "Common Access Method User Library (libcam, \\-lcam)")
-LINE("libcasper",  "Casper Library (libcasper, \\-lcapser)")
+LINE("libcasper",  "Casper Library (libcasper, \\-lcasper)")
 LINE("libcdk", "Curses Development Kit Library (libcdk, \\-lcdk)")
 LINE("libcipher",  "FreeSec Crypt Library (libcipher, \\-lcipher)")
 LINE("libcompat",  "Compatibility Library (libcompat, \\-lcompat)")
___
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: r330327 - stable/11

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:48:23 2018
New Revision: 330327
URL: https://svnweb.freebsd.org/changeset/base/330327

Log:
  MFC r322804 (record only)
  
  Correct typo in usage string.

Modified:
Directory Properties:
  stable/11/   (props changed)
___
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: r330328 - stable/11/sbin/sysctl

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 10:50:16 2018
New Revision: 330328
URL: https://svnweb.freebsd.org/changeset/base/330328

Log:
  MFC r323645:
  
  kern.osreldate is an integer, not a string
  
  PR:   217501

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

Modified: stable/11/sbin/sysctl/sysctl.8
==
--- stable/11/sbin/sysctl/sysctl.8  Sat Mar  3 10:48:23 2018
(r330327)
+++ stable/11/sbin/sysctl/sysctl.8  Sat Mar  3 10:50:16 2018
(r330328)
@@ -214,7 +214,7 @@ String and integer values can be set using
 .It "kern.filedelayinteger yes"
 .It "kern.dirdelay integer yes"
 .It "kern.metadelayinteger yes"
-.It "kern.osreldatestring  no"
+.It "kern.osreldateinteger no"
 .It "kern.bootfile string  yes"
 .It "kern.corefile string  yes"
 .It "kern.logsigexit   integer yes"
___
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: r330329 - stable/11/bin/uuidgen

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 11:02:34 2018
New Revision: 330329
URL: https://svnweb.freebsd.org/changeset/base/330329

Log:
  MFC r303727:
  
  uuid_to_string(3) is allocating memory and can fail on that.
  Check if any error accrued.

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

Modified: stable/11/bin/uuidgen/uuidgen.c
==
--- stable/11/bin/uuidgen/uuidgen.c Sat Mar  3 10:50:16 2018
(r330328)
+++ stable/11/bin/uuidgen/uuidgen.c Sat Mar  3 11:02:34 2018
(r330329)
@@ -47,7 +47,7 @@ main(int argc, char *argv[])
FILE *fp;
uuid_t *store, *uuid;
char *p;
-   int ch, count, i, iterate;
+   int ch, count, i, iterate, status;
 
count = -1; /* no count yet */
fp = stdout;/* default output file */
@@ -101,7 +101,9 @@ main(int argc, char *argv[])
 
uuid = store;
while (count--) {
-   uuid_to_string(uuid++, &p, NULL);
+   uuid_to_string(uuid++, &p, &status);
+   if (status != uuid_s_ok)
+err(1, "cannot stringify a UUID");
fprintf(fp, "%s\n", p);
free(p);
}
___
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: r330330 - stable/11/tools/tools/syscall_timing

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 11:11:07 2018
New Revision: 330330
URL: https://svnweb.freebsd.org/changeset/base/330330

Log:
  MFC r325319:
  
  Remove artificial limit for -i.

Modified:
  stable/11/tools/tools/syscall_timing/syscall_timing.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c
==
--- stable/11/tools/tools/syscall_timing/syscall_timing.c   Sat Mar  3 
11:02:34 2018(r330329)
+++ stable/11/tools/tools/syscall_timing/syscall_timing.c   Sat Mar  3 
11:11:07 2018(r330330)
@@ -706,7 +706,7 @@ main(int argc, char *argv[])
switch (ch) {
case 'i':
ll = strtol(optarg, &endp, 10);
-   if (*endp != 0 || ll < 1 || ll > 10)
+   if (*endp != 0 || ll < 1)
usage();
iterations = ll;
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330331 - stable/11/bin/rm

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 11:12:09 2018
New Revision: 330331
URL: https://svnweb.freebsd.org/changeset/base/330331

Log:
  MFC r325450:
  
  Fix cosmetic nit when printing out "override $mode" and "$owner/$group ..."
  
  The wrong index was being checked for == ' ' in the resulting stringified
  mode from strmode(3) -- it should have been the 11th value, not the 10th.
  
  PR:   76711

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

Modified: stable/11/bin/rm/rm.c
==
--- stable/11/bin/rm/rm.c   Sat Mar  3 11:11:07 2018(r330330)
+++ stable/11/bin/rm/rm.c   Sat Mar  3 11:12:09 2018(r330331)
@@ -515,7 +515,7 @@ check(const char *path, const char *name, struct stat 
"%s: -P was specified, but file is not writable",
path);
(void)fprintf(stderr, "override %s%s%s/%s %s%sfor %s? ",
-   modep + 1, modep[9] == ' ' ? "" : " ",
+   modep + 1, modep[10] == ' ' ? "" : " ",
user_from_uid(sp->st_uid, 0),
group_from_gid(sp->st_gid, 0),
*flagsp ? flagsp : "", *flagsp ? " " : "",
___
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: r330332 - stable/11/bin/pkill/tests

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 11:17:05 2018
New Revision: 330332
URL: https://svnweb.freebsd.org/changeset/base/330332

Log:
  MFC r307519,r307629:
  
  Increase timeout so low-end platforms have a chance to complete test
  procedures.
  
  This fixes operation in QEMU/MIPS64.

Modified:
  stable/11/bin/pkill/tests/pgrep-j_test.sh
  stable/11/bin/pkill/tests/pkill-j_test.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/pkill/tests/pgrep-j_test.sh
==
--- stable/11/bin/pkill/tests/pgrep-j_test.sh   Sat Mar  3 11:12:09 2018
(r330331)
+++ stable/11/bin/pkill/tests/pgrep-j_test.sh   Sat Mar  3 11:17:05 2018
(r330332)
@@ -20,12 +20,13 @@ sleep=$(pwd)/sleep.txt
 ln -sf /bin/sleep $sleep
 
 name="pgrep -j "
-sleep_amount=5
+sleep_amount=15
 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \
 command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount &
 
 jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \
 command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount &
+sleep 0.5
 
 for i in `seq 1 10`; do
jid1=$(jail_name_to_jid ${base}_1_1)
@@ -53,7 +54,7 @@ fi
 wait
 
 name="pgrep -j any"
-sleep_amount=6
+sleep_amount=16
 jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \
 command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount &
 
@@ -74,7 +75,7 @@ fi
 wait
 
 name="pgrep -j none"
-sleep_amount=7
+sleep_amount=17
 daemon -p ${PWD}/${base}_3_1.pid $sleep $sleep_amount &
 jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \
 command=daemon -p ${PWD}/${base}_3_2.pid $sleep $sleep_amount &
@@ -91,7 +92,7 @@ wait
 
 # test 4 is like test 1 except with jname instead of jid.
 name="pgrep -j "
-sleep_amount=8
+sleep_amount=18
 jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \
 command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount &
 

Modified: stable/11/bin/pkill/tests/pkill-j_test.sh
==
--- stable/11/bin/pkill/tests/pkill-j_test.sh   Sat Mar  3 11:12:09 2018
(r330331)
+++ stable/11/bin/pkill/tests/pkill-j_test.sh   Sat Mar  3 11:17:05 2018
(r330332)
@@ -20,7 +20,7 @@ sleep=$(pwd)/sleep.txt
 ln -sf /bin/sleep $sleep
 
 name="pkill -j "
-sleep_amount=5
+sleep_amount=15
 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \
 command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount &
 
@@ -54,7 +54,7 @@ fi 2>/dev/null
 wait
 
 name="pkill -j any"
-sleep_amount=6
+sleep_amount=16
 jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \
 command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount &
 
@@ -76,7 +76,7 @@ fi 2>/dev/null
 wait
 
 name="pkill -j none"
-sleep_amount=7
+sleep_amount=17
 daemon -p ${PWD}/${base}_3_1.pid $sleep $sleep_amount
 jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \
 command=daemon -p ${PWD}/${base}_3_2.pid $sleep $sleep_amount &
@@ -94,7 +94,7 @@ wait
 
 # test 4 is like test 1 except with jname instead of jid.
 name="pkill -j "
-sleep_amount=8
+sleep_amount=18
 jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \
 command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount &
 
___
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: r330333 - stable/11/bin/freebsd-version

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 11:18:38 2018
New Revision: 330333
URL: https://svnweb.freebsd.org/changeset/base/330333

Log:
  MFC r325800:
  
  Add a -r option to print the running kernel version.

Modified:
  stable/11/bin/freebsd-version/freebsd-version.1
  stable/11/bin/freebsd-version/freebsd-version.sh.in
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/freebsd-version/freebsd-version.1
==
--- stable/11/bin/freebsd-version/freebsd-version.1 Sat Mar  3 11:17:05 
2018(r330332)
+++ stable/11/bin/freebsd-version/freebsd-version.1 Sat Mar  3 11:18:38 
2018(r330333)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 5, 2013
+.Dd November 14, 2017
 .Dt FREEBSD-VERSION 1
 .Os
 .Sh NAME
@@ -33,7 +33,7 @@
 .Nd print the version and patch level of the installed system
 .Sh SYNOPSIS
 .Nm
-.Op Fl ku
+.Op Fl kru
 .Sh DESCRIPTION
 The
 .Nm
@@ -50,6 +50,11 @@ if a new kernel has been installed but the system has 
 rebooted,
 .Nm
 will print the version and patch level of the new kernel.
+.It Fl r
+Print the version and patch level of the running kernel.
+Unlike
+.Xr uname 1 ,
+this is unaffected by environment variables.
 .It Fl u
 Print the version and patch level of the installed userland.
 These are hardcoded into
@@ -57,14 +62,10 @@ These are hardcoded into
 during the build.
 .El
 .Pp
-If both
-.Fl k
-and
-.Fl u
-are specified,
+If several of the above options are specified,
 .Nm
-will print the kernel version first, then the userland version, on
-separate lines.
+will print the installed kernel version first, then the running kernel
+version, and finally the userland version, on separate lines.
 If neither is specified, it will print the userland version only.
 .Sh IMPLEMENTATION NOTES
 The

Modified: stable/11/bin/freebsd-version/freebsd-version.sh.in
==
--- stable/11/bin/freebsd-version/freebsd-version.sh.in Sat Mar  3 11:17:05 
2018(r330332)
+++ stable/11/bin/freebsd-version/freebsd-version.sh.in Sat Mar  3 11:18:38 
2018(r330333)
@@ -38,7 +38,7 @@ LOADER_RE1='^\([A-Z_a-z][0-9A-Z_a-z]*=[-./0-9A-Z_a-z]\
 LOADER_RE2='^\([A-Z_a-z][0-9A-Z_a-z]*="[-./0-9A-Z_a-z]\{1,\}"\).*$'
 KERNEL_RE='^@@TYPE@@ \([-.0-9A-Za-z]\{1,\}\) .*$'
 
-progname=$(basename $0)
+progname=${0##*/}
 
 #
 # Print an error message and exit.
@@ -71,6 +71,13 @@ kernel_version() {
 }
 
 #
+# Print the version of the currently running kernel.
+#
+running_version() {
+   sysctl -n kern.osrelease
+}
+
+#
 # Print the hardcoded userland version.
 #
 userland_version() {
@@ -81,7 +88,7 @@ userland_version() {
 # Print a usage string and exit.
 #
 usage() {
-   echo "usage: $progname [-ku]" >&2
+   echo "usage: $progname [-kru]" >&2
exit 1
 }
 
@@ -90,11 +97,14 @@ usage() {
 #
 main() {
# parse command-line arguments
-   while getopts "ku" option ; do
+   while getopts "kru" option ; do
case $option in
k)
opt_k=1
;;
+   r)
+   opt_r=1
+   ;;
u)
opt_u=1
;;
@@ -108,13 +118,18 @@ main() {
fi
 
# default is -u
-   if [ $((opt_k + opt_u)) -eq 0 ] ; then
+   if [ $((opt_k + opt_r + opt_u)) -eq 0 ] ; then
opt_u=1
fi
 
-   # print kernel version
+   # print installed kernel version
if [ $opt_k ] ; then
kernel_version
+   fi
+
+   # print running kernel version
+   if [ $opt_r ] ; then
+   running_version
fi
 
# print userland version
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330334 - stable/11/sys/vm

2018-03-03 Thread Konstantin Belousov
Author: kib
Date: Sat Mar  3 11:53:44 2018
New Revision: 330334
URL: https://svnweb.freebsd.org/changeset/base/330334

Log:
  MFC r329905:
  Hide all vm/vm_pageout.h content under #ifdef _KERNEL.

Modified:
  stable/11/sys/vm/vm_pageout.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/vm_pageout.h
==
--- stable/11/sys/vm/vm_pageout.h   Sat Mar  3 11:18:38 2018
(r330333)
+++ stable/11/sys/vm/vm_pageout.h   Sat Mar  3 11:53:44 2018
(r330334)
@@ -63,6 +63,8 @@
 #ifndef _VM_VM_PAGEOUT_H_
 #define _VM_VM_PAGEOUT_H_
 
+#ifdef _KERNEL
+
 /*
  * Header file for pageout daemon.
  */
@@ -101,11 +103,10 @@ void pagedaemon_wakeup(void);
 void vm_wait(void);
 void vm_waitpfault(void);
 
-#ifdef _KERNEL
 int vm_pageout_flush(vm_page_t *, int, int, int, int *, boolean_t *);
 void vm_pageout_oom(int shortage);
 
 void vm_swapout_run(void);
 void vm_swapout_run_idle(void);
-#endif
+#endif /* _KERNEL */
 #endif /* _VM_VM_PAGEOUT_H_ */
___
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: r330285 - head/sys/sys

2018-03-03 Thread Bruce Evans

On Sat, 3 Mar 2018, Konstantin Belousov wrote:


On Sat, Mar 03, 2018 at 01:47:41PM +1100, Bruce Evans wrote:

On Fri, 2 Mar 2018, Konstantin Belousov wrote:


On Fri, Mar 02, 2018 at 12:43:34PM -0500, Pedro Giffuni wrote:

...
I think use of _Nonnull attributes in the threading functions may also
be a waste (I introduced them mostly to be compatible with Android).
FWIW, Dragonfly sprinkled some restrict there recently:

http://gitweb.dragonflybsd.org/dragonfly.git/commit/d33005aaee6af52c80428b59b52aee522c002492

Just in case someone is considering more cleanups.


This is not a cleanup for me, but a needed change. Right now x86
copyouts are implemented in asm, so whatever damage is done to the
prototypes, only effect is at the caller side. In my work, i386 copyouts
are done in C, so it starts matter.


That seems slow, especially for small sizes as are common for syscall args
(in 1 of my versions, copyin() of args is optimized to fuword() in a loop,
and fuword() is optimized to not use pcb_onfault, so it is not much more
than 1 memory access.  However, in your i386 version this optimization
would be negative since the slow part is switching the map, so fuword()
should never be used to access multiple words).

Yes. I already explained it in private, the current choice for i386 is
either to be neglected very fast, or to get this change to still be a
Tier 1 32 bit platform. The change is to make 4/4g split for UVA/KVA.
In particular, the change ensures that it is possible to self-host i386
for forthcoming years, which is not practical for armv7 now and would be
less so with clang grow.


I use i386 since it is 10-20% faster than amd64 for my applications,
and don't like changes that fix this by slowing down the fast case.  My
applications don't include clang.


...

Also I looked at the dragonfly commit because I become curious what do you
mean by threading functions.  The first example was
intpthread_attr_getguardsize(const pthread_attr_t * __restrict,
-   size_t *);
+   size_t * __restrict);
POSIX agrees with the dragonfly change, but I do not understand it.
Aliasing rules already disallow the first and second arguments to point
to the same memory, because they have different types.


(1) thread_attr_t is opaque, so the types might be the same.
(2) pthread_attr_t might be a pointer to a struct/union containing a size_t.
(3) perhaps other reasons.  I'm not sure how 'restrict interacts with global
 variables or even it it prevents the interaction in (2).  A previous
 discussion showed that const doesn't make types different enough to
 prevent aliasing.  Similarly for volatile.

Similarly for other pointers to {opaque, struct/union, or even integer} types.
size_t can't be aliased to int, but it can be aliased to any unsigned type
in C and to any unsigned type not smaller than uint16_t in POSIX (POSIX
but not C requires u_char == uint8_t, so size_t can't be u_char in POSIX
but it can be u_char in C).


I can only summarize it as 'there is no use to have restrict on the
pthread_attr_getguardsize() arguments'.


No, the summary is 'POSIX is correct to declare almost all arg pointers
as restrict, since it is not useful for new APIs to allow aliases, and
restrict must be used so that implementations can take advantage of this
if they want'.

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"


svn commit: r330335 - head/sys/sys

2018-03-03 Thread Emmanuel Vadot
Author: manu
Date: Sat Mar  3 12:43:11 2018
New Revision: 330335
URL: https://svnweb.freebsd.org/changeset/base/330335

Log:
  Introduce BUS_PASS_SUPPORTDEV
  
  The reason for this new pass is :
  
  The earlier pass names are really specific (interrupt, timer, scheduler etc 
..)
  and making a driver that other device driver (that attach at DEFAULT pass)
  needs probe at earlier pass can be confiusing. We can live with GPIO driver
  at INTERRUPT pass because they are often an interrupt controller too but 
having
  a usb phy driver probed at RESOURCES (or SCHEDULER for example) is silly.
  The number was choosen to have a lot of margin if we want to introduce other
  pass in the futur.
  
  Reviewed by:  ian, imp, kevans
  Differential Revision:https://reviews.freebsd.org/D14568

Modified:
  head/sys/sys/bus.h

Modified: head/sys/sys/bus.h
==
--- head/sys/sys/bus.h  Sat Mar  3 11:53:44 2018(r330334)
+++ head/sys/sys/bus.h  Sat Mar  3 12:43:11 2018(r330335)
@@ -702,6 +702,7 @@ voidbus_data_generation_update(void);
 #defineBUS_PASS_INTERRUPT  40  /* Interrupt controllers. */
 #defineBUS_PASS_TIMER  50  /* Timers and clocks. */
 #defineBUS_PASS_SCHEDULER  60  /* Start scheduler. */
+#defineBUS_PASS_SUPPORTDEV 10  /* Drivers which support 
DEFAULT drivers. */
 #defineBUS_PASS_DEFAULT__INT_MAX /* Everything else. */
 
 #defineBUS_PASS_ORDER_FIRST0
___
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: r330336 - head/sys/arm64/arm64

2018-03-03 Thread Andrew Turner
Author: andrew
Date: Sat Mar  3 13:19:08 2018
New Revision: 330336
URL: https://svnweb.freebsd.org/changeset/base/330336

Log:
  Add the missing GICv3 dev info struct to the ACPI dev info.Previously we
  would read from the resource list when querying from this.
  
  Sponsored by: ABT Systems Ltd
  Sponsored by: Cavium (Hardware)

Modified:
  head/sys/arm64/arm64/gic_v3_acpi.c

Modified: head/sys/arm64/arm64/gic_v3_acpi.c
==
--- head/sys/arm64/arm64/gic_v3_acpi.c  Sat Mar  3 12:43:11 2018
(r330335)
+++ head/sys/arm64/arm64/gic_v3_acpi.c  Sat Mar  3 13:19:08 2018
(r330336)
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
 #include "gic_v3_var.h"
 
 struct gic_v3_acpi_devinfo {
+   struct gic_v3_devinfo   di_gic_dinfo;
struct resource_listdi_rl;
 };
 
@@ -315,6 +316,7 @@ gic_v3_add_children(ACPI_SUBTABLE_HEADER *entry, void 
resource_list_add(&di->di_rl, SYS_RES_MEMORY, 0,
gict->BaseAddress, gict->BaseAddress + 128 * 1024 - 1,
128 * 1024);
+   di->di_gic_dinfo.gic_domain = -1;
sc->gic_nchildren++;
device_set_ivars(child, di);
}
___
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: r330337 - head/sys/arm64/arm64

2018-03-03 Thread Andrew Turner
Author: andrew
Date: Sat Mar  3 13:20:44 2018
New Revision: 330337
URL: https://svnweb.freebsd.org/changeset/base/330337

Log:
  Move setting the IRQ base and length into the common GICv3 ITS attach
  function. This is common across both ACPI and FDT.
  
  Sponsored by: ABT Systems Ltd
  Sponsored by: Cavium (Hardware)

Modified:
  head/sys/arm64/arm64/gicv3_its.c

Modified: head/sys/arm64/arm64/gicv3_its.c
==
--- head/sys/arm64/arm64/gicv3_its.cSat Mar  3 13:19:08 2018
(r330336)
+++ head/sys/arm64/arm64/gicv3_its.cSat Mar  3 13:20:44 2018
(r330337)
@@ -694,6 +694,10 @@ gicv3_its_attach(device_t dev)
 
sc = device_get_softc(dev);
 
+   sc->sc_irq_length = gicv3_get_nirqs(dev);
+   sc->sc_irq_base = GIC_FIRST_LPI;
+   sc->sc_irq_base += device_get_unit(dev) * sc->sc_irq_length;
+
rid = 0;
sc->sc_its_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
RF_ACTIVE);
@@ -1666,11 +1670,6 @@ gicv3_its_fdt_attach(device_t dev)
int err;
 
sc = device_get_softc(dev);
-
-   sc->sc_irq_length = gicv3_get_nirqs(dev);
-   sc->sc_irq_base = GIC_FIRST_LPI;
-   sc->sc_irq_base += device_get_unit(dev) * sc->sc_irq_length;
-
err = gicv3_its_attach(dev);
if (err != 0)
return (err);
@@ -1730,11 +1729,10 @@ gicv3_its_acpi_attach(device_t dev)
struct gicv3_its_softc *sc;
int err;
 
+   sc = device_get_softc(dev);
err = gicv3_its_attach(dev);
if (err != 0)
return (err);
-
-   sc = device_get_softc(dev);
 
sc->sc_pic = intr_pic_register(dev, 1);
intr_pic_add_handler(device_get_parent(dev), sc->sc_pic,
___
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: r330338 - head/sys/amd64/amd64

2018-03-03 Thread Andriy Gapon
Author: avg
Date: Sat Mar  3 15:10:37 2018
New Revision: 330338
URL: https://svnweb.freebsd.org/changeset/base/330338

Log:
  db_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common
  
  Since that change the system call stack traces look like this:
...
sys___sysctl() at sys___sysctl+0x5f/frame 0xfe0028e13ac0
amd64_syscall() at amd64_syscall+0x79b/frame 0xfe0028e13bf0
fast_syscall_common() at fast_syscall_common+0x101/frame 0xfe0028e13bf0
  So, db_nextframe() stopped recognizing the system call frame.
  This commit should fix that.
  
  Reviewed by:  kib
  MFC after:4 days

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

Modified: head/sys/amd64/amd64/db_trace.c
==
--- head/sys/amd64/amd64/db_trace.c Sat Mar  3 13:20:44 2018
(r330337)
+++ head/sys/amd64/amd64/db_trace.c Sat Mar  3 15:10:37 2018
(r330338)
@@ -212,7 +212,9 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, s
strcmp(name, "Xcpususpend") == 0 ||
strcmp(name, "Xrendezvous") == 0)
frame_type = INTERRUPT;
-   else if (strcmp(name, "Xfast_syscall") == 0)
+   else if (strcmp(name, "Xfast_syscall") == 0 ||
+   strcmp(name, "Xfast_syscall_pti") == 0 ||
+   strcmp(name, "fast_syscall_common") == 0)
frame_type = SYSCALL;
 #ifdef COMPAT_FREEBSD32
else if (strcmp(name, "Xint0x80_syscall") == 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: r330285 - head/sys/sys

2018-03-03 Thread Pedro Giffuni



On 03/03/2018 05:21, Konstantin Belousov wrote:

On Sat, Mar 03, 2018 at 01:47:41PM +1100, Bruce Evans wrote:

On Fri, 2 Mar 2018, Konstantin Belousov wrote:


On Fri, Mar 02, 2018 at 12:43:34PM -0500, Pedro Giffuni wrote:

...
I think use of _Nonnull attributes in the threading functions may also
be a waste (I introduced them mostly to be compatible with Android).
FWIW, Dragonfly sprinkled some restrict there recently:

http://gitweb.dragonflybsd.org/dragonfly.git/commit/d33005aaee6af52c80428b59b52aee522c002492

Just in case someone is considering more cleanups.

This is not a cleanup for me, but a needed change. Right now x86
copyouts are implemented in asm, so whatever damage is done to the
prototypes, only effect is at the caller side. In my work, i386 copyouts
are done in C, so it starts matter.

That seems slow, especially for small sizes as are common for syscall args
(in 1 of my versions, copyin() of args is optimized to fuword() in a loop,
and fuword() is optimized to not use pcb_onfault, so it is not much more
than 1 memory access.  However, in your i386 version this optimization
would be negative since the slow part is switching the map, so fuword()
should never be used to access multiple words).

Yes. I already explained it in private, the current choice for i386 is
either to be neglected very fast, or to get this change to still be a
Tier 1 32 bit platform. The change is to make 4/4g split for UVA/KVA.
In particular, the change ensures that it is possible to self-host i386
for forthcoming years, which is not practical for armv7 now and would be
less so with clang grow.

In other news, my system already boots single-user on SMP machine and
I have torture tests like setting invalid %ss segment by sigreturn(2),
work.  There is (much) more to come, but I am happy how the patch
progressed so far.

Very nice.


However, copyinstr() and
copystr() should never have been "optimized" by writing them in asm.  On
x86, their asm is badly written so they are slower than simple C versions
except on 8088's and maybe 8086's and maybe on the original i386.  (8088's
were limited mainly by instruction bandwidth and the original i386 wasn't
much better, so short CISC instructions like lodsb and stosb tended to be
faster than larger separate instructions despite their large setup overheads.

Sure, copyinstr() is rewritten in C.  The current version of copyout stuff
is there:
https://kib.kiev.ua/git/gitweb.cgi?p=deviant2.git;a=blob;f=sys/i386/i386/copyout.c;h=9747c06a84d7d2b5faac946f5de57f6a34d96c8c;hb=refs/heads/pcid


Also I looked at the dragonfly commit because I become curious what do you
mean by threading functions.  The first example was
intpthread_attr_getguardsize(const pthread_attr_t * __restrict,
-   size_t *);
+   size_t * __restrict);
POSIX agrees with the dragonfly change, but I do not understand it.
Aliasing rules already disallow the first and second arguments to point
to the same memory, because they have different types.

(1) thread_attr_t is opaque, so the types might be the same.
(2) pthread_attr_t might be a pointer to a struct/union containing a size_t.
(3) perhaps other reasons.  I'm not sure how 'restrict interacts with global
  variables or even it it prevents the interaction in (2).  A previous
  discussion showed that const doesn't make types different enough to
  prevent aliasing.  Similarly for volatile.

Similarly for other pointers to {opaque, struct/union, or even integer} types.
size_t can't be aliased to int, but it can be aliased to any unsigned type
in C and to any unsigned type not smaller than uint16_t in POSIX (POSIX
but not C requires u_char == uint8_t, so size_t can't be u_char in POSIX
but it can be u_char in C).

I can only summarize it as 'there is no use to have restrict on the
pthread_attr_getguardsize() arguments'.



Well, I'll admit I don't understand well the advantages and that's why I 
brought up a pointer to the changes instead of working on them. Usually, 
standards compliance is reason enough for such change though.


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"


svn commit: r330339 - head/stand/liblua

2018-03-03 Thread Kyle Evans
Author: kevans
Date: Sat Mar  3 17:13:12 2018
New Revision: 330339
URL: https://svnweb.freebsd.org/changeset/base/330339

Log:
  liblua: Add loader.interpret
  
  This allows lua to pass back a command string to be executed as if it were
  typed at the loader prompt- loader tries to execute the string first as pure
  lua, then parses it and gives lua a chance to intercept before it tries to
  execute it itself.
  
  This will be used to implement menu_timeout_command, among other things,
  which *should* be used to execute basic loader commands independent of the
  chosen interpreter.

Modified:
  head/stand/liblua/lutils.c

Modified: head/stand/liblua/lutils.c
==
--- head/stand/liblua/lutils.c  Sat Mar  3 15:10:37 2018(r330338)
+++ head/stand/liblua/lutils.c  Sat Mar  3 17:13:12 2018(r330339)
@@ -77,7 +77,26 @@ lua_perform(lua_State *L)
return 1;
 }
 
+/*
+ * Accepts a space-delimited loader command and runs it through the standard
+ * loader parsing, as if it were executed at the loader prompt by the user.
+ */
 static int
+lua_interpret(lua_State *L)
+{
+   const char  *interp_string;
+
+   if (lua_gettop(L) != 1) {
+   lua_pushnil(L);
+   return 1;
+   }
+
+   interp_string = luaL_checkstring(L, 1);
+   lua_pushinteger(L, interp_run(interp_string));
+   return 1;
+}
+
+static int
 lua_getchar(lua_State *L)
 {
 
@@ -305,6 +324,7 @@ lua_writefile(lua_State *L)
 static const struct luaL_Reg loaderlib[] = {
REG_SIMPLE(delay),
REG_SIMPLE(command),
+   REG_SIMPLE(interpret),
REG_SIMPLE(getenv),
REG_SIMPLE(perform),
/* Also registered as the global 'printc' */
___
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: r330340 - head/stand/lua

2018-03-03 Thread Kyle Evans
Author: kevans
Date: Sat Mar  3 17:18:40 2018
New Revision: 330340
URL: https://svnweb.freebsd.org/changeset/base/330340

Log:
  lualoader: Execute menu_timeout_command at the end of menu autoboot
  
  Instead of hardcoding "boot", respect menu_timeout_command from Forth. It
  still defaults to 'boot', so this will not be a functional change for most.

Modified:
  head/stand/lua/menu.lua

Modified: head/stand/lua/menu.lua
==
--- head/stand/lua/menu.lua Sat Mar  3 17:13:12 2018(r330339)
+++ head/stand/lua/menu.lua Sat Mar  3 17:18:40 2018(r330340)
@@ -448,8 +448,9 @@ function menu.autoboot()
 
loader.delay(5)
until time <= 0
-   core.boot()
 
+   local cmd = loader.getenv("menu_timeout_command") or "boot"
+   loader.interpret(cmd)
 end
 
 return menu
___
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: r330341 - head/stand/lua

2018-03-03 Thread Kyle Evans
Author: kevans
Date: Sat Mar  3 17:25:49 2018
New Revision: 330341
URL: https://svnweb.freebsd.org/changeset/base/330341

Log:
  lualoader: Respect loader_menu_title, prepare for align

Modified:
  head/stand/lua/drawer.lua

Modified: head/stand/lua/drawer.lua
==
--- head/stand/lua/drawer.lua   Sat Mar  3 17:18:40 2018(r330340)
+++ head/stand/lua/drawer.lua   Sat Mar  3 17:25:49 2018(r330341)
@@ -380,8 +380,13 @@ function drawer.drawbox()
printc(vl)
end
 
-   screen.setcursor(x + (w / 2) - 9, y)
-   printc("Welcome to FreeBSD")
+   local menu_header = loader.getenv("loader_menu_title") or
+   "Welcome to FreeBSD"
+   local menu_header_x
+
+   menu_header_x = x + (w / 2) - (#menu_header / 2)
+   screen.setcursor(menu_header_x, y)
+   printc(menu_header)
 end
 
 function drawer.draw(x, y, logo)
___
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: r330342 - head/stand/lua

2018-03-03 Thread Kyle Evans
Author: kevans
Date: Sat Mar  3 17:38:25 2018
New Revision: 330342
URL: https://svnweb.freebsd.org/changeset/base/330342

Log:
  lualoader: Respect loader_menu_title_align
  
  It may be set to "left" or "right" -- any other value will cause the title
  to be centered.
  
  I've chosen to position these things just inside the vertical borders,
  rather than overlapping the corners. This is an arbitrary choice and easily
  amendable if this looks terrible.

Modified:
  head/stand/lua/drawer.lua

Modified: head/stand/lua/drawer.lua
==
--- head/stand/lua/drawer.lua   Sat Mar  3 17:25:49 2018(r330341)
+++ head/stand/lua/drawer.lua   Sat Mar  3 17:38:25 2018(r330342)
@@ -382,9 +382,22 @@ function drawer.drawbox()
 
local menu_header = loader.getenv("loader_menu_title") or
"Welcome to FreeBSD"
+   local menu_header_align = loader.getenv("loader_menu_title_align")
local menu_header_x
 
-   menu_header_x = x + (w / 2) - (#menu_header / 2)
+   if menu_header_align ~= nil then
+   menu_header_align = menu_header_align:lower()
+   if menu_header_align == "left" then
+   -- Just inside the left border on top
+   menu_header_x = x + 1
+   elseif menu_header_align == "right" then
+   -- Just inside the right border on top
+   menu_header_x = x + w - #menu_header
+   end
+   end
+   if menu_header_x == nil then
+   menu_header_x = x + (w / 2) - (#menu_header / 2)
+   end
screen.setcursor(menu_header_x, y)
printc(menu_header)
 end
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330343 - stable/11/sys/kern

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 18:11:02 2018
New Revision: 330343
URL: https://svnweb.freebsd.org/changeset/base/330343

Log:
  MFC r302519:
  
  Audit the file-descriptor number argument for openat(2).  Remove a comment
  about the desirability of auditing the number, as it was in fact in the
  wrong place (in the common path for open(2) and openat(2), and only the
  latter accepts a file-descriptor argument).  Where other ABIs support
  openat(2), it may be necessary to do additional argument auditing as it is
  not performed in kern_openat(9).
  
  MFC after:3 days

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

Modified: stable/11/sys/kern/vfs_syscalls.c
==
--- stable/11/sys/kern/vfs_syscalls.c   Sat Mar  3 17:38:25 2018
(r330342)
+++ stable/11/sys/kern/vfs_syscalls.c   Sat Mar  3 18:11:02 2018
(r330343)
@@ -959,6 +959,7 @@ int
 sys_openat(struct thread *td, struct openat_args *uap)
 {
 
+   AUDIT_ARG_FD(uap->fd);
return (kern_openat(td, uap->fd, uap->path, UIO_USERSPACE, uap->flag,
uap->mode));
 }
@@ -979,7 +980,6 @@ kern_openat(struct thread *td, int fd, char *path, enu
 
AUDIT_ARG_FFLAGS(flags);
AUDIT_ARG_MODE(mode);
-   /* XXX: audit dirfd */
cap_rights_init(&rights, CAP_LOOKUP);
flags_to_rights(flags, &rights);
/*
___
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: r330345 - head/stand/lua

2018-03-03 Thread Kyle Evans
Author: kevans
Date: Sat Mar  3 18:13:14 2018
New Revision: 330345
URL: https://svnweb.freebsd.org/changeset/base/330345

Log:
  lualoader: Tweak positioning and fix an off-by-one
  
  - All of our default positions were offset from forth
  - Our menu frame size was smaller than in forth
  - Logo/brand drawing had an off-by-one, drawing one column lower on the
screen than they should have been.
  - While here, switch a print() to printc() as it's expected that logos may
contain color and other escpae sequences that we'll need to honor.

Modified:
  head/stand/lua/drawer.lua
  head/stand/lua/menu.lua

Modified: head/stand/lua/drawer.lua
==
--- head/stand/lua/drawer.lua   Sat Mar  3 18:12:21 2018(r330344)
+++ head/stand/lua/drawer.lua   Sat Mar  3 18:13:14 2018(r330345)
@@ -205,9 +205,9 @@ drawer.menu_name_handlers = {
 }
 
 drawer.brand_position = {x = 2, y = 1}
-drawer.logo_position = {x = 46, y = 1}
-drawer.menu_position = {x = 6, y = 11}
-drawer.box_pos_dim = {x = 3, y = 10, w = 41, h = 11}
+drawer.logo_position = {x = 46, y = 4}
+drawer.menu_position = {x = 5, y = 10}
+drawer.frame_size = {w = 42, h = 13}
 
 drawer.branddefs = {
-- Indexed by valid values for loader_brand in loader.conf(5). Valid
@@ -337,10 +337,10 @@ function drawer.drawmenu(menudef)
 end
 
 function drawer.drawbox()
-   local x = drawer.box_pos_dim.x
-   local y = drawer.box_pos_dim.y
-   local w = drawer.box_pos_dim.w
-   local h = drawer.box_pos_dim.h
+   local x = drawer.menu_position.x - 3
+   local y = drawer.menu_position.y - 1
+   local w = drawer.frame_size.w
+   local h = drawer.frame_size.h
 
local framestyle = loader.getenv("loader_menu_frame") or "double"
local framespec = drawer.frame_styles[framestyle]
@@ -404,8 +404,8 @@ end
 
 function drawer.draw(x, y, logo)
for i = 1, #logo do
-   screen.setcursor(x, y + i)
-   print(logo[i])
+   screen.setcursor(x, y + i - 1)
+   printc(logo[i])
end
 end
 

Modified: head/stand/lua/menu.lua
==
--- head/stand/lua/menu.lua Sat Mar  3 18:12:21 2018(r330344)
+++ head/stand/lua/menu.lua Sat Mar  3 18:13:14 2018(r330345)
@@ -420,8 +420,8 @@ function menu.autoboot()
end
ab = tonumber(ab) or 10
 
-   local x = loader.getenv("loader_menu_timeout_x") or 5
-   local y = loader.getenv("loader_menu_timeout_y") or 22
+   local x = loader.getenv("loader_menu_timeout_x") or 4
+   local y = loader.getenv("loader_menu_timeout_y") or 23
 
local endtime = loader.time() + ab
local time
___
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: r330344 - head/sys/kern

2018-03-03 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Mar  3 18:12:21 2018
New Revision: 330344
URL: https://svnweb.freebsd.org/changeset/base/330344

Log:
  Correct the return code from pause() during cold startup from zero to
  EWOULDBLOCK. This also matches the description in pause(9).
  
  Discussed with:   kib@
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/kern/kern_synch.c

Modified: head/sys/kern/kern_synch.c
==
--- head/sys/kern/kern_synch.c  Sat Mar  3 18:11:02 2018(r330343)
+++ head/sys/kern/kern_synch.c  Sat Mar  3 18:12:21 2018(r330344)
@@ -326,7 +326,7 @@ pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_
sbt = howmany(sbt, SBT_1US);
if (sbt > 0)
DELAY(sbt);
-   return (0);
+   return (EWOULDBLOCK);
}
return (_sleep(&pause_wchan[curcpu], NULL, 0, wmesg, sbt, pr, 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: r330346 - head/stand/lua

2018-03-03 Thread Kyle Evans
Author: kevans
Date: Sat Mar  3 18:25:50 2018
New Revision: 330346
URL: https://svnweb.freebsd.org/changeset/base/330346

Log:
  lualoader: Shift menu+brand even for logo=none with customized pos

Modified:
  head/stand/lua/drawer.lua

Modified: head/stand/lua/drawer.lua
==
--- head/stand/lua/drawer.lua   Sat Mar  3 18:13:14 2018(r330345)
+++ head/stand/lua/drawer.lua   Sat Mar  3 18:25:50 2018(r330346)
@@ -43,7 +43,6 @@ local fbsd_logo_v
 local orb_color
 local orb
 local none
-local none_shifted = false
 
 local function menuEntryName(drawing_menu, entry)
local name_handler = drawer.menu_name_handlers[entry.entry_type]
@@ -57,15 +56,6 @@ local function menuEntryName(drawing_menu, entry)
return entry.name
 end
 
-local function shiftBrandText(shift)
-   drawer.brand_position.x = drawer.brand_position.x + shift.x
-   drawer.brand_position.y = drawer.brand_position.y + shift.y
-   drawer.menu_position.x = drawer.menu_position.x + shift.x
-   drawer.menu_position.y = drawer.menu_position.y + shift.y
-   drawer.box_pos_dim.x = drawer.box_pos_dim.x + shift.x
-   drawer.box_pos_dim.y = drawer.box_pos_dim.y + shift.y
-end
-
 fbsd_logo = {
 "  __      _ _  ",
 " |  | |  _ \\ / |  __ \\ ",
@@ -208,6 +198,8 @@ drawer.brand_position = {x = 2, y = 1}
 drawer.logo_position = {x = 46, y = 4}
 drawer.menu_position = {x = 5, y = 10}
 drawer.frame_size = {w = 42, h = 13}
+drawer.default_shift = {x = 0, y = 0}
+drawer.shift = drawer.default_shift
 
 drawer.branddefs = {
-- Indexed by valid values for loader_brand in loader.conf(5). Valid
@@ -299,6 +291,9 @@ function drawer.drawmenu(menudef)
local x = drawer.menu_position.x
local y = drawer.menu_position.y
 
+   x = x + drawer.shift.x
+   y = y + drawer.shift.y
+
-- print the menu and build the alias table
local alias_table = {}
local entry_num = 0
@@ -358,6 +353,9 @@ function drawer.drawbox()
local tr = framespec.top_right
local br = framespec.bottom_right
 
+   x = x + drawer.shift.x
+   y = y + drawer.shift.y
+
screen.setcursor(x, y); printc(tl)
screen.setcursor(x, y + h); printc(bl)
screen.setcursor(x + w, y); printc(tr)
@@ -419,6 +417,9 @@ function drawer.drawbrand()
if graphic == nil then
graphic = fbsd_logo
end
+
+   x = x + drawer.shift.x
+   y = y + drawer.shift.y
drawer.draw(x, y, graphic)
 end
 
@@ -434,13 +435,7 @@ function drawer.drawlogo()
-- Lookup
local logodef = drawer.logodefs[logo]
 
-   if logodef ~= nil and logodef.graphic == none then
-   -- centre brand and text if no logo
-   if not none_shifted then
-   shiftBrandText(logodef.shift)
-   none_shifted = true
-   end
-   elseif logodef == nil or logodef.graphic == nil or
+   if logodef == nil or logodef.graphic == nil or
(not colored and logodef.requires_color) then
-- Choose a sensible default
if colored then
@@ -449,10 +444,21 @@ function drawer.drawlogo()
logodef = drawer.logodefs["orbbw"]
end
end
-   if logodef.shift ~= nil then
+
+   if logodef ~= nil and logodef.graphic == none then
+   drawer.shift = logodef.shift
+   else
+   drawer.shift = drawer.default_shift
+   end
+
+   x = x + drawer.shift.x
+   y = y + drawer.shift.y
+
+   if logdef ~= nil and logodef.shift ~= nil then
x = x + logodef.shift.x
y = y + logodef.shift.y
end
+
drawer.draw(x, y, logodef.graphic)
 end
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330347 - head/sys/arm/allwinner

2018-03-03 Thread Emmanuel Vadot
Author: manu
Date: Sat Mar  3 18:28:19 2018
New Revision: 330347
URL: https://svnweb.freebsd.org/changeset/base/330347

Log:
  axp81x: Add support for AXP803
  
  AXP803 and AXP813/818 are very similar, only two regulators differs.
  AXP803 is the companion chip for A64/R18
  AXP813 is the companion chip for A83T
  AXP818 is the companion chip for H8 (~A83T)
  Add support for all regulators found in both of them.

Modified:
  head/sys/arm/allwinner/axp81x.c

Modified: head/sys/arm/allwinner/axp81x.c
==
--- head/sys/arm/allwinner/axp81x.c Sat Mar  3 18:25:50 2018
(r330346)
+++ head/sys/arm/allwinner/axp81x.c Sat Mar  3 18:28:19 2018
(r330347)
@@ -1,4 +1,5 @@
 /*-
+ * Copyright (c) 2018 Emmanuel Vadot 
  * Copyright (c) 2016 Jared McNeill 
  * All rights reserved.
  *
@@ -27,7 +28,7 @@
  */
 
 /*
- * X-Powers AXP813/818 PMU for Allwinner SoCs
+ * X-Powers AXP803/813/818 PMU for Allwinner SoCs
  */
 
 #include 
@@ -58,14 +59,59 @@ __FBSDID("$FreeBSD$");
 #include "iicbus_if.h"
 #include "regdev_if.h"
 
-MALLOC_DEFINE(M_AXP81X_REG, "AXP81x regulator", "AXP81x power regulator");
+MALLOC_DEFINE(M_AXP8XX_REG, "AXP8xx regulator", "AXP8xx power regulator");
 
+#defineAXP_POWERSRC0x00
+#define AXP_POWERSRC_ACIN  (1 << 7)
+#define AXP_POWERSRC_VBUS  (1 << 5)
+#define AXP_POWERSRC_VBAT  (1 << 3)
+#define AXP_POWERSRC_CHARING   (1 << 2)
+#define AXP_POWERSRC_SHORTED   (1 << 1)
+#define AXP_POWERSRC_STARTUP   (1 << 0)
 #defineAXP_ICTYPE  0x03
 #defineAXP_POWERCTL1   0x10
+#define AXP_POWERCTL1_DCDC7(1 << 6)/* AXP813/818 only */
+#define AXP_POWERCTL1_DCDC6(1 << 5)
+#define AXP_POWERCTL1_DCDC5(1 << 4)
+#define AXP_POWERCTL1_DCDC4(1 << 3)
+#define AXP_POWERCTL1_DCDC3(1 << 2)
 #define AXP_POWERCTL1_DCDC2(1 << 1)
+#define AXP_POWERCTL1_DCDC1(1 << 0)
 #defineAXP_POWERCTL2   0x12
-#define AXP_POWERCTL2_DC1SW(1 << 7)
+#define AXP_POWERCTL2_DC1SW(1 << 7)/* AXP803 only */
+#define AXP_POWERCTL2_DLDO4(1 << 6)
+#define AXP_POWERCTL2_DLDO3(1 << 5)
+#define AXP_POWERCTL2_DLDO2(1 << 4)
+#define AXP_POWERCTL2_DLDO1(1 << 3)
+#define AXP_POWERCTL2_ELDO3(1 << 2)
+#define AXP_POWERCTL2_ELDO2(1 << 1)
+#define AXP_POWERCTL2_ELDO1(1 << 0)
+#defineAXP_POWERCTL3   0x13
+#define AXP_POWERCTL3_ALDO3(1 << 7)
+#define AXP_POWERCTL3_ALDO2(1 << 6)
+#define AXP_POWERCTL3_ALDO1(1 << 5)
+#define AXP_POWERCTL3_FLDO3(1 << 4)/* AXP813/818 only */
+#define AXP_POWERCTL3_FLDO2(1 << 3)
+#define AXP_POWERCTL3_FLDO1(1 << 2)
+#defineAXP_VOLTCTL_DLDO1   0x15
+#defineAXP_VOLTCTL_DLDO2   0x16
+#defineAXP_VOLTCTL_DLDO3   0x17
+#defineAXP_VOLTCTL_DLDO4   0x18
+#defineAXP_VOLTCTL_ELDO1   0x19
+#defineAXP_VOLTCTL_ELDO2   0x1A
+#defineAXP_VOLTCTL_ELDO3   0x1B
+#defineAXP_VOLTCTL_FLDO1   0x1C
+#defineAXP_VOLTCTL_FLDO2   0x1D
+#defineAXP_VOLTCTL_DCDC1   0x20
 #defineAXP_VOLTCTL_DCDC2   0x21
+#defineAXP_VOLTCTL_DCDC3   0x22
+#defineAXP_VOLTCTL_DCDC4   0x23
+#defineAXP_VOLTCTL_DCDC5   0x24
+#defineAXP_VOLTCTL_DCDC6   0x25
+#defineAXP_VOLTCTL_DCDC7   0x26
+#defineAXP_VOLTCTL_ALDO1   0x28
+#defineAXP_VOLTCTL_ALDO2   0x29
+#defineAXP_VOLTCTL_ALDO3   0x2A
 #define AXP_VOLTCTL_STATUS (1 << 7)
 #define AXP_VOLTCTL_MASK   0x7f
 #defineAXP_POWERBAT0x32
@@ -92,23 +138,29 @@ MALLOC_DEFINE(M_AXP81X_REG, "AXP81x regulator", "AXP81
 static const struct {
const char *name;
uint8_t ctrl_reg;
-} axp81x_pins[] = {
+} axp8xx_pins[] = {
{ "GPIO0", AXP_GPIO0_CTRL },
{ "GPIO1", AXP_GPIO1_CTRL },
 };
 
+enum AXP8XX_TYPE {
+   AXP803 = 1,
+   AXP813,
+};
+
 static struct ofw_compat_data compat_data[] = {
-   { "x-powers,axp813",1 },
-   { "x-powers,axp818",1 },
+   { "x-powers,axp803",AXP803 },
+   { "x-powers,axp813",AXP813 },
+   { "x-powers,axp818",AXP813 },
{ NULL, 0 }
 };
 
-static struct resource_spec axp81x_spec[] = {
+static struct resource_spec axp8xx_spec[] = {
{ SYS_RES_IRQ,  0,  RF_ACTIVE },
{ -1, 0 }
 };
 
-struct axp81x_regdef {
+struct axp8xx_regdef {
intptr_tid;
char*name;
char*supply_

svn commit: r330348 - head/sys/arm/allwinner

2018-03-03 Thread Emmanuel Vadot
Author: manu
Date: Sat Mar  3 18:30:31 2018
New Revision: 330348
URL: https://svnweb.freebsd.org/changeset/base/330348

Log:
  aw_mmc: Regulator improvement
  
  Getting regulator is good, enabling them is better.
  When the mmc stack decide to change the voltage for IO, don't
  change the main vcc of the sd/mmc, only the io vcc.

Modified:
  head/sys/arm/allwinner/aw_mmc.c

Modified: head/sys/arm/allwinner/aw_mmc.c
==
--- head/sys/arm/allwinner/aw_mmc.c Sat Mar  3 18:28:19 2018
(r330347)
+++ head/sys/arm/allwinner/aw_mmc.c Sat Mar  3 18:30:31 2018
(r330348)
@@ -267,11 +267,17 @@ aw_mmc_attach(device_t dev)
bus_width = 4;
 
if (regulator_get_by_ofw_property(dev, 0, "vmmc-supply",
-   &sc->aw_reg_vmmc) == 0 && bootverbose)
-   device_printf(dev, "vmmc-supply regulator found\n");
+   &sc->aw_reg_vmmc) == 0) {
+   if (bootverbose)
+   device_printf(dev, "vmmc-supply regulator found\n");
+   regulator_enable(sc->aw_reg_vmmc);
+   }
if (regulator_get_by_ofw_property(dev, 0, "vqmmc-supply",
-   &sc->aw_reg_vqmmc) == 0 && bootverbose)
-   device_printf(dev, "vqmmc-supply regulator found\n");
+   &sc->aw_reg_vqmmc) == 0 && bootverbose) {
+   if (bootverbose)
+   device_printf(dev, "vqmmc-supply regulator found\n");
+   regulator_enable(sc->aw_reg_vqmmc);
+   }
 
sc->aw_host.f_min = 40;
sc->aw_host.f_max = 5200;
@@ -861,7 +867,7 @@ aw_mmc_set_power(struct aw_mmc_softc *sc, int32_t vdd)
 
sc->aw_vdd = vdd;
 
-   if (sc->aw_reg_vmmc == NULL && sc->aw_reg_vqmmc == NULL)
+   if (sc->aw_reg_vqmmc == NULL)
return;
 
switch (1 << vdd) {
@@ -878,13 +884,6 @@ aw_mmc_set_power(struct aw_mmc_softc *sc, int32_t vdd)
break;
}
 
-   if (sc->aw_reg_vmmc)
-   if (regulator_set_voltage(sc->aw_reg_vmmc,
-   min_uvolt, max_uvolt) != 0)
-   device_printf(sc->aw_dev,
-   "Cannot set vmmc to %d<->%d\n",
-   min_uvolt,
-   max_uvolt);
if (sc->aw_reg_vqmmc)
if (regulator_set_voltage(sc->aw_reg_vqmmc,
min_uvolt, max_uvolt) != 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330349 - in head/sys: kern sys

2018-03-03 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Mar  3 18:36:38 2018
New Revision: 330349
URL: https://svnweb.freebsd.org/changeset/base/330349

Log:
  Allow pause_sbt() to catch signals during sleep by passing C_CATCH flag.
  Define pause_sig() function macro helper similarly to other kernel functions
  which catch signals. Update outdated function description.
  
  Discussed with:   kib@
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/kern/kern_synch.c
  head/sys/sys/callout.h
  head/sys/sys/systm.h

Modified: head/sys/kern/kern_synch.c
==
--- head/sys/kern/kern_synch.c  Sat Mar  3 18:30:31 2018(r330348)
+++ head/sys/kern/kern_synch.c  Sat Mar  3 18:36:38 2018(r330349)
@@ -297,16 +297,16 @@ msleep_spin_sbt(void *ident, struct mtx *mtx, const ch
 }
 
 /*
- * pause() delays the calling thread by the given number of system ticks.
- * During cold bootup, pause() uses the DELAY() function instead of
- * the tsleep() function to do the waiting. The "timo" argument must be
- * greater than or equal to zero. A "timo" value of zero is equivalent
- * to a "timo" value of one.
+ * pause_sbt() delays the calling thread by the given signed binary
+ * time. During cold bootup, pause_sbt() uses the DELAY() function
+ * instead of the _sleep() function to do the waiting. The "sbt"
+ * argument must be greater than or equal to zero. A "sbt" value of
+ * zero is equivalent to a "sbt" value of one tick.
  */
 int
 pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags)
 {
-   KASSERT(sbt >= 0, ("pause: timeout must be >= 0"));
+   KASSERT(sbt >= 0, ("pause_sbt: timeout must be >= 0"));
 
/* silently convert invalid timeouts */
if (sbt == 0)
@@ -328,7 +328,8 @@ pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_
DELAY(sbt);
return (EWOULDBLOCK);
}
-   return (_sleep(&pause_wchan[curcpu], NULL, 0, wmesg, sbt, pr, flags));
+   return (_sleep(&pause_wchan[curcpu], NULL,
+   (flags & C_CATCH) ? PCATCH : 0, wmesg, sbt, pr, flags));
 }
 
 /*

Modified: head/sys/sys/callout.h
==
--- head/sys/sys/callout.h  Sat Mar  3 18:30:31 2018(r330348)
+++ head/sys/sys/callout.h  Sat Mar  3 18:36:38 2018(r330349)
@@ -60,6 +60,7 @@
 #defineC_HARDCLOCK 0x0100 /* align to hardclock() calls */
 #defineC_ABSOLUTE  0x0200 /* event time is absolute. */
 #defineC_PRECALC   0x0400 /* event time is pre-calculated. 
*/
+#defineC_CATCH 0x0800 /* catch signals, used by 
pause_sbt(9) */
 
 struct callout_handle {
struct callout *callout;

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hSat Mar  3 18:30:31 2018(r330348)
+++ head/sys/sys/systm.hSat Mar  3 18:36:38 2018(r330349)
@@ -411,6 +411,8 @@ int pause_sbt(const char *wmesg, sbintime_t sbt, sbint
int flags);
 #definepause(wmesg, timo)  
\
pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK)
+#definepause_sig(wmesg, timo)  
\
+   pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK | C_CATCH)
 #definetsleep(chan, pri, wmesg, timo)  
\
_sleep((chan), NULL, (pri), (wmesg), tick_sbt * (timo), \
0, C_HARDCLOCK)
___
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: r330350 - head/sys/arm/allwinner

2018-03-03 Thread Kyle Evans
Author: kevans
Date: Sat Mar  3 18:40:46 2018
New Revision: 330350
URL: https://svnweb.freebsd.org/changeset/base/330350

Log:
  aw_syscon(4): Move to BUS_PASS_SUPPORTDEV
  
  It would have been on an actual named pass before, but none were really
  appropriate in name. Move it to the recently created SUPPORTDEV pass, which
  perfectly describes it and keeps it in the right order.

Modified:
  head/sys/arm/allwinner/aw_syscon.c

Modified: head/sys/arm/allwinner/aw_syscon.c
==
--- head/sys/arm/allwinner/aw_syscon.c  Sat Mar  3 18:36:38 2018
(r330349)
+++ head/sys/arm/allwinner/aw_syscon.c  Sat Mar  3 18:40:46 2018
(r330350)
@@ -80,5 +80,5 @@ DEFINE_CLASS_1(aw_syscon, aw_syscon_driver, aw_syscon_
 static devclass_t aw_syscon_devclass;
 /* aw_syscon needs to attach prior to if_awg */
 EARLY_DRIVER_MODULE(aw_syscon, simplebus, aw_syscon_driver, aw_syscon_devclass,
-0, 0, BUS_PASS_DEFAULT - 1000);
+0, 0, BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE);
 MODULE_VERSION(aw_syscon, 1);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330351 - head/sys/arm/freescale/imx

2018-03-03 Thread Kyle Evans
Author: kevans
Date: Sat Mar  3 18:52:19 2018
New Revision: 330351
URL: https://svnweb.freebsd.org/changeset/base/330351

Log:
  Move imx6_usbphy to SUPPORTDEV, massage associated comment
  
  No objections from:   ian

Modified:
  head/sys/arm/freescale/imx/imx6_usbphy.c

Modified: head/sys/arm/freescale/imx/imx6_usbphy.c
==
--- head/sys/arm/freescale/imx/imx6_usbphy.cSat Mar  3 18:40:46 2018
(r330350)
+++ head/sys/arm/freescale/imx/imx6_usbphy.cSat Mar  3 18:52:19 2018
(r330351)
@@ -202,9 +202,9 @@ static devclass_t usbphy_devclass;
 
 /*
  * This driver needs to start before the ehci driver, but later than the usual
- * "special" drivers like clocks and cpu.  Ehci starts at DEFAULT so
- * DEFAULT-1000 seems good.
+ * "special" drivers like clocks and cpu.  Ehci starts at DEFAULT so SUPPORTDEV
+ * is where this driver fits most.
  */
 EARLY_DRIVER_MODULE(usbphy, simplebus, usbphy_driver, usbphy_devclass, 0, 0,
-BUS_PASS_DEFAULT - 1000);
+BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE);
 
___
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: r330352 - in head/sys/compat/linuxkpi/common: include/linux src

2018-03-03 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Mar  3 18:54:16 2018
New Revision: 330352
URL: https://svnweb.freebsd.org/changeset/base/330352

Log:
  Implement msleep_interruptible() in the LinuxKPI. While at it use pause_sbt()
  instead of pause() in the msleep() function to avoid rounding errors when
  converting delay values forth and back. Add a guard for a delay value
  of zero milliseconds which is undefined.
  
  MFC after:1 week
  Requested by: Johannes Lundberg 
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/delay.h
  head/sys/compat/linuxkpi/common/src/linux_schedule.c

Modified: head/sys/compat/linuxkpi/common/include/linux/delay.h
==
--- head/sys/compat/linuxkpi/common/include/linux/delay.h   Sat Mar  3 
18:52:19 2018(r330351)
+++ head/sys/compat/linuxkpi/common/include/linux/delay.h   Sat Mar  3 
18:54:16 2018(r330352)
@@ -36,14 +36,20 @@
 #include 
 
 static inline void
-linux_msleep(int ms)
+linux_msleep(unsigned int ms)
 {
-   pause("lnxsleep", msecs_to_jiffies(ms));
+   /* guard against invalid values */
+   if (ms == 0)
+   ms = 1;
+   pause_sbt("lnxsleep", SBT_1MS * ms, 0, C_HARDCLOCK);
 }
 
 #undef msleep
-#definemsleep  linux_msleep
+#definemsleep(ms) linux_msleep(ms)
 
+#undef msleep_interruptible
+#definemsleep_interruptible(ms) linux_msleep_interruptible(ms)
+
 #defineudelay(t)   DELAY(t)
 
 static inline void
@@ -64,5 +70,7 @@ usleep_range(unsigned long min, unsigned long max)
 {
DELAY(min);
 }
+
+extern unsigned int linux_msleep_interruptible(unsigned int ms);
 
 #endif /* _LINUX_DELAY_H_ */

Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c
==
--- head/sys/compat/linuxkpi/common/src/linux_schedule.cSat Mar  3 
18:52:19 2018(r330351)
+++ head/sys/compat/linuxkpi/common/src/linux_schedule.cSat Mar  3 
18:54:16 2018(r330352)
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -72,6 +73,25 @@ linux_add_to_sleepqueue(void *wchan, struct task_struc
ret = -ERESTARTSYS;
}
return (ret);
+}
+
+unsigned int
+linux_msleep_interruptible(unsigned int ms)
+{
+   int ret;
+
+   /* guard against invalid values */
+   if (ms == 0)
+   ms = 1;
+   ret = -pause_sbt("lnxsleep", SBT_1MS * ms, 0, C_HARDCLOCK | C_CATCH);
+
+   switch (ret) {
+   case -EWOULDBLOCK:
+   return (0);
+   default:
+   linux_schedule_save_interrupt_value(current, ret);
+   return (ms);
+   }
 }
 
 static int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r330352 - in head/sys/compat/linuxkpi/common: include/linux src

2018-03-03 Thread Ian Lepore
On Sat, 2018-03-03 at 18:54 +, Hans Petter Selasky wrote:
> Author: hselasky
> Date: Sat Mar  3 18:54:16 2018
> New Revision: 330352
> URL: https://svnweb.freebsd.org/changeset/base/330352
> 
> Log:
>   Implement msleep_interruptible() in the LinuxKPI. While at it use 
> pause_sbt()
>   instead of pause() in the msleep() function to avoid rounding errors when
>   converting delay values forth and back. Add a guard for a delay value
>   of zero milliseconds which is undefined.
>   
>   MFC after:  1 week
>   Requested by:   Johannes Lundberg 
>   Sponsored by:   Mellanox Technologies
> 
> Modified:
>   head/sys/compat/linuxkpi/common/include/linux/delay.h
>   head/sys/compat/linuxkpi/common/src/linux_schedule.c
> 
> Modified: head/sys/compat/linuxkpi/common/include/linux/delay.h
> ==
> --- head/sys/compat/linuxkpi/common/include/linux/delay.h Sat Mar  3 
> 18:52:19 2018(r330351)
> +++ head/sys/compat/linuxkpi/common/include/linux/delay.h Sat Mar  3 
> 18:54:16 2018(r330352)
> @@ -36,14 +36,20 @@
>  #include 
>  
>  static inline void
> -linux_msleep(int ms)
> +linux_msleep(unsigned int ms)
>  {
> - pause("lnxsleep", msecs_to_jiffies(ms));
> + /* guard against invalid values */
> + if (ms == 0)
> + ms = 1;
> + pause_sbt("lnxsleep", SBT_1MS * ms, 0, C_HARDCLOCK);
>  }
>  

To really avoid roundoff errors, use mstosbt(ms) instead of SBT_1MS*ms.

The rounding errors when multiplying or dividing by SBT_1MS is not
severe like it is with SBT_1NS, but the inline functions still do the
arithmetic more correctly to avoid roundoff error.

-- 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: r309017 - in head/sys: cddl/compat/opensolaris/sys compat/linprocfs fs/tmpfs sys vm

2018-03-03 Thread Alan Cox
On 03/03/2018 02:48, Alexey Dokuchaev wrote:
> On Tue, Nov 22, 2016 at 06:13:46PM +, Alan Cox wrote:
>> New Revision: 309017
>> URL: https://svnweb.freebsd.org/changeset/base/309017
>>
>> Log:
>>   Remove PG_CACHED-related fields from struct vmmeter, because they are no
>>   longer used.  More precisely, they are always zero because the code that
>>   decremented and incremented them no longer exists.
>>   
>>   Bump __FreeBSD_version to mark this change.
>>   
>>   Reviewed by:   kib, markj
>>   Sponsored by:  Dell EMC Isilon
>>   Differential Revision: https://reviews.freebsd.org/D8583
>>
>> Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h
>> ...
>> -#define freemem (vm_cnt.v_free_count + 
>> vm_cnt.v_cache_count)
>> +#define freemem vm_cnt.v_free_count
> This looks correct now.
>
>> Modified: head/sys/compat/linprocfs/linprocfs.c
>> ...
>> @@ -176,7 +176,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS)
>>   * like unstaticizing it just for linprocfs's sake.
>>   */
>>  buffers = 0;
>> -cached = vm_cnt.v_cache_count * PAGE_SIZE;
>> +cached = vm_cnt.v_inactive_count * PAGE_SIZE;
> Some applications that make calculations based on the readings from the
> /usr/compat/linux/proc/meminfo are broken after this change, e.g. those
> that do things like:
>
> return (totalMem - (freeMem + buffers + cache)) / totalMem;
>
> because now free memory includes cached one, and above formula gives
> bogus negative result.
>
> In `sys/compat/linprocfs/linprocfs.c', memfree is calculated as follows:
>
> memtotal = physmem * PAGE_SIZE;
> /*
>  * The correct thing here would be:
>  *
> memfree = vm_cnt.v_free_count * PAGE_SIZE;
> memused = memtotal - memfree;
>  *
>  * but it might mislead linux binaries into thinking there
>  * is very little memory left, so we cheat and tell them that
>  * all memory that isn't wired down is free.
>  */
> memused = vm_cnt.v_wire_count * PAGE_SIZE;
> memfree = memtotal - memused;
>
> So, when vm.stats.vm.v_cache_count was yielding some (typically small)
> result, using the aforementioned trick made sense (because even when
> vm_cnt.v_free_count added to vm.stats.vm.v_cache_count it would still
> be rather small).  This logic no longer applies after this change.
>
> On my 12-CURRENT i386 system, /usr/compat/linux/proc/meminfo reports:
>
> % cat /usr/compat/linux/proc/meminfo | head -4
> MemTotal:   3132504 kB
> MemFree:2925936 kB<<< that's a lot
> Buffers:  0 kB
> Cached: 2212196 kB<<< that's also a lot
>
> On an older 4.11-STABLE box (also i386), it reports:
>
> MemTotal:521828 kB
> MemFree: 383976 kB
> MemShared: 7480 kB
> Buffers:  0 kB
> Cached:   22732 kB (can be added to MemFree and still < MemTotal)
>
> So either the "cheat" have to go away and vm_cnt.v_free_count used as it
> should, or cached memory should not be read from vm_cnt.v_inactive_count
> but estimated somehow else.  Which approach would be more correct?

The former.


___
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: r330353 - in head/sys/compat/linuxkpi/common: include/linux src

2018-03-03 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Mar  3 19:26:40 2018
New Revision: 330353
URL: https://svnweb.freebsd.org/changeset/base/330353

Log:
  Use mstosbt() instead of SBT_1MS in the LinuxKPI to get the last few bits
  of precision.
  
  MFC after:1 week
  Suggested by: ian@
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/delay.h
  head/sys/compat/linuxkpi/common/src/linux_schedule.c

Modified: head/sys/compat/linuxkpi/common/include/linux/delay.h
==
--- head/sys/compat/linuxkpi/common/include/linux/delay.h   Sat Mar  3 
18:54:16 2018(r330352)
+++ head/sys/compat/linuxkpi/common/include/linux/delay.h   Sat Mar  3 
19:26:40 2018(r330353)
@@ -41,7 +41,7 @@ linux_msleep(unsigned int ms)
/* guard against invalid values */
if (ms == 0)
ms = 1;
-   pause_sbt("lnxsleep", SBT_1MS * ms, 0, C_HARDCLOCK);
+   pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK);
 }
 
 #undef msleep

Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c
==
--- head/sys/compat/linuxkpi/common/src/linux_schedule.cSat Mar  3 
18:54:16 2018(r330352)
+++ head/sys/compat/linuxkpi/common/src/linux_schedule.cSat Mar  3 
19:26:40 2018(r330353)
@@ -83,7 +83,7 @@ linux_msleep_interruptible(unsigned int ms)
/* guard against invalid values */
if (ms == 0)
ms = 1;
-   ret = -pause_sbt("lnxsleep", SBT_1MS * ms, 0, C_HARDCLOCK | C_CATCH);
+   ret = -pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK | C_CATCH);
 
switch (ret) {
case -EWOULDBLOCK:
___
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: r330352 - in head/sys/compat/linuxkpi/common: include/linux src

2018-03-03 Thread Hans Petter Selasky

On 03/03/18 20:14, Ian Lepore wrote:

On Sat, 2018-03-03 at 18:54 +, Hans Petter Selasky wrote:

Author: hselasky
Date: Sat Mar  3 18:54:16 2018
New Revision: 330352
URL: https://svnweb.freebsd.org/changeset/base/330352

Log:
   Implement msleep_interruptible() in the LinuxKPI. While at it use pause_sbt()
   instead of pause() in the msleep() function to avoid rounding errors when
   converting delay values forth and back. Add a guard for a delay value
   of zero milliseconds which is undefined.
   
   MFC after:	1 week

   Requested by:Johannes Lundberg 
   Sponsored by:Mellanox Technologies

Modified:
   head/sys/compat/linuxkpi/common/include/linux/delay.h
   head/sys/compat/linuxkpi/common/src/linux_schedule.c

Modified: head/sys/compat/linuxkpi/common/include/linux/delay.h
==
--- head/sys/compat/linuxkpi/common/include/linux/delay.h   Sat Mar  3 
18:52:19 2018(r330351)
+++ head/sys/compat/linuxkpi/common/include/linux/delay.h   Sat Mar  3 
18:54:16 2018(r330352)
@@ -36,14 +36,20 @@
  #include
  
  static inline void

-linux_msleep(int ms)
+linux_msleep(unsigned int ms)
  {
-   pause("lnxsleep", msecs_to_jiffies(ms));
+   /* guard against invalid values */
+   if (ms == 0)
+   ms = 1;
+   pause_sbt("lnxsleep", SBT_1MS * ms, 0, C_HARDCLOCK);
  }
  


To really avoid roundoff errors, use mstosbt(ms) instead of SBT_1MS*ms.



You're right. See r330353. Really, this only makes a noticable 
difference for larger timeouts.


--HPS
___
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: r330354 - head/sys/fs/fuse

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 20:42:39 2018
New Revision: 330354
URL: https://svnweb.freebsd.org/changeset/base/330354

Log:
  sys/fuse: fix off by one error
  
  Reported by:  Ilja Van Sprundel 
  Reported by:  Domagoj Stolfa 

Modified:
  head/sys/fs/fuse/fuse_internal.c

Modified: head/sys/fs/fuse/fuse_internal.c
==
--- head/sys/fs/fuse/fuse_internal.cSat Mar  3 19:26:40 2018
(r330353)
+++ head/sys/fs/fuse/fuse_internal.cSat Mar  3 20:42:39 2018
(r330354)
@@ -357,7 +357,7 @@ fuse_internal_readdir_processdata(struct uio *uio,
memcpy((char *)cookediov->base + sizeof(struct dirent) - 
   MAXNAMLEN - 1,
   (char *)buf + FUSE_NAME_OFFSET, fudge->namelen);
-   ((char *)cookediov->base)[bytesavail] = '\0';
+   ((char *)cookediov->base)[bytesavail - 1] = '\0';
 
err = uiomove(cookediov->base, cookediov->len, uio);
if (err) {
___
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: r330352 - in head/sys/compat/linuxkpi/common: include/linux src

2018-03-03 Thread Konstantin Belousov
On Sat, Mar 03, 2018 at 12:14:42PM -0700, Ian Lepore wrote:
> To really avoid roundoff errors, use mstosbt(ms) instead of SBT_1MS*ms.
> 
> The rounding errors when multiplying or dividing by SBT_1MS is not
> severe like it is with SBT_1NS, but the inline functions still do the
> arithmetic more correctly to avoid roundoff error.

BTW mstosbt() and other functions have weird bracing in the formula. I
think that the formula as calculated by the C operator precedence is
fine, i.e. multiplication is done before right shift. But the bracing
is redundand then, because the '()' pair next to the return () braces by
inclusion is tautological.
___
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: r330352 - in head/sys/compat/linuxkpi/common: include/linux src

2018-03-03 Thread Ian Lepore
On Sat, 2018-03-03 at 22:49 +0200, Konstantin Belousov wrote:
> On Sat, Mar 03, 2018 at 12:14:42PM -0700, Ian Lepore wrote:
> > 
> > To really avoid roundoff errors, use mstosbt(ms) instead of SBT_1MS*ms.
> > 
> > The rounding errors when multiplying or dividing by SBT_1MS is not
> > severe like it is with SBT_1NS, but the inline functions still do the
> > arithmetic more correctly to avoid roundoff error.
> BTW mstosbt() and other functions have weird bracing in the formula. I
> think that the formula as calculated by the C operator precedence is
> fine, i.e. multiplication is done before right shift. But the bracing
> is redundand then, because the '()' pair next to the return () braces by
> inclusion is tautological.

Yeah, I noticed earlier today there is an extra set of parens.  I think
I might have copied the code from being a multi-line expression to
being all in the return and just pasted it without removing the extra
parens.

In general, I prefer extra parens instead of relying on knowledge of
operator precedence, but it makes no sense for the outermost layer of
parens.

-- 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: r330352 - in head/sys/compat/linuxkpi/common: include/linux src

2018-03-03 Thread Ian Lepore
On Sat, 2018-03-03 at 22:49 +0200, Konstantin Belousov wrote:
> On Sat, Mar 03, 2018 at 12:14:42PM -0700, Ian Lepore wrote:
> > 
> > To really avoid roundoff errors, use mstosbt(ms) instead of SBT_1MS*ms.
> > 
> > The rounding errors when multiplying or dividing by SBT_1MS is not
> > severe like it is with SBT_1NS, but the inline functions still do the
> > arithmetic more correctly to avoid roundoff error.
> BTW mstosbt() and other functions have weird bracing in the formula. I
> think that the formula as calculated by the C operator precedence is
> fine, i.e. multiplication is done before right shift. But the bracing
> is redundand then, because the '()' pair next to the return () braces by
> inclusion is tautological.
> 

Oh, on looking closer, it's not a paste-o, I just didn't put the
closing paren where I had intended to for making it clear the shift
happens last.  (So almost everyone except me is still going to think a
fix has redundant parens.)

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


svn commit: r330355 - stable/11/sys/kern

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 21:05:28 2018
New Revision: 330355
URL: https://svnweb.freebsd.org/changeset/base/330355

Log:
  MFC r305137:
  
  Eliminate unnecessary loop in _cap_check()
  
  Calling cap_rights_contains() several times with the same inputs is not
  going to produce a different output. The variable being iterated, i, is
  never used inside the for loop.
  
  The loop is actually done in cap_rights_contains()

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

Modified: stable/11/sys/kern/sys_capability.c
==
--- stable/11/sys/kern/sys_capability.c Sat Mar  3 20:42:39 2018
(r330354)
+++ stable/11/sys/kern/sys_capability.c Sat Mar  3 21:05:28 2018
(r330355)
@@ -154,16 +154,13 @@ static inline int
 _cap_check(const cap_rights_t *havep, const cap_rights_t *needp,
 enum ktr_cap_fail_type type)
 {
-   int i;
 
-   for (i = 0; i < nitems(havep->cr_rights); i++) {
-   if (!cap_rights_contains(havep, needp)) {
+   if (!cap_rights_contains(havep, needp)) {
 #ifdef KTRACE
-   if (KTRPOINT(curthread, KTR_CAPFAIL))
-   ktrcapfail(type, needp, havep);
+   if (KTRPOINT(curthread, KTR_CAPFAIL))
+   ktrcapfail(type, needp, havep);
 #endif
-   return (ENOTCAPABLE);
-   }
+   return (ENOTCAPABLE);
}
return (0);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330356 - head/sys/compat/linux

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 21:14:55 2018
New Revision: 330356
URL: https://svnweb.freebsd.org/changeset/base/330356

Log:
  sys/linux: Fix a few potential infoleaks in Linux IPC
  
  Submitted by: Domagoj Stolfa 
  MFC After:1 month

Modified:
  head/sys/compat/linux/linux_ipc.c

Modified: head/sys/compat/linux/linux_ipc.c
==
--- head/sys/compat/linux/linux_ipc.c   Sat Mar  3 21:05:28 2018
(r330355)
+++ head/sys/compat/linux/linux_ipc.c   Sat Mar  3 21:14:55 2018
(r330356)
@@ -548,6 +548,9 @@ linux_semctl(struct thread *td, struct linux_semctl_ar
register_t rval;
int cmd, error;
 
+   memset(&linux_seminfo, 0, sizeof(linux_seminfo));
+   memset(&linux_semid64, 0, sizeof(linux_semid64));
+
switch (args->cmd & ~LINUX_IPC_64) {
case LINUX_IPC_RMID:
cmd = IPC_RMID;
@@ -702,12 +705,15 @@ linux_msgctl(struct thread *td, struct linux_msgctl_ar
struct l_msqid64_ds linux_msqid64;
struct msqid_ds bsd_msqid;
 
+   memset(&linux_msqid64, 0, sizeof(linux_msqid64));
+
bsd_cmd = args->cmd & ~LINUX_IPC_64;
switch (bsd_cmd) {
case LINUX_IPC_INFO:
case LINUX_MSG_INFO: {
struct l_msginfo linux_msginfo;
 
+   memset(&linux_msginfo, 0, sizeof(linux_msginfo));
/*
 * XXX MSG_INFO uses the same data structure but returns 
different
 * dynamic counters in msgpool, msgmap, and msgtql fields.
@@ -832,6 +838,10 @@ linux_shmctl(struct thread *td, struct linux_shmctl_ar
struct l_shm_info linux_shm_info;
struct shmid_ds bsd_shmid;
int error;
+
+   memset(&linux_shm_info, 0, sizeof(linux_shm_info));
+   memset(&linux_shmid64, 0, sizeof(linux_shmid64));
+   memset(&linux_shminfo64, 0, sizeof(linux_shminfo64));
 
switch (args->cmd & ~LINUX_IPC_64) {
 
___
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: r330357 - stable/11/sys/netinet

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 21:23:31 2018
New Revision: 330357
URL: https://svnweb.freebsd.org/changeset/base/330357

Log:
  MFC r306767:
  
  Correctly calculate snd_max in persist case.
  
  In the persist case, take the SYN and FIN flags into account when updating
  the sequence space sent.

Modified:
  stable/11/sys/netinet/tcp_output.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/tcp_output.c
==
--- stable/11/sys/netinet/tcp_output.c  Sat Mar  3 21:14:55 2018
(r330356)
+++ stable/11/sys/netinet/tcp_output.c  Sat Mar  3 21:23:31 2018
(r330357)
@@ -1545,7 +1545,7 @@ timer:
tp->t_flags |= TF_SENTFIN;
}
if (SEQ_GT(tp->snd_nxt + xlen, tp->snd_max))
-   tp->snd_max = tp->snd_nxt + len;
+   tp->snd_max = tp->snd_nxt + xlen;
}
 
if (error) {
___
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: r330358 - head/share/man/man4

2018-03-03 Thread Ian Lepore
Author: ian
Date: Sat Mar  3 21:41:16 2018
New Revision: 330358
URL: https://svnweb.freebsd.org/changeset/base/330358

Log:
  Minor changes to wording.

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

Modified: head/share/man/man4/fdt_pinctrl.4
==
--- head/share/man/man4/fdt_pinctrl.4   Sat Mar  3 21:23:31 2018
(r330357)
+++ head/share/man/man4/fdt_pinctrl.4   Sat Mar  3 21:41:16 2018
(r330358)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 2, 2018
+.Dd March 3, 2018
 .Dt "FDT_PINCTRL" 4
 .Os
 .Sh NAME
@@ -36,13 +36,13 @@
 .Pp
 Pin multiplexing is a technology used to re-purpose a single
 physical connection (depending on chip packaging it may be
-pin, ball, or pad) to pull signal from one of SoC internal
-controllers to peripheral devices.
+pin, ball, or pad) by routing its signal to any one of several 
+different SoC internal devices.
 For example, based on the actual device design, a single SoC chip
-pin can perform any of these roles: SPI clock, I2C
+pin might perform any of these roles: SPI clock, I2C
 data, GPIO pin, or PWM signal.
 Function selection is performed by the pinmux controller, a SoC
-hardware block, usually controlled a set of registers.
+hardware block which is usually controlled by a set of registers.
 Pinmux controller capabilities and register format depend
 on the actual hardware implementation.
 .Pp
@@ -104,11 +104,11 @@ backlight@7f00 {
 }
 .Ed
 .Pp
-The pinctrl driver should implement FDT_PINCTRL_CONFIGURE
-method, register itself as pin configuration handler by
+The pinctrl driver should implement the FDT_PINCTRL_CONFIGURE
+method, register itself as a pin configuration handler by
 calling fdt_pinctrl_register function, and call
 .Xr fdt_pinctrl_configure_tree 9
-to configure pins for all enabled devices (device where
+to configure pins for all enabled devices (devices where
 the "status" property is not set to "disabled").
 .Sh SEE ALSO
 .Xr fdt_pinctrl 9
___
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: r330359 - head/sys/compat/cloudabi

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sat Mar  3 21:50:55 2018
New Revision: 330359
URL: https://svnweb.freebsd.org/changeset/base/330359

Log:
  sys/linux: Fix a few potential infoleaks in cloudabi
  
  Submitted by: Domagoj Stolfa 
  MFC After:1 month
  Sponsored by: DARPA/AFRL

Modified:
  head/sys/compat/cloudabi/cloudabi_file.c

Modified: head/sys/compat/cloudabi/cloudabi_file.c
==
--- head/sys/compat/cloudabi/cloudabi_file.cSat Mar  3 21:41:16 2018
(r330358)
+++ head/sys/compat/cloudabi/cloudabi_file.cSat Mar  3 21:50:55 2018
(r330359)
@@ -563,6 +563,8 @@ cloudabi_sys_file_stat_fget(struct thread *td,
cloudabi_filetype_t filetype;
int error;
 
+   memset(&csb, 0, sizeof(csb));
+
/* Fetch file descriptor attributes. */
error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FSTAT), &fp);
if (error != 0)
@@ -649,6 +651,8 @@ cloudabi_sys_file_stat_get(struct thread *td,
cloudabi_filestat_t csb;
char *path;
int error;
+
+   memset(&csb, 0, sizeof(csb));
 
error = copyin_path(uap->path, uap->path_len, &path);
if (error != 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: r330352 - in head/sys/compat/linuxkpi/common: include/linux src

2018-03-03 Thread Bruce Evans

On Sat, 3 Mar 2018, Ian Lepore wrote:


On Sat, 2018-03-03 at 22:49 +0200, Konstantin Belousov wrote:

,,,
BTW mstosbt() and other functions have weird bracing in the formula. I
think that the formula as calculated by the C operator precedence is
fine, i.e. multiplication is done before right shift. But the bracing
is redundand then, because the '()' pair next to the return () braces by
inclusion is tautological.



Oh, on looking closer, it's not a paste-o, I just didn't put the
closing paren where I had intended to for making it clear the shift
happens last. ?(So almost everyone except me is still going to think a
fix has redundant parens.)


It is a good example of how redundant parentheses reduce readability.
Redundant parentheses make the non-redundant parentheses hard to see.
The most important ones are for _ms * (x / 500) (where x =
((uint64_t)1 << 63)).  These are needed since the natural expression
_ms * x / 500 would overflow since it is evaluated left to right.  Then
you want to add redundant parentheses for _ms * (x / 500) >> 32,
although both left to right evaluation and operator precedence work
right for that.  Then style(9) requires redundant parentheses for the
return value.  Normally I would parenthesize x * y >> z since I don't
remember the precedence of '>>' and suspect it is broken (*), but here
there are too many other parentheses.

(*) The precedence of '>>' is indeed broken.  It is like a division operator
so should be at the same level or 1 lower.  But it is 2 lower (+ and - are
in between).  So x + y * z means x + (y * z), but x + y >> z means
(x + y) >> z.  So x + (y >> z) needs parentheses, and (x + y) >> z should
be parenthesized since it is surprising that its parentheses are redundant.

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"


svn commit: r330360 - head/share/man/man9

2018-03-03 Thread Ian Lepore
Author: ian
Date: Sat Mar  3 22:10:16 2018
New Revision: 330360
URL: https://svnweb.freebsd.org/changeset/base/330360

Log:
  Minor (mostly) wording changes.

Modified:
  head/share/man/man9/fdt_pinctrl.9

Modified: head/share/man/man9/fdt_pinctrl.9
==
--- head/share/man/man9/fdt_pinctrl.9   Sat Mar  3 21:50:55 2018
(r330359)
+++ head/share/man/man9/fdt_pinctrl.9   Sat Mar  3 22:10:16 2018
(r330360)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 2, 2018
+.Dd March 3, 2018
 .Dt fdt_pinctrl 9
 .Os
 .Sh NAME
@@ -50,15 +50,17 @@ provides an API for manipulating I/O pin configuration
 pinmux controllers and pinmux clients.
 On the controller side, the standard newbus probe and
 attach methods are implemented.
-This driver also implements the
-.Fn fdt_pinctrl_configure
-method, in which it calls the
+As part of handling attach, it calls the
 .Fn fdt_pinctrl_register
 function to register itself as a pinmux controller.
 Then
 .Fn fdt_pinctrl_configure_tree
 is used to walk the device tree and configure pins specified by the pinctrl-0
 property for all active devices.
+The driver also implements the
+.Fn fdt_pinctrl_configure
+method, which allows client devices to change their
+pin configurations after startup.
 If a client device requires a pin configuration change at some
 point of its lifecycle, it uses the
 .Fn fdt_pinctrl_configure
@@ -84,14 +86,9 @@ registers a pinctrl driver so that it can be used by o
 .Fn fdt_pinctrl_configure
 or
 .Fn fdt_pinctrl_configure_by_name .
-The
-.Fa pinprop
-argument is the name of a property that
-identifies each descendant of the pinctrl
-node.
-The pinctrl node is a pin configuration
-node whose xref phandle can be passed to
-.Fn FDT_PINCTRL_CONFIGURE .
+It also registers each child node of the pinctrl driver's node which contains
+a property with the name given in
+.Fa pinprop .
 If
 .Fa pinprop
 is
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330361 - head/sys/sys

2018-03-03 Thread Ian Lepore
Author: ian
Date: Sat Mar  3 22:28:20 2018
New Revision: 330361
URL: https://svnweb.freebsd.org/changeset/base/330361

Log:
  Correct a misplaced closing paren.  Does not affect the result, but does
  clarify (at least for me) that the multiplication happens before the shift.

Modified:
  head/sys/sys/time.h

Modified: head/sys/sys/time.h
==
--- head/sys/sys/time.h Sat Mar  3 22:10:16 2018(r330360)
+++ head/sys/sys/time.h Sat Mar  3 22:28:20 2018(r330361)
@@ -173,7 +173,7 @@ static __inline sbintime_t
 nstosbt(int64_t _ns)
 {
 
-   return ((_ns * (((uint64_t)1 << 63) / 5) >> 32));
+   return ((_ns * (((uint64_t)1 << 63) / 5)) >> 32);
 }
 
 static __inline int64_t
@@ -187,7 +187,7 @@ static __inline sbintime_t
 ustosbt(int64_t _us)
 {
 
-   return ((_us * (((uint64_t)1 << 63) / 50) >> 32));
+   return ((_us * (((uint64_t)1 << 63) / 50)) >> 32);
 }
 
 static __inline int64_t
@@ -201,7 +201,7 @@ static __inline sbintime_t
 mstosbt(int64_t _ms)
 {
 
-   return ((_ms * (((uint64_t)1 << 63) / 500) >> 32));
+   return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32);
 }
 
 /*-
___
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: r330349 - in head/sys: kern sys

2018-03-03 Thread Conrad Meyer
Please document the new ABI in the sleep(9) manual page.

Thanks,
Conrad

On Sat, Mar 3, 2018 at 10:36 AM, Hans Petter Selasky
 wrote:
> Author: hselasky
> Date: Sat Mar  3 18:36:38 2018
> New Revision: 330349
> URL: https://svnweb.freebsd.org/changeset/base/330349
>
> Log:
>   Allow pause_sbt() to catch signals during sleep by passing C_CATCH flag.
>   Define pause_sig() function macro helper similarly to other kernel functions
>   which catch signals. Update outdated function description.
>
>   Discussed with:   kib@
>   MFC after:1 week
>   Sponsored by: Mellanox Technologies
>
> Modified:
>   head/sys/kern/kern_synch.c
>   head/sys/sys/callout.h
>   head/sys/sys/systm.h
>
> Modified: head/sys/kern/kern_synch.c
> ==
> --- head/sys/kern/kern_synch.c  Sat Mar  3 18:30:31 2018(r330348)
> +++ head/sys/kern/kern_synch.c  Sat Mar  3 18:36:38 2018(r330349)
> @@ -297,16 +297,16 @@ msleep_spin_sbt(void *ident, struct mtx *mtx, const ch
>  }
>
>  /*
> - * pause() delays the calling thread by the given number of system ticks.
> - * During cold bootup, pause() uses the DELAY() function instead of
> - * the tsleep() function to do the waiting. The "timo" argument must be
> - * greater than or equal to zero. A "timo" value of zero is equivalent
> - * to a "timo" value of one.
> + * pause_sbt() delays the calling thread by the given signed binary
> + * time. During cold bootup, pause_sbt() uses the DELAY() function
> + * instead of the _sleep() function to do the waiting. The "sbt"
> + * argument must be greater than or equal to zero. A "sbt" value of
> + * zero is equivalent to a "sbt" value of one tick.
>   */
>  int
>  pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags)
>  {
> -   KASSERT(sbt >= 0, ("pause: timeout must be >= 0"));
> +   KASSERT(sbt >= 0, ("pause_sbt: timeout must be >= 0"));
>
> /* silently convert invalid timeouts */
> if (sbt == 0)
> @@ -328,7 +328,8 @@ pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_
> DELAY(sbt);
> return (EWOULDBLOCK);
> }
> -   return (_sleep(&pause_wchan[curcpu], NULL, 0, wmesg, sbt, pr, flags));
> +   return (_sleep(&pause_wchan[curcpu], NULL,
> +   (flags & C_CATCH) ? PCATCH : 0, wmesg, sbt, pr, flags));
>  }
>
>  /*
>
> Modified: head/sys/sys/callout.h
> ==
> --- head/sys/sys/callout.h  Sat Mar  3 18:30:31 2018(r330348)
> +++ head/sys/sys/callout.h  Sat Mar  3 18:36:38 2018(r330349)
> @@ -60,6 +60,7 @@
>  #defineC_HARDCLOCK 0x0100 /* align to hardclock() calls 
> */
>  #defineC_ABSOLUTE  0x0200 /* event time is absolute. */
>  #defineC_PRECALC   0x0400 /* event time is 
> pre-calculated. */
> +#defineC_CATCH 0x0800 /* catch signals, used by 
> pause_sbt(9) */
>
>  struct callout_handle {
> struct callout *callout;
>
> Modified: head/sys/sys/systm.h
> ==
> --- head/sys/sys/systm.hSat Mar  3 18:30:31 2018(r330348)
> +++ head/sys/sys/systm.hSat Mar  3 18:36:38 2018(r330349)
> @@ -411,6 +411,8 @@ int pause_sbt(const char *wmesg, sbintime_t sbt, sbint
> int flags);
>  #definepause(wmesg, timo)
>   \
> pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK)
> +#definepause_sig(wmesg, timo)
>   \
> +   pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK | C_CATCH)
>  #definetsleep(chan, pri, wmesg, timo)
>   \
> _sleep((chan), NULL, (pri), (wmesg), tick_sbt * (timo), \
> 0, C_HARDCLOCK)
>
___
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: r330349 - in head/sys: kern sys

2018-03-03 Thread Hans Petter Selasky

On 03/03/18 23:34, Conrad Meyer wrote:

Please document the new ABI in the sleep(9) manual page.



See r330362.

--HPS
___
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: r330362 - head/share/man/man9

2018-03-03 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Mar  3 23:08:49 2018
New Revision: 330362
URL: https://svnweb.freebsd.org/changeset/base/330362

Log:
  Document pause_sig(9) and update prototypes for existing pause(9) and
  pause_sbt(9) functions.
  
  MFC after:1 week
  Suggested by: cem@
  Sponsored by: Mellanox Technologies

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/sleep.9

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileSat Mar  3 22:28:20 2018
(r330361)
+++ head/share/man/man9/MakefileSat Mar  3 23:08:49 2018
(r330362)
@@ -1830,6 +1830,7 @@ MLINKS+=sleep.9 msleep.9 \
sleep.9 msleep_spin.9 \
sleep.9 msleep_spin_sbt.9 \
sleep.9 pause.9 \
+   sleep.9 pause_sig.9 \
sleep.9 pause_sbt.9 \
sleep.9 tsleep.9 \
sleep.9 tsleep_sbt.9 \

Modified: head/share/man/man9/sleep.9
==
--- head/share/man/man9/sleep.9 Sat Mar  3 22:28:20 2018(r330361)
+++ head/share/man/man9/sleep.9 Sat Mar  3 23:08:49 2018(r330362)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 24, 2015
+.Dd March 4, 2018
 .Dt SLEEP 9
 .Os
 .Sh NAME
@@ -34,6 +34,7 @@
 .Nm msleep_spin ,
 .Nm msleep_spin_sbt ,
 .Nm pause ,
+.Nm pause_sig ,
 .Nm pause_sbt ,
 .Nm tsleep ,
 .Nm tsleep_sbt ,
@@ -53,9 +54,11 @@
 .Ft int
 .Fn msleep_spin_sbt "void *chan" "struct mtx *mtx" "const char *wmesg" \
 "sbintime_t sbt" "sbintime_t pr" "int flags"
-.Ft void
+.Ft int
 .Fn pause "const char *wmesg" "int timo"
-.Ft void
+.Ft int
+.Fn pause_sig "const char *wmesg" "int timo"
+.Ft int
 .Fn pause_sbt "const char *wmesg" "sbintime_t sbt" "sbintime_t pr" \
  "int flags"
 .Ft int
@@ -73,6 +76,8 @@ The functions
 .Fn msleep ,
 .Fn msleep_spin ,
 .Fn pause ,
+.Fn pause_sig ,
+.Fn pause_sbt ,
 .Fn wakeup ,
 and
 .Fn wakeup_one
@@ -82,8 +87,10 @@ external event, it is put to sleep by
 .Fn tsleep ,
 .Fn msleep ,
 .Fn msleep_spin ,
+.Fn pause ,
+.Fn pause_sig ,
 or
-.Fn pause .
+.Fn pause_sbt .
 Threads may also wait using one of the locking primitive sleep routines
 .Xr mtx_sleep 9 ,
 .Xr rw_sleep 9 ,
@@ -248,6 +255,11 @@ The thread can not be awakened early by signals or cal
 .Fn wakeup
 or
 .Fn wakeup_one .
+The
+.Fn pause_sig
+function is a variant of
+.Fn pause
+which can be awakened early by signals.
 .Pp
 The
 .Fn wakeup_one
@@ -385,6 +397,10 @@ The
 .Fn pause
 function appeared in
 .Fx 7.0 .
+The
+.Fn pause_sig
+function appeared in
+.Fx 12.0 .
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
___
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: r330363 - head/share/mk

2018-03-03 Thread Bryan Drewery
Author: bdrewery
Date: Sat Mar  3 23:23:01 2018
New Revision: 330363
URL: https://svnweb.freebsd.org/changeset/base/330363

Log:
  Ignore MAKEOBJDIRPREFIX from src-env.conf in sub-makes.
  
  A sub-make, such as in 'make buildworld', may want to override 
MAKEOBJDIRPREFIX
  but is unable to do so if src-env.conf is forcing it to another value.  
Without
  using '?=' the sub-make may use the wrong .OBJDIR.
  
  Reported by:  eadler
  Sponsored by: Dell EMC

Modified:
  head/share/mk/src.sys.env.mk

Modified: head/share/mk/src.sys.env.mk
==
--- head/share/mk/src.sys.env.mkSat Mar  3 23:08:49 2018
(r330362)
+++ head/share/mk/src.sys.env.mkSat Mar  3 23:23:01 2018
(r330363)
@@ -24,10 +24,38 @@ RELOBJTOP?= ${RELTOP}
 RELSRCTOP?=${RELTOP}
 
 # site customizations that do not depend on anything!
+
+# Save MAKEOBJDIRPREFIX and don't let src-env.conf modify it.
+# MAKEOBJDIRPREFIX is only needed in MAKELEVEL=0.  In sub-makes it will
+# either be read from environment or OBJDIR/MAKEOBJDIR according to
+# src.sys.obj.mk.
+.if !(${.MAKE.LEVEL} == 0 || empty(OBJROOT))
+.if defined(MAKEOBJDIRPREFIX)
+_saveMAKEOBJDIRPREFIX:=${MAKEOBJDIRPREFIX}
+.else
+_undefMAKEOBJDIRPREFIX=t
+.endif
+.endif
+
 SRC_ENV_CONF?= /etc/src-env.conf
 .if !empty(SRC_ENV_CONF) && !target(_src_env_conf_included_)
 .-include "${SRC_ENV_CONF}"
 _src_env_conf_included_:   .NOTMAIN
+.endif
+
+.if defined(_saveMAKEOBJDIRPREFIX) || defined(_undefMAKEOBJDIRPREFIX)
+.if defined(MAKEOBJDIRPREFIX) && ((defined(_saveMAKEOBJDIRPREFIX) && \
+${_saveMAKEOBJDIRPREFIX} != ${MAKEOBJDIRPREFIX}) || \
+defined(_undefMAKEOBJDIRPREFIX))
+.warning ${SRC_ENV_CONF}: Ignoring MAKEOBJDIRPREFIX entry in sub-make.  Use 
'?=' to avoid this warning.
+.endif
+.if defined(_saveMAKEOBJDIRPREFIX)
+MAKEOBJDIRPREFIX:= ${_saveMAKEOBJDIRPREFIX}
+.undef _saveMAKEOBJDIRPREFIX
+.elif defined(_undefMAKEOBJDIRPREFIX)
+.undef MAKEOBJDIRPREFIX
+.undef _undefMAKEOBJDIRPREFIX
+.endif
 .endif
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330364 - head

2018-03-03 Thread Bryan Drewery
Author: bdrewery
Date: Sat Mar  3 23:23:23 2018
New Revision: 330364
URL: https://svnweb.freebsd.org/changeset/base/330364

Log:
  Don't read SRC_ENV_CONF for MAKEOBJDIRPREFIX guard.
  
  This is mostly to allow using MAKEOBJDIRPREFIX in src-env.conf on stable where
  src.sys.obj.mk is not going to be MFC'd.  It is still valid on head but
  effectively a NOP due to MAKEOBJDIRPREFIX being handled differently in
  src.sys.obj.mk.
  
  Reported by:  eadler
  MFC after:1 week
  Sponsored by: Dell EMC

Modified:
  head/Makefile

Modified: head/Makefile
==
--- head/Makefile   Sat Mar  3 23:23:01 2018(r330363)
+++ head/Makefile   Sat Mar  3 23:23:23 2018(r330364)
@@ -195,11 +195,11 @@ PATH= /sbin:/bin:/usr/sbin:/usr/bin
 MAKEOBJDIRPREFIX?= /usr/obj
 _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} MK_AUTO_OBJ=no \
 ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \
-SRCCONF=${SRCCONF} \
+SRCCONF=${SRCCONF} SRC_ENV_CONF= \
 -f /dev/null -V MAKEOBJDIRPREFIX dummy
 .if !empty(_MAKEOBJDIRPREFIX)
-.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\
-   (in make.conf(5) or src.conf(5)) or command-line variable.
+.error MAKEOBJDIRPREFIX can only be set in environment or src-env.conf(5),\
+not as a global (in make.conf(5) or src.conf(5)) or command-line variable.
 .endif
 
 # We often need to use the tree's version of make to build it.
___
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: r330365 - in head/stand: ofw/common ofw/libofw powerpc/ofw

2018-03-03 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sat Mar  3 23:39:07 2018
New Revision: 330365
URL: https://svnweb.freebsd.org/changeset/base/330365

Log:
  Move "common" Open Firmware parts of the loader used only on PowerPC to
  the powerpc/ subdirectory. These have never used by SPARC and we have
  no other (and almost certainly will have no other) Open Firmware platforms.
  This makes the directory structure simpler and lets us avoid some
  cargo-cult MI patterns on code that is, and always was,
  architecture-specific.

Added:
  head/stand/powerpc/ofw/elf_freebsd.c
 - copied, changed from r330364, head/stand/ofw/libofw/elf_freebsd.c
  head/stand/powerpc/ofw/main.c
 - copied unchanged from r330364, head/stand/ofw/common/main.c
  head/stand/powerpc/ofw/ppc64_elf_freebsd.c
 - copied unchanged from r330364, head/stand/ofw/libofw/ppc64_elf_freebsd.c
Deleted:
  head/stand/ofw/common/
  head/stand/ofw/libofw/elf_freebsd.c
  head/stand/ofw/libofw/ppc64_elf_freebsd.c
Modified:
  head/stand/ofw/libofw/Makefile
  head/stand/ofw/libofw/libofw.h
  head/stand/powerpc/ofw/Makefile
  head/stand/powerpc/ofw/conf.c

Modified: head/stand/ofw/libofw/Makefile
==
--- head/stand/ofw/libofw/Makefile  Sat Mar  3 23:23:23 2018
(r330364)
+++ head/stand/ofw/libofw/Makefile  Sat Mar  3 23:39:07 2018
(r330365)
@@ -4,7 +4,7 @@
 
 LIB=   ofw
 
-SRCS=  devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \
+SRCS=  devicename.c ofw_console.c ofw_copy.c ofw_disk.c \
ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \
ofw_time.c openfirm.c
 .PATH: ${ZFSSRC}
@@ -12,10 +12,6 @@ SRCS+=  devicename_stubs.c
 
 # Pick up the bootstrap header for some interface items
 CFLAGS+=   -I${LDRSRC}
-
-.if ${MACHINE_CPUARCH} == "powerpc"
-SRCS+= ppc64_elf_freebsd.c
-.endif
 
 .ifdef(BOOT_DISK_DEBUG)
 # Make the disk code more talkative

Modified: head/stand/ofw/libofw/libofw.h
==
--- head/stand/ofw/libofw/libofw.h  Sat Mar  3 23:23:23 2018
(r330364)
+++ head/stand/ofw/libofw/libofw.h  Sat Mar  3 23:39:07 2018
(r330365)
@@ -62,17 +62,9 @@ void ofw_memmap(int);
 struct preloaded_file;
 struct file_format;
 
-intofw_elf_loadfile(char *, vm_offset_t, struct preloaded_file **);
-intofw_elf_exec(struct preloaded_file *);
-
 /* MD code implementing MI interfaces */
 vm_offset_t md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
 vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
-
-extern struct file_format  ofw_elf;
-#ifdef __powerpc__
-extern struct file_format  ofw_elf64;
-#endif
 
 extern voidreboot(void);
 

Modified: head/stand/powerpc/ofw/Makefile
==
--- head/stand/powerpc/ofw/Makefile Sat Mar  3 23:23:23 2018
(r330364)
+++ head/stand/powerpc/ofw/Makefile Sat Mar  3 23:39:07 2018
(r330365)
@@ -17,7 +17,7 @@ NEWVERSWHAT=  "Open Firmware loader" ${MACHINE_ARCH}
 INSTALLFLAGS=  -b
 
 # Architecture-specific loader code
-SRCS=  conf.c vers.c start.c
+SRCS=  conf.c vers.c main.c elf_freebsd.c ppc64_elf_freebsd.c start.c
 SRCS+= ucmpdi2.c
 
 .include   "${BOOTSRC}/fdt.mk"
@@ -37,10 +37,6 @@ RELOC?=  0x1C0
 CFLAGS+=   -DRELOC=${RELOC}
 
 LDFLAGS=   -nostdlib -static -T ${.CURDIR}/ldscript.powerpc
-
-# Pull in common loader code
-.PATH: ${BOOTSRC}/ofw/common
-.include   "${BOOTSRC}/ofw/common/Makefile.inc"
 
 # Open Firmware standalone support library
 LIBOFW=${BOOTOBJ}/ofw/libofw/libofw.a

Modified: head/stand/powerpc/ofw/conf.c
==
--- head/stand/powerpc/ofw/conf.c   Sat Mar  3 23:23:23 2018
(r330364)
+++ head/stand/powerpc/ofw/conf.c   Sat Mar  3 23:39:07 2018
(r330365)
@@ -97,6 +97,9 @@ struct netif_driver *netif_drivers[] = {
  * rather than reading the file go first.
  */
 
+struct file_format ofw_elf;
+struct file_format ofw_elf64;
+
 struct file_format *file_formats[] = {
 &ofw_elf,
 &ofw_elf64,

Copied and modified: head/stand/powerpc/ofw/elf_freebsd.c (from r330364, 
head/stand/ofw/libofw/elf_freebsd.c)
==
--- head/stand/ofw/libofw/elf_freebsd.c Sat Mar  3 23:23:23 2018
(r330364, copy source)
+++ head/stand/powerpc/ofw/elf_freebsd.cSat Mar  3 23:39:07 2018
(r330365)
@@ -89,8 +89,8 @@ __elfN(ofw_exec)(struct preloaded_file *fp)
dev_cleanup();
if (dtbp != 0) {
OF_quiesce();
-   ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, 
0, 0,
-   (void *)mdp, sizeof(mdp));
+   ((int (*)(u_long, u_long, u_long, void *

Re: svn commit: r330362 - head/share/man/man9

2018-03-03 Thread Konstantin Belousov
On Sat, Mar 03, 2018 at 11:08:49PM +, Hans Petter Selasky wrote:
> Author: hselasky
> Date: Sat Mar  3 23:08:49 2018
> New Revision: 330362
> URL: https://svnweb.freebsd.org/changeset/base/330362
> 
> Log:
>   Document pause_sig(9) and update prototypes for existing pause(9) and
>   pause_sbt(9) functions.
>   
>   MFC after:  1 week
>   Suggested by:   cem@
>   Sponsored by:   Mellanox Technologies
> 
> Modified:
>   head/share/man/man9/Makefile
>   head/share/man/man9/sleep.9
> 
> Modified: head/share/man/man9/Makefile
> ==
> --- head/share/man/man9/Makefile  Sat Mar  3 22:28:20 2018
> (r330361)
> +++ head/share/man/man9/Makefile  Sat Mar  3 23:08:49 2018
> (r330362)
> @@ -1830,6 +1830,7 @@ MLINKS+=sleep.9 msleep.9 \
>   sleep.9 msleep_spin.9 \
>   sleep.9 msleep_spin_sbt.9 \
>   sleep.9 pause.9 \
> + sleep.9 pause_sig.9 \
>   sleep.9 pause_sbt.9 \
>   sleep.9 tsleep.9 \
>   sleep.9 tsleep_sbt.9 \
> 
> Modified: head/share/man/man9/sleep.9
> ==
> --- head/share/man/man9/sleep.9   Sat Mar  3 22:28:20 2018
> (r330361)
> +++ head/share/man/man9/sleep.9   Sat Mar  3 23:08:49 2018
> (r330362)
> @@ -25,7 +25,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd May 24, 2015
> +.Dd March 4, 2018
>  .Dt SLEEP 9
>  .Os
>  .Sh NAME
> @@ -34,6 +34,7 @@
>  .Nm msleep_spin ,
>  .Nm msleep_spin_sbt ,
>  .Nm pause ,
> +.Nm pause_sig ,
>  .Nm pause_sbt ,
pause_sbt is before pause_sig alphabetically.
This note is applicable for all insertions of the pause_sig name in the
man page.

>  .Nm tsleep ,
>  .Nm tsleep_sbt ,
> @@ -53,9 +54,11 @@
>  .Ft int
>  .Fn msleep_spin_sbt "void *chan" "struct mtx *mtx" "const char *wmesg" \
>  "sbintime_t sbt" "sbintime_t pr" "int flags"
> -.Ft void
> +.Ft int
>  .Fn pause "const char *wmesg" "int timo"
> -.Ft void
> +.Ft int
> +.Fn pause_sig "const char *wmesg" "int timo"
> +.Ft int
>  .Fn pause_sbt "const char *wmesg" "sbintime_t sbt" "sbintime_t pr" \
>   "int flags"
>  .Ft int
> @@ -73,6 +76,8 @@ The functions
>  .Fn msleep ,
>  .Fn msleep_spin ,
>  .Fn pause ,
> +.Fn pause_sig ,
> +.Fn pause_sbt ,
>  .Fn wakeup ,
>  and
>  .Fn wakeup_one
> @@ -82,8 +87,10 @@ external event, it is put to sleep by
>  .Fn tsleep ,
>  .Fn msleep ,
>  .Fn msleep_spin ,
> +.Fn pause ,
> +.Fn pause_sig ,
>  or
> -.Fn pause .
> +.Fn pause_sbt .
>  Threads may also wait using one of the locking primitive sleep routines
>  .Xr mtx_sleep 9 ,
>  .Xr rw_sleep 9 ,
> @@ -248,6 +255,11 @@ The thread can not be awakened early by signals or cal
>  .Fn wakeup
>  or
>  .Fn wakeup_one .
> +The
> +.Fn pause_sig
> +function is a variant of
> +.Fn pause
> +which can be awakened early by signals.
It would be useful to mention that pause_sbt(9) provides the same feature
by using a flag.

>  .Pp
>  The
>  .Fn wakeup_one
> @@ -385,6 +397,10 @@ The
>  .Fn pause
>  function appeared in
>  .Fx 7.0 .
> +The
> +.Fn pause_sig
> +function appeared in
> +.Fx 12.0 .
>  .Sh AUTHORS
>  .An -nosplit
>  This manual page was written by
___
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: r330236 - head/sys/compat/linuxkpi/common/src

2018-03-03 Thread Colin Percival
On 03/01/18 02:31, Hans Petter Selasky wrote:
> New Revision: 330236
>   Correct the return value from flush_work() and flush_delayed_work() in the
>   LinuxKPI to comply more with Linux. This fixes an issue when these functions
>   are used in waiting loops.
>   
>   MFC after:  1 week
>   Sponsored by:   Mellanox Technologies

In case the data point is useful: Merging this to stable/11 unbroke S3
suspend/resume on my laptop (system76 Galago Pro, kabylake, using the
drm-next-kmod port).

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
___
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: r330366 - head/gnu/usr.bin/binutils/ld

2018-03-03 Thread Ed Maste
Author: emaste
Date: Sun Mar  4 01:37:49 2018
New Revision: 330366
URL: https://svnweb.freebsd.org/changeset/base/330366

Log:
  When lld is ld, install bfd's man page as ld.bfd.1
  
  When WITH_LLD_IS_LD is set, lld's man page is installed as ld.1.gz, as
  was GNU BFD's man page prior to this change.
  
  Reported by:  Tobias Kortkamp
  Sponsored by: The FreeBSD Foundation

Modified:
  head/gnu/usr.bin/binutils/ld/Makefile

Modified: head/gnu/usr.bin/binutils/ld/Makefile
==
--- head/gnu/usr.bin/binutils/ld/Makefile   Sat Mar  3 23:39:07 2018
(r330365)
+++ head/gnu/usr.bin/binutils/ld/Makefile   Sun Mar  4 01:37:49 2018
(r330366)
@@ -7,7 +7,15 @@ ELF_SCR_EXT=   x xbn xc xd xdc xdw xn xr xs xsc xsw xu x
 .PATH: ${SRCDIR}/ld
 
 PROG=  ld.bfd
+.if ${MK_LLD_IS_LD} == "no"
 MAN=   ld.1
+.else
+MAN=   ld.bfd.1
+CLEANFILES+=   ld.bfd.1
+ld.bfd.1:  ld.1
+   ${CP} ${.ALLSRC} ${.TARGET}
+.endif
+
 SCRIPTDIR= /usr/libdata/ldscripts
 SRCS+= ldcref.c \
ldctor.c \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330368 - head/share/man/man9

2018-03-03 Thread Warner Losh
Author: imp
Date: Sun Mar  4 03:13:13 2018
New Revision: 330368
URL: https://svnweb.freebsd.org/changeset/base/330368

Log:
  Add documentation for CTLFLAG_MPSAFE.

Modified:
  head/share/man/man9/sysctl.9

Modified: head/share/man/man9/sysctl.9
==
--- head/share/man/man9/sysctl.9Sun Mar  4 02:41:25 2018
(r330367)
+++ head/share/man/man9/sysctl.9Sun Mar  4 03:13:13 2018
(r330368)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 10, 2017
+.Dd March 3, 2018
 .Dt SYSCTL 9
 .Os
 .Sh NAME
@@ -662,6 +662,11 @@ this flag will prevent fetching the initial value from
 environment.
 Typically this flag should only be used for very early
 low level system setup code, and not by common drivers and modules.
+.It Dv CTLFLAG_MPSAFE
+This
+.Xr sysctl 9
+handler is MP safe.
+Do not grab Giant around calls to this handler.
 .El
 .Pp
 Additionally, any of the following optional flags may also be specified:
___
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: r330369 - head/stand/lua

2018-03-03 Thread Kyle Evans
Author: kevans
Date: Sun Mar  4 03:21:12 2018
New Revision: 330369
URL: https://svnweb.freebsd.org/changeset/base/330369

Log:
  lualoader: Return meaningful value in cli_execute
  
  loader.command(...) will return whatever the executed function returns, so
  follow suit and return whatever loader.command() returned or whatever the
  Lua function returns.

Modified:
  head/stand/lua/cli.lua

Modified: head/stand/lua/cli.lua
==
--- head/stand/lua/cli.lua  Sun Mar  4 03:13:13 2018(r330368)
+++ head/stand/lua/cli.lua  Sun Mar  4 03:21:12 2018(r330369)
@@ -77,8 +77,7 @@ function cli_execute(...)
local argv = {...}
-- Just in case...
if #argv == 0 then
-   loader.command(...)
-   return
+   return loader.command(...)
end
 
local cmd_name = argv[1]
@@ -88,9 +87,9 @@ function cli_execute(...)
-- traditional reasons for including it don't necessarily apply,
-- it may not be totally redundant if we want to have one global
-- handling multiple commands
-   cmd(...)
+   return cmd(...)
else
-   loader.command(...)
+   return loader.command(...)
end
 
 end
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330367 - stable/11/sys/sys

2018-03-03 Thread Eitan Adler
Author: eadler
Date: Sun Mar  4 02:41:25 2018
New Revision: 330367
URL: https://svnweb.freebsd.org/changeset/base/330367

Log:
  MFC r330256:
  
  sys/sys: Use a more common spelling of 'dirent'

Modified:
  stable/11/sys/sys/dirent.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/sys/dirent.h
==
--- stable/11/sys/sys/dirent.h  Sun Mar  4 01:37:49 2018(r330366)
+++ stable/11/sys/sys/dirent.h  Sun Mar  4 02:41:25 2018(r330367)
@@ -82,7 +82,7 @@ struct dirent {
 
 /*
  * The _GENERIC_DIRSIZ macro gives the minimum record length which will hold
- * the directory entry.  This returns the amount of space in struct direct
+ * the directory entry.  This returns the amount of space in struct dirent
  * without the d_name field, plus enough space for the name with a terminating
  * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
  *
___
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: r330370 - head/stand/lua

2018-03-03 Thread Kyle Evans
Author: kevans
Date: Sun Mar  4 03:23:19 2018
New Revision: 330370
URL: https://svnweb.freebsd.org/changeset/base/330370

Log:
  lualoader: logdef -> logodef typo

Modified:
  head/stand/lua/drawer.lua

Modified: head/stand/lua/drawer.lua
==
--- head/stand/lua/drawer.lua   Sun Mar  4 03:21:12 2018(r330369)
+++ head/stand/lua/drawer.lua   Sun Mar  4 03:23:19 2018(r330370)
@@ -454,7 +454,7 @@ function drawer.drawlogo()
x = x + drawer.shift.x
y = y + drawer.shift.y
 
-   if logdef ~= nil and logodef.shift ~= nil then
+   if logodef ~= nil and logodef.shift ~= nil then
x = x + logodef.shift.x
y = y + logodef.shift.y
end
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r330372 - head/share/man/man9

2018-03-03 Thread Warner Losh
Author: imp
Date: Sun Mar  4 06:19:41 2018
New Revision: 330372
URL: https://svnweb.freebsd.org/changeset/base/330372

Log:
  Mention that CTLFLAG_MPSAFE is only for _PROC entries.

Modified:
  head/share/man/man9/sysctl.9

Modified: head/share/man/man9/sysctl.9
==
--- head/share/man/man9/sysctl.9Sun Mar  4 04:49:09 2018
(r330371)
+++ head/share/man/man9/sysctl.9Sun Mar  4 06:19:41 2018
(r330372)
@@ -667,6 +667,9 @@ This
 .Xr sysctl 9
 handler is MP safe.
 Do not grab Giant around calls to this handler.
+This should only be used for
+.Fn SYSCTL_PROC
+entries.
 .El
 .Pp
 Additionally, any of the following optional flags may also be specified:
___
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: r330371 - head/stand/powerpc/ofw

2018-03-03 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Mar  4 04:49:09 2018
New Revision: 330371
URL: https://svnweb.freebsd.org/changeset/base/330371

Log:
  Where we can, pass the kernel an FDT facsimile of the OF device tree rather
  than a pointer to Open Firmware by default. This eliminates a number of
  potentially unsafe calls to firmware from the kernel and provides better
  performance.
  
  This feature is meant to be expanded until it is on by default
  unconditionally and, ideally, we can then garbage-collect the
  nightmare pile of hacks required to call into Open Firmware from a live
  kernel.
  
  Reviewed by:  jhibbits

Modified:
  head/stand/powerpc/ofw/main.c

Modified: head/stand/powerpc/ofw/main.c
==
--- head/stand/powerpc/ofw/main.c   Sun Mar  4 03:23:19 2018
(r330370)
+++ head/stand/powerpc/ofw/main.c   Sun Mar  4 04:49:09 2018
(r330371)
@@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$");
 #include "libofw.h"
 #include "bootstrap.h"
 
+#include 
+
 struct arch_switch archsw; /* MI/MD interface boundary */
 
 extern char end[];
@@ -47,6 +49,16 @@ static char heap[HEAP_SIZE]; // In BSS, so uses no spa
 
 #define OF_puts(fd, text) OF_write(fd, text, strlen(text))
 
+static __inline register_t
+mfmsr(void)
+{
+   register_t value;
+
+   __asm __volatile ("mfmsr %0" : "=r"(value));
+
+   return (value);
+}
+
 void
 init_heap(void)
 {
@@ -144,6 +156,15 @@ main(int (*openfirm)(void *))
env_setenv("loaddev", EV_VOLATILE, bootpath, env_noset,
env_nounset);
setenv("LINES", "24", 1);   /* optional */
+
+   /*
+* On non-Apple hardware, where it works reliably, pass flattened
+* device trees to the kernel by default instead of OF CI pointers.
+* Apple hardware is the only virtual-mode OF implementation in
+* existence, so far as I am aware, so use that as a flag.
+*/
+   if (!(mfmsr() & PSL_DR))
+   setenv("usefdt", "1", 1);
 
archsw.arch_getdev = ofw_getdev;
archsw.arch_copyin = ofw_copyin;
___
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"