svn commit: r318253 - head/sys/arm64/include

2017-05-13 Thread Andrew Turner
Author: andrew
Date: Sat May 13 13:03:20 2017
New Revision: 318253
URL: https://svnweb.freebsd.org/changeset/base/318253

Log:
  Allocate a cacheline when reading or writing to write through memory. The
  hardware will still write to memory, however following reads will be from
  the cache.
  
  MFC after:1 week
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm64/include/armreg.h

Modified: head/sys/arm64/include/armreg.h
==
--- head/sys/arm64/include/armreg.h Sat May 13 13:01:15 2017
(r318252)
+++ head/sys/arm64/include/armreg.h Sat May 13 13:03:20 2017
(r318253)
@@ -360,7 +360,7 @@
 #defineMAIR_ATTR(attr, idx) ((attr) << ((idx) * 8))
 #define MAIR_DEVICE_nGnRnE 0x00
 #define MAIR_NORMAL_NC 0x44
-#define MAIR_NORMAL_WT 0x88
+#define MAIR_NORMAL_WT 0xbb
 #define MAIR_NORMAL_WB 0xff
 
 /* PAR_EL1 - Physical Address Register */
___
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: r318251 - head/sys/arm/arm

2017-05-13 Thread Michal Meloun
Author: mmel
Date: Sat May 13 10:00:24 2017
New Revision: 318251
URL: https://svnweb.freebsd.org/changeset/base/318251

Log:
  Clarify usage rules for pmap_remap_vm_attr().
  Not a functional change.
  
  MFC with: r318021
  MFC after:2 weeks

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Sat May 13 03:10:50 2017(r318250)
+++ head/sys/arm/arm/pmap-v6.c  Sat May 13 10:00:24 2017(r318251)
@@ -500,7 +500,24 @@ pmap_set_tex(void)
 /*
  * Remap one vm_meattr class to another one. This can be useful as
  * workaround for SOC errata, e.g. if devices must be accessed using
- * SO memory class. 
+ * SO memory class.
+ *
+ * !!! Please note that this function is absolutely last resort thing.
+ * It should not be used under normal circumstances. !!!
+ *
+ * Usage rules:
+ * - it shall be called after pmap_bootstrap_prepare() and before
+ *   cpu_mp_start() (thus only on boot CPU). In practice, it's expected
+ *   to be called from platform_attach() or platform_late_init().
+ *
+ * - if remapping doesn't change caching mode, or until uncached class
+ *   is remapped to any kind of cached one, then no other restriction exists.
+ *
+ * - if pmap_remap_vm_attr() changes caching mode, but both (original and
+ *   remapped) remain cached, then caller is resposible for calling
+ *   of dcache_wbinv_poc_all().
+ *
+ * - remapping of any kind of cached class to uncached is not permitted.
  */
 void
 pmap_remap_vm_attr(vm_memattr_t old_attr, vm_memattr_t new_attr)
___
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: r318252 - head/sys/arm64/include

2017-05-13 Thread Andrew Turner
Author: andrew
Date: Sat May 13 13:01:15 2017
New Revision: 318252
URL: https://svnweb.freebsd.org/changeset/base/318252

Log:
  Add the VM_MEMATTR_WRITE_THROUGH memory type to arm64 and use it to support
  VM_MEMATTR_WRITE_COMBINING in the kernel. This fixes a bug where Xorg would
  use write back cached memory for its graphics buffers. This would produce
  artifacts on the screen as cachelines were written to memory.
  
  MFC after:1 week
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm64/include/vm.h

Modified: head/sys/arm64/include/vm.h
==
--- head/sys/arm64/include/vm.h Sat May 13 10:00:24 2017(r318251)
+++ head/sys/arm64/include/vm.h Sat May 13 13:01:15 2017(r318252)
@@ -30,9 +30,15 @@
 #define_MACHINE_VM_H_
 
 /* Memory attribute configuration. */
-#defineVM_MEMATTR_DEVICE   0
-#defineVM_MEMATTR_UNCACHEABLE  1
-#defineVM_MEMATTR_WRITE_BACK   2
+#defineVM_MEMATTR_DEVICE   0
+#defineVM_MEMATTR_UNCACHEABLE  1
+#defineVM_MEMATTR_WRITE_BACK   2
+#defineVM_MEMATTR_WRITE_THROUGH3
+
+#ifdef _KERNEL
+/* If defined vmstat will try to use both of these in a switch statement */
+#defineVM_MEMATTR_WRITE_COMBINING  VM_MEMATTR_WRITE_THROUGH
+#endif
 
 #defineVM_MEMATTR_DEFAULT  VM_MEMATTR_WRITE_BACK
 
___
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: r318256 - head/libexec/rtld-elf

2017-05-13 Thread Konstantin Belousov
Author: kib
Date: Sat May 13 18:59:27 2017
New Revision: 318256
URL: https://svnweb.freebsd.org/changeset/base/318256

