Re: svn commit: r319561 - head/usr.bin/primes

2017-06-03 Thread Conrad Meyer
Hi Colin,

Minor nitpicking follows.

On Sat, Jun 3, 2017 at 7:36 PM, Colin Percival  wrote:
> Author: cperciva
> Date: Sun Jun  4 02:36:37 2017
> New Revision: 319561
> URL: https://svnweb.freebsd.org/changeset/base/319561
>
> Log:
>   Using results from
>   J. Sorenson and J. Webster, Strong pseudoprimes to twelve prime
>   bases, Math. Comp. 86(304):985-1003, 2017.
>   teach primes(6) to enumerate primes up to 2^64 - 1.  Until Sorenson
>   and Webster's paper, we did not know how many strong speudoprime tests
>   were required when testing alleged primes between 3825123056546413051
>   and 2^64 - 1.
> ...
> Modified: head/usr.bin/primes/primes.c
> ==
> --- head/usr.bin/primes/primes.cSun Jun  4 02:21:38 2017
> (r319560)
> +++ head/usr.bin/primes/primes.cSun Jun  4 02:36:37 2017
> (r319561)
> @@ -120,7 +120,7 @@ main(int argc, char *argv[])
> argv += optind;
>
> start = 0;
> -   stop = SPSPMAX;
> +   stop = (uint64_t)(-1);

Isn't this usually spelled UINT64_MAX?

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


Re: svn commit: r318441 - in head/etc: . cron.d

2017-06-03 Thread Colin Percival
On 06/03/17 21:39, Rodney W. Grimes wrote:
> Are we going to end up with /etc/rc.conf.d?

We've had this for over 15 years -- ever since NetBSD rc.d system was
imported.

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


Re: svn commit: r318441 - in head/etc: . cron.d

2017-06-03 Thread Rodney W. Grimes
> On Friday, May 19, 2017 09:17:23 AM John Baldwin wrote:
> > On Thursday, May 18, 2017 11:24:29 PM Baptiste Daroussin wrote:
> > > On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
> > > > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
> > > > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
> > > > > > > Author: ngie
> > > > > > > Date: Thu May 18 06:25:39 2017
> > > > > > > New Revision: 318441
> > > > > > > URL: https://svnweb.freebsd.org/changeset/base/318441
> > > > > > > 
> > > > > > > Log:
> > > > > > >   Handle the cron.d entry for MK_AT in cron conditionally
> > > > > > >   
> > > > > > >   Install /etc/cron.d/at if MK_AT != no, always using it, which 
> > > > > > > tries
> > > > > > >   to run a non-existent program via cron(8) every 5 minutes with 
> > > > > > > the
> > > > > > >   default /etc/crontab, prior to this commit.
> > > > > > >   
> > > > > > >   SHELL and PATH are duplicated between /etc/crontab and 
> > > > > > > /etc/cron.d/at
> > > > > > >   because atrun(8) executes programs, which may rely on 
> > > > > > > environment
> > > > > > >   currently set via /etc/crontab.
> > > > > > >   
> > > > > > >   Noted by:   bdrewery (in an internal review)
> > > > > > >   MFC after:  2 months
> > > > > > >   Relnotes:   yes (may need to add environmental 
> > > > > > > modifications to
> > > > > > >/etc/cron.d/at)
> > > > > > >   Sponsored by:   Dell EMC Isilon
> > > > > > > 
> > > > > > > Added:
> > > > > > >   head/etc/cron.d/
> > > > > > >   head/etc/cron.d/Makefile   (contents, props changed)
> > > > > > >   head/etc/cron.d/at   (contents, props changed)
> > > > > > > Modified:
> > > > > > >   head/etc/Makefile
> > > > > > >   head/etc/crontab
> > > > > > > 
> > > > > > > Modified: head/etc/Makefile
> > > > > > > ==
> > > > > > > --- head/etc/Makefile Thu May 18 06:15:42 2017
> > > > > > > (r318440)
> > > > > > > +++ head/etc/Makefile Thu May 18 06:25:39 2017
> > > > > > > (r318441)
> > > > > > > @@ -8,6 +8,7 @@ FILESGROUPS=  FILES
> > > > > > >  # No need as it is empty and just causes rebuilds since this 
> > > > > > > file does so much.
> > > > > > >  UPDATE_DEPENDFILE=   no
> > > > > > >  SUBDIR=  \
> > > > > > > + cron.d \
> > > > > > >   newsyslog.conf.d \
> > > > > > >   syslog.d
> > > > > > 
> > > > > > The thread on the newsyslog clearly shows that this is a 
> > > > > > contriversial change.
> > > > > > 
> > > > > > I strongly object to further splitting of /etc/FOO into 
> > > > > > /etc/foo.d/FOO files
> > > > > > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs 
> > > > > > and
> > > > > > desires of others.
> > > > > 
> > > > > Has multiple people has stated, on the newsyslog thread. this is not a
> > > > > DELL/EMC/Isilon need, this is also a requirement for plenty of use 
> > > > > cases
> > > > > 1. Consistency
> > > > >   as a project we do support building WITHOUT_FOO there is no reason 
> > > > > to install
> > > > >   syslog, cron configuration for FOO if the system was built without 
> > > > > foo
> > > > 
> > > > Though it doesn't _hurt_, and breaking POLA has to be worth it, not just
> > > > because it looks nice.
> > > > 
> > > > > 2. Packaging base
> > > > >   if one does not install at there is no need for the at crontab to 
> > > > > be installed
> > > > >   (same reason as 1.)
> > > > 
> > > > This is a viable reason except that it isn't fully baked yet.
> > > > 
> > > > > 3. Large deployment of freebsd farms
> > > > >   Being able to administrate thousands of FreeBSD machines, one often 
> > > > > ends up
> > > > >   using tools like puppet, chef, ansible, cfengine. When 
> > > > > programmatically
> > > > >   handling configuration management it is way easier and safer to 
> > > > > simple
> > > > >   add/removes files in a directory rather than mangling^Winplace 
> > > > > editing files.
> > > > 
> > > > There's nothing preventing you now from deploying split files and an 
> > > > empty
> > > > global configuration file since the daemons support foo.d.  You don't 
> > > > require
> > > > that to change in upstream since you should be using some sort of VCS to
> > > > manage your configuration as it is.
> > > > 
> > > > > 4. Ports/packages
> > > > >   On can provide easily sample configuration for cron, syslog (not 
> > > > > only) and the
> > > > >   admin can decide to use it or not easily (ususally this is done by 
> > > > > making
> > > > >   symlinks from the said file which would live in share/* into the .d 
> > > > > directory.
> > > > > 
> > > > > This is not a new trend in FreeBSD: newsyslog, rc.conf, libmap and 
> > > > > more.
> > > > 
> > > > The support for broken out files has long been there, but the base 
> > > > system has
> > > > not used them previously for default config shipped during a release.  
> > > > That
> > > > is in fact 

svn commit: r319562 - head/usr.bin/factor

2017-06-03 Thread Colin Percival
Author: cperciva
Date: Sun Jun  4 02:45:18 2017
New Revision: 319562
URL: https://svnweb.freebsd.org/changeset/base/319562

Log:
  Delete obsolete paragraph; primes(6) is now able to list primes for the
  full range up to 2^64 - 1.
  
  MFC after:1 week

Modified:
  head/usr.bin/factor/factor.6

Modified: head/usr.bin/factor/factor.6
==
--- head/usr.bin/factor/factor.6Sun Jun  4 02:36:37 2017
(r319561)
+++ head/usr.bin/factor/factor.6Sun Jun  4 02:45:18 2017
(r319562)
@@ -119,9 +119,3 @@ cannot handle the
 factor list,
 .Nm primes
 will not get you a world record.
-.Pp
-.Nm primes
-is unable to list primes between 3825123056546413050 and 18446744073709551615
-since it relies on strong pseudoprime tests after sieving, and nobody has
-proven how many strong pseudoprime tests are required to prove primality for
-integers larger than 3825123056546413050.
___
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: r319561 - head/usr.bin/primes

2017-06-03 Thread Colin Percival
Author: cperciva
Date: Sun Jun  4 02:36:37 2017
New Revision: 319561
URL: https://svnweb.freebsd.org/changeset/base/319561

Log:
  Using results from
  J. Sorenson and J. Webster, Strong pseudoprimes to twelve prime
  bases, Math. Comp. 86(304):985-1003, 2017.
  teach primes(6) to enumerate primes up to 2^64 - 1.  Until Sorenson
  and Webster's paper, we did not know how many strong speudoprime tests
  were required when testing alleged primes between 3825123056546413051
  and 2^64 - 1.
  
  Reported by:  Luiz Henrique de Figueiredo
  Relnotes: primes(6) now enumerates primes beyond 3825123056546413050,
up to a new limit of 2^64 - 1.
  MFC After:1 week

Modified:
  head/usr.bin/primes/primes.c
  head/usr.bin/primes/primes.h
  head/usr.bin/primes/spsp.c

Modified: head/usr.bin/primes/primes.c
==
--- head/usr.bin/primes/primes.cSun Jun  4 02:21:38 2017
(r319560)
+++ head/usr.bin/primes/primes.cSun Jun  4 02:36:37 2017
(r319561)
@@ -120,7 +120,7 @@ main(int argc, char *argv[])
argv += optind;
 
start = 0;
-   stop = SPSPMAX;
+   stop = (uint64_t)(-1);
 
/*
 * Convert low and high args.  Strtoumax(3) sets errno to
@@ -147,8 +147,6 @@ main(int argc, char *argv[])
err(1, "%s", argv[1]);
if (*p != '\0')
errx(1, "%s: illegal numeric format.", argv[1]);
-   if (stop > SPSPMAX)
-   errx(1, "%s: stop value too large.", argv[1]);
break;
case 1:
/* Start on the command line. */

Modified: head/usr.bin/primes/primes.h
==
--- head/usr.bin/primes/primes.hSun Jun  4 02:21:38 2017
(r319560)
+++ head/usr.bin/primes/primes.hSun Jun  4 02:36:37 2017
(r319561)
@@ -72,6 +72,3 @@ extern const size_t pattern_size; /* length of pattern
 
 /* Test for primality using strong pseudoprime tests. */
 int isprime(ubig);
-
-/* Maximum value which the SPSP code can handle. */
-#defineSPSPMAX 3825123056546413050ULL

Modified: head/usr.bin/primes/spsp.c
==
--- head/usr.bin/primes/spsp.c  Sun Jun  4 02:21:38 2017(r319560)
+++ head/usr.bin/primes/spsp.c  Sun Jun  4 02:36:37 2017(r319561)
@@ -32,23 +32,32 @@ __FBSDID("$FreeBSD$");
 
 #include "primes.h"
 
-/* Return a * b % n, where 0 <= a, b < 2^63, 0 < n < 2^63. */
+/* Return a * b % n, where 0 < n. */
 static uint64_t
 mulmod(uint64_t a, uint64_t b, uint64_t n)
 {
uint64_t x = 0;
+   uint64_t an = a % n;
 
while (b != 0) {
-   if (b & 1)
-   x = (x + a) % n;
-   a = (a + a) % n;
+   if (b & 1) {
+   x += an;
+   if ((x < an) || (x >= n))
+   x -= n;
+   }
+   if (an + an < an)
+   an = an + an - n;
+   else if (an + an >= n)
+   an = an + an - n;
+   else
+   an = an + an;
b >>= 1;
}
 
return (x);
 }
 
-/* Return a^r % n, where 0 <= a < 2^63, 0 < n < 2^63. */
+/* Return a^r % n, where 0 < n. */
 static uint64_t
 powmod(uint64_t a, uint64_t r, uint64_t n)
 {
@@ -173,9 +182,20 @@ isprime(ubig _n)
if (n < 3825123056546413051)
return (1);
 
-   /* We can't handle values larger than this. */
-   assert(n <= SPSPMAX);
+   /*
+* Value from:
+* J. Sorenson and J. Webster, Strong pseudoprimes to twelve prime
+* bases, Math. Comp. 86(304):985-1003, 2017.
+*/
 
-   /* UNREACHABLE */
-   return (0);
+   /* No SPSPs to bases 2..37 less than 318665857834031151167461. */
+   if (!spsp(n, 29))
+   return (0);
+   if (!spsp(n, 31))
+   return (0);
+   if (!spsp(n, 37))
+   return (0);
+
+   /* All 64-bit values are less than 318665857834031151167461. */
+   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"


Re: svn commit: r319557 - head/sys/fs/ext2fs

2017-06-03 Thread Ngie Cooper (yaneurabeya)

> On Jun 3, 2017, at 18:16, Pedro Giffuni  wrote:
> 
> 
> On 03/06/2017 17:54, Ngie Cooper (yaneurabeya) wrote:
>>> On Jun 3, 2017, at 15:30, Conrad Meyer  wrote:
>>> 
>>> Author: cem
>>> Date: Sat Jun  3 22:30:30 2017
>>> New Revision: 319557
>>> URL: https://svnweb.freebsd.org/changeset/base/319557
>>> 
>>> Log:
>>>  ext2fs(4): Fix a number of broken flag checks
>>> 
>>>  Introduced in r319071.
>>> 
>>>  Reported by:   Coverity
>>>  CIDs:  1375847, 1375848, 1375849
>>>  Sponsored by:  Dell EMC Isilon
>> Did pjg review this?
> 
> I don't know about pjg, but I wasn't even aware about the Coverity issues. I 
> never added myself to the MAINTAINERS list so it's OK, I will just have the 
> code submitter confirm the fixes.

I meant pfg — sorry :/.

> Luckily this is code that has not been MFC'd because I don't consider it 
> bullet-proof and more eyes are always welcome.


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r319560 - stable/11/usr.bin/mkimg/tests

2017-06-03 Thread Ngie Cooper
Author: ngie
Date: Sun Jun  4 02:21:38 2017
New Revision: 319560
URL: https://svnweb.freebsd.org/changeset/base/319560

Log:
  MFC r319294:
  
  Approved by:  re (gjb)
  
  Fix "make rebase" after ^/head@r315776
  
  "make rebase" can be used for rebasing the output files from mkimg
  after making a change to mkimg. This will come in handy soon, per
  bug 219673.

Modified:
  stable/11/usr.bin/mkimg/tests/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/mkimg/tests/Makefile
==
--- stable/11/usr.bin/mkimg/tests/Makefile  Sat Jun  3 23:13:46 2017
(r319559)
+++ stable/11/usr.bin/mkimg/tests/Makefile  Sun Jun  4 02:21:38 2017
(r319560)
@@ -2,7 +2,8 @@
 
 PACKAGE=   tests
 
-ATF_TESTS_SH=  mkimg_test
+_REBASE_SCRIPT=mkimg_test
+ATF_TESTS_SH=  ${_REBASE_SCRIPT}
 
 SOURCES!=  cd ${.CURDIR}; echo *.uu
 ${PACKAGE}FILES+=  ${SOURCES:S,.gz.uu,,g}
@@ -12,7 +13,7 @@ ${${PACKAGE}FILES}:
 
 CLEANFILES+=   ${${PACKAGE}FILES}}
 
-rebase:
-   (cd ${.CURDIR}; atf-sh mkimg.sh rebase)
+rebase: .PHONY
+   (cd ${.CURDIR}; atf-sh ${_REBASE_SCRIPT}.sh rebase)
 
 .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"


Re: svn commit: r319557 - head/sys/fs/ext2fs

2017-06-03 Thread Pedro Giffuni


On 03/06/2017 17:54, Ngie Cooper (yaneurabeya) wrote:

On Jun 3, 2017, at 15:30, Conrad Meyer  wrote:

Author: cem
Date: Sat Jun  3 22:30:30 2017
New Revision: 319557
URL: https://svnweb.freebsd.org/changeset/base/319557

Log:
  ext2fs(4): Fix a number of broken flag checks

  Introduced in r319071.

  Reported by:  Coverity
  CIDs: 1375847, 1375848, 1375849
  Sponsored by: Dell EMC Isilon

Did pjg review this?


I don't know about pjg, but I wasn't even aware about the Coverity 
issues. I never added myself to the MAINTAINERS list so it's OK, I will 
just have the code submitter confirm the fixes.


Luckily this is code that has not been MFC'd because I don't consider it 
bullet-proof and more eyes are always welcome.


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: r319559 - head

2017-06-03 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun  3 23:13:46 2017
New Revision: 319559
URL: https://svnweb.freebsd.org/changeset/base/319559

Log:
  native-xtools: Connect makewhatis.
  
  This speeds up some port staging, namely perl.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Jun  3 22:39:50 2017(r319558)
+++ head/Makefile.inc1  Sat Jun  3 23:13:46 2017(r319559)
@@ -1964,7 +1964,7 @@ NXBMAKE=  ${NXBENV} ${MAKE} \
MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} \
MK_GDB=no MK_TESTS=no \
SSP_CFLAGS= \
-   MK_HTML=no NO_LINT=yes MK_MAN=no \
+   MK_HTML=no NO_LINT=yes MK_MAN=no MK_MAN_UTILS=yes \
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
@@ -2038,6 +2038,8 @@ native-xtools: .PHONY
 usr.bin/lex \
 usr.bin/limits \
 usr.bin/lorder \
+${_libopenbsd} \
+${_makewhatis} \
 usr.bin/mktemp \
 usr.bin/mt \
 usr.bin/patch \
___
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: r319557 - head/sys/fs/ext2fs

2017-06-03 Thread Ngie Cooper (yaneurabeya)

> On Jun 3, 2017, at 15:30, Conrad Meyer  wrote:
> 
> Author: cem
> Date: Sat Jun  3 22:30:30 2017
> New Revision: 319557
> URL: https://svnweb.freebsd.org/changeset/base/319557
> 
> Log:
>  ext2fs(4): Fix a number of broken flag checks
> 
>  Introduced in r319071.
> 
>  Reported by: Coverity
>  CIDs:1375847, 1375848, 1375849
>  Sponsored by:Dell EMC Isilon

Did pjg review this?
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r319558 - head/sys/fs/ext2fs

