svn commit: r286982 - in head/usr.sbin/pw: . tests

2015-08-21 Thread Baptiste Daroussin
Author: bapt
Date: Fri Aug 21 07:09:53 2015
New Revision: 286982
URL: https://svnweb.freebsd.org/changeset/base/286982

Log:
  Fix useradd regression:
  
  Readd the function to create the parents home directory if it does not exists.
  if it is only a directory at the top level of the hierarchy symlink it into 
/usr
  as it used to be done before.
  
  Reported by:  kevlo, adrian

Modified:
  head/usr.sbin/pw/pw_user.c
  head/usr.sbin/pw/tests/pw_useradd.sh

Modified: head/usr.sbin/pw/pw_user.c
==
--- head/usr.sbin/pw/pw_user.c  Fri Aug 21 06:30:13 2015(r286981)
+++ head/usr.sbin/pw/pw_user.c  Fri Aug 21 07:09:53 2015(r286982)
@@ -38,6 +38,7 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -85,11 +86,76 @@ static void rmat(uid_t uid);
 static voidrmopie(char const * name);
 
 static void
+mkdir_home_parents(int dfd, const char *dir)
+{
+   struct stat st;
+   char *dirs, *tmp;
+
+   if (*dir != '/')
+   errx(EX_DATAERR, "invalid base directory for home '%s'", dir);
+
+   dir++;
+
+   if (fstatat(dfd, dir, &st, 0) != -1) {
+   if (S_ISDIR(st.st_mode))
+   return;
+   errx(EX_OSFILE, "root home `/%s' is not a directory", dir);
+   }
+
+   dirs = strdup(dir);
+   if (dirs == NULL)
+   errx(EX_UNAVAILABLE, "out of memory");
+
+   tmp = strrchr(dirs, '/');
+   if (tmp == NULL)
+   return;
+   tmp[0] = '\0';
+
+   /*
+* This is a kludge especially for Joerg :)
+* If the home directory would be created in the root partition, then
+* we really create it under /usr which is likely to have more space.
+* But we create a symlink from cnf->home -> "/usr" -> cnf->home
+*/
+   if (strchr(dirs, '/') == NULL) {
+   asprintf(&tmp, "usr/%s", dirs);
+   if (tmp == NULL)
+   errx(EX_UNAVAILABLE, "out of memory");
+   if (mkdirat(dfd, tmp, _DEF_DIRMODE) != -1 || errno == EEXIST) {
+   fchownat(dfd, tmp, 0, 0, 0);
+   symlinkat(tmp, dfd, dirs + 1);
+   }
+   free(tmp);
+   }
+   tmp = dirs;
+   if (fstatat(dfd, dirs, &st, 0) == -1) {
+   while ((tmp = strchr(tmp + 1, '/')) != NULL) {
+   *tmp = '\0';
+   if (fstatat(dfd, dirs, &st, 0) == -1) {
+   if (mkdirat(dfd, dirs, _DEF_DIRMODE) == -1)
+   err(EX_OSFILE,  "'%s' (root home 
parent) is not a directory", dirs);
+   }
+   *tmp = '/';
+   }
+   }
+   if (fstatat(dfd, dirs, &st, 0) == -1) {
+   if (mkdirat(dfd, dirs, _DEF_DIRMODE) == -1)
+   err(EX_OSFILE,  "'%s' (root home parent) is not a 
directory", dirs);
+   fchownat(dfd, dirs, 0, 0, 0);
+   }
+
+   free(dirs);
+}
+
+static void
 create_and_populate_homedir(struct userconf *cnf, struct passwd *pwd,
 const char *skeldir, mode_t homemode, bool update)
 {
int skelfd = -1;
 
+   /* Create home parents directories */
+   mkdir_home_parents(conf.rootfd, pwd->pw_dir);
+
if (skeldir != NULL && *skeldir != '\0') {
if (*skeldir == '/')
skeldir++;

Modified: head/usr.sbin/pw/tests/pw_useradd.sh
==
--- head/usr.sbin/pw/tests/pw_useradd.shFri Aug 21 06:30:13 2015
(r286981)
+++ head/usr.sbin/pw/tests/pw_useradd.shFri Aug 21 07:09:53 2015
(r286982)
@@ -245,7 +245,6 @@ user_add_R_body() {
populate_root_etc_skel
 
atf_check -s exit:0 ${RPW} useradd foo
-   mkdir -p ${HOME}/home
atf_check -s exit:0 ${RPW} useradd bar -m
test -d ${HOME}/home/bar || atf_fail "Directory not created"
atf_check -s exit:0 ${RPW} userdel bar
@@ -260,7 +259,7 @@ user_add_skel_body() {
populate_root_etc_skel
 
mkdir ${HOME}/skel
-   echo "a" > ${HOME}/skel/.a
+   echo "a" > ${HOME}/skel/.ae
echo "b" > ${HOME}/skel/b
mkdir ${HOME}/skel/c
mkdir ${HOME}/skel/c/d
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286983 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2015-08-21 Thread Andriy Gapon
Author: avg
Date: Fri Aug 21 08:04:56 2015
New Revision: 286983
URL: https://svnweb.freebsd.org/changeset/base/286983

Log:
  fix a mismerge in r286539 (MFV 286538: 5562 ZFS sa_handle's violate...)
  
  PR:   202358
  X-MFC with:   r286539
  X-MFC attn:   mav

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.cFri Aug 21 
07:09:53 2015(r286982)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.cFri Aug 21 
08:04:56 2015(r286983)
@@ -220,7 +220,6 @@ static void
 sa_cache_destructor(void *buf, void *unused)
 {
sa_handle_t *hdl = buf;
-   hdl->sa_dbu.dbu_evict_func = NULL;
mutex_destroy(&hdl->sa_lock);
 }
 
@@ -1385,6 +1384,7 @@ sa_handle_get_from_db(objset_t *os, dmu_
sa_handle_t *winner = NULL;
 
handle = kmem_cache_alloc(sa_cache, KM_SLEEP);
+   handle->sa_dbu.dbu_evict_func = NULL;
handle->sa_userp = userp;
handle->sa_bonus = db;
handle->sa_os = os;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286984 - head/sys/modules/zfs

2015-08-21 Thread Andriy Gapon
Author: avg
Date: Fri Aug 21 08:06:18 2015
New Revision: 286984
URL: https://svnweb.freebsd.org/changeset/base/286984

Log:
  fix standalone build of zfs module
  
  Not sure if this is a proper fix, but it does the job.

Modified:
  head/sys/modules/zfs/Makefile

Modified: head/sys/modules/zfs/Makefile
==
--- head/sys/modules/zfs/Makefile   Fri Aug 21 08:04:56 2015
(r286983)
+++ head/sys/modules/zfs/Makefile   Fri Aug 21 08:06:18 2015
(r286984)
@@ -4,7 +4,7 @@ SYSDIR?=${.CURDIR}/../..
 
 KMOD=  zfs
 
-SRCS=  bus_if.h device_if.h vnode_if.h opt_kstack_pages.h
+SRCS=  bus_if.h device_if.h vnode_if.h opt_kstack_pages.h opt_random.h
 
 SUNW=  ${SYSDIR}/cddl/contrib/opensolaris
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286985 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2015-08-21 Thread Andriy Gapon
Author: avg
Date: Fri Aug 21 08:17:44 2015
New Revision: 286985
URL: https://svnweb.freebsd.org/changeset/base/286985

Log:
  try to fix lor between z_teardown_lock and spa_namespace_lock
  
  The lock order reversal and a resulting deadlock were introduced
  in r285021 / D2865.  The problem is that zfs_register_callbacks() calls
  dsl_prop_get_integer() that has to acquire spa_namespace_lock.
  At the same time, spa_config_sync() is called with spa_namespace_lock
  held and then it performs ZFS vnode operations that acquire
  z_teardown_lock in the reader mode.
  
  So, fix the problem by using dsl_prop_get_int_ds() instead of
  dsl_prop_get_integer().  The former does not need to look up
  the pool and the dataset by name.
  
  Reported by:  many
  Reviewed by:  delphij
  Tested by:delphij, Jens Schweikhardt 
  MFC after:5 days
  X-MFC with:   r285021

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.cFri Aug 
21 08:06:18 2015(r286984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.cFri Aug 
21 08:17:44 2015(r286985)
@@ -472,6 +472,19 @@ zfs_register_callbacks(vfs_t *vfsp)
}
 
/*
+* We need to enter pool configuration here, so that we can use
+* dsl_prop_get_int_ds() to handle the special nbmand property below.
+* dsl_prop_get_integer() can not be used, because it has to acquire
+* spa_namespace_lock and we can not do that because we already hold
+* z_teardown_lock.  The problem is that spa_config_sync() is called
+* with spa_namespace_lock held and the function calls ZFS vnode
+* operations to write the cache file and thus z_teardown_lock is
+* acquired after spa_namespace_lock.
+*/
+   ds = dmu_objset_ds(os);
+   dsl_pool_config_enter(dmu_objset_pool(os), FTAG);
+
+   /*
 * nbmand is a special property.  It can only be changed at
 * mount time.
 *
@@ -482,14 +495,9 @@ zfs_register_callbacks(vfs_t *vfsp)
nbmand = B_FALSE;
} else if (vfs_optionisset(vfsp, MNTOPT_NBMAND, NULL)) {
nbmand = B_TRUE;
-   } else {
-   char osname[MAXNAMELEN];
-
-   dmu_objset_name(os, osname);
-   if (error = dsl_prop_get_integer(osname, "nbmand", &nbmand,
-   NULL)) {
-   return (error);
-   }
+   } else if (error = dsl_prop_get_int_ds(ds, "nbmand", &nbmand) != 0) {
+   dsl_pool_config_exit(dmu_objset_pool(os), FTAG);
+   return (error);
}
 
/*
@@ -499,8 +507,6 @@ zfs_register_callbacks(vfs_t *vfsp)
 * the first prop_register(), but I guess I like to go
 * overboard...
 */
-   ds = dmu_objset_ds(os);
-   dsl_pool_config_enter(dmu_objset_pool(os), FTAG);
error = dsl_prop_register(ds,
zfs_prop_to_name(ZFS_PROP_ATIME), atime_changed_cb, zfsvfs);
error = error ? error : dsl_prop_register(ds,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r286984 - head/sys/modules/zfs

2015-08-21 Thread Mark R V Murray
Thanks!

I’ve been running “make universe” here as a build-test. I wonder why this was 
not picked up?

M

> On 21 Aug 2015, at 09:06, Andriy Gapon  wrote:
> 
> Author: avg
> Date: Fri Aug 21 08:06:18 2015
> New Revision: 286984
> URL: https://svnweb.freebsd.org/changeset/base/286984
> 
> Log:
>  fix standalone build of zfs module
> 
>  Not sure if this is a proper fix, but it does the job.
> 
> Modified:
>  head/sys/modules/zfs/Makefile
> 
> Modified: head/sys/modules/zfs/Makefile
> ==
> --- head/sys/modules/zfs/Makefile Fri Aug 21 08:04:56 2015
> (r286983)
> +++ head/sys/modules/zfs/Makefile Fri Aug 21 08:06:18 2015
> (r286984)
> @@ -4,7 +4,7 @@ SYSDIR?=${.CURDIR}/../..
> 
> KMOD= zfs
> 
> -SRCS=bus_if.h device_if.h vnode_if.h opt_kstack_pages.h
> +SRCS=bus_if.h device_if.h vnode_if.h opt_kstack_pages.h opt_random.h
> 
> SUNW= ${SYSDIR}/cddl/contrib/opensolaris
> 
> 

-- 
Mark R V Murray

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

Re: svn commit: r286984 - head/sys/modules/zfs

2015-08-21 Thread Andriy Gapon

Precisely because it's the standalone build (cd sys/modules/zfs && make
...) that was affected.  Building the module as a part of the kernel
build worked just fine.

On 21/08/2015 11:17, Mark R V Murray wrote:
> Thanks!
> 
> I’ve been running “make universe” here as a build-test. I wonder why this was 
> not picked up?
> 
> M
> 
>> On 21 Aug 2015, at 09:06, Andriy Gapon  wrote:
>>
>> Author: avg
>> Date: Fri Aug 21 08:06:18 2015
>> New Revision: 286984
>> URL: https://svnweb.freebsd.org/changeset/base/286984
>>
>> Log:
>>  fix standalone build of zfs module
>>
>>  Not sure if this is a proper fix, but it does the job.
>>
>> Modified:
>>  head/sys/modules/zfs/Makefile
>>
>> Modified: head/sys/modules/zfs/Makefile
>> ==
>> --- head/sys/modules/zfs/MakefileFri Aug 21 08:04:56 2015
>> (r286983)
>> +++ head/sys/modules/zfs/MakefileFri Aug 21 08:06:18 2015
>> (r286984)
>> @@ -4,7 +4,7 @@ SYSDIR?=${.CURDIR}/../..
>>
>> KMOD=zfs
>>
>> -SRCS=   bus_if.h device_if.h vnode_if.h opt_kstack_pages.h
>> +SRCS=   bus_if.h device_if.h vnode_if.h opt_kstack_pages.h opt_random.h
>>
>> SUNW=${SYSDIR}/cddl/contrib/opensolaris
>>
>>
> 


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

Re: svn commit: r286985 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2015-08-21 Thread Andriy Gapon
On 21/08/2015 11:17, Andriy Gapon wrote:
> Author: avg
> Date: Fri Aug 21 08:17:44 2015
> New Revision: 286985
> URL: https://svnweb.freebsd.org/changeset/base/286985
> 
> Log:
>   try to fix lor between z_teardown_lock and spa_namespace_lock
>   
>   The lock order reversal and a resulting deadlock were introduced
>   in r285021 / D2865.  The problem is that zfs_register_callbacks() calls
>   dsl_prop_get_integer() that has to acquire spa_namespace_lock.
>   At the same time, spa_config_sync() is called with spa_namespace_lock
>   held and then it performs ZFS vnode operations that acquire
>   z_teardown_lock in the reader mode.
>   
>   So, fix the problem by using dsl_prop_get_int_ds() instead of
>   dsl_prop_get_integer().  The former does not need to look up
>   the pool and the dataset by name.
>   
>   Reported by:many
>   Reviewed by:delphij
>   Tested by:  delphij, Jens Schweikhardt 
>   MFC after:  5 days
>   X-MFC with: r285021

Differential Revision:  https://reviews.freebsd.org/D3281


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


svn commit: r286986 - in head/usr.sbin/pw: . tests

2015-08-21 Thread Baptiste Daroussin
Author: bapt
Date: Fri Aug 21 09:28:20 2015
New Revision: 286986
URL: https://svnweb.freebsd.org/changeset/base/286986

Log:
  Fix /home symlink creation
  
  Add regression test about it

Modified:
  head/usr.sbin/pw/pw_user.c
  head/usr.sbin/pw/tests/pw_useradd.sh

Modified: head/usr.sbin/pw/pw_user.c
==
--- head/usr.sbin/pw/pw_user.c  Fri Aug 21 08:17:44 2015(r286985)
+++ head/usr.sbin/pw/pw_user.c  Fri Aug 21 09:28:20 2015(r286986)
@@ -123,7 +123,7 @@ mkdir_home_parents(int dfd, const char *
errx(EX_UNAVAILABLE, "out of memory");
if (mkdirat(dfd, tmp, _DEF_DIRMODE) != -1 || errno == EEXIST) {
fchownat(dfd, tmp, 0, 0, 0);
-   symlinkat(tmp, dfd, dirs + 1);
+   symlinkat(tmp, dfd, dirs);
}
free(tmp);
}

Modified: head/usr.sbin/pw/tests/pw_useradd.sh
==
--- head/usr.sbin/pw/tests/pw_useradd.shFri Aug 21 08:17:44 2015
(r286985)
+++ head/usr.sbin/pw/tests/pw_useradd.shFri Aug 21 09:28:20 2015
(r286986)
@@ -246,6 +246,7 @@ user_add_R_body() {
 
atf_check -s exit:0 ${RPW} useradd foo
atf_check -s exit:0 ${RPW} useradd bar -m
+   test -d ${HOME}/home || atf_fail "Home parent directory not created"
test -d ${HOME}/home/bar || atf_fail "Directory not created"
atf_check -s exit:0 ${RPW} userdel bar
test -d ${HOME}/home/bar || atf_fail "Directory removed"
@@ -254,6 +255,17 @@ user_add_R_body() {
[ ! -d ${HOME}/home/bar ] || atf_fail "Directory not removed"
 }
 
+atf_test_case user_add_R_symlink
+user_add_R_symlink_body() {
+   populate_root_etc_skel
+
+   mkdir ${HOME}/usr
+   atf_check -s exit:0 ${RPW} useradd foo -m
+   test -d ${HOME}/usr/home || atf_fail "Home parent directory not created"
+   test -h ${HOME}/home || atf_fail "/home directory is not a symlink"
+   atf_check -s exit:0 -o inline:"usr/home\n" readlink ${HOME}/home
+}
+
 atf_test_case user_add_skel
 user_add_skel_body() {
populate_root_etc_skel
@@ -348,6 +360,7 @@ atf_init_test_cases() {
atf_add_test_case user_add_invalid_group_entry
atf_add_test_case user_add_password_from_h
atf_add_test_case user_add_R
+   atf_add_test_case user_add_R_symlink
atf_add_test_case user_add_skel
atf_add_test_case user_add_uid0
atf_add_test_case user_add_uid_too_large
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286991 - head/usr.sbin/pw/tests

2015-08-21 Thread Baptiste Daroussin
Author: bapt
Date: Fri Aug 21 11:25:42 2015
New Revision: 286991
URL: https://svnweb.freebsd.org/changeset/base/286991

Log:
  Fix typo in regression test

Modified:
  head/usr.sbin/pw/tests/pw_useradd.sh

Modified: head/usr.sbin/pw/tests/pw_useradd.sh
==
--- head/usr.sbin/pw/tests/pw_useradd.shFri Aug 21 10:49:12 2015
(r286990)
+++ head/usr.sbin/pw/tests/pw_useradd.shFri Aug 21 11:25:42 2015
(r286991)
@@ -271,7 +271,7 @@ user_add_skel_body() {
populate_root_etc_skel
 
mkdir ${HOME}/skel
-   echo "a" > ${HOME}/skel/.ae
+   echo "a" > ${HOME}/skel/.a
echo "b" > ${HOME}/skel/b
mkdir ${HOME}/skel/c
mkdir ${HOME}/skel/c/d
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286992 - head/usr.sbin/hyperv

2015-08-21 Thread Warner Losh
Author: imp
Date: Fri Aug 21 14:15:54 2015
New Revision: 286992
URL: https://svnweb.freebsd.org/changeset/base/286992

Log:
  Turn off gcc's uninitialized warnings for this code. They
  can be fixed, but really do appear to be false alarms.

Modified:
  head/usr.sbin/hyperv/Makefile.inc

Modified: head/usr.sbin/hyperv/Makefile.inc
==
--- head/usr.sbin/hyperv/Makefile.inc   Fri Aug 21 11:25:42 2015
(r286991)
+++ head/usr.sbin/hyperv/Makefile.inc   Fri Aug 21 14:15:54 2015
(r286992)
@@ -1,3 +1,4 @@
 # $FreeBSD$
 
+CFLAGS.gcc+= -Wno-uninitialized
 .include "../Makefile.inc"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286993 - in head/usr.sbin/pw: . tests

2015-08-21 Thread Baptiste Daroussin
Author: bapt
Date: Fri Aug 21 14:28:14 2015
New Revision: 286993
URL: https://svnweb.freebsd.org/changeset/base/286993

Log:
  Fix err pointer not initialized to NULL resulting
  
  Reported by:  "O. Hartmann" 

Modified:
  head/usr.sbin/pw/strtounum.c
  head/usr.sbin/pw/tests/pw_useradd.sh

Modified: head/usr.sbin/pw/strtounum.c
==
--- head/usr.sbin/pw/strtounum.cFri Aug 21 14:15:54 2015
(r286992)
+++ head/usr.sbin/pw/strtounum.cFri Aug 21 14:28:14 2015
(r286993)
@@ -41,6 +41,7 @@ strtounum(const char * __restrict np, ui
char *endp;
uintmax_t ret;
 
+   *errpp = NULL;
if (minval > maxval) {
errno = EINVAL;
if (errpp != NULL)

Modified: head/usr.sbin/pw/tests/pw_useradd.sh
==
--- head/usr.sbin/pw/tests/pw_useradd.shFri Aug 21 14:15:54 2015
(r286992)
+++ head/usr.sbin/pw/tests/pw_useradd.shFri Aug 21 14:28:14 2015
(r286993)
@@ -338,6 +338,20 @@ user_add_w_yes_body() {
grep "^foo" ${HOME}/master.passwd
 }
 
+atf_test_case user_add_with_pw_conf
+user_add_with_pw_conf_body()
+{
+   populate_etc_skel
+   atf_check -s exit:0 \
+   ${PW} useradd -D -C ${HOME}/pw.conf \
+   -u 2000,32767 -i 2000,32767
+   atf_check -s exit:0 \
+   -o inline:"minuid = 2000\nmaxuid = 32767\nmingid = 2000\nmaxgid 
= 32767\n" \
+   grep "^m.*id =" ${HOME}/pw.conf
+   atf_check -s exit:0 \
+   ${PW} useradd foo -C ${HOME}/pw.conf
+}
+
 atf_init_test_cases() {
atf_add_test_case user_add
atf_add_test_case user_add_noupdate
@@ -367,4 +381,5 @@ atf_init_test_cases() {
atf_add_test_case user_add_bad_shell
atf_add_test_case user_add_already_exists
atf_add_test_case user_add_w_yes
+   atf_add_test_case user_add_with_pw_conf
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286994 - head/sys/x86/acpica

2015-08-21 Thread Konstantin Belousov
Author: kib
Date: Fri Aug 21 15:13:25 2015
New Revision: 286994
URL: https://svnweb.freebsd.org/changeset/base/286994

Log:
  Automatically disable x2APIC mode on SandyBridge Lenovo machines.  I
  believe that the bug only affects mobile CPUs, at least I did not see
  other reports, but it is impossible to detect it in madt_setup_local().
  
  While there, reduce duplication in the information strings printed
  when x2APIC is auto-disabled, and do not print the line when user
  manually override the setting.
  
  Tested and reviewed by: royger (previous version)
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/x86/acpica/madt.c

Modified: head/sys/x86/acpica/madt.c
==
--- head/sys/x86/acpica/madt.c  Fri Aug 21 14:28:14 2015(r286993)
+++ head/sys/x86/acpica/madt.c  Fri Aug 21 15:13:25 2015(r286994)
@@ -132,20 +132,27 @@ madt_setup_local(void)
 {
ACPI_TABLE_DMAR *dmartbl;
vm_paddr_t dmartbl_physaddr;
+   const char *reason;
+   char *hw_vendor;
u_int p[4];
 
madt = pmap_mapbios(madt_physaddr, madt_length);
if ((cpu_feature2 & CPUID2_X2APIC) != 0) {
x2apic_mode = 1;
+   reason = NULL;
+
+   /*
+* Automatically detect several configurations where
+* x2APIC mode is known to cause troubles.  User can
+* override the setting with hw.x2apic_enable tunable.
+*/
dmartbl_physaddr = acpi_find_table(ACPI_SIG_DMAR);
if (dmartbl_physaddr != 0) {
dmartbl = acpi_map_table(dmartbl_physaddr,
ACPI_SIG_DMAR);
if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0) {
x2apic_mode = 0;
-   if (bootverbose)
-   printf(
-   "x2APIC available but disabled by DMAR table\n");
+   reason = "by DMAR table";
}
acpi_unmap_table(dmartbl);
}
@@ -154,14 +161,34 @@ madt_setup_local(void)
if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 ||
(p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) {
x2apic_mode = 0;
-   if (bootverbose)
-   printf(
-   "x2APIC available but disabled inside VMWare without intr 
redirection\n");
+   reason = "inside VMWare without intr redirection";
}
} else if (vm_guest == VM_GUEST_XEN) {
x2apic_mode = 0;
+   reason = "due to running under XEN";
+   } else if (vm_guest == VM_GUEST_NO) {
+   hw_vendor = kern_getenv("smbios.planar.maker");
+   /*
+* It seems that some Lenovo SandyBridge-based
+* notebook BIOSes have a bug which prevents
+* booting AP in x2APIC mode.  Since the only
+* way to detect mobile CPU is to check
+* northbridge pci id, which cannot be done
+* that early, disable x2APIC for all Lenovo
+* SandyBridge machines.
+*/
+   if (hw_vendor != NULL &&
+   !strcmp(hw_vendor, "LENOVO") &&
+   CPUID_TO_FAMILY(cpu_id) == 0x6 &&
+   CPUID_TO_MODEL(cpu_id) == 0x2a) {
+   x2apic_mode = 0;
+   reason = "for a suspected Lenovo SandyBridge BIOS bug";
+   }
+   freeenv(hw_vendor);
}
TUNABLE_INT_FETCH("hw.x2apic_enable", &x2apic_mode);
+   if (!x2apic_mode && reason != NULL && bootverbose)
+   printf("x2APIC available but disabled %s\n", reason);
}
 
lapic_init(madt->Address);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286995 - head/share/mk

2015-08-21 Thread Warner Losh
Author: imp
Date: Fri Aug 21 15:15:22 2015
New Revision: 286995
URL: https://svnweb.freebsd.org/changeset/base/286995

Log:
  Document bsd.progs.mk, including its status as being strongly
  discouraged and that it will be going away as soon as is practicable.

Modified:
  head/share/mk/bsd.README

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEFri Aug 21 15:13:25 2015(r286994)
+++ head/share/mk/bsd.READMEFri Aug 21 15:15:22 2015(r286995)
@@ -36,6 +36,7 @@ bsd.port.post.mk  - building ports
 bsd.port.pre.mk- building ports
 bsd.port.subdir.mk - targets for building subdirectories for ports
 bsd.prog.mk- building programs from source files
+bsd.progs.mk   - build multiple programs from sources (depreciated)
 bsd.snmpmod.mk - building modules for the SNMP daemon bsnmpd
 bsd.subdir.mk  - targets for building subdirectories
 bsd.sys.mk - common settings used for building FreeBSD sources
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286997 - head/sys/dev/vt

2015-08-21 Thread Conrad E. Meyer
Author: cem
Date: Fri Aug 21 15:21:56 2015
New Revision: 286997
URL: https://svnweb.freebsd.org/changeset/base/286997

Log:
  vt_cpulogos: Resize all terms/windows when tearing down logos
  
  PR:   202288 (partial)
  Tested by:Jakob Alvermark
  Reviewed by:  ed
  Approved by:  markj (mentor)
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D3388

Modified:
  head/sys/dev/vt/vt.h
  head/sys/dev/vt/vt_core.c
  head/sys/dev/vt/vt_cpulogos.c

Modified: head/sys/dev/vt/vt.h
==
--- head/sys/dev/vt/vt.hFri Aug 21 15:20:01 2015(r286996)
+++ head/sys/dev/vt/vt.hFri Aug 21 15:21:56 2015(r286997)
@@ -369,6 +369,7 @@ struct vt_driver {
  * Utility macro to make early vt(4) instances work.
  */
 
+extern struct vt_device vt_consdev;
 extern struct terminal vt_consterm;
 extern const struct terminal_class vt_termclass;
 void vt_upgrade(struct vt_device *vd);

Modified: head/sys/dev/vt/vt_core.c
==
--- head/sys/dev/vt/vt_core.c   Fri Aug 21 15:20:01 2015(r286996)
+++ head/sys/dev/vt/vt_core.c   Fri Aug 21 15:21:56 2015(r286997)
@@ -144,7 +144,6 @@ VT_SYSCTL_INT(splash_cpu_style, 2, "Draw
 "(0 = Alternate beastie, 1 = Beastie, 2 = Orb)");
 VT_SYSCTL_INT(splash_cpu_duration, 10, "Hide logos after (seconds)");
 
-static struct vt_devicevt_consdev;
 static unsigned int vt_unit = 0;
 static MALLOC_DEFINE(M_VT, "vt", "vt device");
 struct vt_device *main_vd = &vt_consdev;
@@ -187,7 +186,7 @@ SET_DECLARE(vt_drv_set, struct vt_driver
 
 struct terminalvt_consterm;
 static struct vt_windowvt_conswindow;
-static struct vt_devicevt_consdev = {
+struct vt_device   vt_consdev = {
.vd_driver = NULL,
.vd_softc = NULL,
.vd_prev_driver = NULL,

Modified: head/sys/dev/vt/vt_cpulogos.c
==
--- head/sys/dev/vt/vt_cpulogos.c   Fri Aug 21 15:20:01 2015
(r286996)
+++ head/sys/dev/vt/vt_cpulogos.c   Fri Aug 21 15:21:56 2015
(r286997)
@@ -152,6 +152,7 @@ vt_fini_logos(void *dummy __unused)
struct vt_font *vf;
struct winsize wsz;
term_pos_t size;
+   unsigned int i;
 
if (!vt_draw_logo_cpus)
return;
@@ -160,44 +161,43 @@ vt_fini_logos(void *dummy __unused)
if (!vt_splash_cpu)
return;
 
-   tm = &vt_consterm;
-   vw = tm->tm_softc;
-   if (vw == NULL)
-   return;
-   vd = vw->vw_device;
-   if (vd == NULL)
-   return;
-   vf = vw->vw_font;
-   if (vf == NULL)
-   return;
-
+   vd = &vt_consdev;
VT_LOCK(vd);
-   if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0)
-   goto out;
-
+   if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0) {
+   VT_UNLOCK(vd);
+   return;
+   }
vt_draw_logo_cpus = 0;
VT_UNLOCK(vd);
 
-   vt_termsize(vd, vf, &size);
-   vt_winsize(vd, vf, &wsz);
-
-   /* Resize screen buffer and terminal. */
-   terminal_mute(tm, 1);
-   vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size);
-   terminal_set_winsize_blank(tm, &wsz, 0, NULL);
-   terminal_set_cursor(tm, &vw->vw_buf.vb_cursor);
-   terminal_mute(tm, 0);
-
-   VT_LOCK(vd);
-   vt_compute_drawable_area(vw);
-
-   if (vd->vd_curwindow == vw) {
-   vd->vd_flags |= VDF_INVALID;
-   vt_resume_flush_timer(vd, 0);
+   for (i = 0; i < VT_MAXWINDOWS; i++) {
+   vw = vd->vd_windows[i];
+   if (vw == NULL)
+   continue;
+   tm = vw->vw_terminal;
+   vf = vw->vw_font;
+   if (vf == NULL)
+   continue;
+
+   vt_termsize(vd, vf, &size);
+   vt_winsize(vd, vf, &wsz);
+
+   /* Resize screen buffer and terminal. */
+   terminal_mute(tm, 1);
+   vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size);
+   terminal_set_winsize_blank(tm, &wsz, 0, NULL);
+   terminal_set_cursor(tm, &vw->vw_buf.vb_cursor);
+   terminal_mute(tm, 0);
+
+   VT_LOCK(vd);
+   vt_compute_drawable_area(vw);
+
+   if (vd->vd_curwindow == vw) {
+   vd->vd_flags |= VDF_INVALID;
+   vt_resume_flush_timer(vd, 0);
+   }
+   VT_UNLOCK(vd);
}
-
-out:
-   VT_UNLOCK(vd);
 }
 
 static void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r286994 - head/sys/x86/acpica

2015-08-21 Thread Adrian Chadd
Think we could do the same for the Asus zenbooks?


-a


On 21 August 2015 at 08:13, Konstantin Belousov  wrote:
> Author: kib
> Date: Fri Aug 21 15:13:25 2015
> New Revision: 286994
> URL: https://svnweb.freebsd.org/changeset/base/286994
>
> Log:
>   Automatically disable x2APIC mode on SandyBridge Lenovo machines.  I
>   believe that the bug only affects mobile CPUs, at least I did not see
>   other reports, but it is impossible to detect it in madt_setup_local().
>
>   While there, reduce duplication in the information strings printed
>   when x2APIC is auto-disabled, and do not print the line when user
>   manually override the setting.
>
>   Tested and reviewed by: royger (previous version)
>   Sponsored by: The FreeBSD Foundation
>
> Modified:
>   head/sys/x86/acpica/madt.c
>
> Modified: head/sys/x86/acpica/madt.c
> ==
> --- head/sys/x86/acpica/madt.c  Fri Aug 21 14:28:14 2015(r286993)
> +++ head/sys/x86/acpica/madt.c  Fri Aug 21 15:13:25 2015(r286994)
> @@ -132,20 +132,27 @@ madt_setup_local(void)
>  {
> ACPI_TABLE_DMAR *dmartbl;
> vm_paddr_t dmartbl_physaddr;
> +   const char *reason;
> +   char *hw_vendor;
> u_int p[4];
>
> madt = pmap_mapbios(madt_physaddr, madt_length);
> if ((cpu_feature2 & CPUID2_X2APIC) != 0) {
> x2apic_mode = 1;
> +   reason = NULL;
> +
> +   /*
> +* Automatically detect several configurations where
> +* x2APIC mode is known to cause troubles.  User can
> +* override the setting with hw.x2apic_enable tunable.
> +*/
> dmartbl_physaddr = acpi_find_table(ACPI_SIG_DMAR);
> if (dmartbl_physaddr != 0) {
> dmartbl = acpi_map_table(dmartbl_physaddr,
> ACPI_SIG_DMAR);
> if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0) 
> {
> x2apic_mode = 0;
> -   if (bootverbose)
> -   printf(
> -   "x2APIC available but disabled by DMAR table\n");
> +   reason = "by DMAR table";
> }
> acpi_unmap_table(dmartbl);
> }
> @@ -154,14 +161,34 @@ madt_setup_local(void)
> if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 ||
> (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) {
> x2apic_mode = 0;
> -   if (bootverbose)
> -   printf(
> -   "x2APIC available but disabled inside VMWare without intr 
> redirection\n");
> +   reason = "inside VMWare without intr redirection";
> }
> } else if (vm_guest == VM_GUEST_XEN) {
> x2apic_mode = 0;
> +   reason = "due to running under XEN";
> +   } else if (vm_guest == VM_GUEST_NO) {
> +   hw_vendor = kern_getenv("smbios.planar.maker");
> +   /*
> +* It seems that some Lenovo SandyBridge-based
> +* notebook BIOSes have a bug which prevents
> +* booting AP in x2APIC mode.  Since the only
> +* way to detect mobile CPU is to check
> +* northbridge pci id, which cannot be done
> +* that early, disable x2APIC for all Lenovo
> +* SandyBridge machines.
> +*/
> +   if (hw_vendor != NULL &&
> +   !strcmp(hw_vendor, "LENOVO") &&
> +   CPUID_TO_FAMILY(cpu_id) == 0x6 &&
> +   CPUID_TO_MODEL(cpu_id) == 0x2a) {
> +   x2apic_mode = 0;
> +   reason = "for a suspected Lenovo SandyBridge BIOS bug";
> +   }
> +   freeenv(hw_vendor);
> }
> TUNABLE_INT_FETCH("hw.x2apic_enable", &x2apic_mode);
> +   if (!x2apic_mode && reason != NULL && bootverbose)
> +   printf("x2APIC available but disabled %s\n", reason);
> }
>
> lapic_init(madt->Address);
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286998 - head/share/mk

2015-08-21 Thread Baptiste Daroussin
Author: bapt
Date: Fri Aug 21 15:30:50 2015
New Revision: 286998
URL: https://svnweb.freebsd.org/changeset/base/286998

Log:
  Mark bsd.info.mk as depreciated

Modified:
  head/share/mk/bsd.README

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEFri Aug 21 15:21:56 2015(r286997)
+++ head/share/mk/bsd.READMEFri Aug 21 15:30:50 2015(r286998)
@@ -21,7 +21,7 @@ bsd.dep.mk- handle Makefile dependenci
 bsd.doc.mk - building troff system documents
 bsd.files.mk   - install of general purpose files
 bsd.incs.mk- install of include files
-bsd.info.mk- building GNU Info hypertext system
+bsd.info.mk- building GNU Info hypertext system (depreciated)
 bsd.init.mk- initialization for the make include files
 bsd.kmod.mk- building loadable kernel modules
 bsd.lib.mk - support for building libraries
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r286999 - in head/sys: dev/xen/blkfront dev/xen/netfront x86/xen xen

2015-08-21 Thread Roger Pau Monné
Author: royger
Date: Fri Aug 21 15:53:08 2015
New Revision: 286999
URL: https://svnweb.freebsd.org/changeset/base/286999

Log:
  xen: allow disabling PV disks and nics
  
  Introduce two new loader tunnables that can be used to disable PV disks and
  PV nics at boot time. They default to 0 and should be set to 1 (or any
  number different than 0) in order to disable the PV devices:
  
  hw.xen.disable_pv_disks=1
  hw.xen.disable_pv_nics=1
  
  In /boot/loader.conf will disable both PV disks and nics.
  
  Sponsored by: Citrix Systems R&D
  Tested by:Karl Pielorz 
  MFC after:1 week

Modified:
  head/sys/dev/xen/blkfront/blkfront.c
  head/sys/dev/xen/netfront/netfront.c
  head/sys/x86/xen/hvm.c
  head/sys/xen/xen-os.h

Modified: head/sys/dev/xen/blkfront/blkfront.c
==
--- head/sys/dev/xen/blkfront/blkfront.cFri Aug 21 15:30:50 2015
(r286998)
+++ head/sys/dev/xen/blkfront/blkfront.cFri Aug 21 15:53:08 2015
(r286999)
@@ -1366,6 +1366,9 @@ xbd_probe(device_t dev)
if (strcmp(xenbus_get_type(dev), "vbd") != 0)
return (ENXIO);
 
+   if (xen_hvm_domain() && xen_disable_pv_disks != 0)
+   return (ENXIO);
+
if (xen_hvm_domain()) {
int error;
char *type;

Modified: head/sys/dev/xen/netfront/netfront.c
==
--- head/sys/dev/xen/netfront/netfront.cFri Aug 21 15:30:50 2015
(r286998)
+++ head/sys/dev/xen/netfront/netfront.cFri Aug 21 15:53:08 2015
(r286999)
@@ -445,6 +445,9 @@ static int 
 netfront_probe(device_t dev)
 {
 
+   if (xen_hvm_domain() && xen_disable_pv_nics != 0)
+   return (ENXIO);
+
if (!strcmp(xenbus_get_type(dev), "vif")) {
device_set_desc(dev, "Virtual Network Interface");
return (0);

Modified: head/sys/x86/xen/hvm.c
==
--- head/sys/x86/xen/hvm.c  Fri Aug 21 15:30:50 2015(r286998)
+++ head/sys/x86/xen/hvm.c  Fri Aug 21 15:53:08 2015(r286999)
@@ -100,8 +100,15 @@ DPCPU_DEFINE(struct vcpu_info *, vcpu_in
 shared_info_t *HYPERVISOR_shared_info;
 start_info_t *HYPERVISOR_start_info;
 
+
+/*-- Sysctl tunables 
-*/
+int xen_disable_pv_disks = 0;
+int xen_disable_pv_nics = 0;
+TUNABLE_INT("hw.xen.disable_pv_disks", &xen_disable_pv_disks);
+TUNABLE_INT("hw.xen.disable_pv_nics", &xen_disable_pv_nics);
+
 #ifdef SMP
-/* XEN diverged cpu operations */
+/*-- XEN diverged cpu operations 
-*/
 static void
 xen_hvm_cpu_resume(void)
 {
@@ -256,21 +263,34 @@ enum {
 static void
 xen_hvm_disable_emulated_devices(void)
 {
+   u_short disable_devs = 0;
 
if (xen_pv_domain()) {
/*
 * No emulated devices in the PV case, so no need to unplug
 * anything.
 */
+   if (xen_disable_pv_disks != 0 || xen_disable_pv_nics != 0)
+   printf("PV devices cannot be disabled in PV guests\n");
return;
}
 
if (inw(XEN_MAGIC_IOPORT) != XMI_MAGIC)
return;
 
-   if (bootverbose)
-   printf("XEN: Disabling emulated block and network devices\n");
-   outw(XEN_MAGIC_IOPORT, XMI_UNPLUG_IDE_DISKS|XMI_UNPLUG_NICS);
+   if (xen_disable_pv_disks == 0) {
+   if (bootverbose)
+   printf("XEN: disabling emulated disks\n");
+   disable_devs |= XMI_UNPLUG_IDE_DISKS;
+   }
+   if (xen_disable_pv_nics == 0) {
+   if (bootverbose)
+   printf("XEN: disabling emulated nics\n");
+   disable_devs |= XMI_UNPLUG_NICS;
+   }
+
+   if (disable_devs != 0)
+   outw(XEN_MAGIC_IOPORT, disable_devs);
 }
 
 static void

Modified: head/sys/xen/xen-os.h
==
--- head/sys/xen/xen-os.h   Fri Aug 21 15:30:50 2015(r286998)
+++ head/sys/xen/xen-os.h   Fri Aug 21 15:53:08 2015(r286999)
@@ -56,6 +56,9 @@ extern start_info_t *HYPERVISOR_start_in
 /* XXX: we need to get rid of this and use HYPERVISOR_start_info directly */
 extern char *console_page;
 
+extern int xen_disable_pv_disks;
+extern int xen_disable_pv_nics;
+
 enum xen_domain_type {
XEN_NATIVE, /* running on bare hardware*/
XEN_PV_DOMAIN,  /* running in a PV domain  */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287000 - in head/sys: amd64/amd64 arm/arm i386/i386 kern mips/beri x86/x86

2015-08-21 Thread Roger Pau Monné
Author: royger
Date: Fri Aug 21 15:57:57 2015
New Revision: 287000
URL: https://svnweb.freebsd.org/changeset/base/287000

Log:
  preload_search_info: make sure mod is set
  
  Add a check to preload_search_info to make sure mod is set. Most of the
  callers of preload_search_info don't check that the mod parameter is
  set, which can cause page faults. While at it, remove some now unnecessary
  checks before calling preload_search_info.
  
  Sponsored by: Citrix Systems R&D
  Reviewed by:  kib
  Differential Revision:https://reviews.freebsd.org/D3440

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/arm/arm/machdep.c
  head/sys/i386/i386/machdep.c
  head/sys/kern/link_elf.c
  head/sys/kern/subr_module.c
  head/sys/mips/beri/beri_machdep.c
  head/sys/x86/x86/fdt_machdep.c
  head/sys/x86/x86/nexus.c

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Fri Aug 21 15:53:08 2015
(r286999)
+++ head/sys/amd64/amd64/machdep.c  Fri Aug 21 15:57:57 2015
(r287000)
@@ -1621,8 +1621,8 @@ hammer_time(u_int64_t modulep, u_int64_t
 * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4)
 * transition).
 */
-   if (kmdp != NULL && preload_search_info(kmdp,
-   MODINFO_METADATA | MODINFOMD_EFI_MAP) != NULL)
+   if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP)
+   != NULL)
vty_set_preferred(VTY_VT);
 
identify_cpu(); /* Final stage of CPU initialization */

Modified: head/sys/arm/arm/machdep.c
==
--- head/sys/arm/arm/machdep.c  Fri Aug 21 15:53:08 2015(r286999)
+++ head/sys/arm/arm/machdep.c  Fri Aug 21 15:57:57 2015(r287000)
@@ -1534,10 +1534,7 @@ initarm(struct arm_boot_params *abp)
 * Find the dtb passed in by the boot loader.
 */
kmdp = preload_search_by_type("elf kernel");
-   if (kmdp != NULL)
-   dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t);
-   else
-   dtbp = (vm_offset_t)NULL;
+   dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t);
 #if defined(FDT_DTB_STATIC)
/*
 * In case the device tree blob was not retrieved (from metadata) try

Modified: head/sys/i386/i386/machdep.c
==
--- head/sys/i386/i386/machdep.cFri Aug 21 15:53:08 2015
(r286999)
+++ head/sys/i386/i386/machdep.cFri Aug 21 15:57:57 2015
(r287000)
@@ -2097,9 +2097,8 @@ getmemsize(int first)
kmdp = preload_search_by_type("elf kernel");
if (kmdp == NULL)
kmdp = preload_search_by_type("elf32 kernel");
-   if (kmdp != NULL)
-   smapbase = (struct bios_smap *)preload_search_info(kmdp,
-   MODINFO_METADATA | MODINFOMD_SMAP);
+   smapbase = (struct bios_smap *)preload_search_info(kmdp,
+   MODINFO_METADATA | MODINFOMD_SMAP);
if (smapbase != NULL) {
add_smap_entries(smapbase, physmap, &physmap_idx);
has_smap = 1;
@@ -2778,8 +2777,6 @@ smap_sysctl_handler(SYSCTL_HANDLER_ARGS)
kmdp = preload_search_by_type("elf kernel");
if (kmdp == NULL)
kmdp = preload_search_by_type("elf32 kernel");
-   if (kmdp == NULL)
-   return (0);
smapbase = (struct bios_smap *)preload_search_info(kmdp,
MODINFO_METADATA | MODINFOMD_SMAP);
if (smapbase == NULL)

Modified: head/sys/kern/link_elf.c
==
--- head/sys/kern/link_elf.cFri Aug 21 15:53:08 2015(r286999)
+++ head/sys/kern/link_elf.cFri Aug 21 15:57:57 2015(r287000)
@@ -400,8 +400,7 @@ link_elf_init(void* arg)
modptr = preload_search_by_type("elf" __XSTRING(__ELF_WORD_SIZE) " 
kernel");
if (modptr == NULL)
modptr = preload_search_by_type("elf kernel");
-   if (modptr != NULL)
-   modname = (char *)preload_search_info(modptr, MODINFO_NAME);
+   modname = (char *)preload_search_info(modptr, MODINFO_NAME);
if (modname == NULL)
modname = "kernel";
linker_kernel_file = linker_make_file(modname, &link_elf_class);

Modified: head/sys/kern/subr_module.c
==
--- head/sys/kern/subr_module.c Fri Aug 21 15:53:08 2015(r286999)
+++ head/sys/kern/subr_module.c Fri Aug 21 15:57:57 2015(r287000)
@@ -160,6 +160,9 @@ preload_search_info(caddr_t mod, int inf
 uint32_t   type = 0;
 intnext;
 
+if (mod == NULL)
+   return (NULL);
+
 curp = mod;
 for (;;) {
hdr = (uint32_t *)curp;

Modified: head/sys/mips/beri/beri_machdep.

svn commit: r287001 - head/share/mk

2015-08-21 Thread Warner Losh
Author: imp
Date: Fri Aug 21 16:05:56 2015
New Revision: 287001
URL: https://svnweb.freebsd.org/changeset/base/287001

Log:
  Document bsd.arch.inc.mk.

Modified:
  head/share/mk/bsd.README

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEFri Aug 21 15:57:57 2015(r287000)
+++ head/share/mk/bsd.READMEFri Aug 21 16:05:56 2015(r287001)
@@ -16,6 +16,7 @@ can not/should not be used directly but 
 files.  In most cases it is only interesting to include bsd.prog.mk or
 bsd.lib.mk.
 
+bsd.arch.inc.mk- includes arch-specific Makefile.$arch
 bsd.cpu.mk - sets CPU/arch-related variables
 bsd.dep.mk - handle Makefile dependencies
 bsd.doc.mk - building troff system documents
@@ -118,6 +119,13 @@ environment or otherwise.  You probably 
 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+The include file  includes other Makefiles for specific
+architectures, if they exist. It will include the first of the following
+files that it finds: Makefile.${MACHINE}, Makefile.${MACHINE_ARCH},
+Makefile.${MACHINE_CPUARCH}
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
 The include file  handles installing manual pages and their
 links.
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r286984 - head/sys/modules/zfs

2015-08-21 Thread Mark R V Murray

> On 21 Aug 2015, at 09:20, Andriy Gapon  wrote:
> 
> 
> Precisely because it's the standalone build (cd sys/modules/zfs && make
> ...) that was affected.  Building the module as a part of the kernel
> build worked just fine.

That makes sense. Now I need a regression test to ensure at this problem
is not elsewhere and doesn’t return.

Where do folks put these? I don’t mind writing one.

M
-- 
Mark R V Murray

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

svn commit: r287002 - head/sys/vm

2015-08-21 Thread Alan Cox
Author: alc
Date: Fri Aug 21 17:00:39 2015
New Revision: 287002
URL: https://svnweb.freebsd.org/changeset/base/287002

Log:
  Eliminate pointless assignments to rtvals[] in swap_pager_putpages().
  
  Reviewed by:  kib
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cFri Aug 21 16:05:56 2015(r287001)
+++ head/sys/vm/swap_pager.cFri Aug 21 17:00:39 2015(r287002)
@@ -1404,8 +1404,6 @@ swap_pager_putpages(vm_object_t object, 
blk + j
);
vm_page_dirty(mreq);
-   rtvals[i+j] = VM_PAGER_OK;
-
mreq->oflags |= VPO_SWAPINPROG;
bp->b_pages[j] = mreq;
}
@@ -1421,6 +1419,16 @@ swap_pager_putpages(vm_object_t object, 
PCPU_ADD(cnt.v_swappgsout, bp->b_npages);
 
/*
+* We unconditionally set rtvals[] to VM_PAGER_PEND so that we
+* can call the async completion routine at the end of a
+* synchronous I/O operation.  Otherwise, our caller would
+* perform duplicate unbusy and wakeup operations on the page
+* and object, respectively.
+*/
+   for (j = 0; j < n; j++)
+   rtvals[i + j] = VM_PAGER_PEND;
+
+   /*
 * asynchronous
 *
 * NOTE: b_blkno is destroyed by the call to swapdev_strategy
@@ -1429,10 +1437,6 @@ swap_pager_putpages(vm_object_t object, 
bp->b_iodone = swp_pager_async_iodone;
BUF_KERNPROC(bp);
swp_pager_strategy(bp);
-
-   for (j = 0; j < n; ++j)
-   rtvals[i+j] = VM_PAGER_PEND;
-   /* restart outter loop */
continue;
}
 
@@ -1445,14 +1449,10 @@ swap_pager_putpages(vm_object_t object, 
swp_pager_strategy(bp);
 
/*
-* Wait for the sync I/O to complete, then update rtvals.
-* We just set the rtvals[] to VM_PAGER_PEND so we can call
-* our async completion routine at the end, thus avoiding a
-* double-free.
+* Wait for the sync I/O to complete.
 */
bwait(bp, PVM, "swwrt");
-   for (j = 0; j < n; ++j)
-   rtvals[i+j] = VM_PAGER_PEND;
+
/*
 * Now that we are through with the bp, we can call the
 * normal async completion, which frees everything up.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287003 - head/share/mk

2015-08-21 Thread Garrett Cooper
Author: ngie
Date: Fri Aug 21 17:45:18 2015
New Revision: 287003
URL: https://svnweb.freebsd.org/changeset/base/287003

Log:
  Fix typos (depreciated -> deprecated)

Modified:
  head/share/mk/bsd.README

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEFri Aug 21 17:00:39 2015(r287002)
+++ head/share/mk/bsd.READMEFri Aug 21 17:45:18 2015(r287003)
@@ -22,7 +22,7 @@ bsd.dep.mk- handle Makefile dependenci
 bsd.doc.mk - building troff system documents
 bsd.files.mk   - install of general purpose files
 bsd.incs.mk- install of include files
-bsd.info.mk- building GNU Info hypertext system (depreciated)
+bsd.info.mk- building GNU Info hypertext system (deprecated)
 bsd.init.mk- initialization for the make include files
 bsd.kmod.mk- building loadable kernel modules
 bsd.lib.mk - support for building libraries
@@ -37,7 +37,7 @@ bsd.port.post.mk  - building ports
 bsd.port.pre.mk- building ports
 bsd.port.subdir.mk - targets for building subdirectories for ports
 bsd.prog.mk- building programs from source files
-bsd.progs.mk   - build multiple programs from sources (depreciated)
+bsd.progs.mk   - build multiple programs from sources (deprecated)
 bsd.snmpmod.mk - building modules for the SNMP daemon bsnmpd
 bsd.subdir.mk  - targets for building subdirectories
 bsd.sys.mk - common settings used for building FreeBSD sources
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287004 - head/usr.bin/xargs/tests

2015-08-21 Thread Garrett Cooper
Author: ngie
Date: Fri Aug 21 17:47:17 2015
New Revision: 287004
URL: https://svnweb.freebsd.org/changeset/base/287004

Log:
  Disable the -P0 test
  
  It's unreliable (sometimes it passes, sometimes it fails)
  
  Reported by: Jenkins (many times over the past few weeks)

Modified:
  head/usr.bin/xargs/tests/regress.sh

Modified: head/usr.bin/xargs/tests/regress.sh
==
--- head/usr.bin/xargs/tests/regress.sh Fri Aug 21 17:45:18 2015
(r287003)
+++ head/usr.bin/xargs/tests/regress.sh Fri Aug 21 17:47:17 2015
(r287004)
@@ -12,7 +12,7 @@ REGRESSION_TEST(`P1', `xargs -P1 echo <$
 REGRESSION_TEST(`R', `xargs -I% -R1 echo The % % % %% % % 
<${SRCDIR}/regress.in')
 REGRESSION_TEST(`n1', `xargs -n1 echo <${SRCDIR}/regress.in')
 REGRESSION_TEST(`n2', `xargs -n2 echo <${SRCDIR}/regress.in')
-REGRESSION_TEST(`n2P0',`xargs -n2 -P0 echo <${SRCDIR}/regress.in')
+#REGRESSION_TEST(`n2P0',`xargs -n2 -P0 echo <${SRCDIR}/regress.in')
 REGRESSION_TEST(`n3', `xargs -n3 echo <${SRCDIR}/regress.in')
 REGRESSION_TEST(`0', `xargs -0 -n1 echo <${SRCDIR}/regress.0.in')
 REGRESSION_TEST(`0I', `xargs -0 -I% echo The % %% % <${SRCDIR}/regress.0.in')
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287004 - head/usr.bin/xargs/tests

2015-08-21 Thread Garrett Cooper

> On Aug 21, 2015, at 10:47, Garrett Cooper  wrote:
> 
> Author: ngie
> Date: Fri Aug 21 17:47:17 2015
> New Revision: 287004
> URL: https://svnweb.freebsd.org/changeset/base/287004
> 
> Log:
>  Disable the -P0 test
> 
>  It's unreliable (sometimes it passes, sometimes it fails)
> 
>  Reported by: Jenkins (many times over the past few weeks)

I’ll work on fixing this by converting these tests over to ATF. I just wanted 
to stop the Jenkins failure<->pass emails from spamming current@
Thanks,
-NGie
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r287005 - head/usr.bin/xargs/tests

2015-08-21 Thread Garrett Cooper
Author: ngie
Date: Fri Aug 21 18:42:57 2015
New Revision: 287005
URL: https://svnweb.freebsd.org/changeset/base/287005

Log:
  Fix the racy xargs -P0 -n2 test added in r286289
  
  Sort the output obtained from xargs and the expected output
  to ensure the end result versus the input file is stable
  
  Differential Revision: D3432
  Submitted by: Nikolai Lifanov 

Modified:
  head/usr.bin/xargs/tests/regress.n2P0.out
  head/usr.bin/xargs/tests/regress.sh

Modified: head/usr.bin/xargs/tests/regress.n2P0.out
==
--- head/usr.bin/xargs/tests/regress.n2P0.out   Fri Aug 21 17:47:17 2015
(r287004)
+++ head/usr.bin/xargs/tests/regress.n2P0.out   Fri Aug 21 18:42:57 2015
(r287005)
@@ -1,4 +1,4 @@
-quick brown
 fox jumped
-over the
 lazy dog
+over the
+quick brown

Modified: head/usr.bin/xargs/tests/regress.sh
==
--- head/usr.bin/xargs/tests/regress.sh Fri Aug 21 17:47:17 2015
(r287004)
+++ head/usr.bin/xargs/tests/regress.sh Fri Aug 21 18:42:57 2015
(r287005)
@@ -12,7 +12,7 @@ REGRESSION_TEST(`P1', `xargs -P1 echo <$
 REGRESSION_TEST(`R', `xargs -I% -R1 echo The % % % %% % % 
<${SRCDIR}/regress.in')
 REGRESSION_TEST(`n1', `xargs -n1 echo <${SRCDIR}/regress.in')
 REGRESSION_TEST(`n2', `xargs -n2 echo <${SRCDIR}/regress.in')
-#REGRESSION_TEST(`n2P0',`xargs -n2 -P0 echo <${SRCDIR}/regress.in')
+REGRESSION_TEST(`n2P0',`xargs -n2 -P0 echo <${SRCDIR}/regress.in | sort')
 REGRESSION_TEST(`n3', `xargs -n3 echo <${SRCDIR}/regress.in')
 REGRESSION_TEST(`0', `xargs -0 -n1 echo <${SRCDIR}/regress.0.in')
 REGRESSION_TEST(`0I', `xargs -0 -I% echo The % %% % <${SRCDIR}/regress.0.in')
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287007 - head/share/mk

2015-08-21 Thread Warner Losh
Author: imp
Date: Fri Aug 21 19:51:27 2015
New Revision: 287007
URL: https://svnweb.freebsd.org/changeset/base/287007

Log:
  Document bsd.compiler.mk and the variables it defines.

Modified:
  head/share/mk/bsd.README

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEFri Aug 21 19:51:19 2015(r287006)
+++ head/share/mk/bsd.READMEFri Aug 21 19:51:27 2015(r287007)
@@ -17,6 +17,7 @@ files.  In most cases it is only interes
 bsd.lib.mk.
 
 bsd.arch.inc.mk- includes arch-specific Makefile.$arch
+bsd.compiler.mk- defined based on current compiler
 bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk)
 bsd.dep.mk - handle Makefile dependencies
 bsd.doc.mk - building troff system documents
@@ -116,9 +117,29 @@ object.
 
 The following variables are common:
 
+CFLAGS.${COMPILER_TYPE}
+   Flags dependent on compiler added to CXXFLAGS.
+CFLAGS.${MACHINE_ARCH}
+   Architectural flags added to CFLAGS.
 CFLAGS_NO_SIMD Add this to CFLAGS for programs that don't want any SIMD
instructions generated. It is setup in bsd.cpu.mk to an
appropriate value for the compiler and target.
+CXXFLAGS.${COMPILER_TYPE}
+   Flags dependent on compiler added to CXXFLAGS.
+CXXFLAGS.${MACHINE_ARCH}
+   Architectural flags added to CXXFLAGS.
+COMPILER_FEATURES
+   A list of features that the compiler supports. Zero or
+   more of:
+   c++11   Supports full C++ 11 standard.
+
+COMPILER_TYPE  Type of compiler, either clang or gcc, though other
+   values are possible. Don't assume != clang == gcc.
+
+COMPILER_VERSION
+   A numeric constant equal to:
+major * 1 + minor * 100 + tiny
+   for the compiler's self-reported version.
 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287006 - head/share/mk

2015-08-21 Thread Warner Losh
Author: imp
Date: Fri Aug 21 19:51:19 2015
New Revision: 287006
URL: https://svnweb.freebsd.org/changeset/base/287006

Log:
  Document CFLAGS_NO_SIMD.

Modified:
  head/share/mk/bsd.README

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEFri Aug 21 18:42:57 2015(r287005)
+++ head/share/mk/bsd.READMEFri Aug 21 19:51:19 2015(r287006)
@@ -17,7 +17,7 @@ files.  In most cases it is only interes
 bsd.lib.mk.
 
 bsd.arch.inc.mk- includes arch-specific Makefile.$arch
-bsd.cpu.mk - sets CPU/arch-related variables
+bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk)
 bsd.dep.mk - handle Makefile dependencies
 bsd.doc.mk - building troff system documents
 bsd.files.mk   - install of general purpose files
@@ -114,6 +114,14 @@ object.
 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+The following variables are common:
+
+CFLAGS_NO_SIMD Add this to CFLAGS for programs that don't want any SIMD
+   instructions generated. It is setup in bsd.cpu.mk to an
+   appropriate value for the compiler and target.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
 The include file  has the default rules for all makes, in the BSD
 environment or otherwise.  You probably don't want to touch this file.
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r287007 - head/share/mk

2015-08-21 Thread Dimitry Andric
On 21 Aug 2015, at 21:51, Warner Losh  wrote:
> 
> Author: imp
> Date: Fri Aug 21 19:51:27 2015
> New Revision: 287007
> URL: https://svnweb.freebsd.org/changeset/base/287007
> 
> Log:
>  Document bsd.compiler.mk and the variables it defines.

Thanks!!



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r287008 - head/sys/dev/pccbb

2015-08-21 Thread Warner Losh
Author: imp
Date: Fri Aug 21 21:47:29 2015
New Revision: 287008
URL: https://svnweb.freebsd.org/changeset/base/287008

Log:
  We're waiting on a struct proc *, not a struct thread *. Fix a
  comment that was wrong.

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

Modified: head/sys/dev/pccbb/pccbb.c
==
--- head/sys/dev/pccbb/pccbb.c  Fri Aug 21 19:51:27 2015(r287007)
+++ head/sys/dev/pccbb/pccbb.c  Fri Aug 21 21:47:29 2015(r287008)
@@ -330,7 +330,7 @@ cbb_detach(device_t brdev)
 
/*
 * Wait for the thread to die.  kproc_exit will do a wakeup
-* on the event thread's struct thread * so that we know it is
+* on the event thread's struct proc * so that we know it is
 * safe to proceed.  IF the thread is running, set the please
 * die flag and wait for it to comply.  Since the wakeup on
 * the event thread happens only in kproc_exit, we don't
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287009 - in head: sbin/pfctl share/man/man4 sys/conf sys/net/altq sys/netpfil/pf

2015-08-21 Thread Luiz Otavio O Souza
Author: loos
Date: Fri Aug 21 22:02:22 2015
New Revision: 287009
URL: https://svnweb.freebsd.org/changeset/base/287009

Log:
  Add ALTQ(9) support for the CoDel algorithm.
  
  CoDel is a parameterless queue discipline that handles variable bandwidth
  and RTT.
  
  It can be used as the single queue discipline on an interface or as a sub
  discipline of existing queue disciplines such as PRIQ, CBQ, HFSC, FAIRQ.
  
  Differential Revision:https://reviews.freebsd.org/D3272
  Reviewd by:   rpaulo, gnn (previous version)
  Obtained from:pfSense
  Sponsored by: Rubicon Communications (Netgate)

Added:
  head/sys/net/altq/altq_codel.c   (contents, props changed)
  head/sys/net/altq/altq_codel.h   (contents, props changed)
Modified:
  head/sbin/pfctl/parse.y
  head/sbin/pfctl/pfctl_altq.c
  head/sbin/pfctl/pfctl_parser.h
  head/sbin/pfctl/pfctl_qstats.c
  head/share/man/man4/altq.4
  head/sys/conf/files
  head/sys/conf/options
  head/sys/net/altq/altq.h
  head/sys/net/altq/altq_cbq.c
  head/sys/net/altq/altq_cbq.h
  head/sys/net/altq/altq_classq.h
  head/sys/net/altq/altq_fairq.c
  head/sys/net/altq/altq_fairq.h
  head/sys/net/altq/altq_hfsc.c
  head/sys/net/altq/altq_hfsc.h
  head/sys/net/altq/altq_priq.c
  head/sys/net/altq/altq_priq.h
  head/sys/net/altq/altq_rmclass.c
  head/sys/net/altq/altq_rmclass.h
  head/sys/net/altq/altq_subr.c
  head/sys/net/altq/altq_var.h
  head/sys/netpfil/pf/pf_altq.h

Modified: head/sbin/pfctl/parse.y
==
--- head/sbin/pfctl/parse.y Fri Aug 21 21:47:29 2015(r287008)
+++ head/sbin/pfctl/parse.y Fri Aug 21 22:02:22 2015(r287009)
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -299,7 +300,7 @@ struct pool_opts {
 
 } pool_opts;
 
-
+struct codel_opts   codel_opts;
 struct node_hfsc_opts   hfsc_opts;
 struct node_fairq_opts  fairq_opts;
 struct node_state_opt  *keep_state_defaults = NULL;
@@ -425,6 +426,7 @@ typedef struct {
struct pool_opts pool_opts;
struct node_hfsc_optshfsc_opts;
struct node_fairq_opts   fairq_opts;
+   struct codel_optscodel_opts;
} v;
int lineno;
 } YYSTYPE;
@@ -449,8 +451,8 @@ int parseport(char *, struct range *r, i
 %token REQUIREORDER SYNPROXY FINGERPRINTS NOSYNC DEBUG SKIP HOSTID
 %token ANTISPOOF FOR INCLUDE
 %token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY
-%token ALTQ CBQ PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME UPPERLIMIT
-%token QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE
+%token ALTQ CBQ CODEL PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME
+%token UPPERLIMIT QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE TARGET INTERVAL
 %token LOAD RULESET_OPTIMIZATION
 %token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE
 %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY
@@ -499,6 +501,7 @@ int parseport(char *, struct range *r, i
 %typepriqflags_list priqflags_item
 %type hfscopts_list hfscopts_item hfsc_opts
 %typefairqopts_list fairqopts_item fairq_opts
+%typecodelopts_list codelopts_item codel_opts
 %type  bandwidth
 %type   filter_opts filter_opt filter_opts_l
 %typeantispoof_opts antispoof_opt antispoof_opts_l
@@ -1470,7 +1473,7 @@ altqif: ALTQ interface queue_opts QUEU
a.scheduler = $3.scheduler.qtype;
a.qlimit = $3.qlimit;
a.tbrsize = $3.tbrsize;
-   if ($5 == NULL) {
+   if ($5 == NULL && $3.scheduler.qtype != ALTQT_CODEL) {
yyerror("no child queues specified");
YYERROR;
}
@@ -1672,6 +1675,15 @@ scheduler: CBQ   {
$$.qtype = ALTQT_FAIRQ;
$$.data.fairq_opts = $3;
}
+   | CODEL {
+   $$.qtype = ALTQT_CODEL;
+   bzero(&$$.data.codel_opts,
+   sizeof(struct codel_opts));
+   }
+   | CODEL '(' codel_opts ')'  {
+   $$.qtype = ALTQT_CODEL;
+   $$.data.codel_opts = $3;
+   }
;
 
 cbqflags_list  : cbqflags_item { $$ |= $1; }
@@ -1689,6 +1701,8 @@ cbqflags_item : STRING{
$$ = CBQCLF_RED|CBQCLF_ECN;
else if (!strcmp($1, "rio"))
$$ = CBQCLF_RIO;
+   else if (!strcmp($1, "codel"))
+   $$ = CBQCLF_CODEL;
else {
yyerror("unknown cbq flag \"%

svn commit: r287011 - head/sys/powerpc/mpc85xx

2015-08-21 Thread Justin Hibbits
Author: jhibbits
Date: Sat Aug 22 03:29:12 2015
New Revision: 287011
URL: https://svnweb.freebsd.org/changeset/base/287011

Log:
  Make the mpc85xx platform a kobj base class.
  
  Summary:
  Some systems are based around mpc85xx, but need special initialization.  By
  making the mpc85xx platform a base class, these systems can be platform
  subclasses, and perform board-specific initialization in addition to the 
mpc85xx
  initialization.
  
  Test Plan:
  Tested on my RB800.  A platform class was created, and will be committed
  separately.
  
  Reviewed By: nwhitehorn
  Differential Revision: https://reviews.freebsd.org/D3305

Modified:
  head/sys/powerpc/mpc85xx/mpc85xx.h
  head/sys/powerpc/mpc85xx/platform_mpc85xx.c

Modified: head/sys/powerpc/mpc85xx/mpc85xx.h
==
--- head/sys/powerpc/mpc85xx/mpc85xx.h  Sat Aug 22 00:47:05 2015
(r287010)
+++ head/sys/powerpc/mpc85xx/mpc85xx.h  Sat Aug 22 03:29:12 2015
(r287011)
@@ -30,6 +30,8 @@
 #ifndef _MPC85XX_H_
 #define _MPC85XX_H_
 
+#include 
+
 /*
  * Configuration control and status registers
  */
@@ -84,4 +86,7 @@ int law_disable(int trgt, u_long addr, u
 int law_getmax(void);
 int law_pci_target(struct resource *, int *, int *);
 
+DECLARE_CLASS(mpc85xx_platform);
+int mpc85xx_attach(platform_t);
+
 #endif /* _MPC85XX_H_ */

Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c
==
--- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Aug 22 00:47:05 2015
(r287010)
+++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Aug 22 03:29:12 2015
(r287011)
@@ -71,7 +71,6 @@ vm_offset_t ccsrbar_va;
 static int cpu, maxcpu;
 
 static int mpc85xx_probe(platform_t);
-static int mpc85xx_attach(platform_t);
 static void mpc85xx_mem_regions(platform_t, struct mem_region *phys,
 int *physsz, struct mem_region *avail, int *availsz);
 static u_long mpc85xx_timebase_freq(platform_t, struct cpuref *cpuref);
@@ -98,11 +97,7 @@ static platform_method_t mpc85xx_methods
PLATFORMMETHOD_END
 };
 
-static platform_def_t mpc85xx_platform = {
-   "mpc85xx",
-   mpc85xx_methods,
-   0
-};
+DEFINE_CLASS_0(mpc85xx, mpc85xx_platform, mpc85xx_methods, 0);
 
 PLATFORM_DEF(mpc85xx_platform);
 
@@ -117,7 +112,7 @@ mpc85xx_probe(platform_t plat)
return (ENXIO);
 }
 
-static int
+int
 mpc85xx_attach(platform_t plat)
 {
phandle_t cpus, child, ccsr;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r287012 - in head/bin/pkill: . tests

2015-08-21 Thread Jamie Gritton
Author: jamie
Date: Sat Aug 22 05:04:36 2015
New Revision: 287012
URL: https://svnweb.freebsd.org/changeset/base/287012

Log:
  Make pkill/pgrep -j ARG take jname, not just jid.
  
  PR:   201588
  Submitted by: Daniel Shahaf 
  MFC after:3 days

Modified:
  head/bin/pkill/Makefile
  head/bin/pkill/Makefile.depend
  head/bin/pkill/pkill.1
  head/bin/pkill/pkill.c
  head/bin/pkill/tests/pgrep-j_test.sh
  head/bin/pkill/tests/pkill-j_test.sh

Modified: head/bin/pkill/Makefile
==
--- head/bin/pkill/Makefile Sat Aug 22 03:29:12 2015(r287011)
+++ head/bin/pkill/Makefile Sat Aug 22 05:04:36 2015(r287012)
@@ -5,7 +5,7 @@
 
 PROG=  pkill
 
-LIBADD=kvm
+LIBADD=kvm jail
 
 LINKS= ${BINDIR}/pkill ${BINDIR}/pgrep
 MLINKS=pkill.1 pgrep.1

Modified: head/bin/pkill/Makefile.depend
==
--- head/bin/pkill/Makefile.depend  Sat Aug 22 03:29:12 2015
(r287011)
+++ head/bin/pkill/Makefile.depend  Sat Aug 22 05:04:36 2015
(r287012)
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+   lib/libjail \
lib/libkvm \
 
 

Modified: head/bin/pkill/pkill.1
==
--- head/bin/pkill/pkill.1  Sat Aug 22 03:29:12 2015(r287011)
+++ head/bin/pkill/pkill.1  Sat Aug 22 05:04:36 2015(r287012)
@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 9, 2013
+.Dd August 21, 2015
 .Dt PKILL 1
 .Os
 .Sh NAME
@@ -47,7 +47,7 @@
 .Op Fl c Ar class
 .Op Fl d Ar delim
 .Op Fl g Ar pgrp
-.Op Fl j Ar jid
+.Op Fl j Ar jail
 .Op Fl s Ar sid
 .Op Fl t Ar tty
 .Op Fl u Ar euid
@@ -63,7 +63,7 @@
 .Op Fl U Ar uid
 .Op Fl c Ar class
 .Op Fl g Ar pgrp
-.Op Fl j Ar jid
+.Op Fl j Ar jail
 .Op Fl s Ar sid
 .Op Fl t Ar tty
 .Op Fl u Ar euid
@@ -149,16 +149,16 @@ or
 command.
 .It Fl i
 Ignore case distinctions in both the process table and the supplied pattern.
-.It Fl j Ar jid
-Restrict matches to processes inside jails with a jail ID in the 
comma-separated
-list
-.Ar jid .
-The value
+.It Fl j Ar jail
+Restrict matches to processes inside the specified jails.
+The argument
+.Ar jail
+may be
 .Dq Li any
-matches processes in any jail.
-The value
+to match processes in any jail,
 .Dq Li none
-matches processes not in jail.
+to match processes not in jail,
+or a comma-separated list of jail IDs or names.
 .It Fl l
 Long output.
 For

Modified: head/bin/pkill/pkill.c
==
--- head/bin/pkill/pkill.c  Sat Aug 22 03:29:12 2015(r287011)
+++ head/bin/pkill/pkill.c  Sat Aug 22 05:04:36 2015(r287012)
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #defineSTATUS_MATCH0
 #defineSTATUS_NOMATCH  1
@@ -78,7 +79,7 @@ enum listtype {
LT_GROUP,
LT_TTY,
LT_PGRP,
-   LT_JID,
+   LT_JAIL,
LT_SID,
LT_CLASS
 };
@@ -245,7 +246,7 @@ main(int argc, char **argv)
cflags |= REG_ICASE;
break;
case 'j':
-   makelist(&jidlist, LT_JID, optarg);
+   makelist(&jidlist, LT_JAIL, optarg);
criteria = 1;
break;
case 'l':
@@ -585,7 +586,7 @@ usage(void)
 
fprintf(stderr,
"usage: %s %s [-F pidfile] [-G gid] [-M core] [-N system]\n"
-   " [-P ppid] [-U uid] [-c class] [-g pgrp] [-j 
jid]\n"
+   " [-P ppid] [-U uid] [-c class] [-g pgrp] [-j 
jail]\n"
" [-s sid] [-t tty] [-u euid] pattern ...\n",
getprogname(), ustr);
 
@@ -700,7 +701,7 @@ makelist(struct listhead *head, enum lis
if (li->li_number == 0)
li->li_number = getsid(mypid);
break;
-   case LT_JID:
+   case LT_JAIL:
if (li->li_number < 0)
errx(STATUS_BADUSAGE,
 "Negative jail ID `%s'", sp);
@@ -766,15 +767,20 @@ foundtty: if ((st.st_mode & S_IFCHR) ==
 
li->li_number = st.st_rdev;
break;
-   case LT_JID:
+   case LT_JAIL: {
+   int jid;
+
if (strcmp(sp, "none") == 0)
li->li_number = 0;
else if (strcmp(sp, "any") == 0)
li->li_numbe

svn commit: r287013 - in head/sys: conf dev/fdt geom powerpc/mikrotik sys

2015-08-21 Thread Justin Hibbits
Author: jhibbits
Date: Sat Aug 22 05:50:18 2015
New Revision: 287013
URL: https://svnweb.freebsd.org/changeset/base/287013

Log:
  Create a RouterBoard platform and use it to create a flash map
  
  Summary:
  The RouterBoard uses a predefined partition map which doesn't exist in the 
fdt.
  This change allows overriding the fdt slicer with a custom slicer, and uses 
this
  custom slicer to define the flash map on the RouterBoard RB800.
  D3305 converts the mpc85xx platform into a base class, so that systems based 
on
  the mpc85xx platform can add their own overrides.  This change builds on 
D3305,
  and creates a RouterBoard (RB800) platform to initialize the slicer override.
  
  Reviewed By: nwhitehorn, imp
  Differential Revision: https://reviews.freebsd.org/D3345

Added:
  head/sys/powerpc/mikrotik/
  head/sys/powerpc/mikrotik/platform_rb.c   (contents, props changed)
Modified:
  head/sys/conf/files.powerpc
  head/sys/conf/options.powerpc
  head/sys/dev/fdt/fdt_slicer.c
  head/sys/geom/geom_flashmap.c
  head/sys/sys/slicer.h

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Sat Aug 22 05:04:36 2015(r287012)
+++ head/sys/conf/files.powerpc Sat Aug 22 05:50:18 2015(r287013)
@@ -129,6 +129,7 @@ powerpc/mambo/mambocall.S   optionalmambo
 powerpc/mambo/mambo.c  optionalmambo
 powerpc/mambo/mambo_console.c  optionalmambo
 powerpc/mambo/mambo_disk.c optionalmambo
+powerpc/mikrotik/platform_rb.c optionalmikrotik
 powerpc/mpc85xx/atpic.coptionalmpc85xx isa
 powerpc/mpc85xx/ds1553_bus_fdt.c   optionalds1553 fdt
 powerpc/mpc85xx/ds1553_core.c  optionalds1553

Modified: head/sys/conf/options.powerpc
==
--- head/sys/conf/options.powerpc   Sat Aug 22 05:04:36 2015
(r287012)
+++ head/sys/conf/options.powerpc   Sat Aug 22 05:50:18 2015
(r287013)
@@ -32,3 +32,4 @@ OFWCONS_POLL_HZ   opt_ofw.h
 # AGP debugging support
 AGP_DEBUG  opt_agp.h
 
+MIKROTIK

Modified: head/sys/dev/fdt/fdt_slicer.c
==
--- head/sys/dev/fdt/fdt_slicer.c   Sat Aug 22 05:04:36 2015
(r287012)
+++ head/sys/dev/fdt/fdt_slicer.c   Sat Aug 22 05:50:18 2015
(r287013)
@@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
 #endif
 
 int
-flash_fill_slices(device_t dev, struct flash_slice *slices, int *slices_num)
+fdt_flash_fill_slices(device_t dev, struct flash_slice *slices, int 
*slices_num)
 {
char *slice_name;
phandle_t dt_node, dt_child;

Modified: head/sys/geom/geom_flashmap.c
==
--- head/sys/geom/geom_flashmap.c   Sat Aug 22 05:04:36 2015
(r287012)
+++ head/sys/geom/geom_flashmap.c   Sat Aug 22 05:50:18 2015
(r287013)
@@ -70,6 +70,8 @@ static struct g_geom *g_flashmap_taste(s
 static void g_flashmap_config(struct gctl_req *, struct g_class *,
 const char *);
 static int g_flashmap_load(device_t, struct g_flashmap_head *);
+static int (*flash_fill_slices)(device_t, struct flash_slice *, int *) =
+fdt_flash_fill_slices;
 
 MALLOC_DECLARE(M_FLASHMAP);
 MALLOC_DEFINE(M_FLASHMAP, "geom_flashmap", "GEOM flash memory slicer class");
@@ -230,7 +232,8 @@ g_flashmap_load(device_t dev, struct g_f
 
buf_size = sizeof(struct flash_slice) * FLASH_SLICES_MAX_NUM;
slices = malloc(buf_size, M_FLASHMAP, M_WAITOK | M_ZERO);
-   if (flash_fill_slices(dev, slices, &nslices) == 0) {
+   if (flash_fill_slices &&
+   flash_fill_slices(dev, slices, &nslices) == 0) {
for (i = 0; i < nslices; i++) {
slice = malloc(sizeof(struct g_flashmap_slice),
M_FLASHMAP, M_WAITOK);
@@ -247,6 +250,12 @@ g_flashmap_load(device_t dev, struct g_f
return (nslices);
 }
 
+void flash_register_slicer(int (*slicer)(device_t, struct flash_slice *, int 
*))
+{
+
+   flash_fill_slices = slicer;
+}
+
 static struct g_class g_flashmap_class = {
.name = FLASHMAP_CLASS_NAME,
.version = G_VERSION,

Added: head/sys/powerpc/mikrotik/platform_rb.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/powerpc/mikrotik/platform_rb.c Sat Aug 22 05:50:18 2015
(r287013)
@@ -0,0 +1,123 @@
+/*-
+ * Copyright (c) 2015 Justin Hibbits
+ * 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 fo