Log:
  In _rtld(), reorder local declarations to compact the block and
  partially sort them by style(9).  Move locals declarations from nested
  blocks into the block at function start.
  
  Discussed with:   emaste
  MFC after:1 week

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cSat May 13 18:41:24 2017
(r318255)
+++ head/libexec/rtld-elf/rtld.cSat May 13 18:59:27 2017
(r318256)
@@ -339,22 +339,16 @@ _LD(const char *var)
 func_ptr_type
 _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
 {
-Elf_Auxinfo *aux_info[AT_COUNT];
-int i;
-int argc;
-char **argv;
-char **env;
-Elf_Auxinfo *aux;
-Elf_Auxinfo *auxp;
-const char *argv0;
+Elf_Auxinfo *aux, *auxp, *aux_info[AT_COUNT];
 Objlist_Entry *entry;
-Obj_Entry *obj;
-Obj_Entry *preload_tail;
-Obj_Entry *last_interposer;
+Obj_Entry *last_interposer, *obj, *preload_tail;
+const Elf_Phdr *phdr;
 Objlist initlist;
 RtldLockState lockstate;
-char *library_path_rpath;
-int mib[2];
+char **argv, *argv0, **env, *kexecpath, *library_path_rpath;
+caddr_t imgentry;
+char buf[MAXPATHLEN];
+int argc, fd, i, mib[2], phnum;
 size_t len;
 
 /*
@@ -477,7 +471,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
  * already loaded.
  */
 if (aux_info[AT_EXECFD] != NULL) { /* Load the main program. */
-   int fd = aux_info[AT_EXECFD]->a_un.a_val;
+   fd = aux_info[AT_EXECFD]->a_un.a_val;
dbg("loading main program");
obj_main = map_object(fd, argv0, NULL);
close(fd);
@@ -485,10 +479,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
rtld_die();
max_stack_flags = obj->stack_flags;
 } else {   /* Main program already loaded. */
-   const Elf_Phdr *phdr;
-   int phnum;
-   caddr_t entry;
-
dbg("processing main program's program header");
assert(aux_info[AT_PHDR] != NULL);
phdr = (const Elf_Phdr *) aux_info[AT_PHDR]->a_un.a_ptr;
@@ -497,15 +487,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
assert(aux_info[AT_PHENT] != NULL);
assert(aux_info[AT_PHENT]->a_un.a_val == sizeof(Elf_Phdr));
assert(aux_info[AT_ENTRY] != NULL);
-   entry = (caddr_t) aux_info[AT_ENTRY]->a_un.a_ptr;
-   if ((obj_main = digest_phdr(phdr, phnum, entry, argv0)) == NULL)
+   imgentry = (caddr_t) aux_info[AT_ENTRY]->a_un.a_ptr;
+   if ((obj_main = digest_phdr(phdr, phnum, imgentry, argv0)) == NULL)
rtld_die();
 }
 
 if (aux_info[AT_EXECPATH] != NULL) {
-   char *kexecpath;
-   char buf[MAXPATHLEN];
-
kexecpath = aux_info[AT_EXECPATH]->a_un.a_ptr;
dbg("AT_EXECPATH %p %s", kexecpath, kexecpath);
if (kexecpath[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: r318257 - head/usr.bin/localedef

2017-05-13 Thread Ngie Cooper
Author: ngie
Date: Sat May 13 19:59:03 2017
New Revision: 318257
URL: https://svnweb.freebsd.org/changeset/base/318257

Log:
  style(9): sort headers
  
  MFC after:3 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/localedef/localedef.h

Modified: head/usr.bin/localedef/localedef.h
==
--- head/usr.bin/localedef/localedef.h  Sat May 13 18:59:27 2017
(r318256)
+++ head/usr.bin/localedef/localedef.h  Sat May 13 19:59:03 2017
(r318257)
@@ -35,10 +35,10 @@
  */
 
 /* Common header files. */
+#include 
+#include 
 #include 
 #include 
-#include 
-#include 
 
 extern int com_char;
 extern int esc_char;
___
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: r318258 - head/bin/sh/tests/builtins

2017-05-13 Thread Jilles Tjoelker
Author: jilles
Date: Sat May 13 20:28:32 2017
New Revision: 318258
URL: https://svnweb.freebsd.org/changeset/base/318258

Log:
  sh: Add test for arithmetic expansion in [x-y] pattern range.
  
  It does not make much sense to generate the '-' in a pattern bracket
  expression using arithmetic expansion, but it does not make sense to forbid
  it either.
  
  This test already passes.

Added:
  head/bin/sh/tests/builtins/case21.0   (contents, props changed)
Modified:
  head/bin/sh/tests/builtins/Makefile

Modified: head/bin/sh/tests/builtins/Makefile
==
--- head/bin/sh/tests/builtins/Makefile Sat May 13 19:59:03 2017
(r318257)
+++ head/bin/sh/tests/builtins/Makefile Sat May 13 20:28:32 2017
(r318258)
@@ -40,6 +40,7 @@ ${PACKAGE}FILES+= case17.0
 ${PACKAGE}FILES+=  case18.0
 ${PACKAGE}FILES+=  case19.0
 ${PACKAGE}FILES+=  case20.0
+${PACKAGE}FILES+=  case21.0
 ${PACKAGE}FILES+=  cd1.0
 ${PACKAGE}FILES+=  cd2.0
 ${PACKAGE}FILES+=  cd3.0

Added: head/bin/sh/tests/builtins/case21.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/builtins/case21.0 Sat May 13 20:28:32 2017
(r318258)
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+case 5 in
+[0$((-9))]) ;;
+*) echo bad1 ;;
+esac
+
+case - in
+[0$((-9))]) echo bad2 ;;
+esac
___
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: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-13 Thread Rodney W. Grimes
> Author: ngie
> Date: Sat May 13 03:10:50 2017
> New Revision: 318250
> URL: https://svnweb.freebsd.org/changeset/base/318250
> 
> Log:
>   Handle the logfiles in newsyslog and syslogd conditionally, based on
>   src.conf(5) knobs
>   
>   This will allow consumers of FreeBSD to use the unmodified configuration
>   files out of the box more than previously.

What about simply generating proper newsyslog.conf and syslog.conf based
on the the MK_ values rather than change the visible administration
interface that has finger memory, ansible, and puppet support?

>   
>   Both newsyslog.conf and syslog.conf:
>   - /var/log/lpd-errs (MK_LPR != no)
>   - /var/log/ppp.log (MK_PPP != no)
>   - /var/log/xferlog (MK_FTP != no)
>   
>   newsyslog.conf:
>   - /var/log/amd.log (MK_AMD != no)
>   - /var/log/pflog (MK_PF != no)
>   - /var/log/sendmail.st (MK_SENDMAIL != no)
>   
>   MFC after:  3 weeks
>   Sponsored by:   Dell EMC Isilon
> 
> Added:
>   head/etc/newsyslog.conf.d/amd.conf   (contents, props changed)
>   head/etc/newsyslog.conf.d/ftp.conf   (contents, props changed)
>   head/etc/newsyslog.conf.d/lpr.conf   (contents, props changed)
>   head/etc/newsyslog.conf.d/pf.conf   (contents, props changed)
>   head/etc/newsyslog.conf.d/ppp.conf   (contents, props changed)
>   head/etc/newsyslog.conf.d/sendmail.conf   (contents, props changed)
>   head/etc/syslog.d/
>   head/etc/syslog.d/Makefile   (contents, props changed)
>   head/etc/syslog.d/ftp.conf   (contents, props changed)
>   head/etc/syslog.d/lpr.conf   (contents, props changed)
>   head/etc/syslog.d/ppp.conf   (contents, props changed)
> Modified:
>   head/etc/Makefile
>   head/etc/newsyslog.conf
>   head/etc/newsyslog.conf.d/Makefile
>   head/etc/syslog.conf
>   head/tools/build/mk/OptionalObsoleteFiles.inc
> 
> Modified: head/etc/Makefile
> ==
> --- head/etc/Makefile Fri May 12 18:37:08 2017(r318249)
> +++ head/etc/Makefile Sat May 13 03:10:50 2017(r318250)
> @@ -8,7 +8,8 @@ FILESGROUPS=  FILES
>  # No need as it is empty and just causes rebuilds since this file does so 
> much.
>  UPDATE_DEPENDFILE=   no
>  SUBDIR=  \
> - newsyslog.conf.d
> + newsyslog.conf.d \
> + syslog.d
>  
>  .if ${MK_SENDMAIL} != "no"
>  SUBDIR+=sendmail
> 
> Modified: head/etc/newsyslog.conf
> ==
> --- head/etc/newsyslog.conf   Fri May 12 18:37:08 2017(r318249)
> +++ head/etc/newsyslog.conf   Sat May 13 03:10:50 2017(r318250)
> @@ -18,7 +18,6 @@
>  #
>  # logfilename  [owner:group]mode count size when  flags 
> [/pid_file] [sig_num]
>  /var/log/all.log 600  7 *@T00  J
> -/var/log/amd.log 644  7 1000 * J
>  /var/log/auth.log600  7 1000 @0101T JC
>  /var/log/console.log 600  5 1000 * J
>  /var/log/cron600  3 1000 * JC
> @@ -26,18 +25,13 @@
>  /var/log/debug.log   600  7 1000 * JC
>  /var/log/init.log644  3 1000 * J
>  /var/log/kerberos.log600  7 1000 * J
> -/var/log/lpd-errs644  7 1000 * JC
>  /var/log/maillog 640  7 *@T00  JC
>  /var/log/messages644  5 1000 @0101T JC
>  /var/log/monthly.log 640  12*$M1D0 JN
> -/var/log/pflog   600  3 1000 * JB
> /var/run/pflogd.pid
> -/var/log/ppp.log root:network640  3 1000 * JC
>  /var/log/devd.log644  3 1000 * JC
>  /var/log/security600  101000 * JC
> -/var/log/sendmail.st 640  10*168   BN
>  /var/log/utx.log 644  3 *@01T05 B
>  /var/log/weekly.log  640  5 *$W6D0 JN
> -/var/log/xferlog 600  7 1000 * JC
>  
>   /etc/newsyslog.conf.d/*
>   /usr/local/etc/newsyslog.conf.d/*
> 
> Modified: head/etc/newsyslog.conf.d/Makefile
> ==
> --- head/etc/newsyslog.conf.d/MakefileFri May 12 18:37:08 2017
> (r318249)
> +++ head/etc/newsyslog.conf.d/MakefileSat May 13 03:10:50 2017
> (r318250)
> @@ -6,8 +6,32 @@ BINDIR=  /etc/newsyslog.conf.d
>  
>  FILES=
>  
> +.if ${MK_AMD} != "no"
> +FILES+=  amd.conf
> +.endif
> +
> +.if ${MK_FTP} != "no"
> +FILES+=  ftp.conf
> +.endif
> +
> +.if ${MK_LPR} != "no"
> +FILES+=  lpr.conf
> +.endif
> +
>  .if ${MK_OFED} != "no"
>  FILES+=  opensm.conf
>  .endif
>  
> +.if ${MK_PF} != "no"
> +FILES+=  pf.conf
> +.endif
> +
> +.if ${MK_PPP} != "no"
> +FILES+=  ppp.conf
> +.endif
> +
> +.if 

Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-13 Thread Ngie Cooper
On May 13, 2017, at 08:37, Rodney W. Grimes  
wrote:

>> Author: ngie
>> Date: Sat May 13 03:10:50 2017
>> New Revision: 318250
>> URL: https://svnweb.freebsd.org/changeset/base/318250
>> 
>> Log:
>>  Handle the logfiles in newsyslog and syslogd conditionally, based on
>>  src.conf(5) knobs
>> 
>>  This will allow consumers of FreeBSD to use the unmodified configuration
>>  files out of the box more than previously.
> 
> What about simply generating proper newsyslog.conf and syslog.conf based
> on the the MK_ values rather than change the visible administration
> interface that has finger memory, ansible, and puppet support?

- My employer doesn't use puppet on its appliances.
- Files snapshotted in time bitrot (which was the case with our configs, which 
is part of the reason behind this change.
- It's really easy to screw up a mergemaster call if you edit the files, and 
install the stock version which removes the edits.
Thanks,
-Ngie
___
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: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-13 Thread Ngie Cooper

> On May 13, 2017, at 09:29, Ngie Cooper  wrote:
> 
> On May 13, 2017, at 08:37, Rodney W. Grimes  
> wrote:
> 
>>> Author: ngie
>>> Date: Sat May 13 03:10:50 2017
>>> New Revision: 318250
>>> URL: https://svnweb.freebsd.org/changeset/base/318250
>>> 
>>> Log:
>>> Handle the logfiles in newsyslog and syslogd conditionally, based on
>>> src.conf(5) knobs
>>> 
>>> This will allow consumers of FreeBSD to use the unmodified configuration
>>> files out of the box more than previously.
>> 
>> What about simply generating proper newsyslog.conf and syslog.conf based
>> on the the MK_ values rather than change the visible administration
>> interface that has finger memory, ansible, and puppet support?
> 
> - My employer doesn't use puppet on its appliances.
> - Files snapshotted in time bitrot (which was the case with our configs, 
> which is part of the reason behind this change.
> - It's really easy to screw up a mergemaster call if you edit the files, and 
> install the stock version which removes the edits.

Also, programmatically removing the entries means you have to bake the metadata 
into etc/Makefile, which is already complicated enough as-is.
Thanks,
-Ngie
___
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: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-13 Thread Nikolai Lifanov
On 05/13/2017 13:21, Ngie Cooper (yaneurabeya) wrote:
> Even ansible/chef/puppet would have to bake the configuration removal logic 
> into its template files, which seems like a pain for folks (and the same 
> logic would need to be implemented multiple times instead of once).

Having to template one .conf file couples not necessarily related config
modules together and it's *a lot* more performant to conditionally
install and remove config snippets in .d/ than to expand a template.

The separation matters when separate people write separate configuration
modules and the performance matters when deciding on frequency of config
runs.

- Nikolai



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-13 Thread Ian Lepore
On Sat, 2017-05-13 at 08:37 -0700, Rodney W. Grimes wrote:
> > 
> > Author: ngie
> > Date: Sat May 13 03:10:50 2017
> > New Revision: 318250
> > URL: https://svnweb.freebsd.org/changeset/base/318250
> > 
> > Log:
> >   Handle the logfiles in newsyslog and syslogd conditionally, based on
> >   src.conf(5) knobs
> >   
> >   This will allow consumers of FreeBSD to use the unmodified configuration
> >   files out of the box more than previously.
> What about simply generating proper newsyslog.conf and syslog.conf based
> on the the MK_ values rather than change the visible administration
> interface that has finger memory, ansible, and puppet support?
> 

The evolution for years has been away from monolithic config files
containing a mashup of values for unrelated subsystems and towards
.conf.d directories containing many single-subject files.  The
monolithic files are difficult to edit and otherwise manage
programmatically, and especially difficult to manage in terms of
software packaging and software updates.

-- 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: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-13 Thread Warner Losh
On Sat, May 13, 2017 at 10:32 AM, Ngie Cooper  wrote:
>
>> On May 13, 2017, at 09:29, Ngie Cooper  wrote:
>>
>> On May 13, 2017, at 08:37, Rodney W. Grimes  
>> wrote:
>>
 Author: ngie
 Date: Sat May 13 03:10:50 2017
 New Revision: 318250
 URL: https://svnweb.freebsd.org/changeset/base/318250

 Log:
 Handle the logfiles in newsyslog and syslogd conditionally, based on
 src.conf(5) knobs

 This will allow consumers of FreeBSD to use the unmodified configuration
 files out of the box more than previously.
>>>
>>> What about simply generating proper newsyslog.conf and syslog.conf based
>>> on the the MK_ values rather than change the visible administration
>>> interface that has finger memory, ansible, and puppet support?
>>
>> - My employer doesn't use puppet on its appliances.
>> - Files snapshotted in time bitrot (which was the case with our configs, 
>> which is part of the reason behind this change.

couldn't you have an Isilion config file in the appropriate directory
instead? And use the default newsyslog / syslog config files?

>> - It's really easy to screw up a mergemaster call if you edit the files, and 
>> install the stock version which removes the edits.
>
> Also, programmatically removing the entries means you have to bake the 
> metadata into etc/Makefile, which is already complicated enough as-is.

Why do you care about removing them at all? They are no-ops if the
files don't exist. Why not just always install all these files is
where I'm going with this...

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


Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-13 Thread Alexey Dokuchaev
On Sat, May 13, 2017 at 10:24:20AM -0600, Ian Lepore wrote:
> ...
> The evolution for years has been away from monolithic config files
> containing a mashup of values for unrelated subsystems and towards
> .conf.d directories containing many single-subject files.

This "evolution" had probably originated in people's minds who know little
about software development and maintenance.  And FWIW, newsyslog files are
not about "unrelated subsystems", it's about one subsystem responsible for
log rotation.

Speaking of "unrelated subsystems", /etc/rc.conf is a living manifestation
of how "unrelated subsystems" can be configured in a single file and, mind
you, everyone is being quite happy about it.

> The monolithic files are difficult to edit

Quite on the contrary: monolithic files are much easier to edit and keep
track of by a human being (system operator).

> and otherwise manage programmatically, and especially difficult to manage
> in terms of software packaging and software updates.

Please don't mix "difficult to edit" and "manage programmatically".  As I
have said, having support for "include *.conf.d" makes sense for 3rd-party
software (read: ports), but has little need for the base, and IMHO brings
more maintenance burden than any benefit.

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


Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-13 Thread Ngie Cooper (yaneurabeya)

> On May 13, 2017, at 9:39 AM, Warner Losh  wrote:
> 
> On Sat, May 13, 2017 at 10:32 AM, Ngie Cooper  > wrote:
>> 
>>> On May 13, 2017, at 09:29, Ngie Cooper  wrote:
>>> 
>>> On May 13, 2017, at 08:37, Rodney W. Grimes 
>>>  wrote:
>>> 
> Author: ngie
> Date: Sat May 13 03:10:50 2017
> New Revision: 318250
> URL: https://svnweb.freebsd.org/changeset/base/318250
> 
> Log:
> Handle the logfiles in newsyslog and syslogd conditionally, based on
> src.conf(5) knobs
> 
> This will allow consumers of FreeBSD to use the unmodified configuration
> files out of the box more than previously.
 
 What about simply generating proper newsyslog.conf and syslog.conf based
 on the the MK_ values rather than change the visible administration
 interface that has finger memory, ansible, and puppet support?
>>> 
>>> - My employer doesn't use puppet on its appliances.
>>> - Files snapshotted in time bitrot (which was the case with our configs, 
>>> which is part of the reason behind this change.
> 
> couldn't you have an Isilion config file in the appropriate directory
> instead? And use the default newsyslog / syslog config files?

I’m not sure I’m in disagreement with this statement, but the fact is that 
there are a handful of config files, about 200 lines each, which drive 
newsyslog/syslogd on OneFS, with a fair amount of duplication. I’m trying to 
simplify the mess I’m presented with at work, one bit at a time.

>>> - It's really easy to screw up a mergemaster call if you edit the files, 
>>> and install the stock version which removes the edits.
>> 
>> Also, programmatically removing the entries means you have to bake the 
>> metadata into etc/Makefile, which is already complicated enough as-is.
> 
> Why do you care about removing them at all? They are no-ops if the
> files don't exist. Why not just always install all these files is
> where I'm going with this…

I don’t follow. Could you please restate this paragraph?
Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP


Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-13 Thread Ngie Cooper (yaneurabeya)

> On May 13, 2017, at 9:51 AM, Alexey Dokuchaev  wrote:
> 
> On Sat, May 13, 2017 at 10:24:20AM -0600, Ian Lepore wrote:
>> ...
>> The evolution for years has been away from monolithic config files
>> containing a mashup of values for unrelated subsystems and towards
>> .conf.d directories containing many single-subject files.
> 
> This "evolution" had probably originated in people's minds who know little
> about software development and maintenance.  And FWIW, newsyslog files are
> not about "unrelated subsystems", it's about one subsystem responsible for
> log rotation.

This hasn’t really changed with moving to .conf.d. A single subsystem is 
managing a series of modular config files, instead of a single config file. I 
firmly believe that this was the right general approach to go.

> Speaking of "unrelated subsystems", /etc/rc.conf is a living manifestation
> of how "unrelated subsystems" can be configured in a single file and, mind
> you, everyone is being quite happy about it.

… except people have to bake in defaults in rc.d scripts for whether or not 
services should be disabled because they can’t put apache defaults in 
/etc/rc.conf . /etc/rc.conf isn’t managed via etcupdate or mergemaster, so I 
think this comparison is like apples to oranges.

>> The monolithic files are difficult to edit
> 
> Quite on the contrary: monolithic files are much easier to edit and keep
> track of by a human being (system operator).

I strongly disagree, having seen multiple configuration files a couple hundred 
lines long. It gets messy and for those who don’t understand how 
syslogd/newsyslog works (inevitably, these people are the ones that get charged 
with implementing daemons, and this is one of the pieces that needs to be done).

>> and otherwise manage programmatically, and especially difficult to manage
>> in terms of software packaging and software updates.
> 
> Please don't mix "difficult to edit" and "manage programmatically".  As I
> have said, having support for "include *.conf.d" makes sense for 3rd-party
> software (read: ports), but has little need for the base, and IMHO brings
> more maintenance burden than any benefit.

Can you please provide an example of how it’s more burdensome going to .conf.d? 
Personally, I think it’s a whole lot easier doing `rm -f 
/etc/newsyslog.d/amd.conf`, than it is to open up the file and edit out the amd 
entries, or invoke sed/something else to do the same thing.

Even ansible/chef/puppet would have to bake the configuration removal logic 
into its template files, which seems like a pain for folks (and the same logic 
would need to be implemented multiple times instead of once).

Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP


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

2017-05-13 Thread Jason Evans
Author: jasone
Date: Sat May 13 17:49:53 2017
New Revision: 318254
URL: https://svnweb.freebsd.org/changeset/base/318254

Log:
  Fix __pthread_mutex_trylock() to call THR_CRITICAL_LEAVE() on failure rather
  than on success.  This regression was introduced by r300043 (Add 
implementation
  of robust mutexes...).
  
  MFC after:1 day

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

Modified: head/lib/libthr/thread/thr_mutex.c
==
--- head/lib/libthr/thread/thr_mutex.c  Sat May 13 13:03:20 2017
(r318253)
+++ head/lib/libthr/thread/thr_mutex.c  Sat May 13 17:49:53 2017
(r318254)
@@ -631,7 +631,7 @@ __pthread_mutex_trylock(pthread_mutex_t 
} /* else {} */
if (robust)
_mutex_leave_robust(curthread, m);
-   if ((ret == 0 || ret == EOWNERDEAD) &&
+   if (ret != 0 && ret != EOWNERDEAD &&
(m->m_flags & PMUTEX_FLAG_PRIVATE) != 0)
THR_CRITICAL_LEAVE(curthread);
return (ret);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r318255 - in head/sys: netinet netinet6

2017-05-13 Thread Ngie Cooper
Author: ngie
Date: Sat May 13 18:41:24 2017
New Revision: 318255
URL: https://svnweb.freebsd.org/changeset/base/318255

Log:
  Add missing braces around MCAST_EXCLUDE check when KTR support is
  compiled into the kernel
  
  This ensures that .iss_asm (the number of ASM listeners) isn't incorrectly
  decremented for MLD-layer source datagrams when inspecting im*s_st[1]
  (the second state in the structure).
  
  MFC after:2 months
  PR:   217509 [1]
  Reported by:  Coverity (Isilon)
  Reviewed by:  ae ("This patch looks correct to me." [1])
  Submitted by: Miles Ohlrich 
  Sponsored by: Dell EMC Isilon

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

Modified: head/sys/netinet/in_mcast.c
==
--- head/sys/netinet/in_mcast.c Sat May 13 17:49:53 2017(r318254)
+++ head/sys/netinet/in_mcast.c Sat May 13 18:41:24 2017(r318255)
@@ -1047,9 +1047,10 @@ inm_merge(struct in_multi *inm, /*const*
/* Decrement ASM listener count on transition out of ASM mode. */
if (imf->imf_st[0] == MCAST_EXCLUDE && nsrc0 == 0) {
if ((imf->imf_st[1] != MCAST_EXCLUDE) ||
-   (imf->imf_st[1] == MCAST_EXCLUDE && nsrc1 > 0))
+   (imf->imf_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) {
CTR1(KTR_IGMPV3, "%s: --asm on inm at t1", __func__);
--inm->inm_st[1].iss_asm;
+   }
}
 
/* Increment ASM listener count on transition to ASM mode. */

Modified: head/sys/netinet6/in6_mcast.c
==
--- head/sys/netinet6/in6_mcast.c   Sat May 13 17:49:53 2017
(r318254)
+++ head/sys/netinet6/in6_mcast.c   Sat May 13 18:41:24 2017
(r318255)
@@ -999,9 +999,10 @@ in6m_merge(struct in6_multi *inm, /*cons
/* Decrement ASM listener count on transition out of ASM mode. */
if (imf->im6f_st[0] == MCAST_EXCLUDE && nsrc0 == 0) {
if ((imf->im6f_st[1] != MCAST_EXCLUDE) ||
-   (imf->im6f_st[1] == MCAST_EXCLUDE && nsrc1 > 0))
+   (imf->im6f_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) {
CTR1(KTR_MLD, "%s: --asm on inm at t1", __func__);
--inm->in6m_st[1].iss_asm;
+   }
}
 
/* Increment ASM listener count on transition to ASM mode. */
___
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: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-13 Thread Alexey Dokuchaev
On Sat, May 13, 2017 at 08:37:42AM -0700, Rodney W. Grimes wrote:
> > New Revision: 318250
> > URL: https://svnweb.freebsd.org/changeset/base/318250
> > 
> > Log:
> >   Handle the logfiles in newsyslog and syslogd conditionally, based on
> >   src.conf(5) knobs
> >   
> >   This will allow consumers of FreeBSD to use the unmodified configuration
> >   files out of the box more than previously.
> 
> What about simply generating proper newsyslog.conf and syslog.conf based
> on the the MK_ values rather than change the visible administration
> interface that has finger memory, ansible, and puppet support?

+1.  I've always loved FreeBSD for its simplicity, and having to know/care
about one or two config files is one of it; these *.d populated directories
smell like Linux too much.

I understand the reason behind supporting those for ports, but please don't
plague our base with this one-line config files scattered around idiocy.

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


Re: svn commit: r318262 - head/usr.sbin/mountd

2017-05-13 Thread Bruce Evans

On Sun, 14 May 2017, Rick Macklem wrote:


Log:
 Change the default uid/gid values for nobody/nogroup to 65534/65533.

 The default values found in /etc/passwd and /etc/group are 65534, 65533.
 In mountd.c, the defaults were -2, which was 65534 back when uid_t was 16bits.
 Without this patch, a file created by root on an NFS exported volume without
 the "-root=" export option will end up owned by uid 4**32 - 2.
 When discussed on freebsd-current@, it seemed that users preferred the
 values being changed to 65534/65533.


I got used to 4294967294.  The large number makes it easy to see files
created by root on another system.  I mostly use nfs without maproot, and
create such files often using tmp directories to transfer files.


 I have not added code to acquire these values from the databases, since
 the mountd daemon might get "stuck" during startup waiting for a non-responsive
 password database server.

 Discussed on:  freebsd-current

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


exports(5) is not modified, so still documents -2:-2 but not the actual
value of 4294967294:4294967294.  It seems dangerous to change the documented
default.

What happens if the server only supports 16-bit (or 15-bit, or 8-bit) uids?


Modified: head/usr.sbin/mountd/mountd.c
==
--- head/usr.sbin/mountd/mountd.c   Sun May 14 00:23:27 2017
(r318261)
+++ head/usr.sbin/mountd/mountd.c   Sun May 14 00:38:41 2017
(r318262)
@@ -230,9 +230,9 @@ static char **exnames;
static char **hosts = NULL;
static struct xucred def_anon = {
XUCRED_VERSION,
-   (uid_t)-2,
+   (uid_t)65534,
1,
-   { (gid_t)-2 },
+   { (gid_t)65533 },
NULL
};
static int force_v2 = 0;


The casts are now bogus.  They might have been needed to avoid warnings
about possible sign extension bugs...


@@ -2893,8 +2893,8 @@ parsecred(char *namelist, struct xucred
/*
 * Set up the unprivileged user.
 */
-   cr->cr_uid = -2;
-   cr->cr_groups[0] = -2;
+   cr->cr_uid = 65534;
+   cr->cr_groups[0] = 65533;
cr->cr_ngroups = 1;
/*
 * Get the user's password table entry.


But there were no casts here, and the warnings should be the same.

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: r318259 - head/lib/msun/src

2017-05-13 Thread Dimitry Andric
Author: dim
Date: Sat May 13 22:36:54 2017
New Revision: 318259
URL: https://svnweb.freebsd.org/changeset/base/318259

Log:
  Silence a -Wunused warning about the junk variable being used to raise
  an inexact floating point exception.  The variable cannot be eliminated,
  unfortunately, otherwise the desired addition triggering the exception
  will be emitted neither by clang, nor by gcc.
  
  Reviewed by:  Steve Kargl, bde
  MFC after:3 days

Modified:
  head/lib/msun/src/catrig.c
  head/lib/msun/src/catrigf.c
  head/lib/msun/src/catrigl.c

Modified: head/lib/msun/src/catrig.c
==
--- head/lib/msun/src/catrig.c  Sat May 13 20:28:32 2017(r318258)
+++ head/lib/msun/src/catrig.c  Sat May 13 22:36:54 2017(r318259)
@@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
 #define isinf(x)   (fabs(x) == INFINITY)
 #undef isnan
 #define isnan(x)   ((x) != (x))
-#defineraise_inexact() do { volatile float junk = 1 + tiny; } while(0)
+#defineraise_inexact() do { volatile float junk __unused = 1 + tiny; } 
while(0)
 #undef signbit
 #define signbit(x) (__builtin_signbit(x))
 

Modified: head/lib/msun/src/catrigf.c
==
--- head/lib/msun/src/catrigf.c Sat May 13 20:28:32 2017(r318258)
+++ head/lib/msun/src/catrigf.c Sat May 13 22:36:54 2017(r318259)
@@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$");
 #define isinf(x)   (fabsf(x) == INFINITY)
 #undef isnan
 #define isnan(x)   ((x) != (x))
-#defineraise_inexact() do { volatile float junk = 1 + tiny; } while(0)
+#defineraise_inexact() do { volatile float junk __unused = 1 + tiny; } 
while(0)
 #undef signbit
 #define signbit(x) (__builtin_signbitf(x))
 

Modified: head/lib/msun/src/catrigl.c
==
--- head/lib/msun/src/catrigl.c Sat May 13 20:28:32 2017(r318258)
+++ head/lib/msun/src/catrigl.c Sat May 13 22:36:54 2017(r318259)
@@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$");
 #define isinf(x)   (fabsl(x) == INFINITY)
 #undef isnan
 #define isnan(x)   ((x) != (x))
-#defineraise_inexact() do { volatile float junk = 1 + tiny; } while(0)
+#defineraise_inexact() do { volatile float junk __unused = 1 + tiny; } 
while(0)
 #undef signbit
 #define signbit(x) (__builtin_signbitl(x))
 
___
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: r318260 - stable/11/sys/fs/nfsclient

2017-05-13 Thread Rick Macklem
Author: rmacklem
Date: Sun May 14 00:12:29 2017
New Revision: 318260
URL: https://svnweb.freebsd.org/changeset/base/318260

Log:
  MFC: r317576
  Modify the NFSv4.1/pNFS client to ask for a maximum length of layout.
  
  The code specified the length of a layout as INT64_MAX instead of
  UINT64_MAX. This could result in getting a layout for less than the
  full file for extremely large files. Although having little practical
  effect, this patch corrects this in the code.
  Detected during recent testing of the pNFS server.

Modified:
  stable/11/sys/fs/nfsclient/nfs_clrpcops.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nfsclient/nfs_clrpcops.c
==
--- stable/11/sys/fs/nfsclient/nfs_clrpcops.c   Sat May 13 22:36:54 2017
(r318259)
+++ stable/11/sys/fs/nfsclient/nfs_clrpcops.c   Sun May 14 00:12:29 2017
(r318260)
@@ -5238,7 +5238,7 @@ nfsrpc_getlayout(struct nfsmount *nmp, v
stateid.other[1] = stateidp->other[1];
stateid.other[2] = stateidp->other[2];
error = nfsrpc_layoutget(nmp, nfhp->nfh_fh,
-   nfhp->nfh_len, iomode, (uint64_t)0, INT64_MAX,
+   nfhp->nfh_len, iomode, (uint64_t)0, UINT64_MAX,
(uint64_t)0, layoutlen, , ,
, cred, p, NULL);
} else {
@@ -5248,7 +5248,7 @@ nfsrpc_getlayout(struct nfsmount *nmp, v
stateid.other[1] = lyp->nfsly_stateid.other[1];
stateid.other[2] = lyp->nfsly_stateid.other[2];
error = nfsrpc_layoutget(nmp, nfhp->nfh_fh,
-   nfhp->nfh_len, iomode, off, INT64_MAX,
+   nfhp->nfh_len, iomode, off, UINT64_MAX,
(uint64_t)0, layoutlen, , ,
, cred, p, NULL);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r318261 - stable/10/sys/fs/nfsclient

2017-05-13 Thread Rick Macklem
Author: rmacklem
Date: Sun May 14 00:23:27 2017
New Revision: 318261
URL: https://svnweb.freebsd.org/changeset/base/318261

Log:
  MFC: r317576
  Modify the NFSv4.1/pNFS client to ask for a maximum length of layout.
  
  The code specified the length of a layout as INT64_MAX instead of
  UINT64_MAX. This could result in getting a layout for less than the
  full file for extremely large files. Although having little practical
  effect, this patch corrects this in the code.
  Detected during recent testing of the pNFS server.

Modified:
  stable/10/sys/fs/nfsclient/nfs_clrpcops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfsclient/nfs_clrpcops.c
==
--- stable/10/sys/fs/nfsclient/nfs_clrpcops.c   Sun May 14 00:12:29 2017
(r318260)
+++ stable/10/sys/fs/nfsclient/nfs_clrpcops.c   Sun May 14 00:23:27 2017
(r318261)
@@ -5235,7 +5235,7 @@ nfsrpc_getlayout(struct nfsmount *nmp, v
stateid.other[1] = stateidp->other[1];
stateid.other[2] = stateidp->other[2];
error = nfsrpc_layoutget(nmp, nfhp->nfh_fh,
-   nfhp->nfh_len, iomode, (uint64_t)0, INT64_MAX,
+   nfhp->nfh_len, iomode, (uint64_t)0, UINT64_MAX,
(uint64_t)0, layoutlen, , ,
, cred, p, NULL);
} else {
@@ -5245,7 +5245,7 @@ nfsrpc_getlayout(struct nfsmount *nmp, v
stateid.other[1] = lyp->nfsly_stateid.other[1];
stateid.other[2] = lyp->nfsly_stateid.other[2];
error = nfsrpc_layoutget(nmp, nfhp->nfh_fh,
-   nfhp->nfh_len, iomode, off, INT64_MAX,
+   nfhp->nfh_len, iomode, off, UINT64_MAX,
(uint64_t)0, layoutlen, , ,
, cred, p, NULL);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r318262 - head/usr.sbin/mountd

2017-05-13 Thread Rick Macklem
Author: rmacklem
Date: Sun May 14 00:38:41 2017
New Revision: 318262
URL: https://svnweb.freebsd.org/changeset/base/318262

Log:
  Change the default uid/gid values for nobody/nogroup to 65534/65533.
  
  The default values found in /etc/passwd and /etc/group are 65534, 65533.
  In mountd.c, the defaults were -2, which was 65534 back when uid_t was 16bits.
  Without this patch, a file created by root on an NFS exported volume without
  the "-root=" export option will end up owned by uid 4**32 - 2.
  When discussed on freebsd-current@, it seemed that users preferred the
  values being changed to 65534/65533.
  I have not added code to acquire these values from the databases, since
  the mountd daemon might get "stuck" during startup waiting for a 
non-responsive
  password database server.
  
  Discussed on: freebsd-current

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

Modified: head/usr.sbin/mountd/mountd.c
==
--- head/usr.sbin/mountd/mountd.c   Sun May 14 00:23:27 2017
(r318261)
+++ head/usr.sbin/mountd/mountd.c   Sun May 14 00:38:41 2017
(r318262)
@@ -230,9 +230,9 @@ static char **exnames;
 static char **hosts = NULL;
 static struct xucred def_anon = {
XUCRED_VERSION,
-   (uid_t)-2,
+   (uid_t)65534,
1,
-   { (gid_t)-2 },
+   { (gid_t)65533 },
NULL
 };
 static int force_v2 = 0;
@@ -2893,8 +2893,8 @@ parsecred(char *namelist, struct xucred 
/*
 * Set up the unprivileged user.
 */
-   cr->cr_uid = -2;
-   cr->cr_groups[0] = -2;
+   cr->cr_uid = 65534;
+   cr->cr_groups[0] = 65533;
cr->cr_ngroups = 1;
/*
 * Get the user's password table entry.
___
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"