2017-06-03 Thread Conrad Meyer
Author: cem
Date: Sat Jun  3 22:39:50 2017
New Revision: 319558
URL: https://svnweb.freebsd.org/changeset/base/319558

Log:
  ext2fs(4): Fix a null dererence and clean an unclear switch
  
  Coverity warned that the switch statement fell through.  While this was
  intentional, the pattern wasn't especially clear.  I just changed it to a
  conventional if pattern.
  
  Reported by:  Coverity
  CIDs: 1375851 (false positive), 1375853
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/fs/ext2fs/ext2_acl.c

Modified: head/sys/fs/ext2fs/ext2_acl.c
==
--- head/sys/fs/ext2fs/ext2_acl.c   Sat Jun  3 22:30:30 2017
(r319557)
+++ head/sys/fs/ext2fs/ext2_acl.c   Sat Jun  3 22:39:50 2017
(r319558)
@@ -127,13 +127,18 @@ ext2_sync_inode_from_acl(struct acl *acl, struct inode
 static int
 ext4_acl_from_disk(char *value, size_t size, struct acl *acl)
 {
-   const char *end = value + size;
+   const char *end;
int n, count, s;
 
+   if (value == NULL)
+   return (EINVAL);
+
+   end = value + size;
+
if (((struct ext2_acl_header *)value)->a_version != EXT4_ACL_VERSION)
return (EINVAL);
 
-   if (!value || size < sizeof(struct ext2_acl_header))
+   if (size < sizeof(struct ext2_acl_header))
return (EINVAL);
 
s = size - sizeof(struct ext2_acl_header);
@@ -230,8 +235,7 @@ ext2_getacl_posix1e(struct vop_getacl_args *ap)
 
error = vn_extattr_get(ap->a_vp, IO_NODELOCKED, attrnamespace, attrname,
&len, value, ap->a_td);
-   switch (error) {
-   case ENOATTR:
+   if (error == ENOATTR) {
switch (ap->a_type) {
case ACL_TYPE_ACCESS:
ap->a_aclp->acl_cnt = 3;
@@ -250,21 +254,20 @@ ext2_getacl_posix1e(struct vop_getacl_args *ap)
ap->a_aclp->acl_cnt = 0;
break;
}
-   case 0:
-   if (!error) {
-   error = ext4_acl_from_disk(value, len, ap->a_aclp);
-   if (error)
-   goto out;
-   }
+   } else if (error != 0)
+   goto out;
 
-   if (error == ENOATTR)
-   error = 0;
-
-   if (ap->a_type == ACL_TYPE_ACCESS)
-   ext2_sync_acl_from_inode(VTOI(ap->a_vp), ap->a_aclp);
-   default:
-   break;
+   if (!error) {
+   error = ext4_acl_from_disk(value, len, ap->a_aclp);
+   if (error)
+   goto out;
}
+
+   if (error == ENOATTR)
+   error = 0;
+
+   if (ap->a_type == ACL_TYPE_ACCESS)
+   ext2_sync_acl_from_inode(VTOI(ap->a_vp), ap->a_aclp);
 
 out:
free(value, M_TEMP);
___
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: r319557 - head/sys/fs/ext2fs

2017-06-03 Thread Conrad Meyer
Author: cem
Date: Sat Jun  3 22:30:30 2017
New Revision: 319557
URL: https://svnweb.freebsd.org/changeset/base/319557

Log:
  ext2fs(4): Fix a number of broken flag checks
  
  Introduced in r319071.
  
  Reported by:  Coverity
  CIDs: 1375847, 1375848, 1375849
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/fs/ext2fs/ext2_acl.c

Modified: head/sys/fs/ext2fs/ext2_acl.c
==
--- head/sys/fs/ext2fs/ext2_acl.c   Sat Jun  3 21:53:58 2017
(r319556)
+++ head/sys/fs/ext2fs/ext2_acl.c   Sat Jun  3 22:30:30 2017
(r319557)
@@ -276,7 +276,7 @@ ext2_getacl(struct vop_getacl_args *ap)
 {
 
if (((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) ||
-   ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 1))
+   ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) != 0))
return (EOPNOTSUPP);
 
if (ap->a_type == ACL_TYPE_NFS4)
@@ -473,7 +473,7 @@ int
 ext2_setacl(struct vop_setacl_args *ap)
 {
if (((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) ||
-   ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 1))
+   ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) != 0))
return (EOPNOTSUPP);
 
if (ap->a_type == ACL_TYPE_NFS4)
@@ -490,7 +490,7 @@ ext2_aclcheck(struct vop_aclcheck_args *ap)
 {
 
if (((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) ||
-   ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 1))
+   ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) != 0))
return (EOPNOTSUPP);
 
if (ap->a_type == ACL_TYPE_NFS4)
___
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: r319556 - head/sys/netinet

2017-06-03 Thread Michael Tuexen
Author: tuexen
Date: Sat Jun  3 21:53:58 2017
New Revision: 319556
URL: https://svnweb.freebsd.org/changeset/base/319556

Log:
  Fix the ICMP6 handling for TCP.
  
  The ICMP6 packets might not be contained in a single mbuf. So don't
  assume this. Keep the IPv4 and IPv6 code in sync and make explicit
  that the syncache code only need the TCP sequence number, not the
  complete TCP header.
  
  MFC after:3 days
  Sponsored by: Netflix, Inc.

Modified:
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/tcp_syncache.c
  head/sys/netinet/tcp_syncache.h

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Sat Jun  3 20:39:48 2017(r319555)
+++ head/sys/netinet/tcp_subr.c Sat Jun  3 21:53:58 2017(r319556)
@@ -1963,16 +1963,16 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
if (inp != NULL && PRC_IS_REDIRECT(cmd)) {
/* signal EHOSTDOWN, as it flushes the cached route */
inp = (*notify)(inp, EHOSTDOWN);
-   if (inp != NULL)
-   INP_WUNLOCK(inp);
-   } else if (inp != NULL)  {
+   goto out;
+   }
+   icmp_tcp_seq = th->th_seq;
+   if (inp != NULL)  {
if (!(inp->inp_flags & INP_TIMEWAIT) &&
!(inp->inp_flags & INP_DROPPED) &&
!(inp->inp_socket == NULL)) {
-   icmp_tcp_seq = ntohl(th->th_seq);
tp = intotcpcb(inp);
-   if (SEQ_GEQ(icmp_tcp_seq, tp->snd_una) &&
-   SEQ_LT(icmp_tcp_seq, tp->snd_max)) {
+   if (SEQ_GEQ(ntohl(icmp_tcp_seq), tp->snd_una) &&
+   SEQ_LT(ntohl(icmp_tcp_seq), tp->snd_max)) {
if (cmd == PRC_MSGSIZE) {
/*
 * MTU discovery:
@@ -1980,7 +1980,7 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
 * in the route to the suggested new
 * value (if given) and then notify.
 */
-   mtu = ntohs(icp->icmp_nextmtu);
+   mtu = ntohs(icp->icmp_nextmtu);
/*
 * If no alternative MTU was
 * proposed, try the next smaller
@@ -2011,16 +2011,17 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
inetctlerrmap[cmd]);
}
}
-   if (inp != NULL)
-   INP_WUNLOCK(inp);
} else {
bzero(&inc, sizeof(inc));
inc.inc_fport = th->th_dport;
inc.inc_lport = th->th_sport;
inc.inc_faddr = faddr;
inc.inc_laddr = ip->ip_src;
-   syncache_unreach(&inc, th);
+   syncache_unreach(&inc, icmp_tcp_seq);
}
+out:
+   if (inp != NULL)
+   INP_WUNLOCK(inp);
INP_INFO_RUNLOCK(&V_tcbinfo);
 }
 #endif /* INET */
@@ -2030,7 +2031,6 @@ void
 tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d)
 {
struct in6_addr *dst;
-   struct tcphdr *th;
struct inpcb *(*notify)(struct inpcb *, int) = tcp_notify;
struct ip6_hdr *ip6;
struct mbuf *m;
@@ -2040,11 +2040,14 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d)
struct ip6ctlparam *ip6cp = NULL;
const struct sockaddr_in6 *sa6_src = NULL;
struct in_conninfo inc;
+   struct tcp_ports {
+   uint16_t th_sport;
+   uint16_t th_dport;
+   } t_ports;
tcp_seq icmp_tcp_seq;
unsigned int mtu;
unsigned int off;
 
-
if (sa->sa_family != AF_INET6 ||
sa->sa_len != sizeof(struct sockaddr_in6))
return;
@@ -2093,27 +2096,31 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d)
/* Check if we can safely get the ports from the tcp hdr */
if (m == NULL ||
(m->m_pkthdr.len <
-   (int32_t) (off + offsetof(struct tcphdr, th_seq {
+   (int32_t) (off + sizeof(struct tcp_ports {
return;
}
-
-   th = (struct tcphdr *) mtodo(ip6cp->ip6c_m, ip6cp->ip6c_off);
+   bzero(&t_ports, sizeof(struct tcp_ports));
+   m_copydata(m, off, sizeof(struct tcp_ports), (caddr_t)&t_ports);
INP_INFO_RLOCK(&V_tcbinfo);
-   inp = in6_pcblookup(&V_tcbinfo, &ip6->ip6_dst, th->th_dport,
-   &ip6->ip6_src, th->th_sport, INPLOOKUP_WLOCKPCB, NULL);
+   inp = in6_pcblookup(&V_tcbinfo, &ip6->ip6_dst, t_ports.th_dport,
+   &ip6->ip6_src, t_ports.th_sport, INPLOOKUP_WLOCKPCB, NULL);
 

Re: svn commit: r318441 - in head/etc: . cron.d

2017-06-03 Thread Ngie Cooper (yaneurabeya)

> On Jun 3, 2017, at 12:05, John Baldwin  wrote:

…

> Ping?  bapt@ agreed with this, but I haven't seen any other feedback?  If 
> others
> agree then we should either revert back to a single foo.conf or we should 
> fully
> split newsyslog.conf and syslogd.conf out to individual files.

Please, no. The single monolithic foo.conf idea may have made sense back in the 
day, but with the various knobs that are available for building the system, for 
ease-of-use/intuitiveness the feature makes sense.
I planned on introducing more of these files for other areas of the system that 
aren’t currently being handled— like bsnmpd’s logging, etc. I think the 
modularization makes sense.
Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r319555 - stable/11/usr.sbin/extattr/tests

2017-06-03 Thread Ngie Cooper
Author: ngie
Date: Sat Jun  3 20:39:48 2017
New Revision: 319555
URL: https://svnweb.freebsd.org/changeset/base/319555

Log:
  MFC r316503,r316504,r316505:
  
  Approved by:  re (gjb)
  
  r316503:
  
  Clean up trailing whitespace
  
  r316504:
  
  Clean up more trailing whitespace in the licensing tort that
  happened to be spaces, not tabs
  
  r316505:
  
  Don't assume NAME_MAX is 255
  
  Query the filesystem limit via getconf(3) instead

Modified:
  stable/11/usr.sbin/extattr/tests/extattr_test.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/extattr/tests/extattr_test.sh
==
--- stable/11/usr.sbin/extattr/tests/extattr_test.shSat Jun  3 20:14:46 
2017(r319554)
+++ stable/11/usr.sbin/extattr/tests/extattr_test.shSat Jun  3 20:39:48 
2017(r319555)
@@ -10,7 +10,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #notice, this list of conditions and the following disclaimer in the
 #documentation and/or other materials provided with the distribution.
-#   
+#
 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -36,7 +36,7 @@ bad_namespace_body() {
setextattr badnamespace myattr X foo
atf_check -s not-exit:0 -e match:"Invalid argument" \
lsextattr -q badnamespace foo
-}  
+}
 
 atf_test_case hex
 hex_head() {
@@ -48,7 +48,7 @@ hex_body() {
atf_check -s exit:0 -o empty setextattr user myattr XYZ foo
atf_check -s exit:0 -o inline:"58 59 5a\n" \
getextattr -qx user myattr foo
-}  
+}
 
 atf_test_case hex_nonascii
 hex_nonascii_head() {
@@ -62,7 +62,7 @@ hex_nonascii_body() {
getextattr user myattr foo
atf_check -s exit:0 -o inline:"20 30 40 55 66 70 81 a2 b3 ee ff\n" \
getextattr -qx user myattr foo
-}  
+}
 
 atf_test_case long_name
 long_name_head() {
@@ -70,10 +70,15 @@ long_name_head() {
 }
 long_name_body() {
check_fs
+
+   if ! NAME_MAX=$(getconf NAME_MAX .); then
+   atf_skip "Filesystem not reporting NAME_MAX; skipping testcase"
+   fi
+
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208965
atf_expect_fail "BUG 208965 extattr(2) doesn't allow maxlen attr names"
 
-   ATTRNAME=`jot -b X -s "" 255 0`
+   ATTRNAME=`jot -b X -s "" $NAME_MAX 0`
touch foo
atf_check -s exit:0 -o empty setextattr user $ATTRNAME myvalue foo
atf_check -s exit:0 -o inline:"${ATTRNAME}\n" lsextattr -q user foo
@@ -81,7 +86,7 @@ long_name_body() {
getextattr -q user ${ATTRNAME} foo
atf_check -s exit:0 -o empty rmextattr user ${ATTRNAME} foo
atf_check -s exit:0 -o empty lsextattr -q user foo
-}  
+}
 
 atf_test_case loud
 loud_head() {
@@ -99,7 +104,7 @@ loud_body() {
printf "%s %s" $(getextattr user myattr foo)
atf_check -s exit:0 -o empty rmextattr user myattr foo
atf_check -s exit:0 -o inline:"foo" printf %s $(lsextattr user foo)
-}  
+}
 
 atf_test_case noattrs
 noattrs_head() {
@@ -109,7 +114,7 @@ noattrs_body() {
check_fs
touch foo
atf_check -s exit:0 -o empty lsextattr -q user foo
-}  
+}
 
 atf_test_case nonexistent_file
 nonexistent_file_head() {
@@ -125,7 +130,7 @@ nonexistent_file_body() {
getextattr user myattr foo
atf_check -s exit:1 -e match:"No such file or directory" \
rmextattr user myattr foo
-}  
+}
 
 atf_test_case null
 null_head() {
@@ -136,7 +141,7 @@ null_body() {
touch foo
atf_check -s exit:0 -o empty setextattr -n user myattr myvalue foo
atf_check -s exit:0 -o inline:"myvalue\0\n" getextattr -q user myattr 
foo
-}  
+}
 
 atf_test_case one_user_attr
 one_user_attr_head() {
@@ -150,7 +155,7 @@ one_user_attr_body() {
atf_check -s exit:0 -o inline:"myvalue\n" getextattr -q user myattr foo
atf_check -s exit:0 -o empty rmextattr user myattr foo
atf_check -s exit:0 -o empty lsextattr -q user foo
-}  
+}
 
 atf_test_case one_system_attr
 one_system_attr_head() {
@@ -165,7 +170,7 @@ one_system_attr_body() {
atf_check -s exit:0 -o inline:"myvalue\n" getextattr -q system myattr 
foo
atf_check -s exit:0 -o empty rmextattr system myattr foo
atf_check -s exit:0 -o empty lsextattr -q system foo
-}  
+}
 
 atf_test_case stdin
 stdin_head() {
@@ -179,7 +184,7 @@ stdin_body() {
atf_check -s exit:0 -o inline:"myattr\n" lsextattr -q user foo
getextattr -qq user myattr foo > outfile || atf_fail "getextattr failed"
atf_check -s exit:0 cmp -s infile outfile
-}  
+}
 
 atf_test_case stringify
 stringify_head() {
@@ -191,7 +196,7 @@ stringify

svn commit: r319554 - in head/sys/arm: conf freescale/vybrid

2017-06-03 Thread Andrew Turner
Author: andrew
Date: Sat Jun  3 20:14:46 2017
New Revision: 319554
URL: https://svnweb.freebsd.org/changeset/base/319554

Log:
  Port the Vybrid code to PLATFORM to help move it into GENERIC.

Deleted:
  head/sys/arm/freescale/vybrid/vf_common.c
Modified:
  head/sys/arm/conf/VYBRID
  head/sys/arm/freescale/vybrid/files.vybrid
  head/sys/arm/freescale/vybrid/vf_machdep.c

Modified: head/sys/arm/conf/VYBRID
==
--- head/sys/arm/conf/VYBRIDSat Jun  3 20:02:12 2017(r319553)
+++ head/sys/arm/conf/VYBRIDSat Jun  3 20:14:46 2017(r319554)
@@ -25,6 +25,7 @@ include   "../freescale/vybrid/std.vybrid"
 makeoptionsWERROR="-Werror"
 
 optionsSCHED_4BSD  # 4BSD scheduler
+optionsPLATFORM# Platform based SoC
 #options   NANDFS  # NAND Filesystem
 #options   SMP # Enable multiple cores
 

Modified: head/sys/arm/freescale/vybrid/files.vybrid
==
--- head/sys/arm/freescale/vybrid/files.vybrid  Sat Jun  3 20:02:12 2017
(r319553)
+++ head/sys/arm/freescale/vybrid/files.vybrid  Sat Jun  3 20:14:46 2017
(r319554)
@@ -3,7 +3,6 @@
 kern/kern_clocksource.cstandard
 
 arm/freescale/vybrid/vf_machdep.c  standard
-arm/freescale/vybrid/vf_common.c   standard
 arm/freescale/vybrid/vf_ccm.c  standard
 arm/freescale/vybrid/vf_anadig.c   standard
 arm/freescale/vybrid/vf_iomuxc.c   standard

Modified: head/sys/arm/freescale/vybrid/vf_machdep.c
==
--- head/sys/arm/freescale/vybrid/vf_machdep.c  Sat Jun  3 20:02:12 2017
(r319553)
+++ head/sys/arm/freescale/vybrid/vf_machdep.c  Sat Jun  3 20:14:46 2017
(r319554)
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  */
 
-#include "opt_ddb.h"
 #include "opt_platform.h"
 
 #include 
@@ -32,46 +31,56 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 
 #include 
 
-#include 
+#include 
+
 #include 
-#include 
+#include 
 #include  
+#include 
 
-vm_offset_t
-platform_lastaddr(void)
-{
+#include 
 
-   return (devmap_lastaddr());
-}
+#include "platform_if.h"
 
-void
-platform_probe_and_attach(void)
+static int
+vf_devmap_init(platform_t plat)
 {
 
+   devmap_add_entry(0x4000, 0x10);
+
+   return (0);
 }
 
-void
-platform_gpio_init(void)
+static void
+vf_cpu_reset(platform_t plat)
 {
+   phandle_t src;
+   uint32_t paddr;
+   bus_addr_t vaddr;
 
-}
+   if (src_swreset() == 0)
+   goto end;
 
-void
-platform_late_init(void)
-{
+   src = OF_finddevice("src");
+   if ((src != 0) && (OF_getencprop(src, "reg", &paddr, sizeof(paddr))) > 
0) {
+   if (bus_space_map(fdtbus_bs_tag, paddr, 0x10, 0, &vaddr) == 0) {
+   bus_space_write_4(fdtbus_bs_tag, vaddr, 0x00, SW_RST);
+   }
+   }
 
+end:
+   while (1);
 }
 
-int
-platform_devmap_init(void)
-{
+static platform_method_t vf_methods[] = {
+   PLATFORMMETHOD(platform_devmap_init,vf_devmap_init),
+   PLATFORMMETHOD(platform_cpu_reset,  vf_cpu_reset),
 
-   devmap_add_entry(0x4000, 0x10);
+   PLATFORMMETHOD_END,
+};
 
-   return (0);
-}
+FDT_PLATFORM_DEF(vf, "vybrid", 0, "freescale,vybrid", 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: r319553 - in head/sys/arm: conf samsung/exynos

2017-06-03 Thread Andrew Turner
Author: andrew
Date: Sat Jun  3 20:02:12 2017
New Revision: 319553
URL: https://svnweb.freebsd.org/changeset/base/319553

Log:
  Port the Samsung ARM code to use PLATFORM and PLATFORM_SMP. This will help
  move it into the GENERIC kernel config.

Added:
  head/sys/arm/samsung/exynos/exynos5_mp.h   (contents, props changed)
Deleted:
  head/sys/arm/samsung/exynos/exynos5_common.c
Modified:
  head/sys/arm/conf/EXYNOS5.common
  head/sys/arm/samsung/exynos/exynos5_machdep.c
  head/sys/arm/samsung/exynos/exynos5_mp.c
  head/sys/arm/samsung/exynos/files.exynos5

Modified: head/sys/arm/conf/EXYNOS5.common
==
--- head/sys/arm/conf/EXYNOS5.commonSat Jun  3 19:11:32 2017
(r319552)
+++ head/sys/arm/conf/EXYNOS5.commonSat Jun  3 20:02:12 2017
(r319553)
@@ -22,6 +22,8 @@ makeoptions   WERROR="-Werror"
 
 include"std.armv6"
 optionsSCHED_ULE   # ULE scheduler
+optionsPLATFORM# Platform based SoC
+optionsPLATFORM_SMP
 optionsPREEMPTION  # Enable kernel thread preemption
 optionsINET# InterNETworking
 optionsINET6   # IPv6 communications protocols

Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c
==
--- head/sys/arm/samsung/exynos/exynos5_machdep.c   Sat Jun  3 19:11:32 
2017(r319552)
+++ head/sys/arm/samsung/exynos/exynos5_machdep.c   Sat Jun  3 20:02:12 
2017(r319553)
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  */
 
-#include "opt_ddb.h"
 #include "opt_platform.h"
 
 #include 
@@ -37,40 +36,26 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include 
+
 #include 
 #include 
+#include 
 #include 
 #include  
+#include 
 
-vm_offset_t
-platform_lastaddr(void)
-{
+#include 
 
-   return (devmap_lastaddr());
-}
+#include "platform_if.h"
 
-void
-platform_probe_and_attach(void)
-{
+static platform_devmap_init_t exynos5_devmap_init;
+static platform_cpu_reset_t exynos5_cpu_reset;
 
-}
-
-void
-platform_gpio_init(void)
+static int
+exynos5_devmap_init(platform_t plat)
 {
 
-}
-
-void
-platform_late_init(void)
-{
-
-}
-
-int
-platform_devmap_init(void)
-{
-
/* CHIP ID */
devmap_add_entry(0x1000, 0x10);
 
@@ -82,3 +67,28 @@ platform_devmap_init(void)
 
return (0);
 }
+
+static void
+exynos5_cpu_reset(platform_t plat)
+{
+   bus_space_handle_t bsh;
+
+   bus_space_map(fdtbus_bs_tag, 0x10040400, 0x1000, 0, &bsh);
+   bus_space_write_4(fdtbus_bs_tag, bsh, 0, 1);
+
+   while (1);
+}
+
+static platform_method_t exynos5_methods[] = {
+   PLATFORMMETHOD(platform_devmap_init,exynos5_devmap_init),
+   PLATFORMMETHOD(platform_cpu_reset,  exynos5_cpu_reset),
+
+#ifdef SMP
+   PLATFORMMETHOD(platform_mp_start_ap,exynos5_mp_start_ap),
+   PLATFORMMETHOD(platform_mp_setmaxid,exynos5_mp_setmaxid),
+#endif
+
+   PLATFORMMETHOD_END,
+};
+
+FDT_PLATFORM_DEF(exynos5, "exynos5", 0, "samsung,exynos5", 0);

Modified: head/sys/arm/samsung/exynos/exynos5_mp.c
==
--- head/sys/arm/samsung/exynos/exynos5_mp.cSat Jun  3 19:11:32 2017
(r319552)
+++ head/sys/arm/samsung/exynos/exynos5_mp.cSat Jun  3 20:02:12 2017
(r319553)
@@ -40,7 +40,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
+#include 
+
 #defineEXYNOS_CHIPID   0x1000
 
 #defineEXYNOS5250_SOC_ID   0x4352
@@ -71,7 +74,7 @@ exynos_get_soc_id(void)
 }
 
 void
-platform_mp_setmaxid(void)
+exynos5_mp_setmaxid(platform_t plat)
 {
 
if (exynos_get_soc_id() == EXYNOS5420_SOC_ID)
@@ -83,7 +86,7 @@ platform_mp_setmaxid(void)
 }
 
 void
-platform_mp_start_ap(void)
+exynos5_mp_start_ap(platform_t plat)
 {
bus_addr_t sysram, pmu;
int err, i, j;

Added: head/sys/arm/samsung/exynos/exynos5_mp.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/samsung/exynos/exynos5_mp.hSat Jun  3 20:02:12 2017
(r319553)
@@ -0,0 +1,34 @@
+/*-
+ * Copyright (c) 2017 Andrew Turner 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INC

svn commit: r319552 - in head/sys/arm: conf xilinx

2017-06-03 Thread Andrew Turner
Author: andrew
Date: Sat Jun  3 19:11:32 2017
New Revision: 319552
URL: https://svnweb.freebsd.org/changeset/base/319552

Log:
  Port the Xilinx code to use PLATFORM and PLATFORM_SMP. This will help move
  it to be part of the armv6 GENERIC kernel.

Added:
  head/sys/arm/xilinx/zy7_mp.h   (contents, props changed)
Modified:
  head/sys/arm/conf/ZEDBOARD
  head/sys/arm/xilinx/zy7_machdep.c
  head/sys/arm/xilinx/zy7_mp.c

Modified: head/sys/arm/conf/ZEDBOARD
==
--- head/sys/arm/conf/ZEDBOARD  Sat Jun  3 18:29:18 2017(r319551)
+++ head/sys/arm/conf/ZEDBOARD  Sat Jun  3 19:11:32 2017(r319552)
@@ -27,6 +27,8 @@ include   "../xilinx/std.zynq7"
 makeoptionsMODULES_EXTRA="dtb/zynq"
 
 optionsSCHED_ULE   # ULE scheduler
+optionsPLATFORM# Platform based SoC
+optionsPLATFORM_SMP
 #options   NFSSD   # Network Filesystem Server
 optionsSMP # Enable multiple cores
 

Modified: head/sys/arm/xilinx/zy7_machdep.c
==
--- head/sys/arm/xilinx/zy7_machdep.c   Sat Jun  3 18:29:18 2017
(r319551)
+++ head/sys/arm/xilinx/zy7_machdep.c   Sat Jun  3 19:11:32 2017
(r319552)
@@ -33,6 +33,8 @@
  * (v1.4) November 16, 2012.  Xilinx doc UG585.
  */
 
+#include "opt_platform.h"
+
 #include 
 __FBSDID("$FreeBSD$");
 
@@ -47,41 +49,22 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include  
+#include 
 
+#include 
 #include 
 
+#include "platform_if.h"
+
 void (*zynq7_cpu_reset)(void);
 
-vm_offset_t
-platform_lastaddr(void)
-{
-
-   return (devmap_lastaddr());
-}
-
-void
-platform_probe_and_attach(void)
-{
-
-}
-
-void
-platform_gpio_init(void)
-{
-}
-
-void
-platform_late_init(void)
-{
-}
-
 /*
  * Set up static device mappings.  Not strictly necessary -- simplebus will
  * dynamically establish mappings as needed -- but doing it this way gets us
  * nice efficient 1MB section mappings.
  */
-int
-platform_devmap_init(void)
+static int
+zynq7_devmap_init(platform_t plat)
 {
 
devmap_add_entry(ZYNQ7_PSIO_HWBASE, ZYNQ7_PSIO_SIZE);
@@ -90,8 +73,8 @@ platform_devmap_init(void)
return (0);
 }
 
-void
-cpu_reset(void)
+static void
+zynq7_do_cpu_reset(platform_t plat)
 {
if (zynq7_cpu_reset != NULL)
(*zynq7_cpu_reset)();
@@ -100,3 +83,17 @@ cpu_reset(void)
for (;;)
;
 }
+
+static platform_method_t zynq7_methods[] = {
+   PLATFORMMETHOD(platform_devmap_init,zynq7_devmap_init),
+   PLATFORMMETHOD(platform_cpu_reset,  zynq7_do_cpu_reset),
+
+#ifdef SMP
+   PLATFORMMETHOD(platform_mp_setmaxid,zynq7_mp_setmaxid),
+   PLATFORMMETHOD(platform_mp_start_ap,zynq7_mp_start_ap),
+#endif
+
+   PLATFORMMETHOD_END,
+};
+
+FDT_PLATFORM_DEF(zynq7, "zynq7", 0, "xlnx,zynq-7000", 0);

Modified: head/sys/arm/xilinx/zy7_mp.c
==
--- head/sys/arm/xilinx/zy7_mp.cSat Jun  3 18:29:18 2017
(r319551)
+++ head/sys/arm/xilinx/zy7_mp.cSat Jun  3 19:11:32 2017
(r319552)
@@ -22,6 +22,8 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_platform.h"
+
 #include 
 __FBSDID("$FreeBSD$");
 #include 
@@ -38,7 +40,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
+#include 
 #include 
 
 #defineZYNQ7_CPU1_ENTRY0xfff0
@@ -47,7 +51,7 @@ __FBSDID("$FreeBSD$");
 #define   SCU_CONTROL_ENABLE   (1 << 0)
 
 void
-platform_mp_setmaxid(void)
+zynq7_mp_setmaxid(platform_t plat)
 {
 
mp_maxid = 1;
@@ -55,7 +59,7 @@ platform_mp_setmaxid(void)
 }
 
 void
-platform_mp_start_ap(void)
+zynq7_mp_start_ap(platform_t plat)
 {
bus_space_handle_t scu_handle;
bus_space_handle_t ocm_handle;

Added: head/sys/arm/xilinx/zy7_mp.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/xilinx/zy7_mp.hSat Jun  3 19:11:32 2017
(r319552)
@@ -0,0 +1,34 @@
+/*-
+ * Copyright (c) 2017 Andrew Turner 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 

Re: svn commit: r318441 - in head/etc: . cron.d

2017-06-03 Thread John Baldwin
On Friday, May 19, 2017 09:17:23 AM John Baldwin wrote:
> On Thursday, May 18, 2017 11:24:29 PM Baptiste Daroussin wrote:
> > On Thu, May 18, 2017 at 09:48:25AM -0700, John Baldwin wrote:
> > > On Thursday, May 18, 2017 03:09:32 PM Baptiste Daroussin wrote:
> > > > On Thu, May 18, 2017 at 02:56:31AM -0700, Rodney W. Grimes wrote:
> > > > > > Author: ngie
> > > > > > Date: Thu May 18 06:25:39 2017
> > > > > > New Revision: 318441
> > > > > > URL: https://svnweb.freebsd.org/changeset/base/318441
> > > > > > 
> > > > > > Log:
> > > > > >   Handle the cron.d entry for MK_AT in cron conditionally
> > > > > >   
> > > > > >   Install /etc/cron.d/at if MK_AT != no, always using it, which 
> > > > > > tries
> > > > > >   to run a non-existent program via cron(8) every 5 minutes with the
> > > > > >   default /etc/crontab, prior to this commit.
> > > > > >   
> > > > > >   SHELL and PATH are duplicated between /etc/crontab and 
> > > > > > /etc/cron.d/at
> > > > > >   because atrun(8) executes programs, which may rely on environment
> > > > > >   currently set via /etc/crontab.
> > > > > >   
> > > > > >   Noted by: bdrewery (in an internal review)
> > > > > >   MFC after:2 months
> > > > > >   Relnotes: yes (may need to add environmental modifications to
> > > > > >  /etc/cron.d/at)
> > > > > >   Sponsored by: Dell EMC Isilon
> > > > > > 
> > > > > > Added:
> > > > > >   head/etc/cron.d/
> > > > > >   head/etc/cron.d/Makefile   (contents, props changed)
> > > > > >   head/etc/cron.d/at   (contents, props changed)
> > > > > > Modified:
> > > > > >   head/etc/Makefile
> > > > > >   head/etc/crontab
> > > > > > 
> > > > > > Modified: head/etc/Makefile
> > > > > > ==
> > > > > > --- head/etc/Makefile   Thu May 18 06:15:42 2017
> > > > > > (r318440)
> > > > > > +++ head/etc/Makefile   Thu May 18 06:25:39 2017
> > > > > > (r318441)
> > > > > > @@ -8,6 +8,7 @@ FILESGROUPS=FILES
> > > > > >  # No need as it is empty and just causes rebuilds since this file 
> > > > > > does so much.
> > > > > >  UPDATE_DEPENDFILE= no
> > > > > >  SUBDIR=\
> > > > > > +   cron.d \
> > > > > > newsyslog.conf.d \
> > > > > > syslog.d
> > > > > 
> > > > > The thread on the newsyslog clearly shows that this is a 
> > > > > contriversial change.
> > > > > 
> > > > > I strongly object to further splitting of /etc/FOO into 
> > > > > /etc/foo.d/FOO files
> > > > > to suite Dell/EMC/Isilon's needs.  It is in conflict with the needs 
> > > > > and
> > > > > desires of others.
> > > > 
> > > > Has multiple people has stated, on the newsyslog thread. this is not a
> > > > DELL/EMC/Isilon need, this is also a requirement for plenty of use cases
> > > > 1. Consistency
> > > >   as a project we do support building WITHOUT_FOO there is no reason to 
> > > > install
> > > >   syslog, cron configuration for FOO if the system was built without foo
> > > 
> > > Though it doesn't _hurt_, and breaking POLA has to be worth it, not just
> > > because it looks nice.
> > > 
> > > > 2. Packaging base
> > > >   if one does not install at there is no need for the at crontab to be 
> > > > installed
> > > >   (same reason as 1.)
> > > 
> > > This is a viable reason except that it isn't fully baked yet.
> > > 
> > > > 3. Large deployment of freebsd farms
> > > >   Being able to administrate thousands of FreeBSD machines, one often 
> > > > ends up
> > > >   using tools like puppet, chef, ansible, cfengine. When 
> > > > programmatically
> > > >   handling configuration management it is way easier and safer to simple
> > > >   add/removes files in a directory rather than mangling^Winplace 
> > > > editing files.
> > > 
> > > There's nothing preventing you now from deploying split files and an empty
> > > global configuration file since the daemons support foo.d.  You don't 
> > > require
> > > that to change in upstream since you should be using some sort of VCS to
> > > manage your configuration as it is.
> > > 
> > > > 4. Ports/packages
> > > >   On can provide easily sample configuration for cron, syslog (not 
> > > > only) and the
> > > >   admin can decide to use it or not easily (ususally this is done by 
> > > > making
> > > >   symlinks from the said file which would live in share/* into the .d 
> > > > directory.
> > > > 
> > > > This is not a new trend in FreeBSD: newsyslog, rc.conf, libmap and more.
> > > 
> > > The support for broken out files has long been there, but the base system 
> > > has
> > > not used them previously for default config shipped during a release.  
> > > That
> > > is in fact a new trend.
> > > 
> > > However, the current approach seems to be the absolute worst way to do 
> > > this.
> > > If someone wants to use the existing base system image and modify it with
> > > config management, they now have to use a mix of styles (for some services
> > > edit a global config file for certain setti

Re: svn commit: r319551 - head/bin/dd/tests

2017-06-03 Thread Ngie Cooper (yaneurabeya)

> On Jun 3, 2017, at 11:29, Alan Somers  wrote:
> 
> Author: asomers
> Date: Sat Jun  3 18:29:18 2017
> New Revision: 319551
> URL: https://svnweb.freebsd.org/changeset/base/319551
> 
> Log:
>  Fix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS
> 
>  Split the postive and negative parts into separate test cases.  The positive
>  test case can only run on ZFS, because only ZFS supports files that large.
> 
>  PR:  219757
>  Reported by: ngie
>  MFC after:   18 days
>  X-MFC-with:  319339

Thanks :)!
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r319551 - head/bin/dd/tests

2017-06-03 Thread Alan Somers
Author: asomers
Date: Sat Jun  3 18:29:18 2017
New Revision: 319551
URL: https://svnweb.freebsd.org/changeset/base/319551

Log:
  Fix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS
  
  Split the postive and negative parts into separate test cases.  The positive
  test case can only run on ZFS, because only ZFS supports files that large.
  
  PR:   219757
  Reported by:  ngie
  MFC after:18 days
  X-MFC-with:   319339

Modified:
  head/bin/dd/tests/dd2_test.sh

Modified: head/bin/dd/tests/dd2_test.sh
==
--- head/bin/dd/tests/dd2_test.sh   Sat Jun  3 18:25:36 2017
(r319550)
+++ head/bin/dd/tests/dd2_test.sh   Sat Jun  3 18:29:18 2017
(r319551)
@@ -26,21 +26,35 @@
 # $FreeBSD$
 
 
-atf_test_case seek_overflow
-seek_overflow_head()
+atf_test_case max_seek
+max_seek_head()
 {
-   atf_set "descr" "dd(1) should reject too-large seek values"
+   atf_set "descr" "dd(1) can seek by the maximum amount"
 }
-seek_overflow_body()
+max_seek_body()
 {
-   atf_expect_fail "fails with 'dd: truncating f.out: File too large' - 
bug 219757"
+   case `df -T . | tail -n 1 | cut -wf 2` in
+   "ufs")
+   atf_skip "UFS's maximum file size is too small";;
+   "zfs") ;; # ZFS is fine
+   "tmpfs")
+   atf_skip "tmpfs can't create arbitrarily large spare 
files";;
+   *) atf_skip "Unknown file system";;
+   esac
 
touch f.in
-   # Positive tests
seek=`echo "2^63 / 4096 - 1" | bc`
atf_check -s exit:0 -e ignore dd if=f.in of=f.out bs=4096 seek=$seek
+}
 
-   # Negative tests
+atf_test_case seek_overflow
+seek_overflow_head()
+{
+   atf_set "descr" "dd(1) should reject too-large seek values"
+}
+seek_overflow_body()
+{
+   touch f.in
seek=`echo "2^63 / 4096" | bc`
atf_check -s not-exit:0 -e match:"seek offsets cannot be larger than" \
dd if=f.in of=f.out bs=4096 seek=$seek
@@ -50,5 +64,6 @@ seek_overflow_body()
 
 atf_init_test_cases()
 {
-atf_add_test_case seek_overflow
+   atf_add_test_case max_seek
+   atf_add_test_case seek_overflow
 }
___
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: r319550 - stable/10/usr.sbin/extattr/tests

2017-06-03 Thread Ngie Cooper
Author: ngie
Date: Sat Jun  3 18:25:36 2017
New Revision: 319550
URL: https://svnweb.freebsd.org/changeset/base/319550

Log:
  MFC r316503,r316504,r316505:
  
  r316503:
  
  Clean up trailing whitespace
  
  r316504:
  
  Clean up more trailing whitespace in the licensing tort that
  happened to be spaces, not tabs
  
  r316505:
  
  Don't assume NAME_MAX is 255
  
  Query the filesystem limit via getconf(3) instead

Modified:
  stable/10/usr.sbin/extattr/tests/extattr_test.sh
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/extattr/tests/extattr_test.sh
==
--- stable/10/usr.sbin/extattr/tests/extattr_test.shSat Jun  3 18:21:50 
2017(r319549)
+++ stable/10/usr.sbin/extattr/tests/extattr_test.shSat Jun  3 18:25:36 
2017(r319550)
@@ -10,7 +10,7 @@
 # 2. Redistributions in binary form must reproduce the above copyright
 #notice, this list of conditions and the following disclaimer in the
 #documentation and/or other materials provided with the distribution.
-#   
+#
 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -36,7 +36,7 @@ bad_namespace_body() {
setextattr badnamespace myattr X foo
atf_check -s not-exit:0 -e match:"Invalid argument" \
lsextattr -q badnamespace foo
-}  
+}
 
 atf_test_case hex
 hex_head() {
@@ -48,7 +48,7 @@ hex_body() {
atf_check -s exit:0 -o empty setextattr user myattr XYZ foo
atf_check -s exit:0 -o inline:"58 59 5a\n" \
getextattr -qx user myattr foo
-}  
+}
 
 atf_test_case hex_nonascii
 hex_nonascii_head() {
@@ -62,7 +62,7 @@ hex_nonascii_body() {
getextattr user myattr foo
atf_check -s exit:0 -o inline:"20 30 40 55 66 70 81 a2 b3 ee ff\n" \
getextattr -qx user myattr foo
-}  
+}
 
 atf_test_case long_name
 long_name_head() {
@@ -70,10 +70,15 @@ long_name_head() {
 }
 long_name_body() {
check_fs
+
+   if ! NAME_MAX=$(getconf NAME_MAX .); then
+   atf_skip "Filesystem not reporting NAME_MAX; skipping testcase"
+   fi
+
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208965
atf_expect_fail "BUG 208965 extattr(2) doesn't allow maxlen attr names"
 
-   ATTRNAME=`jot -b X -s "" 255 0`
+   ATTRNAME=`jot -b X -s "" $NAME_MAX 0`
touch foo
atf_check -s exit:0 -o empty setextattr user $ATTRNAME myvalue foo
atf_check -s exit:0 -o inline:"${ATTRNAME}\n" lsextattr -q user foo
@@ -81,7 +86,7 @@ long_name_body() {
getextattr -q user ${ATTRNAME} foo
atf_check -s exit:0 -o empty rmextattr user ${ATTRNAME} foo
atf_check -s exit:0 -o empty lsextattr -q user foo
-}  
+}
 
 atf_test_case loud
 loud_head() {
@@ -99,7 +104,7 @@ loud_body() {
printf "%s %s" $(getextattr user myattr foo)
atf_check -s exit:0 -o empty rmextattr user myattr foo
atf_check -s exit:0 -o inline:"foo" printf %s $(lsextattr user foo)
-}  
+}
 
 atf_test_case noattrs
 noattrs_head() {
@@ -109,7 +114,7 @@ noattrs_body() {
check_fs
touch foo
atf_check -s exit:0 -o empty lsextattr -q user foo
-}  
+}
 
 atf_test_case nonexistent_file
 nonexistent_file_head() {
@@ -125,7 +130,7 @@ nonexistent_file_body() {
getextattr user myattr foo
atf_check -s exit:1 -e match:"No such file or directory" \
rmextattr user myattr foo
-}  
+}
 
 atf_test_case null
 null_head() {
@@ -136,7 +141,7 @@ null_body() {
touch foo
atf_check -s exit:0 -o empty setextattr -n user myattr myvalue foo
atf_check -s exit:0 -o inline:"myvalue\0\n" getextattr -q user myattr 
foo
-}  
+}
 
 atf_test_case one_user_attr
 one_user_attr_head() {
@@ -150,7 +155,7 @@ one_user_attr_body() {
atf_check -s exit:0 -o inline:"myvalue\n" getextattr -q user myattr foo
atf_check -s exit:0 -o empty rmextattr user myattr foo
atf_check -s exit:0 -o empty lsextattr -q user foo
-}  
+}
 
 atf_test_case one_system_attr
 one_system_attr_head() {
@@ -165,7 +170,7 @@ one_system_attr_body() {
atf_check -s exit:0 -o inline:"myvalue\n" getextattr -q system myattr 
foo
atf_check -s exit:0 -o empty rmextattr system myattr foo
atf_check -s exit:0 -o empty lsextattr -q system foo
-}  
+}
 
 atf_test_case stdin
 stdin_head() {
@@ -179,7 +184,7 @@ stdin_body() {
atf_check -s exit:0 -o inline:"myattr\n" lsextattr -q user foo
getextattr -qq user myattr foo > outfile || atf_fail "getextattr failed"
atf_check -s exit:0 cmp -s infile outfile
-}  
+}
 
 atf_test_case stringify
 stringify_head() {
@@ -191,7 +196,7 @@ stringify_body() {
atf_check 

svn commit: r319548 - head/usr.sbin/newsyslog/tests

2017-06-03 Thread Ngie Cooper
Author: ngie
Date: Sat Jun  3 18:20:23 2017
New Revision: 319548
URL: https://svnweb.freebsd.org/changeset/base/319548

Log:
  Remove TODO for sub testcases added for bug 212160
  
  On closer inspection, the past failures no longer occur on ^/head.
  
  PR:   212160
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.sbin/newsyslog/tests/legacy_test.sh

Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh
==
--- head/usr.sbin/newsyslog/tests/legacy_test.shSat Jun  3 18:18:34 
2017(r319547)
+++ head/usr.sbin/newsyslog/tests/legacy_test.shSat Jun  3 18:20:23 
2017(r319548)
@@ -380,8 +380,6 @@ tests_time_rotate() {
 
sleep 1.1
 
-   TODO="rotate time 2-4 fail today; bug 212160"
-
begin "rotate time 2 ${name_postfix}"
run_newsyslog ${newsyslog_args}
ckfe ${LOGFNAME}
@@ -403,7 +401,6 @@ tests_time_rotate() {
ckfe ${LOGFNAME}
chkfcnt 3 ${dir}${LOGFNAME}.*${ext}
end
-   unset TODO
 
begin "noaction ${name_postfix}"
ofiles=`ls -1 ${dir}${LOGFNAME}.*${ext} | tr -d '\n'`
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r319546 - head/usr.sbin/newsyslog/tests

2017-06-03 Thread Ngie Cooper
Author: ngie
Date: Sat Jun  3 18:12:00 2017
New Revision: 319546
URL: https://svnweb.freebsd.org/changeset/base/319546

Log:
  Fix the testplan after ^/head@r318960
  
  The number of executed testcases is 128, not 126.
  
  MFC after:18 days
  MFC with: r318960
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.sbin/newsyslog/tests/legacy_test.sh

Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh
==
--- head/usr.sbin/newsyslog/tests/legacy_test.shSat Jun  3 18:10:04 
2017(r319545)
+++ head/usr.sbin/newsyslog/tests/legacy_test.shSat Jun  3 18:12:00 
2017(r319546)
@@ -454,7 +454,7 @@ tests_rfc5424() {
tmpdir_clean
 }
 
-echo 1..126
+echo 1..128
 mkdir -p ${TMPDIR}
 cd ${TMPDIR}
 
___
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: r319545 - head/usr.sbin/newsyslog/tests

2017-06-03 Thread Ngie Cooper
Author: ngie
Date: Sat Jun  3 18:10:04 2017
New Revision: 319545
URL: https://svnweb.freebsd.org/changeset/base/319545

Log:
  Don't execute the TODO cases in a subshell
  
  This messes up the testcase counter, as seen in bug 219756.
  
  PR:   212160, 219756
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.sbin/newsyslog/tests/legacy_test.sh

Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh
==
--- head/usr.sbin/newsyslog/tests/legacy_test.shSat Jun  3 17:59:10 
2017(r319544)
+++ head/usr.sbin/newsyslog/tests/legacy_test.shSat Jun  3 18:10:04 
2017(r319545)
@@ -380,7 +380,6 @@ tests_time_rotate() {
 
sleep 1.1
 
-   (
TODO="rotate time 2-4 fail today; bug 212160"
 
begin "rotate time 2 ${name_postfix}"
@@ -404,7 +403,7 @@ tests_time_rotate() {
ckfe ${LOGFNAME}
chkfcnt 3 ${dir}${LOGFNAME}.*${ext}
end
-   )
+   unset TODO
 
begin "noaction ${name_postfix}"
ofiles=`ls -1 ${dir}${LOGFNAME}.*${ext} | tr -d '\n'`
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r319544 - head/bin/dd/tests

2017-06-03 Thread Ngie Cooper
Author: ngie
Date: Sat Jun  3 17:59:10 2017
New Revision: 319544
URL: https://svnweb.freebsd.org/changeset/base/319544

Log:
  Mark :seek_overflow as an expected failure
  
  MFC after:18 days
  MFC with: r319339
  PR:   219757
  Sponsored by: Dell EMC Isilon

Modified:
  head/bin/dd/tests/dd2_test.sh

Modified: head/bin/dd/tests/dd2_test.sh
==
--- head/bin/dd/tests/dd2_test.sh   Sat Jun  3 17:56:31 2017
(r319543)
+++ head/bin/dd/tests/dd2_test.sh   Sat Jun  3 17:59:10 2017
(r319544)
@@ -33,6 +33,8 @@ seek_overflow_head()
 }
 seek_overflow_body()
 {
+   atf_expect_fail "fails with 'dd: truncating f.out: File too large' - 
bug 219757"
+
touch f.in
# Positive tests
seek=`echo "2^63 / 4096 - 1" | bc`
___
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: r319543 - head/bin/dd/tests

2017-06-03 Thread Ngie Cooper
Author: ngie
Date: Sat Jun  3 17:56:31 2017
New Revision: 319543
URL: https://svnweb.freebsd.org/changeset/base/319543

Log:
  Stylistic tweaks
  
  Move opening braces of functions from the last column to column 0.
  
  MFC after:18 days
  MFC with: r319339
  Sponsored by: Dell EMC Isilon

Modified:
  head/bin/dd/tests/dd2_test.sh

Modified: head/bin/dd/tests/dd2_test.sh
==
--- head/bin/dd/tests/dd2_test.sh   Sat Jun  3 17:24:13 2017
(r319542)
+++ head/bin/dd/tests/dd2_test.sh   Sat Jun  3 17:56:31 2017
(r319543)
@@ -27,10 +27,12 @@
 
 
 atf_test_case seek_overflow
-seek_overflow_head() {
+seek_overflow_head()
+{
atf_set "descr" "dd(1) should reject too-large seek values"
 }
-seek_overflow_body() {
+seek_overflow_body()
+{
touch f.in
# Positive tests
seek=`echo "2^63 / 4096 - 1" | bc`
___
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: r319542 - head/sys/amd64/amd64

2017-06-03 Thread Alan Cox
Author: alc
Date: Sat Jun  3 17:24:13 2017
New Revision: 319542
URL: https://svnweb.freebsd.org/changeset/base/319542

Log:
  Eliminate duplication of the pmap and pv list unlock operations in
  pmap_enter() by implementing a single return path.  Otherwise, the
  duplication will only increase with the upcoming support for psind == 1.
  
  Reviewed by:  kib (some time ago)

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

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Sat Jun  3 16:24:17 2017(r319541)
+++ head/sys/amd64/amd64/pmap.c Sat Jun  3 17:24:13 2017(r319542)
@@ -4313,6 +4313,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
pv_entry_t pv;
vm_paddr_t opa, pa;
vm_page_t mpte, om;
+   int rv;
boolean_t nosleep;
 
PG_A = pmap_accessed_bit(pmap);
@@ -4387,10 +4388,8 @@ retry:
mpte = _pmap_allocpte(pmap, pmap_pde_pindex(va),
nosleep ? NULL : &lock);
if (mpte == NULL && nosleep) {
-   if (lock != NULL)
-   rw_wunlock(lock);
-   PMAP_UNLOCK(pmap);
-   return (KERN_RESOURCE_SHORTAGE);
+   rv = KERN_RESOURCE_SHORTAGE;
+   goto out;
}
goto retry;
} else
@@ -4516,10 +4515,12 @@ unchanged:
vm_reserv_level_iffullpop(m) == 0)
pmap_promote_pde(pmap, pde, va, &lock);
 
+   rv = KERN_SUCCESS;
+out:
if (lock != NULL)
rw_wunlock(lock);
PMAP_UNLOCK(pmap);
-   return (KERN_SUCCESS);
+   return (rv);
 }
 
 /*
___
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: r319541 - in head/sys/arm: annapurna/alpine arm versatile

2017-06-03 Thread Andrew Turner
Author: andrew
Date: Sat Jun  3 16:24:17 2017
New Revision: 319541
URL: https://svnweb.freebsd.org/changeset/base/319541

Log:
  Stop making cpu_initclocks weak when using event timers. A weak symbol
  could be overridden in the SoC specific code, but this would break GENERIC
  as it is likely to be incorrect.
  
  Remove the versatile implementation of cpu_initclocks as it's unneeded.

Deleted:
  head/sys/arm/versatile/versatile_timer.c
Modified:
  head/sys/arm/annapurna/alpine/files.alpine
  head/sys/arm/arm/machdep.c
  head/sys/arm/versatile/files.versatile

Modified: head/sys/arm/annapurna/alpine/files.alpine
==
--- head/sys/arm/annapurna/alpine/files.alpine  Sat Jun  3 16:19:33 2017
(r319540)
+++ head/sys/arm/annapurna/alpine/files.alpine  Sat Jun  3 16:24:17 2017
(r319541)
@@ -3,7 +3,6 @@
 kern/kern_clocksource.cstandard
 
 arm/versatile/sp804.c  standard
-arm/versatile/versatile_timer.cstandard
 dev/uart/uart_dev_ns8250.c optionaluart
 
 arm/annapurna/alpine/common.c  standard

Modified: head/sys/arm/arm/machdep.c
==
--- head/sys/arm/arm/machdep.c  Sat Jun  3 16:19:33 2017(r319540)
+++ head/sys/arm/arm/machdep.c  Sat Jun  3 16:24:17 2017(r319541)
@@ -301,6 +301,7 @@ cpu_idle_wakeup(int cpu)
return (0);
 }
 
+#ifdef NO_EVENTTIMERS
 /*
  * Most ARM platforms don't need to do anything special to init their clocks
  * (they get intialized during normal device attachment), and by not defining a
@@ -311,8 +312,14 @@ cpu_idle_wakeup(int cpu)
 void
 arm_generic_initclocks(void)
 {
+}
+__weak_reference(arm_generic_initclocks, cpu_initclocks);
 
-#ifndef NO_EVENTTIMERS
+#else
+void
+cpu_initclocks(void)
+{
+
 #ifdef SMP
if (PCPU_GET(cpuid) == 0)
cpu_initclocks_bsp();
@@ -321,9 +328,8 @@ arm_generic_initclocks(void)
 #else
cpu_initclocks_bsp();
 #endif
-#endif
 }
-__weak_reference(arm_generic_initclocks, cpu_initclocks);
+#endif
 
 #ifdef MULTIDELAY
 void

Modified: head/sys/arm/versatile/files.versatile
==
--- head/sys/arm/versatile/files.versatile  Sat Jun  3 16:19:33 2017
(r319540)
+++ head/sys/arm/versatile/files.versatile  Sat Jun  3 16:24:17 2017
(r319541)
@@ -8,6 +8,5 @@ arm/versatile/versatile_common.cstandard
 arm/versatile/versatile_pci.c  optional pci
 arm/versatile/versatile_scm.c  standard
 arm/versatile/versatile_sic.c  standard
-arm/versatile/versatile_timer.cstandard
 
 kern/kern_clocksource.c standard
___
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: r319540 - head/sys/kern

2017-06-03 Thread Alan Cox
Author: alc
Date: Sat Jun  3 16:19:33 2017
New Revision: 319540
URL: https://svnweb.freebsd.org/changeset/base/319540

Log:
  The data type returned by vmoff() is too narrow in its range.  This could
  break the transmission of files longer than 4 GB on 32-bit architectures.
  
  Reviewed by:  glebius, kib
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D10019

Modified:
  head/sys/kern/kern_sendfile.c

Modified: head/sys/kern/kern_sendfile.c
==
--- head/sys/kern/kern_sendfile.c   Sat Jun  3 16:18:50 2017
(r319539)
+++ head/sys/kern/kern_sendfile.c   Sat Jun  3 16:19:33 2017
(r319540)
@@ -207,12 +207,12 @@ xfsize(int i, int n, off_t off, off_t len)
 /*
  * Helper function to get offset within object for i page.
  */
-static inline vm_offset_t
+static inline vm_ooffset_t
 vmoff(int i, off_t off)
 {
 
if (i == 0)
-   return ((vm_offset_t)off);
+   return ((vm_ooffset_t)off);
 
return (trunc_page(off + i * PAGE_SIZE));
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r319539 - head/sys/ufs/ffs

2017-06-03 Thread Konstantin Belousov
Author: kib
Date: Sat Jun  3 16:18:50 2017
New Revision: 319539
URL: https://svnweb.freebsd.org/changeset/base/319539

Log:
  Mitigate several problems with the softdep_request_cleanup() on busy
  host.
  
  Problems start appearing when there are several threads all doing
  operations on a UFS volume and the SU workqueue needs a cleanup.  It is
  possible that each thread calling softdep_request_cleanup() owns the
  lock for some dirty vnode (e.g. all of them are executing mkdir(2),
  mknod(2), creat(2) etc) and all vnodes which must be flushed are locked
  by corresponding thread. Then, we get all the threads simultaneously
  entering softdep_request_cleanup().
  
  There are two problems:
  - Several threads execute MNT_VNODE_FOREACH_ALL() loops in parallel.  Due
to the locking, they quickly start executing 'in phase' with the speed
of the slowest thread.
  - Since each thread already owns the lock for a dirty vnode, other threads
non-blocking attempt to lock the vnode owned by other thread fail,
and loops executing without making the progress.
  Retry logic does not allow the situation to recover.  The result is
  a livelock.
  
  Fix these problems by making the following changes:
  - Allow only one thread to enter MNT_VNODE_FOREACH_ALL() loop per mp.
A new flag FLUSH_RC_ACTIVE guards the loop.
  - If there were failed locking attempts during the loop, abort retry
even if there are still work items on the mp work list.  An
assumption is that the items will be cleaned when other thread
either fsyncs its vnode, or unlock and allow yet another thread to
make the progress.
  
  It is possible now that some calls would get undeserved ENOSPC from
  ffs_alloc(), because the cleanup is not aggressive enough. But I do
  not see how can we reliably clean up workitems if calling
  softdep_request_cleanup() while still owning the vnode lock. I thought
  about scheme where ffs_alloc() returns ERESTART and saves the retry
  counter somewhere in struct thread, to return to the top level, unlock
  the vnode and retry.  But IMO the very rare (and unproven) spurious
  ENOSPC is not worth the complications.
  
  Reported and tested by:   pho
  Style and comments by:mckusick
  Reviewed by:  mckusick
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ffs/softdep.h

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Sat Jun  3 15:56:54 2017
(r319538)
+++ head/sys/ufs/ffs/ffs_softdep.c  Sat Jun  3 16:18:50 2017
(r319539)
@@ -901,6 +901,7 @@ static  int pagedep_find(struct pagedep_hashhead *, ino
struct pagedep **);
 static void pause_timer(void *);
 static int request_cleanup(struct mount *, int);
+static int softdep_request_cleanup_flush(struct mount *, struct ufsmount *);
 static void schedule_cleanup(struct mount *);
 static void softdep_ast_cleanup_proc(struct thread *);
 static int process_worklist_item(struct mount *, int, int);
@@ -13274,10 +13275,9 @@ softdep_request_cleanup(fs, vp, cred, resource)
 {
struct ufsmount *ump;
struct mount *mp;
-   struct vnode *lvp, *mvp;
long starttime;
ufs2_daddr_t needed;
-   int error;
+   int error, failed_vnode;
 
/*
 * If we are being called because of a process doing a
@@ -13368,41 +13368,88 @@ retry:
 * to the worklist that we can then process to reap addition
 * resources. We walk the vnodes associated with the mount point
 * until we get the needed worklist requests that we can reap.
+*
+* If there are several threads all needing to clean the same
+* mount point, only one is allowed to walk the mount list.
+* When several threads all try to walk the same mount list,
+* they end up competing with each other and often end up in
+* livelock. This approach ensures that forward progress is
+* made at the cost of occational ENOSPC errors being returned
+* that might otherwise have been avoided.
 */
+   error = 1;
if ((resource == FLUSH_BLOCKS_WAIT && 
 fs->fs_cstotal.cs_nbfree <= needed) ||
(resource == FLUSH_INODES_WAIT && fs->fs_pendinginodes > 0 &&
 fs->fs_cstotal.cs_nifree <= needed)) {
-   MNT_VNODE_FOREACH_ALL(lvp, mp, mvp) {
-   if (TAILQ_FIRST(&lvp->v_bufobj.bo_dirty.bv_hd) == 0) {
-   VI_UNLOCK(lvp);
-   continue;
+   ACQUIRE_LOCK(ump);
+   if ((ump->um_softdep->sd_flags & FLUSH_RC_ACTIVE) == 0) {
+   ump->um_softdep->sd_flags |= FLUSH_RC_ACTIVE;
+   FREE_LOCK(ump);
+   failed_vnode = softdep_request_cleanup_flush(mp, ump);
+   

svn commit: r319538 - head/sys/arm/arm

2017-06-03 Thread Andrew Turner
Author: andrew
Date: Sat Jun  3 15:56:54 2017
New Revision: 319538
URL: https://svnweb.freebsd.org/changeset/base/319538

Log:
  Add MULTIDELAY support to the mpcore timer driver. This is needed when
  using this with GENERIC.
  
  While here remove the weak symbol, it doesn't seem to be needed anymore.

Modified:
  head/sys/arm/arm/mpcore_timer.c

Modified: head/sys/arm/arm/mpcore_timer.c
==
--- head/sys/arm/arm/mpcore_timer.c Sat Jun  3 15:48:03 2017
(r319537)
+++ head/sys/arm/arm/mpcore_timer.c Sat Jun  3 15:56:54 2017
(r319538)
@@ -59,6 +59,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef MULTIDELAY
+#include  /* For arm_set_delay */
+#endif
+
 #include 
 #include 
 #include 
@@ -115,6 +119,8 @@ static boolean_t arm_tmr_freq_varies;
 #definetmr_gbl_read_4(sc, reg) bus_read_4((sc)->gbl_mem, reg)
 #definetmr_gbl_write_4(sc, reg, val)   bus_write_4((sc)->gbl_mem, reg, 
val)
 
+static void arm_tmr_delay(int, void *);
+
 static timecounter_get_t arm_tmr_get_timecount;
 
 static struct timecounter arm_tmr_timecount = {
@@ -431,6 +437,11 @@ arm_tmr_attach(device_t dev)
if (tc_err != 0 && et_err != 0) {
return (ENXIO);
}
+
+#ifdef MULTIDELAY
+   arm_set_delay(arm_tmr_delay, sc);
+#endif
+
return (0);
 }
 
@@ -482,37 +493,14 @@ arm_tmr_change_frequency(uint64_t newfreq)
et_change_frequency(arm_tmr_et, newfreq);
 }
 
-/**
- * DELAY - Delay for at least usec microseconds.
- * @usec: number of microseconds to delay by
- *
- * This function is called all over the kernel and is suppose to provide a
- * consistent delay.  This function may also be called before the console
- * is setup so no printf's can be called here.
- *
- * RETURNS:
- * nothing
- */
-static void __used /* Must emit function code for the weak ref below. */
-arm_tmr_DELAY(int usec)
+static void
+arm_tmr_delay(int usec, void *arg)
 {
-   struct arm_tmr_softc *sc;
+   struct arm_tmr_softc *sc = arg;
int32_t counts_per_usec;
int32_t counts;
uint32_t first, last;
 
-   /* Check the timers are setup, if not just use a for loop for the 
meantime */
-   if (arm_tmr_tc == NULL || arm_tmr_timecount.tc_frequency == 0) {
-   for (; usec > 0; usec--)
-   for (counts = 200; counts > 0; counts--)
-   cpufunc_nullop();   /* Prevent gcc from 
optimizing
-* out the loop
-*/
-   return;
-   }
-
-   sc = arm_tmr_tc->tc_priv;
-
/* Get the number of times to count */
counts_per_usec = ((arm_tmr_timecount.tc_frequency / 100) + 1);
 
@@ -536,10 +524,34 @@ arm_tmr_DELAY(int usec)
}
 }
 
-/*
- * Supply a DELAY() implementation via weak linkage.  A platform may want to 
use
- * the mpcore per-cpu eventtimers but provide its own DELAY() routine,
- * especially when the core frequency can change on the fly.
+#ifndef MULTIDELAY
+/**
+ * DELAY - Delay for at least usec microseconds.
+ * @usec: number of microseconds to delay by
+ *
+ * This function is called all over the kernel and is suppose to provide a
+ * consistent delay.  This function may also be called before the console
+ * is setup so no printf's can be called here.
+ *
+ * RETURNS:
+ * nothing
  */
-__weak_reference(arm_tmr_DELAY, DELAY);
+void
+DELAY(int usec)
+{
+   struct arm_tmr_softc *sc;
+   int32_t counts;
 
+   /* Check the timers are setup, if not just use a for loop for the 
meantime */
+   if (arm_tmr_tc == NULL || arm_tmr_timecount.tc_frequency == 0) {
+   for (; usec > 0; usec--)
+   for (counts = 200; counts > 0; counts--)
+   cpufunc_nullop();   /* Prevent gcc from 
optimizing
+* out the loop
+*/
+   } else {
+   sc = arm_tmr_tc->tc_priv;
+   arm_tmr_delay(usec, sc);
+   }
+}
+#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: r319537 - head/sys/arm/versatile

2017-06-03 Thread Andrew Turner
Author: andrew
Date: Sat Jun  3 15:48:03 2017
New Revision: 319537
URL: https://svnweb.freebsd.org/changeset/base/319537

Log:
  Add MULTIDELAY support to the sp804 driver.

Modified:
  head/sys/arm/versatile/sp804.c

Modified: head/sys/arm/versatile/sp804.c
==
--- head/sys/arm/versatile/sp804.c  Sat Jun  3 15:40:34 2017
(r319536)
+++ head/sys/arm/versatile/sp804.c  Sat Jun  3 15:48:03 2017
(r319537)
@@ -42,6 +42,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef MULTIDELAY
+#include  /* For arm_set_delay */
+#endif
+
 #include 
 #include 
 #include 
@@ -109,6 +113,7 @@ struct sp804_timer_softc {
bus_space_write_4(sc->bst, sc->bsh, reg, val)
 
 static unsigned sp804_timer_tc_get_timecount(struct timecounter *);
+static void sp804_timer_delay(int, void *);
 
 static unsigned
 sp804_timer_tc_get_timecount(struct timecounter *tc)
@@ -287,6 +292,10 @@ sp804_timer_attach(device_t dev)
 (sp804_timer_tc_read_4(SP804_PRIMECELL_ID0 + i*4) & 0xff);
}
 
+#ifdef MULTIDELAY
+   arm_set_delay(sp804_timer_delay, sc);
+#endif
+
device_printf(dev, "PrimeCell ID: %08x\n", id);
 
sc->timer_initialized = 1;
@@ -310,11 +319,36 @@ static devclass_t sp804_timer_devclass;
 
 DRIVER_MODULE(sp804_timer, simplebus, sp804_timer_driver, 
sp804_timer_devclass, 0, 0);
 
+static void
+sp804_timer_delay(int usec, void *arg)
+{
+   struct sp804_timer_softc *sc = arg;
+   int32_t counts;
+   uint32_t first, last;
+
+   /* Get the number of times to count */
+   counts = usec * ((sc->tc.tc_frequency / 100) + 1);
+
+   first = sp804_timer_tc_get_timecount(&sc->tc);
+
+   while (counts > 0) {
+   last = sp804_timer_tc_get_timecount(&sc->tc);
+   if (last == first)
+   continue;
+   if (last > first) {
+   counts -= (int32_t)(last - first);
+   } else {
+   counts -= (int32_t)((0x - first) + last);
+   }
+   first = last;
+   }
+}
+
+#ifndef MULTIDELAY
 void
 DELAY(int usec)
 {
int32_t counts;
-   uint32_t first, last;
device_t timer_dev;
struct sp804_timer_softc *sc;
int timer_initialized = 0;
@@ -336,23 +370,8 @@ DELAY(int usec)
for (counts = 200; counts > 0; counts--)
/* Prevent gcc from optimizing  out the loop */
cpufunc_nullop();
-   return;
+   } else {
+   sp804_timer_delay(usec, sc);
}
-
-   /* Get the number of times to count */
-   counts = usec * ((sc->tc.tc_frequency / 100) + 1);
-
-   first = sp804_timer_tc_get_timecount(&sc->tc);
-
-   while (counts > 0) {
-   last = sp804_timer_tc_get_timecount(&sc->tc);
-   if (last == first)
-   continue;
-   if (last>first) {
-   counts -= (int32_t)(last - first);
-   } else {
-   counts -= (int32_t)((0x - first) + last);
-   }
-   first = last;
-   }
 }
+#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: r319536 - head/sys/arm/conf

2017-06-03 Thread Andrew Turner
Author: andrew
Date: Sat Jun  3 15:40:34 2017
New Revision: 319536
URL: https://svnweb.freebsd.org/changeset/base/319536

Log:
  Add MULTIDELAY to the Beaglebone kenrel config to help moving it to GENERIC.

Modified:
  head/sys/arm/conf/BEAGLEBONE

Modified: head/sys/arm/conf/BEAGLEBONE
==
--- head/sys/arm/conf/BEAGLEBONESat Jun  3 15:39:23 2017
(r319535)
+++ head/sys/arm/conf/BEAGLEBONESat Jun  3 15:40:34 2017
(r319536)
@@ -29,6 +29,7 @@ include   "../ti/am335x/std.am335x"
 makeoptionsMODULES_EXTRA="dtb/am335x am335x_dmtpps"
 
 optionsINTRNG
+optionsMULTIDELAY
 
 optionsSCHED_4BSD  # 4BSD scheduler
 optionsPLATFORM
___
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: r319535 - in head/sys/arm: conf freescale/imx

2017-06-03 Thread Andrew Turner
Author: andrew
Date: Sat Jun  3 15:39:23 2017
New Revision: 319535
URL: https://svnweb.freebsd.org/changeset/base/319535

Log:
  Enable MULTIDELAY in the i.MX5 kernel configs. This will help adding them
  to GENERIC.

Modified:
  head/sys/arm/conf/EFIKA_MX
  head/sys/arm/conf/IMX53
  head/sys/arm/freescale/imx/imx51_machdep.c
  head/sys/arm/freescale/imx/imx53_machdep.c

Modified: head/sys/arm/conf/EFIKA_MX
==
--- head/sys/arm/conf/EFIKA_MX  Sat Jun  3 15:21:33 2017(r319534)
+++ head/sys/arm/conf/EFIKA_MX  Sat Jun  3 15:39:23 2017(r319535)
@@ -31,6 +31,7 @@ options   SCHED_4BSD  # 4BSD scheduler
 #options   MD_ROOT # MD is a potential root device
 #options   NFSD# Network Filesystem Server
 optionsPLATFORM
+optionsMULTIDELAY
 optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 
 # NFS root from boopt/dhcp

Modified: head/sys/arm/conf/IMX53
==
--- head/sys/arm/conf/IMX53 Sat Jun  3 15:21:33 2017(r319534)
+++ head/sys/arm/conf/IMX53 Sat Jun  3 15:39:23 2017(r319535)
@@ -28,6 +28,7 @@ options   SOC_IMX53
 optionsSCHED_4BSD  # 4BSD scheduler
 #options   NFSD# Network Filesystem Server
 optionsPLATFORM
+optionsMULTIDELAY
 optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 
 # kernel/memory size reduction

Modified: head/sys/arm/freescale/imx/imx51_machdep.c
==
--- head/sys/arm/freescale/imx/imx51_machdep.c  Sat Jun  3 15:21:33 2017
(r319534)
+++ head/sys/arm/freescale/imx/imx51_machdep.c  Sat Jun  3 15:39:23 2017
(r319535)
@@ -99,4 +99,4 @@ static platform_method_t imx51_methods[] = {
PLATFORMMETHOD_END,
 };
 
-FDT_PLATFORM_DEF(imx51, "i.MX51", 0, "fsl,imx51", 0);
+FDT_PLATFORM_DEF(imx51, "i.MX51", 0, "fsl,imx51", 100);

Modified: head/sys/arm/freescale/imx/imx53_machdep.c
==
--- head/sys/arm/freescale/imx/imx53_machdep.c  Sat Jun  3 15:21:33 2017
(r319534)
+++ head/sys/arm/freescale/imx/imx53_machdep.c  Sat Jun  3 15:39:23 2017
(r319535)
@@ -95,5 +95,4 @@ static platform_method_t imx53_methods[] = {
PLATFORMMETHOD_END,
 };
 
-FDT_PLATFORM_DEF(imx53, "i.MX53", 0, "fsl,imx53", 0);
-
+FDT_PLATFORM_DEF(imx53, "i.MX53", 0, "fsl,imx53", 100);
___
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: r319534 - vendor/lldb/lldb-trunk-r304659

2017-06-03 Thread Dimitry Andric
Author: dim
Date: Sat Jun  3 15:21:33 2017
New Revision: 319534
URL: https://svnweb.freebsd.org/changeset/base/319534

Log:
  Tag lldb trunk r304659.

Added:
  vendor/lldb/lldb-trunk-r304659/
 - copied from r319533, vendor/lldb/dist/
___
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: r319533 - in vendor/lldb/dist: cmake/modules include/lldb/Host include/lldb/Host/linux packages/Python/lldbsuite/test/lang/objc/objc-new-syntax source/Host/linux source/Plugins/Platform...

2017-06-03 Thread Dimitry Andric
Author: dim
Date: Sat Jun  3 15:21:27 2017
New Revision: 319533
URL: https://svnweb.freebsd.org/changeset/base/319533

Log:
  Vendor import of lldb trunk r304659:
  https://llvm.org/svn/llvm-project/lldb/trunk@304659

Modified:
  vendor/lldb/dist/cmake/modules/LLDBConfig.cmake
  vendor/lldb/dist/cmake/modules/LLDBGenerateConfig.cmake
  vendor/lldb/dist/include/lldb/Host/Config.h.cmake
  vendor/lldb/dist/include/lldb/Host/linux/Uio.h
  
vendor/lldb/dist/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
  vendor/lldb/dist/source/Host/linux/LibcGlue.cpp
  vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
  vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.h
  vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
  vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
  vendor/lldb/dist/source/Symbol/ClangASTContext.cpp
  vendor/lldb/dist/unittests/CMakeLists.txt

Modified: vendor/lldb/dist/cmake/modules/LLDBConfig.cmake
==
--- vendor/lldb/dist/cmake/modules/LLDBConfig.cmake Sat Jun  3 15:21:24 
2017(r319532)
+++ vendor/lldb/dist/cmake/modules/LLDBConfig.cmake Sat Jun  3 15:21:27 
2017(r319533)
@@ -334,28 +334,6 @@ if (HAVE_LIBDL)
   list(APPEND system_libs ${CMAKE_DL_LIBS})
 endif()
 
-# Check for syscall used by lldb-server on linux.
-# If these are not found, it will fall back to ptrace (slow) for memory reads.
-check_cxx_source_compiles("
-  #include 
-  int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }"
-  HAVE_PROCESS_VM_READV)
-
-if (HAVE_PROCESS_VM_READV)
-  add_definitions(-DHAVE_PROCESS_VM_READV)
-else()
-  # If we don't have the syscall wrapper function, but we know the syscall 
number, we can
-  # still issue the syscall manually
-  check_cxx_source_compiles("
-  #include 
-  int main() { return __NR_process_vm_readv; }"
-  HAVE_NR_PROCESS_VM_READV)
-
-  if (HAVE_NR_PROCESS_VM_READV)
-  add_definitions(-DHAVE_NR_PROCESS_VM_READV)
-  endif()
-endif()
-
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
 if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")

Modified: vendor/lldb/dist/cmake/modules/LLDBGenerateConfig.cmake
==
--- vendor/lldb/dist/cmake/modules/LLDBGenerateConfig.cmake Sat Jun  3 
15:21:24 2017(r319532)
+++ vendor/lldb/dist/cmake/modules/LLDBGenerateConfig.cmake Sat Jun  3 
15:21:27 2017(r319533)
@@ -12,6 +12,15 @@ check_symbol_exists(sigaction signal.h HAVE_SIGACTION)
 check_include_file(termios.h HAVE_TERMIOS_H)
 check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H)
 
+check_cxx_source_compiles("
+  #include 
+  int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }"
+  HAVE_PROCESS_VM_READV)
+check_cxx_source_compiles("
+#include 
+int main() { return __NR_process_vm_readv; }"
+HAVE_NR_PROCESS_VM_READV)
+
 # These checks exist in LLVM's configuration, so I want to match the LLVM names
 # so that the check isn't duplicated, but we translate them into the LLDB names
 # so that I don't have to change all the uses at the moment.

Modified: vendor/lldb/dist/include/lldb/Host/Config.h.cmake
==
--- vendor/lldb/dist/include/lldb/Host/Config.h.cmake   Sat Jun  3 15:21:24 
2017(r319532)
+++ vendor/lldb/dist/include/lldb/Host/Config.h.cmake   Sat Jun  3 15:21:27 
2017(r319533)
@@ -20,4 +20,8 @@
 
 #cmakedefine01 HAVE_SIGACTION
 
+#cmakedefine01 HAVE_PROCESS_VM_READV
+
+#cmakedefine01 HAVE_NR_PROCESS_VM_READV
+
 #endif // #ifndef LLDB_HOST_CONFIG_H

Modified: vendor/lldb/dist/include/lldb/Host/linux/Uio.h
==
--- vendor/lldb/dist/include/lldb/Host/linux/Uio.h  Sat Jun  3 15:21:24 
2017(r319532)
+++ vendor/lldb/dist/include/lldb/Host/linux/Uio.h  Sat Jun  3 15:21:27 
2017(r319533)
@@ -10,11 +10,12 @@
 #ifndef liblldb_Host_linux_Uio_h_
 #define liblldb_Host_linux_Uio_h_
 
+#include "lldb/Host/Config.h"
 #include 
 
 // We shall provide our own implementation of process_vm_readv if it is not
 // present
-#ifndef HAVE_PROCESS_VM_READV
+#if !HAVE_PROCESS_VM_READV
 ssize_t process_vm_readv(::pid_t pid, const struct iovec *local_iov,
  unsigned long liovcnt, const struct iovec *remote_iov,
  unsigned long riovcnt, unsigned long flags);

Modified: 
vendor/lldb/dist/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
==
--- 
vendor/lldb/dist/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCN

svn commit: r319527 - in vendor/compiler-rt/dist: include/sanitizer lib/asan lib/lsan lib/sanitizer_common lib/sanitizer_common/scripts lib/sanitizer_common/tests lib/ubsan test/asan/TestCases/Andr...

2017-06-03 Thread Dimitry Andric
Author: dim
Date: Sat Jun  3 15:21:00 2017
New Revision: 319527
URL: https://svnweb.freebsd.org/changeset/base/319527

Log:
  Vendor import of compiler-rt trunk r304659:
  https://llvm.org/svn/llvm-project/compiler-rt/trunk@304659

Added:
  
vendor/compiler-rt/dist/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc
   (contents, props changed)
  vendor/compiler-rt/dist/test/ubsan/TestCases/Pointer/
  vendor/compiler-rt/dist/test/ubsan/TestCases/Pointer/index-overflow.cpp   
(contents, props changed)
Deleted:
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
  
vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_mapping_libcdep.cc
  vendor/compiler-rt/dist/test/asan/TestCases/Android/coverage-android.cc
  vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-maybe-open-file.cc
Modified:
  vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h
  vendor/compiler-rt/dist/lib/asan/asan_activation.cc
  vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc
  vendor/compiler-rt/dist/lib/asan/asan_thread.cc
  vendor/compiler-rt/dist/lib/lsan/lsan_common.cc
  vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_interface.inc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix_libcdep.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/scripts/check_lint.sh
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_flags_test.cc
  vendor/compiler-rt/dist/lib/ubsan/ubsan_checks.inc
  vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc
  vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.h
  vendor/compiler-rt/dist/lib/ubsan/ubsan_interface.inc
  vendor/compiler-rt/dist/test/asan/TestCases/Linux/uar_signals.cc

Modified: vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h
==
--- vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h  Sat Jun 
 3 15:20:57 2017(r319526)
+++ vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h  Sat Jun 
 3 15:21:00 2017(r319527)
@@ -19,8 +19,6 @@
 extern "C" {
 #endif
 
-  // Initialize coverage.
-  void __sanitizer_cov_init();
   // Record and dump coverage info.
   void __sanitizer_cov_dump();
 
@@ -28,10 +26,6 @@ extern "C" {
   //  .sancov files.
   void __sanitizer_dump_coverage(const uintptr_t *pcs, uintptr_t len);
 
-  // Open .sancov.packed in the coverage directory and return the file
-  // descriptor. Returns -1 on failure, or if coverage dumping is disabled.
-  // This is intended for use by sandboxing code.
-  intptr_t __sanitizer_maybe_open_cov_file(const char *name);
 #ifdef __cplusplus
 }  // extern "C"
 #endif

Modified: vendor/compiler-rt/dist/lib/asan/asan_activation.cc
==
--- vendor/compiler-rt/dist/lib/asan/asan_activation.cc Sat Jun  3 15:20:57 
2017(r319526)
+++ vendor/compiler-rt/dist/lib/asan/asan_activation.cc Sat Jun  3 15:21:00 
2017(r319527)
@@ -106,7 +106,6 @@ void AsanDeactivate() {
   // Deactivate the runtime.
   SetCanPoisonMemory(false);
   SetMallocContextSize(1);
-  ReInitializeCoverage(false, nullptr);
 
   AllocatorOptions disabled = asan_deactivated_flags.allocator_options;
   disabled.quarantine_size_mb = 0;
@@ -130,8 +129,6 @@ void AsanActivate() {
 
   SetCanPoisonMemory(asan_deactivated_flags.poison_heap);
   SetMallocContextSize(asan_deactivated_flags.malloc_context_size);
-  ReInitializeCoverage(asan_deactivated_flags.coverage,
-   asan_deactivated_flags.coverage_dir);
   ReInitializeAllocator(asan_deactivated_flags.allocator_options);
 
   asan_is_deactivated = false;

Modified: vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc
==
--- vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc   Sat Jun  3 
15:20:57 2017(r319526)
+++ vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc   Sat Jun  3 
15:21:00 2017(r319527)
@@ -242,9 +242,8 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free, void *)
 CheckNoDeepBind(filename, flag);   
\
   } while (false)
 #define COMMON_INTERCEPTOR_ON_EXIT(ctx) OnExit()
-#define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle) \
-  CoverageUpdat

svn commit: r319525 - in vendor/clang/dist: docs include/clang/Basic include/clang/Driver include/clang/Frontend include/clang/Lex lib/ARCMigrate lib/AST lib/Analysis lib/Basic lib/CodeGen lib/Driv...

2017-06-03 Thread Dimitry Andric
Author: dim
Date: Sat Jun  3 15:20:48 2017
New Revision: 319525
URL: https://svnweb.freebsd.org/changeset/base/319525

Log:
  Vendor import of clang trunk r304659:
  https://llvm.org/svn/llvm-project/cfe/trunk@304659

Added:
  vendor/clang/dist/test/CodeGen/pr26099.c   (contents, props changed)
  vendor/clang/dist/test/CodeGenCXX/pr33080.cpp   (contents, props changed)
  vendor/clang/dist/test/CodeGenCXX/unaligned-member-qualifier.cpp   (contents, 
props changed)
  vendor/clang/dist/test/Frontend/rewrite-includes-filenotfound.c   (contents, 
props changed)
  vendor/clang/dist/test/Modules/Inputs/check-for-sanitizer-feature/
  vendor/clang/dist/test/Modules/Inputs/check-for-sanitizer-feature/check.h   
(contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/check-for-sanitizer-feature/map
  vendor/clang/dist/test/Modules/Inputs/header-attribs/
  vendor/clang/dist/test/Modules/Inputs/header-attribs/bar.h   (contents, props 
changed)
  vendor/clang/dist/test/Modules/Inputs/header-attribs/baz.h   (contents, props 
changed)
  vendor/clang/dist/test/Modules/Inputs/header-attribs/foo.h   (contents, props 
changed)
  vendor/clang/dist/test/Modules/Inputs/header-attribs/modular.modulemap
  vendor/clang/dist/test/Modules/Inputs/header-attribs/textual.modulemap
  vendor/clang/dist/test/Modules/check-for-sanitizer-feature.cpp   (contents, 
props changed)
  vendor/clang/dist/test/Modules/header-attribs.cpp   (contents, props changed)
  vendor/clang/dist/test/Modules/preprocess-missing.modulemap
Deleted:
  vendor/clang/dist/test/CodeGenCXX/unaligned-duplicated-mangle-name.cpp
Modified:
  vendor/clang/dist/docs/Modules.rst
  vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td
  vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
  vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td
  vendor/clang/dist/include/clang/Basic/Module.h
  vendor/clang/dist/include/clang/Basic/Sanitizers.h
  vendor/clang/dist/include/clang/Driver/CC1Options.td
  vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def
  vendor/clang/dist/include/clang/Lex/ModuleMap.h
  vendor/clang/dist/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
  vendor/clang/dist/lib/ARCMigrate/TransformActions.cpp
  vendor/clang/dist/lib/AST/ASTContext.cpp
  vendor/clang/dist/lib/AST/ASTDiagnostic.cpp
  vendor/clang/dist/lib/AST/ASTStructuralEquivalence.cpp
  vendor/clang/dist/lib/AST/DeclPrinter.cpp
  vendor/clang/dist/lib/AST/Expr.cpp
  vendor/clang/dist/lib/AST/ExprConstant.cpp
  vendor/clang/dist/lib/AST/ItaniumMangle.cpp
  vendor/clang/dist/lib/AST/NestedNameSpecifier.cpp
  vendor/clang/dist/lib/Analysis/PrintfFormatString.cpp
  vendor/clang/dist/lib/Analysis/PseudoConstantAnalysis.cpp
  vendor/clang/dist/lib/Analysis/ScanfFormatString.cpp
  vendor/clang/dist/lib/Basic/IdentifierTable.cpp
  vendor/clang/dist/lib/Basic/LangOptions.cpp
  vendor/clang/dist/lib/Basic/Module.cpp
  vendor/clang/dist/lib/Basic/TargetInfo.cpp
  vendor/clang/dist/lib/CodeGen/BackendUtil.cpp
  vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp
  vendor/clang/dist/lib/CodeGen/CGCall.cpp
  vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp
  vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp
  vendor/clang/dist/lib/CodeGen/CGDebugInfo.h
  vendor/clang/dist/lib/CodeGen/CGExpr.cpp
  vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp
  vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp
  vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp
  vendor/clang/dist/lib/Driver/SanitizerArgs.cpp
  vendor/clang/dist/lib/Edit/RewriteObjCFoundationAPI.cpp
  vendor/clang/dist/lib/Frontend/CompilerInstance.cpp
  vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp
  vendor/clang/dist/lib/Frontend/FrontendAction.cpp
  vendor/clang/dist/lib/Frontend/FrontendActions.cpp
  vendor/clang/dist/lib/Frontend/InitHeaderSearch.cpp
  vendor/clang/dist/lib/Frontend/Rewrite/FrontendActions.cpp
  vendor/clang/dist/lib/Frontend/Rewrite/InclusionRewriter.cpp
  vendor/clang/dist/lib/Frontend/SerializedDiagnosticReader.cpp
  vendor/clang/dist/lib/Lex/HeaderSearch.cpp
  vendor/clang/dist/lib/Lex/Lexer.cpp
  vendor/clang/dist/lib/Lex/LiteralSupport.cpp
  vendor/clang/dist/lib/Lex/ModuleMap.cpp
  vendor/clang/dist/lib/Lex/PPDirectives.cpp
  vendor/clang/dist/lib/Parse/ParseDecl.cpp
  vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp
  vendor/clang/dist/lib/Parse/ParseExpr.cpp
  vendor/clang/dist/lib/Parse/ParseInit.cpp
  vendor/clang/dist/lib/Parse/ParseOpenMP.cpp
  vendor/clang/dist/lib/Parse/ParseStmt.cpp
  vendor/clang/dist/lib/Parse/ParseTentative.cpp
  vendor/clang/dist/lib/Parse/Parser.cpp
  vendor/clang/dist/lib/Rewrite/HTMLRewrite.cpp
  vendor/clang/dist/lib/Sema/CoroutineStmtBuilder.h
  vendor/clang/dist/lib/Sema/SemaCodeComplete.cpp
  vendor/clang/dist/lib/Sema/SemaCoroutine.cpp
  vendor/clang/dist/lib/Sema/SemaDecl.cpp
  vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp
  vendor/clang/dist/lib/Sema/SemaExpr.cpp
  vendor/clang/dist/lib/Sema/SemaLambda.cpp
  vendor/clang/dist/lib/Sema/SemaLookup.cpp
  vendor/clang/d

svn commit: r319528 - vendor/compiler-rt/compiler-rt-trunk-r304659

2017-06-03 Thread Dimitry Andric
Author: dim
Date: Sat Jun  3 15:21:07 2017
New Revision: 319528
URL: https://svnweb.freebsd.org/changeset/base/319528

Log:
  Tag compiler-rt trunk r304659.

Added:
  vendor/compiler-rt/compiler-rt-trunk-r304659/
 - copied from r319527, vendor/compiler-rt/dist/
___
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: r319532 - vendor/lld/lld-trunk-r304659

2017-06-03 Thread Dimitry Andric
Author: dim
Date: Sat Jun  3 15:21:24 2017
New Revision: 319532
URL: https://svnweb.freebsd.org/changeset/base/319532

Log:
  Tag lld trunk r304659.

Added:
  vendor/lld/lld-trunk-r304659/
 - copied from r319531, vendor/lld/dist/
___
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: r319529 - in vendor/libc++/dist: include test/libcxx/containers/unord test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion test/std/exp...

2017-06-03 Thread Dimitry Andric
Author: dim
Date: Sat Jun  3 15:21:10 2017
New Revision: 319529
URL: https://svnweb.freebsd.org/changeset/base/319529

Log:
  Vendor import of libc++ trunk r304659:
  https://llvm.org/svn/llvm-project/libcxx/trunk@304659

Added:
  vendor/libc++/dist/test/libcxx/containers/unord/next_pow2.pass.cpp   
(contents, props changed)
Modified:
  vendor/libc++/dist/include/__hash_table
  
vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp
  
vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp
  
vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp
  
vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/generator.pass.cpp
  
vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp

Modified: vendor/libc++/dist/include/__hash_table
==
--- vendor/libc++/dist/include/__hash_table Sat Jun  3 15:21:07 2017
(r319528)
+++ vendor/libc++/dist/include/__hash_table Sat Jun  3 15:21:10 2017
(r319529)
@@ -137,7 +137,7 @@ inline _LIBCPP_INLINE_VISIBILITY
 size_t
 __next_hash_pow2(size_t __n)
 {
-return size_t(1) << (std::numeric_limits::digits - __clz(__n-1));
+return __n < 2 ? __n : (size_t(1) << (std::numeric_limits::digits 
- __clz(__n-1)));
 }
 
 

Added: vendor/libc++/dist/test/libcxx/containers/unord/next_pow2.pass.cpp
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/libc++/dist/test/libcxx/containers/unord/next_pow2.pass.cpp  Sat Jun 
 3 15:21:10 2017(r319529)
@@ -0,0 +1,88 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+//
+// REQUIRES: long_tests
+// UNSUPPORTED: c++98, c++03
+
+// Not a portable test
+
+// <__hash_table>
+
+// size_t __next_hash_pow2(size_t n);
+
+// If n <= 1, return n. If n is a power of 2, return n.
+// Otherwise, return the next power of 2.
+
+#include <__hash_table>
+#include 
+#include 
+
+#include 
+
+bool
+is_power_of_two(unsigned long n)
+{
+return __builtin_popcount(n) == 1;
+}
+
+void test_next_pow2_val(size_t n)
+{
+std::size_t npow2 = std::__next_hash_pow2(n);
+assert(is_power_of_two(npow2) && npow2 > n);
+}
+
+void
+test_next_pow2()
+{
+assert(!is_power_of_two(0));
+assert(is_power_of_two(1));
+assert(is_power_of_two(2));
+assert(!is_power_of_two(3));
+
+assert(std::__next_hash_pow2(0) == 0);
+assert(std::__next_hash_pow2(1) == 1);
+
+for (std::size_t n = 2; n < (sizeof(std::size_t) * 8 - 1); ++n)
+{
+std::size_t pow2 = 1ULL << n;
+assert(std::__next_hash_pow2(pow2) == pow2);
+}
+
+   test_next_pow2_val(3);
+   test_next_pow2_val(7);
+   test_next_pow2_val(9);
+   test_next_pow2_val(15);
+   test_next_pow2_val(127);
+   test_next_pow2_val(129);
+}
+
+// Note: this is only really useful when run with -fsanitize=undefined.
+void
+fuzz_unordered_map_reserve(unsigned num_inserts,
+   unsigned num_reserve1,
+   unsigned num_reserve2)
+{
+std::unordered_map m;
+m.reserve(num_reserve1);
+for (unsigned I = 0; I < num_inserts; ++I) m[I] = 0;
+m.reserve(num_reserve2);
+assert(m.bucket_count() >= num_reserve2);
+}
+
+int main()
+{
+test_next_pow2();
+
+for (unsigned num_inserts = 0; num_inserts <= 64; ++num_inserts)
+for (unsigned num_reserve1 = 1; num_reserve1 <= 64; ++num_reserve1)
+for (unsigned num_reserve2 = 1; num_reserve2 <= 64; ++num_reserve2)
+fuzz_unordered_map_reserve(num_inserts, num_reserve1, 
num_reserve2);
+
+return 0;
+}

Modified: 
vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp
==
--- 
vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp
 Sat Jun  3 15:21:07 2017(r319528)
+++ 
vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp
 Sat Jun  3 15:21:10 2017(r319529)
@@ -33,7 +33,7 @@ void do_test(coro::coroutine_handle const& H)
   // FIXME Add a runtime test
   {
 ASSERT_SAME_TYPE(decltype(H.done()), bo

svn commit: r319531 - in vendor/lld/dist: COFF ELF test/COFF test/ELF

2017-06-03 Thread Dimitry Andric
Author: dim
Date: Sat Jun  3 15:21:18 2017
New Revision: 319531
URL: https://svnweb.freebsd.org/changeset/base/319531

Log:
  Vendor import of lld trunk r304659:
  https://llvm.org/svn/llvm-project/lld/trunk@304659

Added:
  vendor/lld/dist/test/COFF/def-export-stdcall.s   (contents, props changed)
Modified:
  vendor/lld/dist/COFF/DLL.cpp
  vendor/lld/dist/COFF/DLL.h
  vendor/lld/dist/COFF/Driver.cpp
  vendor/lld/dist/COFF/PDB.cpp
  vendor/lld/dist/ELF/LinkerScript.cpp
  vendor/lld/dist/ELF/OutputSections.cpp
  vendor/lld/dist/ELF/OutputSections.h
  vendor/lld/dist/ELF/Writer.cpp
  vendor/lld/dist/test/COFF/armnt-imports.test
  vendor/lld/dist/test/COFF/hello32.test
  vendor/lld/dist/test/COFF/imports.test
  vendor/lld/dist/test/ELF/emit-relocs.s

Modified: vendor/lld/dist/COFF/DLL.cpp
==
--- vendor/lld/dist/COFF/DLL.cppSat Jun  3 15:21:15 2017
(r319530)
+++ vendor/lld/dist/COFF/DLL.cppSat Jun  3 15:21:18 2017
(r319531)
@@ -100,17 +100,13 @@ class ImportDirectoryChunk : public Chunk { (public)
 
   void writeTo(uint8_t *Buf) const override {
 auto *E = (coff_import_directory_table_entry *)(Buf + OutputSectionOff);
+E->ImportLookupTableRVA = LookupTab->getRVA();
 E->NameRVA = DLLName->getRVA();
-
-// The import descriptor table contains two pointers to
-// the tables describing dllimported symbols. But the
-// Windows loader actually uses only one. So we create
-// only one table and set both fields to its address.
-E->ImportLookupTableRVA = AddressTab->getRVA();
 E->ImportAddressTableRVA = AddressTab->getRVA();
   }
 
   Chunk *DLLName;
+  Chunk *LookupTab;
   Chunk *AddressTab;
 };
 
@@ -392,6 +388,7 @@ std::vector IdataContents::getChunks() {
   // Add each type in the correct order.
   std::vector V;
   V.insert(V.end(), Dirs.begin(), Dirs.end());
+  V.insert(V.end(), Lookups.begin(), Lookups.end());
   V.insert(V.end(), Addresses.begin(), Addresses.end());
   V.insert(V.end(), Hints.begin(), Hints.end());
   V.insert(V.end(), DLLNames.begin(), DLLNames.end());
@@ -407,18 +404,21 @@ void IdataContents::create() {
 // we need to create HintName chunks to store the names.
 // If they don't (if they are import-by-ordinals), we store only
 // ordinal values to the table.
-size_t Base = Addresses.size();
+size_t Base = Lookups.size();
 for (DefinedImportData *S : Syms) {
   uint16_t Ord = S->getOrdinal();
   if (S->getExternalName().empty()) {
+Lookups.push_back(make(Ord));
 Addresses.push_back(make(Ord));
 continue;
   }
   auto *C = make(S->getExternalName(), Ord);
+  Lookups.push_back(make(C));
   Addresses.push_back(make(C));
   Hints.push_back(C);
 }
 // Terminate with null values.
+Lookups.push_back(make(ptrSize()));
 Addresses.push_back(make(ptrSize()));
 
 for (int I = 0, E = Syms.size(); I < E; ++I)
@@ -427,6 +427,7 @@ void IdataContents::create() {
 // Create the import table header.
 DLLNames.push_back(make(Syms[0]->getDLLName()));
 auto *Dir = make(DLLNames.back());
+Dir->LookupTab = Lookups[Base];
 Dir->AddressTab = Addresses[Base];
 Dirs.push_back(Dir);
   }

Modified: vendor/lld/dist/COFF/DLL.h
==
--- vendor/lld/dist/COFF/DLL.h  Sat Jun  3 15:21:15 2017(r319530)
+++ vendor/lld/dist/COFF/DLL.h  Sat Jun  3 15:21:18 2017(r319531)
@@ -36,6 +36,7 @@ class IdataContents { (private)
 
   std::vector Imports;
   std::vector Dirs;
+  std::vector Lookups;
   std::vector Addresses;
   std::vector Hints;
   std::vector DLLNames;

Modified: vendor/lld/dist/COFF/Driver.cpp
==
--- vendor/lld/dist/COFF/Driver.cpp Sat Jun  3 15:21:15 2017
(r319530)
+++ vendor/lld/dist/COFF/Driver.cpp Sat Jun  3 15:21:18 2017
(r319531)
@@ -434,7 +434,8 @@ std::vector createCOFFShortExportFrom
   std::vector Exports;
   for (Export &E1 : Config->Exports) {
 COFFShortExport E2;
-E2.Name = E1.Name;
+// Use SymbolName, which will have any stdcall or fastcall qualifiers.
+E2.Name = E1.SymbolName;
 E2.ExtName = E1.ExtName;
 E2.Ordinal = E1.Ordinal;
 E2.Noname = E1.Noname;

Modified: vendor/lld/dist/COFF/PDB.cpp
==
--- vendor/lld/dist/COFF/PDB.cppSat Jun  3 15:21:15 2017
(r319530)
+++ vendor/lld/dist/COFF/PDB.cppSat Jun  3 15:21:18 2017
(r319531)
@@ -157,7 +157,8 @@ static void dumpDebugS(ScopedPrinter &W, ObjectFile *F
 fatal(EC, "StreamReader.readArray failed");
 
   TypeDatabase TDB(0);
-  CVSymbolDumper SymbolDumper(W, TDB, nullptr, false);
+  CVSymbolDumper SymbolDumper(W, TDB, CodeViewContainer::ObjectFile, nullptr,
+   

svn commit: r319526 - vendor/clang/clang-trunk-r304659

2017-06-03 Thread Dimitry Andric
Author: dim
Date: Sat Jun  3 15:20:57 2017
New Revision: 319526
URL: https://svnweb.freebsd.org/changeset/base/319526

Log:
  Tag clang trunk r304659.

Added:
  vendor/clang/clang-trunk-r304659/
 - copied from r319525, vendor/clang/dist/
___
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: r319530 - vendor/libc++/libc++-trunk-r304659

2017-06-03 Thread Dimitry Andric
Author: dim
Date: Sat Jun  3 15:21:15 2017
New Revision: 319530
URL: https://svnweb.freebsd.org/changeset/base/319530

Log:
  Tag libc++ trunk r304659.

Added:
  vendor/libc++/libc++-trunk-r304659/
 - copied from r319529, vendor/libc++/dist/
___
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: r319524 - vendor/llvm/llvm-trunk-r304659

2017-06-03 Thread Dimitry Andric
Author: dim
Date: Sat Jun  3 15:20:41 2017
New Revision: 319524
URL: https://svnweb.freebsd.org/changeset/base/319524

Log:
  Tag llvm trunk r304659.

Added:
  vendor/llvm/llvm-trunk-r304659/
 - copied from r319523, vendor/llvm/dist/
___
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: r319523 - in vendor/llvm/dist: include/llvm include/llvm/ADT include/llvm/Analysis include/llvm/CodeGen include/llvm/CodeGen/PBQP include/llvm/DebugInfo/CodeView include/llvm/DebugInfo/...

2017-06-03 Thread Dimitry Andric
Author: dim
Date: Sat Jun  3 15:20:36 2017
New Revision: 319523
URL: https://svnweb.freebsd.org/changeset/base/319523

Log:
  Vendor import of llvm trunk r304659:
  https://llvm.org/svn/llvm-project/llvm/trunk@304659

Added:
  vendor/llvm/dist/lib/Target/ARM/ARMScheduleA57.td
  vendor/llvm/dist/lib/Target/ARM/ARMScheduleA57WriteRes.td
  vendor/llvm/dist/test/CodeGen/AMDGPU/not-scalarize-volatile-load.ll
  vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-alu.ll
  vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-basic.ll
  vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-ldm-wrback.ll
  vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-ldm.ll
  vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-stm-wrback.ll
  vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-stm.ll
  vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vfma.ll
  vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vldm-wrback.ll
  vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vldm.ll
  vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vstm-wrback.ll
  vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vstm.ll
  vendor/llvm/dist/test/CodeGen/Hexagon/newify-crash.ll
  
vendor/llvm/dist/test/CodeGen/Mips/micromips-sizereduction/micromips-lbu16-lhu16-sb16-sh16.ll
  vendor/llvm/dist/test/CodeGen/PowerPC/scavenging.mir
  vendor/llvm/dist/test/CodeGen/SystemZ/RAbasic-invalid-LR-update.mir
  vendor/llvm/dist/test/CodeGen/X86/scavenger.mir
  vendor/llvm/dist/test/CodeGen/X86/vector-unsigned-cmp.ll
  vendor/llvm/dist/test/DebugInfo/MIR/AArch64/
  vendor/llvm/dist/test/DebugInfo/MIR/AArch64/clobber-sp.mir
  vendor/llvm/dist/test/DebugInfo/MIR/AArch64/lit.local.cfg
  
vendor/llvm/dist/test/Instrumentation/SanitizerCoverage/inline-8bit-counters.ll
  vendor/llvm/dist/test/MC/WebAssembly/external-data.ll
  vendor/llvm/dist/test/Transforms/CodeExtractor/cost.ll
  vendor/llvm/dist/test/Transforms/CodeExtractor/cost_meta.ll
  vendor/llvm/dist/test/Transforms/LowerExpectIntrinsic/phi_merge.ll
  vendor/llvm/dist/test/Transforms/LowerExpectIntrinsic/phi_or.ll
  vendor/llvm/dist/test/Transforms/LowerExpectIntrinsic/phi_tern.ll
  vendor/llvm/dist/test/Transforms/LowerTypeTests/Inputs/use-typeid1-dead.yaml
  vendor/llvm/dist/test/Transforms/LowerTypeTests/export-dead.ll
  vendor/llvm/dist/test/Transforms/Util/PredicateInfo/condprop2.ll
  vendor/llvm/dist/test/Transforms/Util/PredicateInfo/testandor2.ll
  vendor/llvm/dist/unittests/Analysis/OrderedBasicBlockTest.cpp   (contents, 
props changed)
Modified:
  vendor/llvm/dist/include/llvm/ADT/SmallVector.h
  vendor/llvm/dist/include/llvm/Analysis/OrderedBasicBlock.h
  vendor/llvm/dist/include/llvm/Analysis/RegionPass.h
  vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h
  vendor/llvm/dist/include/llvm/CodeGen/MachineRegionInfo.h
  vendor/llvm/dist/include/llvm/CodeGen/MachineRegisterInfo.h
  vendor/llvm/dist/include/llvm/CodeGen/MachineScheduler.h
  vendor/llvm/dist/include/llvm/CodeGen/PBQP/CostAllocator.h
  vendor/llvm/dist/include/llvm/CodeGen/PBQP/Graph.h
  vendor/llvm/dist/include/llvm/CodeGen/PBQP/Math.h
  vendor/llvm/dist/include/llvm/CodeGen/PBQP/ReductionRules.h
  vendor/llvm/dist/include/llvm/CodeGen/PBQP/Solution.h
  vendor/llvm/dist/include/llvm/CodeGen/PBQPRAConstraint.h
  vendor/llvm/dist/include/llvm/CodeGen/Passes.h
  vendor/llvm/dist/include/llvm/CodeGen/RegAllocPBQP.h
  vendor/llvm/dist/include/llvm/CodeGen/RegisterScavenging.h
  vendor/llvm/dist/include/llvm/CodeGen/ScheduleDAGInstrs.h
  vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h
  vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h
  vendor/llvm/dist/include/llvm/CodeGen/SlotIndexes.h
  vendor/llvm/dist/include/llvm/CodeGen/StackMaps.h
  vendor/llvm/dist/include/llvm/CodeGen/TargetSchedule.h
  vendor/llvm/dist/include/llvm/CodeGen/WinEHFuncInfo.h
  vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeView.h
  vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
  vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
  vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h
  vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
  vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
  vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolDumper.h
  vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
  vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
  vendor/llvm/dist/include/llvm/DebugInfo/MSF/MappedBlockStream.h
  
vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h
  vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
  vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
  vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/TpiStream.h
  vendor/llvm/dist/include/llvm/IR/DIBuilder.h
  vendor/llvm/dist/include/llvm/IR/DebugLoc.h
  vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndex.h
  vendor/llvm/dis

svn commit: r319522 - head/sys/arm/conf

2017-06-03 Thread Andrew Turner
Author: andrew
Date: Sat Jun  3 14:45:46 2017
New Revision: 319522
URL: https://svnweb.freebsd.org/changeset/base/319522

Log:
  Remove RT1310 from universe as it fails to build.

Modified:
  head/sys/arm/conf/RT1310

Modified: head/sys/arm/conf/RT1310
==
--- head/sys/arm/conf/RT1310Sat Jun  3 14:28:19 2017(r319521)
+++ head/sys/arm/conf/RT1310Sat Jun  3 14:45:46 2017(r319522)
@@ -3,6 +3,8 @@
 #
 # $FreeBSD$
 #
+# TODO: This fails to build under universe, irnore it until it's fixed
+#NO_UNIVERSE
 
 ident  RT1310
 include"std.arm"
___
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: r319521 - head/usr.sbin/makefs/ffs

2017-06-03 Thread Ed Maste
Author: emaste
Date: Sat Jun  3 14:28:19 2017
New Revision: 319521
URL: https://svnweb.freebsd.org/changeset/base/319521

Log:
  makefs: rename variable for NetBSD diff reduction

Modified:
  head/usr.sbin/makefs/ffs/buf.c

Modified: head/usr.sbin/makefs/ffs/buf.c
==
--- head/usr.sbin/makefs/ffs/buf.c  Sat Jun  3 14:22:15 2017
(r319520)
+++ head/usr.sbin/makefs/ffs/buf.c  Sat Jun  3 14:28:19 2017
(r319521)
@@ -60,7 +60,7 @@ bread(struct vnode *vp, daddr_t blkno, int size, struc
 {
off_t   offset;
ssize_t rv;
-   fsinfo_t *fsinfo = vp->fs;
+   fsinfo_t *fs = vp->fs;
 
assert (bpp != NULL);
 
@@ -68,7 +68,7 @@ bread(struct vnode *vp, daddr_t blkno, int size, struc
printf("%s: blkno %lld size %d\n", __func__, (long long)blkno,
size);
*bpp = getblk(vp, blkno, size, 0, 0, 0);
-   offset = (*bpp)->b_blkno * fsinfo->sectorsize + fsinfo->offset;
+   offset = (*bpp)->b_blkno * fs->sectorsize + fs->offset;
if (debug & DEBUG_BUF_BREAD)
printf("%s: blkno %lld offset %lld bcount %ld\n", __func__,
(long long)(*bpp)->b_blkno, (long long) offset,
___
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: r319520 - in head: lib/libsysdecode usr.bin/kdump usr.bin/truss

2017-06-03 Thread John Baldwin
Author: jhb
Date: Sat Jun  3 14:22:15 2017
New Revision: 319520
URL: https://svnweb.freebsd.org/changeset/base/319520

Log:
  Decode the 'who' argument passed to getrusage().
  
  Add a new sysdecode_getrusage_who() which decodes the RUSAGE_* constant
  passed as the first argument to getrusage().  Use this function in both
  kdump and truss to decode the first argument to getrusage().
  
  PR:   215448
  Submitted by: Anton Yuzhaninov 
  MFC after:1 month

Modified:
  head/lib/libsysdecode/Makefile
  head/lib/libsysdecode/flags.c
  head/lib/libsysdecode/mktables
  head/lib/libsysdecode/sysdecode.h
  head/lib/libsysdecode/sysdecode_enum.3
  head/usr.bin/kdump/kdump.c
  head/usr.bin/truss/syscall.h
  head/usr.bin/truss/syscalls.c

Modified: head/lib/libsysdecode/Makefile
==
--- head/lib/libsysdecode/Makefile  Sat Jun  3 14:15:14 2017
(r319519)
+++ head/lib/libsysdecode/Makefile  Sat Jun  3 14:22:15 2017
(r319520)
@@ -32,6 +32,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \
sysdecode_enum.3 sysdecode_fadvice.3 \
sysdecode_enum.3 sysdecode_fcntl_cmd.3 \
sysdecode_enum.3 sysdecode_getfsstat_mode.3 \
+   sysdecode_enum.3 sysdecode_getrusage_who.3 \
sysdecode_enum.3 sysdecode_idtype.3 \
sysdecode_enum.3 sysdecode_ipproto.3 \
sysdecode_enum.3 sysdecode_kldsym_cmd.3 \

Modified: head/lib/libsysdecode/flags.c
==
--- head/lib/libsysdecode/flags.c   Sat Jun  3 14:15:14 2017
(r319519)
+++ head/lib/libsysdecode/flags.c   Sat Jun  3 14:22:15 2017
(r319520)
@@ -487,6 +487,13 @@ sysdecode_getfsstat_mode(int mode)
 }
 
 const char *
+sysdecode_getrusage_who(int who)
+{
+
+   return (lookup_value(rusage, who));
+}
+
+const char *
 sysdecode_kldsym_cmd(int cmd)
 {
 

Modified: head/lib/libsysdecode/mktables
==
--- head/lib/libsysdecode/mktables  Sat Jun  3 14:15:14 2017
(r319519)
+++ head/lib/libsysdecode/mktables  Sat Jun  3 14:22:15 2017
(r319520)
@@ -114,6 +114,7 @@ gen_table "quotactlcmds""Q_[A-Z]+[[:space:]]+0x[0-
 gen_table "rebootopt"   "RB_[A-Z]+[[:space:]]+0x[0-9]+"
"sys/reboot.h"
 gen_table "rforkflags"  "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)"   
"sys/unistd.h"
 gen_table "rlimit"  "RLIMIT_[A-Z]+[[:space:]]+[0-9]+"  
"sys/resource.h"
+gen_table "rusage"  "RUSAGE_[A-Z]+[[:space:]]+[-0-9]+" 
"sys/resource.h"
 gen_table "schedpolicy" "SCHED_[A-Z]+[[:space:]]+[0-9]+"   
"sched.h"
 gen_table "sendfileflags"   "SF_[A-Z]+[[:space:]]+[0-9]+"  
"sys/socket.h"
 gen_table "shmatflags"  "SHM_[A-Z]+[[:space:]]+[0-9]{6}+"  
"sys/shm.h"

Modified: head/lib/libsysdecode/sysdecode.h
==
--- head/lib/libsysdecode/sysdecode.h   Sat Jun  3 14:15:14 2017
(r319519)
+++ head/lib/libsysdecode/sysdecode.h   Sat Jun  3 14:22:15 2017
(r319520)
@@ -55,6 +55,7 @@ bool  sysdecode_filemode(FILE *_fp, int _mode, int *_re
 bool   sysdecode_flock_operation(FILE *_fp, int _operation, int *_rem);
 intsysdecode_freebsd_to_abi_errno(enum sysdecode_abi _abi, int _error);
 const char *sysdecode_getfsstat_mode(int _mode);
+const char *sysdecode_getrusage_who(int _who);
 const char *sysdecode_idtype(int _idtype);
 const char *sysdecode_ioctlname(unsigned long _val);
 const char *sysdecode_ipproto(int _protocol);

Modified: head/lib/libsysdecode/sysdecode_enum.3
==
--- head/lib/libsysdecode/sysdecode_enum.3  Sat Jun  3 14:15:14 2017
(r319519)
+++ head/lib/libsysdecode/sysdecode_enum.3  Sat Jun  3 14:22:15 2017
(r319520)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 2, 2017
+.Dd June 3, 2017
 .Dt sysdecode_enum 3
 .Os
 .Sh NAME
@@ -36,6 +36,7 @@
 .Nm sysdecode_fadvice ,
 .Nm sysdecode_fcntl_cmd ,
 .Nm sysdecode_getfsstat_mode ,
+.Nm sysdecode_getrusage_who ,
 .Nm sysdecode_idtype ,
 .Nm sysdecode_ipproto ,
 .Nm sysdecode_kldsym_cmd ,
@@ -89,6 +90,8 @@
 .Ft const char *
 .Fn sysdecode_getfsstat_mode "int mode"
 .Ft const char *
+.Fn sysdecode_getrusage_who "int who"
+.Ft const char *
 .Fn sysdecode_idtype "int idtype"
 .Ft const char *
 .Fn sysdecode_ipproto "int protocol"
@@ -188,6 +191,7 @@ Most of these functions decode an argument passed to a
 .It Fn sysdecode_ptrace_request Ta Xr ptrace 2 Ta Fa request
 .It Fn sysdecode_rlimit Ta Xr getrlimit 2 Ta Fa resource
 .It Fn sysdecode_rtprio_function Ta Xr rtprio 2 Ta Fa function
+.It Fn sysdecode_getrusage_who Ta Xr getrusage 2 Ta Fa who
 .It Fn sysdecode_scheduler_policy Ta Xr sched_setscheduler 2 Ta Fa policy
 .It Fn sysdeco

svn commit: r319519 - head/sys/ufs/ffs

2017-06-03 Thread Konstantin Belousov
Author: kib
Date: Sat Jun  3 14:15:14 2017
New Revision: 319519
URL: https://svnweb.freebsd.org/changeset/base/319519

Log:
  Clean possible td_su reference on the struct mount being unmounted as
  the last step of ffs_unmount().
  
  It is possible that the mount point is recorded for cleanup in AST
  context while softdep flush is executed during unmount.  The workitems
  are flushed by other means for the unmount, but the stray reference to
  struct mount blocks destruction of mount.  Check for the situation and
  manually call vfs_rel() before returning from ffs_unmount().
  
  Reported and tested by:   pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

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

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==
--- head/sys/ufs/ffs/ffs_vfsops.c   Sat Jun  3 14:12:17 2017
(r319518)
+++ head/sys/ufs/ffs/ffs_vfsops.c   Sat Jun  3 14:15:14 2017
(r319519)
@@ -1319,6 +1319,10 @@ ffs_unmount(mp, mntflags)
MNT_ILOCK(mp);
mp->mnt_flag &= ~MNT_LOCAL;
MNT_IUNLOCK(mp);
+   if (td->td_su == mp) {
+   td->td_su = NULL;
+   vfs_rel(mp);
+   }
return (error);
 
 fail:
___
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: r319518 - head/sys/kern

2017-06-03 Thread Konstantin Belousov
Author: kib
Date: Sat Jun  3 14:12:17 2017
New Revision: 319518
URL: https://svnweb.freebsd.org/changeset/base/319518

Log:
  Ensure that cached struct thread does not keep spurious td_su
  reference on an UFS mount point.
  
  Reported and tested by:   pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/kern_proc.c

Modified: head/sys/kern/kern_proc.c
==
--- head/sys/kern/kern_proc.c   Sat Jun  3 14:10:09 2017(r319517)
+++ head/sys/kern/kern_proc.c   Sat Jun  3 14:12:17 2017(r319518)
@@ -226,6 +226,8 @@ proc_dtor(void *mem, int size, void *arg)
 #endif
/* Free all OSD associated to this thread. */
osd_thread_exit(td);
+   td_softdep_cleanup(td);
+   MPASS(td->td_su == NULL);
 
/* Make sure all thread destructors are executed */
EVENTHANDLER_INVOKE(thread_dtor, td);
___
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: r319517 - head/lib/libsysdecode

2017-06-03 Thread John Baldwin
Author: jhb
Date: Sat Jun  3 14:10:09 2017
New Revision: 319517
URL: https://svnweb.freebsd.org/changeset/base/319517

Log:
  Add a cross-reference to sysdecode_socket_protocol(3).

Modified:
  head/lib/libsysdecode/sysdecode.3

Modified: head/lib/libsysdecode/sysdecode.3
==
--- head/lib/libsysdecode/sysdecode.3   Sat Jun  3 13:13:57 2017
(r319516)
+++ head/lib/libsysdecode/sysdecode.3   Sat Jun  3 14:10:09 2017
(r319517)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 17, 2016
+.Dd June 3, 2017
 .Dt SYSDECODE 3
 .Os
 .Sh NAME
@@ -76,6 +76,7 @@ A placeholder for use when the ABI is not known.
 .Xr sysdecode_mask 3 ,
 .Xr sysdecode_quotactl_cmd 3 ,
 .Xr sysdecode_sigcode 3 ,
+.Xr sysdecode_socket_protocol 3 ,
 .Xr sysdecode_sockopt_name 3 ,
 .Xr sysdecode_syscallnames 3 ,
 .Xr sysdecode_utrace 3
___
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: r319516 - head/contrib/compiler-rt/lib/tsan/rtl

2017-06-03 Thread Ed Maste
Author: emaste
Date: Sat Jun  3 13:13:57 2017
New Revision: 319516
URL: https://svnweb.freebsd.org/changeset/base/319516

Log:
  tsan: set noexec stack on aarch64
  
  This may be refined upstream.
  
  Reviewed by:  dim
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D11034

Modified:
  head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S

Modified: head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S
==
--- head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.SSat Jun  3 
10:40:45 2017(r319515)
+++ head/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.SSat Jun  3 
13:13:57 2017(r319516)
@@ -252,7 +252,7 @@ __sigsetjmp:
   CFI_ENDPROC
 .size __sigsetjmp, .-__sigsetjmp
 
-#if defined(__linux__)
+#if defined(__FreeBSD__) || defined(__linux__)
 /* We do not need executable stack.  */
 .section.note.GNU-stack,"",@progbits
 #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: r319515 - head/sys/arm/arm

2017-06-03 Thread Andrew Turner
Author: andrew
Date: Sat Jun  3 10:40:45 2017
New Revision: 319515
URL: https://svnweb.freebsd.org/changeset/base/319515

Log:
  Make it an error to build armv6 without INTRNG enabled. Most kernel configs
  have been updated for this, with the exception of the two marked as
  NO_UNIVERSE in r319514.

Modified:
  head/sys/arm/arm/machdep.c

Modified: head/sys/arm/arm/machdep.c
==
--- head/sys/arm/arm/machdep.c  Sat Jun  3 10:38:41 2017(r319514)
+++ head/sys/arm/arm/machdep.c  Sat Jun  3 10:40:45 2017(r319515)
@@ -103,6 +103,10 @@ __FBSDID("$FreeBSD$");
 #error FreeBSD/arm doesn't provide compatibility with releases prior to 10
 #endif
 
+#if __ARM_ARCH >= 6 && !defined(INTRNG)
+#error armv6 requires INTRNG
+#endif
+
 struct pcpu __pcpu[MAXCPU];
 struct pcpu *pcpup = &__pcpu[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: r319514 - head/sys/arm/conf

2017-06-03 Thread Andrew Turner
Author: andrew
Date: Sat Jun  3 10:38:41 2017
New Revision: 319514
URL: https://svnweb.freebsd.org/changeset/base/319514

Log:
  Mark the non-INTRNG armv6 configs with NO_UNIVERSE to prepare for INTRNG
  being always enabled on armv6.

Modified:
  head/sys/arm/conf/AML8726
  head/sys/arm/conf/ARMADAXP

Modified: head/sys/arm/conf/AML8726
==
--- head/sys/arm/conf/AML8726   Sat Jun  3 03:40:11 2017(r319513)
+++ head/sys/arm/conf/AML8726   Sat Jun  3 10:38:41 2017(r319514)
@@ -18,6 +18,9 @@
 #
 # $FreeBSD$
 
+# TODO: Port to INTRNG
+#NO_UNIVERSE
+
 ident  AML8726
 
 include"std.armv6"

Modified: head/sys/arm/conf/ARMADAXP
==
--- head/sys/arm/conf/ARMADAXP  Sat Jun  3 03:40:11 2017(r319513)
+++ head/sys/arm/conf/ARMADAXP  Sat Jun  3 10:38:41 2017(r319514)
@@ -18,6 +18,9 @@
 #
 # $FreeBSD$
 
+# TODO: Port to INTRNG
+#NO_UNIVERSE
+
 ident  MV-88F78XX0
 
 include"std.armv6"
___
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: r319507 - head/sys/fs/msdosfs

2017-06-03 Thread Bruce Evans

On Fri, 2 Jun 2017, Ed Maste wrote:


Log:
 msdosfs: use mem{cpy,move,set} instead of bcopy,bzero

 This somewhat simplifies use of msdosfs code in userland (for makefs),
 reduces diffs with NetBSD and is standard C as of C89.


This is a style bug in the kernel.  The kernel should use the standard BSD
functions bcopy() and bzero().

bzero() is better designed than memset() for zeroing.

bcopy() is essentially the same as memmove(), but is implemented more
optimally
  (the non-use of memmove() in the kernel used to be implememented by
  by not having it, but someone broke this by adding an memmove() wrapper
  which is an extern function that calls bcopy().  This is even slower than
  the inline wrappers used to break intentionally leaving out some of the
  other functions).

memcpy() became a non-style-bug in the kernel when dg optimized some
networking code by using it.  It was supposed to be used only for small
fixed-sized copies when the compiler can and does inlines it.  The extern
memcpy() unfortunately had to be implemented so that compiling with -O0
(which turns off inlining) is used, so that the code doesn't need ifdefs
for -O0.  This became nonsense when -ffreestanding killed inlining of
all Standard C functions.  The slow support function for -O0 is used in
all cases where memcpy() is used.  It turns out to be not very slow, at
least on x86.  On x86, it was never optimized like bcopy() was, but the
optimizations for bcopy() were very MD and are now not attempted, so
memcpy() is now just bcopy() with the support for overlapping copies
removed, so is slightly faster.  On newer x86, "rep movs[any]" is as
fast as anything for large copies, but has a large startup overhead so
is a bad method for small copies, but is used in all cases.  Compiler
inlines wouldn't use it for small copies, but the threshold for using it
is very MD so always using it is not too bad as a default.

memset() has a bad inline implementation.  It just calls bzero() when the
fill byte is zero.  Otherwise, it slowly stores 1 byte per iteration.
memset() is also extern in libkern with the same bad implementation, and
and it takes complicated macros to get the inline version.

memcmp() used to have a worse inline implementation that wrapped bcmp().
This was broken since bcmp() is boolean while memcmp() is 3-state.  This
has been fixed by using the extern libkern version which is a copy of
the generic libc version.  Except it is a bug for memcmp() to exist in
the kernel.


Modified: head/sys/fs/msdosfs/msdosfs_conv.c
==
--- head/sys/fs/msdosfs/msdosfs_conv.c  Fri Jun  2 17:57:27 2017
(r319506)
+++ head/sys/fs/msdosfs/msdosfs_conv.c  Fri Jun  2 18:39:53 2017
(r319507)
@@ -536,7 +536,7 @@ unix2winfn(const u_char *un, size_t unlen, struct wine
/*
 * Initialize winentry to some useful default
 */
-   for (wcp = (uint8_t *)wep, i = sizeof(*wep); --i >= 0; *wcp++ = 0xff);
+   memset(wep, 0xff, sizeof(*wep));
wep->weCnt = cnt;
wep->weAttributes = ATTR_WIN95;
wep->weReserved1 = 0;


memset() uses the same slow loop as the old inline code.  Unfortunately,
there is no bset() function in the bcopy family, so the unusual case of
setting to nonzero had to be handled inline.

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"